Powered By Blogger

Sunday, July 25, 2010

Displaying Employee Photo on the Approval Page

I tried displaying it on Workflow page but the way to display it is downloading the photo on application server and setting that in the property of Image item programatically.So what i did is i added a button on the workflow page and when user clicks on this button then system will display the photo on a diiferent page.
Following steps need to done to achieve the same:-
1) Add a new item on the page

2) Set the properies as shown below:-


3) To open the photo in different page set the Target Frame as _blank 
4) In destination URL put OA.jsp?page=/oracle/apps/xxekk/approval/webui/xxEmpPhotoPG&akRegionApplicationId=800
5) Put the logic in controller file to fetch photo from database and display it on the page.

SIT Validations

There are 2 ways of putting validation in SIT.
1) Write the validation logic in Api Hooks provided for hr_sit_api Api. This validation will be fired when user will try to enter data in SIT using Forms or Self service.
2) Another way of putting validation on self service page is writing a controller and attaching this controller to SIT self service page using personalization.

Here is the detail steps to acheive validation using personalization:-
1) Create a controller file SITCO which wil extend standard oracle controller SitUpdateCO

// Source File Name: SITCO.java

package oracle.apps.per.selfservice.specialinformation.webui;

import java.sql.Connection;
import java.sql.SQLException;
import oracle.apps.fnd.common.VersionInfo;
import oracle.apps.fnd.flexj.KeyFlexfield;
import oracle.apps.fnd.flexj.Segment;
import oracle.apps.fnd.framework.OAApplicationModule;
import oracle.apps.fnd.framework.OAException;
import oracle.apps.fnd.framework.server.OADBTransaction;
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
import oracle.apps.fnd.framework.webui.beans.OAKeyFlexBean;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import oracle.apps.per.selfservice.common.SSHRParams;
import oracle.jdbc.driver.OracleCallableStatement;
import oracle.sql.ARRAY;
import oracle.sql.ArrayDescriptor;


public class SITCO extends SitUpdateCO

{

public SITCO()
{

}
public void processRequest(OAPageContext pageContext, OAWebBean webBean)
{
   super.processRequest(pageContext, webBean);
}

public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
{

       if(pageContext.getParameter("HrNext") != null)

     {

        String s = null;

        OAKeyFlexBean kffBean = (OAKeyFlexBean)webBean.findIndexedChildRecursive("HrSitKeyFlex");

        KeyFlexfield keyflexfield = (KeyFlexfield)kffBean.getAttributeValue
                                                     (OAWebBeanConstants.FLEXFIELD_REFERENCE);

        String s_struc_code = keyflexfield.getStructureCode();

        String str[] = new String[30];

       for(int i = 0; i < 10; i++)

       try

     {

        str[i] = keyflexfield.getSegment(i).getInputValue();

      }
      catch(Exception e)

    {
          str[i] = null;
    }
     OAApplicationModule am = pageContext.getRootApplicationModule();
     Connection connection = am.getOADBTransaction().getJdbcConnection();
     String v_message = null;
     Integer s_prsn = new Integer(pageContext.getEmployeeId());
     SSHRParams sshrparams = new SSHRParams(am.getOADBTransaction());
     String v_emp_id = sshrparams.getPersonId();
     sshrparams.setProfiles();
    String v_person_id = s_prsn.toString();

   try
 {

   ArrayDescriptor segvaldesc = ArrayDescriptor.createDescriptor("SEGMENT_VALUES", connection);

   ARRAY segval = new ARRAY(segvaldesc, connection, str);

  OracleCallableStatement ocs = (OracleCallableStatement)connection.prepareCall("Begin  
   XXHR_SIT_VALIDATION_PKG.VALIDATE_RECORD 
  (p_sit_code=>:1,p_segment=>:2,p_person_id=>:3,p_employee_id=>:4,p_message=>:5); end;");

  ocs.setString(1, s_struc_code);
  ocs.setARRAY(2, segval);
  ocs.setString(3, v_person_id);
  ocs.setString(4, v_emp_id);
  ocs.registerOutParameter(5, 12);
  ocs.execute();

  v_message = ocs.getString(5);
  ocs.close();
 }
catch(SQLException sqlexception)
{
throw new OAException("Error " + sqlexception.getMessage(), (byte)2);
}

if(v_message != null)
throw new OAException(v_message, OAException.ERROR);
super.processFormRequest(pageContext, webBean);
} else
{
super.processFormRequest(pageContext, webBean);
}
}
public static final String RCS_ID = "$Header$";
public static final boolean RCS_ID_RECORDED = VersionInfo.recordClassVersion("$Header$", "%packagename%");
}

2) Login to oracle application and click on personalize link on SIT data entry page.
3) Select Complete view and then against Default Single Column: Special Information click the personlize link
4) Enter oracle.apps.per.selfservice.specialinformation.webui.SITCO  for Controller class as shown below:-

5) Now create a package named XXHR_SIT_VALIDATION_PKG and put a function in it called VALIDATE_RECORD (p_sit_code varchar2,p_segment SEGMENT_VALUES,p_person_id  number,p_employee_id number ,p_message varchar2);
6) Structure of this package will be somewhat shown below:-

Create or replace package body XXHR_SIT_VALIDATION_PKG as

function VALIDATE_RECORD (p_sit_code varchar2,p_segment SEGMENT_VALUES,p_person_id number,p_employee_id number ,p_message varchar2) as

begin

if p_sit_code varchar2 = then
  if p_segment(1)= then
     your code here
  end if;
elsif p_sit_code varchar2 = then



end if;

exception
  when others then 
   -----

end;

end;


Saturday, July 24, 2010

Oracle Data Integrator


1) Click on Master Repository Creation to create a new master repository.

2) Select Oracle driver for driver field and then enter the connection url.

3) Enter the user name and password. For master repository I created a new schema called XXODI_MST.

4) Click OK. You will get Successful Creation message.


5) Go to Start->Oracle->Oracle Data Integrator->Topology Manager

6) A small window will open. Click on new icon.

7) Login Name : Enter “Master Repository”

User : Supervisor

Password: SUNOPSIS

User: XXODI_MST

Pwd: XXODI_MST

Driver : Oracle JDBC Driver

Driver Name: oracle.jdbc.driver.OracleDriver

Url:odbc.oracle.thin:@taylusap.oradom.ekk:1520:DEV





8) Right click on Work Repository and click on Insert Work Repository

9)Click the first tab and then expand Technologies and right click oracle and click insert data server
10) Create a Source physical data server as shown below
11) Create another data server for target data server.
12) Click on logical schema and then expand Technologies. Right click on Oracle and insert logical schema.




13) Go to ODI menu and click on Designer. Select the work repository and enter user as SUPERVISOR and password as SUNOPSIS



14) Create a new project.
15) Right click on project and click on “import Knowledge Module”
16) Select the folder impexp from ODI directory.
17) Select IKM Oracle Incremental Update and LKM SQL to SQL

18) Click on Model tab and then right click and then click on insert model folder.
19) Create a source model folder and select the values as shown below:-







20) On the Selective Reverse tab click on “Object to Reverse” and then select the table from which you want to fetch the data. Once selected then click on Reverse button




20) Similarly create Target model and select the table which you want to populate.
21) Right click on source model and select add to cdc(Changed data capture).
22) Right click on Constraint in each of the table and create a primary key. Same thing is to be done for tables in target model.
23) Click on projects and create a new interface as shown below.



24) Drag the source table and drop it in right frame as shown below. Similiarly drag the target table and drop it in Target area on the right hand side as shown below.


25) If column names in source and target are same then auto mapping will be done. Otherwise we can do manual mapping for each column in target table.
26) Click on flow tab and then click on source frame . Then select LKM SQL to SQL.
27) Then click on Target frame and select IKM Oracle Increment Update.



28) Right click on package and click on “insert Package”. Then add the interfaces to this newly created package.
29) Here we can set the sequence in which interfaces is to be executed.

30 ) Right click on package and generate the scenario.
31) Under Scenario, Scheduling option is there. Using this we can schedule the package.









32) Right click package and click on execute.
33) Go to ODI menu, click on Operator and check the status by expanding ALL Execution node