Tuesday, October 11, 2011

Simple VO extension in OA Frame works

Requirement

To change a seeded LOV by adding additional condition .

Procedure

1) FTP all the required files into local machine and open in jdeveloper after doing the necessary setups.

2) Identify the VO of the seeded LOV to be extended.

3) Create a new VO by rt.clicking on the package.




4) Extend the original VO while creating this new VO


5) Upon clicking next, enter the SQL query, the query which is designed by you to incorporate the new condition.

6) Click on option  to generate the row level java files  and Finish.


7) The newly created VO will look like below:




8) Now we need to substitute the newly created VO for the original VO. For that rt.click on project and  click on 'Edit Business Components Project'.



9) Go to substitutions



10) On the LHS select the VO being substituted and the newVO on the RHS and 'Add'.












11) A new jpx file wold be created as below


12) Now run the Pages in the Jdeveloper and see whether the LOV is modified.


Procedure to move to Server


The newly created VO and the jpx file need to be moved to server to reflect the same in the instance.


1) Move the VO files i.e. <newvo>.xml and <newvo>Rowimpl.java files from myclasses to the  respective location in the server.


2) To move the jpx file using the cmd, go to the following path of the jdeveloper



3) Use the following command

jpximport.bat D:\JDEVELOPER9i\jdevbin\jdev\myclasses\TravelProjecttemp.jpx -username apps -password <pwd> -dbconnection "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=<host>)(Port=<port>)) (CONNECT_DATA=(SID=<sid>)))"

4) This will import the jpx file into the DB. And you will get a message as shown below:


After this bounce the apache and the change will be reflected in the instance.

Some general Info

Whenever we create any substitution, it creates a new document for that substitution. The document can be viewed as below in Toad by enabling DBMS Output:

begin
jdr_utils.printdocument('/msft/oracle/apps/per/travelinfo/server/customizations/site/0/ApprovedbyVO');
end;

 The out put will be as follows:

<?xml version='1.0' encoding='UTF-8'?>
<customization xmlns="http://xmlns.oracle.com/jrad" xmlns:ui="http://xmlns.oracle.com/uix/ui" xmlns:oa="http://xmlns.oracle.com/oa" xmlns:user="http://xmlns.oracle.com/user" version="9.0.3.8.13_1550" xml:lang="en-US"
               customizes="/msft/oracle/apps/per/travelinfo/server/ApprovedbyVO">
   <replace with="/msft/oracle/apps/per/travelinfo/server/ApprovedbytempVO"/>
</customization>

Procedure to delete the VO extension

To delete the VO extension we just need to run the following script:


begin
jdr_utils.deletedocument('/msft/oracle/apps/per/travelinfo/server/customizations/site/0/ApprovedbyVO');
end;


 Commit;

Please do not forget to COMMIT.