Thursday, June 9, 2016

Creating Auto Customization Criteria OAF Search Page

1. Create a New Workspace and Project
Right click Workspaces and click create new OAworkspace and name it as CustSearch. Automatically a new OA Project will also be created. Name the project as CustSearchDemo and package as search.oracle.apps.fnd.custsearchdemo

2. Create a New Application Module (AM)
Right Click on CustSearchDemo > New > ADF Business Components > Application Module
Name -- CustSearchAM
Package -- search.oracle.apps.fnd.custsearchdemo.server

3. Enable Passivation for the Root UI Application Module (AM)
Right Click on CustSearchAM > Edit SearchAM > Custom Properties >
Name – RETENTION_LEVEL
Value – MANAGE_STATE
Click add > Apply > OK

4. Use the Emp table.

Select * From EMP;

5. Create a New Entity Object (EO)
Right click on SearchDemo > New > ADF Business Components > Entity Object
Name – CustSearchEO
Package -- search.oracle.apps.fnd.custsearchdemo.schema.server
Database Objects -- EMP

Note – By default ROWID will be the primary key if we will not make any column to be primary key

Check the Accessors, Create Method, Validation Method and Remove Method


6. Create a New View Object (VO)
Right click on CustSearchDemo > New > ADF Business Components > View Object
Name -- CustSearchVO
Package -- search.oracle.apps.fnd.custsearchdemo.server

In Step2 in Entity Page select CustSearchEO and shuttle them to selected list

In Step3 in Attributes Window select columns empno,ename,job,Mgr, and shuttle them to selected list

In Java page deselect Generate Java file for View Object Class: CustSearchVOImpl and Select Generate Java File for View Row Class: CustSearchVORowImpl

7. Add Your View Object to Root UI Application Module
Select Right click on CustSearchAM > Application Modules > Data Model
Select CustSearchVO and shuttle to Data Model list

8. Create a New Page
Right click on CustSearchDemo > New > Web Tier > OA Components > Page
Name -- CustSearchPG
Package -- search.oracle.apps.fnd.custsearchdemo.webui

9. Select the CustSearchPG and go to the strcuture pane where a default region has been created

10. Select region1 and set the following properties:
ID -- PageLayoutRN
Region Style -- PageLayout
AM Definition -- search.oracle.apps.fnd.custsearchdemo.server.CustSearchAM
Window Title – AutoCustomize Search Page Window
Title – AutoCustomization Search Page
Auto Footer -- True

11. Add a Query Bean to Your Page
Right click on PageLayoutRN > New > Region
Select new region region1 and set following properties
ID – QueryRN
Region Style – query
Construction Mode – autoCustomizationCriteria
Include Simple Panel – False
Include Views Panel – False
Include Advanced Panel – False

12. Create a New Region of style table
Right Click on QueryRN > New > Region Using WizardApplication Module – search.oracle.apps.fnd.custsearchdemo.server.CustSearchAM
Available View Usages – CustSearchVO1

In Step2 in Region Properties set following properties
Region ID – CustSearchTable
Region Style – Table

In Step3 in View Attributes shuttle all the items (Column1, Column2, Column3, Column4) available in “Available View Attributes” to Selected View Attributes:
In Step4 in Region Items page set style to “messageStyledText” for all items

13. Select CustSearchTable in Structure Panel and set property Width to 100%

14. Include Simple Search Panel
Right Click on QueryRN > New > simpleSearchPanel
Automatically region2 (header Region) and region1 (MessageComponentLayout Region) createdSet Following Properties for region2
Id – SimpleSearchHeader
Text -- Simple Search

15. Now right click on message Component Layout Region (SimpleSearchMappings) and create two message text input beans and set the below properties to each

Message TextInputBean1
Id – searchEmpno
Search Allowed – True
Data Type – VARCHAR2
Maximum Length –
CSS Class – OraFieldText
Prompt – empno

Message TextInputBean2
Id – searchEname
Search Allowed -- True
Data Type – VARCHAR2
Maximum Length – 100
CSS Class – OraFieldText
Prompt – ename

Message TextInputBean1
Id – searchJob
Search Allowed – True
Data Type – VARCHAR2
Maximum Length –
CSS Class – OraFieldText
Prompt – empno

Message TextInputBean1
Id – searchMgr
Search Allowed – True
Data Type – VARCHAR2
Maximum Length –
CSS Class – OraFieldText
Prompt – Mgr

16. Now Right Click on query Components and create simple Search Mappings. Then automatically SimpleSearchMappings and QueryCriteriaMap1 created

17.  Now select the QueryCriteriaMap1 and set the below properties
Id – SearchEmpnoMap
Search Item – SearchEmpno
Result Item – Empno

18. Now again right click on simpleSearchMappings -> New -> queryCriteriaMap, and then set the below properties
Id – SearchEnameMap
Search Item – SearchEname
Result Item – Ename
 Now again right click on simpleSearchMappings -> New -> queryCriteriaMap, and then set the below properties
Id – SearchJobMap
Search Item – SearchJob
Result Item –Job

 Now again right click on simpleSearchMappings -> New -> queryCriteriaMap, and then set the below properties
Id – SearchMgrMap
Search Item – SearchMgr
Result Item – Mgr

19.Add Following code to xx_EOImpl.java class to solve WHO COLUMNS problem

  public void setLastUpdateLogin( oracle.jbo.domain.Number n ) {}

  public void setLastUpdatedBy( oracle.jbo.domain.Number n ) {}

  public void setLastUpdateDate( oracle.jbo.domain.Date n ) {}

  public void setCreationDate( oracle.jbo.domain.Date n ) {}

  public void setCreatedBy( oracle.jbo.domain.Number n ) {}




20. Congratulation you have successfully finished Auto Customization Search page. Run Your CustSearchPG page and Test Your Work


(1)

(2)

(3)
End




No comments:

Post a Comment