Getting Started with Oracle ADF

Oracle ADF Lab#1

Description:
BISP is committed to provide BEST learning material to the beginners and advance learners. In the same series, we have prepared a complete end-to end Hands-on Beginner’s G ide !or "racle #$%. The doc ment !oc ses on basic creating #$% application, view ob&ects, view ob&ects, $ata 'odels, #$% B siness (omponents, and e)ploring b siness services. *oin o r pro!essional training program and learn !rom e)perts.

History:
Version Description Change 0.1 Initial Draft 0.1 $e%ie&'1 Author Chandra Prakash har!a A!it har!a Publish Date 10th Aug "01# th 10 Aug "01#

www.bispsolutions.com

www.bisptrainigs.com

www.hyperionguru.com

Page 1

Contents
How To Create First Application in Oracle ADF :...............................................................................3 Building a Business Model with ADF Business Components :..................................................11 De ining Attri!ute"s #roperties :................................................................................................1$ How to add Field %e&el 'alidation :...........................................................................................1( ................................................................................................................................................. 1( How to run this application : .....................................................................................................)* Create 'iew O!+ects ....................................................................................................................... )1 'iew Criteria , D-namic where clause ............................................................................................). How to 'iew Criteria :............................................................................................................... ). %in/ing 'iew O!+ects :..................................................................................................................... )( How to Create %in/ing 'iew O!+ects :.........................................................................................)( %ist o 'alues................................................................................................................................... 30 How to add %ist o 'alues :.......................................................................................................30 De ine the Data Model or the Application Module :.........................................................................3$ How To open Data Model or the Application Module :...........................................................3$ Adding %ogic to -our 1ntit- O!+ect :.................................................................................................3( How to Add %ogic to -our 1ntit- O!+ect :..................................................................................3( Finding Hoo/,#oints :...................................................................................................................... 23 13posing 4our !usiness 5er&ices to Other 5-stems :....................................................................23 How to Add 5er&ices 6nter ace :................................................................................................23

www.bispsolutions.com

www.bisptrainigs.com

www.hyperionguru.com

Page )

How To Create First Application in Oracle ADF :
Step 1 : Open 7De&eloper and clic/ on Application Navigator 8 New Application.

Step 2: Here gi&e Application 9ame: select director- and gi&e application pac/age name. there is man- t-pe o application select Fusion ;e! Application<ADF=: Then clic/ on Next !utton.

Step

: 1nter #ro+ect name and select a&aila!le pro+ect technolog-: then clic/ on Next !utton.

www.bispsolutions.com

www.bisptrainigs.com

www.hyperionguru.com

Page 3

Step ! : Chec/ De ault #ac/age: 7a&a 5ource #ath: Output director-: Then clic/ on Next !utton.

Step ! : 1nter #ro+ect ) name and Clic/ on Next !utton.

www.bispsolutions.com

www.bisptrainigs.com

www.hyperionguru.com

Page 2

Step " : Clic/ on Finish !utton.

A ter clic/ on inish !utton there Fusion we! application list. see !elow. www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page >

A ter Clic/ on Finish !utton then 9ew Application create -ou can see !elow.

Step 1 : in This application how to add !usiness la-er see !elow.

www.bispsolutions.com

www.bisptrainigs.com

www.hyperionguru.com

Page 0

Step 2 : Clic/ on Connection icon then open new window: on this window enter Connection name: Connection T-pe: ?ser 9ame: #assword: Dri&er: Host 9ame: 56D: 7DBC #ort: Then clic/ on Test !utton or test connection: Then Clic/ on O/ !utton.

Step

: Clic/ on #$er% !utton. 1nter pac/age name: 5elect ta!le: Clic/ on 9e3t !utton. www.bisptrainigs.com www.hyperionguru.com Page .

www.bispsolutions.com

Step ! : Change the #ac/age name and select a&aila!le list then clic/ on 9e3t !utton.

Step " : 5elect Ta!le or @ead onl- 'iew o!+ects then clic/ on 9e3t !utton. www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page $

Step & : Clic/ on Next !utton.

Step ' : Chec/ed Business components Diagram chec/ !o3. then clic/ on ne3t !utton.

www.bispsolutions.com

www.bisptrainigs.com

www.hyperionguru.com

Page (

Step ( : Clic/ on Finish !utton.

A ter inis: -ou can see diagram. www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 1*

)$il*ing a )$siness +o*el wit, ADF )$siness Co-ponents :
ADF Business Components and 7De&eloper simpli - the de&elopment: deli&er-: and customiAation o !usiness applications or the 7a&a 11 plat orm.  Connect to the data!ase  @etrie&e data  %oc/ data!ase records  Manage transactions Connect To a Database : www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 11

Step 1: Clic/ on Connect Data!ase %in/. 5ee !elow.

Step 2 : Then Clic/ on Create a Database Connection !utton.

Step : 1nter Connection name: ?ser 9ame: password host 9ame: 56D: 7DBC #rot A ter that clic/ on Test Connection Button or test. a ter that clic/ on O/ !utton.

www.bispsolutions.com

www.bisptrainigs.com

www.hyperionguru.com

Page 1)

Step ! : A ter then Clic/ on Done !utton.

Build Business ser&ices : Step 1 : Clic/ on Build Business ser&ices then clic/ on .o to S$bsteps !uttons.

www.bispsolutions.com

www.bisptrainigs.com

www.hyperionguru.com

Page 13

Step 2 : Clic/ on Create /ntit% Ob0ect an* Associations.

Step

: A ter then select 4our model then clic/ on O1 !utton.

Step ! : Browse pac/age name select schema then clic/ on Next !utton. www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 12

Step " : 5elect Ta!le &iew then Clic/ on Next !utton.

Step & : 5elect @ead onl- o!+ect: then clic/ on Next !utton.

www.bispsolutions.com

www.bisptrainigs.com

www.hyperionguru.com

Page 1>

Step ' : select Application module: Then clic/ on Next !utton.

Step (: 5elect Business Components Diagram: Then clic/ on Next !utton.

Step 2 : A ter that clic/ on Finis, !utton.

www.bispsolutions.com

www.bisptrainigs.com

www.hyperionguru.com

Page 10

A ter that -ou can see diagram see !elow.

www.bispsolutions.com

www.bisptrainigs.com

www.hyperionguru.com

Page 1.

De3ining Attrib$te4s 5roperties :
Control 3$nctionalit% an* be,avior :  Mandator De ault &alue  @e resh on update De3a$lt 67 representation :  %a!el  Tooltip.  Format mas/.  Control t-pe.

5et the attri!ute propert- see !elow.

www.bispsolutions.com

www.bisptrainigs.com

www.hyperionguru.com

Page 1$

How to a** Fiel* Level 8ali*ation :
Open 7De&eloper select ta!le: then go to attri!ute: then dou!le clic/ on an- &alue . -ou can see !elow.

Declaration 8ali*ation :

www.bispsolutions.com

www.bisptrainigs.com

www.hyperionguru.com

Page 1(

/xa-ple : 1mplo-ee 5alar- should !e greater than >***. Sol$tion : Open 7De&eloper select ta!le: then go to attri!ute: then dou!le clic/ on an- &alue . Clic/ on 'alidation: Than clic/ on 9ew !utton. select T-pe: there is three ta! a&aila!le <@ule De inition: 'alidation 13ecution: Failure Handling = 5elect operator: Compare with : 1nter 13pression: Than clic/ on o/ !utton.

How to r$n t,is application :
Bo to AppModule: right clic/ than clic/ on run lin/.. see !elow. www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page )*

O$t p$t :

Create 8iew Ob0ects
Oracle ADF &iew o!+ects are !usiness components that collect data rom the data source: shape that data or use !- clients: and allow clients to change that data in the Oracle ADF Business Components cache. Step 1 : @ight clic/ on AppModule: select ADF Business Components: than select 'iew o!+ect: a ter that clic/ on O/.

www.bispsolutions.com

www.bisptrainigs.com

www.hyperionguru.com

Page )1

Step 2 : 1nter then 9ame: 5elect the data source t-pe. Then clic/ on 9e3t !utton.

Step : ;rite Cuer- 5tatement: or writing Duer- clic/ on #$er% b$il*er !utton: then test the Duerand clic/ on 9e3t !utton.

www.bispsolutions.com

www.bisptrainigs.com

www.hyperionguru.com

Page ))

Step ! : Clic/ on 9ew !utton: then 1nter 9ame: select T-pe 1nter 'alue: Then clic/ on 9e3t !utton.

Step " : Clic/ on 9e3t !utton.

www.bispsolutions.com

www.bisptrainigs.com

www.hyperionguru.com

Page )3

Step & : Clic/ on 9e3t !utton.

Step ' : Chec/ and set Attri!ute 5ettings: Then clic/ on 9e3t !utton.

www.bispsolutions.com

www.bisptrainigs.com

www.hyperionguru.com

Page )2

Step ( : Clic/ on 9e3t !utton.

www.bispsolutions.com

www.bisptrainigs.com

www.hyperionguru.com

Page )>

Step 2 : Chec/ed Application Module: Than clic/ on Next !utton.

Step 19 : Then Clic/ on Finish !utton.

A ter then run this application and see result: or run right clic/ on AppModule and clic/ on run. see !elow.

www.bispsolutions.com

www.bisptrainigs.com

www.hyperionguru.com

Page )0

8iew Criteria : D%na-ic w,ere cla$se
 De ine multiple Duer- conditions  Appl- selected condition at runtime  1na!le urther &iew o!+ect reusa!ilit-

How to 8iew Criteria :
Dou!le Clic/ on /-plo%ee8iew in 'alue o!+ect 8 select #$er% 8 then go to down and ind view criteria and clic/ on plus Step 1 : icon. see !elow.

www.bispsolutions.com

www.bisptrainigs.com

www.hyperionguru.com

Page ).

Step 2 : 1nter Criteria 9ame: Clic/ on Add 6tem !utton: Add attri!ute: set Operator: ser Operand: add #arameter: Then clic/ on O/ !utton.

A ter clic/ on O/ !utton -ou can see . a ter then clic/ on

5a&e !utton.

A3ter t,at ;$n t,is application 3or see res$lt :

www.bispsolutions.com

www.bisptrainigs.com

www.hyperionguru.com

Page )$

Lin1ing 8iew Ob0ects :
A &iew lin/ allows us to create a relationship !etween &iew o!+ects. The relationship can !e one,to, one: one,to,man-: man-,to,one: or man-,to,man-. The 'iew %in/ ;iAard and 1ditor lets us speci source and destination &iew o!+ects: and lin/s them using attri!utes selected. To create a &iew lin/: we irst need to ha&e all the underl-ing &iew o!+ects in place. A &iew lin/ is also li/e a Oracle Forms Bloc/ relation: that allows -ou to +oin two o!+ects. <oin #$er% ,De ine at &iew o!+ect Duer-. ,Can !e updata!le. +aster=Detail ,de ine with &iew lin/s. ,The derail item !elongs to the master.

How to Create Lin1ing 8iew Ob0ects :
Step 1 : Bo to Application: then go to 'alue o!+ect: then Clic/ on E New 8iew Ob0ect lin1 E . see !elow.

www.bispsolutions.com

www.bisptrainigs.com

www.hyperionguru.com

Page )(

Step 2: 1nter 9ame : Then clic/ on 9e3t !utton.

Step

: Mo&e A&aila!le 1ntit- O!+ects: Then clic/ on ne3t !utton.

www.bispsolutions.com

www.bisptrainigs.com

www.hyperionguru.com

Page 3*

Step ! : Choose speci ic ield which -ou want and clic/ on mo&e !utton: Then clic/ on ne3t !utton.

Step " : Chec/ attri!ute setting: Then Clic/ on 9e3t !utton.

www.bispsolutions.com

www.bisptrainigs.com

www.hyperionguru.com

Page 31

Step & : Chec/ Cuer- and clic/ on 9e3t !utton.

Step ' : Chec/ Cuer-: there is use +oin ta!le. www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 3)

Step ( : Chec/ !ind 'aria!les. Then clic/ to 9e3t !utton.

Step 2 : Clic/ on 9e3t !utton.

www.bispsolutions.com

www.bisptrainigs.com

www.hyperionguru.com

Page 33

Step 19 : Mar/ Application Module and clic/ on ne3t !utton.

Step 11 : Chec/ summar- and clic/ on Finis, !utton.

www.bispsolutions.com

www.bisptrainigs.com

www.hyperionguru.com

Page 32

A3ter ;$n t,is application 8iew res$lt : 5ee !elow.

www.bispsolutions.com

www.bisptrainigs.com

www.hyperionguru.com

Page 3>

List o3 8al$es
6n this post i will continue to enhance m- pre&ious postFs 1mplo-ee Form and create m- irst %ist o 'alues <%O'= in Oracle ADF Form. Creation o %O' in ADF is as simple as in Oracle Forms. 6n this post i am going to create %O' or Department and 7o! entities. Do the ollowing steps to create %O' in ADF. 1= Add Departments and 7o!s 1ntities )= Add 'iew O!+ects or Departments and 7o!s %O's 3= Create %O's 2= Finall- %in/ %O's to 75F #age  De ine at the attri!ute le&el.  Bets list rom another &iew o!+ect.  De ine t-pe o list and list !eha&ior.

How to a** List o3 8al$es :
Step 1 : Bo to application: select An- &alue o!+ect: clic/ on Attri!ute: go to down and clic/ on this icon.

www.bispsolutions.com

www.bisptrainigs.com

www.hyperionguru.com

Page 30

Step 2 : 1nter the list o 'alues 9ame: 5elect %ist data source: set list attri!ute: set ?6 Hints: Then clic/ on O !utton.

A ter that run this application .

www.bispsolutions.com

www.bisptrainigs.com

www.hyperionguru.com

Page 3.

De3ine t,e Data +o*el 3or t,e Application +o*$le :
Associated with the root Application Module is the Transaction o!+ect: which pro&ides this transaction conte3t. From an- <root or nested= Application Module: the user can retrie&e the transaction o!+ect through a call to getTransaction<=. 6n realit-: getTransaction<= irst locates the root Application Module and then returns the transaction o!+ect rom it.

How To open Data +o*el 3or t,e Application +o*$le :
Open Apple action: Dou!le clic/ on AppModule : then select Data Model.

www.bispsolutions.com

www.bisptrainigs.com

www.hyperionguru.com

Page 3$

ADF )$siness Co-ponents :

GM% and 7a&a. ADF Business Components and 7De&eloper simpli - the de&elopment: deli&er-: and customiAation o !usiness applications or the 7a&a 11 plat orm. ;ith ADF Business Components: de&elopers aren"t reDuired to write the application in rastructure code reDuired !- the t-pical 7a&a 11 application to:  Connect to the data!ase  @etrie&e data  %oc/ data!ase records  Manage transactions ADF BC uses GM% metadata to descri!e the o!+ects. B- de ault there are no +a&a iles created. 6n man- cases -ou don"t need +a&a iles. Howe&er i -ou want more comple3 logic -ou"ll put that ina +a&a ile o&erriding de ault !eha&ior. 4ou can create +a&a iles or 1O: 'O and AM.

A**ing Logic to %o$r /ntit% Ob0ect :
The 6mpl ile is the one -ou all mostl- use Then choose which de ault method to create. 4ou onlneed to create the one -ou want to o&erride.

How to A** Logic to %o$r /ntit% Ob0ect :
Bo to Application Then Bo to 1ntit- O!+ect and Dou!le clic/ on an- ta!le: Then 5elect 7a&a<gi&en right side screen= then clic/ on Step 1: 1dit icon. 5ee !elow.

www.bispsolutions.com

www.bisptrainigs.com

www.hyperionguru.com

Page 3(

Step 2 : Chec/ed Benerate 1ntit- O!+ect class.

Step

: Clic/ on 1ntit- O!+ect Class.

Step ! : On 5ource page right clic/ : Then select So$rce 8 Overri*e +et,o*s: see !elow. or adding o&erride method.

www.bispsolutions.com

www.bisptrainigs.com

www.hyperionguru.com

Page 2*

Step " : For /xa-ple : create remo&e Method: or create @emo&e method select ;e-ove>? method then clic/ on O/ !utton. -ou can see !elow.

Step & : ;rite here code or print message .

www.bispsolutions.com

www.bisptrainigs.com

www.hyperionguru.com

Page 21

Step ' : A ter that run this application and see result.

www.bispsolutions.com

www.bisptrainigs.com

www.hyperionguru.com

Page 2)

Fin*ing Hoo1:5oints :
, ?se 5ource 8 O&erride Methods to locate an e&ent -ou want to in+ect code into 4ou ha&e Access to :  setHget or attri!utes  Transaction e&ents  Creation Hremo&e e&ents  DM% e&ents , 5imilar to Oracle Forms Triggers.

/xposing @o$r b$siness Services to Ot,er S%ste-s :
, Create 5CAH5DO inter aces to !usiness ser&ices declarati&el-. , Automates creation o : , +a&a inter ace : De ine the ser&ice. , 17B 3.* session !ean : 6mplements the +a&a inter ace. , ;5Dl ile : descri!es the ser&ice"s operations. , GM% 5chema Document<G5D= : De ines the ser&ice"s data structures. , 6ntegration with Oracle"s 5OA 5uite.

How to A** Services 7nter3ace :
Bo application 8 Then Bo 'alue O!+ect: Dou!le clic/ App+o*$le 8 5elect Service 7nter3ace<A&aila!le @ight side=: Then Clic/ on Add 6con. see !elow. Step 1 : 5elect 'alue O!+ect: Then Dou!le Clic/ on AppModule: Then 5elect 5er&ice 6nter ace.

Step 2 : 1nter we! ser&ice name clic/ on 9e3t !utton.

www.bispsolutions.com

www.bisptrainigs.com

www.hyperionguru.com

Page 23

Step

: Clic/ on 9e3t !utton.

Step ! : 5elect Ta!le: Chec/ed chec/ !o3 which want to want then clic/ on 9e3t !utton.

www.bispsolutions.com

www.bisptrainigs.com

www.hyperionguru.com

Page 22

www.bispsolutions.com

www.bisptrainigs.com

www.hyperionguru.com

Page 2>

Master your semester with Scribd & The New York Times

Special offer for students: Only $4.99/month.

Master your semester with Scribd & The New York Times

Cancel anytime.