1.Application
Module :- Container for BC4J Components
2.Entity
Object:- Encapsulates Business rules
3.View
Object:- Present data to the Framework Page.
1.CreationDate
2.CreatedBy
3.LastUpdateDate
4.LastUpdatedBy
5.LastUpdateLogin
1.Reference
Association
2.Composition
Association
1.When
Child is locked, parent is locked first automatically
2.Validation
order is child first, parent second
3.Insert/Update
order is parent first, child second
4.Deletion
order is child first, parent second
Naming
Standards for Application Module:-
The AM name should convey the
purpose the user interface module it services
Application Module name ends with
AM:- <ModuleName>AM
Ex:- HelloworldAM
EmployeesAM
SupplierAM
Naming
Standards for Controller Object:-
Controller Object ends with CO:-
<objectname>CO
Ex:- SearchCO
EmployeeCO
SupplierCO
OAF Page Contains
1.Regions
2.Items
There are 32 different types of
Region Styles and 32 different types of Items available for designing of a OAF
Page (As per version 12.1.1).
Page Contains the Region and the
Region contains the Items. Without Region, we cannot attach the Items to the
page.
Region:-
A Region is a container that holds
the items.
Different Types of Regions.
1.pageLayout
Region
This is
the top level region of every OAF page. It will create automatically when we
create the page.
2. Header Region:-
By using the Header Region, the
items in that region will have only 1 column. All the items will be in Line
Order
Item1
Item2
Item3
Item4
3. Message Component Layout
Here in this region, we are having
rows and columns properties. We can define how many columns and rows we want.
Suppose there are 4 items in the
region, we can define them in 2 columns as
Item1 Item3
Item2 Item4
Suppose we want all the items in 1
row as below
Item1 Item2 Item3 Item4
4. Default Single Column
5. Default Double Column
6.rowLayout Region
7.PageButton Bar Region
8. Query Region:- Which is useful
while creating the search page
9. Table Region:- which is useful
for displaying the data in the table region
10.Stack Layout Region:- which is
useful for displaying the data of flexfield
11.Train Region:- Which is useful
in multi transaction pages.
12. Advanced Search
13. Advanced table
14.Bulleted
list
15.Cell
Format
16. Content Container
17. content Footer
18. Default stack
19. Default Form Stack
20. Flexible layout
21. Flow Layout
22. gantt
23. Graph table
24. Hide show
25. Hide Show Header
26. Labeled
Field Layout 27. navigation Bar
28. shuttle
29.
Switcher 30. Tree 31. subTab
Layout. 32.hGrid
Items in OAF
1.Message
Styled Text
Whenever the user wants to display
only the text and the user should not be able to edit the text then we use the
message styled text
2. Message Radio Group:
This will create Radio Buttons in
your page
3. Message check Box:
This will create check boxes in
your page
4. Message Text Input:
By using this we will enter the
data in the text box.
5.Message Lov
Input:-
Whenever the user wants to select
the value, he can select from the list the values.
6. Message Choice:-
When you want to display a list of
values in drop down fashion, then we use message choice.
7. Message Download:
When the user needs to download a
page we use this message download
8. Message File upload:
User will browse the file from
local machine and upload a file.
9. Button:
It is a general button and it is
having action associated with it. You have set the property for the button.
Action Type Ã
Fire action
Ã
Partial Fire Action
Ã
None
10. Submit Button:-
By using this we will submit data
to the OAF page
11. Link:-
By using this we will Create links
12. Form Value:- This is used to
send the value to the OAF page but without being displayed in the OAF page
13. spacer: This is used to add
space between the two items placed in the page
14. separator:- This creates
horizontal line in the oaf page
15. Flex:- This is a flex field.
There are 2 types of flex fields. KFF and DFF
16. urlInclude:-
This help to include the HTML Content
17. tip:- Helps to give hint to the
user.
Where does the EO, VO, AM, Page, CO
resides ?
EO Resides in
xxx.Oracle.apps.fnd.objectname.schema.server
VO Resides in
xxx.oracle.apps.fnd.objectname.server
AM Resides in
xxx.oracle.apps.fnd.objectname.webui
Page Resides in
xxx.oracle.apps.fnd.objectname.webui
CO Resides in
xxx.oracle.apps.fnd.objectname.webui
Exceptions in OAF
There are 4 Types of Exceptions in
OAF
While writing exceptions, we need
to add the class
import oracle.apps.fnd.framework.OAException;
We write the exceptions in Process
Form Request of Controller.
1.INFORMATION
2.CONFIRMATION
3.ERROR
4.WARNING
throw new OAException(message,
OAException.INFORMATION);
Simple Page Creation steps:-
Welcome to Dhanush
Page Creation Steps.
1.First
we have to connect to our oracle database and then we have to start
2.Start
creating a workspace. Right click on the Application and create new OA
workspace.
Give the name for the workspace as Helloworld.jws
3. Click OK and then give project
name, directory name and default package and click on Next
4. Connect to the database at
runtime and browse the dbc file and give the oracle
applications login credentials.
5. Give the application short name
and Responsibility Key
6. Click on Next and Finish
7. Create the Application Module
and the package should end with webui and
click on Finish
8. Create the page and give the
name of the page and package should end with webui
9. It will create the .xml file in
the webui
10. Select the xml file and go to
the region and name it as PageLayout
Region and give the window title and Page title and attach the AM Definition in
the page.
11. Create another region and name
it as main region and create the text fields in the main region. After add
another region under it and add a button item and write the code for the Button
Item in the controller by creating the new controller for the xml file.
Code Written for GO Button in Controller Process Form Request Method
And
Validating Text Input to not
allowing the special Characters
if (pageContext.getParameter("Go")
!=
null)
{
String userContent=
pageContext.getParameter("Hello");
Pattern p=Pattern.compile("[^a-zA-Z0-9\\s]");
Matcher m=p.matcher(userContent);
if(m.find())
{
throw new OAException("Special
Characters are not allowed",OAException.ERROR);
}
else
{
String message =
"Welcome to Dhanush,
" + userContent
+ "!";
throw new OAException(message,
OAException.INFORMATION);
}
}
Creating of Clear Button In ButtonLayout Region
1.
After the creation of GO Button add one more
button Clear
Clear Button Code:-
Import the below classes
1. import
oracle.apps.fnd.framework.webui.OAWebBeanConstants;
2. import oracle.apps.fnd.framework.webui.beans.message.OAMessageTextInputBean;
if(pageContext.getParameter("clear")!=null) //id of clear button
{
OAMessageTextInputBean mstb =
OAMessageTextInputBean)webBean.findChildRecursive("Hello"); mstb.setValue(pageContext,null);
}
What is MDS?
MDS means Meta Data Service
Meta:-
Meta
means dictionary.
Think of a web page broken into small units which are fields, buttons, list
boxes. These small individual units[fields, buttons etc]
are stored in a dictionary, in the database. These units when combined
together, they become a webpage that gets rendered on the browser.
Data:-
Those meta pieces are not stored as binary files, but as data in tables. Those
tables begin with JDR, for example JDR_ATTRIBUTES,
JDR_ATTRIBUTES_TRANS, JDR_COMPONENTS & JDR_PATHS. The definition and
relationship of each field/region/component is stored in these JDR tables. OA
framework reads that data when you request a page. The page structure is then
built based on MetaData.
Service:-
Meta Data is available as a service(plain service not webservice).
The data is there in JDR tables, but all such data has to be co-related, all
fields, regions,buttons
etc
have to be clubbed into a meaningful manner to make a web page. You can say
that MDS provides service to store & return page definitions. MDS collates
those definitions in components/fields in a meaningful manner to build a page.
what are JDR tables?
JDR_PATHS:
Stores the path of the documents, OA Framework pages and their parent child
relationship.
JDR_COMPONENTS:
Stores components on documents and OA Framework pages.
JDR_ATTRIBUTES:
Stores attributes of components on documents and OA Framework pages.
JDR_ATTRIBUTES_TRANS:
Stores translated attribute values of document components or OA framework
pages.
MDS is located in every module top.
Partial
Page Rendering In OAF
Whatever item we place in the region, it has Action
Type which is a client Action.
Action Type is of 3 Types
1.
None
2.
fireAction
3.
firePartialAction
None will not perform any action
If you want to refresh a specific part of a page
without disturbing the entirepage, we go for firePartialAction.
Example on Partial Page Rendering.
1.
Suppose I entered text in the “State”
field, City field should be enabled.
2.
Suppose I clear the text in the “State”
field, City field should be disabled.
Steps Need to perform for this Example
1.
Create a New OAworkspace and project
2.
Create AM
3.
Create 1 VO and without Query. In the attributes
pages, create 2 Transient Attributes, 1 with Primary key.
Transient Attribute means the attribute which is not a
Database Attribute.
In VO we need
to create 2 transient attributes in the Attributes page.
Click on New to
Create the 1st Attribute.
Attribute
|
Property
|
Name
|
RowKey
|
Type
|
Number
|
Updateable
|
Always
|
Key Attribute
|
(Checked)
|
Make this attribute as Primary Key.
Click on New to Create another Attribute
Attribute
|
Property
|
Name
|
CityRender
|
Type
|
Boolean
|
Updateable
|
Always
|
4.
Create 1 Page, 1st Region is
“PageLayoutRegion”
2nd
Region is main region which is message component layout
Under main region
I am creating the text items
(i)
Name
(ii)
State
(iii)
City
Based on the
State, City Field should be displayed.
For State field,
Action type is firePartialAction
EventName is StateChange
In the City Field Render
Property should be ${oa.PPRVO1.CityRender}
and action Type is None.
Code written in
Application Module:-
public void handlePPRAction()
{
Number val = 1;
OAViewObject vo =
(OAViewObject)findViewObject("PPRVO1");
if (vo != null)
{
if (vo.getFetchedRowCount() ==
0)
{
vo.setMaxFetchSize(0);
vo.executeQuery();
vo.insertRow(vo.createRow());
OARow row =
(OARow)vo.first();
row.setAttribute("RowKey", val);
row.setAttribute("CityRender",
Boolean.FALSE);
}
}
}
Code written in Process
Request:-
PPRAMImpl am = (PPRAMImpl)pageContext.getApplicationModule(webBean);
am.invokeMethod("handlePPRAction");
Code written in Process Form
Request:-
PPRAMImpl am = (PPRAMImpl)pageContext.getApplicationModule(webBean);
OAViewObject vo =
(OAViewObject)am.findViewObject("PPRVO1");
OARow row =
(OARow)vo.getCurrentRow();
//Checking the State Field whether value is present or not
if ("StateChange".equals(pageContext.getParameter(EVENT_PARAM)))
{
if
(pageContext.getParameter("State").equals(""))
{
row.setAttribute("CityRender", Boolean.FALSE);
}
else
{
row.setAttribute("CityRender", Boolean.TRUE);
}
}
Deployment of Page in Oracle Application
Deployment of OAF Page in Apps Environment
Go to folder in which you have installed the OAF Patch
D:/OAF/jdevhome/jdev/myprojects
Open winscp and go to JAVA_TOP
JAVA_TOP:-
/u01/d02/apps/apps_st/comn/java/classes
Move the project folder into the Java_Top
And go to the path
D:\OAF\jdevhome\jdev\myclasses
And move the project folder into the JAVA_TOP/myclasses
JAVA_TOP:-
/u01/d02/apps/apps_st/comn/java/classes/myclasses
Go to Application top
and run the environmental files
Path:- /u01/d02/apps/apps_st/appl
Run ls *.env
And then . *.env
After that
Go to the JAVA_TOP path
Cd /u01/d02/apps/apps_st/comn/java/classes
Run the import script
java
oracle.jrad.tools.xml.importer.XMLImporter
$JAVA_TOP/dhanush/oracle/apps/po/FirstPage/webui/FirstPagePG.xml -username apps
-password apps -dbconnection
"(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.XX.XX)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=VISION)))"
-rootdir $JAVA_TOP/dhanush/oracle/apps/po
After doing XMLImporter, then we have to register the OAF
Page in the Apps Environment
Login with the credentials and go to the application
developer responsibility
Application ------------------------Ã Function
Give the Function Name:-----------------------------
Give the User Function Name:-------------------------------
Go to the properties tab:-
Type:- SSWA jsp function
In the WEB HTML tab give the HTML Call, PageName we need to
mention here.
Attach the OAF Page to the menu , suppose Order Management
Responsibility is there , get the menu name of the Order Management
Responsibility and attach the Function Name in the Menu.
Calling D2K
Form from OAF Page
1. Create AM
2. Create the
Page and attach the AM to the Page and create one button item in the rowlayout
region and the item should be submitbutton and give the attributeset as
/oracle/apps/fnd/attributesets/Buttons/Go
3. Create one
Controller
In the process form request we need to call the D2k
Form by clicking the button.
4. Syntax for
calling the D2K Page from OAF Page
SYNTAX:
-
form:FND:RESPONSIBILITY
KEY:DATA GROUP:FUNCTION NAME(D2K FORM NAME).
For this
we need to know the following
Responsibility Name: - System Administrator.
Responsibility Key: - SYSTEM_ADMINISTRATOR.
Function name: - FND_FNDCPMCP_SYS
Data Group:- STANDARD.
We need to call this syntax in the Process Form Request
"form:FND: SYSTEM_ADMINISTRATOR:STANDARD: FND_FNDCPMCP_SYS";
Code in the Controller under Process Form Request
if(pageContext.getParameter("item1")!=null)
{
String FormPath
= "form:FND:SYSTEM_ADMINISTRATOR:STANDARD:FND_FNDCPMCP_SYS";
pageContext.forwardImmediatelyToForm(FormPath);
}
While opening the Form from OAF page we need to open in the
following manner
pageContext.forwardImmediatelyToForm(FormPath);
Inserting the Records into OAF Page
Before inserting the records into OAF Page, we need to know
which components will effect
1. AM needs to
be created
2. Page needs
to be created and we need to attach the AM in the page
3. As we are
doing DML operations we need to create EO
4. After
creating the EO , we need to attach to the VO by creating the EO Based VO
5. After
creating the VO, need to attach this VO to AM
Steps need to Follow:-
1. First
create a workspace and then project
2. Create 1
application module
3. After that
create 1 EO, for selecting the table for which we need to insert the records.
If we are inserting the records into custom table, we
need to create the table in the database so that while creating the EO, the
table will be appear, otherwise it will not appear
4. After
create the VO based on the EO, while attaching the EO select the attributes
which needs to be entered while entering in the OAF Page
5. After that
Attach this VO to the Application Module
6. After that
create the Page and attach AM to the Page.
7. Change the main
region as Page Layout Region and add the AM Definition and Window title, Page
title.
8. Create the
Text Input items based on your query written in the VO
9. Create 1
button as ADD
10.
Write the code
in the Application Module for inserting the records into table
public void
InsertRecord()
{
insertVOImpl
vo= getinsertVO1();
OADBTransaction trans= getOADBTransaction();
vo.executeQuery();
Row v_row;
v_row =
(Row)vo.createRow();
vo.insertRow((Row)v_row);
}
11.
Call this AM in Controller
In Process
Request
public void
processRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processRequest(pageContext, webBean);
insertAMImpl
am=(insertAMImpl)pageContext.getApplicationModule(webBean);
am.InsertRecord();
}
In Process
Form Request
public void
processFormRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processFormRequest(pageContext, webBean);
insertAMImpl
am=(insertAMImpl)pageContext.getApplicationModule(webBean);
if
(pageContext.getParameter("Go") != null)
{
String userContent=
pageContext.getParameter("empno");
Pattern
p=Pattern.compile("[^0-9\\s]");
Matcher
m=p.matcher(userContent);
if(m.find())
{
throw new
OAException("Special Characters are not allowed",OAException.ERROR);
}
else
{
am.getOADBTransaction().commit();
throw new
OAException("Employee Created
sucsessfully",OAException.CONFIRMATION);
}
}