OAF Registration
The basic file available in OAF is java file and XML file.
we never move java file to server
*.java(we never move source code)
-----------------------------------
if we want to deploy OAF page
.*xml, .*java
----------------------------
we move
class file(eo,vo, am)
xml file--> bc4j objects, pg files
-----------------------------------
Class,XML--> JAVA_TOP
PG.xml--> MDS Layer
--------------------------------------------
open putty
echo applmgr$echo $JAVA_TOP --> (D:\oracle\VIS\apps\apps_st\comn\java\classes\) move the folder in this folder
oracle seeded files will be in oracle folder
-------------------
for pg.xml we have import statement
import C:\jdev\jdevhome\jdev\febpaftraining\myprojrcts\xxibm\oracle\apps\fnd\webui\studentDNMUsingEOPG.xml
-username apps -password apps -dbconnection
"(DESCRIPTIOn=(ADDRESS=(PROTOCOL=tcp)(HOST=glo.dev.com)(PORT=1521))(CONNECT_DATA=(SID=VIS)))" -rootDor C:\jdev\jdevhome\jdev\
feboaftraining\myprojects
--------------------
open command prompt
cd c:\jdev
cd jdevbin
cd oaext
cd bin
dir
it will show dorectory of C:\jdev\jdevbin\oaext\bin
execute the import command
-------------------------------------
select * from jdr_paths where path_name = 'StudentDMLUsingEOPG' ---page info ---- created_by (interal means its custom page)
select * from jdr_components where comp_docid = 95411;--- iitem / region info
select * from jdr_attributes where att_comp_docid = 95411;--- attributes/properties of item/region
select jdr_mds_internal.getdocumentname(95411) from dual;
-----------------------------------
registration of page
AOL function and menu
Description
Function: XX_IBM_PG
User Function Name: XX_IBM_PG
Properties
Type: SSWA jsp function ----------if we are rejestering ADF Page we use External ADF Application
WEBHTML
OA.jsp?page=/xxibm/oracle/apps/fnd/webui/StudentDMLUsingEOPG (select jdr_mds_internal.getdocumentname(95411) from dual;)
------------------------------
assign function to menu
-------------------------
clear cache in function administrator
------------------------------------------------
Bouncing sever
cd $ADMIN_SCRIPTS_HOME
ls (will show alll script to bounce different servers)
$adopmnct_.sh status
$adapmnctl.sh status (it will show the server this script will stop)
$adopmnctl.sh stop all
$adopmnctl.sh status (status 0 error)
$adapmnctl.sh start all
-------------------------------------
starting each server manually (oacore, form, report and http server)
applmgr$adoa--- shows script with this name like operator
$adoafmctl.sh start all ----$adapcctl.sh status
$adformsctl.sh start all
$adoacorectl.sh start all
copy the folder to java top
D:\oracle\VIS\apps\apps_st\comn\java\classes
prepare import script
go to command promt
D:\oracle\VIS\apps\apps_st\comn\java\classes\ebspage\oracle\apps\po\requisition\webui\ebsPG.xml -rootdir
--------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------
Basics
--------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------
controller -> Java file to handel the event. -> At page level or region level
On the main region we create controller. (right click and create new controller.)
package-> strucure in which files are saved.
import-> whenever we are accessing any method which is available in another class, we have to import that particular class.
public class HelloWorldCO extend OAControllerImpl ---> it is extending java api whcih will have core logic for handelling event.
it will have all the access of OAControllerImpl class. (it will have field , constructor and methods. it is provided by oracle)
--->to handel the buuton or hyperlink event, without using OA framework will be extra 20 line of code.
it will have the access of OAControllerImpl. Double click on OAControllerImpl, which will have constructor and set of methods.
CO---> OAControllerImpl(JavaAPI---core for handelling events.)
HelloWorldCO--> Extending --> OAControllerImpl
Thers 3 methods have 2 parameters
1.---> ProcessRequest(OAPageContext pageContext, OAWebBean webBean)
During page load, initialization. (Before report, before parameter)
2.--> ProcessFormData(OAPageContext pageContext, OAWebBean webBean)
it is used for getting value for the components, for validation of data of fields when user enter it. and setting the value.
3.--->ProcessFormRequest(OAPageContext pageContext, OAWebBean webBean)
called afer page load.when we click button event, LOV , Popups. Handellig events.
pageContext --> Store page related infor, parameter information , user ino, resp , appl name ...etc,
webBean --> Store the hierarchy of the OAF UI Components.
parameter information-> whenevr we are passing data from one page to another this particula page context object or variable will store it.
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
Hellow World Page
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
1.we will create a text Input box --> it is Java Bean (for setting and getting value)
---> java API for the purpose of setting the properties.
---> itemStyle--> message TextInput
----> OAmessageTextInputBean (refer class name)
2. Create submit button
3. //OAException(welcomeStr,OAException.warning) etc.----this is contructor
OAException A is a constructor --- in java class , if method name = class name its construcor
OAMessageTextInputBean CLASS
nameIDBean OBJECT
webBean WE ARE GTTING THE VALUE
nameID PASSING THE nameID
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processFormRequest(pageContext, webBean);
String eventName = pageContext.getParameter("go"); // it will have event value when we click submit button
System.out.println("event name is ---->"+eventName);
if(pageContext.getParameter("go")!=null) // it check whether event is clicked.
{
OAMessageTextInputBean nameIDBean = (OAmessageTextInputBean)webBean.findIndexedChildRecursive("nameID");
//alt +Enter//getting value/// this method will return memory pointer location of this component/bean
String nameStr = nameIDBean.getText(pageContext);
String welcomeStr = "Hello" +nameStr +"Welcome to OAF";
OAException exceptionObj = new OAException(welcomeStr,OAException.INFORMATION);// creating object, for displaying the information to the user;
//another way
thorw new OAException("user Clicked ",OAException.WARNING); //OAException(welcomeStr,OAException.warning) etc.----OAExceptionOAException is contructor
throw exceptionObj;
}
else if(pageContext.getParameter("sb2")!=null)
{thorw new OAException("user Clicked ",OAException.WARNING);
}
}
In JSP, pageContext is an implicit object of type PageContext class.The pageContext object can be used to set,get or remove attribute from one of the following scopes:
page
request
session
application
in java whenver method name = class name then its a constructor
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
Diplaying VO in a page (table)
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
OAF PG -> CO -> AM -> VO -> DB
to display the data from DB using SQL Query.
1. Requirement Diplay Employee data in OAF Page.
EmployeePG.XML
EmployeeCO.java -> to initialize data we need Controller.
AM -> it will have .java file and .xml file
VO -> PerPeopleVO ---> select * from per_people_x
1st create VO --> (PerPeopleVO VO will have PerPeopleVO.xml and PerPeopleVO.java)
2nd we have to assign to AM. All BC4J object has to be assigned to AM. .java file in AM will add new method automatically
AmazonBizzServices.XML
AmazonBizzServicesImpl.java
public PerPeopleVOImpl getPerPeopleVO1()
{ :return (PerPeopleVOImpl)findViewObject("PerPeopleVO1"); // for initializing our VO and getting pointer location, allocating memory
}
3rd create page . Use table wizard. Region Style: Table
4th AMImpl.java ---> vo.executeQuery();
public void initPerPeopleVO()
{ PerPeopleVOImpl vo = getPerPeopleVO1();
vo.executeQuery();
}
5th Controller
public void ProcessRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processRequest(pageContext, webBean);
OAApplicationModule am = pageContext.getApplicationModule(webBean);
am.invokeMethod("initPerPeopleVO");
or we can write
AmazonBizzServiceImpl amazonAM = (AmazonBizzServicesImpl)pageContext.getApplicationModule(webBean);
amazonAM.initPerPeopleVO();
}
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
Creating Region of header
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
HRMS Module --> 15 pages to be developed
15 pages--> header information --> employee details --> empid, no, name, location, bgid
Shared region
1. VO--> emp details
2. AM
3. RN
4. CO
1. Create VO
Select person_id, employee_number, full_name, business_group_id, email_address from per_people_f where
person_id = (select employee_id from fnd_user where user_id = FND_PROFILE.VALUE('USER_ID'))
2. Right Click on webui -> New -> OA Component -> Region
New Region
Name : Region1
Package: xxibm.oracle.apps.fnd.webui
Style: Header
2. Down right click on region and Create a cotroller
Package Name : xxibm.oracle.apps.fnd.webui
ClassName: MYCO
Assign the AM in properties.
Text:> Employee Details
New Region Wizard-> Next-> Select the column to be displayed.
Region Style: defaultDoubleColumn or messagecomponentlayout (properties 2 rows and 3 column, width 90%, move it down to another region and give a text field : Emplooyee Detail)
Style: messageStyleText
3. Go to application Module , AMImpl.java ----initialize the VO
public void initEmployeeDetailsVO()
{EmployeeDetailVOImpl vo = getEmployeeDetailsVO1();
vo.initEmpVO();
}
4. Go to EmployeeDetailVOImpl.java, by double clicking on it in AM
public void initEmpVO()
{executeQuery();
}
5. Write the code in controller
super.processRequest(pageContext, webBean);
OAApplicationModule am = pageContext.getApplicationModule(webBean);
am.invokeMethod("initEmployeeDetailsVO");
Now if we want to use the detail in another pages
We will copy the region path given in the URL
GO to any webui-> xyz.xml
Down in the structure-> Right Click on Main Region -> New -> region (drag it to top of the already existing region)
Properties: Extends: xxibm/oracle/apps/fnd/webui/EmployeeDetailsRN
import C:\jdev\jdevhome\jdev\febpaftraining\myprojrcts\xxibm\oracle\apps\fnd\webui\EmployeeDetailRN.xml
-username apps -password apps -dbconnection
"(DESCRIPTIOn=(ADDRESS=(PROTOCOL=tcp)(HOST=glo.dev.com)(PORT=1521))(CONNECT_DATA=(SID=VIS)))" -rootDor C:\jdev\jdevhome\jdev\
feboaftraining\myprojects
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
SEARCH PAGE
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
Create VO ->
india.oracle.apps.po.SerchPG.server
xxManualPageVO
select fs.supplier_id, fs.name, fs.on_hold_flag, fs.start_date, fs.end_date, fst.supplier_site_id, fst.site_name, fst.carrier_code, fst.purchasing_site_flag, fst.address_id
from fwk_tbx_suppliers fs, fwk_tbx_supplier_sites fst
where fs.supplier_id = fst.supplier_id
and fs.supplier_id like nvl(:1,fs.supplier_id)
and fs.name like nvl(:2,fs.name)
and nvl(fs.on_hold_flag,'N') like nvl(:3,NVL(fs.on_hold_flag,'N'))
Create AM
Pacjkge: india.oracle.apps.po.SearchPG.server
Name : xxSupplierAM
Create Page
name : xxManualSearchPG
Package: india.oracle.apps.po.SearchPG.webui
Create Region
Attach the AM
Window Title : Serch Page
Create Another Regiion under Main Region
Text Supplier Details
Region Style : defaultDoubleColumn
Creating Item
SuppllierID
SupplierName
onHoldFlag
StartDate
Click on the main region create another region
ID : RowLayoutRN
Region Style : rowLayout
Create GO and Clear Button
ID : Search
Item Style : Submit Button
ID : ButtonSpacer
Item Style :spacer
width: 50
ID : Cancel
Item Style :Submit Button
-------------------------------------------
Right Click on the main region -> Create Item
ID : regionSpacer
Item Style :spacer
height : 10
-------------------------------------------------
Right Click on the main region -> Create region
---------------------
ID : Site Details
Region Style :tab;e
Width : 100%
Right Click on the main region -> Create Item
ID : SupplierId
ItemStyle: messageStyledText
Prompt: supplierDI
View instance: xxManualSearchVO1
View Attribute: SupplierId
ID : SupplierSiteId
ItemStyle: messageStyledText
Prompt: SupplierSiteId
View instance: xxManualSearchVO1
View Attribute: SupplierSiteId
ID : SiteName
ItemStyle: messageStyledText
Prompt: SiteName
View instance: xxManualSearchVO1
View Attribute: SiteName
ID : StartDate
ItemStyle: messageStyledText
Prompt: StartDate
View instance: xxManualSearchVO1
View Attribute: StartDate
ID : EndDate
ItemStyle: messageStyledText
Prompt: EndDate
View instance: xxManualSearchVO1
View Attribute: EndDate
ID : HoldFlag
ItemStyle: messageStyledText
Prompt: HoldFlag
View instance: xxManualSearchVO1
View Attribute: HoldFlag
ID : CarrierCode
ItemStyle: messageStyledText
Prompt: CarrierCode
View instance: xxManualSearchVO1
View Attribute: CarrierCode
--------------------------------
Right Click on sitedetails region -> Table Actions
Right Click on table action region -> Create Item
ID: create Supplier
Iten Style: Submit Button
Prompt: Create Supplier
-------------------------------------------
creating Controller--------------To Handle Event
Right Click on Maiin region -> new ->Set new Controller
india.oracle.apps.po.SearchPG.webui
xxManualSerarchCo
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
{super.processFormRequest(pageCotext, webBean);
xxSupplierAMImpl am = (xxSupplierAMImpl)pageContext.getApplicationModule(webBean);
if(pageContext.getParameter("Search")!=null)
{
String Sup_ID = pageContext.getParameter("SupplierID");
String Sup_Name = pageContext.getParameter("SupplierName");
String HFlag = pageContext.getParameter("onHoldFlag");
String Start_Date = pageContext.getParameter("StartDate");
am.xxinitQuery(Sup_ID,Sup_Name,HFlag, Start_Date);
}
if (pageContext.getParameter("Clear")!=null)
{pageContext.setForwardURLToCurrentPage(null,false,null,OAWebBeanConstants,IGNORE_MESSAGES);
}
}
--------------Application Module
public void xxintQuery(String Sup_ID, String Sup_Name, String onHoldFlag, String SDate)
{xxManualSearchVOImpl vo = getxxMaualSearchVO1();
vo.xxGetSuppDate(Sup_ID,Sup_Name,onHoldFlag,SDate);
}
-----------------VOCode
public void xxGetSuppData(String Sup_ID, String Sup_Name, String onHoldFlag, String SDate)
{
this.clearCache(); //clearing the cashe
String oldQuery = this.getQuery(); //method to get query
String flag = null;
if(Sup_ID!=null &&!"".equals(Sup_ID))
{
this.setWhereClauseParam(0,Sup_ID); // indexing starts from zero,1st parameter
flag = "Supplier_ID";
}
else
{this.setWhereClauseParam(0,null);} // else it will pass null to where clause
if(Sup_Name!=null&&!"".equals(Sup_Name))
{
this.setWhereClauseParam(1,Sup_Name);
flag = flag+"-"+"Supplier_Name";
}
else
{this.setWhereClauseParam(1,null);}
if(onHoldFlag!=null&&!"".equals(onHoldFlag))
{
this.setWhereClauseParam(2,onHoldFlag);
flag = "onHoldFlag";
}
else
{this.setWhereClauseParam(2,null);}
if(SDate!=null&&!"".equals(SDate))
{
this.addWhereClause(SDate);
this.setWhereClauseParam(3,SDate);
flag = "Start_Date";
}
else
{}
if (flag!=null)
{
if (flag.equalsIgnoreCase("Supplier_ID")||flag.equalsIgnoreCase("Supplier_Name")||flag.contains("null"||"Supplier_ID-Supplier_Name".equals(flag))
{
if(!"Supplier_ID-Supplier_Name".equals(flag))
{
throw new OAException("Please enter Supplier ID and Supplier Name or HoldFlag", OAException.ERROR);
}
else
{flag= "EXECUTE";
}
}
if (flag.equalsIgnoreCase("ONHOLDFLAG")||flag.equalsIgnoreCase("Start_Date")||flag.equalsIgnoreCase("EXECUTE"))
{this.executeQuery();
this.setQuery(oldQuery);
}
}
else
{throw new OAException("Please Enter Atlease One Search Criteria", OAException.ERROR);
}
}
public void addWhereClause(String SDate)
{
String oldQuery = this.getQuery();
StringBuffer newQuery = new StringBuffer(oldQuery);
newQuery = newQuery.append("AND NVL(fs.START_DATE,sysdate)= nvl(:4,NVL(fs.START_DATE,sysdate))");
this.setQuery(newQuery.toString());
}
pubic void clearCache()
{
this.setWhereClauseParam(0,"-9999");
this.setWhereClauseParam(1,null);
this.setWhereClauseParam(2,null);
}
Controller
OAApplicationModule am = pageContext.getApplicationModule(webBean);
am.invokeMethod("initEmployeeDetailsVO");
FND_PROFILE.value('user_id')
Application module
public void initEmployeeDetailsVO()
{EmployeeDetailsVOImpl vo = getEmployeeDetailsVO1();
vo.initEmpVO();
}
VO.java
public void initEmpVO()
{
execute.Query();
}
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
Calling another form
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
Create new workspace
Create new project
Create a new Application module.
Create a new Page. dept PG
(first page)
Create VO Department
select deptno, dname, loc from dept
Attach deptvo to AM
Go to page -> Create region wizrad to create fields -> region style table
Run the page and copy
OA.jsp?page=/cf/oracle/apps/po/requisition/webui/deptPG
create a controller CO
under processRequest
OAApplicationModule am = pageContext.getApplicationModule(webBean);
OAViewObject vo = (OAViewObject) am.findViewObject("deptVO1");
if(!vo.isPreparedForExecution())
vo.executeQuery();
(second page)
Create VO Employee
reate VO Employee
select deptno, empname, ename, sal, job, hiredate
from emp where depno = :1
Attach deptvo to AM
Go to page -> Create region wizrad to create fields -> region style table
Run the page and copy
OA.jsp?page=/cf/oracle/apps/po/requisition/webui/empPG
create a controller CO
under processRequest
OAApplicationModule am = pageContext.getApplicationModule(webBean);
OAViewObject vo = (OAViewObject) am.findViewObject("empVO1");
String x = pageContext.getParameter("param");
vo.setwhereClauseParam(0,x);
if(!vo.isPreparedForExecution())
vo.executeQuery();
Go to depatment page
Go to properties of deptno-> in the destination URL
Paste:
OA.jsp?page=/cf/oracle/apps/po/requisition/webui/empPG&retainAM=Y¶m{@Deptno}
Under Employee region create a back button
itemStyle : Submit button
loginv in controller Now under process form requset CO
if (pageContext.getParameter("back")!=null)
pageContext.redirectImmediately("OA.jsp?page=/cf/oracle/apps/po/requisition/webui/deptPG&retanAM=Y");
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
DynamicVO
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
public void intEmloyee1()
{
OADBTransactionImpl dbTx = (OADBTransactionImpl)getTransaction();
Transaction txn = getTransaction();
String sqlText = "select Employee1.Employee_id as employee_id,\n" +
"Employee1.full_name as employee_name,\n"+
"employee1.email_address as employee_email,\n"+
"Employee2.EMPLOYEE_ID AS MANAGER_ID,\n" +
"Employee2.FULL_NAME AS MANAGER_NAME,\n"+
"Employee2.EMAIL_ADDRESS AS MANAGER_EMAIL\n"+
"FROM FWK_TBX_EMPLOYEES Employee1,\n" +
" FWK_TBX_EMPLOYEES Employee2\n"+
"WHERE Employee1.MANAGER_ID = Employee2.EMPLOYEE_ID";
OAViewDef viewDef = dbTx.createViewDef();
viewDef.setSql(sqlText);
viewDef.setExpertMode(true);
viewDef.setViewRowClass("oracle.apps.fnd.framework.server.OAViewRowImpl");
viewDef.addSqlDerivedAttrDef("EMPLOYEE_ID", //Attr name
"EMPLOYEE_ID",
"oracle.jbo.domain.Number",
Types.NUMERIC,
true,
true,
AttributeDef.READONLY,
(byte)15);
viewDef.addSqlDerivedAttrDef("EMPLOYEE_NAME", //Attr name
"EMPLOYEE_NAME",
"java.lang.String",
Types.VARCHAR,
true,
true,
AttributeDef.READONLY,
(byte)7);
viewDef.addSqlDerivedAttrDef("EMPLOYEE_EMAIL", //Attr name
"EMPLOYEE_EMAIL",
"java.lang.String",
Types.VARCHAR,
true,
true,
AttributeDef.READONLY,
(byte)15);
viewDef.addSqlDerivedAttrDef("MANAGER_ID", //Attr name
"MANAGER_ID",
"oracle.jbo.domain.Number",
Types.NUMERIC,
true,
true,
AttributeDef.READONLY,
(byte)15);
viewDef.addSqlDerivedAttrDef("MANAGER_NAME", //Attr name
"MANAGER_NAME",
"java.lang.String",
Types.VARCHAR,
true,
true,
AttributeDef.UPDATEABLE,
(byte)7);
viewDef.addSqlDerivedAttrDef("MANAGER_EMAIL", //Attr name
"MANAGER_EMAIL",
"java.lang.String",
Types.VARCHAR,
true,
true,
AttributeDef.UPDATEABLE,
(byte)7);
String voName="DynamicVO";
OAViewObject vo = (OAViewObject) findViewObject(voName);
if (vo != null)
{
vo.remove();
System.out.println("VO removed: " + voName);
}
vo = (OAViewObject) createViewObject(voName, viewDef);
}
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processFormRequest(pageContext, webBean);
OAApplicationModule am = pageContext.getApplicationModule(webBean);
String searchEmpName = pageContext.getParameter("EmployeeName");
String searchEmpId = pageContext.getParameter("EmployeeId");
System.out.println("EmployeeName: "+searchEmpName);
System.out.println("EmployeeId: "+searchEmpId);
if (pageContext.getParameter("Search") != null)
{
Serializable[] parameters = { searchEmpName, searchEmpId };
Class[] paramTypes = { String.class, String.class };
am.invokeMethod("intEmployee",parameters,paramTypes);
pageContext.setForwardURLToCurrentPage(null,true,OAWebBeanConstants.ADD_BREAD_CRUMB_NO,OAException.ERROR);
}
}
public void intEmployee(String empName,String empId)
{
String voName="DynamicVO";
OAViewObject vo = (OAViewObject) findViewObject(voName);
Number empNum = null;
try
{
empNum = new Number(empId);
}
catch(Exception e) { }
if (vo != null)
{
vo.setWhereClause(null);
vo.setWhereClauseParams(null);
if(!empName.equals("") && !empId.equals("") )
{
String s1 = " EMPLOYEE_ID = "+empNum+" AND "+" UPPER(EMPLOYEE_NAME) LIKE "+"UPPER("+"'"+empName+"'"+")";
vo.setWhereClause(s1);
}
else if(!empName.equals(""))
{
String s2 = " UPPER(EMPLOYEE_NAME) LIKE "+"UPPER("+"'"+empName+"'"+")";
vo.setWhereClause(s2);
}
else if(!empId.equals(""))
{
String s3 = " EMPLOYEE_ID = "+ empNum;
vo.setWhereClause(s3);
}
}
vo.executeQuery();
}
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
Execute parameterized PL SQL procedure from OAF page
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
CREATE OR REPLACE PACKAGE APPS.test_package AUTHID CURRENT_USER
IS
PROCEDURE data_sum
( item1 IN NUMBER,
item2 IN NUMBER,
data_sum OUT NUMBER );
END test_package;
/
SHOW ERRORS;
EXIT;
Package Body
CREATE OR REPLACE PACKAGE BODY APPS.test_package
IS
PROCEDURE data_sum
( item1 IN NUMBER,
item2 IN NUMBER,
data_sum OUT NUMBER
)
IS
BEGIN
data_sum := item1 + item2;
END data_sum;
END test_package;
/
SHOW ERRORS;
EXIT;
10. Add Following Code in your AMImpl Class (ParameterizedProcDemoAMImpl.java)
import oracle.apps.fnd.framework.server.OADBTransaction;
import oracle.apps.fnd.framework.server.OADBTransactionImpl;
import oracle.jdbc.OracleCallableStatement;
import java.sql.Types;
import oracle.apps.fnd.framework.OAException;
...
public String dataSumAction(String item1,String item2)
{ OADBTransaction oadbtransaction = (OADBTransaction)getTransaction();
OADBTransactionImpl oadbtransactionimpl = (OADBTransactionImpl)getTransaction();
String retValues;
StringBuffer str = new StringBuffer();
str.append( " BEGIN ");
str.append( " test_package.data_sum( ");
str.append( " item1 => :1, ");
str.append( " item2 => :2, ");
str.append( " data_sum => :3 ");
str.append( " ); ");
str.append( " END; ");
OracleCallableStatement oraclecallablestatement = (OracleCallableStatement)oadbtransaction.createCallableStatement(str.toString(), 1);
try
{
oraclecallablestatement.setInt(1, Integer.parseInt(item1) );
oraclecallablestatement.setInt(2, Integer.parseInt(item2) );
oraclecallablestatement.registerOutParameter(3, Types.VARCHAR);
oraclecallablestatement.execute();
retValues = oraclecallablestatement.getString(3);
}
catch(Exception e)
{
throw OAException.wrapperException(e);
}
return retValues;
}
11. Add Controller for Page ParameterizedProcDemoPG Select PageLayoutRN right click Set New Controller
Package Name -- prajkumar.oracle.apps.fnd.parameterizedprocdemo.webui
Class Name -- ParameterizedProcDemoCO
Add Following Code in Controller
import oracle.apps.fnd.framework.OAException;
import oracle.apps.fnd.framework.OAApplicationModule;
import java.io.Serializable;
...
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processFormRequest(pageContext, webBean);
OAApplicationModule am = pageContext.getApplicationModule(webBean);
if (pageContext.getParameter("Sum") != null)
{
Serializable[] parameters1 = { pageContext.getParameter("item1"),
pageContext.getParameter("item2"),
};
String retVals1 = (String)am.invokeMethod("dataSumAction", parameters1);
String message = "Sum: " + retVals1;
throw new OAException(message, OAException.INFORMATION);
}
}
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
KFF
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
3. Create a New View Object (VO)
Right click on KFFDemo > New > ADF Business Components > View Object
Name -- KFFVO
Package -- prajkumar.oracle.apps.fnd.kffdemo.server
Note - The VO is not based on any EO so click next and go to the query section and paste the query
SELECT code_combination_id
FROM gl_code_combinations_kfv
9. Create a New Item of type Flex under the Stack Layout Region
Right click on MainRN > New > Item
Set Following Properties for New Item --
Attribute Property
ID KeyFlexItem
Item Style Flex
Prompt Accounting Key Flex Field
Appl Short Name SQLGL
Name GL#
Type Key
View Instance KFFVO1
10. Create Controller for page KFFPG
Right Click on PageLayoutRN > Set New Controller
Package Name: prajkumar.oracle.apps.fnd.kffdemo.webui
Class Name: KFFCO
Write Following Code in KFFCO processRequest
public void processRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processRequest(pageContext, webBean);
OAKeyFlexBean kffId = (OAKeyFlexBean)webBean.findIndexedChildRecursive("KeyFlexItem");
// Set the code combination lov
kffId.useCodeCombinationLOV(true);
//set the structure code for the item key flex
kffId.setStructureCode("FED_AFF");
//Set the attribute name to the item
kffId.setCCIDAttributeName("CodeCombinationId");
//Execute the Query
KFFAMImpl am = (KFFAMImpl)pageContext.getApplicationModule(webBean);
KFFVOImpl vo = (KFFVOImpl)am.findViewObject("KFFVO1");
if(!vo.isPreparedForExecution())
{
vo.executeQuery();
}
}
Note -- If you do not want to see the key flex field is merging one then change the code in the controller class as below
kffId.useCodeCombinationLOV(false);
11. Use the below Query to find the Structure Code
SELECT fif.application_id,
fif.id_flex_code,
fif.id_flex_name,
fif.application_table_name,
fif.description,
fifs.id_flex_num,
fifs.id_flex_structure_code,
fifse.segment_name,
fifse.segment_num,
fifse.flex_value_set_id
FROM fnd_id_flexs fif,
fnd_id_flex_structures fifs,
fnd_id_flex_segments fifse
WHERE fif.application_id = fifs.application_id
AND fif.id_flex_code = fifs.id_flex_code
AND fifse.application_id = fif.application_id
AND fifse.id_flex_code = fif.id_flex_code
AND fifse.id_flex_num = fifs.id_flex_num
AND fif.id_flex_code LIKE 'GL#'
AND fif.id_flex_name LIKE 'Accounting Flexfield';
x
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
Implement Train in OAF Page
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
Let us try to implement train between three pages. Consider three pages each having Text Item
1. Create a New OA Workspace and Empty OA Project
File> New > General> Workspace Configured for Oracle Applications
File Name -- TrainProj
Project Name – TrainDemoProj
Default Package -- prajkumar.oracle.apps.fnd.traindemo
2. Create Application Module AM
TrainDemoProj right click > New > ADF Business Components > Application Module
Name -- TrainDemoAM
Package -- prajkumar.oracle.apps.fnd.traindemo.server
Check Generate JavaFile(s)
Create Three Pages TrainDemoPG1, TrainDemoPG2 and TrainDemoPG3 as similar way as mention below to create TrainDemoPG1
3. Create a OA components Pages
TrainDemoProj right click > New > OA Components > Page
Name – TrainDemoPG1
Package -- prajkumar.oracle.apps.fnd.traindemo.webui
4. Modify the Page Layout (Top-level) Region
Attribute Property
ID PageLayoutRN
Region Style pageLayout
Form Property True
Auto Footer True
Window Title Train Demo Window Title
Title Train Demo Page Header
AM Definition
prajkumar.oracle.apps.fnd.traindemo.server.TrainDemoAM
5. Create the Second Region (Main Content Region)
Select PageLayoutRN right click > New > Region
Attribute Property
ID MainRN
Region Style messageComponentLayout
Create Text Items for all three pages say TextItemPage1, TextItemPage2 and TextItemPage3 in respective pages TrainDemoPG1, TrainDemoPG2 and TrainDemoPG3 in similar way of as mention below to create TextItemPage1 in page TrainDemoPG1
6. Create Text Items
Select MainRN right click > New > messageTextInput
Prompt – TextItemPage1
Length -- 20
7. Create a Standalone Train Region
TrainDemoProj > New > Web Tier > OA Components > Region
Name -- TrainRN
Package – prajkumar.oracle.apps.fnd.traindemo.webui
Style – train
Select TrainRN inStructure pane and open property inspector and set Allow Interaction property to True
8. Add Three Train Nodes to TrainRN
Right Click on TrainRN in Structure pane > New > Link
Set the link properties as follow --
ID – TrainStep1
Item Style – link
Text – Step 1
Destination URI – OA.jsp?page=/prajkumar/oracle/apps/fnd/traindemo/webui/TrainDemoPG1
Right Click on TrainRN in Structure pane > New > Link
Set the link properties as follow --
ID – TrainStep2
Item Style – link
Text – Step 2
Destination URI – OA.jsp?page=/prajkumar/oracle/apps/fnd/traindemo/webui/TrainDemoPG2
Right Click on TrainRN in Structure pane > New > Link
Set the link properties as follow --
ID – TrainStep3
Item Style – link
Text – Step 3
Destination URI – OA.jsp?page=/prajkumar/oracle/apps/fnd/traindemo/webui/TrainDemoPG3
9. Add Train Region to each of your Pages
For each of three pages in multistep flow, right click the pageLayoutRN in structure panel, and select New > location from page Context menu
Set following properties as follow --
ID – TrainDemoRN
Extends -- /prajkumar/oracle/apps/fnd/traindemo/webui/TrainRN
10. Create a Standalone (Shared) TrainFooterRN
TrainDemoProj > New > Web Tier > OA Components > Region
Name -- TrainFooterRN
Package -- prajkumar.oracle.apps.fnd.traindemo.webui
Region Style -- pageButtonBar
11. Add navigrationBar
Select TrainFooterRN in Structure pane right click > New > Region
Set the region properties as follows:
ID -- NavBar
Region Style – navigationBar
First Step – 1
Last Step – 3
12. Add Links to the navigrationBar
Right Click on NavBar > New > link
Set Item’s properties as follows:
ID – Step1Link
Item Style – link
Text – Step 1 of 3: Page1
Warn About Changes – False
Destination URI -- /prajkumar/oracle/apps/fnd/traindemo/webui/TrainDemoPG1
Right Click on NavBar > New > link
Set Item’s properties as follows:
ID – Step2Link
Item Style – link
Text – Step 2 of 3: Page2
Warn About Changes – False
Destination URI -- /prajkumar/oracle/apps/fnd/traindemo/webui/TrainDemoPG2
Right Click on NavBar > New > link
Set Item’s properties as follows:
ID – Step3Link
Item Style – link
Text – Step 3 of 3: Page3
Warn About Changes – False
Destination URI -- /prajkumar/oracle/apps/fnd/traindemo/webui/TrainDemoPG3
13. Initialize the Footer Region
Select TrainFooterRN in Structure pane right click > Set New Controller
Class Name -- TrainDemoCO
Package Name – prajkumar.oracle.apps.fnd.traindemo.webui
Add following code in processRequest()
import oracle.apps.fnd.framework.webui.beans.nav.OATrainBean;
import oracle.apps.fnd.framework.webui.beans.nav.OANavigationBarBean;
...
public void processRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processRequest(pageContext, webBean);
OATrainBean trainBean = (OATrainBean)pageContext.getPageLayoutBean().getLocation();
trainBean.prepareForRendering(pageContext);
int step = trainBean.getSelectedTrainStepRenderedIndex();
OANavigationBarBean navBean = (OANavigationBarBean)webBean.findChildRecursive("NavBar");
navBean.setValue(step+1);
} // end processRequest()
14. Add the Navigation Region to your pages
For each of three pages in the multistep flow, right click the PageLayoutRN in Structure pane and select New > Region
Set the region’s properties as follow:
ID -- PageButtonBar
Style -- pageButtonBar
Extends -- /prajkumar/oracle/apps/fnd/traindemo/webui/TrainFooterRN
15. Congratulation you have successfully finished. Run Your TrainDemoPG1 page and Test Your Work
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
OAF Validation
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
BseFnoMasterEOImpl.java at Enity Object level
--------------------------------------------------
protected void doDML(int operation , TransactionEvent e)
{
super.doDML(operation, e);
String value = getEmail();
if (value==null)
{
throw new OAAttrException(OAException.TYPE_ENTITY_OBJECT,
getEntityDef().getFullName(), // entity name
getPrimaryKey(), //entity primary key
"Email", //attribute name
value, //bad attribute value
"FND", //message application short name
"XXCUS_EMAIL_REQ");
}
}
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
INSERT ROW
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
public void processRequest(OAPageContext pageContext, OAWebBean webBean)
{super.processRequest(pageContext, webBean);
OAApplicationModule am=pageContext.getApplicationModule(webBean);
am.invokeMethod("CreateSupplierRow");
}
public void processRequest(OAPageContext pageContext, OAWebBean webBean)
{super.processRequest(pageContext, webBean);
OAApplicationModule am=pageContext.getApplicationModule(webBean);
String event= pageContext.getParameter(OAWebBeanConstants.EVENT_PARAM);
String source= pageContext.getParameter(OAWebBeanConstants.SOURCE_PARAM);
if(pageContext.getParameter("Apply")!=null)
{am.invokeMethod("SaveData");
//These five lines are there to display the confirmation Message
String supId=pageContext.getParameter("SupplierID");
String supName=page.Context.getParameter("SupplierName");
MessageToken[] tokens= {new MessageToken("SUPID",supId), new MessageToken("SNAME",supName)};
OAException msg = new OAException("PO","xxinsertData", tokens, OAException.Confirmation,null);
throw msg;
}
if(ADD_ROWS_EVENT.equals(event))
{
am.invokeMethod("CreateSitesRow");
}
}
public void CreateSupplierRow()
{
SuppliersEOVOImpl vo = getSuppliersEOVO1();
Row row= vo.createRow();
if(!vo.isPreparedForExecution())
{vo.setmaxFetchSize(0);
}
vo.insertRow(row);
Number seq = getOADBTransaction().getSequenceValue("fwk_tbx_suppliers_s");
row.setAttribute("SupplierId",seq)
row.setNewRowState(Row.STATUS_INITIALIZED);
}
public void CreateSitesRow()
{
SitesEOVOImpl vo = getSitesEOVO1();
SuppliersEOVOImpl vo1 = getSupplerEOVO1();
Row siterow=vo.createRow();
if(!vo.isPreparedForExecution())
{ vo.setMaxFetchSize(0);
}
int count = vo.getRowCount();
vo.insertRowAtRangeIndex(count,siterow);
OA Extensions to extend existing Apps OA Framework pages
Create customization in existing package
-----------------------------------------
1) Create new project
In my simple test, I am creating a new OA Project called "mzExtend"I am using application shortname "MZ" and responsibility key "MZCUSTOMSSWA" for my project, as this is already setup on my environment (see Note 216589.1)
In project settings, change the Runner options in configuration section to add the entry "-Djbo.project=mzExtend" to the end of the line.
Also add "F:\oracle\viscomn\java" to the "Additional Classpath" (this is a shared network drive to my OA_JAVA directory) You would have to copy the server.xml to your local PC first, if the Apps 11i instance was on a Unix box.
2) Add existing BC4J Objects to your project
Refer to chapter 9 on the Developers Guide "Extending OA Framework Applications"
The "server.xml" files are shipped with Apps 11i, so you add the server.xml file to your custom project in order to access the original BC4J objects. You need access to the original objects in order to select them in the "extends" field when creating your new object.
Add the file "F:\oracle\viscomn\java\oracle\apps\ar\irec\common\server\server.xml" to the project. This will create a BC4J Package in your custom project.
For my custom page, I need to create a custom VO and AM
oracle.apps.ar.irec.common.server.InternalCustomerSearchByCustomerIdVO
oracle.apps.ar.irec.common.server.CustomerSearchAM
Create a new VO, extending the original
oracle.apps.ar.irec.common.server.mzInternalCustomerSearchByCustomerIdVO
Manually copy the SQL from the original VO, my customization requires me to remove the WHERE clause from the original SQL
Create a new AM, extending the original
oracle.apps.ar.irec.common.server.mzCustomerSearchAM
In the view objects selection, add "mzInternalCustomerSearchByCustomerIdVO"
I am modifying these java files, to enable a default selection to show when the custom page is launched
mzCustomerSearchAMImpl.java
mzInternalCustomerSearchByCustomerIdVOImpl.java
3) Create a new OA Web page called "mzSearchPG.xml"
Simple page, with 4 fields from "mzInternalCustomerSearchByCustomerIdVO"
Add a Page Controller "mzSearchPGCO.java" to send a hard coded customerID to the AM to show customer data on the page when the page is launched (I told you this was a simple example :-) ) See java code in Appendix A below.
Run this page through JDeveloper and check it displays the page, with some data on it..
4) Now I want to deploy this to my Apps 11i instance, so I can run through Apps itself
a) First copy over the compiled objects, if using your custom scheme, this could be easiest achieved by copying over the whole of the D:\Jdev_510\jdevhome\jdev\myclasses\oracle\apps\mz directory to the $OA_JAVA\oracle\apps\mz directory, although you can be more selective if required
NOTE - it is the "myclasses" files you need to copy (the .class not the .java files!)
In this case, I have added classes to the existing ar directory structure, so need to copy the 4 class files from "D:\Jdev_510\jdevhome\jdev\myclasses\oracle\apps\ar\irec\common\server" to the $OA_JAVA/oracle\apps\ar\irec\common\server directory.
b) I have not yet used the "substitution" mechanism in JDev to use custom objects rather than the original ones, but had I done so, I would need to load the <Project Name>.jpx file into the MDS. Follow the instructions in the Developers Guide, chapter 9 "Deploying Customer Extentions" to do this, but you can use a batch file like below:-
REM
REM Batch file to set environment to upload JPX file into Apps database
REM
REM This section is for the PC specific variables
set JDEV_BIN_HOME=D:\Jdev_510\jdevbin
set JDEV_USER_HOME=D:\Jdev_510\jdevhome\jdev
set DB_CONNECTION="(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(host=hostname.domain.com)(port=1521))(CONNECT_DATA=(SID=VIS)))"
set JPX2UPLOAD=mzExtend
set APPS_PASSWD=apps
REM End of PC specific variables
REM Set PATH to ensure we are using the right Java.exe
set PATH=%JDEV_BIN_HOME%\jdk\bin;%JDEV_BIN_HOME%\jdev\bin;%PATH%
REM This is what we actually want to run...
call jpximport.bat %JDEV_USER_HOME%\myprojects\%JPX2UPLOAD%.jpx -username apps -password %APPS_PASSWD% -dbconnection %DB_CONNECTION%
pause
REM End of process
This loads the JPX into the MDS, for example to the location
/oracle/apps/ar/irec/common/server/customizations/site/0/mzInternalCustomerSearchByCustomerIdVO
To remove the substitution, you would need to use JDR_UTILS, for example
exec jdr_utils.deleteDocument('/oracle/apps/ar/irec/common/server/customizations/site/0/mzInternalCustomerSearchByCustomerIdVO');
c) Deploy the XML pages into MDS from local PC. Can use following wrapper script
REM
REM Batch file to set environment to upload XML Page files into Apps database
REM
REM This section is for the PC specific variables
set JDEV_BIN_HOME=D:\Jdev_510\jdevbin
set JDEV_USER_HOME=D:\Jdev_510\jdevhome\jdev
set JDEV_PROJECT_HOME=%JDEV_USER_HOME%\myprojects
set DB_CONNECTION="(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(host=hostname.domain.com)(port=1521))(CONNECT_DATA=(SID=VIS)))"
REM example of PAGE2UPLOAD mz\comments\bc4jcomponents\CreateCommentPG
REM can also just specify directory to load all pages in that directory
set PAGE2UPLOAD=ar\irec\common\server
set APPS_PASSWD=apps
REM End of PC specific variables
REM Set PATH to ensure we are using the right Java.exe
set PATH=%JDEV_BIN_HOME%\jdk\bin;%JDEV_BIN_HOME%\jdev\bin;%PATH%
REM This is what we actually want to run...
call import.bat %JDEV_PROJECT_HOME%\oracle\apps\%PAGE2UPLOAD% -rootdir %JDEV_PROJECT_HOME% -mmddir %JDEV_BIN_HOME%\jdev\lib\ext\jrad\config\mmd -username apps -password %APPS_PASSWD% -dbconnection %DB_CONNECTION% -jdk13 -validate
pause
REM End of process
Check they are uploaded OK, using the SQL
REM START OF SQL
set serveroutput on
set pagesize 132
exec JDR_UTILS.listContents('/oracle/apps/ar/irec/common/server', true);
REM END OF SQL
The following is a general script to look for all pages in your custom schema
REM START OF SQL
set serveroutput on
set pagesize 132
exec JDR_UTILS.listContents('/oracle/apps/mz', true);
REM END OF SQL
d) Create new Function to call the page, for example:
Function Name = MZ_CREATE_COMMENT
User Function Name = mz Create Comment
Type = SSWA JSP Function (JSP)
HTML Call = OA.jsp?page=/oracle/apps/mz/comments/bc4jcomponents/CreateCommentPG
In my case, I am adding the following:
Function Name = MZ_CUSTOMER_SEARCH
User Function Name = mz Customer Search
Type = SSWA JSP Function (JSP)
HTML Call = OA.jsp?page=/oracle/apps/ar/irec/common/server/mzSearchPG
e) Add function to menu
MZ_CUSTOM_SSWA menu for example.
f) Bounce Apache
g) Test page
Login as user with the responsibility to see the menu
Select the menu function to launch the page and check the results are the same as from JDeveloper
Create similar customization, in custom schema
----------------------------------------------
I really should have created the above customization in my custom schema, so will do so now.
Create a new empty BC4J package called
oracle.apps.mz.sanity.server
For my custom page, I need to create a custom VO and AM
Create a new VO, extending the original
oracle.apps.mz.sanity.server.mzSearchVO
Manually copy the SQL from the original VO, my customization requires me to remove the WHERE clause from the original SQL
Create a new AM, extending the original
oracle.apps.mz.sanity.server.mzSearchAM
In the view objects selection, add "mzSearchVO"
I am modifying these java files, to enable a default selection to show when the custom page is launched
mzSearchAMImpl.java
mzSearchVOImpl.java
3) Create a new OA Web page called "mzNewSearchPG.xml"
Simple page, with 4 fields from "mzSearchVO"
Add a Page Controller "mzNewSearchCO.java" to send a hard coded customerID to the AM to show customer data on the page when the page is launched.
Run this page through JDeveloper and check it displays the page, with some data on it..
4) Deploy the page and java objects to the Apps 11i instance and re-test
5) Once checked that it is working, I am now going to personalize this new screen.
I did not include all the items from the VO in the customization, so will add a new field to the page directly.
Do a Site level personalization, then add an item.
Type = Stylised Text
ID = ConcatenatedAddress
prompt = Address
VO Attribute = ConcatenatedAddress
VO Instance = mzSearchVO1
On saving this personalization and returning to the page, you will see the Address text on the page as well
APPENDIX A
--
-- java code for mzSearchPGCO page controller
-- (comments and spacing stripped out)
--
package oracle.apps.ar.irec.common.server.webui;
import java.io.Serializable;
import oracle.apps.fnd.common.MessageToken;
import oracle.apps.fnd.common.VersionInfo;
import oracle.apps.fnd.framework.OAApplicationModule;
import oracle.apps.fnd.framework.OAException;
import oracle.apps.fnd.framework.OAViewObject;
import oracle.apps.fnd.framework.webui.OAControllerImpl;
import oracle.apps.fnd.framework.webui.OADialogPage;
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import oracle.jbo.domain.Number;
public class mzSearchPGCO extends OAControllerImpl
{
public static final String RCS_ID="$Header$";
public static final boolean RCS_ID_RECORDED =
VersionInfo.recordClassVersion(RCS_ID, "%packagename%");
public void processRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processRequest(pageContext, webBean);
-- NOTE this is hard coded value for quickness and simplicity.
String customerId = "8070";
OAApplicationModule am = pageContext.getApplicationModule(webBean);
Serializable[] params = { customerId };
am.invokeMethod("initDetails", params);
}
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processFormRequest(pageContext, webBean);
}
} // end of class
IMPORTANT NOTE
--------------
Ensure you are using the correct version of JDeveloper. Review Note 416708.1 to confirm the correct patch number
RELATED DOCUMENTS
-----------------
Note 330236.1 "Configuring JDeveloper For Use With Oracle Applications 11i"
Note 357218.1 "Troubleshooting JDeveloper setup for Oracle Applications"
Note 416708.1 "How to found right version of JDeveloper for eBusiness Suite 11i and 12"
---------------------------------------------------------------------------------------------------------------------------------
Oracle Application Framework (OAF) Interview Questions and Answers
1. What is an EO?
a. Map to a database table or other data source
b. Each entity object instance represents a single row
c. Contains attributes representing database columns
d. Fundamental BC4J object through which all inserts/updates/deletes interact with the database
e. Central point for business logic and validation related to a table
f. Encapsulates attribute-level and entity-level validation logic
g. Can contain custom business methods
2. What is a VO?
a. Represent a query result
b. Are used for joining, filtering, projecting, and sorting your business data
c. Can be based on any number of entity objects
d. Can also be constructed from a SQL statement
3. What are the methods in controller?
ProcessRequest, ProcessformData and processformrequest
ProcessRequest : is called when the page is requested for the first time from the server.
ProcessFormRequest : is called when some event occurs on the page
ProcessformData(not visible). : Used to capture Data from the form fields which the user has entered and post it into Model Layer.
4. What is a Controller?
Controller is the java file and can be associated to a complete OAF page or to a specific region.
There are several tasks you will do routinely in your code.
Handle button press and other events
Automatic queries
Dynamic WHERE clauses
Commits
JSP Forwards
The logic for accomplishing all these tasks is written in controller
5. When is the processRequest method called?
PR method is called when the page is getting rendered onto the screen
6. When is processFormRequest method called?
PFR method is called when we perform some action on the screen like click of submit button or click on lov
7. What is extension?
Extension is when you take an already existing component ex an OAF page or a region and then add some more functionality to it without disturbing the original functionality.
8. What is personalization?
Oracle Apps Framework has an OA Personalization Framework associated with it so that you can personalize any OAF page in an Oracle E-business Suite application without changing the basic or underlying code of that OA Framework page, Oracle Application Framework makes it very easy to personalize the appearance of the page or even the personalization of data displayed on to an OA Framework page.
9. What are levels of personalization?
1. Function Level
2. Localization Level
3. Site Level
4. Organization Level
5. Responsibility Level
6. Admin-Seeded User Level
7. Portlet Level
8. User Level
10) What is BC4J?
Business Components for Java is JDeveloper’s programming framework for building multitier database applications from reusable business components. These applications typically consist of:
• A client-side user interface written in Java and/or HTML.
• One or more business logic tier components that provide business logic and views of business objects.
• Tables on the database server that store the underlying data.
11.What are all the components of BC4J?
Following are the components of BC4J:
• Entity Object - EO encapsulates the business logic and rules. EO’s are used for Inserting, Updating and Deleting data from the database table. E0 is also used for validating the records across the applications.
• View Object - View object encapsulates the database query. It is used for selecting data. It provides iteration over a query result set. VO’s are primarily based on EO’s. It can be used on multiple EO’s if the UI is for update.
• Application Module - Application Modules serve as containers for related BC4J components. The pages are related by participating in the same task. It also defines the logical data model and business methods needed.
12) What is an EO?
EO encapsulates the business logic and rules.EO’s are used for Inserting, Updating and Deleting data. This is used for validating across the applications. We can also link to other EO’s and create a Association object.
13) What is an VO?
View object encapsulates the database query. It is used for selecting data. It provides iteration over a query result set.VO’s are primarily based on Eo’s. It can be used on multiple EO’s if the UI is for update. It provides a single point of contact for getting and setting entity object values. It can be linked together to form View Links.
14) What is an AO?
An association object is created where we link EO’s. For example take the search page where we link the same EO to form a association between the manager and employee. Every employee should have a manager associated. But if it President then no there is no manager associated. This is a perfect example to understand the AO.
15) What is an VL?
A view link is an active link between view links. A view link can be created by providing the source and destination views and source and destination attributes. There are two modes of View link operation that can be performed. A document and Master/Detail operation.
16). What is UIX?
UIX is an extensible, J2EE-based framework for building web applications. It is based on the Model-View-Controller (MVC) design pattern, which provides the foundation for building scalable enterprise web applications.
17). Where the VO is located in the MVC architecture?
VO is located in the View Layer in MVC which is responsible for presenting the data to the user.
18) Which package should include EO and AO.
The EO and AO will be present in the schema.server package.
19) What is the difference between inline lov and external lov.
Inline lov is a lov which is used only for that particular page for which it was created and cannot be used by any other page.
External lov is a common lov which can be used by any page. It is a common component for any page to use it. It can be used by giving the full path of the lov in the properties section “External LOV” of the item.
20) what is a Javabean?
JavaBeans is an object-oriented programming interface that lets you build re-useable applications or program building blocks called components that can be deployed in a network on any major operating system platform.
21) What is query Bean?
QueryBean is used to execute and return the results of a query on behalf of the QueryPortlet application.
22) what is the difference between autocustomization criteria and result based search?
Results based search generates search items automatically based on the columns on the results table.
In Autocustomization search we need to set what all fields are required to display as a search criteria.
23) what is MDS?
MDS is MetaData Service. When a web page is broken into small units like buttons,fields etc they are stored in a database. These are not stored as binary files but as data in tables. The data are present in JDR tables. MDS provides service to store & return page definitions. MDS collects those definitions in components/fields in a meaningful manner to build a page.
24) What is XML?
XML is a markup language for documents containing structured information.
Structured information contains both content (words, pictures, etc.) and some indication of what role that content plays (for example, content in a section heading has a different meaning from content in a footnote, which means something different than content in a figure caption or content in a database table, etc.).
25) What is the difference between customization and extension?
Customization is under direct user control. The user explicitly selects between certain options. Using customization a user can:
Altering the functionality of an application
Altering existing UI
Altering existing business logic
Extension is about extending the functionality of an application beyond what can be done through personalization. Using extension we can:
Add new functional flows
Extend or override existing business logic
Create New application/module
Create New page
Create New attribute
Extend/Override defaults & validations
26) What is Personalization?
Personalization enables you to declaratively tailor the UI look-and-feel, layout or visibility of page content to suit a business need or a user preference. Using Personalization we can:
• Tailor the order in which table columns are displayed.
• Tailor a query result.
• Tailor the color scheme of the UI.
• Folder Forms
• Do Forms Personalization
27)Can you extend every possible Application Module?
Answer: No..Root AM cannot be extended.
28) What is rootAM?
The application module which is associated with the top-level page region (the pageLayout region) is root application module.
29) Why can’t Root AM be extended?
The root AM is loaded first and after that the MDS Substitutions are parsed.
Hence ROOT AM gets loaded even before the time the substitutions definition from MDS layer get worked out.
Obviously, the root am cant substitute itself, hence it can’t be extended
30)What are the various profile options in OAF?
FND Diagnostics: required for ABOUT THIS PAGE and Diagnostic link on page.
Personalize Self Service Definitions: To enable Personalize page link on the page.
FND Personalization Region Link Enabled: used to enable Region Personalization links at every region.
FND Migrate to JRAD: By default set to Yes. Page would run from MDS if Yes, else it will run from AK.
FND Document root path: required for personalization migration. It is set to path of the MDS folder on the respective servers.
FND Branding image:
FND Banding Size: these profiles options are used for changing standard image (Oracle) on the page.
31)Steps for VO substitution?
1. About this Page-> VO, AM, EO, Path of Page
2. Export Commad (in cmd Prompt)
3. New .jpr =Open page
4. Look for AM and VO or EO.
5. Copy the class files of VO,AM or EO
6. Decompile into Java and store it into MyProjects (with respective directory structure)
7. Open VO.xml in a new jpr
8. Create a new BC4J based on your Original VO.
9. Create a new VO and extends original VO
10. Change the query
11. Rebuild the project
12. Go to .jpx(double click)
13. Go to Substitutions
14. Substitute Vo
15. Rebuild your Project .jpr
16. Transfer New VO class and xml to respective directory structure
17. FTP .jpx into $JAVA _TOP
18. unix command promrt CD$ JAVA_TOP
19. jpx importer command
20. Bounce Apache Server
32)What are different methods for passing paramaters?
1. Tokens
eg. vname={@AttributeName}
2. Hash Maps
eg. HashMap variablename=nre HashMap();
variablename.add(“ParameterName”,ParameterValue);
3.ThroughSession
eg. pageContext.putSessionvalue(“ParamterName”,ParameterValue)
33) setForwardURL list
There are many parameters, here is the complete list of it:-
public void setForwardURL(String functionName,
byte menuContextAction,
String menuName,
com.sun.java.util.collections.HashMap parameters,
boolean retainAM,
String addBreadCrumb,
byte messagingLevel)
Parameters:
functionName – This is the function name representing the page you want to forward to. If its null, an IllegalArgumentException will be thrown.
Also if the function is not under the current HOMEPAGE a OAException will be thrown.
menuContextAction – Determines the behavior of the MenuContext after forwarding to the new page. It accepts the following values:
OAWebBeanConstants.KEEP_MENU_CONTEXT: Keeps the menu context as is.
OAWebBeanConstants.KEEP_NO_DISPLAY_MENU_CONTEXT: Keeps the menu context as is, but will not display all menus including global buttons.
OAWebBeanConstants.KEEP_NO_DISPLAY_MENU_CONTEXT_RETAIN_GLOBAL_BUTTONS: Keeps the menu context as is, but will not display all menus excluding global buttons.
OAWebBeanConstants.REMOVE_MENU_CONTEXT: Removes the menu context
OAWebBeanConstants.GUESS_MENU_CONTEXT: Selects the given functionName function if it exists in the current menu.
If not it will try to make a guess by moving up the menu tree until it finds it. An exception will be thrown if the function could not be located.
OAWebBeanConstants.RESET_MENU_CONTEXT: Reset the menu context to the given functionName and menuName.
menuName – The name of the HOMEPAGE menu to reset the Menu context to when the menuContextAction is OAWebBeanConstants.RESET_MENU_CONTEXT.
If the menuName is not of type HOMEPAGE a OAException will be thrown. You can pass null otherwise.
parameters -
HashMap of parameter name/value pairs to append to the forward URL. The final forward URL parameters are in the following sequence:
It will first get the function’s corresponding URL call by querying the function information from the database. If the user is not authorized to execute this function, a security OAException will be thrown.
It will then append all parameters passed in the parameters HashMap. First parameter added to the HashMap will be first added to the URL. Also the framework will encode all parameter values before appending them to the URL.
It will remove all parameters if they have null values in the passed parameters HashMap. This provides an easy way for developers to set a certain parameter’s value to null if they want to remove it.
It will remove any OA Framework internal URL parameters such as bcrumb, retainAM, and so on..
retainAM – If true, all the cached application modules will be retained. If false, all the cached application modules will be released.
Developers must use this parameter to control the release behavior of the cached appplication modules.
This method will ignore any retainAM=true or retainAM=false as a URL parameter or as part of parameters
34)Code to copy rows in VO
public void copy()
{
SuppliersVOImpl pervo = getSuppliersVO1();
Row row[] = pervo.getFilteredRows("SelectFlag","Y");
for (int i=0;i<row.length;i++)
{
SuppliersVORowImpl rowi = (SuppliersVORowImpl)row;
OADBTransaction trx = (OADBTransaction)getTransaction();
Number b = trx.getSequenceValue("FWK_TBX_SUPPLIERS_S");
AttributeList a = (AttributeList)rowi;
SuppliersVORowImpl r =(SuppliersVORowImpl)pervo.createAndInitRow(a);
//Set here your unique attribute values, I'm setting here Supplier Id as for every new row it should be different.
r.setSupplierId(b);
pervo.insertRow(r);
}
}
35)what for isPreparedForExecution() and executeQuery() methods used?
isPreparedForExecution function will check whether all parameters are assigned properly and query is ready for execution.
On multiple navigations to the page this query will not be executed multiple times.
While executeQuery function is used for executing the VO query so that it can fetch the data from database into VO cache.
36) What is the pattern used in developing any OAF component?
MVC (Model, View, Controller)
Lists the components in the MVC architecture
Model: Application Module, View Objects, View Links, Entity Objects, Entity Associations etc.
View: Page, Region, Attributesets etc.
Controller: Controller class files
37) Which is the component responsible for user actions?
Controller is the object. The code present in ProcessFormRequest gets executed up on the user action.
38) If we have to initialize something during the page loading, which is the right place?
A. ProcessRequest() method of the Controller file is the right place.
39) What is the significance of ProcessFormData()?
For a ‘POST’ request the data on the page is binded to the view object in this method
40) Does ‘GET’ request result in calling ProcessFormData()?
No, only POST request calls that.
41. What is the main Controller component in OAF?
OAController is the main class and our controller will become subclass of it.
42.How does page structure get created at runtime?
OAPageBean is responsible for creating the bean hierarchy structure at runtime after calling ProcessRequest() of each of the beans in the hierarchy.
43.Where does the client BC4J objects get placed in the server?
A. They are located in the oracle.apps.<product>.<application>.server
44.Where does the server BC4J objects get placed in the server?
They are located in the oracle.apps.<product>.<application>.schema.server
45.Where does the Page and Controller related files get placed?
They are located in oracle.apps.<product>.<application>.webui
46.What are Validation View Objects?
They are the VVO’s used in validation of attributes, they are the BC4J components and have their AM ie VAM Validation Application Module
47. What is the version of Jdeveloper to be used in 11i or R12?
For 11i, Jdeveloper 9i will be used and for R12 Jdeveloper 10g will be used.
48. What is a Database Connectivity File?
It is a .dbc file which is specified in the project properties. The location of this file on the server is $FND_TOP/secure
49. What is a View Object?
It is a BC4J(Business Component for Java) object which encapsulates the query results. View objects will support the display of the content to user in the Page.
50. How do you create a view object?
View objects can be created in the Business components package, can be based on entity objects or an sql query. View objects based on sql query are read only view objects
51. WHAT IS AN ENTITY OBJECT?
Entity object is created based on a database table, it is responsible for insertion/updation/validation of the table data. They are stored in the oracle.apps.<prod>.<application>.schema.server package directory
52. What is an Application Module(AM)?
Application module holds the related objects pertaining to an application ie. View objects, Entity Objects etc. The application module helps in getting the required database connection, maintains the page session or transaction context
53. What is the object passed to every page request?
OAPageContext object is passed to every request, using this object the controller initializes the application module object and will call the required methods.
54. Where is the view object(VO) initialization or query filtering done?
It is done with view object implementation class Ex. EmpVOImpl.java
55. What is the property to set for an AM so that the transaction state is maintained across pages?
RETENTION_LEVEL property is set to value MANAGE_STATE for an AM.
56.What is the Personalization?
Personalization means changes to the existing ‘Page’ according to the customer requirement
57.Give some examples of Page Personalization?
Addition of new columns to a table results, adding of fields, changing the order of regions, columns etc. Apart from this validation of certain fields, display of Descriptive flex fields etc can also be achieved
58. WHAT IS EXTENSION?
Extension is the changing of the existing components for adding more features or customer required features. View Objects, Controller, Application Module can be extended.
59. What is substitution?
When view objects are extended, we need to tell the applications that our extended view object should be used or substituted during runtime, substitution will serve this purpose
60. How to do register a new OA Framework page in Oracle Applications?
oracle.jrad.tools.XMLImporter utility will be used. After successfully importing the page data will be stored in metadata repository tables of the database
61. How do you move personalization from one machine to another?
Using the functional administrator responsibility the xml file can be downloaded, this file contains the required personalization done on a particular page. The same can be used to upload in a different instance. Here XMLImporter utility can be also used.
62. How is the applications security maintained during the OA Framework components development or how is the required security obtained?
The Database connectivity file ( .dbc file) has the applications username and password along with the responsibility to be used for connecting to the applications at page run time.
63. What are the different layers of onion reuse object model in OAF?
The hierarchy is as :
Controller (XXCO.java)
|__
Application Module (XXAMImpl.java, XXAM.xml)
|__
View Objects(XXVOImpl.java, XXVORowImpl.java, XXVO.xml)
|__
Entity Objects(XXEOImpl.java, XXEO.xml)
|_ Database
64. What is ‘Partial Page Rendering’ PPR?
A. PPR is a mechanism where in only the required part of the page is refreshed as against the whole page. The page objects fire the ‘events’ and accordingly the request is handled in the controller file
65. What are the search region options available?
Simple Search – ResultBasedSearch is the construction mode for the region
Advanced or autocustomization search – Autocustomization is the mode here
None – User has the develop the page, regions, controller etc here
66. What is the bean used for supporting transactions across pages visually to the user?
OATrainBean is used to link the pages across the transaction. AM supports the transaction context or state here across the pages.
67. How does personalization takes its effect at runtime?
After the page structure or bean hierarchy is formed with, the personalization layers get applied on top of it to come up with the final structure. Remember that is the reason why personalization is upgrade safe.
68. Name some components requiring extension?
View Objects, Controller, Application Module. Yes nested application module concept is allowed.
After you modify a class file and move it to the server what is the immediate step that will be followed?
The services of the instance ie. Apache server etc. have to be bounced so that the new code in the class file takes effect.
69. Where does the two categories of files in OAF be placed in the server?
All the xml files of the page/region will be placed in the respective TOP’s mds directory. All the class files irrespective of TOP will be placed under $JAVA_TOP which can be $COMMON_TOP/java
70. When do you create additional business components package?
Apart from B4CJ client business components package and B4CJ server business components package we create additional business components package when we develop any sharable thing such as ‘LOV’ (List of Values), ‘Poplist’ etc which will be used in multiple pages
71. How do you map the LOV created to your base page?
One of the items in the page has to be MessageLOVInput which extends the new LOV region, apart from this LOV mappings between base page and LOV region have to be created.
72. What is the default top region of any new page that you create?
PageLayout is the top level default region
73.At what level region controller for a page can be set?
It can be under a Main region under PageLayoutRegion or any region as per the business need. Provision of defining multiple controllers for a page also exist.
74. PPR follows GET or POST flow?
POST flow
75. What is the extension to the tool for developing OA F components?
Jdeveloper OA Extension class support the OA F development
76. What are the methods in controller?
ProcessRequest and processformrequest
77. What is a Controller?
Controller is the java file and can be associated to a complete OAF page or to a specific region.
There are several tasks you will do routinely in your code.
? Handle button press and other events
? Automatic queries
? Dynamic WHERE clauses
? Commits
? JSP Forwards
The logic for accomplishing all these tasks is written in controller
78. When is the processRequest method called?
PR method is called when the page is getting rendered onto the screen
79. When is processFormRequest method called?
PFR method is called when we perform some action on the screen like click of submit button or click on lov
80. What are levels of personalization?
1. Function Level
2. Localization Level
3. Site Level
4. Organization Level
5. Responsibility Level
6. Admin-Seeded User Level
7. Portlet Level
8. User Level
81) What is the difference between inline lov and external lov.
Inline lov is a lov which is used only for that particular page for which it was created and cannot be used by any other page.
External lov is a common lov which can be used by any page. It is a common component for any page to use it. It can be used by giving the full path of the lov in the properties section “External LOV” of the item.
82) what is a Javabean?
JavaBeans is an object-oriented programming interface that lets you build re-useable applications or program building blocks called components that can be deployed in a network on any major operating system platform.
83) What is query Bean?
QueryBean is used to execute and return the results of a query on behalf of the QueryPortlet application.
84) what is the difference between autocustomization criteria and result based search?
Results based search generates search items automatically based on the columns on the results table.
In Autocustomization search we need to set what all fields are required to display as a search criteria.
85) what is MDS?
MDS is MetaData Service. When a web page is broken into small units like buttons,fields etc they are stored in a database. These are not stored as binary files but as data in tables. The data are present in JDR tables. MDS provides service to store & return page definitions. MDS collects those definitions in components/fields in a meaningful manner to build a page.
86) What is XML?
XML is a markup language for documents containing structured information.
Structured information contains both content (words, pictures, etc.) and some indication of what role that content plays (for example, content in a section heading has a different meaning from content in a footnote, which means something different than content in a figure caption or content in a database table, etc.).
87) What is the difference between customization and extension?
Customization is under direct user control. The user explicitly selects between certain options. Using customization a user can:
Altering the functionality of an application
Altering existing UI
Altering existing business logic
Extension is about extending the functionality of an application beyond what can be done through personalization. Using extension we can:
Add new functional flows
Extend or override existing business logic
Create New application/module
Create New page
Create New attribute
Extend/Override defaults & validations
88) What is Personalization?
Personalization enables you to declaratively tailor the UI look-and-feel, layout or visibility of page content to suit a business need or a user preference. Using Personalization we can:
• Tailor the order in which table columns are displayed.
• Tailor a query result.
• Tailor the color scheme of the UI.
• Folder Forms
• Do Forms Personalization
88)Can you extend every possible Application Module?
Answer: No..Root AM cannot be extended.
89) What is rootAM?
The application module which is associated with the top-level page region (the pageLayout region) is root application module.
90) Why can’t Root AM be extended?
The root AM is loaded first and after that the MDS Substitutions are parsed.
Hence ROOT AM gets loaded even before the time the substitutions definition from MDS layer get worked out.
Obviously, the root am cant substitute itself, hence it can’t be extended
91.WHAT IS MVC ARCHITECTURE?
Ans: MVC Architecture is a Model View Controller Architecture. The controller responds to user actions and directs application flow. The model encapsulates underlying data and business logic of the application. The view formats and presents data from a model to the user.
92.which is the MVC layer VO located?
Ans: O is located in the View Layer which is responsible for presenting the data to the user.
93.Which package should include EO and AO.
Ans: The EO and AO will be present in the schema.server package.
94.What is the difference between inline lov and external lov.
Ans: Inline lov is a lov which is used only for that particular page for which it was created and cannot be used by any other page.External lov is a common lov which can be used by any page. It is a common component for any page to use it. It can be used by giving the full path of the lov in the properties section “External LOV” of the item.
95.what is a Javabean?
Ans: JavaBeans is an object-oriented programming interface that lets you build re-useable applications or program building blocks called components that can be deployed in a network on any major operating system platform.
96.What is query Bean?
Ans: QueryBean is used to execute and return the results of a query on behalf of the QueryPortlet application.
what is the difference between autocustomization criteria and result based search?
Ans: Results based search generates search items automatically based on the columns on the results table.
In Autocustomization search we need to set what all fields are required to display as a search criteria.
97. what is MDS?
Ans: MDS is MetaData Service. When a web page is broken into small units like buttons,fields etc they are stored in a database. These are not stored as binary files but as data in tables. The data are present in JDR tables. MDS provides service to store & return page definitions. MDS collects those definitions in components/fields in a meaningful manner to build a page.
98) Why Should we give retainAM=Y?
Ans: The AM should be retained whenever you are navigating away from a page and when you know that there is a possibility to come back to the page again and data is to be retained. Example : Any navigation link that opens in a new page or any navigation which has a back button to come back to the initial page.
The AM should not be retained for two independent pages, especially if they have common VOs which fetch different result sets. In such cases, retaining the AM may not remove the cache of VOs and so the result may not be as expected.
99) What is the significance of addBreadCrumb=Y
Ans: The basic intention of the breadcrumb is to let the user know of the navigation path he took to reach the current page.
100) How do you find right jdev patch for your oracle application version.
Ans: Search in oracle.metalink.com as Jdev with OA Extension.
101) What are the tools you had used for decompiling java class?
Ans: Jad is one of the tool for decompiling the java class.
102. What will setmaxFetchSize(0) will do?
Ans: setmaxFetchSize just determines how much data to be sent at a time.
103.Can we use dynamically created VO in OAF?What is the pros and cons?
Ans: Want to answer this section? use the comment section.
104.What is advanced table in table?
Ans: Want to answer this section? use the comment section.
105.What is a HGrid?
Ans: A HGrid, otherwise known as a hierarchy grid, allows users to browse through complex sets of hierarchical data.
106. Tell me the OAF components required for a simple search page?
Ans: VO,AM,Page
107.What is a switcher in oAF and when it is used?
Ans: A switcher is a control, that allows the selective display of information.For example if you want to display a image for update enabled and update disabled you can use switcher.
108.What are all the methods in CO?
Ans: processForRequest
processRequest
109.When a page renders which method in CO fires?
Ans: processRequest
110.How do you handle back button navigation in OAF based application?
Ans: Want to answer this section? use the comment section.
111.Where will you write your business logic?
Ans: EO.
112.What will vo.createRow() do?
Ans: createRow creates a row in the VO.
113.How do you catch the button event on ProcessFormRequest Method?
Ans: if (“update1?.equals(pageContext.getParameter(OAWebBeanConstants.EVENT_PARAM)))
Here update1 is the event.
114.What is pageButton bar?
Ans: When you want to display buttons on top and bottom of the page then you create a region as pageButtonbar and create buttons within this region.
115.How do you add a link to OAF Page?
Ans: Create a new item with style as link and give its destination uri property which is the url where you want to navigate to.
116.Which is the top most region in OAF page?
Ans: PageLayoutRN
117.What are all the several ways to debug an OAF based application?
Ans: We can use the debugger option .Set breakpoints and run the page in debug mode.
118.How do you call an pl/sql api from OAF page.
Ans: To call a PL/SQL API from OAF, we use OracleCallableStatement or CallableStatement
119.Should a search page have an EO?
Ans: Not necessary. If you are creating a record then we need a EO
120.What will happen when you set DisableClientSideValidation property to True?
Ans: If you set the property to True it shows that there will no validation that will occur on the web tier as part of the form submit.
121.WHAT IS SPEL?
Ans: It is an expression that will either return TRUE or FALSE.
122.Where is a SPEL used?
Ans: SPEL is used in places where you want to show or hide an item programatically.
123.What is PPR?
Ans: PPR is Partial Page rendering. Which means that only a particular part of the page is refreshed and not the entire page.
Examples of PPR scenarios?
Ans: [*]Hiding/Showing Objects[/*]
[*]Required/Optional[/*]
[*]Disabled/Enabled[/*]
[*]Read only/Updatable[/*]
124. How do you generate stack of exception and display the list of error messages in OAF page?
Ans: Create an arrayList of exceptions then do a raiseBundledException.
125.What is the significance of ProcessFormData method?
Ans: Fires when page submit happens..
126. Describe the steps for VO Extension?
Ans: 1.Identify VO to be extended.And Copy to your machine from server.
2.Create new Vo in xx.oracle.apps package and extend parent VO.
3.Create substitution in jdev.
4.Deploy extended VO to $JAVA_TOP.
5.Load jpx file to database using jpximporter..
127.How to enable personlization?
Ans: 1.Login to the application.
2.Click on Functional Administrator responsibility.
3.Click on Core Services Tab.
4.Click on Profiles.
5.Enter Pers%Self% in Name and click Go.
6.In the results you will see Personalise Self-Service Defn.Update it and enter Yes in the Site Value
128. When we should bounce the page?
Ans: Want to answer this section? use the comment section.
129. What is the command used to import an oaf page and region?
Ans: java oracle.jrad.tools.xml.importer.XMLImporter $JAVA_TOP/ -username <>-password <>-dbconnection “(DESCRIPTION= (ADDRESS=(PROTOCOL=tcp)(HOST=[LINK=http://cpa51d.cpa.bdoutsource.com/][/LINK])(PORT=1558)) (CONNECT_DATA= (SID=<>) ) )” -rootdir . ;
130. Where to locate the definition of standard OAF Pages and regions?
Ans: : $APPL_TOP/icx/11.5.0/mds/por/ — for purchasing
131. What is Passivation?
Ans: passivation is the process of saving application state to a secondary medium (the database) at specific event points so it can be restored (activated) when needed.
132.How do you get the value from the database sequence?
Ans: OADBTransaction transaction = getOADBTransaction();
Number employeeId = transaction.getSequenceValue(“SEQ Name”);
setEmployeeId(employeeId);
133. How do you perform your validation in OAF?
Ans: All OAF validations are done in the Entity Object.
134. How do you copy rows from one vo to another?
Ans: To copy multiple rows you can add the multipleSelection item for the table.Check which row is selected and write code for implementing this.
135.What is a transaction unit in OAF?
Ans: With the transaction unit identifier, you can indicate when a specific UI task begins and ends, and if the user navigates in an unexpected manner such as using the browser Back button. You can check the transaction unit status and react to ensure that inappropriate actions are not performed and unwanted data in the BC4J cache is not committed.
136. How to implement a dependent poplist?
Ans: Dependent poplist can be implemented by enabling firePartialAction and capturing the event for the source poplist and passing the value selected in the source to the method where we set the where clause and execute the query for the destination poplist.
137.How do we pass parameters between pages?
Ans: pageContext.forwardImmediately(“OA.jsp?page=/xxch/oracle/apps/fnd/test/webui/DetailsPG&fname=”+fname.
Here fname is the variable we are passing to the DetailsPG.
138. How do we synchronize a EO and Table in the database?
Ans: Right click on the EO and click Synchronise.
139. How to set currency formatting in an OAF advance table region?
Ans: pageContext.getOANLSServcies().formatCurrency(num,”USD”);
140. How to call Concurrent Program in OAF?
Ans :
public int submitRequest( String ProgramApplication ,String ProgramName ,String ProgramDescription ,String StartTime,boolean SubRequest,Vector Parameters ) throws RequestSubmissionException
ProgramApplication -Application Short name of application under which the program is registered.
ProgramName – Concurrent Program Name for which the request has to be submitted.
ProgramDescription – Concurrent Program Description.
StartTime – Time at which the request should start running.
SubRequest – Set to TRUE if the request is submitted from another running request and has to be treated as a sub request.
Parameters – Parameters of the concurrent Request.
Example:
public int submitCPRequest(OAPageContext oapagecontext,OAWebBean oawebbean,Number headerId)
{
OAApplicationModule am = oapagecontext.getApplicationModule(oawebbean);
try {
OADBTransaction tx = (OADBTransaction)am.getOADBTransaction();
java.sql.Connection pConncection = tx.getJdbcConnection();
ConcurrentRequest cr = new ConcurrentRequest(pConncection);
String applnName = "PO"; //Application that contains the concurrent program
String cpName = "POXXXX"; //Concurrent program name
String cpDesc = "Concurrent Program Description"; // concurrent Program description
Vector cpArgs = new Vector(); // Pass the Arguments using vector
cpArgs.addElement((String)headerId);
int requestId = cr.submitRequest(applnName, cpName, cpDesc, null, false, cpArgs); // Calling the Concurrent Program
tx.commit();
return requestId;
}
catch (RequestSubmissionException e)
{
OAException oe = new OAException(e.getMessage());
oe.setApplicationModule(am);
throw oe; }
}
141. How to Extend a VO which is having View Link?
Ans :
VO extension will take of viewlink by itself So we can extend this VO as usual VO Extension.
142.What is the Purpose of Serializable in OAF?
Ans: To Pass Multiple parameters of different type as a single
143. How to Synchronize an Entity Object (EO) with Data Base?
Ans:
Step 1 : Right click on Entity Object(EO) and click on “Synchronize with DataBase..”
Step 2 : Double Click on the EO, Click on Attributes in the left Panel and then Click on “New from Table….”
144. What are the methods in controller?
Ans: Controller is having three type of methods they are
1. ProcessRequest,
2. ProcessFormRequest
3. ProcessFormData
145. How do you catch the button event on ProcessFormRequest Method?
Ans:
if (pageContext.getParameter(.EVENT_PARAM).equals(“update”)) Here update is the event.
146. How to create a Dynamic VO?
Ans:
OAApplicationModule am = oapagecontext.getApplicationModule(oawebbean);
String DynamicVOQuery = “select a.scheduled_start_date,a.wip_entity_id,b.wip_entity_name from WIP_DISCRETE_JOBS a,WIP_ENTITIES b “;
DynamicVOQuery = DynamicVOQuery + "where a.wip_entity_id=b.wip_entity_id and wip_entity_name = :1 ";
OAViewObject DynamicViewObject =(OAViewObject) am.findViewObject("DynamicVO");
if(DynamicViewObject == null)
{
DynamicViewObject =(OAViewObject) am.createViewObjectFromQueryStmt("DynamicVO ", DynamicVOQuery);
DynamicViewObject.setWhereClauseParams(null);
DynamicViewObject.executeQuery();
oracle.jbo.Row row1 =DynamicViewObject.first();
if(row1 != null)
{
String mFndUserDescription = row1.getAttribute(0).toString();
}
DynamicViewObject.remove();
}
147. When is processFormRequest method called?
Ans:
ProcessFormRequest(PFR)t method is called when we perform some action on the screen like click of submit button or click on Go or any action perform on the page the result is displayed is called PFR.
148. Which package should include EO and AO?
Ans: The EO and AO will be present in the schema.server package.
149.What is Activation and Passivation in OAF
Ans:
Passivation is the process of saving application state to a secondary medium (the database) at specific event points so it can be restored (activated) when needed. This restoration of data is called Activation. Passivation in OAF is done implicitly when the appropriate profile options are enabled.
150. What is Validation View Object(VVO), Validation Application Module , Root Application Module , View Link , Entity Expert , Association Object , Attribute Set?
Ans:
Validation View Object – A view object created exclusively for the purpose of performing light-weight SQL validation on behalf of entity objects or their experts.
Validation Application Module – An application module created exclusively for the purpose of grouping and providing transaction context to related validation view objects. Typically, a standalone entity object or the top-level entity object in a composition would have an associated validation application module.
Root Application Module – Each pageLayout region in an OA Framework application is associated with a “root” application module which groups related services and establishes the transaction context.
This transaction context can be shared by multiple pages if they all reference the same root application module, and instruct the framework to retain this application module (not return it to the pool) when navigating from page to page within the transaction task.
View Link – Establishes a master/detail relationship between two view objects
Entity Expert – A special singleton class registered with an entity object (EO) that performs operations on behalf of the EO.
Association Object – BC4J association objects implement the relationships between entity objects. For example, a purchase order header can reference a supplier, or it can own its order lines.
Attribute Set – Bundles of region or item properties that can be reused either as is or with modifications. For example, all buttons sharing the same attribute set would have the same label and Alt text.
---------------------------------------------------------------------------------------------------------------
OAF Steps
Automatic Search Page Steps:
1) Create the page as the normal way like create jws, jpr, bc4js, AM, page etc…. .
2) Right click of the .jpr, Create the bc4j for VO.
EX: xxaam.oracle.apps.po.autosearch.server
3) Create VO under BC4J, and attach VO to the AM.
Ex:AutosearchVO -> add this into AM.
4) Select the page, Under page Layout RN,create one Region, region style as Query.
5) Then select query region -> right click -> Region using wizard ->dialogbox -> you can select your VO which you created in 3rd step.
6) Click next to continue -> there you can select region style is table region, because we are going to display results in table region.
7) Click next to continue ->Shuttle the items which you want to display in page and table region.
8) Then right click query Region-> select simple search panel & simple search query region
9) In simple search panel –create what ever you want to create the items means message text inputs, it will display in top of the Automatic search PG.
10) In simple search mappings -> you have create mappings. Map all the fields to query columns to created message text inputs in simple search panel.
11) Then run the automatic search PG.
How to Create LOV in OA Framework pages step by step:
1) Create the bc4j for LOV.Right click the .jpr create the BC4j for LOV.
Ex: xxaam.oracle.apps.po.autosearch.lov.server
2) Under the LOV bc4j, create the LOVVO and LOVAM(this VO and AM called as LOVVO and LOV AM).
Ex: xxxLOVVO and xxxLOVAM.
3) Attach that LOVAM to VO.
Ex:Add xxxLOVVO to xxxLOVAM.
4) Create the region under jpr, navigation path is -> right click .jpr->New->OAComponenst ->webtier->Region.
Ex:xxxLOVRN
5) Dialog Box->In region properties -> style as ListOfValues ->click OK.
6) In structure window select region ->property inspector ->scope – public and add LOV AM To this Region.
7) Come to item search allowed property should be true.
8) Select the page, which item you want to make LOV and select item style as Message LOV Input.
9) In property inspector window ->you have to add region path in external LOV.
10) Come to mapping section , select map1
Property inspector ->functional
LOV Region Item – data base column Name
Return Item – region Item
Criteria Item- same as return item
Manual Search Page Steps:
1) Create the page as the normal way like create jws, jpr, bc4js, AM, page etc…. .
2) Create one EO BC4J under that BC4J create EO.->Right click of the BC4J select New Entity Object.
EX: xxaam.oracle.apps.po.autosearch.schema.server and xxxEO.
Note : for Manual search no need to create Entity Object. Just for explaining how to create EO based VO.
3) Then create VO based on EO. Create new VO under particular(VO) BC4J, there you can shuffle the EO (which you created in 2nd step) into selected side.
4) Click next twice and query automatically will generate , if you want to change you select expert mode checkbox and you can change the query. Amend the where clause like below example.
Ex: SELECT DepartmentEO.DEPT_ID,
DepartmentEO.DEPTNO,
DepartmentEO.DEPTNAME,
DepartmentEO.LOCATION,
DepartmentEO.CREATED_BY,
DepartmentEO.CREATION_DATE,
DepartmentEO.LAST_UPDATED_BY,
DepartmentEO.LAST_UPDATE_DATE,
DepartmentEO.LAST_UPDATE_LOGIN
FROM Department DepartmentEO
WHERE DepartmentEO.DEPTNAME LIKE NVL(:1,DepartmentEO.DEPTNAME)
AND DepartmentEO.LOCATION LIKE NVL(:2,DepartmentEO.LOCATION)
Then finish the creation VO.
5) Add this VO into AM.
6) Then design the page , create 3 regions 1 for getting page items, 2 for getting buttons and, 3 for table region for displaying results when you press the go button.
7) Select AMimpl class file to write logic like below.
public int deptsearchparams(OAPageContext pageContext, OAWebBean webBean)
{
int flag=0;
String Dname = "";
String Location ="";
DeptSearchVOImpl vo= getDeptSearchVO1();
if(pageContext.getParameter("DeptName")!=null && !pageContext.getParameter("DeptName").equals(""))
{
Dname=pageContext.getParameter("DeptName").toString();
vo.setWhereClauseParam(0,Dname);
flag=1;
}
else
{
vo.setWhereClauseParam(0,null);
}
if(pageContext.getParameter("Location")!=null && !pageContext.getParameter("Location").equals(""))
{
Location=pageContext.getParameter("Location").toString();
vo.setWhereClauseParam(1,Location);
flag=2;
}
else
{
vo.setWhereClauseParam(1,null);
}
System.out.println("the flag value is"+flag);
return flag;
}
8) Create Controller under pageLayouot region to handle the go button events and call the logic from AM. Follow logic below.
if(pageContext.getParameter("Go")!=null)
{
XXnewAMImpl am=(XXnewAMImpl)pageContext.getApplicationModule(webBean);
int fg=am. deptsearchparams (pageContext, webBean);
if(fg==0)
{
am.getDepartmentVO1().setWhereClauseParam(0,"-gfdgdjghdj");
am.getDepartmentVO1().setWhereClauseParam(1,"hkdffhkdkhgkk");
throw new OAException("please select atleast one search criteria",OAException.ERROR);
}
else
{
am.getDepartmentVO1().executeQuery();
}
}
9) Then run the page to test the Manual search page.
Create page Steps:
1) Create the page as the normal way like create jws, jpr, bc4js, AM, page etc…. .
2) EO should be mandatory to develop the create the page.
3) Create the EO which table you want to insert the records through page.
4) Create the BC4J for EO and develop the EO.
Ex: xxaam.oracle.apps.po.autosearch.schema.server and xxxEO.
5) Then create VO based on EO. Create new VO under particular(VO) BC4J, there you can
Shuffle the EO (which you created in 2nd step) into selected side
6) Add above VO into AM.
7) Then design the page for appropriate records insert into table and create two buttons for pressing in page.
8) Then select AMimpl class file to develop the logic below.
public void CreateDept()
{
DepartmentCreationVOImpl vo= getDepartmentCreationVO1();
OADBTransaction Tr=getOADBTransaction();
if(!vo.isPreparedForExecution())
{
vo.executeQuery();
}
Row row1=vo.createRow();
vo.insertRow(row1);
row1.setNewRowState(Row.STATUS_INITIALIZED);
Number deptid=Tr.getSequenceValue("DEPT_DEPT_ID_SEQ");
// vo.getCurrentRow().setAttribute("DeptId",deptid);
vo.getCurrentRow().setAttribute("DeptId",deptid);
}
9) Create Controller under pageLayouot region to handle the go button events and call the logic from AM. Follow logic below.
Process Request :
DeptAMImpl am=(DeptAMImpl)pageContext.getApplicationModule(webBean);
am.invokeMethod("CreateDept");
Process Form request:
If (pageContext.getParameter("Save")!=null)
{
am.getOADBTransaction().commit();
}
Update Page Steps:
1) Create the page as the normal way like create jws, jpr, bc4js, AM, page etc…. .
2) EO should be mandatory to develop the update page.
3) Create the EO which table you want to update the records through page.
4) Create the BC4J for EO and develop the EO.
Ex: xxaam.oracle.apps.po.autosearch.schema.server and xxxEO.
5) Then create VO based on EO. Create a new VO under particular(VO) BC4J, there you can Shuffle the EO (which you created in 2nd step) into selected side
6) Add above VO into AM.
7) Select the search page, there select table region and create one item and style as image.
8) In the image properties a) image uri as updateicon_enabled.gif b)Action Type as fire action. In the parameter window -> id = pdeptid value -> ${oa.SearchVO1.DeptId}.
9) Create the update page with appropriate records. And Buttons.
10) Create Controller under pageLayouot region to handle the go button events and call the logic from AM. Follow logic below.
Process request:
if(pageContext.getParameter("pdeptid")!=null)
{
String deptid=pageContext.getParameter("pdeptid").toString();
String whereclause="DEPT_ID='"+deptid+"'";
am.getCreateVO1().setWhereClauseParams(null);
am.getCreateVO1().setWhereClause(whereclause);
am.getCreateVO1().executeQuery();
}
Process Form request:
If (pageContext.getParameter("Save")!=null)
{
am.getOADBTransaction().commit();
}
Create the table and synonym example:
Create table modpos.DEPARTMENT
(
DEPT_ID number PRIMARY KEY,
DEPTNO VARCHAR2(50),
DEPTNAME VARCHAR2(100),
LOCATION VARCHAR2(100),
CREATED_BY NUMBER,
CREATION_DATE Date,
LAST_UPDATED_BY NUMBER,
LAST_UPDATE_DATE Date,
LAST_UPDATE_LOGIN NUMBER
)
CREATE SYNONYM DEPARTMENT FOR modpos.DEPARTMENT
Create the Sequene with example:
create sequence DEPT_DEPT_ID_SEQ
Start with 1 increment by 1
Grant all on DEPT_DEPT_ID_SEQ to apps
create sequence DEPT_DEPT_ID_SEQ
Start with 4 increment by 1 cus
Grant all on DEPT_DEPT_ID_SEQ to apps cus
Create synonym DEPT_DEPT_ID_SEQ for cus.DEPT_DEPT_ID_SEQ apps
Call one OAF page from another OAF page Syntax:
if (pageContext.getParameter("Create")!=null)
{
pageContext.setForwardURL("OA.jsp?page=rajesh/oracle/apps/po/dept/webui/DepartmentCreationPage",
null,
OAWebBeanConstants.KEEP_MENU_CONTEXT,
null,
null,
false, // Retain AM
OAWebBeanConstants.ADD_BREAD_CRUMB_NO, // Do not display breadcrums
OAWebBeanConstants.IGNORE_MESSAGES);
}
Follow Bc4j for each object:
Ø AM AND VO -> BC4J
XXAAM.oracle.apps.po.xxname.server
Ø Entity Object(EO) -> BC4J
XXAAM.oracle.apps.po.xxname.schema.server
Ø LOV ->BC4J
XXAAM.oracle.apps.po.xxname.LOV.server
Ø Poplist ->BC4J
XXAAM.oracle.apps.po.xxname.poplist.server
Ø Controller,Page & Region
XXAAM.oracle.apps.po.xxname.webui
Delete page steps
1) For delete no need to create any pages.
2) Select search page , in table region you create one item and style as image. Below set of properties needs to set for this image.
Image Uri - deleteicon_enabled.gif
Action Type – fireAction
Event - Any Name (delete)
Parameter window:SPEL
Name – DeptId
Value - ${oa.SearchVO1.DeptId}
3) write the delete login AM, start with creating method ->
public void deletedepartment(String departmentid)
{
// First, we need to find the selected Program in our VO.
// When we find it, we call remove( ) on the row which in turn
// calls remove on the associated ModposVendorProgsImpl object.
int deptidtodelete=Integer.parseInt(departmentid);
SearchVOImpl vo=getSearchVO1();
SearchVORowImpl row=null;
// This tells us the number of rows that have been fetched in the
// row set, and will not pull additional rows in like some of the
// other "get count" methods.
int fetchedrowcount =vo.getFetchedRowCount();
System.out.println("Fetched Row Count is"+fetchedrowcount);
// We use a separate iterator -- even though we could step through the
// rows without it -- because we don't want to affect row currency.
RowSetIterator deleteiter=vo.createRowSetIterator("deleteiter");
if (fetchedrowcount >0)
{
deleteiter.setRangeStart(0);
deleteiter.setRangeSize(fetchedrowcount);
for (int i=0;i<fetchedrowcount;i++)
{
row=(SearchVORowImpl)deleteiter.getRowAtRangeIndex(i);
// For performance reasons, we generate ViewRowImpls for all
// View Objects. When we need to obtain an attribute value,
// we use the named accessors instead of a generic String lookup.
Number deptid=row.getDeptId();
if(deptid.compareTo(deptidtodelete)==0)
{
// This performs the actual delete.
row.remove();
getOADBTransaction().commit();
break;
}
}
}
deleteiter.closeRowSetIterator();
}
4) Call that delete even tin Controller like below. Below logic having how to create OADialog box in OA Framework.
if ("delete".equals(pageContext.getParameter(EVENT_PARAM)))
{
// The user has clicked a "Delete" icon so we want to display a "Warning"
// dialog asking if she really wants to delete the employee. Note that we
// configure the dialog so that pressing the "Yes" button submits to
// this page so we can handle the action in this processFormRequest( ) method.
String DeptId = pageContext.getParameter("DeptId");
OAException mainMessage = new OAException("POS","xxx");
// Note that even though we're going to make our Yes/No buttons submit a
// form, we still need some non-null value in the constructor's Yes/No
// URL parameters for the buttons to render, so we just pass empty
// Strings for this.
OADialogPage dialogPage = new OADialogPage(OAException.WARNING,
mainMessage, null, "", "");
// Always use Message Dictionary for any Strings you want to display.
String yes = pageContext.getMessage("AK", "FWK_TBX_T_YES", null);
String no = pageContext.getMessage("AK", "FWK_TBX_T_NO", null);
// We set this value so the code that handles this button press is
// descriptive.
dialogPage.setOkButtonItemName("DeleteYesButton");
// The following configures the Yes/No buttons to be submit buttons,
// and makes sure that we handle the form submit in the originating
// page (the "Employee" summary) so we can handle the "Yes"
// button selection in this controller.
dialogPage.setOkButtonToPost(true);
dialogPage.setNoButtonToPost(true);
dialogPage.setPostToCallingPage(true);
// Now set our Yes/No labels instead of the default OK/Cancel.
dialogPage.setOkButtonLabel(yes);
dialogPage.setNoButtonLabel(no);
// The OADialogPage gives us a convenient means
// of doing this. Note that the use of the Hashtable is
// most appropriate for passing multiple parameters. See the OADialogPage
// javadoc for an alternative when dealing with a single parameter.
Hashtable formParams = new Hashtable();
formParams.put("DeptId", DeptId);
dialogPage.setFormParameters(formParams);
pageContext.redirectToDialogPage(dialogPage);
}
else if (pageContext.getParameter("DeleteYesButton") != null)
{
// User has confirmed that she wants to delete this employee.
// Invoke a method on the AM to set the current row in the VO and
// call remove() on this row.
String DeptId = pageContext.getParameter("DeptId");
Serializable[] parameters = { DeptId };
// OAApplicationModule am = pageContext.getApplicationModule(webBean);
am.invokeMethod("deletedepartment", parameters);
// Now, redisplay the page with a confirmation message at the top. Note
// that the deleteComponent() method in the AM commits, and our code
// won't get this far if any exceptions are thrown.
OAException message = new OAException("POS","xxxxxxxx",
null,OAException.CONFIRMATION,null);
pageContext.putDialogMessage(message);
}
}
Emp advance table row
public void createemp()
{
EmployeeCreationVOImpl vo= getEmployeeCreationVO1();
DepartmentCreationVOImpl vo1= getDepartmentCreationVO1();
OADBTransaction tr=getOADBTransaction();
vo.setMaxFetchSize(0);
Row row1=vo.createRow();
vo.insertRow(row1);
row1.setNewRowState(Row.STATUS_INITIALIZED);
Number empid=tr.getSequenceValue("EMPLOEE_EMP_ID_SEQ");
vo.getCurrentRow().setAttribute("E
mployeeId",empid);
String departmentid=vo1.getCurrentRow().getAttribute("DeptId").toString();
vo.getCurrentRow().setAttribute("DeptId",departmentid);
}
if (ADD_ROWS_EVENT.equals(pageContext.getParameter(EVENT_PARAM)))
{
am.invokeMethod("createemp");
}
we never move java file to server
*.java(we never move source code)
-----------------------------------
if we want to deploy OAF page
.*xml, .*java
----------------------------
we move
class file(eo,vo, am)
xml file--> bc4j objects, pg files
-----------------------------------
Class,XML--> JAVA_TOP
PG.xml--> MDS Layer
--------------------------------------------
open putty
echo applmgr$echo $JAVA_TOP --> (D:\oracle\VIS\apps\apps_st\comn\java\classes\) move the folder in this folder
oracle seeded files will be in oracle folder
-------------------
for pg.xml we have import statement
import C:\jdev\jdevhome\jdev\febpaftraining\myprojrcts\xxibm\oracle\apps\fnd\webui\studentDNMUsingEOPG.xml
-username apps -password apps -dbconnection
"(DESCRIPTIOn=(ADDRESS=(PROTOCOL=tcp)(HOST=glo.dev.com)(PORT=1521))(CONNECT_DATA=(SID=VIS)))" -rootDor C:\jdev\jdevhome\jdev\
feboaftraining\myprojects
--------------------
open command prompt
cd c:\jdev
cd jdevbin
cd oaext
cd bin
dir
it will show dorectory of C:\jdev\jdevbin\oaext\bin
execute the import command
-------------------------------------
select * from jdr_paths where path_name = 'StudentDMLUsingEOPG' ---page info ---- created_by (interal means its custom page)
select * from jdr_components where comp_docid = 95411;--- iitem / region info
select * from jdr_attributes where att_comp_docid = 95411;--- attributes/properties of item/region
select jdr_mds_internal.getdocumentname(95411) from dual;
-----------------------------------
registration of page
AOL function and menu
Description
Function: XX_IBM_PG
User Function Name: XX_IBM_PG
Properties
Type: SSWA jsp function ----------if we are rejestering ADF Page we use External ADF Application
WEBHTML
OA.jsp?page=/xxibm/oracle/apps/fnd/webui/StudentDMLUsingEOPG (select jdr_mds_internal.getdocumentname(95411) from dual;)
------------------------------
assign function to menu
-------------------------
clear cache in function administrator
------------------------------------------------
Bouncing sever
cd $ADMIN_SCRIPTS_HOME
ls (will show alll script to bounce different servers)
$adopmnct_.sh status
$adapmnctl.sh status (it will show the server this script will stop)
$adopmnctl.sh stop all
$adopmnctl.sh status (status 0 error)
$adapmnctl.sh start all
-------------------------------------
starting each server manually (oacore, form, report and http server)
applmgr$adoa--- shows script with this name like operator
$adoafmctl.sh start all ----$adapcctl.sh status
$adformsctl.sh start all
$adoacorectl.sh start all
copy the folder to java top
D:\oracle\VIS\apps\apps_st\comn\java\classes
prepare import script
go to command promt
D:\oracle\VIS\apps\apps_st\comn\java\classes\ebspage\oracle\apps\po\requisition\webui\ebsPG.xml -rootdir
--------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------
Basics
--------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------
controller -> Java file to handel the event. -> At page level or region level
On the main region we create controller. (right click and create new controller.)
package-> strucure in which files are saved.
import-> whenever we are accessing any method which is available in another class, we have to import that particular class.
public class HelloWorldCO extend OAControllerImpl ---> it is extending java api whcih will have core logic for handelling event.
it will have all the access of OAControllerImpl class. (it will have field , constructor and methods. it is provided by oracle)
--->to handel the buuton or hyperlink event, without using OA framework will be extra 20 line of code.
it will have the access of OAControllerImpl. Double click on OAControllerImpl, which will have constructor and set of methods.
CO---> OAControllerImpl(JavaAPI---core for handelling events.)
HelloWorldCO--> Extending --> OAControllerImpl
Thers 3 methods have 2 parameters
1.---> ProcessRequest(OAPageContext pageContext, OAWebBean webBean)
During page load, initialization. (Before report, before parameter)
2.--> ProcessFormData(OAPageContext pageContext, OAWebBean webBean)
it is used for getting value for the components, for validation of data of fields when user enter it. and setting the value.
3.--->ProcessFormRequest(OAPageContext pageContext, OAWebBean webBean)
called afer page load.when we click button event, LOV , Popups. Handellig events.
pageContext --> Store page related infor, parameter information , user ino, resp , appl name ...etc,
webBean --> Store the hierarchy of the OAF UI Components.
parameter information-> whenevr we are passing data from one page to another this particula page context object or variable will store it.
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
Hellow World Page
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
1.we will create a text Input box --> it is Java Bean (for setting and getting value)
---> java API for the purpose of setting the properties.
---> itemStyle--> message TextInput
----> OAmessageTextInputBean (refer class name)
2. Create submit button
3. //OAException(welcomeStr,OAException.warning) etc.----this is contructor
OAException A is a constructor --- in java class , if method name = class name its construcor
OAMessageTextInputBean CLASS
nameIDBean OBJECT
webBean WE ARE GTTING THE VALUE
nameID PASSING THE nameID
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processFormRequest(pageContext, webBean);
String eventName = pageContext.getParameter("go"); // it will have event value when we click submit button
System.out.println("event name is ---->"+eventName);
if(pageContext.getParameter("go")!=null) // it check whether event is clicked.
{
OAMessageTextInputBean nameIDBean = (OAmessageTextInputBean)webBean.findIndexedChildRecursive("nameID");
//alt +Enter//getting value/// this method will return memory pointer location of this component/bean
String nameStr = nameIDBean.getText(pageContext);
String welcomeStr = "Hello" +nameStr +"Welcome to OAF";
OAException exceptionObj = new OAException(welcomeStr,OAException.INFORMATION);// creating object, for displaying the information to the user;
//another way
thorw new OAException("user Clicked ",OAException.WARNING); //OAException(welcomeStr,OAException.warning) etc.----OAExceptionOAException is contructor
throw exceptionObj;
}
else if(pageContext.getParameter("sb2")!=null)
{thorw new OAException("user Clicked ",OAException.WARNING);
}
}
In JSP, pageContext is an implicit object of type PageContext class.The pageContext object can be used to set,get or remove attribute from one of the following scopes:
page
request
session
application
in java whenver method name = class name then its a constructor
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
Diplaying VO in a page (table)
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
OAF PG -> CO -> AM -> VO -> DB
to display the data from DB using SQL Query.
1. Requirement Diplay Employee data in OAF Page.
EmployeePG.XML
EmployeeCO.java -> to initialize data we need Controller.
AM -> it will have .java file and .xml file
VO -> PerPeopleVO ---> select * from per_people_x
1st create VO --> (PerPeopleVO VO will have PerPeopleVO.xml and PerPeopleVO.java)
2nd we have to assign to AM. All BC4J object has to be assigned to AM. .java file in AM will add new method automatically
AmazonBizzServices.XML
AmazonBizzServicesImpl.java
public PerPeopleVOImpl getPerPeopleVO1()
{ :return (PerPeopleVOImpl)findViewObject("PerPeopleVO1"); // for initializing our VO and getting pointer location, allocating memory
}
3rd create page . Use table wizard. Region Style: Table
4th AMImpl.java ---> vo.executeQuery();
public void initPerPeopleVO()
{ PerPeopleVOImpl vo = getPerPeopleVO1();
vo.executeQuery();
}
5th Controller
public void ProcessRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processRequest(pageContext, webBean);
OAApplicationModule am = pageContext.getApplicationModule(webBean);
am.invokeMethod("initPerPeopleVO");
or we can write
AmazonBizzServiceImpl amazonAM = (AmazonBizzServicesImpl)pageContext.getApplicationModule(webBean);
amazonAM.initPerPeopleVO();
}
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
Creating Region of header
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
HRMS Module --> 15 pages to be developed
15 pages--> header information --> employee details --> empid, no, name, location, bgid
Shared region
1. VO--> emp details
2. AM
3. RN
4. CO
1. Create VO
Select person_id, employee_number, full_name, business_group_id, email_address from per_people_f where
person_id = (select employee_id from fnd_user where user_id = FND_PROFILE.VALUE('USER_ID'))
2. Right Click on webui -> New -> OA Component -> Region
New Region
Name : Region1
Package: xxibm.oracle.apps.fnd.webui
Style: Header
2. Down right click on region and Create a cotroller
Package Name : xxibm.oracle.apps.fnd.webui
ClassName: MYCO
Assign the AM in properties.
Text:> Employee Details
New Region Wizard-> Next-> Select the column to be displayed.
Region Style: defaultDoubleColumn or messagecomponentlayout (properties 2 rows and 3 column, width 90%, move it down to another region and give a text field : Emplooyee Detail)
Style: messageStyleText
3. Go to application Module , AMImpl.java ----initialize the VO
public void initEmployeeDetailsVO()
{EmployeeDetailVOImpl vo = getEmployeeDetailsVO1();
vo.initEmpVO();
}
4. Go to EmployeeDetailVOImpl.java, by double clicking on it in AM
public void initEmpVO()
{executeQuery();
}
5. Write the code in controller
super.processRequest(pageContext, webBean);
OAApplicationModule am = pageContext.getApplicationModule(webBean);
am.invokeMethod("initEmployeeDetailsVO");
Now if we want to use the detail in another pages
We will copy the region path given in the URL
GO to any webui-> xyz.xml
Down in the structure-> Right Click on Main Region -> New -> region (drag it to top of the already existing region)
Properties: Extends: xxibm/oracle/apps/fnd/webui/EmployeeDetailsRN
import C:\jdev\jdevhome\jdev\febpaftraining\myprojrcts\xxibm\oracle\apps\fnd\webui\EmployeeDetailRN.xml
-username apps -password apps -dbconnection
"(DESCRIPTIOn=(ADDRESS=(PROTOCOL=tcp)(HOST=glo.dev.com)(PORT=1521))(CONNECT_DATA=(SID=VIS)))" -rootDor C:\jdev\jdevhome\jdev\
feboaftraining\myprojects
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
SEARCH PAGE
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
Create VO ->
india.oracle.apps.po.SerchPG.server
xxManualPageVO
select fs.supplier_id, fs.name, fs.on_hold_flag, fs.start_date, fs.end_date, fst.supplier_site_id, fst.site_name, fst.carrier_code, fst.purchasing_site_flag, fst.address_id
from fwk_tbx_suppliers fs, fwk_tbx_supplier_sites fst
where fs.supplier_id = fst.supplier_id
and fs.supplier_id like nvl(:1,fs.supplier_id)
and fs.name like nvl(:2,fs.name)
and nvl(fs.on_hold_flag,'N') like nvl(:3,NVL(fs.on_hold_flag,'N'))
Create AM
Pacjkge: india.oracle.apps.po.SearchPG.server
Name : xxSupplierAM
Create Page
name : xxManualSearchPG
Package: india.oracle.apps.po.SearchPG.webui
Create Region
Attach the AM
Window Title : Serch Page
Create Another Regiion under Main Region
Text Supplier Details
Region Style : defaultDoubleColumn
Creating Item
SuppllierID
SupplierName
onHoldFlag
StartDate
Click on the main region create another region
ID : RowLayoutRN
Region Style : rowLayout
Create GO and Clear Button
ID : Search
Item Style : Submit Button
ID : ButtonSpacer
Item Style :spacer
width: 50
ID : Cancel
Item Style :Submit Button
-------------------------------------------
Right Click on the main region -> Create Item
ID : regionSpacer
Item Style :spacer
height : 10
-------------------------------------------------
Right Click on the main region -> Create region
---------------------
ID : Site Details
Region Style :tab;e
Width : 100%
Right Click on the main region -> Create Item
ID : SupplierId
ItemStyle: messageStyledText
Prompt: supplierDI
View instance: xxManualSearchVO1
View Attribute: SupplierId
ID : SupplierSiteId
ItemStyle: messageStyledText
Prompt: SupplierSiteId
View instance: xxManualSearchVO1
View Attribute: SupplierSiteId
ID : SiteName
ItemStyle: messageStyledText
Prompt: SiteName
View instance: xxManualSearchVO1
View Attribute: SiteName
ID : StartDate
ItemStyle: messageStyledText
Prompt: StartDate
View instance: xxManualSearchVO1
View Attribute: StartDate
ID : EndDate
ItemStyle: messageStyledText
Prompt: EndDate
View instance: xxManualSearchVO1
View Attribute: EndDate
ID : HoldFlag
ItemStyle: messageStyledText
Prompt: HoldFlag
View instance: xxManualSearchVO1
View Attribute: HoldFlag
ID : CarrierCode
ItemStyle: messageStyledText
Prompt: CarrierCode
View instance: xxManualSearchVO1
View Attribute: CarrierCode
--------------------------------
Right Click on sitedetails region -> Table Actions
Right Click on table action region -> Create Item
ID: create Supplier
Iten Style: Submit Button
Prompt: Create Supplier
-------------------------------------------
creating Controller--------------To Handle Event
Right Click on Maiin region -> new ->Set new Controller
india.oracle.apps.po.SearchPG.webui
xxManualSerarchCo
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
{super.processFormRequest(pageCotext, webBean);
xxSupplierAMImpl am = (xxSupplierAMImpl)pageContext.getApplicationModule(webBean);
if(pageContext.getParameter("Search")!=null)
{
String Sup_ID = pageContext.getParameter("SupplierID");
String Sup_Name = pageContext.getParameter("SupplierName");
String HFlag = pageContext.getParameter("onHoldFlag");
String Start_Date = pageContext.getParameter("StartDate");
am.xxinitQuery(Sup_ID,Sup_Name,HFlag, Start_Date);
}
if (pageContext.getParameter("Clear")!=null)
{pageContext.setForwardURLToCurrentPage(null,false,null,OAWebBeanConstants,IGNORE_MESSAGES);
}
}
--------------Application Module
public void xxintQuery(String Sup_ID, String Sup_Name, String onHoldFlag, String SDate)
{xxManualSearchVOImpl vo = getxxMaualSearchVO1();
vo.xxGetSuppDate(Sup_ID,Sup_Name,onHoldFlag,SDate);
}
-----------------VOCode
public void xxGetSuppData(String Sup_ID, String Sup_Name, String onHoldFlag, String SDate)
{
this.clearCache(); //clearing the cashe
String oldQuery = this.getQuery(); //method to get query
String flag = null;
if(Sup_ID!=null &&!"".equals(Sup_ID))
{
this.setWhereClauseParam(0,Sup_ID); // indexing starts from zero,1st parameter
flag = "Supplier_ID";
}
else
{this.setWhereClauseParam(0,null);} // else it will pass null to where clause
if(Sup_Name!=null&&!"".equals(Sup_Name))
{
this.setWhereClauseParam(1,Sup_Name);
flag = flag+"-"+"Supplier_Name";
}
else
{this.setWhereClauseParam(1,null);}
if(onHoldFlag!=null&&!"".equals(onHoldFlag))
{
this.setWhereClauseParam(2,onHoldFlag);
flag = "onHoldFlag";
}
else
{this.setWhereClauseParam(2,null);}
if(SDate!=null&&!"".equals(SDate))
{
this.addWhereClause(SDate);
this.setWhereClauseParam(3,SDate);
flag = "Start_Date";
}
else
{}
if (flag!=null)
{
if (flag.equalsIgnoreCase("Supplier_ID")||flag.equalsIgnoreCase("Supplier_Name")||flag.contains("null"||"Supplier_ID-Supplier_Name".equals(flag))
{
if(!"Supplier_ID-Supplier_Name".equals(flag))
{
throw new OAException("Please enter Supplier ID and Supplier Name or HoldFlag", OAException.ERROR);
}
else
{flag= "EXECUTE";
}
}
if (flag.equalsIgnoreCase("ONHOLDFLAG")||flag.equalsIgnoreCase("Start_Date")||flag.equalsIgnoreCase("EXECUTE"))
{this.executeQuery();
this.setQuery(oldQuery);
}
}
else
{throw new OAException("Please Enter Atlease One Search Criteria", OAException.ERROR);
}
}
public void addWhereClause(String SDate)
{
String oldQuery = this.getQuery();
StringBuffer newQuery = new StringBuffer(oldQuery);
newQuery = newQuery.append("AND NVL(fs.START_DATE,sysdate)= nvl(:4,NVL(fs.START_DATE,sysdate))");
this.setQuery(newQuery.toString());
}
pubic void clearCache()
{
this.setWhereClauseParam(0,"-9999");
this.setWhereClauseParam(1,null);
this.setWhereClauseParam(2,null);
}
Controller
OAApplicationModule am = pageContext.getApplicationModule(webBean);
am.invokeMethod("initEmployeeDetailsVO");
FND_PROFILE.value('user_id')
Application module
public void initEmployeeDetailsVO()
{EmployeeDetailsVOImpl vo = getEmployeeDetailsVO1();
vo.initEmpVO();
}
VO.java
public void initEmpVO()
{
execute.Query();
}
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
Calling another form
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
Create new workspace
Create new project
Create a new Application module.
Create a new Page. dept PG
(first page)
Create VO Department
select deptno, dname, loc from dept
Attach deptvo to AM
Go to page -> Create region wizrad to create fields -> region style table
Run the page and copy
OA.jsp?page=/cf/oracle/apps/po/requisition/webui/deptPG
create a controller CO
under processRequest
OAApplicationModule am = pageContext.getApplicationModule(webBean);
OAViewObject vo = (OAViewObject) am.findViewObject("deptVO1");
if(!vo.isPreparedForExecution())
vo.executeQuery();
(second page)
Create VO Employee
reate VO Employee
select deptno, empname, ename, sal, job, hiredate
from emp where depno = :1
Attach deptvo to AM
Go to page -> Create region wizrad to create fields -> region style table
Run the page and copy
OA.jsp?page=/cf/oracle/apps/po/requisition/webui/empPG
create a controller CO
under processRequest
OAApplicationModule am = pageContext.getApplicationModule(webBean);
OAViewObject vo = (OAViewObject) am.findViewObject("empVO1");
String x = pageContext.getParameter("param");
vo.setwhereClauseParam(0,x);
if(!vo.isPreparedForExecution())
vo.executeQuery();
Go to depatment page
Go to properties of deptno-> in the destination URL
Paste:
OA.jsp?page=/cf/oracle/apps/po/requisition/webui/empPG&retainAM=Y¶m{@Deptno}
Under Employee region create a back button
itemStyle : Submit button
loginv in controller Now under process form requset CO
if (pageContext.getParameter("back")!=null)
pageContext.redirectImmediately("OA.jsp?page=/cf/oracle/apps/po/requisition/webui/deptPG&retanAM=Y");
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
DynamicVO
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
public void intEmloyee1()
{
OADBTransactionImpl dbTx = (OADBTransactionImpl)getTransaction();
Transaction txn = getTransaction();
String sqlText = "select Employee1.Employee_id as employee_id,\n" +
"Employee1.full_name as employee_name,\n"+
"employee1.email_address as employee_email,\n"+
"Employee2.EMPLOYEE_ID AS MANAGER_ID,\n" +
"Employee2.FULL_NAME AS MANAGER_NAME,\n"+
"Employee2.EMAIL_ADDRESS AS MANAGER_EMAIL\n"+
"FROM FWK_TBX_EMPLOYEES Employee1,\n" +
" FWK_TBX_EMPLOYEES Employee2\n"+
"WHERE Employee1.MANAGER_ID = Employee2.EMPLOYEE_ID";
OAViewDef viewDef = dbTx.createViewDef();
viewDef.setSql(sqlText);
viewDef.setExpertMode(true);
viewDef.setViewRowClass("oracle.apps.fnd.framework.server.OAViewRowImpl");
viewDef.addSqlDerivedAttrDef("EMPLOYEE_ID", //Attr name
"EMPLOYEE_ID",
"oracle.jbo.domain.Number",
Types.NUMERIC,
true,
true,
AttributeDef.READONLY,
(byte)15);
viewDef.addSqlDerivedAttrDef("EMPLOYEE_NAME", //Attr name
"EMPLOYEE_NAME",
"java.lang.String",
Types.VARCHAR,
true,
true,
AttributeDef.READONLY,
(byte)7);
viewDef.addSqlDerivedAttrDef("EMPLOYEE_EMAIL", //Attr name
"EMPLOYEE_EMAIL",
"java.lang.String",
Types.VARCHAR,
true,
true,
AttributeDef.READONLY,
(byte)15);
viewDef.addSqlDerivedAttrDef("MANAGER_ID", //Attr name
"MANAGER_ID",
"oracle.jbo.domain.Number",
Types.NUMERIC,
true,
true,
AttributeDef.READONLY,
(byte)15);
viewDef.addSqlDerivedAttrDef("MANAGER_NAME", //Attr name
"MANAGER_NAME",
"java.lang.String",
Types.VARCHAR,
true,
true,
AttributeDef.UPDATEABLE,
(byte)7);
viewDef.addSqlDerivedAttrDef("MANAGER_EMAIL", //Attr name
"MANAGER_EMAIL",
"java.lang.String",
Types.VARCHAR,
true,
true,
AttributeDef.UPDATEABLE,
(byte)7);
String voName="DynamicVO";
OAViewObject vo = (OAViewObject) findViewObject(voName);
if (vo != null)
{
vo.remove();
System.out.println("VO removed: " + voName);
}
vo = (OAViewObject) createViewObject(voName, viewDef);
}
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processFormRequest(pageContext, webBean);
OAApplicationModule am = pageContext.getApplicationModule(webBean);
String searchEmpName = pageContext.getParameter("EmployeeName");
String searchEmpId = pageContext.getParameter("EmployeeId");
System.out.println("EmployeeName: "+searchEmpName);
System.out.println("EmployeeId: "+searchEmpId);
if (pageContext.getParameter("Search") != null)
{
Serializable[] parameters = { searchEmpName, searchEmpId };
Class[] paramTypes = { String.class, String.class };
am.invokeMethod("intEmployee",parameters,paramTypes);
pageContext.setForwardURLToCurrentPage(null,true,OAWebBeanConstants.ADD_BREAD_CRUMB_NO,OAException.ERROR);
}
}
public void intEmployee(String empName,String empId)
{
String voName="DynamicVO";
OAViewObject vo = (OAViewObject) findViewObject(voName);
Number empNum = null;
try
{
empNum = new Number(empId);
}
catch(Exception e) { }
if (vo != null)
{
vo.setWhereClause(null);
vo.setWhereClauseParams(null);
if(!empName.equals("") && !empId.equals("") )
{
String s1 = " EMPLOYEE_ID = "+empNum+" AND "+" UPPER(EMPLOYEE_NAME) LIKE "+"UPPER("+"'"+empName+"'"+")";
vo.setWhereClause(s1);
}
else if(!empName.equals(""))
{
String s2 = " UPPER(EMPLOYEE_NAME) LIKE "+"UPPER("+"'"+empName+"'"+")";
vo.setWhereClause(s2);
}
else if(!empId.equals(""))
{
String s3 = " EMPLOYEE_ID = "+ empNum;
vo.setWhereClause(s3);
}
}
vo.executeQuery();
}
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
Execute parameterized PL SQL procedure from OAF page
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
CREATE OR REPLACE PACKAGE APPS.test_package AUTHID CURRENT_USER
IS
PROCEDURE data_sum
( item1 IN NUMBER,
item2 IN NUMBER,
data_sum OUT NUMBER );
END test_package;
/
SHOW ERRORS;
EXIT;
Package Body
CREATE OR REPLACE PACKAGE BODY APPS.test_package
IS
PROCEDURE data_sum
( item1 IN NUMBER,
item2 IN NUMBER,
data_sum OUT NUMBER
)
IS
BEGIN
data_sum := item1 + item2;
END data_sum;
END test_package;
/
SHOW ERRORS;
EXIT;
10. Add Following Code in your AMImpl Class (ParameterizedProcDemoAMImpl.java)
import oracle.apps.fnd.framework.server.OADBTransaction;
import oracle.apps.fnd.framework.server.OADBTransactionImpl;
import oracle.jdbc.OracleCallableStatement;
import java.sql.Types;
import oracle.apps.fnd.framework.OAException;
...
public String dataSumAction(String item1,String item2)
{ OADBTransaction oadbtransaction = (OADBTransaction)getTransaction();
OADBTransactionImpl oadbtransactionimpl = (OADBTransactionImpl)getTransaction();
String retValues;
StringBuffer str = new StringBuffer();
str.append( " BEGIN ");
str.append( " test_package.data_sum( ");
str.append( " item1 => :1, ");
str.append( " item2 => :2, ");
str.append( " data_sum => :3 ");
str.append( " ); ");
str.append( " END; ");
OracleCallableStatement oraclecallablestatement = (OracleCallableStatement)oadbtransaction.createCallableStatement(str.toString(), 1);
try
{
oraclecallablestatement.setInt(1, Integer.parseInt(item1) );
oraclecallablestatement.setInt(2, Integer.parseInt(item2) );
oraclecallablestatement.registerOutParameter(3, Types.VARCHAR);
oraclecallablestatement.execute();
retValues = oraclecallablestatement.getString(3);
}
catch(Exception e)
{
throw OAException.wrapperException(e);
}
return retValues;
}
11. Add Controller for Page ParameterizedProcDemoPG Select PageLayoutRN right click Set New Controller
Package Name -- prajkumar.oracle.apps.fnd.parameterizedprocdemo.webui
Class Name -- ParameterizedProcDemoCO
Add Following Code in Controller
import oracle.apps.fnd.framework.OAException;
import oracle.apps.fnd.framework.OAApplicationModule;
import java.io.Serializable;
...
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processFormRequest(pageContext, webBean);
OAApplicationModule am = pageContext.getApplicationModule(webBean);
if (pageContext.getParameter("Sum") != null)
{
Serializable[] parameters1 = { pageContext.getParameter("item1"),
pageContext.getParameter("item2"),
};
String retVals1 = (String)am.invokeMethod("dataSumAction", parameters1);
String message = "Sum: " + retVals1;
throw new OAException(message, OAException.INFORMATION);
}
}
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
KFF
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
3. Create a New View Object (VO)
Right click on KFFDemo > New > ADF Business Components > View Object
Name -- KFFVO
Package -- prajkumar.oracle.apps.fnd.kffdemo.server
Note - The VO is not based on any EO so click next and go to the query section and paste the query
SELECT code_combination_id
FROM gl_code_combinations_kfv
9. Create a New Item of type Flex under the Stack Layout Region
Right click on MainRN > New > Item
Set Following Properties for New Item --
Attribute Property
ID KeyFlexItem
Item Style Flex
Prompt Accounting Key Flex Field
Appl Short Name SQLGL
Name GL#
Type Key
View Instance KFFVO1
10. Create Controller for page KFFPG
Right Click on PageLayoutRN > Set New Controller
Package Name: prajkumar.oracle.apps.fnd.kffdemo.webui
Class Name: KFFCO
Write Following Code in KFFCO processRequest
public void processRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processRequest(pageContext, webBean);
OAKeyFlexBean kffId = (OAKeyFlexBean)webBean.findIndexedChildRecursive("KeyFlexItem");
// Set the code combination lov
kffId.useCodeCombinationLOV(true);
//set the structure code for the item key flex
kffId.setStructureCode("FED_AFF");
//Set the attribute name to the item
kffId.setCCIDAttributeName("CodeCombinationId");
//Execute the Query
KFFAMImpl am = (KFFAMImpl)pageContext.getApplicationModule(webBean);
KFFVOImpl vo = (KFFVOImpl)am.findViewObject("KFFVO1");
if(!vo.isPreparedForExecution())
{
vo.executeQuery();
}
}
Note -- If you do not want to see the key flex field is merging one then change the code in the controller class as below
kffId.useCodeCombinationLOV(false);
11. Use the below Query to find the Structure Code
SELECT fif.application_id,
fif.id_flex_code,
fif.id_flex_name,
fif.application_table_name,
fif.description,
fifs.id_flex_num,
fifs.id_flex_structure_code,
fifse.segment_name,
fifse.segment_num,
fifse.flex_value_set_id
FROM fnd_id_flexs fif,
fnd_id_flex_structures fifs,
fnd_id_flex_segments fifse
WHERE fif.application_id = fifs.application_id
AND fif.id_flex_code = fifs.id_flex_code
AND fifse.application_id = fif.application_id
AND fifse.id_flex_code = fif.id_flex_code
AND fifse.id_flex_num = fifs.id_flex_num
AND fif.id_flex_code LIKE 'GL#'
AND fif.id_flex_name LIKE 'Accounting Flexfield';
x
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
Implement Train in OAF Page
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
Let us try to implement train between three pages. Consider three pages each having Text Item
1. Create a New OA Workspace and Empty OA Project
File> New > General> Workspace Configured for Oracle Applications
File Name -- TrainProj
Project Name – TrainDemoProj
Default Package -- prajkumar.oracle.apps.fnd.traindemo
2. Create Application Module AM
TrainDemoProj right click > New > ADF Business Components > Application Module
Name -- TrainDemoAM
Package -- prajkumar.oracle.apps.fnd.traindemo.server
Check Generate JavaFile(s)
Create Three Pages TrainDemoPG1, TrainDemoPG2 and TrainDemoPG3 as similar way as mention below to create TrainDemoPG1
3. Create a OA components Pages
TrainDemoProj right click > New > OA Components > Page
Name – TrainDemoPG1
Package -- prajkumar.oracle.apps.fnd.traindemo.webui
4. Modify the Page Layout (Top-level) Region
Attribute Property
ID PageLayoutRN
Region Style pageLayout
Form Property True
Auto Footer True
Window Title Train Demo Window Title
Title Train Demo Page Header
AM Definition
prajkumar.oracle.apps.fnd.traindemo.server.TrainDemoAM
5. Create the Second Region (Main Content Region)
Select PageLayoutRN right click > New > Region
Attribute Property
ID MainRN
Region Style messageComponentLayout
Create Text Items for all three pages say TextItemPage1, TextItemPage2 and TextItemPage3 in respective pages TrainDemoPG1, TrainDemoPG2 and TrainDemoPG3 in similar way of as mention below to create TextItemPage1 in page TrainDemoPG1
6. Create Text Items
Select MainRN right click > New > messageTextInput
Prompt – TextItemPage1
Length -- 20
7. Create a Standalone Train Region
TrainDemoProj > New > Web Tier > OA Components > Region
Name -- TrainRN
Package – prajkumar.oracle.apps.fnd.traindemo.webui
Style – train
Select TrainRN inStructure pane and open property inspector and set Allow Interaction property to True
8. Add Three Train Nodes to TrainRN
Right Click on TrainRN in Structure pane > New > Link
Set the link properties as follow --
ID – TrainStep1
Item Style – link
Text – Step 1
Destination URI – OA.jsp?page=/prajkumar/oracle/apps/fnd/traindemo/webui/TrainDemoPG1
Right Click on TrainRN in Structure pane > New > Link
Set the link properties as follow --
ID – TrainStep2
Item Style – link
Text – Step 2
Destination URI – OA.jsp?page=/prajkumar/oracle/apps/fnd/traindemo/webui/TrainDemoPG2
Right Click on TrainRN in Structure pane > New > Link
Set the link properties as follow --
ID – TrainStep3
Item Style – link
Text – Step 3
Destination URI – OA.jsp?page=/prajkumar/oracle/apps/fnd/traindemo/webui/TrainDemoPG3
9. Add Train Region to each of your Pages
For each of three pages in multistep flow, right click the pageLayoutRN in structure panel, and select New > location from page Context menu
Set following properties as follow --
ID – TrainDemoRN
Extends -- /prajkumar/oracle/apps/fnd/traindemo/webui/TrainRN
10. Create a Standalone (Shared) TrainFooterRN
TrainDemoProj > New > Web Tier > OA Components > Region
Name -- TrainFooterRN
Package -- prajkumar.oracle.apps.fnd.traindemo.webui
Region Style -- pageButtonBar
11. Add navigrationBar
Select TrainFooterRN in Structure pane right click > New > Region
Set the region properties as follows:
ID -- NavBar
Region Style – navigationBar
First Step – 1
Last Step – 3
12. Add Links to the navigrationBar
Right Click on NavBar > New > link
Set Item’s properties as follows:
ID – Step1Link
Item Style – link
Text – Step 1 of 3: Page1
Warn About Changes – False
Destination URI -- /prajkumar/oracle/apps/fnd/traindemo/webui/TrainDemoPG1
Right Click on NavBar > New > link
Set Item’s properties as follows:
ID – Step2Link
Item Style – link
Text – Step 2 of 3: Page2
Warn About Changes – False
Destination URI -- /prajkumar/oracle/apps/fnd/traindemo/webui/TrainDemoPG2
Right Click on NavBar > New > link
Set Item’s properties as follows:
ID – Step3Link
Item Style – link
Text – Step 3 of 3: Page3
Warn About Changes – False
Destination URI -- /prajkumar/oracle/apps/fnd/traindemo/webui/TrainDemoPG3
13. Initialize the Footer Region
Select TrainFooterRN in Structure pane right click > Set New Controller
Class Name -- TrainDemoCO
Package Name – prajkumar.oracle.apps.fnd.traindemo.webui
Add following code in processRequest()
import oracle.apps.fnd.framework.webui.beans.nav.OATrainBean;
import oracle.apps.fnd.framework.webui.beans.nav.OANavigationBarBean;
...
public void processRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processRequest(pageContext, webBean);
OATrainBean trainBean = (OATrainBean)pageContext.getPageLayoutBean().getLocation();
trainBean.prepareForRendering(pageContext);
int step = trainBean.getSelectedTrainStepRenderedIndex();
OANavigationBarBean navBean = (OANavigationBarBean)webBean.findChildRecursive("NavBar");
navBean.setValue(step+1);
} // end processRequest()
14. Add the Navigation Region to your pages
For each of three pages in the multistep flow, right click the PageLayoutRN in Structure pane and select New > Region
Set the region’s properties as follow:
ID -- PageButtonBar
Style -- pageButtonBar
Extends -- /prajkumar/oracle/apps/fnd/traindemo/webui/TrainFooterRN
15. Congratulation you have successfully finished. Run Your TrainDemoPG1 page and Test Your Work
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
OAF Validation
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
BseFnoMasterEOImpl.java at Enity Object level
--------------------------------------------------
protected void doDML(int operation , TransactionEvent e)
{
super.doDML(operation, e);
String value = getEmail();
if (value==null)
{
throw new OAAttrException(OAException.TYPE_ENTITY_OBJECT,
getEntityDef().getFullName(), // entity name
getPrimaryKey(), //entity primary key
"Email", //attribute name
value, //bad attribute value
"FND", //message application short name
"XXCUS_EMAIL_REQ");
}
}
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
INSERT ROW
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
public void processRequest(OAPageContext pageContext, OAWebBean webBean)
{super.processRequest(pageContext, webBean);
OAApplicationModule am=pageContext.getApplicationModule(webBean);
am.invokeMethod("CreateSupplierRow");
}
public void processRequest(OAPageContext pageContext, OAWebBean webBean)
{super.processRequest(pageContext, webBean);
OAApplicationModule am=pageContext.getApplicationModule(webBean);
String event= pageContext.getParameter(OAWebBeanConstants.EVENT_PARAM);
String source= pageContext.getParameter(OAWebBeanConstants.SOURCE_PARAM);
if(pageContext.getParameter("Apply")!=null)
{am.invokeMethod("SaveData");
//These five lines are there to display the confirmation Message
String supId=pageContext.getParameter("SupplierID");
String supName=page.Context.getParameter("SupplierName");
MessageToken[] tokens= {new MessageToken("SUPID",supId), new MessageToken("SNAME",supName)};
OAException msg = new OAException("PO","xxinsertData", tokens, OAException.Confirmation,null);
throw msg;
}
if(ADD_ROWS_EVENT.equals(event))
{
am.invokeMethod("CreateSitesRow");
}
}
public void CreateSupplierRow()
{
SuppliersEOVOImpl vo = getSuppliersEOVO1();
Row row= vo.createRow();
if(!vo.isPreparedForExecution())
{vo.setmaxFetchSize(0);
}
vo.insertRow(row);
Number seq = getOADBTransaction().getSequenceValue("fwk_tbx_suppliers_s");
row.setAttribute("SupplierId",seq)
row.setNewRowState(Row.STATUS_INITIALIZED);
}
public void CreateSitesRow()
{
SitesEOVOImpl vo = getSitesEOVO1();
SuppliersEOVOImpl vo1 = getSupplerEOVO1();
Row siterow=vo.createRow();
if(!vo.isPreparedForExecution())
{ vo.setMaxFetchSize(0);
}
int count = vo.getRowCount();
vo.insertRowAtRangeIndex(count,siterow);
OA Extensions to extend existing Apps OA Framework pages
Create customization in existing package
-----------------------------------------
1) Create new project
In my simple test, I am creating a new OA Project called "mzExtend"I am using application shortname "MZ" and responsibility key "MZCUSTOMSSWA" for my project, as this is already setup on my environment (see Note 216589.1)
In project settings, change the Runner options in configuration section to add the entry "-Djbo.project=mzExtend" to the end of the line.
Also add "F:\oracle\viscomn\java" to the "Additional Classpath" (this is a shared network drive to my OA_JAVA directory) You would have to copy the server.xml to your local PC first, if the Apps 11i instance was on a Unix box.
2) Add existing BC4J Objects to your project
Refer to chapter 9 on the Developers Guide "Extending OA Framework Applications"
The "server.xml" files are shipped with Apps 11i, so you add the server.xml file to your custom project in order to access the original BC4J objects. You need access to the original objects in order to select them in the "extends" field when creating your new object.
Add the file "F:\oracle\viscomn\java\oracle\apps\ar\irec\common\server\server.xml" to the project. This will create a BC4J Package in your custom project.
For my custom page, I need to create a custom VO and AM
oracle.apps.ar.irec.common.server.InternalCustomerSearchByCustomerIdVO
oracle.apps.ar.irec.common.server.CustomerSearchAM
Create a new VO, extending the original
oracle.apps.ar.irec.common.server.mzInternalCustomerSearchByCustomerIdVO
Manually copy the SQL from the original VO, my customization requires me to remove the WHERE clause from the original SQL
Create a new AM, extending the original
oracle.apps.ar.irec.common.server.mzCustomerSearchAM
In the view objects selection, add "mzInternalCustomerSearchByCustomerIdVO"
I am modifying these java files, to enable a default selection to show when the custom page is launched
mzCustomerSearchAMImpl.java
mzInternalCustomerSearchByCustomerIdVOImpl.java
3) Create a new OA Web page called "mzSearchPG.xml"
Simple page, with 4 fields from "mzInternalCustomerSearchByCustomerIdVO"
Add a Page Controller "mzSearchPGCO.java" to send a hard coded customerID to the AM to show customer data on the page when the page is launched (I told you this was a simple example :-) ) See java code in Appendix A below.
Run this page through JDeveloper and check it displays the page, with some data on it..
4) Now I want to deploy this to my Apps 11i instance, so I can run through Apps itself
a) First copy over the compiled objects, if using your custom scheme, this could be easiest achieved by copying over the whole of the D:\Jdev_510\jdevhome\jdev\myclasses\oracle\apps\mz directory to the $OA_JAVA\oracle\apps\mz directory, although you can be more selective if required
NOTE - it is the "myclasses" files you need to copy (the .class not the .java files!)
In this case, I have added classes to the existing ar directory structure, so need to copy the 4 class files from "D:\Jdev_510\jdevhome\jdev\myclasses\oracle\apps\ar\irec\common\server" to the $OA_JAVA/oracle\apps\ar\irec\common\server directory.
b) I have not yet used the "substitution" mechanism in JDev to use custom objects rather than the original ones, but had I done so, I would need to load the <Project Name>.jpx file into the MDS. Follow the instructions in the Developers Guide, chapter 9 "Deploying Customer Extentions" to do this, but you can use a batch file like below:-
REM
REM Batch file to set environment to upload JPX file into Apps database
REM
REM This section is for the PC specific variables
set JDEV_BIN_HOME=D:\Jdev_510\jdevbin
set JDEV_USER_HOME=D:\Jdev_510\jdevhome\jdev
set DB_CONNECTION="(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(host=hostname.domain.com)(port=1521))(CONNECT_DATA=(SID=VIS)))"
set JPX2UPLOAD=mzExtend
set APPS_PASSWD=apps
REM End of PC specific variables
REM Set PATH to ensure we are using the right Java.exe
set PATH=%JDEV_BIN_HOME%\jdk\bin;%JDEV_BIN_HOME%\jdev\bin;%PATH%
REM This is what we actually want to run...
call jpximport.bat %JDEV_USER_HOME%\myprojects\%JPX2UPLOAD%.jpx -username apps -password %APPS_PASSWD% -dbconnection %DB_CONNECTION%
pause
REM End of process
This loads the JPX into the MDS, for example to the location
/oracle/apps/ar/irec/common/server/customizations/site/0/mzInternalCustomerSearchByCustomerIdVO
To remove the substitution, you would need to use JDR_UTILS, for example
exec jdr_utils.deleteDocument('/oracle/apps/ar/irec/common/server/customizations/site/0/mzInternalCustomerSearchByCustomerIdVO');
c) Deploy the XML pages into MDS from local PC. Can use following wrapper script
REM
REM Batch file to set environment to upload XML Page files into Apps database
REM
REM This section is for the PC specific variables
set JDEV_BIN_HOME=D:\Jdev_510\jdevbin
set JDEV_USER_HOME=D:\Jdev_510\jdevhome\jdev
set JDEV_PROJECT_HOME=%JDEV_USER_HOME%\myprojects
set DB_CONNECTION="(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(host=hostname.domain.com)(port=1521))(CONNECT_DATA=(SID=VIS)))"
REM example of PAGE2UPLOAD mz\comments\bc4jcomponents\CreateCommentPG
REM can also just specify directory to load all pages in that directory
set PAGE2UPLOAD=ar\irec\common\server
set APPS_PASSWD=apps
REM End of PC specific variables
REM Set PATH to ensure we are using the right Java.exe
set PATH=%JDEV_BIN_HOME%\jdk\bin;%JDEV_BIN_HOME%\jdev\bin;%PATH%
REM This is what we actually want to run...
call import.bat %JDEV_PROJECT_HOME%\oracle\apps\%PAGE2UPLOAD% -rootdir %JDEV_PROJECT_HOME% -mmddir %JDEV_BIN_HOME%\jdev\lib\ext\jrad\config\mmd -username apps -password %APPS_PASSWD% -dbconnection %DB_CONNECTION% -jdk13 -validate
pause
REM End of process
Check they are uploaded OK, using the SQL
REM START OF SQL
set serveroutput on
set pagesize 132
exec JDR_UTILS.listContents('/oracle/apps/ar/irec/common/server', true);
REM END OF SQL
The following is a general script to look for all pages in your custom schema
REM START OF SQL
set serveroutput on
set pagesize 132
exec JDR_UTILS.listContents('/oracle/apps/mz', true);
REM END OF SQL
d) Create new Function to call the page, for example:
Function Name = MZ_CREATE_COMMENT
User Function Name = mz Create Comment
Type = SSWA JSP Function (JSP)
HTML Call = OA.jsp?page=/oracle/apps/mz/comments/bc4jcomponents/CreateCommentPG
In my case, I am adding the following:
Function Name = MZ_CUSTOMER_SEARCH
User Function Name = mz Customer Search
Type = SSWA JSP Function (JSP)
HTML Call = OA.jsp?page=/oracle/apps/ar/irec/common/server/mzSearchPG
e) Add function to menu
MZ_CUSTOM_SSWA menu for example.
f) Bounce Apache
g) Test page
Login as user with the responsibility to see the menu
Select the menu function to launch the page and check the results are the same as from JDeveloper
Create similar customization, in custom schema
----------------------------------------------
I really should have created the above customization in my custom schema, so will do so now.
Create a new empty BC4J package called
oracle.apps.mz.sanity.server
For my custom page, I need to create a custom VO and AM
Create a new VO, extending the original
oracle.apps.mz.sanity.server.mzSearchVO
Manually copy the SQL from the original VO, my customization requires me to remove the WHERE clause from the original SQL
Create a new AM, extending the original
oracle.apps.mz.sanity.server.mzSearchAM
In the view objects selection, add "mzSearchVO"
I am modifying these java files, to enable a default selection to show when the custom page is launched
mzSearchAMImpl.java
mzSearchVOImpl.java
3) Create a new OA Web page called "mzNewSearchPG.xml"
Simple page, with 4 fields from "mzSearchVO"
Add a Page Controller "mzNewSearchCO.java" to send a hard coded customerID to the AM to show customer data on the page when the page is launched.
Run this page through JDeveloper and check it displays the page, with some data on it..
4) Deploy the page and java objects to the Apps 11i instance and re-test
5) Once checked that it is working, I am now going to personalize this new screen.
I did not include all the items from the VO in the customization, so will add a new field to the page directly.
Do a Site level personalization, then add an item.
Type = Stylised Text
ID = ConcatenatedAddress
prompt = Address
VO Attribute = ConcatenatedAddress
VO Instance = mzSearchVO1
On saving this personalization and returning to the page, you will see the Address text on the page as well
APPENDIX A
--
-- java code for mzSearchPGCO page controller
-- (comments and spacing stripped out)
--
package oracle.apps.ar.irec.common.server.webui;
import java.io.Serializable;
import oracle.apps.fnd.common.MessageToken;
import oracle.apps.fnd.common.VersionInfo;
import oracle.apps.fnd.framework.OAApplicationModule;
import oracle.apps.fnd.framework.OAException;
import oracle.apps.fnd.framework.OAViewObject;
import oracle.apps.fnd.framework.webui.OAControllerImpl;
import oracle.apps.fnd.framework.webui.OADialogPage;
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import oracle.jbo.domain.Number;
public class mzSearchPGCO extends OAControllerImpl
{
public static final String RCS_ID="$Header$";
public static final boolean RCS_ID_RECORDED =
VersionInfo.recordClassVersion(RCS_ID, "%packagename%");
public void processRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processRequest(pageContext, webBean);
-- NOTE this is hard coded value for quickness and simplicity.
String customerId = "8070";
OAApplicationModule am = pageContext.getApplicationModule(webBean);
Serializable[] params = { customerId };
am.invokeMethod("initDetails", params);
}
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processFormRequest(pageContext, webBean);
}
} // end of class
IMPORTANT NOTE
--------------
Ensure you are using the correct version of JDeveloper. Review Note 416708.1 to confirm the correct patch number
RELATED DOCUMENTS
-----------------
Note 330236.1 "Configuring JDeveloper For Use With Oracle Applications 11i"
Note 357218.1 "Troubleshooting JDeveloper setup for Oracle Applications"
Note 416708.1 "How to found right version of JDeveloper for eBusiness Suite 11i and 12"
---------------------------------------------------------------------------------------------------------------------------------
Oracle Application Framework (OAF) Interview Questions and Answers
1. What is an EO?
a. Map to a database table or other data source
b. Each entity object instance represents a single row
c. Contains attributes representing database columns
d. Fundamental BC4J object through which all inserts/updates/deletes interact with the database
e. Central point for business logic and validation related to a table
f. Encapsulates attribute-level and entity-level validation logic
g. Can contain custom business methods
2. What is a VO?
a. Represent a query result
b. Are used for joining, filtering, projecting, and sorting your business data
c. Can be based on any number of entity objects
d. Can also be constructed from a SQL statement
3. What are the methods in controller?
ProcessRequest, ProcessformData and processformrequest
ProcessRequest : is called when the page is requested for the first time from the server.
ProcessFormRequest : is called when some event occurs on the page
ProcessformData(not visible). : Used to capture Data from the form fields which the user has entered and post it into Model Layer.
4. What is a Controller?
Controller is the java file and can be associated to a complete OAF page or to a specific region.
There are several tasks you will do routinely in your code.
Handle button press and other events
Automatic queries
Dynamic WHERE clauses
Commits
JSP Forwards
The logic for accomplishing all these tasks is written in controller
5. When is the processRequest method called?
PR method is called when the page is getting rendered onto the screen
6. When is processFormRequest method called?
PFR method is called when we perform some action on the screen like click of submit button or click on lov
7. What is extension?
Extension is when you take an already existing component ex an OAF page or a region and then add some more functionality to it without disturbing the original functionality.
8. What is personalization?
Oracle Apps Framework has an OA Personalization Framework associated with it so that you can personalize any OAF page in an Oracle E-business Suite application without changing the basic or underlying code of that OA Framework page, Oracle Application Framework makes it very easy to personalize the appearance of the page or even the personalization of data displayed on to an OA Framework page.
9. What are levels of personalization?
1. Function Level
2. Localization Level
3. Site Level
4. Organization Level
5. Responsibility Level
6. Admin-Seeded User Level
7. Portlet Level
8. User Level
10) What is BC4J?
Business Components for Java is JDeveloper’s programming framework for building multitier database applications from reusable business components. These applications typically consist of:
• A client-side user interface written in Java and/or HTML.
• One or more business logic tier components that provide business logic and views of business objects.
• Tables on the database server that store the underlying data.
11.What are all the components of BC4J?
Following are the components of BC4J:
• Entity Object - EO encapsulates the business logic and rules. EO’s are used for Inserting, Updating and Deleting data from the database table. E0 is also used for validating the records across the applications.
• View Object - View object encapsulates the database query. It is used for selecting data. It provides iteration over a query result set. VO’s are primarily based on EO’s. It can be used on multiple EO’s if the UI is for update.
• Application Module - Application Modules serve as containers for related BC4J components. The pages are related by participating in the same task. It also defines the logical data model and business methods needed.
12) What is an EO?
EO encapsulates the business logic and rules.EO’s are used for Inserting, Updating and Deleting data. This is used for validating across the applications. We can also link to other EO’s and create a Association object.
13) What is an VO?
View object encapsulates the database query. It is used for selecting data. It provides iteration over a query result set.VO’s are primarily based on Eo’s. It can be used on multiple EO’s if the UI is for update. It provides a single point of contact for getting and setting entity object values. It can be linked together to form View Links.
14) What is an AO?
An association object is created where we link EO’s. For example take the search page where we link the same EO to form a association between the manager and employee. Every employee should have a manager associated. But if it President then no there is no manager associated. This is a perfect example to understand the AO.
15) What is an VL?
A view link is an active link between view links. A view link can be created by providing the source and destination views and source and destination attributes. There are two modes of View link operation that can be performed. A document and Master/Detail operation.
16). What is UIX?
UIX is an extensible, J2EE-based framework for building web applications. It is based on the Model-View-Controller (MVC) design pattern, which provides the foundation for building scalable enterprise web applications.
17). Where the VO is located in the MVC architecture?
VO is located in the View Layer in MVC which is responsible for presenting the data to the user.
18) Which package should include EO and AO.
The EO and AO will be present in the schema.server package.
19) What is the difference between inline lov and external lov.
Inline lov is a lov which is used only for that particular page for which it was created and cannot be used by any other page.
External lov is a common lov which can be used by any page. It is a common component for any page to use it. It can be used by giving the full path of the lov in the properties section “External LOV” of the item.
20) what is a Javabean?
JavaBeans is an object-oriented programming interface that lets you build re-useable applications or program building blocks called components that can be deployed in a network on any major operating system platform.
21) What is query Bean?
QueryBean is used to execute and return the results of a query on behalf of the QueryPortlet application.
22) what is the difference between autocustomization criteria and result based search?
Results based search generates search items automatically based on the columns on the results table.
In Autocustomization search we need to set what all fields are required to display as a search criteria.
23) what is MDS?
MDS is MetaData Service. When a web page is broken into small units like buttons,fields etc they are stored in a database. These are not stored as binary files but as data in tables. The data are present in JDR tables. MDS provides service to store & return page definitions. MDS collects those definitions in components/fields in a meaningful manner to build a page.
24) What is XML?
XML is a markup language for documents containing structured information.
Structured information contains both content (words, pictures, etc.) and some indication of what role that content plays (for example, content in a section heading has a different meaning from content in a footnote, which means something different than content in a figure caption or content in a database table, etc.).
25) What is the difference between customization and extension?
Customization is under direct user control. The user explicitly selects between certain options. Using customization a user can:
Altering the functionality of an application
Altering existing UI
Altering existing business logic
Extension is about extending the functionality of an application beyond what can be done through personalization. Using extension we can:
Add new functional flows
Extend or override existing business logic
Create New application/module
Create New page
Create New attribute
Extend/Override defaults & validations
26) What is Personalization?
Personalization enables you to declaratively tailor the UI look-and-feel, layout or visibility of page content to suit a business need or a user preference. Using Personalization we can:
• Tailor the order in which table columns are displayed.
• Tailor a query result.
• Tailor the color scheme of the UI.
• Folder Forms
• Do Forms Personalization
27)Can you extend every possible Application Module?
Answer: No..Root AM cannot be extended.
28) What is rootAM?
The application module which is associated with the top-level page region (the pageLayout region) is root application module.
29) Why can’t Root AM be extended?
The root AM is loaded first and after that the MDS Substitutions are parsed.
Hence ROOT AM gets loaded even before the time the substitutions definition from MDS layer get worked out.
Obviously, the root am cant substitute itself, hence it can’t be extended
30)What are the various profile options in OAF?
FND Diagnostics: required for ABOUT THIS PAGE and Diagnostic link on page.
Personalize Self Service Definitions: To enable Personalize page link on the page.
FND Personalization Region Link Enabled: used to enable Region Personalization links at every region.
FND Migrate to JRAD: By default set to Yes. Page would run from MDS if Yes, else it will run from AK.
FND Document root path: required for personalization migration. It is set to path of the MDS folder on the respective servers.
FND Branding image:
FND Banding Size: these profiles options are used for changing standard image (Oracle) on the page.
31)Steps for VO substitution?
1. About this Page-> VO, AM, EO, Path of Page
2. Export Commad (in cmd Prompt)
3. New .jpr =Open page
4. Look for AM and VO or EO.
5. Copy the class files of VO,AM or EO
6. Decompile into Java and store it into MyProjects (with respective directory structure)
7. Open VO.xml in a new jpr
8. Create a new BC4J based on your Original VO.
9. Create a new VO and extends original VO
10. Change the query
11. Rebuild the project
12. Go to .jpx(double click)
13. Go to Substitutions
14. Substitute Vo
15. Rebuild your Project .jpr
16. Transfer New VO class and xml to respective directory structure
17. FTP .jpx into $JAVA _TOP
18. unix command promrt CD$ JAVA_TOP
19. jpx importer command
20. Bounce Apache Server
32)What are different methods for passing paramaters?
1. Tokens
eg. vname={@AttributeName}
2. Hash Maps
eg. HashMap variablename=nre HashMap();
variablename.add(“ParameterName”,ParameterValue);
3.ThroughSession
eg. pageContext.putSessionvalue(“ParamterName”,ParameterValue)
33) setForwardURL list
There are many parameters, here is the complete list of it:-
public void setForwardURL(String functionName,
byte menuContextAction,
String menuName,
com.sun.java.util.collections.HashMap parameters,
boolean retainAM,
String addBreadCrumb,
byte messagingLevel)
Parameters:
functionName – This is the function name representing the page you want to forward to. If its null, an IllegalArgumentException will be thrown.
Also if the function is not under the current HOMEPAGE a OAException will be thrown.
menuContextAction – Determines the behavior of the MenuContext after forwarding to the new page. It accepts the following values:
OAWebBeanConstants.KEEP_MENU_CONTEXT: Keeps the menu context as is.
OAWebBeanConstants.KEEP_NO_DISPLAY_MENU_CONTEXT: Keeps the menu context as is, but will not display all menus including global buttons.
OAWebBeanConstants.KEEP_NO_DISPLAY_MENU_CONTEXT_RETAIN_GLOBAL_BUTTONS: Keeps the menu context as is, but will not display all menus excluding global buttons.
OAWebBeanConstants.REMOVE_MENU_CONTEXT: Removes the menu context
OAWebBeanConstants.GUESS_MENU_CONTEXT: Selects the given functionName function if it exists in the current menu.
If not it will try to make a guess by moving up the menu tree until it finds it. An exception will be thrown if the function could not be located.
OAWebBeanConstants.RESET_MENU_CONTEXT: Reset the menu context to the given functionName and menuName.
menuName – The name of the HOMEPAGE menu to reset the Menu context to when the menuContextAction is OAWebBeanConstants.RESET_MENU_CONTEXT.
If the menuName is not of type HOMEPAGE a OAException will be thrown. You can pass null otherwise.
parameters -
HashMap of parameter name/value pairs to append to the forward URL. The final forward URL parameters are in the following sequence:
It will first get the function’s corresponding URL call by querying the function information from the database. If the user is not authorized to execute this function, a security OAException will be thrown.
It will then append all parameters passed in the parameters HashMap. First parameter added to the HashMap will be first added to the URL. Also the framework will encode all parameter values before appending them to the URL.
It will remove all parameters if they have null values in the passed parameters HashMap. This provides an easy way for developers to set a certain parameter’s value to null if they want to remove it.
It will remove any OA Framework internal URL parameters such as bcrumb, retainAM, and so on..
retainAM – If true, all the cached application modules will be retained. If false, all the cached application modules will be released.
Developers must use this parameter to control the release behavior of the cached appplication modules.
This method will ignore any retainAM=true or retainAM=false as a URL parameter or as part of parameters
34)Code to copy rows in VO
public void copy()
{
SuppliersVOImpl pervo = getSuppliersVO1();
Row row[] = pervo.getFilteredRows("SelectFlag","Y");
for (int i=0;i<row.length;i++)
{
SuppliersVORowImpl rowi = (SuppliersVORowImpl)row;
OADBTransaction trx = (OADBTransaction)getTransaction();
Number b = trx.getSequenceValue("FWK_TBX_SUPPLIERS_S");
AttributeList a = (AttributeList)rowi;
SuppliersVORowImpl r =(SuppliersVORowImpl)pervo.createAndInitRow(a);
//Set here your unique attribute values, I'm setting here Supplier Id as for every new row it should be different.
r.setSupplierId(b);
pervo.insertRow(r);
}
}
35)what for isPreparedForExecution() and executeQuery() methods used?
isPreparedForExecution function will check whether all parameters are assigned properly and query is ready for execution.
On multiple navigations to the page this query will not be executed multiple times.
While executeQuery function is used for executing the VO query so that it can fetch the data from database into VO cache.
36) What is the pattern used in developing any OAF component?
MVC (Model, View, Controller)
Lists the components in the MVC architecture
Model: Application Module, View Objects, View Links, Entity Objects, Entity Associations etc.
View: Page, Region, Attributesets etc.
Controller: Controller class files
37) Which is the component responsible for user actions?
Controller is the object. The code present in ProcessFormRequest gets executed up on the user action.
38) If we have to initialize something during the page loading, which is the right place?
A. ProcessRequest() method of the Controller file is the right place.
39) What is the significance of ProcessFormData()?
For a ‘POST’ request the data on the page is binded to the view object in this method
40) Does ‘GET’ request result in calling ProcessFormData()?
No, only POST request calls that.
41. What is the main Controller component in OAF?
OAController is the main class and our controller will become subclass of it.
42.How does page structure get created at runtime?
OAPageBean is responsible for creating the bean hierarchy structure at runtime after calling ProcessRequest() of each of the beans in the hierarchy.
43.Where does the client BC4J objects get placed in the server?
A. They are located in the oracle.apps.<product>.<application>.server
44.Where does the server BC4J objects get placed in the server?
They are located in the oracle.apps.<product>.<application>.schema.server
45.Where does the Page and Controller related files get placed?
They are located in oracle.apps.<product>.<application>.webui
46.What are Validation View Objects?
They are the VVO’s used in validation of attributes, they are the BC4J components and have their AM ie VAM Validation Application Module
47. What is the version of Jdeveloper to be used in 11i or R12?
For 11i, Jdeveloper 9i will be used and for R12 Jdeveloper 10g will be used.
48. What is a Database Connectivity File?
It is a .dbc file which is specified in the project properties. The location of this file on the server is $FND_TOP/secure
49. What is a View Object?
It is a BC4J(Business Component for Java) object which encapsulates the query results. View objects will support the display of the content to user in the Page.
50. How do you create a view object?
View objects can be created in the Business components package, can be based on entity objects or an sql query. View objects based on sql query are read only view objects
51. WHAT IS AN ENTITY OBJECT?
Entity object is created based on a database table, it is responsible for insertion/updation/validation of the table data. They are stored in the oracle.apps.<prod>.<application>.schema.server package directory
52. What is an Application Module(AM)?
Application module holds the related objects pertaining to an application ie. View objects, Entity Objects etc. The application module helps in getting the required database connection, maintains the page session or transaction context
53. What is the object passed to every page request?
OAPageContext object is passed to every request, using this object the controller initializes the application module object and will call the required methods.
54. Where is the view object(VO) initialization or query filtering done?
It is done with view object implementation class Ex. EmpVOImpl.java
55. What is the property to set for an AM so that the transaction state is maintained across pages?
RETENTION_LEVEL property is set to value MANAGE_STATE for an AM.
56.What is the Personalization?
Personalization means changes to the existing ‘Page’ according to the customer requirement
57.Give some examples of Page Personalization?
Addition of new columns to a table results, adding of fields, changing the order of regions, columns etc. Apart from this validation of certain fields, display of Descriptive flex fields etc can also be achieved
58. WHAT IS EXTENSION?
Extension is the changing of the existing components for adding more features or customer required features. View Objects, Controller, Application Module can be extended.
59. What is substitution?
When view objects are extended, we need to tell the applications that our extended view object should be used or substituted during runtime, substitution will serve this purpose
60. How to do register a new OA Framework page in Oracle Applications?
oracle.jrad.tools.XMLImporter utility will be used. After successfully importing the page data will be stored in metadata repository tables of the database
61. How do you move personalization from one machine to another?
Using the functional administrator responsibility the xml file can be downloaded, this file contains the required personalization done on a particular page. The same can be used to upload in a different instance. Here XMLImporter utility can be also used.
62. How is the applications security maintained during the OA Framework components development or how is the required security obtained?
The Database connectivity file ( .dbc file) has the applications username and password along with the responsibility to be used for connecting to the applications at page run time.
63. What are the different layers of onion reuse object model in OAF?
The hierarchy is as :
Controller (XXCO.java)
|__
Application Module (XXAMImpl.java, XXAM.xml)
|__
View Objects(XXVOImpl.java, XXVORowImpl.java, XXVO.xml)
|__
Entity Objects(XXEOImpl.java, XXEO.xml)
|_ Database
64. What is ‘Partial Page Rendering’ PPR?
A. PPR is a mechanism where in only the required part of the page is refreshed as against the whole page. The page objects fire the ‘events’ and accordingly the request is handled in the controller file
65. What are the search region options available?
Simple Search – ResultBasedSearch is the construction mode for the region
Advanced or autocustomization search – Autocustomization is the mode here
None – User has the develop the page, regions, controller etc here
66. What is the bean used for supporting transactions across pages visually to the user?
OATrainBean is used to link the pages across the transaction. AM supports the transaction context or state here across the pages.
67. How does personalization takes its effect at runtime?
After the page structure or bean hierarchy is formed with, the personalization layers get applied on top of it to come up with the final structure. Remember that is the reason why personalization is upgrade safe.
68. Name some components requiring extension?
View Objects, Controller, Application Module. Yes nested application module concept is allowed.
After you modify a class file and move it to the server what is the immediate step that will be followed?
The services of the instance ie. Apache server etc. have to be bounced so that the new code in the class file takes effect.
69. Where does the two categories of files in OAF be placed in the server?
All the xml files of the page/region will be placed in the respective TOP’s mds directory. All the class files irrespective of TOP will be placed under $JAVA_TOP which can be $COMMON_TOP/java
70. When do you create additional business components package?
Apart from B4CJ client business components package and B4CJ server business components package we create additional business components package when we develop any sharable thing such as ‘LOV’ (List of Values), ‘Poplist’ etc which will be used in multiple pages
71. How do you map the LOV created to your base page?
One of the items in the page has to be MessageLOVInput which extends the new LOV region, apart from this LOV mappings between base page and LOV region have to be created.
72. What is the default top region of any new page that you create?
PageLayout is the top level default region
73.At what level region controller for a page can be set?
It can be under a Main region under PageLayoutRegion or any region as per the business need. Provision of defining multiple controllers for a page also exist.
74. PPR follows GET or POST flow?
POST flow
75. What is the extension to the tool for developing OA F components?
Jdeveloper OA Extension class support the OA F development
76. What are the methods in controller?
ProcessRequest and processformrequest
77. What is a Controller?
Controller is the java file and can be associated to a complete OAF page or to a specific region.
There are several tasks you will do routinely in your code.
? Handle button press and other events
? Automatic queries
? Dynamic WHERE clauses
? Commits
? JSP Forwards
The logic for accomplishing all these tasks is written in controller
78. When is the processRequest method called?
PR method is called when the page is getting rendered onto the screen
79. When is processFormRequest method called?
PFR method is called when we perform some action on the screen like click of submit button or click on lov
80. What are levels of personalization?
1. Function Level
2. Localization Level
3. Site Level
4. Organization Level
5. Responsibility Level
6. Admin-Seeded User Level
7. Portlet Level
8. User Level
81) What is the difference between inline lov and external lov.
Inline lov is a lov which is used only for that particular page for which it was created and cannot be used by any other page.
External lov is a common lov which can be used by any page. It is a common component for any page to use it. It can be used by giving the full path of the lov in the properties section “External LOV” of the item.
82) what is a Javabean?
JavaBeans is an object-oriented programming interface that lets you build re-useable applications or program building blocks called components that can be deployed in a network on any major operating system platform.
83) What is query Bean?
QueryBean is used to execute and return the results of a query on behalf of the QueryPortlet application.
84) what is the difference between autocustomization criteria and result based search?
Results based search generates search items automatically based on the columns on the results table.
In Autocustomization search we need to set what all fields are required to display as a search criteria.
85) what is MDS?
MDS is MetaData Service. When a web page is broken into small units like buttons,fields etc they are stored in a database. These are not stored as binary files but as data in tables. The data are present in JDR tables. MDS provides service to store & return page definitions. MDS collects those definitions in components/fields in a meaningful manner to build a page.
86) What is XML?
XML is a markup language for documents containing structured information.
Structured information contains both content (words, pictures, etc.) and some indication of what role that content plays (for example, content in a section heading has a different meaning from content in a footnote, which means something different than content in a figure caption or content in a database table, etc.).
87) What is the difference between customization and extension?
Customization is under direct user control. The user explicitly selects between certain options. Using customization a user can:
Altering the functionality of an application
Altering existing UI
Altering existing business logic
Extension is about extending the functionality of an application beyond what can be done through personalization. Using extension we can:
Add new functional flows
Extend or override existing business logic
Create New application/module
Create New page
Create New attribute
Extend/Override defaults & validations
88) What is Personalization?
Personalization enables you to declaratively tailor the UI look-and-feel, layout or visibility of page content to suit a business need or a user preference. Using Personalization we can:
• Tailor the order in which table columns are displayed.
• Tailor a query result.
• Tailor the color scheme of the UI.
• Folder Forms
• Do Forms Personalization
88)Can you extend every possible Application Module?
Answer: No..Root AM cannot be extended.
89) What is rootAM?
The application module which is associated with the top-level page region (the pageLayout region) is root application module.
90) Why can’t Root AM be extended?
The root AM is loaded first and after that the MDS Substitutions are parsed.
Hence ROOT AM gets loaded even before the time the substitutions definition from MDS layer get worked out.
Obviously, the root am cant substitute itself, hence it can’t be extended
91.WHAT IS MVC ARCHITECTURE?
Ans: MVC Architecture is a Model View Controller Architecture. The controller responds to user actions and directs application flow. The model encapsulates underlying data and business logic of the application. The view formats and presents data from a model to the user.
92.which is the MVC layer VO located?
Ans: O is located in the View Layer which is responsible for presenting the data to the user.
93.Which package should include EO and AO.
Ans: The EO and AO will be present in the schema.server package.
94.What is the difference between inline lov and external lov.
Ans: Inline lov is a lov which is used only for that particular page for which it was created and cannot be used by any other page.External lov is a common lov which can be used by any page. It is a common component for any page to use it. It can be used by giving the full path of the lov in the properties section “External LOV” of the item.
95.what is a Javabean?
Ans: JavaBeans is an object-oriented programming interface that lets you build re-useable applications or program building blocks called components that can be deployed in a network on any major operating system platform.
96.What is query Bean?
Ans: QueryBean is used to execute and return the results of a query on behalf of the QueryPortlet application.
what is the difference between autocustomization criteria and result based search?
Ans: Results based search generates search items automatically based on the columns on the results table.
In Autocustomization search we need to set what all fields are required to display as a search criteria.
97. what is MDS?
Ans: MDS is MetaData Service. When a web page is broken into small units like buttons,fields etc they are stored in a database. These are not stored as binary files but as data in tables. The data are present in JDR tables. MDS provides service to store & return page definitions. MDS collects those definitions in components/fields in a meaningful manner to build a page.
98) Why Should we give retainAM=Y?
Ans: The AM should be retained whenever you are navigating away from a page and when you know that there is a possibility to come back to the page again and data is to be retained. Example : Any navigation link that opens in a new page or any navigation which has a back button to come back to the initial page.
The AM should not be retained for two independent pages, especially if they have common VOs which fetch different result sets. In such cases, retaining the AM may not remove the cache of VOs and so the result may not be as expected.
99) What is the significance of addBreadCrumb=Y
Ans: The basic intention of the breadcrumb is to let the user know of the navigation path he took to reach the current page.
100) How do you find right jdev patch for your oracle application version.
Ans: Search in oracle.metalink.com as Jdev with OA Extension.
101) What are the tools you had used for decompiling java class?
Ans: Jad is one of the tool for decompiling the java class.
102. What will setmaxFetchSize(0) will do?
Ans: setmaxFetchSize just determines how much data to be sent at a time.
103.Can we use dynamically created VO in OAF?What is the pros and cons?
Ans: Want to answer this section? use the comment section.
104.What is advanced table in table?
Ans: Want to answer this section? use the comment section.
105.What is a HGrid?
Ans: A HGrid, otherwise known as a hierarchy grid, allows users to browse through complex sets of hierarchical data.
106. Tell me the OAF components required for a simple search page?
Ans: VO,AM,Page
107.What is a switcher in oAF and when it is used?
Ans: A switcher is a control, that allows the selective display of information.For example if you want to display a image for update enabled and update disabled you can use switcher.
108.What are all the methods in CO?
Ans: processForRequest
processRequest
109.When a page renders which method in CO fires?
Ans: processRequest
110.How do you handle back button navigation in OAF based application?
Ans: Want to answer this section? use the comment section.
111.Where will you write your business logic?
Ans: EO.
112.What will vo.createRow() do?
Ans: createRow creates a row in the VO.
113.How do you catch the button event on ProcessFormRequest Method?
Ans: if (“update1?.equals(pageContext.getParameter(OAWebBeanConstants.EVENT_PARAM)))
Here update1 is the event.
114.What is pageButton bar?
Ans: When you want to display buttons on top and bottom of the page then you create a region as pageButtonbar and create buttons within this region.
115.How do you add a link to OAF Page?
Ans: Create a new item with style as link and give its destination uri property which is the url where you want to navigate to.
116.Which is the top most region in OAF page?
Ans: PageLayoutRN
117.What are all the several ways to debug an OAF based application?
Ans: We can use the debugger option .Set breakpoints and run the page in debug mode.
118.How do you call an pl/sql api from OAF page.
Ans: To call a PL/SQL API from OAF, we use OracleCallableStatement or CallableStatement
119.Should a search page have an EO?
Ans: Not necessary. If you are creating a record then we need a EO
120.What will happen when you set DisableClientSideValidation property to True?
Ans: If you set the property to True it shows that there will no validation that will occur on the web tier as part of the form submit.
121.WHAT IS SPEL?
Ans: It is an expression that will either return TRUE or FALSE.
122.Where is a SPEL used?
Ans: SPEL is used in places where you want to show or hide an item programatically.
123.What is PPR?
Ans: PPR is Partial Page rendering. Which means that only a particular part of the page is refreshed and not the entire page.
Examples of PPR scenarios?
Ans: [*]Hiding/Showing Objects[/*]
[*]Required/Optional[/*]
[*]Disabled/Enabled[/*]
[*]Read only/Updatable[/*]
124. How do you generate stack of exception and display the list of error messages in OAF page?
Ans: Create an arrayList of exceptions then do a raiseBundledException.
125.What is the significance of ProcessFormData method?
Ans: Fires when page submit happens..
126. Describe the steps for VO Extension?
Ans: 1.Identify VO to be extended.And Copy to your machine from server.
2.Create new Vo in xx.oracle.apps package and extend parent VO.
3.Create substitution in jdev.
4.Deploy extended VO to $JAVA_TOP.
5.Load jpx file to database using jpximporter..
127.How to enable personlization?
Ans: 1.Login to the application.
2.Click on Functional Administrator responsibility.
3.Click on Core Services Tab.
4.Click on Profiles.
5.Enter Pers%Self% in Name and click Go.
6.In the results you will see Personalise Self-Service Defn.Update it and enter Yes in the Site Value
128. When we should bounce the page?
Ans: Want to answer this section? use the comment section.
129. What is the command used to import an oaf page and region?
Ans: java oracle.jrad.tools.xml.importer.XMLImporter $JAVA_TOP/ -username <>-password <>-dbconnection “(DESCRIPTION= (ADDRESS=(PROTOCOL=tcp)(HOST=[LINK=http://cpa51d.cpa.bdoutsource.com/][/LINK])(PORT=1558)) (CONNECT_DATA= (SID=<>) ) )” -rootdir . ;
130. Where to locate the definition of standard OAF Pages and regions?
Ans: : $APPL_TOP/icx/11.5.0/mds/por/ — for purchasing
131. What is Passivation?
Ans: passivation is the process of saving application state to a secondary medium (the database) at specific event points so it can be restored (activated) when needed.
132.How do you get the value from the database sequence?
Ans: OADBTransaction transaction = getOADBTransaction();
Number employeeId = transaction.getSequenceValue(“SEQ Name”);
setEmployeeId(employeeId);
133. How do you perform your validation in OAF?
Ans: All OAF validations are done in the Entity Object.
134. How do you copy rows from one vo to another?
Ans: To copy multiple rows you can add the multipleSelection item for the table.Check which row is selected and write code for implementing this.
135.What is a transaction unit in OAF?
Ans: With the transaction unit identifier, you can indicate when a specific UI task begins and ends, and if the user navigates in an unexpected manner such as using the browser Back button. You can check the transaction unit status and react to ensure that inappropriate actions are not performed and unwanted data in the BC4J cache is not committed.
136. How to implement a dependent poplist?
Ans: Dependent poplist can be implemented by enabling firePartialAction and capturing the event for the source poplist and passing the value selected in the source to the method where we set the where clause and execute the query for the destination poplist.
137.How do we pass parameters between pages?
Ans: pageContext.forwardImmediately(“OA.jsp?page=/xxch/oracle/apps/fnd/test/webui/DetailsPG&fname=”+fname.
Here fname is the variable we are passing to the DetailsPG.
138. How do we synchronize a EO and Table in the database?
Ans: Right click on the EO and click Synchronise.
139. How to set currency formatting in an OAF advance table region?
Ans: pageContext.getOANLSServcies().formatCurrency(num,”USD”);
140. How to call Concurrent Program in OAF?
Ans :
public int submitRequest( String ProgramApplication ,String ProgramName ,String ProgramDescription ,String StartTime,boolean SubRequest,Vector Parameters ) throws RequestSubmissionException
ProgramApplication -Application Short name of application under which the program is registered.
ProgramName – Concurrent Program Name for which the request has to be submitted.
ProgramDescription – Concurrent Program Description.
StartTime – Time at which the request should start running.
SubRequest – Set to TRUE if the request is submitted from another running request and has to be treated as a sub request.
Parameters – Parameters of the concurrent Request.
Example:
public int submitCPRequest(OAPageContext oapagecontext,OAWebBean oawebbean,Number headerId)
{
OAApplicationModule am = oapagecontext.getApplicationModule(oawebbean);
try {
OADBTransaction tx = (OADBTransaction)am.getOADBTransaction();
java.sql.Connection pConncection = tx.getJdbcConnection();
ConcurrentRequest cr = new ConcurrentRequest(pConncection);
String applnName = "PO"; //Application that contains the concurrent program
String cpName = "POXXXX"; //Concurrent program name
String cpDesc = "Concurrent Program Description"; // concurrent Program description
Vector cpArgs = new Vector(); // Pass the Arguments using vector
cpArgs.addElement((String)headerId);
int requestId = cr.submitRequest(applnName, cpName, cpDesc, null, false, cpArgs); // Calling the Concurrent Program
tx.commit();
return requestId;
}
catch (RequestSubmissionException e)
{
OAException oe = new OAException(e.getMessage());
oe.setApplicationModule(am);
throw oe; }
}
141. How to Extend a VO which is having View Link?
Ans :
VO extension will take of viewlink by itself So we can extend this VO as usual VO Extension.
142.What is the Purpose of Serializable in OAF?
Ans: To Pass Multiple parameters of different type as a single
143. How to Synchronize an Entity Object (EO) with Data Base?
Ans:
Step 1 : Right click on Entity Object(EO) and click on “Synchronize with DataBase..”
Step 2 : Double Click on the EO, Click on Attributes in the left Panel and then Click on “New from Table….”
144. What are the methods in controller?
Ans: Controller is having three type of methods they are
1. ProcessRequest,
2. ProcessFormRequest
3. ProcessFormData
145. How do you catch the button event on ProcessFormRequest Method?
Ans:
if (pageContext.getParameter(.EVENT_PARAM).equals(“update”)) Here update is the event.
146. How to create a Dynamic VO?
Ans:
OAApplicationModule am = oapagecontext.getApplicationModule(oawebbean);
String DynamicVOQuery = “select a.scheduled_start_date,a.wip_entity_id,b.wip_entity_name from WIP_DISCRETE_JOBS a,WIP_ENTITIES b “;
DynamicVOQuery = DynamicVOQuery + "where a.wip_entity_id=b.wip_entity_id and wip_entity_name = :1 ";
OAViewObject DynamicViewObject =(OAViewObject) am.findViewObject("DynamicVO");
if(DynamicViewObject == null)
{
DynamicViewObject =(OAViewObject) am.createViewObjectFromQueryStmt("DynamicVO ", DynamicVOQuery);
DynamicViewObject.setWhereClauseParams(null);
DynamicViewObject.executeQuery();
oracle.jbo.Row row1 =DynamicViewObject.first();
if(row1 != null)
{
String mFndUserDescription = row1.getAttribute(0).toString();
}
DynamicViewObject.remove();
}
147. When is processFormRequest method called?
Ans:
ProcessFormRequest(PFR)t method is called when we perform some action on the screen like click of submit button or click on Go or any action perform on the page the result is displayed is called PFR.
148. Which package should include EO and AO?
Ans: The EO and AO will be present in the schema.server package.
149.What is Activation and Passivation in OAF
Ans:
Passivation is the process of saving application state to a secondary medium (the database) at specific event points so it can be restored (activated) when needed. This restoration of data is called Activation. Passivation in OAF is done implicitly when the appropriate profile options are enabled.
150. What is Validation View Object(VVO), Validation Application Module , Root Application Module , View Link , Entity Expert , Association Object , Attribute Set?
Ans:
Validation View Object – A view object created exclusively for the purpose of performing light-weight SQL validation on behalf of entity objects or their experts.
Validation Application Module – An application module created exclusively for the purpose of grouping and providing transaction context to related validation view objects. Typically, a standalone entity object or the top-level entity object in a composition would have an associated validation application module.
Root Application Module – Each pageLayout region in an OA Framework application is associated with a “root” application module which groups related services and establishes the transaction context.
This transaction context can be shared by multiple pages if they all reference the same root application module, and instruct the framework to retain this application module (not return it to the pool) when navigating from page to page within the transaction task.
View Link – Establishes a master/detail relationship between two view objects
Entity Expert – A special singleton class registered with an entity object (EO) that performs operations on behalf of the EO.
Association Object – BC4J association objects implement the relationships between entity objects. For example, a purchase order header can reference a supplier, or it can own its order lines.
Attribute Set – Bundles of region or item properties that can be reused either as is or with modifications. For example, all buttons sharing the same attribute set would have the same label and Alt text.
---------------------------------------------------------------------------------------------------------------
OAF Steps
Automatic Search Page Steps:
1) Create the page as the normal way like create jws, jpr, bc4js, AM, page etc…. .
2) Right click of the .jpr, Create the bc4j for VO.
EX: xxaam.oracle.apps.po.autosearch.server
3) Create VO under BC4J, and attach VO to the AM.
Ex:AutosearchVO -> add this into AM.
4) Select the page, Under page Layout RN,create one Region, region style as Query.
5) Then select query region -> right click -> Region using wizard ->dialogbox -> you can select your VO which you created in 3rd step.
6) Click next to continue -> there you can select region style is table region, because we are going to display results in table region.
7) Click next to continue ->Shuttle the items which you want to display in page and table region.
8) Then right click query Region-> select simple search panel & simple search query region
9) In simple search panel –create what ever you want to create the items means message text inputs, it will display in top of the Automatic search PG.
10) In simple search mappings -> you have create mappings. Map all the fields to query columns to created message text inputs in simple search panel.
11) Then run the automatic search PG.
How to Create LOV in OA Framework pages step by step:
1) Create the bc4j for LOV.Right click the .jpr create the BC4j for LOV.
Ex: xxaam.oracle.apps.po.autosearch.lov.server
2) Under the LOV bc4j, create the LOVVO and LOVAM(this VO and AM called as LOVVO and LOV AM).
Ex: xxxLOVVO and xxxLOVAM.
3) Attach that LOVAM to VO.
Ex:Add xxxLOVVO to xxxLOVAM.
4) Create the region under jpr, navigation path is -> right click .jpr->New->OAComponenst ->webtier->Region.
Ex:xxxLOVRN
5) Dialog Box->In region properties -> style as ListOfValues ->click OK.
6) In structure window select region ->property inspector ->scope – public and add LOV AM To this Region.
7) Come to item search allowed property should be true.
8) Select the page, which item you want to make LOV and select item style as Message LOV Input.
9) In property inspector window ->you have to add region path in external LOV.
10) Come to mapping section , select map1
Property inspector ->functional
LOV Region Item – data base column Name
Return Item – region Item
Criteria Item- same as return item
Manual Search Page Steps:
1) Create the page as the normal way like create jws, jpr, bc4js, AM, page etc…. .
2) Create one EO BC4J under that BC4J create EO.->Right click of the BC4J select New Entity Object.
EX: xxaam.oracle.apps.po.autosearch.schema.server and xxxEO.
Note : for Manual search no need to create Entity Object. Just for explaining how to create EO based VO.
3) Then create VO based on EO. Create new VO under particular(VO) BC4J, there you can shuffle the EO (which you created in 2nd step) into selected side.
4) Click next twice and query automatically will generate , if you want to change you select expert mode checkbox and you can change the query. Amend the where clause like below example.
Ex: SELECT DepartmentEO.DEPT_ID,
DepartmentEO.DEPTNO,
DepartmentEO.DEPTNAME,
DepartmentEO.LOCATION,
DepartmentEO.CREATED_BY,
DepartmentEO.CREATION_DATE,
DepartmentEO.LAST_UPDATED_BY,
DepartmentEO.LAST_UPDATE_DATE,
DepartmentEO.LAST_UPDATE_LOGIN
FROM Department DepartmentEO
WHERE DepartmentEO.DEPTNAME LIKE NVL(:1,DepartmentEO.DEPTNAME)
AND DepartmentEO.LOCATION LIKE NVL(:2,DepartmentEO.LOCATION)
Then finish the creation VO.
5) Add this VO into AM.
6) Then design the page , create 3 regions 1 for getting page items, 2 for getting buttons and, 3 for table region for displaying results when you press the go button.
7) Select AMimpl class file to write logic like below.
public int deptsearchparams(OAPageContext pageContext, OAWebBean webBean)
{
int flag=0;
String Dname = "";
String Location ="";
DeptSearchVOImpl vo= getDeptSearchVO1();
if(pageContext.getParameter("DeptName")!=null && !pageContext.getParameter("DeptName").equals(""))
{
Dname=pageContext.getParameter("DeptName").toString();
vo.setWhereClauseParam(0,Dname);
flag=1;
}
else
{
vo.setWhereClauseParam(0,null);
}
if(pageContext.getParameter("Location")!=null && !pageContext.getParameter("Location").equals(""))
{
Location=pageContext.getParameter("Location").toString();
vo.setWhereClauseParam(1,Location);
flag=2;
}
else
{
vo.setWhereClauseParam(1,null);
}
System.out.println("the flag value is"+flag);
return flag;
}
8) Create Controller under pageLayouot region to handle the go button events and call the logic from AM. Follow logic below.
if(pageContext.getParameter("Go")!=null)
{
XXnewAMImpl am=(XXnewAMImpl)pageContext.getApplicationModule(webBean);
int fg=am. deptsearchparams (pageContext, webBean);
if(fg==0)
{
am.getDepartmentVO1().setWhereClauseParam(0,"-gfdgdjghdj");
am.getDepartmentVO1().setWhereClauseParam(1,"hkdffhkdkhgkk");
throw new OAException("please select atleast one search criteria",OAException.ERROR);
}
else
{
am.getDepartmentVO1().executeQuery();
}
}
9) Then run the page to test the Manual search page.
Create page Steps:
1) Create the page as the normal way like create jws, jpr, bc4js, AM, page etc…. .
2) EO should be mandatory to develop the create the page.
3) Create the EO which table you want to insert the records through page.
4) Create the BC4J for EO and develop the EO.
Ex: xxaam.oracle.apps.po.autosearch.schema.server and xxxEO.
5) Then create VO based on EO. Create new VO under particular(VO) BC4J, there you can
Shuffle the EO (which you created in 2nd step) into selected side
6) Add above VO into AM.
7) Then design the page for appropriate records insert into table and create two buttons for pressing in page.
8) Then select AMimpl class file to develop the logic below.
public void CreateDept()
{
DepartmentCreationVOImpl vo= getDepartmentCreationVO1();
OADBTransaction Tr=getOADBTransaction();
if(!vo.isPreparedForExecution())
{
vo.executeQuery();
}
Row row1=vo.createRow();
vo.insertRow(row1);
row1.setNewRowState(Row.STATUS_INITIALIZED);
Number deptid=Tr.getSequenceValue("DEPT_DEPT_ID_SEQ");
// vo.getCurrentRow().setAttribute("DeptId",deptid);
vo.getCurrentRow().setAttribute("DeptId",deptid);
}
9) Create Controller under pageLayouot region to handle the go button events and call the logic from AM. Follow logic below.
Process Request :
DeptAMImpl am=(DeptAMImpl)pageContext.getApplicationModule(webBean);
am.invokeMethod("CreateDept");
Process Form request:
If (pageContext.getParameter("Save")!=null)
{
am.getOADBTransaction().commit();
}
Update Page Steps:
1) Create the page as the normal way like create jws, jpr, bc4js, AM, page etc…. .
2) EO should be mandatory to develop the update page.
3) Create the EO which table you want to update the records through page.
4) Create the BC4J for EO and develop the EO.
Ex: xxaam.oracle.apps.po.autosearch.schema.server and xxxEO.
5) Then create VO based on EO. Create a new VO under particular(VO) BC4J, there you can Shuffle the EO (which you created in 2nd step) into selected side
6) Add above VO into AM.
7) Select the search page, there select table region and create one item and style as image.
8) In the image properties a) image uri as updateicon_enabled.gif b)Action Type as fire action. In the parameter window -> id = pdeptid value -> ${oa.SearchVO1.DeptId}.
9) Create the update page with appropriate records. And Buttons.
10) Create Controller under pageLayouot region to handle the go button events and call the logic from AM. Follow logic below.
Process request:
if(pageContext.getParameter("pdeptid")!=null)
{
String deptid=pageContext.getParameter("pdeptid").toString();
String whereclause="DEPT_ID='"+deptid+"'";
am.getCreateVO1().setWhereClauseParams(null);
am.getCreateVO1().setWhereClause(whereclause);
am.getCreateVO1().executeQuery();
}
Process Form request:
If (pageContext.getParameter("Save")!=null)
{
am.getOADBTransaction().commit();
}
Create the table and synonym example:
Create table modpos.DEPARTMENT
(
DEPT_ID number PRIMARY KEY,
DEPTNO VARCHAR2(50),
DEPTNAME VARCHAR2(100),
LOCATION VARCHAR2(100),
CREATED_BY NUMBER,
CREATION_DATE Date,
LAST_UPDATED_BY NUMBER,
LAST_UPDATE_DATE Date,
LAST_UPDATE_LOGIN NUMBER
)
CREATE SYNONYM DEPARTMENT FOR modpos.DEPARTMENT
Create the Sequene with example:
create sequence DEPT_DEPT_ID_SEQ
Start with 1 increment by 1
Grant all on DEPT_DEPT_ID_SEQ to apps
create sequence DEPT_DEPT_ID_SEQ
Start with 4 increment by 1 cus
Grant all on DEPT_DEPT_ID_SEQ to apps cus
Create synonym DEPT_DEPT_ID_SEQ for cus.DEPT_DEPT_ID_SEQ apps
Call one OAF page from another OAF page Syntax:
if (pageContext.getParameter("Create")!=null)
{
pageContext.setForwardURL("OA.jsp?page=rajesh/oracle/apps/po/dept/webui/DepartmentCreationPage",
null,
OAWebBeanConstants.KEEP_MENU_CONTEXT,
null,
null,
false, // Retain AM
OAWebBeanConstants.ADD_BREAD_CRUMB_NO, // Do not display breadcrums
OAWebBeanConstants.IGNORE_MESSAGES);
}
Follow Bc4j for each object:
Ø AM AND VO -> BC4J
XXAAM.oracle.apps.po.xxname.server
Ø Entity Object(EO) -> BC4J
XXAAM.oracle.apps.po.xxname.schema.server
Ø LOV ->BC4J
XXAAM.oracle.apps.po.xxname.LOV.server
Ø Poplist ->BC4J
XXAAM.oracle.apps.po.xxname.poplist.server
Ø Controller,Page & Region
XXAAM.oracle.apps.po.xxname.webui
Delete page steps
1) For delete no need to create any pages.
2) Select search page , in table region you create one item and style as image. Below set of properties needs to set for this image.
Image Uri - deleteicon_enabled.gif
Action Type – fireAction
Event - Any Name (delete)
Parameter window:SPEL
Name – DeptId
Value - ${oa.SearchVO1.DeptId}
3) write the delete login AM, start with creating method ->
public void deletedepartment(String departmentid)
{
// First, we need to find the selected Program in our VO.
// When we find it, we call remove( ) on the row which in turn
// calls remove on the associated ModposVendorProgsImpl object.
int deptidtodelete=Integer.parseInt(departmentid);
SearchVOImpl vo=getSearchVO1();
SearchVORowImpl row=null;
// This tells us the number of rows that have been fetched in the
// row set, and will not pull additional rows in like some of the
// other "get count" methods.
int fetchedrowcount =vo.getFetchedRowCount();
System.out.println("Fetched Row Count is"+fetchedrowcount);
// We use a separate iterator -- even though we could step through the
// rows without it -- because we don't want to affect row currency.
RowSetIterator deleteiter=vo.createRowSetIterator("deleteiter");
if (fetchedrowcount >0)
{
deleteiter.setRangeStart(0);
deleteiter.setRangeSize(fetchedrowcount);
for (int i=0;i<fetchedrowcount;i++)
{
row=(SearchVORowImpl)deleteiter.getRowAtRangeIndex(i);
// For performance reasons, we generate ViewRowImpls for all
// View Objects. When we need to obtain an attribute value,
// we use the named accessors instead of a generic String lookup.
Number deptid=row.getDeptId();
if(deptid.compareTo(deptidtodelete)==0)
{
// This performs the actual delete.
row.remove();
getOADBTransaction().commit();
break;
}
}
}
deleteiter.closeRowSetIterator();
}
4) Call that delete even tin Controller like below. Below logic having how to create OADialog box in OA Framework.
if ("delete".equals(pageContext.getParameter(EVENT_PARAM)))
{
// The user has clicked a "Delete" icon so we want to display a "Warning"
// dialog asking if she really wants to delete the employee. Note that we
// configure the dialog so that pressing the "Yes" button submits to
// this page so we can handle the action in this processFormRequest( ) method.
String DeptId = pageContext.getParameter("DeptId");
OAException mainMessage = new OAException("POS","xxx");
// Note that even though we're going to make our Yes/No buttons submit a
// form, we still need some non-null value in the constructor's Yes/No
// URL parameters for the buttons to render, so we just pass empty
// Strings for this.
OADialogPage dialogPage = new OADialogPage(OAException.WARNING,
mainMessage, null, "", "");
// Always use Message Dictionary for any Strings you want to display.
String yes = pageContext.getMessage("AK", "FWK_TBX_T_YES", null);
String no = pageContext.getMessage("AK", "FWK_TBX_T_NO", null);
// We set this value so the code that handles this button press is
// descriptive.
dialogPage.setOkButtonItemName("DeleteYesButton");
// The following configures the Yes/No buttons to be submit buttons,
// and makes sure that we handle the form submit in the originating
// page (the "Employee" summary) so we can handle the "Yes"
// button selection in this controller.
dialogPage.setOkButtonToPost(true);
dialogPage.setNoButtonToPost(true);
dialogPage.setPostToCallingPage(true);
// Now set our Yes/No labels instead of the default OK/Cancel.
dialogPage.setOkButtonLabel(yes);
dialogPage.setNoButtonLabel(no);
// The OADialogPage gives us a convenient means
// of doing this. Note that the use of the Hashtable is
// most appropriate for passing multiple parameters. See the OADialogPage
// javadoc for an alternative when dealing with a single parameter.
Hashtable formParams = new Hashtable();
formParams.put("DeptId", DeptId);
dialogPage.setFormParameters(formParams);
pageContext.redirectToDialogPage(dialogPage);
}
else if (pageContext.getParameter("DeleteYesButton") != null)
{
// User has confirmed that she wants to delete this employee.
// Invoke a method on the AM to set the current row in the VO and
// call remove() on this row.
String DeptId = pageContext.getParameter("DeptId");
Serializable[] parameters = { DeptId };
// OAApplicationModule am = pageContext.getApplicationModule(webBean);
am.invokeMethod("deletedepartment", parameters);
// Now, redisplay the page with a confirmation message at the top. Note
// that the deleteComponent() method in the AM commits, and our code
// won't get this far if any exceptions are thrown.
OAException message = new OAException("POS","xxxxxxxx",
null,OAException.CONFIRMATION,null);
pageContext.putDialogMessage(message);
}
}
Emp advance table row
public void createemp()
{
EmployeeCreationVOImpl vo= getEmployeeCreationVO1();
DepartmentCreationVOImpl vo1= getDepartmentCreationVO1();
OADBTransaction tr=getOADBTransaction();
vo.setMaxFetchSize(0);
Row row1=vo.createRow();
vo.insertRow(row1);
row1.setNewRowState(Row.STATUS_INITIALIZED);
Number empid=tr.getSequenceValue("EMPLOEE_EMP_ID_SEQ");
vo.getCurrentRow().setAttribute("E
mployeeId",empid);
String departmentid=vo1.getCurrentRow().getAttribute("DeptId").toString();
vo.getCurrentRow().setAttribute("DeptId",departmentid);
}
if (ADD_ROWS_EVENT.equals(pageContext.getParameter(EVENT_PARAM)))
{
am.invokeMethod("createemp");
}
Comments
Post a Comment