OAF : - Oracle Applications Framework Version : - 9.0.

3 NOTE: - For OAF install Jdeveloper (developed by Java & J2ee for E-Business Suite). Architecture of OAF: OAF follows the MVC (Model View Controller) Architecture. Model (BC4J Components) View (User Interface xml) Controller (Developed by Java Classes) What are BC4J Components? BC4J Components are as follows AM: Application Module VO: View Object EO: Entity Object VL: View Links

What is Onion Structure?

AM VO EO D B

The above structure is the Onion Structure; in which AM (Application Module) interact with the VO (View Object) and VO interacts with EO (Entity Object) and EO interacts with DB (Data Base). NOTE: • EO can only interact with the Data Base. • A page can have only one AM and AM can have number of VO and EO’s. • To display simple page no need of VO and EO, only AM is enough.

Steps to Install OAF? 1. Download the patch from Oracle metalink.

F:\Vijay_OAF.zip

2. Create one folder (Jdeveloper) in your local system. 3. Extract the above patch. 4. Create environment variable My computer  Properties  Advanced  Environment Variable  New Variable Name Variable Value : JDEV_USER_HOME : D:\Jdeveloper\jdevhome\jdev. copy the Jdevw icon and past it in desktop.

5. Go to D:\Jdeveloper\jdevbin\jdev\bin How to create simple page in OAF?

 Open Jdeveloper.  First create the data base connection Right click on Connections select the New Data Base Connection

Next  Give the Connection Name  Next

Give Oracle Application Data Base user name and password Username: apps Password: apps  Next

For the above screen first you need to get the .dbc file. By the following path we can get the .dbc file from the server /d01/applmgr/visappl/fnd/11.5.0/secure/erp_vis.dbc. Open the .dbc file copies the host name and past it in the host name in the screen, similarly get the Service Name and past it in the SID. - Next and click on Test Connection.

Create Workspaces. Right click on Workspaces  select New OA Workspace .Next Finish. to create workspaces follow the steps.

By default the Directory Name: D:\Jdeveloper\jdevhome\jdev\myprojects and give any file name : OAVijay.WelcomePG.po.webui Ex: .jws (Jdeveloper Workspace)  ok Next  Give the default package name in the standard format as follows <Identifier>.Vijay.apps.apps.oracle.<application_short_name>.oracle.webui (web user interface) .<component>.

Next checks the check box and select the use repository for design time And select the database connection name (Vijay). attach the DBC file name in the DBC file name by click on browse. Next. Give the oracle application front end user name: operations Password: welcome .

Create BC4J Components as follows. Right click on project and select New Business Components Packages .Click on Next Finish.

Ex: .Vijay.Change the .server.apps.server Next Next Finish.po. all the BC4J components will be stored in the server.webui to . .oracle.WelcomePG.

Welcome AM Next  Next  Next Next Finish. Right click on BC4J component select Application Module. Give AM name with Suffix of AM Ex: .Create AM (Application Module). .

follow the steps Right click on project select NEW Click on Web Tier .Create a page.

Always keep the Page in .webui NOTE: .Click on Web Tier select OA Component and select the Page OK Give any name for page Ex: .webui  ok .WelcomePG and select the package as .

Welcome Page .Welcome PG and Title: .Click on the region1. go to property inspector  BC4J attach the AM Definition Ok Give the Window Title: .

Go to system Navigator  Right click on page <WelcomePG> Run WelcomePG.xml .

Complier log and Property-inspector. b) Extract this patch. controller and region will store? . • What is the default region when we create new region? Page layout region • Where will be the page. • What are the Components of OAF? System.FAQ’s • What is the Architecture of OAF? OAF follows the MVC (Model View Controller) Architecture. c) Set the Environment Variable.webui (Web user interface) • What are the BC4J components? .navigator. • Types of projects in OAF? Personalization. • What is onion structure? AM VO EO  DB • Is Am required for new page? Yes • Steps to install OAF? a) Down load the patch from metalink. Structure-Window. Extension and New page Development.

Text) and Prompt (Enter our Name) in property inspector window .Components of BC4J are AM. Give the item ID name (ex: .0/secure/.dbc file? visappl/fnd/11.server • is window title and title is mandatory? Yes • Which BC4J component will interact with the database? EO • To display simple note is VO and EO is required? No • What are the responsibilities to attach the user for OAF? OA frame work tool box Tutorial.dbc How to write code in controller? After developing the welcome page go to structure window right click on the region and select New Item. VL and Associations. • Where will be the BC4J components will store? .5. VO. EO. OA frame work tool box Tutorial Lab. • How to find the path for .

Similarly create another item with the item (Submit) item style as submit button and give the prompt in property window and run the page. . Go to structure window right click on region1 and select the Set New Controller.

The controller should be under the .Note: .webui Give any name to the controller with prefix with CO ex: .WelcomeCO Click on Ok. .

Write this code in Processes Form Request Then run the page ex: . Process Form Request: .OAF) and Click on Submit. Note: -To display any information we have to import the following interface import oracle.framework. It has two parameters called pageContext and webBean. .OAException. What is Process Request and Process Form Request? Process Request: .apps. Process Form Data: . It has two parameters called pageContext and webBean. 2) Process Form Request.This method is used to display any message after taking any action on the page then you will write code in Process Form Request.it works internally which is used to handle the internal validation against BC4J components.This method is used to display any message while page is loading the you will write code in the Process Request.WelcomePG Enter any text in the message input (ex:. Write the following highlighted code in Processes from request.fnd.Here we can find two methods in controller 1) Process Request.

How to create Clear Button? .U can see the output on the next screen.

Create another button the same region and give the ID name as Clear with item style as Submit Button. . Clear Clear It looks like as follows when we run the WelcomePG.

Write the following code in Processes from Request for Clear Button. NOTE: .To import any page follow the syntax .

Vijay  ok . FAQ’s What is Controller? The controller responds to user action and directs to the application flow.<an name> ex:. b) Processes Form Request. Which method is used to move to another page? pageContext. c) Processes Form Data. How to print a message in OAF? With which interface? Using the throw new under the OAException Interface.setRedirectURL(“page_path and page_name”). What are the methods in controller? The following are the methods in controller a) Process Request.< Path of the page>/<page_name>. What are the parameters in the Processes Request and Processes Form Request? pageContext and webBean. How to create Search Page? Create OAWorkspace b right click on the Workspaces New OAWorkspace Give the file name Fine Name : . What is Processes Form Data? In this we are not writing a code it will work internally.

oracle.apps.webui next Give the connection to the data base .ex: -Vijay.Next Give the fine name: <any name> ex: .search.po.Vijay Default package: .

Next Attach the . .dbc file and give the front end username and password.

webui to .server  next .Next  finish. Create BC4J component Next  change the path from .

Create Application Module Give the application module name Ex: .searchAM  next  next finish.Next  next  finish. .

Create EO by right click on the BC4J component select the New Entity Object (EO) .

searchVO . PO_HEADERS_ALL Next next by default it takes rowed will be the primary key (click on Yes)  Select all general methods  next. Here by default system will ask to create the VO and give the VO name ex: .searchEO And check the checkbox called synonyms and select the any schema object ex.Give the EO name: <any name> Ex: .

Next  finish. VO. then click on AM select Data Model and attach the VO to AM . Now you can see that AM. EO is created.

Click on apply and ok.TYPE_LOOKUP_CODE=UPPER(NVL(:0..TYPE_LOOKUP_CODE)) .searchEO. Click on VO select query write the condition in the where clause Write the where clause Ex.

searchPG and select the . Create new page by right clicking on the project name select New.webui  ok .Test the query by clicking on the test button. Select Webtier  OAComponents  Page  Ok Give the page name (any name) ex. .

SearchPG.Automatically in the structure window one region will be created (region1). Click on that region attach the AM Definition Select the AM  ok. Create another region and select the region style as Message Component Layout. and give the window title (any name) ex: . title (an name) Welcome to search page. .

Enter Type Lookup Code) Rebuilt the page and run the page to test. You can see the following out put.Create one message Text input Give the ID. . name for the item and give any prompt name (Ex: .

Create another region with region style as PageButtonBar and create an item by giving the item style as SubmitButton and give any ID name (Ex: .Search) and give any prompt as well (Search). . Rebuilt the page and test the page.

. Right click on that region and select the New  Column.Create another region with the region style as advancetable and attach the view instance (searchVo1) as shown in figure.  Ok.

And right click on column1 create one item. Give the item style as MessageStyledText and select the view attribute (PoHeaderId). .

For column adjustment click on the advanced table region and change the width as 100%. Type Lookup Code. Vendor ID …. Then write the code in VO.Java . Right click on the code and select MakeSearchVOImpl. 2. Rebuilt the page and run the page you can see the following out put.etc NOTE: 1.Click on column header  New  SortableHeader and give the prompt (PO Header ID) Similarly create any number columns………. To suppress any column change rendered to false (in visual of property window) 3. click on searchVO  select serachVOImpl.java And write the following code in searchVOImpl. For space create one region with the item and region style as spacer and give height. Hear I am taking the Agent ID.

Create controller.You can see the status here Click on AM  select searchAMImpl.searchAMImpl. import java.Serializable. First import the following packages import oracle. give the controller name (any name) and write the following code in controller.framework. import Vijay.apps. .server. Write the following code in PossessFormRequest a) Initialize the Application Module.search.fnd.apps.po.OAApplicationModule.server.po.io.oracle.search. First we need to import the searchVOImpl.oracle.searchVOImpl.java and write the following code.apps. import Vijay.

Write the following code in controller Rebuilt the page and test the work and you will see the out put as follows .

Create the regions. Create new page foe lines. Create AM. Rfq. Now we will create another search page for lines. columns and buttons same as search page. . Attach the VO to AM. The final output for lines page looks like shown in fig. Create BC4J component for polines as shown in fig. VO and EO for PO_LINES_ALL.Enter any type of purchase order like Standard. Blanket and Contract. How to call from one page to the other page? In the begin you already created search page with the PO_HEADERS_ALL table with respect to that we will take PO_LINES_ALL with respect to the PO_HEADER_ID we have to display PO_LINES.

Click on VO  select the Query and Click on VO and write the following code in polinesVOImpl.java .java Click on AM and write the following code in polinesAMImpl.

server.polinesAMImpl.this is for back button.apps. import Vijay.oracle.po. .message.OAMessageStyledTextBean.polines. Import all the following interfaces. ProcessessRequest: - ProcessesFormReuest: . Next we need to give the link between headers and lines.java Create controller (insertCO) and write the following code. . to create the link follow the steps.write the following code in polinesAMImpl.

Connect to apps and create synonym as follows . Enter the required details in the above screen and click on search and click on particular header id we can get the details with respect to header id.You can see the final out put as shown in fig. supplier_category varchar2(30). Grant all on vijay_suppliers to apps. create table vijay_suppliers ( supplier_id number. last_updated_by number. 2. As shown next fig. first_name varchar2(30). last_name varchar2(30). last_update_date date. middle_name varchar2(30). last_update_login number ) 1. How to insert data into custom table? 1) Create a table as follows in cus_top. supplier_number varchar2(30). title varchar2(10).

The out put will be as shown in fig.apps.oracle. you can see as shown in fig.po. import oracle.OADBTransaction.java The above program is for both insert with sequence.suppliersInsert. Write the following code in supplierInsertAMImpl. Create sequence in custom top and grant it all to apps and create synonym in apps 1.Create synonym vijay_suppliers to cus. import Vijay.getCurrentRow().fnd. Create one insert page using this table. Enter the data and click on save. .OAApplicationModule.apps. write the following code in supplierInsertCO import oracle. For constant or default value add the below code in the above program. vo1.supplierInsertAMImpl.framework.server.vijay_suppliers.apps. 2.framework.”OracleCorp”).fnd. Now you see the data in back end in the respective table vijay_suppliers.server. processesrequest: ProcessesFormRequest: Rebuilt the page and run the page.setAttribute("SupplierId".

Sign up to vote on this title
UsefulNot useful