You are on page 1of 42

Oracle Application Framework Training Guide

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

7-Create Project AM , Job and Position VO and VL .................................................. 15


1- Create Jobs VO .................................................................................................................. 15
2- Create Positions VO ......................................................................................................... 17
3- Create View Link .............................................................................................................. 19
4- Create XxHR AM .............................................................................................................. 21

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

Java Class ........................................................................................................................ 40

Oracle Application Framework Training Guide

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

Right click in Workspace and choose new OA workspace

Directory Name Leave it as written


File Name OASession.jws
If you need to create project direct after create work space so leave checkbox of Add new OA Project checked
In our case we will unchecked it

8
9

Notice that OASession.jws is written in Italic Still.!!!!!!


Because we didnt compile and if you search in
the directory <jdeveloper path >\JDEV\jdevhome\jdev\myprojectsyou will not find the file

Oracle Application Framework Training Guide


10
11

Press Ctrl+S or Ctrl+F9 or right click on OASession.jws and choose Make OASession.jws

12
13

It will be like below PIC

14

Also if you serach in directory <jdeveloper path >\jdevhome\jdev\myprojectsyou will find the file

Oracle Application Framework Training Guide

2-Create OA Project
Step
No.
1
2

Description
Right click on OASession.jws and choose New OA Project

Directory Name Leave it as written


File Name OAHrProject.jpr
Default Package Leave it as written
And click next

Check Use Repository for Design Time and choose your connection
And click next

Choose you DBC file


User Name operations Application User Name
Password welcome Password for this user
Choose responsibility you will work on it and get application short name and responsibility key
In our example we will chose Application Developer Responsibility
Application Short Name FND
Responsibility Key APPLICATION_DEVELOPER
And click finish

Oracle Application Framework Training Guide


8

10
11

After compile

12

Also if you serach in directory <jdeveloper path >\jdevhome\jdev\myprojectsyou will find the file
OAHrProject.jpr

13

Oracle Application Framework Training Guide

3-Naming of structure and files


Step
No.
1
2

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

Association object < Association Name>AO


Stored in .schema.server
For our example xx_jobs table
Association object XxPositionAO
Stored in xx.oracle.apps.per.xxhr.schema.server

View object <View Name>VO


Stored in .server
For our example xx_jobs table
View object XxJobsVO
Stored in xx.oracle.apps.per.xxhr.server

View Link <View Link Name>VL


Stored in .server
For our example view link between job and position
View Link XxPositionVL
Stored in xx.oracle.apps.per.xxhr.server

Application Module <Application Module Name>AM


Stored in .server
For our example
View Link XxHrAM
Stored in xx.oracle.apps.per.xxhr.server

Page <Page Name>PG


Stored in .webui
For our example
page XxJobsAndPositionPG
Stored in xx.oracle.apps.per.xxhr.webui
Controller Class <controller name>CO
Stored in .webui
For our example
page XxJobsAndPositionCO
Stored in xx.oracle.apps.per.xxhr.webui

10

For more advanced information see CHAPTER 8: STANDARDS AND GUIDELINES in attached files

Oracle Application Framework Training Guide

4-Create Business Components Package


Step
No.
1

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

Pakage Name xx.oracle.apps.per.xxhr.schema.server


Notice that when you enter you package name its equal to directory in your jdeveloper path
Press Finish

Oracle Application Framework Training Guide


8

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

Oracle Application Framework Training Guide

5-Project DDL and DML


Step
No.
1
2

Description
DDL in attached file OA Project DDL Script.sql
DML in attached file OA Project DML Script.sql

Oracle Application Framework Training Guide

6-Create Job and Position EO and AO


Step
No.
1

Description

1- Create Jobs EO

2
3

Right click on xx.oracle.apps.per.xxhr.schema.server package and choose New Entity Object

4
5

Press Next

In Schema Object write your Table Name XX_JOBS


It will write by default in Entity name XxJobs but we need to add EO to be XxJobsEO
Be sure the package name is correct to create EO under schema.server
Press next

You must see all columns in xx_jobs table

Oracle Application Framework Training Guide


9

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

Oracle Application Framework Training Guide


16

17
18

Also this files are created under directory

19

2- Create Positions EO

20
21

Right click on xx.oracle.apps.per.xxhr.schema.server package and choose New Entity Object

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

Oracle Application Framework Training Guide


25
26

You must see all columns in XX_POSITIONS table

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

Also this files are created under directory

Oracle Application Framework Training Guide


35

3- Create Association AO

36

It looks like relation between master and details table on EO Level


XX_JOBS is master (JOB_ID)
XX_POSITIONS is details (JOB_ID)

37
38

Right click on xx.oracle.apps.per.xxhr.schema.server package and choose New Association

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

Oracle Application Framework Training Guide


44

In select Destination Attribute (Details)


Select JobID under Entity XxPositionsEO under Package xx.oracle.apps.per.xxhr.schema.server

45

46
47

Press add

48
49

Press next then finish

Oracle Application Framework Training Guide

7-Create Project AM , Job and Position VO and VL


Step
No.
1

Description

1- Create Jobs VO

2
3

Right click on xx.oracle.apps.per.xxhr.server package and choose New View Object

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

Oracle Application Framework Training Guide


10

11
12

Press Next
Choose attributes (Columns) to be declared in VO
We will choose all

13

14

15
16

Press Next Then Finish

Oracle Application Framework Training Guide


17

2- Create Positions VO

18
19

Right click on xx.oracle.apps.per.xxhr.server package and choose New View Object

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

Oracle Application Framework Training Guide


26

27
28

Press Next
Choose attributes (Columns) to be declared in VO
We will choose all

29

30

31
32

Press Next Then Finish

Oracle Application Framework Training Guide


33

3- Create View Link

34
35
36

It looks like relation between master and details table on VO Level


Right click on xx.oracle.apps.per.xxhr.server package and choose New View Link

37

Name XxPositionsVL
Be sure the package name is correct to create VL under .server

38

39

40

Select source View Object XxJobsVO


Select Destination View Object XxPositionsVO
Press Next

Oracle Application Framework Training Guide


41
42

Becouse we create the realation between EOs before so we will choose the association already created

43

By default it will choose JobId


Press Next
Also by default in destination View Object Jdeveloper will choose JobId

44
45

46
47

Press Next Then Finish

Oracle Application Framework Training Guide


48

4- Create XxHR AM

49
50

Right click on xx.oracle.apps.per.xxhr.server package and choose New Application Module

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

And then choose XxPositions VL becouse VL is based on VO

Oracle Application Framework Training Guide


58

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

Oracle Application Framework Training Guide

8-Create Job and position Page and standard search Region


Step
No.
1

Description

1- Create Job and position Page

2
3

File Menu New

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

Oracle Application Framework Training Guide


10
11

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

Am Definition Press Button

20

Choose AM XxHrAM and press OK

Oracle Application Framework Training Guide


21

2- Create Standard Search Region for Jobs

22
23

Right click on MainRN New Region

24

Change Id StandardQuery
Region Style Query
Construction Mode resultsBasedSearch

25

26
27

Right Click on StandardQuery New Region Using Wizard

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

Oracle Application Framework Training Guide


32

33
34
35

Press Next
Choose attributes you need to show on screen
We will choose
JobName
JobHeadCount
EffectiveStartDate
EffectiveEndDate

36

37
38

Press Next then Finish

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

Oracle Application Framework Training Guide


41
42

Now Right XxJobsAndPositionsPG .xml Click On and choose Run XxJobsAndPositionsPG.xml

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

3- Create Custom Search Region for Jobs

49

Click on StandardQuery
Set proerty renderd to(Under visual category) false

50
51
52

Right Click on MainRN New Region

53
54

By default it will create region with style header

55

Change Id to CustomJobQuery
Text(Under Visual Category) Search

Oracle Application Framework Training Guide


56

57

Right Click on CustomJobQuery New Region


Change Id to Query
Region Style LabelFeildLayout

58

59

Right Click on Query New Item


Change Id to QJobName
Item Style messageTextInput
Prompt Job Name
Right Click on Query New Item
Change Id to Search
Item Style submitButton
Prompt Go

60

Oracle Application Framework Training Guide


61
62

Run Page

63
64

Right Click on MainRN New Region


ID JobHeader
Text Job

65

66
67

Right Click on MainRN New Region Region Using Wizard


Be Sure that you are choose right application Module from List
And then choose VO that you need to show (XxJobsVO1)

68

69

Press Next

Oracle Application Framework Training Guide


RegionId JobTable
Region Style table
70

71
72

Choose attributes you need to show on screen


We will choose
JobName
JobHeadCount
EffectiveStartDate
EffectiveEndDate

73

74
75

Press Finish and run page

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

Oracle Application Framework Training Guide


81

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

Before the last Arc write our public void

public void FindJob(String pJobName)


{
//Define ViewObject Variable and get in it XxJobsVO1 View Object
OAViewObject pJobsVO = getXxJobsVO1();
//Set where clause of query in VO so we but colume name in DB table
pJobsVO.setWhereClause("Job_Name like '%"+pJobName+"%'");
//Execute Query
pJobsVO.executeQuery();
}

Oracle Application Framework Training Guide


88

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

Oracle Application Framework Training Guide


95

96
97

Right Click on MainRNSet New Controller

98

Package Name xx.oracle.apps.per.xxhr.webui


Class Name XxJobsAndPositionsCO
This controller is respnisble to handle actionsfired on page

99

100
101

Double Click on XxJobsAndPositionsCO.java


Put
// To Can Get appliation Moudle and invoke Method in it
import oracle.apps.fnd.framework.OAApplicationModule;
//To can define Serializable (List of parameters) and pass it to method in Application Module
import java.io.Serializable;
in import section

102

In processFormRequest after super we will write this code


//Define Application Module variable get application module of page into it.
OAApplicationModule pXxHrAm = pageContext.getApplicationModule(webBean);
//Define String variable get in it any action fired in page
String pAction = pageContext.getParameter(EVENT_PARAM);
//Filter action to get the action we set on seigleSelection on tableXxJobsVO1?JobSelectFlag
//Make Sure to copy action name case sensitive
if (pAction.equals("FindJobAction"))
{
//Define String and get in it value of Job Name in Page Note: write ID of attribute to can get value in it
String JobName = pageContext.getParameter("QJobName");
//Define Serializable (List of parameters) and put JobName in it
Serializable[] paramList = { JobName };
//Invoke method we create in Application Module and pass to it parameters
pXxHrAm.invokeMethod("FindJob",paramList);
}

Oracle Application Framework Training Guide


103

104
105

Now Run Page and press go

106

4- Create Position Region (Detail Affected by Master Query)

107
108

Right Click on MainRN New Region


ID PositionHeader
Text Position

109

110
111

Right Click on PositionHeader New Region Region Using Wizard


Be Sure that you are choose right application Module from List
And then choose VO that you need to show (XxPositionsVO1)

112

113

Press Next

Oracle Application Framework Training Guide


114

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

Press Next then Finish

122
123

Run page Now and press Go

124
125

So why Now there is no data in Position Region ?????


Becouse we have not to inform XxpositionVO which record must shown related to the Job record I choose
So first we need to create radio group on JobTable to dedecate which record I need to show its details

Oracle Application Framework Training Guide


126
127

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

Oracle Application Framework Training Guide


134

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

Oracle Application Framework Training Guide


141

142

Put
import oracle.jbo.Row;
in import section

143

public void JobSelectFlag()


{
//Define ViewObject Variable and get in it XxJobsVO1 View Object
OAViewObject pJobsVO = getXxJobsVO1();
//Define Rowt Variable and get in it XxJobsVO1 row which SelectFlag attribute = Y
Row pJobsVORow = pJobsVO.getFirstFilteredRow("SelectFlag","Y");
//Make this row is the current row of XxJobsVO1 by this way XxPositionsVO1 will get data related to this row
pJobsVO.setCurrentRow(pJobsVORow);
}

144

145
146
147

Return to java class


need to call this public void when action of radiogroup fired

Oracle Application Framework Training Guide


148

In processFormRequest
if (pAction.equals("JobSelect"))
{
//Invoke method we create in Application Module
pXxHrAm.invokeMethod("JobSelectFlag");
}

149

150
151

Now Run Page and Press Go and select record

Oracle Application Framework Training Guide

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)

You might also like