ITPub博客

首页 > 数据库 > Oracle > OAF View Object Extension

OAF View Object Extension

Oracle 作者:贾三灌汤包 时间:2014-04-03 14:35:56 0 删除 编辑

Our business requirement is to add ‘Voucher Number’, ‘Invoice Pay Group’ and ‘Pay Alone Flag’ on the seeded ‘Invoice Approval Notification’ page.    Snap1_OAFV

Analyzing the Page

click on “About this Page” link to check , which View Object is associated with the message component layout [region4]

Snap2_OAFV

Here we can see that message component layout (region 4) has ApInvoiceHeaderVO attached to it. Now click on ‘Business Component References details’ and check the path of ApInvoiceHeaderVO.

Snap4_OAFV

Now, click on ApInvoiceHeaderVO which is an EO based [ApInvoicesAllEO] to check whether it has the additional attributes that need to be added                                                                                 

Snap5_OAFV

Here we can see that our VO does not have the attributes – ‘Voucher Number’, ‘Invoice Pay Group’ and ‘Pay Alone Flag’.

So for adding these attribute we need to perform VO Extension.

Now FTP the complete solution package (i.e. oracle.apps.ap) from Application server into myprojects\oracle\apps\ folder.

Open Jdeveloper and create a new OA workspace and project. (Enter the following at each step of the Oracle Application Project Wizard):
Step1: Name workspace as AOAInvNotifEx.jws and the project as AOAInvNotifEx.jpr.
Step2: Check the box for ‘Use Repository for Design Time’ and select the Database connection in use.
Step3: Provide the necessary details:
DBC File Name :
User Name:
Password:
Application Short Name: < Application_Short_Name >
Responsibility Key:

Now right click on AOAInvNotifEx project to open project properties –>Project Content –>Add to include the standard VO package in current project.                                                                      

Snap6_OAFV

After adding BC4J package i.e. oracle.apps.ap the project looks like                                               

Snap7_OAFV

Creating New View Object (VO): -

Right click on your project and select New–>Adf business Components–>View Object

Snap8_OAFV

Give the package name as ‘aoa.oracle.apps.ap.invoice.request.negotiation.server’, VO name as ‘AOAApInvoiceHeaderVOEx’ and in the extends property select ‘ApInvoiceHeaderVO’                   

Snap9_OAFV

The next screen allows the addition or deletion of Entity Objects. No change is required here for this extension so simply select ‘Next’.
The next pane allows additional attributes to be added or attributes to be removed. In this case add ‘Voucher Num’, ‘Pay Group Lookup Code’ and ‘Exclusive Payment Flag’ attributes to the selected list.

Note 1: On adding the first field we receive the following message:                                                   

Snap10_OAFV

Click on ‘OK’ and continue adding the remaining fields.

Note 2: The new attribute you would be adding will be ‘Transient‘

Snap11_OAFV

Click on Next

Since our attributes are created as Transient, to fix this issue follow the below steps:

At step 4 of the VO creation Wizard:
Select the newly added attribute – ‘VoucherNum’
Check the box: Mapped to column or SQL
Provide the alias name in the ‘Expression’ field.
(Repeat the above steps for the attributes – ‘Pay Group Lookup Code’ and ‘Exclusive Payment Flag’ as well).                                                                                                                                

Snap12_OAFV

Modify your sql statement to add new created attributes                         

Snap13_OAFV

Click on next – >Next
Generate RowImpl and click on finish
Now verify that the newly created attributes are not transient:

Snap14_OAFV

Add the new VO (AOAExApInvoiceHeaderVO) to the main Application Module (The AM to which the parent VO (ApInvoiceHeaderVO) has been attached). Also Rename the instance name from ‘AOAExApInvoiceHeaderVO1’ to ‘AOAExApInvoiceHeaderVO’.                                                          Snap15_OAFV

 

 Substitute Your New VO for the Parent VO

Now we need to perform the VO substitution For this we will right click on AOAInvNotifEx project and open project properties–>Business Components–>Substitutions.
Select the ‘ApInvoiceHeaderVO’ in ‘Available’ and ‘AOAExApInvoiceHeaderVO’ in ‘Substitute’ list and click on Add button and then press Ok button.                                                                       

Snap16_OAFV

FTP VO.xml, .class, and the AM.xml, .class files to the respective directories in $JAVA_TOP
(note: FTP the .java files of the VO and AM and compile the files on the server using the ‘javac’ command if the .java file do not compile successfully on ‘JDeveloper’).

Now Import the ‘Substitution’ from the local machine using the following command:

jpximport C:\JDeveloper\jdevhome\jdev\myprojects\ AOAInvNotifEx.jpx -username -password -dbconnection “(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=))(CONNECT_DATA=(SID=)))”

(Run the above command from ‘Command Prompt’)

Personalize the page to create new items:-

On InvPoReqNegoPG, click on personalize page –> complete view –> Expand All, and click on Create Item on Message Component Layout: (region4)                                                               

Snap17_OAFV

Set the item style as messageStyledText. Give the id, CSS Class, prompt , View Instance and View Attribute.                                                                                                                                            

Snap18-1_OAFV

Snap18-2_OAFV

Create two items for ‘Pay Group Lookup Code’ and ‘Exclusive Payment Flag’ following the above steps.
Click on Apply -> return to application. You can notice that the page has the three columns.    

Snap19_OAFV

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/22816976/viewspace-1135412/,如需转载,请注明出处,否则将追究法律责任。

下一篇: Workflow Tables
请登录后发表评论 登录
全部评论

注册时间:2009-11-03

  • 博文量
    128
  • 访问量
    222366