Sei sulla pagina 1di 17

Steps for OAF Application

Creating Tables in Oracle Database for OAF Pages

1. Create following tables by running scripts in Oracle Database Instance.


CREATE TABLE PERSON_DETAILS
(
PERSON_ID NUMBER NOT NULL,
FIRST_NAME VARCHAR2(50 BYTE),
LAST_NAME VARCHAR2(50 BYTE),
EMAIL VARCHAR2(100 BYTE),
STUDENT_FLAG VARCHAR2(1 BYTE),
NAME_OF_UNIVERSITY VARCHAR2(100 BYTE),
LAST_UPDATE_DATE DATE DEFAULT sysdate,
LAST_UPDATE_LOGIN INTEGER DEFAULT -1,
LAST_UPDATED_BY INTEGER DEFAULT 71690,
CREATION_DATE DATE DEFAULT sysdate,
CREATED_BY INTEGER DEFAULT 71690
)

insert into PERSON_DETAILS(person_id,first_name,last_name,email,student_flag)


values(100,’Rohan’,’Taneja’,’rohan@yahoo.com’,’N’);
insert into PERSON_DETAILS(person_id,first_name,last_name,email,student_flag)
values(101,’Anmol’,’Mishra’,’anmol@yahoo.com’,’N’);
insert into PERSON_DETAILS(person_id,first_name,last_name,email,student_flag)
values(102,’Mohini’,’Kumari’,’mohini@hotmail.com’,’N’);
insert into PERSON_DETAILS(person_id,first_name,last_name,email,student_flag)
values(103,’Vikram’,’Singh’,’vikram@indiatimes.com’,’N’);

Connecting to Database from JDeveloper Environment

1. Create a new database connection by selecting Database option under


Connections inside JDeveloper. Right click and New and follow the steps to
complete this task.

Creating Search Page

1. Create a new OAF workspace (People.jws)

2. Create a new OAF project (People.jpr)

3. Create new bc4j package (amdocs.oracle.apps.cap.people.server)

4. Create one more new bc4j package


(amdocs.oracle.apps.cap.people.schema.server)

5. Select schema package and create a new entity object for person_details table
(PersonEO)
6. Select newly created entity object (PersonEO) and create a new default view
object by right clicking on PersonEO.

7. Rename view object to (PersonVO)


Change package of PersonVO to amdocs.oracle.apps.cap.people.server

8. Create new application module by selecting PersonVO package (PersonAM) and


add one instance of VO inside AM called PersonVO1

9. Create a new OA Page (HomePG)


Jpr -> New -> Web Tier -> OA Component -> page

10. Under structure window, select region and make following changes :
a. Rename region to : MainRN
b. AM Definitation : PersonAM
c. Window Title : Search Page
d. Title : Search Page

11. Under MainRN , make following changes :


a. Create another region named : QueryRN
b. Style: query
c. Construction Mode : resultBasedSearch
d. Change all three panels to : True

12. Under QueryRN , make following changes :


a. Create another region using Region Wizard
b. Choose PersonAM and PersonVO1
c. PersonVO1 style : table
d. Select 4 first fields only
e. Every field style must be : messageStyledText

13. Under newly created region, make following changes :


a. Select PersonId and change Search Allowed to Yes
b. Sort Allowed : Ascending
c. Select Name,LastName and change Sort Allowed to Ascending

14. Search Page is complete now. Save All. Rebuild Project and Run the page with
OC4J within JDeveloper.
Adding Delete Functionality on Search Page

1. To add a delete icon in each row in search result, do the following :


a. In structure window, select PersonVO1 region
b. Create a new item with id : item1
c. Style : link
d. Under Client Action – Action Type : fireAction
e. Event : deletePerson
f. Parameters – paramPersonId : ${oa.PersonVO1.PersonId}
g. Submit : True
h. Now select item1 and add one item under item1
i. Create a new item with id : item2
j. Style : image
k. Under Visual – Image URI : deleteicon_enabled.gif from /OA_MEDIA
path

2. Add a new controller.


Select MainRN and choose “Set New Controller” option.

3. Controller name should be HomeCO under oracle.apps.cap.people.webui package

4. Add the following code inside processFormRequest() method of HomeCO

String actionInHomeScreen=pageContext.getParameter(EVENT_PARAM);
String paramPersonId=pageContext.getParameter("paramPersonId");

if(actionInHomeScreen.equals("deletePerson")){
Serializable paramDelete[]={actionInHomeScreen,paramPersonId};
OAApplicationModule am=pageContext.getAplicationModule(webBean);
am.invokeMethod("deletePersonMethod",paramDelete);
}

5. Add the following imports to HomeCO

import oracle.apps.fnd.framework.server.*;
import oracle.apps.fnd.framework.*;
import java.io;

6. Add the following method inside PersonAMImpl under PersonAM

public void deletePersonMethod(String pAction,String pPersonId){

PersonVOImpl perVO=getPersonVO1();
perVO.setRangeSize(-1);
Row row[]=perVO.getAllRowsInRange();
for(int i=0;i<row.length;i++){
PersonVORowImpl rowImpl=(PersonVORowImpl)row[i];
if(rowImpl.getPersonId().equals(pPersonId)){
rowImpl.remove();
getOADBTransaction().commit();
return;
}

}
}

7. Add the following imports to PersonAMImpl

import oracle.apps.fnd.framework.server.*;
import oracle.apps.fnd.framework.*;
import oracle.jbo.Row;
import java.io;

8. Generate a new java file called PersonVORowImpl.java


a. Select PersonVO, right click and choose Edit PersonVO
b. In the wizard, choose Java from the available options
c. Now select the checkbox to generate PersonVORowImpl java file.

9. Delete Functionality is complete now. Save All. Rebuild Project and Run the page
with OC4J within JDeveloper.

Adding Add New Person Functionality on Search Page

a- New Page to Enter Data

1. Create a new page called ManagePersonPG under oracle.apps.cap.people.webui


package
Jpr -> New -> Web Tier -> OA Component -> page

2. Inside structure window, select region1 and do the following-


a. AM Definition : PersonAM
b. Style : pageLayout
3. Under region1, create a new region using Region Wizard as follows –
a. In Step 1 of the wizard, select PersonVO1
b. In Step 2 , RegionId : PersonVO1 and Style : defaultSingleColumn
c. In Step 3 , Select from PersonId to NameOfUniversity only
d. Step 4 & 5 as it is and Finish.

4. Again select region1, create another new region with Id : region2 and Style :
messageComponentLayout
5. Now select region2, create a new region of Style : messageLayout
6. Now select the newly created region and add an item under it as follows-
a. Id: savePerson
b. Style : submitButton
c. Prompt : Commit Data

b- Link between Home Page and New Page

7. Create "Add New Person" button on HomePG.


8. Select MainRN in HomePG inside structure window.
9. Under MainRN, create a region with –
Id : region1 and
Style : messageComponentLayout
10. Under region1, create a region with Id : region2 and Style : messageLayout
11. Under region2, create an item as follows –
Style : submitButton
Prompt : Add New Person
Client Action –
Action Type : fireAction
Event : createPerson
Submit : True

12. Add following code to HomeCO inside processFormPequest() method

if(actionInHomeScreen.equals("createPerson")){

HashMap map=new HashMap();


map.put("paramPersonId",paramPersonId);
map.put("actionInHomeScreen",actionInHomeScreen);

pageContext.setForwardURL("OA.jsp?
page=/amdocs/oracle/apps/cap/people/webui/ManagePersonPG"
,null
,OAWebBeanConstants.KEEP_MENU_CONTEXT
,null
,map
,true
,OAWebBeanConstants.ADD_BREAD_CRUMB_NO
,OAWebBeanConstants.IGNORE_MESSAGES);
}

13. Do import

import com.sun.java.util.collections.HashMap;
import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
Link is Created

Code in New Page to Initialize the Fields as soon as it opens. (Create Page)

14. Create a controller for ManagePersonPG page.


15. Select region1 then right click and choose “Set New Controller” with name as
ManagePersonCO under oracle.apps.ak.person.webui package.
16. Add the following code inside processRequest() method

String actionInHomeScreen = pageContext.getParameter("actionInHomeScreen");


String paramPersonId = pageContext.getParameter("paramPersonId");

OAApplicationModule am = pageContext.getApplicationModule(webBean);
Serializable paramPersonList[]={actionInHomeScreen,paramPersonId};
if(actionInHomeScreen!= null && actionInHomeScreen.equals("createPerson")){
am.invokeMethod("createPersonMethod",paramPersonList);
}

17. Import
import com.sun.java.util.collections.HashMap;
import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
import oracle.apps.fnd.framework.*;
import java.io.*;
import oracle.jbo.Row.*;

18. Add a method called createPersonMethod() in PersonAM module as follows:

public void createPersonMethod(String pAction,String pPersonId){

OAViewObjectImpl perVO=getPersonVO1();
if(!perVO.isPreparedForExecution())
perVO.executeQuery();
Row row=perVO.createRow();
perVO.insertRow(row);
row.setNewRowState(Row.STATUS_INITIALIZED);

19. Open "ManagePersonCO" and change processFormRequest() method to the


following :

OAApplicationModule am = pageContext.getApplicationModule(webBean);

if (pageContext.getParameter("savePerson")!=null)
{
am.invokeMethod("SavePersonToDatabase");
pageContext.setForwardURL("OA.jsp?
page=/amdocs/oracle/apps/cap/people/webui/HomePG",null,OAWebBeanConstan
ts.KEEP_MENU_CONTEXT,null,null,true,OAWebBeanConstants.ADD_BREA
D_CRUMB_NO,OAWebBeanConstants.IGNORE_MESSAGES);

20. Add the following new method inside PersonAM to save record to the database.

public void savePersonToDatabase(){


getDBTransaction().commit();
}

21. To add support to auto generate PersonId from a database sequence and display in “Add New
Person” screen. Follow the next steps otherwise skip them and run the application.
22. Select PersonEO under oracle.apps.ak.person.schema.server package and right click and choose
“Edit PersonEO” option.
23. In the Window, Choose Java Option on the left bar.
24. Select checkbox for “createMethod” and press OK.
25. Now open the PersonEO java file and in the generated “create()” method, add the following line
of code :
setPersonId(getOADBTransaction().getSequenceValue("PER_NEW_SEQ"));
Note : PER_NEW_SEQ must already exist in the database.

26. Add New Person Functionality is complete now. Save All. Rebuild Project and
Run the HomePG page with OC4J within JDeveloper.

Adding Update Person Details Functionality on Search Page


1. Create “Edit Person” link in the main search result page.
2. Select HomePG and in the structure window, select the region named
“PersonVO1” and add a new item as follows :
a. Id : item4
b. Style : link
c. Under Client Action –
Action Type : fireAction
Event : updatePerson
Parameters – paramPersonId : ${oa.PersonVO1.PersonId}

Submit : True

3. Under item4, Add a new item as follows :


a. Id : item5
b. Style : image
c. Image URI : updateicon_enabled.gif from (/OA_MEDIA) path

4. Open HomeCO java file and add the following code inside processFormRequest()
method :

if(actionInHomeScreen.equals("createPerson") ||
actionInHomeScreen.equals("updatePerson")){

HashMap map=new HashMap();


map.put("paramPersonId",paramPersonId);
map.put("actionInHomeScreen ", actionInHomeScreen);
pageContext.setForwardURL("OA.jsp?
page=/oracle/apps/ak/person/webu
i/ManagePersonPG",null,OAWebBeanConstants.KEEP_MENU_CONTE
XT,null,map,true, OAWebBeanConstants.ADD_BREAD_CRUMB_NO,
OAWebBeanConstants.IGNORE_MESSAGES);
}

5. Open ManagePersonCO java file and change processRequest() method as


follows:

String actionInHomeScreen =pageContext.getParamater("actionInHomeScreen ");


String paramPersonId=pageContext.getParamater("paramPersonId");
OAApplicationModule am=pageContext.getApplicationModule(webBean);
Serializable paramPersonList[]={actionInHomeScreen,paramPersonId};
if(actionInHomeScreen!= null && actionInHomeScreen.equals("createPerson")){
am.invokeMethod("createPersonMethod",paramPersonList);
}
if(actionInHomeScreen!= null &&
actionInHomeScreen.equals("updatePerson")){
am.invokeMethod("updatePersonMethod",paramPersonList);
}

6. Open PersonAM java file and add the following method :

public void updatePersonMethod(String pAction,String pPersonId){

try{
OAViewObjectImpl perVO=getPersonVO1();
String existingWhereClause=perVO.getWhereClause();
perVO.setWhereClauseParams(null);
perVO.setWhereClause("person_id=:1");
perVO.setWhereClauseParam(0,new Number(pPersonId));
perVO.executeQuery();
perVO.setWhereClauseParams(null);
perVO.setWhereClause(existingWhereClause);
}catch(Exception e){
throw OAException.wrapperException(e);
}

7. Add the following import inside PersonAM java file.

import oracle.jbo.domain.Number;

8. Update Person Details Functionality is complete now. Save All. Rebuild Project
and Run the HomePG page with OC4J within JDeveloper.
Deploy the application on Oracle Apps Instance

1. Find JAVA_TOP variable on the machine where Oracle Apps Instance is running.
2. Transfer complete package structure(subpackage,.class & .xml files) from local
JDeveloper environment to Oracle Apps Instance by followinf next steps.
3. Go to myclasses folder under jdevhome folder of your installation on local
system.
4. Copy “oracle” folder from myclasses to JAVA_TOP path on the server using some
transfer utility like TotalCommander,FileZilla etc in “ASCII Transfer Mode”.
5. Make sure .class files are individually transferred into their respective packages
using “Binary Transfer Mode” after copying complete oracle folder on the server.
6. Transfer is done.
7. Import page xml files into MDS repository on the server using “import” utility
comes with JDeveloper under ../jdevbin/jdev/bin folder.
8. Import HomePG.xml and ManagePersonPG.xml into MDS repository as follows:

import
C:\JDeveloper9.0.3\jdevhome\jdev\myclasses\oracle\apps\ak\person\webui\H
omePG.xml
-username <DB user name> -password <DB password> -rootdir
C:\JDeveloper 9.0.3\jdevhome\jdev\myclasses\ -dbconnection
“(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=<host IP>)
(PORT=<portno.>))(CONNECT_DATA=(SID=<SIDNAME>)))”

import
C:\JDeveloper9.0.3\jdevhome\jdev\myclasses\oracle\apps\ak\person\webui\M
anagePersonPG.xml
-username <DB user name> -password <DB password> -rootdir
C:\JDeveloper 9.0.3\jdevhome\jdev\myclasses\ -dbconnection
“(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=<host IP>)
(PORT=<portno.>))(CONNECT_DATA=(SID=<SIDNAME>)))”

Note : To run import command, You must be in ../jdevbin/jdev/bin folder.

9. XML Page Data will be loaded into MDS Repository into the following tables:
a. JDR_ATTRIBUTES
b. JDR_COMPONENTS
c. JDR_PATHS
d. JDR_ATTRUBITES_TRANS

10. Verify whether XML Page Data has been loaded into MDS Repository or not
using the following jdr_utils function:
DECLARE
BEGIN
jdr_utils.listdocuments('/oracle/apps/ak', TRUE);
END;
11. Register the Main page i.e. HomePG as a function under Oracle Apps Instance.
12. Log In as a Functional Administrator in Oracle Applications and Enter Function
Name,User Function Name and Description.
13. Enter Properties Type SSWA jsp function on Properties Tab
14. Under Web HTML Tab, Enter the main page xml path as follows :
OA.jsp?page=/oracle/apps/ak/person/webui/HomePG
Note : Don’t append .xml with the path.

15. Attach the function with a menu and then run main page from the respective
responsibility.
16. May need to bounce the Apache Server in Oracle Apps 11i as follows :
a. $COMMON_TOP/admin/scripts/$TWO_TASK*/adapcctl.sh stop
b. $COMMON_TOP/admin/scripts/$TWO_TASK*/adapcctl.sh start

17. Deployment of the application on server environment is complete now. Just open
the main page from the menu in the browser window and test it.

Personalizing OA Pages running on Oracle Apps Instance

Personalization of any OA Page can be done by following the “Personalize Page” link on
top right of every page as End User/Administrator Level.

Extending/Customizing OA Pages running on Oracle Apps Instance

1. Clean your myclasses and myprojects folder by deleting everything in your local
system under JDeveloper.
2. Copy deployed OAF application from Oracle Apps Instance (server) to your local
JDeveloper environment by following next steps.
3. Copy “oracle” folder from $JAVA_TOP variable on server to “myclasses” folder
on your local system using some utility like TotalCommander or FileZilla etc in
ASCII Text Mode.
4. Copy individual .class files from their respective packages on server to right
places on local system using Binary Transfer Mode.
Note: When you are extending Oracle Applications pages, you will not have access to
Oracle Applications .java files, but the .class files will be available in your
classpath.

5. Create a new OAF workspace (ExtendPerson.jws).


6. Create a new OAF project (ExtendPerson.jpr)
7. Add existing BC4J package Files to ExtendPerson.jpr project.
8. Select ExtendPerson.jpr project and Go to File->Open menu option on the menu
bar and add the following .xml files from under myclasses folder to this project.
a. oracle/apps/ak/person/schema/server/server.xml
b. oracle/apps/ak/person/server/server.xml
This would add 2 packages to this project.

Extending View Object

1. To add new attributes to our search page, we need to extend View Object. In
search result, City and Country of the person should also be displayed.
2. Create new bc4j package “amdocs.oracle.apps.ak.person.server” in
ExtendPerson.jpr project.
3. Create a New View Object named
amdocs.oracle.apps.ak.person.server.PersonVOEx that extends
oracle.apps.ak.person.server.PersonVO as follows :
a. Right click on amdocs.oracle.apps.ak.person.server package
b. Choose option “New View Object”
c. Enter the name as “PersonVOEx” and choose package as
“amdocs.oracle.apps.ak.person.server”
d. Select “oracle.apps.ak.person.schema.server.PersonAddressEO” from left
panel to move it to the right panel. From this EO, we are going to get City
and Country info.
e. In Next step, add City & Country attributes from PersonAddressEO to
PersonVOEx view object.
f. In Next step, append the following SQL phrase to the newly created VO.
where PersonEO.person_id = PersonAddressEO.person_id
g. In Next step, Under Java section , uncheck the View Object Class –
Generate Java File checkbox and check the View Row Class – Generate
Java File and Generate Accessors checkboxes.

4. Substitute newly created extended VO Object for the base VO Object to be used
throughout the application by OAF Framework as follows :
a. Right click on ExtendPerson.jpr project
b. Choose “Edit Business Components Project” option.
c. From the screen , select “Substitutions” section.
d. From the available list, select the base VO Object that to be replaced.
(oracle.apps.ak.person.server.PersonVO)
e. From the substitute list, select the extended VO Object that to be used as
substitute. (amdocs.oracle.apps.ak.person.server.PersonVOEx)
f. Then choose Add button.
g. Choose OK and Exit.

5. Copy newly created extended VO with full package from myclasses folder to
$JAVA_TOP variable on server machine as done earlier also using some utility in
ASCII and Binary Mode. Just copy amdocs folder to $JAVA_TOP variable.
6. Import .jpx file into MDS repository on the server using “jpximport” utility comes
with JDeveloper under ../jdevbin/jdev/bin folder.
7. Import ExtendPerson.jpx file into MDS repository as follows :

jpximport C:\JDeveloper9.0.3\jdevhome\jdev\myprojects\ExtendPerson.jpx
-username <DB user name> -password <DB password> -dbconnection
“(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=<host IP>)
(PORT=<portno.>))(CONNECT_DATA=(SID=<SIDNAME>)))”
8. May be, Server bounce is required for the changes to take effect.
9. Personalize the UI to display New Attributes from the extended VO by following
next steps.
10. Run deployed HomePG from the server machine, not JDeveloper environment.
11. In the browser, Select “Personalize Page” global link from top right of the page.
12. In “Choose Personalization Context” page, select Page : HomePG (Search Page)
from “Scope” poplist and select the Apply button.
13. In “Personalize Page” page, expand QueryRN node and locate Table :
PersonVO1 node in page hierarchy.
14. Select “Create Item” icon. Create Item page would be displayed. Now do the
following.
a. Style : Message Styled Text
b. Id : City
c. Prompt : City
d. View Attribute : City
e. View Instance : PersonVO1
f. Select Apply button.

15. Select “Create Item” icon once more to add one more item for country. Create
Item page would be displayed. Now do the following.
a. Style : Message Styled Text
b. Id : Country
c. Prompt : Country
d. View Attribute : Country
e. View Instance : PersonVO1
f. Select Apply button.
16. In “Personalize Page” page, expand QueryRN node and locate Table :
PersonVO1 node again in page hierarchy.
17. Select the Reorder icon.
18. In the Reorder Contents of Table page, move City and Country to be sequenced
accordingly.
19. Select Apply Button.
20. In “Personalize Page” page, select Return To Application link.
21. Now click on Go button and see the search result is displaying City and Country
too.
22. Customization of VO is now complete.

Extending Entity Object(EO)

1. To display some default values in ManagePersonPG screen, we could achieve


this by doing personalization. But if the default values are conditional, then some
part of code need to be changed. Plus if some customized validation logic is
required then also code need to be changed. So we need to extend PersonEO
object for both the purposes. Here we will do the following two tasks :
a. Displaying default conditional value in NameOfUniversity field in
ManagePersonPG screen
b. Adding customized validation logic for FirstName field in
ManagePersonPG screen

2. Create new bc4j package “amdocs.oracle.apps.ak.person.schema.server” in


ExtendPerson.jpr project.
3. Right click on “amdocs.oracle.apps.ak.person.schema.server” package and select
“New Entity Object” option.
4. In the wizard, enter new entity object name to
“amdocs.oracle.apps.ak.person.schema.server.PersonEOEx”
5. Set Extends Entity text filed to “oracle.apps.ak.person.schema.server.PersonEO”.
6. Don’t generate default view object.
7. Generate create and accessors methods.
8. Open PersonEOExImpl.java file under
amdocs.oracle.apps.ak.person.schema.server package.
9. Change the create method for default value of NameOfUniversity field on screen,
so it look like as follows :

public void create(AttributeList attributeList){


super.create(attributeList);
//Add some condition here
setNameOfUniversity(“Mumbai University”);
}
10. Change the setFirstName method for customized validation logic for FirstName
field(FirstName must be more than or equals to 5 characters) on screen, so it look
like as follows :

public void setFirstName(String value){

if(value != null){
if(value.trim().length() <5){

throw new OAAttrValException(OAException.TYP_ENTITY_OBJECT,


getEntityDef().getFullName(),
getPrimaryKey(),
“FirstName”,
value,
“AK”,
“First Name must contain 5 or more characters!”);
}
}
super.setFirstName(value);
}

11. Add the following imports to PersonEOExImpl.java file.

import oracle.apps.fnd.framework.OAAttrValException;
import oracle.apps.fnd.framework.OAException;

12. Substitute newly created extended EO Object for the base EO Object to be used
throughout the application by OAF Framework as follows :
a. Right click on ExtendPerson.jpr project
b. Choose “Edit Business Components Project” option.
c. From the screen , select “Substitutions” section.
d. From the available list, select the base EO Object that to be replaced.
(oracle.apps.ak.person.schema.server.PersonEO)
e. From the substitute list, select the extended EO Object that to be used as
substitute. (amdocs.oracle.apps.ak.person.schema.server.PersonEOEx)
f. Then choose Add button.
g. Choose OK and Exit.

13. Copy newly created extended EO with full package from myclasses folder to
$JAVA_TOP variable on server machine as done earlier also using some utility in
ASCII and Binary Mode. Just copy amdocs folder to $JAVA_TOP variable.
14. Import .jpx file into MDS repository on the server using “jpximport” utility comes
with JDeveloper under ../jdevbin/jdev/bin folder.
15. Import ExtendPerson.jpx file into MDS repository as follows :
jpximport C:\JDeveloper9.0.3\jdevhome\jdev\myprojects\ExtendPerson.jpx
-username <DB user name> -password <DB password> -dbconnection
“(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=<host IP>)
(PORT=<portno.>))(CONNECT_DATA=(SID=<SIDNAME>)))”
16. May be, Server bounce is required for the changes to take effect.
17. Run deployed HomePG from the server machine, not JDeveloper environment.
18. In the browser, From the Search Page, click on button labeled as “Add New
Person”.
19. In the displayed screen, verify that NameOfUniversity field is having a default
value as “Mumbai University”.
20. Plus in the displayed screen, enter some value in FirstName field lesser then 5
length and by clicking on “Commit Data” button , verify that error message for
FirstName field is displayed on the page.
21. Customization of EO is now complete for defaulting and custom validation logic.

Extending Controller Object(CO)

1. To override some default values coming/not from EO in ManagePersonPG screen,


we need to achieve this task by doing customization of ManagePersonCO under
oracle.apps.ak.person.webui package. So we need to extend ManagePersonCO
object for this purpose. Here we will do the following task :
a. Displaying overridden value in NameOfUniversity field in
ManagePersonPG screen from “Mumbai University” to “Pune
University”.

2. Right click on “ExtendPerson.jpr” project and select “New” option to create a


new class as follows:
a. Name : ManagePersonCOEx
b. Package : amdocs.oracle.apps.ak.person.webui
c. Extends : oracle.apps.ak.person.webui.ManagePersonCO
d. Unckeck Generate Default Constructor and Main Method checkboxes
3. Select Finish button.
4. Open amdocs.oracle.apps.ak.person.webui.ManagePersonCOEx.java file and
change processRequest() method as follows :

public void processRequest(PageContext pageContext,WebBean webBean){


super.processRequest(pageContext,webBean);
OAMessageTextInputBean
nameOfUniversity=(OAMessageTextInputBean)webBean.findChildRecur
sive(“NameOfUniversity”);
nameOfUniversity.setText(pageContext,”Pune University”);
}

5. Add the following imports to ManagePersonCOEx.java file.


import oracle.apps.fnd.common.VersionInfo;
import oracle.apps.fnd.framework.webui.OAControllerImpl;
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import
oracle.apps.fnd.framework.webui.beans.message.OAMessageTextInputBe
an;

6. Save All. Rebuild Project.


7. Copy newly created extended CO with full package from myclasses folder to
$JAVA_TOP variable on server machine as done earlier also using some utility in
ASCII and Binary Mode. Just copy amdocs folder to $JAVA_TOP variable.
8. May be, Server bounce is required for the changes to take effect.
9. Personalize the UI to apply newly created extended CO to ManagePersonPG
screen by following next steps.
10. Run deployed HomePG from the server machine, not JDeveloper environment.
11. Click on “Add New Person” button to display ManagePersonPG screen.
12. On ManagePersonPG page in the browser, Select “Personalize Page” global link
from top right of the page.
13. In “Choose Personalization Context” page, select Page : ManagePersonPG
(Manage Person Page) from “Scope” poplist and select the Apply button.
14. In “Personalize Page Hierarchy” page, locate for pageLayout : region1 node in
page hierarchy.
15. Click on “Personalize” link and in the displayed screen, change the Controller
Class filed so that it points to
“amdocs.oracle.apps.ak.person.webui.ManagePersonCOEx” by entering the full
path.
16. Select Apply Button.
17. In “Personalize Page” page, select “Return To Application” link.
18. In the displayed screen, verify that NameOfUniversity field is having a default
value as “Pune University”
19. Customization of CO is now complete for overriding default values.

Potrebbero piacerti anche