Posts

Showing posts from August, 2018

Developing a Pre-populate and process task adapter in OIM 11G R2 PS3

Image
Prepopulate adapter: Step 1: class should have public method which returns some value Example: public class CommonName { public String getCommonName(String firstName,String lastName){ return firstName+", "+lastName; } } Build a Jar file by exporting the class using Eclipse and copy the jar to oim server location /opt/apps/oracle/Oracle/Middleware/Oracle_IDM/server/JavaTasks the above path varies project to project Step 2: Upload jar to server using command utility Navigate to UploadJars.sh file path location(use locate -i UploadJars.sh) Example Location: /opt/apps/oracle/Oracle/Middleware/Oracle_IDM/server/bin Run below command(Export paths if required) ./UploadJars.sh Provide xelsysadm username and password t3://HOSTNAME:14000 Select Jar type as JavaTasks(option 1) Provide complete Jar path example: /opt/apps/oracle/Oracle/Middleware/Oracle_IDM/server/JavaTasks/CommonNameGenerator.jar Do purge cache using bel...

Export full MDS in OIM using WLST Command

1. Create a folder where we want to export all existing MDS files (Ex. /opt/apps/oracle/MDS Backup/) 2. Navigate to OIM_ORACLE_HOME/common/bin (ex: /opt/apps/oracle/Oracle/Middleware/Oracle_IDM/common/bin) folder and execute below commands a. ./wlst.sh b. connect() (Enter weblogic credentials when prompted. Note: provide actual hostnames wherever necessary t3://HOSTNAME:7001 ) c. exportMetadata(application='OIMMetadata', server='oim_server', toLocation='/opt/apps/oracle/MDS Backup/’) (Note: Make sure application, server details are according to document Make sure location is referred to the one which was created in step 1)

Creating JDBC connection to Oracle Database using Java code

Below is the java code to create connection to database External Jar required: ojdbc6-11.2.0.3.jar  public Connection getJDBConnection(){         String methodName = "getJDBConnection";         logger.setMethodStartLog(className, methodName);               String jdbcDriver = "oracle.jdbc.OracleDriver";         String dbUrl = "jdbc:oracle:thin:@HOSTNAME:1521:IDMDEV1";         String username = "USERNAME";         String password = "PASSWORD";         try { Class.forName(jdbcDriver); jdbcConnection = DriverManager.getConnection(dbUrl,username,password); } catch (ClassNotFoundException | SQLException e) { e.printStackTrace(); }                   logger.setMethodFinishLog(className, methodName);         return jdbcC...

How to develop a Scheduler in OIM

Image
Below steps help us in developing a new Scheduler in OIM 11G R2 PS3. Create a new Java project in Eclipse and add external jars from design console(you can add whatever Jars required for your scheduler) Create a new class which extends oracle.iam.scheduler.vo.TaskSupport as super class Write your business logic in Execute method Below is the basic structure of the Scheduler package com.ghr; import java.util.HashMap; import oracle.iam.scheduler.vo.TaskSupport; public class UpdateTCADRemovalDate extends TaskSupport { @Override public void execute(HashMap taskparams) throws Exception { // TODO Auto-generated method stub } @Override public HashMap getAttributes() { // TODO Auto-generated method stub return null; } @Override public void setAttributes() { // TODO Auto-generated method stub } } 3. Reading Task input parameters All the task input parameters available in taskparams variable which is of...

Read data from Excel Sheet using Java Code

Image
In this post lets write code to read data from excel sheet my excel sheet looks like below Output: Jars Required: Java code: package com.ghr; import java.io.FileInputStream; import java.io.InputStream; import java.util.ArrayList; import java.util.HashMap; import org.apache.poi.xssf.usermodel.XSSFSheet; import org.apache.poi.xssf.usermodel.XSSFWorkbook; public class ReadExcelBook { public static void main(String[] args) { //file path and sheetname ArrayList<HashMap<String,String>> data = readExcelSheet("C:\\Users\\ravi.kumar.honnappa\\Desktop\\IdM AMS Monitoring Code\\myExcelFile.xlsx","userInfo"); System.out.println("Data in the Excel sheet is: "+data); } public static ArrayList<HashMap<String,String>> readExcelSheet(String filePath, String sheetName){ ArrayList<HashMap<String,String>> excelData = new ArrayList<HashMap<String,String>>()...

Reading values from properties file using JAVA code

Image
In this post lets write code to read values from properties file Example my properties file (mypropertyFile.properties) contain below data Java output: Code to read this properties file package com.ghr; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.util.Properties; public class ReadProp { public static void main(String[] args) { Properties prop = getPropertiesFile("C:\\Users\\ravikumar\\Desktop\\mypropertyFile.properties"); String name = prop.getProperty("name"); System.out.println("Name: "+name); String email = prop.getProperty("email"); System.out.println("Email: "+email); } /** * Reading properties file and storing in prop object * * @param propertiesFilePath * @return */ public static Properties getPropertiesFile(String propertiesFilePath) { Properties prop = new Properties();         InputStream in; ...