1-Oracle Application Framework (OAF) Training Guide - EO, AM, VO, Search Region
1-Oracle Application Framework (OAF) Training Guide - EO, AM, VO, Search Region
1-Oracle Application Framework (OAF) Training Guide - EO, AM, VO, Search Region
Contents
1-Create Workspace......................................................................................................... 1
2-Create OA Project ......................................................................................................... 3
3-Naming of structure and files ..................................................................................... 5
4-Create Business Components Package ...................................................................... 6
5-Project DDL and DML ................................................................................................. 8
6-Create Job and Position EO and AO .......................................................................... 9
1- Create Jobs EO .................................................................................................................... 9
2- Create Positions EO .......................................................................................................... 11
3- Create Association AO..................................................................................................... 13
8-Create Job and position Page and standard search Region .................................. 23
1- Create Job and position Page .......................................................................................... 23
2- Create Standard Search Region for Jobs ........................................................................ 25
3- Create Custom Search Region for Jobs .......................................................................... 27
4- Create Position Region (Detail Affected by Master Query) ........................................ 34
1-Create Workspace
Step
No.
1
2
3
Description
Create workspace to include projects we will create
Start Jdeveloper from <jdeveloper path >\jdevbin\jdev\bin\jdevw.exe
4
5
8
9
Press Ctrl+S or Ctrl+F9 or right click on OASession.jws and choose Make OASession.jws
12
13
14
Also if you serach in directory <jdeveloper path >\jdevhome\jdev\myprojectsyou will find the file
2-Create OA Project
Step
No.
1
2
Description
Right click on OASession.jws and choose New OA Project
Check Use Repository for Design Time and choose your connection
And click next
10
11
After compile
12
Also if you serach in directory <jdeveloper path >\jdevhome\jdev\myprojectsyou will find the file
OAHrProject.jpr
13
Description
Use lower case letter and use initial capitals rather than
underscores for each subsequent word in the name
Naming of Business Components Package that contain files
< naming conventions for custom logic >.<oracle>.<apps>.<short name application>.<your custom
application>
For our example
xx.oracle.apps.per.xxhr
Entity object <EntityName>EO
Stored in .schema.server
For our example xx_jobs table
Entity object XxJobsEO
Stored in xx.oracle.apps.per.xxhr.schema.server
10
For more advanced information see CHAPTER 8: STANDARDS AND GUIDELINES in attached files
Description
We will create 3 Business Components Package
1- For EO and AO xx.oracle.apps.per.xxhr.schema.server
2- For VO ,VL and AM xx.oracle.apps.per.xxhr.server
3- For PG and CO xx.oracle.apps.per.xxhr.webui
Right Click on OAHrProject.jpr and choose
New Business Components Package
4
5
Press Next
9
10
11
12
After Compile you will find this directory created under myprojects
Repeat previous step to create the other two package
1- xx.oracle.apps.per.xxhr.server
2- xx.oracle.apps.per.xxhr.webui
Be careful in naming package
After create the three package it must be like below PIC
Description
DDL in attached file OA Project DDL Script.sql
DML in attached file OA Project DML Script.sql
Description
1- Create Jobs EO
2
3
4
5
Press Next
10
11
Press Next
12
In the select attribute list you will find all columns also you must choose one of them as primary key
If not Jdeveloper will ask you to make rowId as primary key
In our example we will choose JodId as Primary Key
13
14
15
Press finish
It will be created under package
17
18
19
2- Create Positions EO
20
21
22
23
Press Next
In Schema Object write your Table Name XX_POSITIONS
It will write by default in Entity name XxPositions but we need to add EO to be XxPositionsEO
Be sure the package name is correct to create EO under schema.server
Press next
24
27
28
Press Next
In the select attribute list you will find all columns also you must choose one of the as primary key
If not Jdeveloper will ask you to make rowId as primary key
In our example we will choose PositionId as Primary Key
29
30
31
32
Press finish
It will be created under package
33
34
3- Create Association AO
36
37
38
39
Name XxPositionsAO
Be sure the package name is correct to create EO under schema.server
40
41
42
43
Press next
In select source Attribute (Master)
Select JobID under Entity XxJobsEO under Package xx.oracle.apps.per.xxhr.schema.server
45
46
47
Press add
48
49
Description
1- Create Jobs VO
2
3
Name XxJobsVO
Be sure the package name is correct to create VO under .server
6
7
8
9
Press Next
In our case we will create VO based on EO
Select XxJobsEO Under Package xx.oracle.apps.per.xxhr.schema.server
And press arrow button
11
12
Press Next
Choose attributes (Columns) to be declared in VO
We will choose all
13
14
15
16
2- Create Positions VO
18
19
20
Name XxPositionsVO
Be sure the package name is correct to create VO under .server
21
22
23
24
25
Press Next
In our case we will create VO based on EO
Select XxPositionsEO Under Package xx.oracle.apps.per.xxhr.schema.server
And press arrow button
27
28
Press Next
Choose attributes (Columns) to be declared in VO
We will choose all
29
30
31
32
34
35
36
37
Name XxPositionsVL
Be sure the package name is correct to create VL under .server
38
39
40
Becouse we create the realation between EOs before so we will choose the association already created
43
44
45
46
47
4- Create XxHR AM
49
50
51
Name XxHrAM
Be sure the package name is correct to create AM under .server
52
53
54
55
56
Press Next
Choose VO and VL to be attached under AM
You have to Choose XxjobsVO under xx.oracle.apps.per.xxhr.server and press arrow button
57
59
60
61
Instance Name is the name the AM will interact with VO by default it be VO concat with one you can change it to
any other name .
Press Finish
Description
2
3
4
5
Under Web Tire choose OA Component and the choose file and press ok
Name XxJobsAndPositionsPG
Be sure the package name is correct to create PG under .webui
8
9
Press OK
When you click on XxJobsAndPositionsPG you will see the structure of page
12
13
When click on any component of page the property will be shown in property inspector
14
15
Click On Region1
Change
ID MainRN
Window Title Jobs And Positions
Title Jobs And Positions
16
17
18
19
20
22
23
24
Change Id StandardQuery
Region Style Query
Construction Mode resultsBasedSearch
25
26
27
28
Be Sure that you are choose right application Module from List
And then choose VO that you need to make query on it (XxJobsVO1)
29
30
31
Press Next
Region Style (The way that Jdeveloper will show you data in Jdeveloper)
Region Style table
33
34
35
Press Next
Choose attributes you need to show on screen
We will choose
JobName
JobHeadCount
EffectiveStartDate
EffectiveEndDate
36
37
38
39
Click on JobName
Search Allowed true
To can search by JobName if you need to search with toher attribute also make searchallowed property to true
40
43
44
45
Make Sure the table (XX_JOBS) has data if not please run attached script (OA Project DML Script.sql)
It looks like that
46
47
Press Go Button
48
49
Click on StandardQuery
Set proerty renderd to(Under visual category) false
50
51
52
53
54
55
Change Id to CustomJobQuery
Text(Under Visual Category) Search
57
58
59
60
Run Page
63
64
65
66
67
68
69
Press Next
71
72
73
74
75
76
77
78
Now We need to fire action when press go button to execute query with parameter job name
Here we start to write our code and hadle page actions
There are to main places we write our code
First in Controller class which handle the actions of page
Second in application Module to handle actions of controller class
See Java Class
First we need to create public void to handle this action in application module
Go to application module there is a java file under it doubleclick on it
79
80
82
83
Press Next
Put
//To can get View Object deal with it
import oracle.apps.fnd.framework.OAViewObject;
in import section
84
85
86
87
89
90
Press Ctrl+F9 you must not find any error in compiler area
91
Now we need to get value from Job Name field in page and call previous method with this value to execut
equery
First click on Search Button
92
93
94
ActionType FireAction
Event FindJobAction
96
97
98
99
100
101
102
104
105
106
107
108
109
110
111
112
113
Press Next
Region ID PositionTable
Region Style table
115
116
117
118
Press Next
Choose attributes you need to show on screen
We will choose
PositionName
PositionHeadCount
EffectiveStartDate
EffectiveEndDate
119
120
121
122
123
124
125
This radio group will be created on transite attribute (Non database) to flag record..
Second fire action when select record in JobTable and get data from XxpositionVO related to its master record
Go to XxJobsVO under xx.oracle.apps.per.xxhr.server package and double click
128
129
Click on attributes
130
131
Press New
Name SelectFlag
Updatable Always
Uncheck Queriable
132
133
Press Ok
135
136
137
Press Ok
Right Click on Jobtable New singleSelection
138
ID JobSelectFlag
View Instance (Press button and choose) XxJobsVO1
View Attribute (Press button and choose) SelectFlag
FireAction fireParialAction
Event JobSelect
139
140
First we need to create public void to execute query in position on specific master record
Go to application module there is a java file under it doubleclick on it
142
Put
import oracle.jbo.Row;
in import section
143
144
145
146
147
In processFormRequest
if (pAction.equals("JobSelect"))
{
//Invoke method we create in Application Module
pXxHrAm.invokeMethod("JobSelectFlag");
}
149
150
151
Java Class
Step
No.
1
Description
Divided to three partitions
1- Import classes (to can deal with it like application module and so on)
2- processRequest(Action in start of page like hide or show fields depend on profile option)
3- processFormRequest(Actions in runtime like action of buttons)