Steps For OAF Development
Steps For OAF Development
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.
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
14. Search Page is complete now. Save All. Rebuild Project and Run the page with
OC4J within JDeveloper.
Adding Delete Functionality on Search Page
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);
}
import oracle.apps.fnd.framework.server.*;
import oracle.apps.fnd.framework.*;
import java.io;
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;
}
}
}
import oracle.apps.fnd.framework.server.*;
import oracle.apps.fnd.framework.*;
import oracle.jbo.Row;
import java.io;
9. Delete Functionality is complete now. Save All. Rebuild Project and Run the page
with OC4J within JDeveloper.
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
if(actionInHomeScreen.equals("createPerson")){
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)
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.*;
OAViewObjectImpl perVO=getPersonVO1();
if(!perVO.isPreparedForExecution())
perVO.executeQuery();
Row row=perVO.createRow();
perVO.insertRow(row);
row.setNewRowState(Row.STATUS_INITIALIZED);
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.
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.
Submit : True
4. Open HomeCO java file and add the following code inside processFormRequest()
method :
if(actionInHomeScreen.equals("createPerson") ||
actionInHomeScreen.equals("updatePerson")){
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);
}
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>)))”
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.
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.
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.
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.
if(value != null){
if(value.trim().length() <5){
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.