Wednesday, June 23, 2010

How to Extend View Object in OAF?

1. Identify the VO to be extended.

This is the first thing that you have to determine.
Suppose you want to add address field to the following page:


Then you will go to "About this Page" link and find out the VO associated to this region.
In our case we will extend EmloyeeFullVO.



2. Create new workspace and new project.
Now go to JDeveloper and create new workspace and a new project.
Add the server.xml of the package where the VO to be extended is present to your . This will add complete package in your new project.
Add any other dependent packages if required.


3. In the new project create a new Business Component with default package as xxx.oracle.apps..... xxx being your identifier.
In our case we have taken xxx as xtendEmp.

4. Import the Business Component in which the VO to be extended is present. And import any other dependent component if required.

5. Create a new VO in the newly created package extending the VO to be extended.
Create a new VO with the additional address description field along with all the existing fields in the base VO.
This new VO should extend the base VO.



6. Click on .jpx and add the substitution.
In our case click on newEmp.jpx and add the substitution.


7. Upload the .jpx to the DB

Ex. java oracle.jrad.tools.xml.importer.JPXImporter TestXtend.jpx -username apps -password apps -dbconnection "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=RWS60040REMS.US.ORACLE.COM)(PORT=1548))(CONNECT_DATA=(SID=HG0DV102)))"

While running the above command make sure that oracle.jrad.tools.xml.importer.JPXImporter is present in classpath.

8. Upload the .java and .xml files to the instance.
Either upload the .java and .xml files to the instance directly or create a jar file and add the jar file as first element in the classpath.
In our case we have created a jar file and placed in the classpath.

9. Bounce the Apache server.

10
. Create a new item on the page through personalization and attach the new field added it.
Now go back the screen where we wanted to add Address Description field.
Click on personaliza the link. And click on create item icon under the desired region.
Create the new Address item. Provide all properties:
ID -- Address
Data Type -- Varchar2
Prompt -- Address Description
CSS Style -- OraDataText
View Attribute -- Description (Be careful its case sensitive. Its should exactly same as you created in new VO)
View Instance -- EmployeeFullVO1 (VO instance name of base VO)




Thanks,
Agry

No comments:

Post a Comment