SlideShare a Scribd company logo
1 of 465
Download to read offline
Author: Deepak Bhagat
Fusion Functional Consultant,
Solution Architect & ADF Corporate Trainer
Free Downloadable Course material: GDrive Link
Deepak Bhagat’s Oracle ADF Blogs
Develop Rich Web Applications
with ADF 12c Essentials
Hands-on Lab Practices
Develop Rich Web Application with ADF 12c Essentials – Hands-on Lab Practices
i
ADF Essentials Training by Deepak Bhagat
Table of Contents
1 Overview of Fusion Middleware and ADF ..............................................................1
1.1 System Requirements for ADF Training -* ......................................................2
1.2 Oracle Technology Resource Account Login -*................................................3
1.3 Downloading and Installing Oracle XE Database -* .........................................4
1.4 Downloading and Installing JDeveloper -*......................................................5
1.5 Unlocking HR Schema -*...............................................................................9
1.6 Entity Relation Diagram of HR System -*......................................................11
1.7 Working with JDev IDE Configuration Files -o ...............................................13
1.8 Java for Beginners -o ..................................................................................14
1.9 References -o.............................................................................................15
1.10 Grouping of Hands-on Lab Practices -* ........................................................16
1.11 Important Abbreviation and Information -* ..................................................17
1.12 Downloading Training Materials -*...............................................................18
1.13 Important to go through after the training -o ...............................................19
2 Understanding Development Tool: JDeveloper....................................................20
2.1 Creating a New Fusion Application and Project -* .........................................21
2.2 Creating a New Database Connection and Initialize the Project -*..................25
2.3 Adding ADF Business Components and ADF Faces -* ....................................27
2.4 Exploring JDeveloper and New Application -* ...............................................33
2.5 Exploring Windows of JDeveloper -* ............................................................34
2.6 Working with Windows -*............................................................................35
2.7 Taking Help using F1 key -* ........................................................................36
2.8 Refactoring JDeveloper Artifacts -* ..............................................................37
2.9 Setting IDE Preferences -* ..........................................................................39
2.10 Setting Package Levels -*............................................................................41
2.11 Lab Solution ...............................................................................................42
3 Modeling Database Schema...............................................................................43
3.1 Copying Application -o ................................................................................44
Develop Rich Web Application with ADF 12c Essentials – Hands-on Lab Practices
ii
ADF Essentials Training by Deepak Bhagat
3.2 Exploring HR System ER Diagram -* ............................................................45
3.3 Examining Training Lab Application – Lab Solution 22 -*...............................46
3.4 Creating an Offline Database Diagram with Existing Schema Objects-o ..........47
3.5 Adding New Offline Database Schema Objects -o .........................................49
3.6 Generating the SQL Scripts -o......................................................................51
3.7 Running the SQL Scripts on Database -o ......................................................55
3.8 Invoking PLSQL -x ......................................................................................56
4 Building Business Services with Default Business Components .............................57
4.1 Creating another New Application and Projects -*.........................................58
4.2 Creating Default ADF Business Components -* .............................................59
4.3 Examining Generated ADF Business Components Artifacts -*.........................62
4.4 Testing the Business Service (using Oracle ADF Model Tester) -* ..................63
4.5 Lab Solution ...............................................................................................64
5 Persisting Data Using Entity Objects...................................................................65
5.1 Copying Application -o ................................................................................66
5.2 Creating Multiple Entity Objects at Once -*...................................................67
5.3 Creating an Association -*...........................................................................68
5.4 Examining Attribute Settings -* ...................................................................69
5.5 Creating Entity Object based on Database View -o........................................71
5.6 Synchronizing an Entity Object with Table Structure Changes -o....................74
5.7 Lab Solution ...............................................................................................75
5.8 Applying Property Set -d .............................................................................76
6 Querying Data Using View Objects.....................................................................77
6.1 Copying Application -o ................................................................................78
6.2 Creating Read-Only View Object based on SQL Query -*...............................79
6.3 Creating Updatable Join View Object -*........................................................82
6.4 Adding View Object to Existing Application Module -* ...................................85
6.5 Testing View Objects -* ..............................................................................86
6.6 Internationalizing through Resource Bundle -o..............................................89
Develop Rich Web Application with ADF 12c Essentials – Hands-on Lab Practices
iii
ADF Essentials Training by Deepak Bhagat
6.7 Creating Read-Only View Object based on Static List -o ................................90
6.8 Creating Multiple Read-Only View Objects at Once -o....................................92
6.9 Creating View Link -o..................................................................................94
6.10 Adding Child VO to Master VO Through Link in Existing AM -o .......................95
6.11 Testing View Objects and Link -o.................................................................96
6.12 Lab Solution ...............................................................................................97
7 Exposing Business Service through Application Module........................................98
7.1 Copying Application -o ................................................................................99
7.2 Creating New Nested Application Module -o................................................100
7.3 Lab Solution .............................................................................................102
8 Declaratively Customizing Business Services .....................................................103
8.1 Copying Application -o ..............................................................................104
8.2 Customizing Entity Objects by Defining Control Hints -* ..............................105
8.3 Customizing View Object by Adding Transient Attribute -*...........................107
8.4 Defining List of Values and Accessors -*.....................................................109
8.5 Creating View Object with Parameterized Where Clause -*..........................113
8.6 Creating and Using Parameterized View Criteria -o......................................115
8.7 Creating Alternate Key Entity Constraints -o ...............................................119
8.8 Declaratively Populating Primary Key with a Database Sequence -o .............120
8.9 Lab Solution .............................................................................................121
8.10 References for Groovy -o ..........................................................................122
8.11 Defining Dependent List of Values (LOV) -x................................................123
8.12 View Criteria using Custom Operator -d......................................................124
9 Validating in Business Services.........................................................................125
9.1 Copying Application -o ..............................................................................126
9.2 Adding Declarative Validation: Range Validator -*.......................................127
9.3 Generating Java Files for Entity Objects -* .................................................129
9.4 Adding Method Validator -* .......................................................................131
9.5 Adding Declarative Validation: Unique Key Validator -o ...............................134
Develop Rich Web Application with ADF 12c Essentials – Hands-on Lab Practices
iv
ADF Essentials Training by Deepak Bhagat
9.6 Lab Solution .............................................................................................137
9.7 Adding Domain Validator -x.......................................................................138
9.8 Demonstrate Various Types of Validations -d..............................................139
10 Introducing User Interface Technologies .......................................................140
10.1 Running, Exploring and Familiarizing Lab 20 Application -*..........................141
11 Getting Started with User Interface and UI Components ................................149
11.1 Creating New Application with only ViewController Project -* ......................150
11.2 Setting Up the UI Project for Internationalization -*....................................152
11.3 Setting Up the Skin Preference -* ..............................................................153
11.4 Lab Solution .............................................................................................154
11.5 ADF Faces Rich Client Components -d........................................................155
12 Planning Pages using Layout Components.....................................................156
12.1 Copying Application -o ..............................................................................157
12.2 Creating New JSF Page -* .........................................................................158
12.3 Adding Default Layout Components -* .......................................................159
12.4 Customizing Layout Components -* ...........................................................163
12.5 Lab Solution .............................................................................................165
13 Designing User Interfaces and Page Flows ....................................................166
13.1 Copying Application -o ..............................................................................167
13.2 Creating Bounded Task Flows and Add View Activities -* ............................168
13.3 Creating New Page Fragments -*...............................................................169
13.4 Adding Task Flow Call Activities -* .............................................................171
13.5 Adding Return Activities -* ........................................................................172
13.6 Using Bounded Task Flows as a Region on a page -*..................................173
13.7 Creating Bounded Task Flow without Fragments -o.....................................175
13.8 Converting Bounded Task Flows to Use Page Fragments -o.........................176
13.9 Using Unbounded Task Flow with View and Control Flow Activities -o ..........177
13.10 Extracting Part of Task Flow -o..................................................................179
13.11 Lab Solution .............................................................................................181
Develop Rich Web Application with ADF 12c Essentials – Hands-on Lab Practices
v
ADF Essentials Training by Deepak Bhagat
13.12 Using URL View Activity -d ........................................................................182
14 Interactively Controlling with Navigation Components ....................................183
14.1 Copying Application -o ..............................................................................184
14.2 Adding Links and Buttons for Navigation -* ................................................185
14.3 Using Menu and Menu Items -*.................................................................191
14.4 Assigning Internationalization and Accessibility -o.......................................193
14.5 Using BreadCrumbs -o ..............................................................................195
14.6 Using Popup Dialog -o...............................................................................197
14.7 Defining Sequence of Steps (Train) and Use Wild Card Activity -o................199
14.8 Lab Solution .............................................................................................204
15 Ensuring Reusability in Web Applications.......................................................205
15.1 Copying Application -o ..............................................................................206
15.2 Creating and Using Reusable Component -* ...............................................207
15.3 Creating Page Templates -o ......................................................................212
15.4 Applying Template to Existing Page Fragments -o.......................................216
15.5 Creating a New Header Template -o ..........................................................218
15.6 Applying Template to Existing Page -o .......................................................221
15.7 Creating a New Page with Template -o ......................................................222
15.8 Adding Panel Springboard Component -o ...................................................224
15.9 Converting JSPX to Facelets -o ..................................................................226
15.10 Refactoring Page and Page Definition File -o ..............................................229
15.11 Lab Solution .............................................................................................231
15.12 Bind Custom Declarative Components to ADF -d.........................................232
16 Working with Parameters, Scopes and Partial Page Refresh (PSP)...................233
16.1 Copying BATLab_16-PSP from Solution -o ..................................................234
16.2 Implementing Set Action Listener, Scopes and Partial Page Refresh -o.........235
16.3 Setting Conditional Display -o....................................................................236
16.4 Defining Task Flow Parameters -o..............................................................238
16.5 Defining Regions Parameters -o.................................................................239
Develop Rich Web Application with ADF 12c Essentials – Hands-on Lab Practices
vi
ADF Essentials Training by Deepak Bhagat
16.6 Using Refresh Property in PageDef -o ........................................................240
16.7 Lab Solution .............................................................................................241
17 Responding to Managed Beans, Events and Listeners.....................................242
17.1 Creating new Application BATLab_17 with ViewController Project -* ............243
17.2 Creating Managed Bean -* ........................................................................245
17.3 Creating Action Listener and Adding Method Binding -*...............................251
17.4 Creating Value Change Listener -*.............................................................252
17.5 Adding Phase Listener -o...........................................................................253
17.6 Adding Validator -o ...................................................................................255
17.7 Adding Converter -o..................................................................................256
17.8 Lab Solution .............................................................................................257
18 Binding Model Layer with Business Services and Databound View ...................258
18.1 Copying Application -o ..............................................................................259
18.2 Creating a Read Only ADF Tables with Row Selection -* .............................260
18.3 Customizing Data and UI Components -o ...................................................264
18.4 Creating a Detail Forms -o.........................................................................270
18.5 Making a Table Non-Selectable -o..............................................................272
18.6 Using setCurrentRowWithKey -o ................................................................274
18.7 Using setCurrentRowWithKeyValue -o ........................................................277
18.8 Creating a Graph Component -o ................................................................280
18.9 Creating a Read Only Tree -o ....................................................................283
18.10 Lab Solution .............................................................................................287
18.11 More ADF Data-bound Components -d .......................................................288
19 Querying Data with Search Components .......................................................289
19.1 Copying Application -o ..............................................................................290
19.2 Adding Query Search and Result -*............................................................291
19.3 Customizing Query Search and Result -o....................................................295
19.4 Adding Quick Search -o.............................................................................296
19.5 Lab Solution .............................................................................................299
Develop Rich Web Application with ADF 12c Essentials – Hands-on Lab Practices
vii
ADF Essentials Training by Deepak Bhagat
20 Implementing Transactions ..........................................................................300
20.1 Copying Application -o ..............................................................................301
20.2 Implementing Create Operation -*.............................................................302
20.3 Implementing Delete Operation and Creating Helper Method -* ..................310
20.4 Implementing Update Operation -o............................................................313
20.5 Lab Solution .............................................................................................316
20.6 More ADF Transaction Management -d.......................................................317
21 Understanding Data Controls and Bindings ....................................................318
21.1 Examining the Page’s Data Bindings -*.......................................................319
22 Programmatically Customizing Business Services ...........................................321
22.1 Copying Application -* ..............................................................................322
22.2 Migrating Project to Another Application -*.................................................323
22.3 Prog Custz EO: Including Override Method -*.............................................325
22.4 Prog Custz EO: Overriding Method -*.........................................................327
22.5 Programmatically Assigning a Database Sequence -* ..................................329
22.6 Prog Custz AM: Adding and Exposing Service Methods -*............................330
22.7 Prog Custz VO: Default Parameterized Where Clause -* ..............................334
22.8 Prog Custz VO: Default Parameterized View Criteria -o................................335
22.9 Prog Custz VO: Dynamic Parameterized Where Clause -o............................336
22.10 Prog Custz VO: Dynamic Parameterized View Criteria -o..............................337
22.11 Prog Custz VO: Resetting -o ......................................................................338
22.12 Prog Custz VO: CRUD Operation: Creating -o .............................................339
22.13 Prog Custz VO: CRUD Operation: Reading and findByPrimaryKey -o.............340
22.14 Prog Custz VO: CRUD Operation: Deleting and findByKey -o........................341
22.15 Testing Exposed Service Methods using ADF Model Tester -o ......................342
22.16 Creating and Running Test Clients -o .........................................................343
22.17 Calling Service Method from MVC Layer -o .................................................345
22.18 Lab Solution .............................................................................................348
23 Deploying ADF Applications ..........................................................................349
Develop Rich Web Application with ADF 12c Essentials – Hands-on Lab Practices
viii
ADF Essentials Training by Deepak Bhagat
23.1 Copying Application -o ..............................................................................350
23.2 Creating a Business Service Deployment Profile -*......................................351
23.3 Creating a Web Module Deployment Profile -*............................................353
23.4 Creating an Application Deployment Profile -* ............................................355
23.5 Starting Integrated Weblogic Server -* ......................................................358
23.6 Deploying the Application from JDeveloper -*.............................................359
23.7 Running the Application -* ........................................................................360
23.8 Undeploying the Application -* ..................................................................361
23.9 Lab Solution .............................................................................................364
24 Securing ADF Applications ............................................................................365
24.1 Copying Application -o ..............................................................................366
24.2 Configuring the Application to use ADF Security -o......................................367
24.3 Defining Users in the Identity Store -o .......................................................369
24.4 Defining Application Roles -o .....................................................................370
24.5 Implementing Security on Task Flows and Pages -o....................................372
24.6 Testing Application Authentication and Authorization -o ..............................374
24.7 Lab Solution .............................................................................................375
24.8 ADF Basic Authentication -d ......................................................................376
25 Debugging and Troubleshooting ADF Applications..........................................377
25.1 Copying Solution -*...................................................................................378
25.2 Discovering Application Problems -*...........................................................379
25.3 Setting Breakpoints in the Debugger -*......................................................380
25.4 Running Application Module in Debug Mode -* ...........................................383
26 Best Practices ..............................................................................................390
27 Miscellaneous Topics....................................................................................391
27.1 Real-time End-to-end ADF Application -d....................................................392
28 Advance Topics............................................................................................393
28.1 UI and Page Flow Design ..........................................................................394
28.2 List of Existing Features ............................................................................395
Develop Rich Web Application with ADF 12c Essentials – Hands-on Lab Practices
ix
ADF Essentials Training by Deepak Bhagat
28.3 Adding Custom View Criteria .....................................................................396
28.4 Traversing, Creating and Deleting Master-Detail .........................................397
28.5 Creating an Application Module Base Class .................................................398
28.6 Programmatically Calling EL, Scopes and Conditional Display.......................399
28.7 Adding Router Activity...............................................................................400
28.8 Programmatically Handling Confirm Dialog .................................................401
28.9 Programmatically Invoking Popup..............................................................402
28.10 Programmatically Closing Popup ................................................................403
28.11 Rendering Dynamic Region........................................................................404
28.12 Adding Context Menu................................................................................405
28.13 Creating Data Control Method from Backing Bean.......................................406
28.14 Contextual Events.....................................................................................407
28.15 Publishing Contextual Event ......................................................................408
28.16 Subscribing and Handling Contextual Event to Region.................................409
28.17 Subscribing and Handling Contextual Event to Page....................................410
28.18 Programmatically Adding Partial Page Refresh ............................................411
28.19 Programmatically Handling UI Create Transaction.......................................412
28.20 Programmatically Handling UI Delete Transaction.......................................413
28.21 Lab Solution .............................................................................................414
28.22 Advance ADF Extended Examples -x ..........................................................415
28.23 Entity-Level Triggers -d.............................................................................416
29 Integrating ADF with Web Service ...............................................................417
29.1 Creating REST Web Service with ADF Business Service ...............................418
29.2 Creating SOAP Web Service with ADF Business Service ...............................422
29.3 Consuming REST Web Service (ADF) .........................................................425
29.4 Consuming REST Web Service (Generic) ....................................................427
29.5 Consuming SOAP Web Service...................................................................429
29.6 Advance ADF Extended Examples -x ..........................................................431
29.7 More Examples on ADF Integration with Web Services -d............................432
Develop Rich Web Application with ADF 12c Essentials – Hands-on Lab Practices
x
ADF Essentials Training by Deepak Bhagat
30 Integrating ADF with Enterprise Java Bean (EJB).........................................433
30.1 Consuming EJB Data Control .....................................................................434
30.2 Advance ADF Extended Example -x............................................................435
30.3 More Examples on Consuming EJB Data Control -d .....................................436
31 Integrating ADF with Service Orientated Architecture (SOA).........................437
31.1 Integrating SOA........................................................................................438
31.2 Advance ADF Extended Example -x............................................................440
31.3 More Examples on Integrating Oracle SOA with ADF -d...............................441
32 Integrating ADF with Mobile Application Framework (MAF)...........................442
32.1 Mobile Application Framework (MAF) .........................................................443
32.2 Advance ADF Extended Example -x............................................................453
32.3 More Examples on Integrating Oracle MAF with ADF -d...............................454
Free Downloadable Course material: GDrive Link
Deepak Bhagat’s Oracle ADF Blogs: www.cloudadfdeepakb.blogspot.com
Develop Rich Web Application with ADF 12c Essentials – Hands-on Lab Practices
1/465
ADF Essentials Training by Deepak Bhagat
1
Overview of Fusion Middleware
and ADF
For detail information refer handout “…BATHandoutsBATDocs-
PreTrainingMaterialBAT ADF Hands-on Lab Setup Guide.pdf”.
Download all Oracle ADF training documents and lab solutions, from shared folders on Google
GDrive shared by the trainer. Unzip all lab solutions. These training materials consist of study
guides, hands-on lab practices, reference guides, bookmarks, downloaded materials, extended
samples, demos, books, tutorials, etc.
This Hands-on Lab Practices is a beta version.
2/454
ADF Essentials Training by Deepak Bhagat
1.1 System Requirements for ADF Training -*
1) Personal laptop with admin access (Logged in user must be an Admin)
2) Software versions and requirements on your personal laptop, for ADF Training:
Requirements Recommended Minimum Value
RAM 4 GB of RAM (Preferably 8 GB). (I use 16 GB).
Display
1024 X 768 resolution or more. Prefer extra extended
large monitor, to attend lecture and lab simultaneously.
Hard Drive Space 10+ GB
OS MS Windows 8+, Linux
Java JDK 1.7 Update 15+
Oracle XE Database 11.2.0.2.0
ADF, JDeveloper and
Fusion Middleware (12c)
12.2.1.0.0 (not latest)
(Do NOT use 12.2.1.1.0 or later)
Oracle Technology
Resource Account
https://www.oracle.com/technical-resources ->
View Accounts -> Oracle Account -> Sign-In
3/454
ADF Essentials Training by Deepak Bhagat
1.2 Oracle Technology Resource Account Login -*
Login to your Oracle Resource account. Create one if necessary. The URL is
https://www.oracle.com/technical-resources -> View Accounts -> Oracle Account -> Sign-In.
4/454
ADF Essentials Training by Deepak Bhagat
1.3 Downloading and Installing Oracle XE Database -*
1) Link to download latest Oracle XE 11gR2 database:
a) https://download.oracle.com/otn/nt/oracle11g/xe/OracleXE112_Win64.zip or
b) https://www.oracle.com/database/technologies/xe-prior-releases.html or
c) copy an executable file from someone who has already downloaded.
2) Links for installing Oracle XE Database:
http://docs.oracle.com/cd/E17781_01/install.112/e18803/toc.htm#XEINW123
While Installing Oracle DB it will ask for system (SYS or SYSTEM) password. So, enter a
password and save it for later use. Example sysadmin (used for this lab).
3) Links for starting Oracle XE Database:
http://docs.oracle.com/cd/E17781_01/install.112/e18803/toc.htm#XEINW133
5/454
ADF Essentials Training by Deepak Bhagat
1.4 Downloading and Installing JDeveloper -*
1) Link to download JDeveloper 12.2.1.0.0:
https://www.oracle.com/tools/downloads/jdev-v12210-downloads.html.
2) Links for installing JDeveloper:
https://docs.oracle.com/middleware/1221/jdev/install/GUID-311BD061-083E-403A-8FE7-
4D78EEAFCB45.htm#OJDIG114
3) Unzip jdev_suite_122100_win64-2.zip.
4) Right-click on jdev_suite_122100_win64.exe file and select Run as Administrator.
Click Yes.
Oracle JDeveloper Studio Installation wizard appears.
5) On the Welcome page of the wizard, click Next.
6) On the Auto Updates page of the wizard, ensure Skip Auto Updates is selected and
click Next.
7) On the Installation Location page of the wizard, in the Oracle Home field, change the
path to C:OracleMiddleware122100.
8) Click Next. Click Next.
9) On the Installation Summary page of the wizard, click Install.
10) On the Installation Progress page of the wizard, after installation is completed, click
Next.
11) On the Installation Complete page of the wizard,
a) select Customize Settings and Then Start JDeveloper.
b) Click Finish.
Note: Do NOT miss this Important Step. See image below.
6/454
ADF Essentials Training by Deepak Bhagat
12) Oracle JDeveloper Studio Settings wizard appears.
a) In the Default User Directory field, enter D:<<User>>.jdeveloper.
b) In the JDeveloper Work Directory field, enter D:<<User>>BATJDev122100.
Click OK.
13) Links for starting JDeveloper:
https://docs.oracle.com/middleware/1221/jdev/install/GUID-533986A2-EF19-44B3-
B2BA-7090DB6F8891.htm#OJDIG129
14) After installing the JDeveloper run the Weblogic Server by clicking Run > Start Server
Instance (as shown in below image) and giving the password as weblogic1 (as shown in
below image) and test whether it is running successful or not.
D:Deepak-PC.jdeveloper
D:Deepak-PCBATJDev122100
7/454
ADF Essentials Training by Deepak Bhagat
15) To start JDeveloper, click on the Start menu > Oracle > Oracle JDeveloper Studio,
or double-click on the desktop shortcut .
8/454
ADF Essentials Training by Deepak Bhagat
9/454
ADF Essentials Training by Deepak Bhagat
1.5 Unlocking HR Schema -*
1) After Installing Oracle XE, you can access ‘system’ schema but not ‘hr’ schema. ‘hr’ schema
comes along with Oracle XE database, but locked. To unlock ‘hr’ schema from database to
grant permission to the users to utilize this schema, follow below steps.
a) Click Start > expand Oracle Database 11g Express Edition > select Run SQL
Command Line.
Run SQL Command Line editor opens.
b) In the editor, enter connect; command
c) Enter the user name and password for the ‘system’
Enter user-name: system (case insensitive)
Enter password: sysadmin (case sensitive)
d) Enter the following command to unlock the ‘hr’ Schema
SQL> ALTER USER HR IDENTIFIED by hr ACCOUNT UNLOCK;
e) Exit from the editor by giving command “exit” or by closing directly.
f) Now login with ‘hr’ user and password
User Name: hr (case insensitive)
Password: hr (case sensitive)
g) Now you can use all tables specified in tutorial.
h) Unlocking the HR Schema
OR
2) Alternatively, you can also unlock ‘hr’ Schema from JDeveloper as follows
a) Once you are connected as system, expand the tree in the connection panel
as Connections->SYSTEM->Other Users
b) Right-click on HR to access the Edit User dialog.
10/454
ADF Essentials Training by Deepak Bhagat
c) Within the dialog, simply uncheck the box entitled Account is Locked and
click Apply.
d) After completing this process, you should now have a fully functional Oracle XE
database with the example HR schema unlocked.
11/454
ADF Essentials Training by Deepak Bhagat
1.6 Entity Relation Diagram of HR System -*
12/454
ADF Essentials Training by Deepak Bhagat
13/454
ADF Essentials Training by Deepak Bhagat
1.7 Working with JDev IDE Configuration Files -o
1) The locations from where you can start JDeveloper apart from the shortcuts are:
a) MW_HOMEjdeveloperjdeveloper.exe
b) MW_HOMEjdeveloperjdevbinjdevw.exe
c) MW_HOMEjdeveloperjdevbinjdev.exe
The first two options have the same purpose. The last option will open along with a console
for diagnostic purposes. Example of MW_HOME is C:OracleMiddleware122100.
2) An alternate way for this is to set the JDEV_USER_DIR environment variable that points
to the user's current working directory.
JDEV_USER_HOME and JDEV_USER_DIR are the variables that are listed in the
MW_HOMEjdeveloperjdevbinjdev.boot file. JDeveloper will look up these variables on
startup to set the user's directory. For example:
set JDEV_USER_HOME=C:Users<<User>>AppDataRoamingJDeveloper
set JDEV_USER_DIR=D:<<User>>BATJDev122100mywork
3) Location of IDE configuration files:
a) MW_HOMEjdeveloperidebinide.conf
b) MW_HOMEjdeveloperjdevbinjdev.conf
4) Location of IDE boot files:
a) MW_HOMEjdeveloperidebinide.boot
b) MW_HOMEjdeveloperjdevbinjdev.boot
14/454
ADF Essentials Training by Deepak Bhagat
1.8 Java for Beginners -o
Following links are limited Java necessary for ADF. Those moving to ADF from non-Java
background may find these sufficient to learn Java.
1) http://www.javatpoint.com/simple-program-of-java
2) http://www.javatpoint.com/variable-datatype
3) http://www.javatpoint.com/operators-in-java
4) http://www.javatpoint.com/object-and-class-in-java
5) http://www.javatpoint.com/constructor
6) http://www.javatpoint.com/static-keyword-in-java
7) http://www.javatpoint.com/this-keyword
8) http://www.javatpoint.com/interface-in-java
9) http://www.javatpoint.com/access-modifiers
10) http://www.javatpoint.com/package
15/454
ADF Essentials Training by Deepak Bhagat
1.9 References -o
1) JDeveloper and ADF Release 12.2.1.0.0:
https://www.oracle.com/tools/downloads/jdev-v12210-downloads.html
2) JDeveloper and ADF Latest Release, Technical Resources & Learn more:
https://www.oracle.com/application-development/technologies/jdeveloper.html
3) ADF Homepage:
https://www.oracle.com/database/technologies/developer-tools/adf/
4) Step by Step Building Simple Demo Application with ADF:
a) http://docs.oracle.com/cd/E53569_01/tutorials/tut_rich_app/tut_rich_app.html
b) http://docs.oracle.com/cd/E53569_01/tutorials/tut_rich_app_alta/tut_rich_app_alta_
1.html
5) ADF Faces Rich Component Demos:
https://docs.oracle.com/middleware/1221/adf/develop-faces/GUID-EE22FD96-2723-4F07-
95A9-04931E42C365.htm
6) ADF Code Corner:
https://www.oracle.com/application-development/technologies/adf/codecorner.html
7) ADF Forums:
https://community.oracle.com/community/java/java_development_tools/application_devel
opment_in_java/jdeveloper_and_adf
16/454
ADF Essentials Training by Deepak Bhagat
1.10 Grouping of Hands-on Lab Practices -*
1) There is no Lab 01, Lab 10 and Lab 21.
2) Lab 02, Lab 16, Lab 17 and Lab 25 are independent Lab practices and are not dependent
on any other Lab.
3) Lab 02, Lab 04, Lab 11, Lab 16, Lab 17, Lab 25 are new starter Labs.
4) Lab 04 continues to Lab 09 and has practices on ADF BC. Later Lab 09 merges with Lab 22
into one Application.
5) Lab 11 continues to Lab 24 (excluding Lab 16, Lab 17). Later Lab 15 adds Lab 09 as ADF
Model Library.
6) Lab 20, Lab 24 and Lab 28 are full applications like real-time project.
7) To get a feel of lab objectives and practices, run Lab 20 or Lab 22.
17/454
ADF Essentials Training by Deepak Bhagat
1.11 Important Abbreviation and Information -*
Some of the abbreviations used in this documents are:
1) BAT stands for Bhagat’s (or Bright Wave’s) ADF Training.
2) Lxx where xx is a numeric value. L stands for Lab or Lesson. L04 means Lab04 or Lesson04.
3) -* are Hands-on Labs you must practice.
4) -o are optional example(s), as Advance ADF topics for self-paced Hands-on practice.
5) -x are extended example(s), as Advance ADF topics for self-paced Hands-on practice,
provided separately under folder …BATHandoutsBATXtEg-Proprietary. These
examples may also be found in my blog at https://cloudadfdeepakb.blogspot.com.
6) -d is downloaded examples from web, as Advance ADF topics for self-paced hands-on
practice, provided separately under folder …BATHandoutsOADFXtEg-Downloaded.
Important Information:
1) The labs marked with –o, -x and –d are extended example(s), as Advance ADF topics for
optional self-paced Hands-on practice.
2) Some images may have the word AAT instead of BAT and aat instead of bat. Please
read/replace them as BAT and bat respectively.
3) Steps provided for Hands-on Labs are beta version and not fully verified yet. All errors and
omissions are regretted.
4) Kindly contribute with corrections to the Hands-on Lab Practices, to help the ADF
community, as all Oracle ADF documents written by us, are free with no copyright. To
participate send an email to adftraining.b@gmail.com.
5) Do share freely with larger ADF communities.
18/454
ADF Essentials Training by Deepak Bhagat
1.12 Downloading Training Materials -*
Download all Oracle ADF training documents and lab solutions (prepared by Deepak Bhagat),
from shared folders on Google GDrive. Unzip all lab solutions. These training materials consist of
study guides, hands-on lab practices, reference guides, bookmarks, downloaded materials,
extended samples, demos, etc. Hands-on Lab Practices is a beta version.
You may also find some Advance ADF topic examples in Deepak Bhagat’s blog at
https://cloudadfdeepakb.blogspot.com.
19/454
ADF Essentials Training by Deepak Bhagat
1.13 Important to go through after the training -o
Codes, Scripts and Configurations:
1) ...BATHandoutsBATLabs-SrcCodesscrjdev.conf
2) ...BATHandoutsBATLabs-SrcCodesL28-SrcCodes-AdvanceADFvc-utilBATADFUtil.java
3) ...BATHandoutsBATLabs-SrcCodesL17-SrcCodes-Bean_Event_Listener
4) ...BATHandoutsBATLabs-SrcCodesL21-SrcCodes-Binding*.java
5) ...BATHandoutsBATXtEg-ProprietaryL28-BATXtEg-AdvanceADFBATVCContextualEventEg
6) ...BATHandoutsBATXtEg-ProprietaryL28-BATXtEg-AdvanceADFBATVCDynamicRegionEg
7) ...BATHandoutsBATXtEg-ProprietaryL28-BATXtEg-AdvanceADFBATVCProgHandleSimplePopupEg
8) ...BATHandoutsBATXtEg-ProprietaryL28-BATXtEg-AdvanceADFBATVCProgHandlePopupWithRegionEg
9) ...BATHandoutsBATXtEg-ProprietaryL29-BATXtEg-Integrating-WebService1Create_REST-WebService-withADFBS
Documents:
10) ...BATHandoutsBATDocs-PreTrainingMaterialPrint- BAT ADF Handy Reference.pdf
11) ...BATHandoutsBATDocs-TrainingMaterialBAT ADF Study Guide - student.pdf
12) ...BATHandoutsBATDocs-TrainingReferenceBAT ADF Assorted Notes.pdf
13) ...BATHandoutsBATDocs-TrainingReferenceL08-BAT Introduction to Groovy.pdf
14) ...BATHandoutsBATDocs-TrainingReferenceOracle ADF Bookmarks 2016.html
15) ...BATHandoutsBATDocs-TrainingReferenceOracle ADF Feeds Firefox 2015.opml
16) ...BATHandoutsOADFDocs-DownloadedL26-ADFDocs-BestPractices
17) ...BATHandoutsOADFDocs-DownloadedL27-ADFDocs-MiscellaneousADF Programmer Cheat Sheet.pdf
18) ...BATHandoutsOADFDocs-DownloadedL35-ADFDocs-Books
19) ...BATHandoutsOADFDocs-DownloadedL35-ADFDocs-Tutorials
Concepts:
20) Geometry Management
21) Scopes
22) Lifecycle and validation
23) Contextual event
24) Create or Expose as REST Web Service or as REST API
20/454
ADF Essentials Training by Deepak Bhagat
2
Understanding Development
Tool: JDeveloper
In this lab for this lesson, start JDeveloper, set preferences for the IDE, and create a JDeveloper
application, project and database connection.
21/454
ADF Essentials Training by Deepak Bhagat
2.1 Creating a New Fusion Application and Project -*
Start JDeveloper, create a new ADF Fusion Web Application named BATLab_02 with custom
settings and database connection. Also explore data control, overview page and generated files.
1) Start JDeveloper using the default role.
a) Double-click the desktop shortcut to start JDeveloper.
b) In the Select Role dialog box, select the Role as Studio Developer (All
Features). Click OK.
c) Optionally, if system prompts the Confirm Import Preferences dialog box, click
No.
d) JDeveloper starts by displaying the Tip of the Day. Optionally, if you want, deselect
the Show tips at startup check box. Click Close.
e) Explore and then optionally close the Start page by clicking the X at the right of its
tab. (The X is not visible until you position the cursor over the tab.)
2) Create a new ADF Fusion Web Application named BATLab_02 in the bat.lab.hrsystem
package. Do not use an application template. Create the initial projects named HRService
in the bat.lab.hrsystem.service package and HRViewController in the
bat.lab.hrsystem.ui package.
a) Click the File menu > New > select Application.
Or
In the Applications window, click the New Application link.
New Gallery wizard appears.
22/454
ADF Essentials Training by Deepak Bhagat
b) Expand the General (in the Categories list) > Applications > select ADF Fusion
Web Application (in the Items list). Click OK.
Create ADF Fusion Web Application wizard appears.
c) On the Application Name page of the wizard,
i) In the Application Name field, enter BATLab_02.
ii) In the Application Package Prefix field, enter bat.lab.hrsystem.
iii) Click Next.
d) On the Project 1 Name page of the wizard,
Page
BAT
BAT
bat
BAT
BAT
23/454
ADF Essentials Training by Deepak Bhagat
i) In the Project Name field, enter HRService.
ii) Click Next.
e) On the Project 1 Java Settings page of the wizard,
i) In the Default Package field, enter bat.lab.hrsystem.service.
ii) Click Next.
f) On the Project 2 Name page of the wizard,
i) In the Project Name field, enter HRViewController.
ii) Click Next.
g) On the Project 2 Java Settings page of the wizard,
i) In the Default Package field, enter bat.lab.hrsystem.ui.
ii) Click Next.
h) Click Finish.
3) Notice that the Applications window displays your application and projects.
BAT BAT
BAT BAT
BAT BAT
BAT
BAT BAT
BAT BAT
bat.
bat
24/454
ADF Essentials Training by Deepak Bhagat
4) Explore all the default generated files.
5) Explore the empty Data Controls window (within Applications window).
6) Explore the BATLab_02 Overview. (Notice that the BATLab_02 Overview page is open
in the editor. This page enables you to see all the aspects of your application at a glance,
to obtain related help and to create new objects. You can spend some time exploring this
overview objects if you want to, but it is not used in this lab.)
BAT
BAT
25/454
ADF Essentials Training by Deepak Bhagat
2.2 Creating a New Database Connection and Initialize the Project -*
Create a new database connection and initialize the project.
1) Create a new database connection.
a) Expand the Application Resources window. Right-click the Connections > New
Connection > select Database.
Create Database Connection wizard appears.
b) Supply the following information.
Connection Name Hrconn
Connection Type Oracle (JDBC)
Username hr (or if you are using a shared database, follow
instructions given by your instructor.)
Password hr (case sensitive)
Save Password Select the check box (if not checked/selected)
BAT
26/454
ADF Essentials Training by Deepak Bhagat
c) In Oracle (JDBC) Settings section, leave the Driver field as thin, Host Name field
as localhost, JDBC Port field as 1521, SID field as XE respectively.
d) Click Test Connection.
The status box should display the word Success!.
e) Click OK. Click Save All .
27/454
ADF Essentials Training by Deepak Bhagat
2.3 Adding ADF Business Components and ADF Faces -*
Create new default business components such as entity objects, view objects and application
module. Also create a JSF page.
1) Create new default business components.
a) Right-click the HRService > New > select Business Components from Tables.
Initialize Business Components Project wizard appears.
b) Ensure the Connection is hrconn (if the database connection is already created or
else click icon and follow the 2.2 above to create a new database connection). Click
OK.
Create Business Components from Tables wizard appears.
c) On the Entity Objects page of the wizard,
Page
bat
28/454
ADF Essentials Training by Deepak Bhagat
i) In the Package field, enter bat.lab.hrsystem.service.eo (note eo).
ii) Click the Query button to see the available tables.
iii) From the Available pane, select DEPARTMENTS and EMPLOYEES, click to
shuttle to the Selected pane.
iv) In the Selected pane, select the DEPARTMENTS, in the Entity Name field,
change to DepartmentEO (remove s).
v) Similarly, select the EMPLOYEES, in the Entity Name field, change to
EmployeeEO (remove s).
vi) Click Next.
d) On the Entity-based View Objects page of the wizard,
i) In the Package field, enter bat.lab.hrsystem.service.vo (note vo).
ii) From the Available pane, select DepartmentEO and EmployeeEO, click to
shuttle to Selected pane.
iii) In the Selected pane, select the DepartmentEOView, in the Object Name
field, change to DepartmentVO (remove View and replace E to V).
iv) Similarly, select the EmployeeEOView, in the Object Name field, change to
EmployeeVO (remove View and replace E to V).
v) Click Next.
Page
Pane Pane
bat
29/454
ADF Essentials Training by Deepak Bhagat
e) On the Query-based View Objects page of the wizard,
i) In the Package field, enter bat.lab.hrsystem.service.vvo (note vvo
replacing vo).
ii) Click the Query button.
iii) From the Available pane, select the JOBS, click to shuttle to the Selected
pane.
iv) In the Selected pane, select the JOBS, in the View Name field, change to
JobsVVO (note sVVO).
v) Click Next.
f) On the Application Module page of the wizard,
i) Ensure that the Add to Application Module check box is checked.
ii) In the Package field, enter bat.lab.hrsystem.service.am (note am).
iii) In the Name field, change to HRSystemAM.
iv) Click Next.
Page
Page
bat
bat
30/454
ADF Essentials Training by Deepak Bhagat
g) On the Diagram page of the wizard,
i) Check the Add to Business Components Diagram check box to create
business components diagram. (Leave Package as it is. We will refactor later).
ii) Click Next.
iii) Click Finish. Click Save All .
2) Explore the files generated and diagrams. Ensure following details:
Type of Object Package Objects Based on
Entity Object bat.lab.hrsystem.service.eo
DepartmentEO,
EmployeeEO
DEPARTMENTS,
EMPLOYEES
tables
Updatable VO bat.lab.hrsystem.service.vo
DepartmentVO,
EmployeeVO
DepartmentEO,
EmployeeEO
Query-based VO bat.lab.hrsystem.service.vvo JobsVVO JOBS table
Application
Module
bat.lab.hrsystem.service.am HRSystemAM
Page
bat
bat
31/454
ADF Essentials Training by Deepak Bhagat
3) Test the default business components by running the application module.
a) Right-click the (application module) HRSystemAM (in the bat.lab.hrsystem.service.am
package) > select Run.
Oracle ADF Model Tester wizard appears.
b) Explore the view object instances in it.
2) Create a new JSF page named HRSystemIndex and run the page.
BAT
bat
bat
bat
bat
bat
bat
32/454
ADF Essentials Training by Deepak Bhagat
a) Right-click the HRViewController > New > select Page.
Create JSF Page wizard appears.
b) In the File Name field, enter HRSystemIndex. Keep remaining as defaults.
c) Click OK.
d) Explore the newly created page HRSystemIndex.jsf.
e) Right-click the HRSystemIndex.jsf > select Run.
System opens the HRSystemIndex page in web browser. Explore the URL and title.
BAT BAT
bat
bat
bat
bat
bat
bat
33/454
ADF Essentials Training by Deepak Bhagat
2.4 Exploring JDeveloper and New Application -*
Examine, explore, understand and familiarize with all generated artifacts.
1) Expand the HRService > Application Sources > bat.lab.hrsystem.
2) Double-click the HRService.jpx file (database connectivity) and explore it. Observe
Connection details.
3) Expand the Data Controls window and explore newly displayed artifacts i.e.,
HRSystemAMDataControl and components under it.
4) Expand the bat.lab.hrsystem.service.am and double-click the Business
Components Diagram.adfbc_diagram.
5) Explore all generated artifacts.
6) Expand the Application Resources window > Connections, explore HR System schema,
tables, sequence, properties, etc.
bat
34/454
ADF Essentials Training by Deepak Bhagat
2.5 Exploring Windows of JDeveloper -*
Examine, explore, understand and familiarize with various windows of the JDeveloper.
1) Explore various windows of JDeveloper such as Applications, Data Controls, Databases,
Structure, Editors (code and visual), Log and Debugger, Components, Resources (IDE and
Application), Properties, etc. and other Windows.
BATLab_02
35/454
ADF Essentials Training by Deepak Bhagat
2.6 Working with Windows -*
Play around with windows and familiarize.
1) Right-click the window title, to work with following window options:
Close / Open Maximize / Restore Float / Dock Split / Unsplit Resize Reposition
2) All JDev Menus and menu items like File, Edit, View, Application, Refactor, Search, etc.
BAT
36/454
ADF Essentials Training by Deepak Bhagat
2.7 Taking Help using F1 key -*
Familiarize with JDeveloper Help.
1) Select or place the cursor on the object or context of which you need help.
2) Press F1 key for help.
Help window appears, which contains the detailed information regarding the selected object
or context.
37/454
ADF Essentials Training by Deepak Bhagat
2.8 Refactoring JDeveloper Artifacts -*
Refactor artifacts by renaming view object and moving diagram to appropriate package.
1) Rename (JobsVVO to JobVVO) and move diagram (from
bat.lab.hrsystem.service.am to bat.lab.hrsystem.service.diagram).
a) Right-click the JobsVVO > Refactor > select Rename.
Rename wizard appears.
b) In the Rename To field, change to JobVVO (remove s). Click OK.
Notice the name JobsVVO changed to JobVVO.
c) Expand the bat.lab.hrsystem.service.am, select Business Components
Diagram.adfbc_diagram.
d) Click the Refactor menu > select Move.
bat
38/454
ADF Essentials Training by Deepak Bhagat
Move Files window appears.
e) Select the service folder, create a new folder diagram by clicking icon and
select it.
f) Click the Select button.
Diagram moves from package bat.lab.hrsystem.service.am to
bat.lab.hrsystem.service.diagram
2) Save All.
BAT BAT
BAT
BAT
bat
39/454
ADF Essentials Training by Deepak Bhagat
2.9 Setting IDE Preferences -*
Configure JDeveloper preferences for Object Naming and Packages.
1) Set global naming preferences and packaging preferences for following ADF BC objects:
entity object, domain, association, view object, view link and application module.
a) Click the Tools menu > select Preferences.
Preferences wizard appears.
b) Expand the ADF Business Components > select Object Naming.
c) In the Suffix column, enter values as follows:
d) At the left pane, select Packages and enter Packages values as follows
40/454
ADF Essentials Training by Deepak Bhagat
e) Click OK. Save All.
2) Click the Tools menu > select Switch Roles, to switch default role to start JDeveloper, if
needed.
41/454
ADF Essentials Training by Deepak Bhagat
2.10 Setting Package Levels -*
Set the project package and web content levels to reduce number of levels.
1) Click the Applications Window Options as shown below.
2) Change the both Package Level and Web Content Level to 5.
3) Save All.
BAT
bat
bat
bat
bat
bat
bat
42/454
ADF Essentials Training by Deepak Bhagat
2.11 Lab Solution
Lab solutions can be found under …BATHandoutsBATLabs-SolutionsBATLab_02.
43/454
ADF Essentials Training by Deepak Bhagat
3
Modeling Database Schema
In this lab, you use the diagram modeler/editor to create a visual representation of the database
schema. You also create a new database component (a table) and create the DDL (Data Definition
Language) scripts to add the table to the schema.
44/454
ADF Essentials Training by Deepak Bhagat
3.1 Copying Application -o
Make a copy of application BATLab_02 and rename it to BATLab_03.
1) In the File Explorer, open location …mywork.
2) Copy and paste the application BATLab_02 in the same location.
3) Rename the newly copied application from BATLab_02-Copy to BATLab_03.
4) Switch to JDeveloper.
5) Click the File menu > select Open.
6) Select the …myworkBATLab_03BATLab_02.jws from your local system. Click Open.
7) Click the Application menu > select Rename.
Rename wizard appears.
8) In the File Name field, change to BATLab_03.jws. Click Save.
9) Click the Build menu > select Clean All and Refresh Application. Click Yes.
BAT BAT
BAT
BAT
45/454
ADF Essentials Training by Deepak Bhagat
3.2 Exploring HR System ER Diagram -*
Examine, explore, understand and familiarize with HR System ER diagram.
46/454
ADF Essentials Training by Deepak Bhagat
3.3 Examining Training Lab Application – Lab Solution 22 -*
Open …BATHandoutsBATLabs-SolutionsBATLab_22 lab solution. Run and explore the
application.
<<to be done together at end>>
47/454
ADF Essentials Training by Deepak Bhagat
3.4 Creating an Offline Database Diagram with Existing Schema Objects-o
Create a new offline database diagram (BAT_DB) with existing schema objects.
1) Expand the Application Resources window > Connections > Database > hrconn and
explore.
2) Right-click the HRService > New > select From Gallery.
New Gallery wizard appears.
3) Expand the General > Diagrams > select Database Diagram at right-side. Click OK.
Create Database Diagram wizard appears.
4) In the Name field, enter BATSchema
5) In the Package field, enter bat.lab.hrsystem.service.db (note db).
6) Click OK.
7) BATSchema.db_diagram opens in the editor. Save All.
bat
BAT
48/454
ADF Essentials Training by Deepak Bhagat
8) Expand the Application Resources window > Connections > Database > hrconn >
Tables.
9) Drag the DEPARTMENTS and EMPLOYEES tables to the diagram modeler/editor.
Specify Location dialog box appears.
10) Select the Offline Database, in Offline Database field enter BAT_DB.
11) Click OK. Save All.
BAT
BAT
BAT
49/454
ADF Essentials Training by Deepak Bhagat
3.5 Adding New Offline Database Schema Objects -o
Add new database schema object (GENDERS) to the newly created offline database (BAT_DB).
1) From the Components window (ensure Database page is selected), drag Table
component to the BATSchema.db_diagram editor.
Specify Location wizard appears.
2) In the Offline Database list, select BAT_DB (If it is already not selected). Click OK.
3) In the diagram editor, change table name from TABLE1 to GENDERS.
4) Resize the table.
5) Double-click the GENDERS table diagram to invoke Edit Table page.
a) Click the Columns page (left side).
Page
BAT
BAT
BAT
50/454
ADF Essentials Training by Deepak Bhagat
b) Click the icon (right end) to add a new column GENDER_ID.
i) In the Name column, enter GENDER_ID,
ii) In the Data Type column, change to Number,
iii) In the Size column, enter 4,
iv) In the Not NULL column, check the check box, to make it mandatory,
v) In the PK column, click inside column, to make it a primary key,
vi) Save All.
OR
vii) Click the Constraints page. Click icon and select New Primary Key
Constraint. From Available Columns, select GENDER_ID and shuttle it to
Selected Columns.
c) Similarly add another column GENDER_NAME with default values.
i) In the Name column, enter GENDER_NAME.
6) Save All.
51/454
ADF Essentials Training by Deepak Bhagat
3.6 Generating the SQL Scripts -o
Create and run scripts to create GENDER table in the Database and to insert data in it.
1) To generate DDL script,
a) In the Projects window, expand Offline Database Sources > BAT_DB > HR.
b) Right-click the GENDERS table > Generate To > select SQL Script.
Generate SQL from Database Objects wizard appears.
BAT
BAT BAT
BAT
52/454
ADF Essentials Training by Deepak Bhagat
c) On the SQL Script page of the wizard, in the File Name field change to
…databaseBAT_DBcreateTableGender.sql. Click Next. Click Next. Click
Next. Click Next. Click Finish.
It creates createTableGender.sql file and opens in the editor
2) Double-click the Employees table.
a) Click the Columns page.
b) Select the last column (i.e. DEPARTMENT_ID), click icon to add a new column.
It inserts new column.
c) In the Name column, change from COLUMN1 to GENDER_ID,
d) In the Data Type column, change to Number,
e) In the Size column, change to 4. Save All.
3) Go back to BATSchema.db_digram (if it is closed, expand the Recent Files window and
double-click the diagram).
4) In the Components window, drag Foreign Key from GENDER_ID of GENDERS table to
GENDER_ID of EMPLOYEES table. Click OK. Save All.
BAT
BAT
53/454
ADF Essentials Training by Deepak Bhagat
5) To generate DDL script,
a) Expand the Offline Database Sources > BAT_DB > HR.
b) Right-click the EMPLOYEES table > Generate To > select SQL Script.
Generate SQL from Database Objects wizard appears.
c) In the File Name field, change to …databaseBAT_DBalterTableEmp.sql.
Click Next. Click Next. Click Next.
d) On the Specify Operation page of the wizard,
i) In the Operation option, select Alter radio button.
ii) Check the With replace if necessary checkbox.
iii) In the Target option, select Database Connection.
iv) Ensure the Connection is hrconn (BATLab_03).
v) Click Next. Click Finish.
BAT
BAT
BAT
54/454
ADF Essentials Training by Deepak Bhagat
6) Expand the Offline Database Sources.
7) Right-click the BAT_DB > New > select From Gallery.
New Gallery wizard, appears.
a) Expand the Database Tier > select Database Files > SQL File. Click OK.
Create SQL File wizard appears.
b) In the File Name field, enter populateTableGender.sql.
c) In the Directory field, change path to …HRServicedatabaseBAT_DB.
d) Click OK.
populateTableGender.sql opens in the editor.
8) Insert following content in populateTableGender.sql editor.
INSERT INTO GENDERS (gender_id, gender_name) VALUES (1, 'MALE');
INSERT INTO GENDERS (gender_id, gender_name) VALUES (2,
'FEMALE');
9) Save All.
BAT
BAT BAT BAT
55/454
ADF Essentials Training by Deepak Bhagat
3.7 Running the SQL Scripts on Database -o
Run the all three scripts to create GENDER table and to insert data in the table.
1) Run the scripts in following order: createTableGender.sql, alterTableEmp.sql
and populateTableGender.sql.
a) Expand the Offline Database Sources > BAT_DB > HR.
b) Double-click the createTableGender.sql to open it in the editor.
c) Right-click in the editor, select Run Script.
It creates new table GENDERS in database.
2) Similarly, Run Script on alterTableEmp.sql and populateTableGender.sql.
3) To verify, check the database that the GENDERS table is created and it has data.
56/454
ADF Essentials Training by Deepak Bhagat
3.8 Invoking PLSQL -x
This is part of advance ADF topic and a copy of this extended example (named
BATPLSQLIntgEg) may be found under …BATHandoutsBATXtEg-ProprietaryL03-
BATXtEg-Database. For hands-on practice, please refer to Deepak Bhagat’s Blog at
https://cloudadfdeepakb.blogspot.com or download from above location. It’s a lab sample on
invoking PLSQL.
57/454
ADF Essentials Training by Deepak Bhagat
4
Building Business Services with
Default Business Components
In this lab, you create a business model by using the wizards that are built into JDeveloper. You
see how to build a default model without any coding. In subsequent lessons and practices, you
learn to build and customize components to meet your specific application requirements.
58/454
ADF Essentials Training by Deepak Bhagat
4.1 Creating another New Application and Projects -*
Create an application BATLab_04 with default projects, with default packages and settings.
1) Create an application named BATLab_04 with package bat (as explained in Lab 2.1) and
with default projects, packages and settings.
a) Click the File menu > New > select Application.
New Gallery wizard appears.
b) Expand the General > Applications > select ADF Fusion Web Application.
c) Click OK.
Create ADF Fusion Web Application wizard appears.
d) On the Application Name page of the wizard,
i) In the Application Name field, enter BATLab_04.
ii) In the Application Package Prefix field, enter bat.
iii) Click Finish. (or Click Next > Next > Next > Next > Next > Finish).
2) The application gets created with default projects Model and ViewController and with
default packages bat.model and bat.view respectively.
3) Optionally one may delete ViewController project.
BAT
BAT BAT
BAT
bat
59/454
ADF Essentials Training by Deepak Bhagat
4.2 Creating Default ADF Business Components -*
Create default business components; Entity Objects, View Objects and Application Module.
1) Create Business Components by using Create Business Components from Tables with
following details
Type of Object Package Objects Based on
Entity Object bat.model.eo DepartmentsEO,
EmployeesEO
DEPARTMENTS,
EMPLOYEES tables
Updatable VO bat.model.vo
DepartmentsVO,
EmployeesVO
DepartmentsEO,
EmployeesEO
Query-based VO bat.model.vo JobsVO JOBS tables
Application
Module
bat.model.am AppModuleAM
a) Right-click the Model project > New > select Create Business Components from
Tables.
Initialize Business Components Project wizard appears.
b) Click the icon, next to the Connection.
Create Database Connection wizard appears.
60/454
ADF Essentials Training by Deepak Bhagat
c) Supply the following information:
Connection Name Hrconn
Connection Type Oracle (JDBC)
Username
hr (or if you are using a shared database, follow the
instructions given by your instructor.)
Password hr (case sensitive)
Save Password Select check box
d) Click the Test Connection. The status box displays the word Success! Click OK.
e) Click OK.
Create Business Components from Tables wizard appears.
f) To create default business components, follow below steps, as explained in step 2.1.9.
BAT
61/454
ADF Essentials Training by Deepak Bhagat
i) Click the Query button. From Available pane, select DEPARTMENTS and
EMPLOYEES and shuttle them to Selected pane. Click Next.
ii) On the Entity-based View Objects page of the wizard. From Available pane,
shuttle DepartmentsEO and EmployeesEO to Selected pane. Click Next.
iii) On the Query-based View Objects page of the wizard. Click Query button.
From Available pane, select JOBS and shuttle them to Selected pane. Click
Next.
iv) Ensure the Add to Application Module checkbox is checked.
v) Click Next.
vi) Click Finish.
g) Save All.
Page
bat
62/454
ADF Essentials Training by Deepak Bhagat
4.3 Examining Generated ADF Business Components Artifacts -*
Examine, explore, understand and familiarize with all generated artifacts.
BAT
bat
bat
bat
bat
bat
bat
63/454
ADF Essentials Training by Deepak Bhagat
4.4 Testing the Business Service (using Oracle ADF Model Tester) -*
Test the business services which are created in earlier sections by using Oracle ADF Model Tester.
1) Run and test application module (AppModuleAM), using Oracle ADF Model Tester.
a) Right-click the (application module) AppModuleAM, select Run.
Oracle ADF Model Tester wizard appears.
2) Double-click the various object instances on the left side panel and test.
a) For example, double-click the EmpDeptFkVL1 and Jobs and observe the details on
right side panel.
b) Navigate through records by clicking right-arrow and left arrow .
64/454
ADF Essentials Training by Deepak Bhagat
4.5 Lab Solution
Lab solutions can be found under …BATHandoutsBATLabs-SolutionsBATLab_04
65/454
ADF Essentials Training by Deepak Bhagat
5
Persisting Data Using Entity
Objects
In this lab, you create entity objects for tables that the application will update and also create
associations.
66/454
ADF Essentials Training by Deepak Bhagat
5.1 Copying Application -o
Make a copy of application BATLab_04 and rename it to BATLab_05. Follow the steps, as
explained in Lab 3.1.
1) In the File Explorer, open location …mywork.
2) Copy and paste the application BATLab_04 in the same location.
3) Rename the newly copied application from BATLab_04-Copy to BATLab_05.
4) Switch to JDeveloper.
5) Click the File menu > select Open.
6) Select …myworkBATLab_05BATLab_04.jws from your local system. Click Open.
7) Click the Application menu > select Rename.
Rename wizard appears.
8) In the File Name field, change to BATLab_05.jws. Click Save.
9) Click the Build menu > select Clean All and Refresh Application. Click Yes.
10) Open the Model.jpx file in the editor.
11) If the Connection is selected None, then select Online Database.
67/454
ADF Essentials Training by Deepak Bhagat
5.2 Creating Multiple Entity Objects at Once -*
Create following multiple entity objects at once by using Create Business Components from
Tables.
DB Tables Entity Objects (EO)
COUNTRIES CountriesEO
REGIONS RegionsEO
JOB_HISTORY JobHistoryEO
1) Right-click the bat.model.eo package > New > select Business Components from
Tables.
Create Business Components from Tables wizard appears.
2) Click the Query button.
3) From the Available (left) pane, select COUNTRIES, REGIONS and JOB_HISTORY and shuttle
them to Selected (right) pane.
4) Click Finish.
bat
68/454
ADF Essentials Training by Deepak Bhagat
5.3 Creating an Association -*
(dependent on 5.3)
Manually create an association JobHistDeptAS between two entity objects DepartmentsEO
and JobHistoryEO.
1) Right-click the bat.model.as > New > select Association.
Create Association wizard appears.
2) On the Name page of the wizard, in the Name field enter JobHistDeptAS. Click Next.
3) On the Entity Objects page of the wizard,
a) From the Select Source Attribute pane, expand DepartmentsEO > select
DepartmentId and from Select Destination Attribute pane, expand
JobHistoryEO > select DepartmentId.
b) Click the Add button.
4) Click Next. Click Next. Click Next. Click Finish. Save All.
bat
bat
bat
69/454
ADF Essentials Training by Deepak Bhagat
5.4 Examining Attribute Settings -*
Examine, explore, understand and familiarize with all settings of an Attribute.
1) Property Set: Select a named property set to apply to this attribute. A property set is a
version of an existing domain that is XML-only (no Java) and does not enforce a data type.
2) Effective Date: Specify effective date properties for the attribute. These options are
available only if the attribute type is Date.
3) Start Date: Select to indicate that this attribute is the start attribute of an effective dated
entity object.
4) End Date: Select to indicate that this attribute is the end attribute of an effective dated
entity object.
5) Sequence Flag: Select to indicate that this attribute stores a flag indicating the most recent
change in the sequence for an effective dated entity object.
6) Sequence: Select to indicate that this attribute stores a sequence of changes for an
effective dated entity object.
7) Updatable: You can enable the attribute to Always or Never be updatable or enable it to
be updated only before the entity is first posted (While New).
70/454
ADF Essentials Training by Deepak Bhagat
8) Queryable: Specify that this attribute can occur in the WHERE clause of a view object
(selected by default except for LOBs).
9) Precision Rule: Specifies that a validator is applied by the framework at runtime to enforce
the maximum precision and scale of the data type. If selected, the validation is performed
by the entity. If not selected, the validation is not performed by the entity and may result
in invalid precision/scale errors from the database when the transaction is committed.
10) Refresh on Insert/ Update: Specify whether to retrieve the value from the database
after an insert or update.
11) Change Indicator: Select this option if the column is a change indicator, such as a
timestamp, to be used to indicate that a row has been changed by another transaction. (If
no columns are specified as change indicators, ADF BC does a column-by-column
comparison.)
12) Effective Date: The attribute is either the start or end date of a date range for which the
entity row is effective (used for a point of time snapshot to answer such questions as what
an employee’s salary was on January 30, 2004.)
13) History Column: Select to use this column to log changes to the database. You can log
changes only if you have implemented Java Authentication and Authorization Service (JAAS)
authentication, the selected attribute is persistent, you have not selected Primary Key,
Mandatory, or Discriminator, and the attribute is Char, Character, String, Date, Timestamp,
or Number. After you have selected History Column, you can select the history column type
(created on or modified on for a Date or Timestamp attribute, created by or modified by for
a Char, Character, or Stringattribute, or version number for a Number attribute).
14) Generate Unique Constraint: Select to generate a UNIQUE constraint for this attribute.
It is often useful to define an attribute so that its values must be unique. For example, you
might want to enforce that every customer has a unique email address.
15) Sequence Name: Enter the name of the database sequence. The sequence name shown
on the Sequence tab is applicable only at design time when you use the Create Database
Tables feature. The sequence indicated here will be created along with the table on which
the entity object is based. This field is not available for all attribute types.
16) Start At: Enter an integer value you want the sequence to start at, the default value is 1.
This field is not available for all attribute types.
71/454
ADF Essentials Training by Deepak Bhagat
5.5 Creating Entity Object based on Database View -o
Create Entity Object EmpDetailsViewEO in bat.model.eo package, based on Database View
(EMP_DETAILS_VIEW).
1) In the Applications window, right-click the Model project (or bat.model.eo package)
> New > select Entity Object.
Create Entity Object wizard appears.
2) On the Name page of the wizard, in the Name field, enter EmpDetailsViewEO and click
Browse (next to the Schema Object).
Select Schema Object wizard appears.
a) Check the Object Type as Views and uncheck Tables.
b) Click the Query button.
c) From the Available Objects select EMP_DETAILS_VIEW. Click OK.
bat
72/454
ADF Essentials Training by Deepak Bhagat
3) Click Next.
4) On the Attributes page of the wizard, select last two columns (CounrtyName and
RegionName). Click Remove. Click Next. (Removing is important for lab 5.4).
5) On the Attribute Settings page of the wizard, select EmployeeId and check Primay Key
check box to make it as Primary Key. Click Next. Click Next. Click Next. Click Finish. (See
lab 5.6 for details on each properties of the Attribute).
bat
73/454
ADF Essentials Training by Deepak Bhagat
74/454
ADF Essentials Training by Deepak Bhagat
5.6 Synchronizing an Entity Object with Table Structure Changes -o
(dependent on 5.5)
Synchronize EmpDetailsViewEO entity object’s missing columns with database or structure
changes in table.
1) Double-click the EmpDetailsViewEO to open in the editor.
2) Click the Attributes page. Verify that CounrtyName and RegionName attributes are
missing.
3) Right-click the EmpDetailsViewEO > select Synchronize with Database.
Synchronize with Database wizard appears.
4) Select statements with COUNTRY_NAME and REGION_NAME. Click Synchronize button.
Click OK. Click OK. Save All.
5) Verify the CounrtyName and RegionName attributes are now present in the
EmpDetailsViewEO.
75/454
ADF Essentials Training by Deepak Bhagat
5.7 Lab Solution
Lab solutions can be found under …BATHandoutsBATLabs-SolutionsBATLab_05
76/454
ADF Essentials Training by Deepak Bhagat
5.8 Applying Property Set -d
This Property Set topic is part of the Advance ADF extended example, taken from the web. For
optional self-paced hands-on practice, it may be further downloaded from
…BATHandoutsOADFXtEg-DownloadedL05-ADFXtEg-EntityObject.
77/454
ADF Essentials Training by Deepak Bhagat
6
Querying Data Using View
Objects
In this lab, you create view objects that are more customized for your application. You can also
create LOV, read-only view objects to support those LOVs and updatable view objects based on
entity objects and also create links between view objects. You can test these objects or instances
by using tester.
78/454
ADF Essentials Training by Deepak Bhagat
6.1 Copying Application -o
Make a copy of application BATLab_05 and rename it to BATLab_06. Follow the steps, as
explained in Lab 5.1.
1) In the File Explorer, open location …mywork.
2) Copy and paste the application BATLab_05 in the same location.
3) Rename the newly copied application from BATLab_05-Copy to BATLab_06.
4) Switch to JDeveloper.
5) Click the File menu > select Open.
6) Select …myworkBATLab_06BATLab_05.jws from your local system. Click Open.
7) Click the Application menu > select Rename.
Rename wizard appears.
8) In the File Name field, change to BATLab_06.jws. Click Save.
9) Click the Build menu > select Clean All and Refresh Application. Click Yes.
10) Open the Model.jpx file in the editor.
11) If the Connection is selected None, then select Online Database.
79/454
ADF Essentials Training by Deepak Bhagat
6.2 Creating Read-Only View Object based on SQL Query -*
Create a read-only view object EmpSqlQueryVO based on SQL Query.
1) Right-click the bat.model.vo > New > select View Object.
Create View Object wizard appears.
2) On the Name page of the wizard,
a) In the Name field, enter EmpSqlQueryVO.
b) Select the Custom SQL query radio button (under Data Source). Click Next.
3) On the Query page of the wizard,
a) Click the Query Builder button to build a Query.
SQL Statement wizard appears.
b) Click the Query button.
c) Expand the EMPLOYEES and select attributes EMPLOYEE_ID, FIRST_NAME,
LAST_NAME, EMAIL, PHONE_NUMBER, HIRE_DATE, JOB_ID, SALARY,
COMMISSION_PCT, MANAGER_ID, DEPARTMENT_ID from Available pane (left) and
shuttle them to Selected pane (right). Click OK.
bat
80/454
ADF Essentials Training by Deepak Bhagat
4) Verify the Query: SELECT EMPLOYEE_ID, FIRST_NAME, LAST_NAME, EMAIL,
PHONE_NUMBER, HIRE_DATE, JOB_ID, SALARY, COMMISSION_PCT,
MANAGER_ID, DEPARTMENT_ID FROM EMPLOYEES.
5) Click Next till Step 8 (i.e. Application Module page).
6) Check the Add to Application Module.
7) Click Finish. Save All.
8) Right-click the AppModuleAM > select Run.
81/454
ADF Essentials Training by Deepak Bhagat
Oracle ADF Model Tester wizard appears.
9) Double-click the EmpSqlQuery1 and observe the result with read-only values.
82/454
ADF Essentials Training by Deepak Bhagat
6.3 Creating Updatable Join View Object -*
(Dependent on 4.2)
Create updatable join view object EmpSummaryVO in the bat.model.vo package, based on two
entity objects EmployeesEO and DepartmentsEO.
1) Right-click the bat.model.vo > New > select View Object.
Create View Object wizard appears.
2) On the Name page of the wizard,
a) In the Name field, enter EmpSummaryVO and select Entity radio button (under Data
Source).
b) Click Next.
3) On the Entity Objects page of the wizard,
a) From the Available pane, expand bat.model.eo > select first EmployeesEO and
then DepartmentsEO and shuttle them to Selected pane. (Note Order of selection
is important).
bat
bat
83/454
ADF Essentials Training by Deepak Bhagat
b) In the Selected pane, select DepartmentsEO. Ensure that Association is set to
EmpDeptFkAS.Departments1.
c) Notice that default Join Type is inner join.
d) Change the Join Type to left outer join.
e) Ensure that Updatable check box is NOT checked, and that Reference check box is
checked.
f) Select the EmployeesEO and ensure Updatable checkbox is checked. Click Next.
4) On the Attributes page of the wizard,
a) From Available pane, expand EmployeesEO > select attributes EmployeeId,
FirstName, LastName, Email, PhoneNumber, HireDate, JobId,
bat
bat
bat
bat
84/454
ADF Essentials Training by Deepak Bhagat
CommissionPct, Salary and shuttle them to Selected pane. (Note order of
selection is very important).
b) From Available pane, expand DepartmentsEO > select attributes DepartmentId,
DepartmentName, ManagerId and shuttle them to Selected pane. Click Next till
Application Module page.
5) Do NOT check Add to Application Module checkbox. Click Finish.
6) Save All your work and Make.
85/454
ADF Essentials Training by Deepak Bhagat
6.4 Adding View Object to Existing Application Module -*
(Dependent on 6.6)
Add a view object (EmpSummaryVO) to existing application module (AppModule).
1) Add a view object EmpSummaryVO to AppModuleAM
a) Double-click the AppModuleAM (under bat.model.am) to open in the editor.
b) Click the Data Model page.
c) From Available View Objects pane, select EmpSummaryVO and shuttle it to Data
Model pane (Observer it creates an instance EmpSummary1).
d) Save All.
bat
bat
bat
86/454
ADF Essentials Training by Deepak Bhagat
6.5 Testing View Objects -*
Test view objects and view links by using Oracle ADF Model Tester. <<more elaborate steps req>
1) Right-click the AppModuleAM > select Run.
Oracle ADF Model Tester wizard appears.
2) Test the view link DeptLocVL1 and master detail Locations1-Departments3.
3) Test the updatable view object EmpSummary1.
4) Double-click the EmpSummary1 and traverse through details by clicking icon.
87/454
ADF Essentials Training by Deepak Bhagat
5) Create a new employee and commit.
6) Find/Search this particular employee record.
7) Update this record and commit.
8) Now remove filter/search and get all records.
9) Again, find record and edit details of an employee.
10) Delete record and rollback.
11) Delete record and commit.
12) Now find that record. Verify that it shows empty non- editable fields, as record does not
exist anymore.
13) For EmployeeId 100, change Salary to 240000 and tab out. Observe that there is no
error thrown. Change Salary to 2400000 and observe that error is thrown because
Salary range cannot be more than 6 digits.
14) Observe the format of HireDate is YYYY-MM-DD. Change HireDate to 2023-06-17 and
tab out. Observe that there is no error thrown even though HireDate is greater than
current date.
15) Observe that JobId is not an LOV and displays only the Job Id, not Job Title.
16) Observe that there is no field as Annual Salary.
88/454
ADF Essentials Training by Deepak Bhagat
89/454
ADF Essentials Training by Deepak Bhagat
6.6 Internationalizing through Resource Bundle -o
Internationalize ADF Business Service through resource bundle.
1) Click the Application menu > select Project Properties.
Project Properties wizard appears.
2) Select the Resource Bundle (at left side pane).
3) In the Default Project Bundle Name field, enter bat.model.rb.ModelBundle.
4) Click OK. Click Yes. Save All.
BAT BAT
bat
90/454
ADF Essentials Training by Deepak Bhagat
6.7 Creating Read-Only View Object based on Static List -o
Create a read-only view object CurrencyStaticVO based on Static List.
1) Right-click the bat.model.vo > New > select View Object.
Create View Object wizard appears.
2) On the Name page of the wizard,
a) In the Name field, enter CurrencyStaticVO.
b) Select the Static list radio button (under Data Source).
c) Click Next.
3) On the Attributes page of the wizard,
a) Click the New button.
New View Object Attribute dialog box appears.
b) In the Name field, enter Symbol. Click OK.
4) Follow the same steps, to add new attributes Country and Currency.
bat
91/454
ADF Essentials Training by Deepak Bhagat
5) Click Next. Click Next. (if it prompts dialog box, click No).
6) On the Static List page of the wizard,
a) Click the icon to add values for the Attributes, as shown in below table.
b) Click on empty text boxes and provide values for the Attributes as shown in above
table. Click Next.
7) On the Application Module page of the wizard, check Add to Application Module.
Click Finish. Save All.
8) Right-click the AppModuleAM > select Run.
Oracle ADF Model Tester, wizard appears.
9) Double-click the CurrencyStatic1 and observe the result with static values.
92/454
ADF Essentials Training by Deepak Bhagat
6.8 Creating Multiple Read-Only View Objects at Once -o
Create following multiple read-only view objects at once by using Create Business Components
from Tables.
Tables Read Only View Objects
COUNTRIES CountriesVO
LOCATIONS LocationsVO
REGIONS RegionsVO
1) Right-click the bat.model.vo > New > select Business Components from Tables.
Create Business Components from Tables wizard appears.
2) Click Next till Query-based View Objects page.
3) On the Query-based View Objects page of the wizard,
a) Click the Query button.
b) Select COUNTRIES, LOCATIONS and REGIONS from Available pane and shuttle them
to Selected pane.
c) Click Next till Application Module page.
4) On the Application Module page of the wizard, check Add to Application Module.
Click Finish.
5) Examine the newly generated links CountrRegFkVL and LocCIdFkVL that it is not based
on association unlike others.
6) Right-click the AppModuleAM > select Run.
Oracle ADF Model Tester wizard appears.
7) Double-click the LocCIdFkVL1 and CountrRegFkVL1 and observe the result with read-
only values.
bat
93/454
ADF Essentials Training by Deepak Bhagat
94/454
ADF Essentials Training by Deepak Bhagat
6.9 Creating View Link -o
Manually create a Master-Detail relationship between two view objects (LocationsVO and
DepartmentsVO) using view link (DeptLocVL).
1) Right-click the bat.model.vl > New > select View Link.
Create View Link wizard appears.
2) On the Name page of the wizard, in the Name field enter DeptLocVL. Click Next.
3) On the View Objects page of the wizard,
a) From Select Source Attribute pane, expand bat.model.vo > LocationsVO >
select LocationId and from Select Destination Attribute pane expand
DepartmentsVO > select LocationId.
b) Click the Add button.
c) Click Next. Click Finish. (Note Do NOT check Add to Application Module).
bat
bat
95/454
ADF Essentials Training by Deepak Bhagat
6.10 Adding Child VO to Master VO Through Link in Existing AM -o
(Dependent on 6.9)
Add master view object (LocationsVO) and child view object (DepartmentsVO) via view link
(DeptLocVL) to application module (AppModuleAM). <<Make all other objectives clear>>
1) Open the AppModuleAM in the editor.
2) Click the Data Model page.
3) In the Data Model pane, select Locations1.
4) From Available View Objects pane, expand bat.model.vo > LocationsVO > select
DepartmentsVO via DeptLocVL and shuttle it to Data Model pane.
5) Ensure that child instance Departments3 is created under Location1 in Data Model
pane. Save All.
bat
96/454
ADF Essentials Training by Deepak Bhagat
6.11 Testing View Objects and Link -o
Test view objects and view links by using Oracle ADF Model Tester.
1) Right-click the AppModuleAM > select Run.
Oracle ADF Model Tester wizard appears.
2) Test the view link DeptLocVL1 and master detail Locations1-Departments3.
97/454
ADF Essentials Training by Deepak Bhagat
6.12 Lab Solution
Lab solutions can be found under …BATHandoutsBATLabs-SolutionsBATLab_06
98/454
ADF Essentials Training by Deepak Bhagat
7
Exposing Business Service
through Application Module
In this lab, you create nested application module and add view objects to that application module
which are no longer required.
99/454
ADF Essentials Training by Deepak Bhagat
7.1 Copying Application -o
Make a copy of application BATLab_06 and rename it to BATLab_07. Follow the steps, as
explained in Lab 5.1 or Lab 6.1.
100/454
ADF Essentials Training by Deepak Bhagat
7.2 Creating New Nested Application Module -o
Create new nested application module NestedAM in bat.model.am package.
1) Right-click the bat.model.am > New > select Application Module.
Create Application Module wizard appears.
2) On the Name page of the wizard,
a) In the Name field, enter NestedAM.
b) Click Next.
3) On the Data Model page of the wizard,
a) From the Available View Objects pane (under bat.model.vo), select
CurrencyStaticVO, CountrRegFkVL and LocCIdFkVL and shuttle them to Data
Model pane, under NestedAM.
b) Click Next.
4) On the Application Modules page of the wizard,
a) From the Available pane, select AppModuleAM and shuttle it to Selected pane.
b) Click Next. Click Finish.
bat
bat
bat
bat
101/454
ADF Essentials Training by Deepak Bhagat
5) Open the AppModuleAM in the editor.
6) Click the Data Model page.
a) From the Data Model pane, select and remove Countries1, CurrencyStatic1
and Regions1 object instances by shuttling them back (use back arrow) to
Available View Objects pane.
b) Save All.
7) Run the NestedAM and test.
bat
bat
102/454
ADF Essentials Training by Deepak Bhagat
7.3 Lab Solution
Lab solutions can be found under …BATHandoutsBATLabs-SolutionsBATLab_07
103/454
ADF Essentials Training by Deepak Bhagat
8
Declaratively Customizing
Business Services
In this lab, you make declarative modifications to your business components such as defining
control hints, creating alternate key, populating primary key, adding transient attribute, creating
list of values, creating view criteria and using groovy.
104/454
ADF Essentials Training by Deepak Bhagat
8.1 Copying Application -o
Make a copy of application BATLab_07 and rename it to BATLab_08. Follow the steps, as
explained in Lab 5.1 or Lab 6.1.
105/454
ADF Essentials Training by Deepak Bhagat
8.2 Customizing Entity Objects by Defining Control Hints -*
(Dependent on 4.3)
Customize entity objects (EmployeesEO) by defining control hints.
1) Open the EmployeesEO in the editor.
2) Click the Attributes page.
3) Select the HireDate attribute.
4) Click the UI Hints tab (after the attributes).
a) In the Tooltip field, enter Hire Date,
b) In the Format Type field, select Simple Date,
c) In the Format field, select dd-MMM-yyyy. If it prompts Warning message, click Yes.
d) Save All.
5) Click the Details tab.
a) Select the Expression radio button under Default Value section.
b) Click the Edit expression icon.
Edit Expression Editor wizard appears.
c) In the Expression textbox, enter adf.currentDate.
106/454
ADF Essentials Training by Deepak Bhagat
d) Click OK. Save All.
107/454
ADF Essentials Training by Deepak Bhagat
8.3 Customizing View Object by Adding Transient Attribute -*
(Dependent on 6.6)
Customize view object by adding a new transient attribute.
1) Open the EmpSummaryVO in the editor.
2) Click the Attributes page.
3) Click the icon (to add new attribute) > select New Attribute.
New View Object Attribute dialog box appears.
4) In the Name field enter AnnualSalary, in the Type field select BigDecimal, Click OK.
5) Select the AnualSalary attribute, click UI Hints tab, in the Width field enter 10.
108/454
ADF Essentials Training by Deepak Bhagat
6) Click the Details tab, select Expression radio button under Default Value section, click
Edit expression icon.
Edit Expression Editor wizard appears.
7) In the Expression textbox, enter Salary!=null?Salary*12:null. Click OK. Save All.
109/454
ADF Essentials Training by Deepak Bhagat
8.4 Defining List of Values and Accessors -*
(Dependent on 6.6)
Define list of values and accessors.
1) Open the EmpSummaryVO in the editor.
2) Click the Attributes page.
3) Select the JobId attribute.
4) Click the List of Values tab. Click icon.
Create List of Values wizard appears.
a) In the List Data Source field, select JobsVO1 by clicking icon and selecting
JobsVO from View Accessors dialog box.
b) In the List Attribute field, select JobId from the drop-down.
c) Click the UI Hints tab,
110/454
ADF Essentials Training by Deepak Bhagat
i) In the Default List Type field, select Combo Box with List of Values from
the drop-down
ii) From the Available pane, select JobTitle and shuttle it to Selected pane.
iii) Click OK. Save All.
OR
5) Alternatively, Click the Accessors page and click icon.
View Accessors wizard appears.
a) Add the JobsVO. Click OK. Save All.
6) Go back to Attributes page. Select JobId attribute.
7) Click the List of Values tab and click icon.
Create List of Values wizard appears.
a) In the List Data Source field, select JobsVO1.
bat
bat
111/454
ADF Essentials Training by Deepak Bhagat
b) In the List Attribute field, select JobId.
c) Click the UI Hints tab.
i) In the Default List Type field, select Combo Box with List of Values.
ii) From the Available pane select JobTitle and shuttle it to Selected pane.
d) Click OK.
8) Save All.
9) Click the Accessors page, observe the View Accessors.
10) Run the AppModuleAM and test.
a) Double-click the AppModuleAM > select Run.
Oracle ADF Model Tester wizard appears.
b) Double-click the EmpSummary1.
c) Observe the JobId field shows the list of values with Job Title.
bat
bat
112/454
ADF Essentials Training by Deepak Bhagat
113/454
ADF Essentials Training by Deepak Bhagat
8.5 Creating View Object with Parameterized Where Clause -*
Create view object with Parameterized Where Clause.
1) Right-click the bat.model.vo > New > select View Object.
Create View Object wizard appears.
2) On the Name page of the wizard,
a) Select the Custom SQL query,
b) In the Name field, enter EmpByEmailVO,
c) Click Next.
3) On the Query page of the wizard,
a) Write the query select FIRST_NAME, LAST_NAME, EMAIL from EMPLOYEES where
EMAIL=:p_email.
b) Click Next.
4) On the Bind Variables page of the wizard,
a) Click the New button to add bind variable.
b) In the Name field, enter p_email.
c) Click Next till Attribute Settings page.
5) On the Attribute Settings page of the wizard,
a) Click Next. (If it prompts dialog box click No).
6) On the Application Module page of the wizard,
a) Check the Add to Application Module checkbox.
b) In the Name field, change to AppModuleAM.
7) Click Finish. Save All.
8) Run the AppModuleAM and test.
a) Double-click the AppModuleAM > select Run.
bat
114/454
ADF Essentials Training by Deepak Bhagat
Oracle ADF Model Tester wizard appears.
b) Double-click the EmpByEmail1.
Bind Variables dialog box appears.
c) In the Value field, enter AKHOO. Click OK.
d) It shows FirstName, LastName and Email values in read-only mode.
115/454
ADF Essentials Training by Deepak Bhagat
8.6 Creating and Using Parameterized View Criteria -o
(Dependent on 6.4)
Create two parameterized view criteria’s in EmpSqlQueryVO.
1) Open the EmpSqlQueryVO in the editor.
2) Click the View Criteria page. Click icon under View Criteria section.
Create View Criteria wizard appears.
3) In the Criteria Name field, enter EmpByDeptVC. Click Add Item.
4) In the Definition section,
a) In the Attribute field, select DepartmentId,
b) In the Operator field, select Equals,
c) In the Operand field, select Bind Variable.
d) In the Parameter field, click icon to enter bind variable.
New Variable dialog box appears.
e) In the Name field enter p_deptId, in the Type field select Integer, click OK.
5) Click OK. Saver All.
116/454
ADF Essentials Training by Deepak Bhagat
6) Similarly, create another view criteria named EmpByEmailVC. In the Attribute field select
Email, in the Operator field select Equals, in the Operand field select Bind Variable
and add Parameter as p_email. Click OK. Save All.
7) Run the AppModuleAM and test.
a) Double-click the AppModuleAM > select Run.
Oracle ADF Model Tester wizard appears.
b) Double-click the EmpSqlQuery1.
c) Click the Search icon.
View Criteria wizard appears.
i) From the Available pane select EmpByDeptVC and shuttle it to Selected pane.
ii) Click Find.
iii) Bind Variables dialog box appears.
iv) In the Value field, enter 80. Click OK.
117/454
ADF Essentials Training by Deepak Bhagat
d) It shows the employee details with Department Id 80.
118/454
ADF Essentials Training by Deepak Bhagat
e) Similarly, double-click the EmpSqlQuery1, click the Search icon. Shuttle
EmpByEmailVC. (Move back EmpByDeptVC). Click Find. In the Value field enter
AKHOO. Click OK.
f) It shows the employee details with Email AKHOO.
119/454
ADF Essentials Training by Deepak Bhagat
8.7 Creating Alternate Key Entity Constraints -o
(Dependent on 6.6)
Explore how to create alternate key constraint.
1) Right-click the EmployeesEO > select New Entity Constraint (from context menu).
Create Entity Constraint wizard appears.
2) On the Name page of the wizard, keep default values. Click Next.
3) On the Attributes page of the wizard, from the Available pane, select PhoneNumber and
shuttle it to Selected pane. Click Next.
4) On the Properties page of the wizard, select Alternate radio button (under Key Type
section). Click Cancel (Do NOT Save).
120/454
ADF Essentials Training by Deepak Bhagat
8.8 Declaratively Populating Primary Key with a Database Sequence -o
(Dependent on 6.6)
Declaratively populate primary key with Database sequence.
1) Open the EmployeesEO in the editor.
2) Click the Attributes page.
3) Select the EmployeeId attribute.
4) In the Details tab, in the Type field select DBSequence, in the Sequence Name field
enter EMPLOYEES_SEQ.
5) Do NOT Save. (revert back)
6) Additional advance extended example BATDBSequenceEg may be found under
...BATXtEg-ProprietaryL08-BATXtEg-DeclCustomization.
121/454
ADF Essentials Training by Deepak Bhagat
8.9 Lab Solution
Lab solutions can be found under …BATHandoutsBATLabs-SolutionsBATLab_08.
122/454
ADF Essentials Training by Deepak Bhagat
8.10 References for Groovy -o
1) Groovy Language, guides, examples: http://groovy.codehaus.org
2) …BATDocs-TrainingReferenceL08-BAT Introduction to Groovy.pdf
3) http://www.oracle.com/technetwork/developer-tools/jdev/introduction-to-groovy-128837.pdf
123/454
ADF Essentials Training by Deepak Bhagat
8.11 Defining Dependent List of Values (LOV) -x
Create a new application, displaying Locations containing Country LOV and State Province LOV,
where State Province LOV is dependent on Country LOV. This would demonstrate that State
Province LOV is dependent on Country LOV and hence called Dependent LOV.
This topic is part of advance ADF extended example (BATDependentLOV-Eg) may be found
under …BATHandoutsBATXtEg-ProprietaryL08-BATXtEg-DeclCustomization.
For hands-on practice, please refer to Deepak Bhagat’s Blog at
https://cloudadfdeepakb.blogspot.com or download from the above location. It's a lab sample on
creating dependent or cascading List of Values (LOV).
124/454
ADF Essentials Training by Deepak Bhagat
8.12 View Criteria using Custom Operator -d
This topic is part of the Advance ADF extended example, taken from the web. For optional self-
paced hands-on practice, it may be further downloaded from
…BATHandoutsOADFXtEg-DownloadedL08-ADFXtEg-DeclCustomization.
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices
Oracle ADF Hands-on Lab Practices

More Related Content

Similar to Oracle ADF Hands-on Lab Practices

AppSys-SDM Concepts and Practices_v0-02
AppSys-SDM Concepts and Practices_v0-02AppSys-SDM Concepts and Practices_v0-02
AppSys-SDM Concepts and Practices_v0-02
Raymond Wong
 
FRG_P4_Final_Project_Report_Modifications_to_edX_platform
FRG_P4_Final_Project_Report_Modifications_to_edX_platformFRG_P4_Final_Project_Report_Modifications_to_edX_platform
FRG_P4_Final_Project_Report_Modifications_to_edX_platform
Kripal Gaurav
 
FRG_P4_Final_Project_Report_Modifications_to_edX_platform
FRG_P4_Final_Project_Report_Modifications_to_edX_platformFRG_P4_Final_Project_Report_Modifications_to_edX_platform
FRG_P4_Final_Project_Report_Modifications_to_edX_platform
Pushkar Narayan
 
Shariar Rostami - Master Thesis
Shariar Rostami - Master ThesisShariar Rostami - Master Thesis
Shariar Rostami - Master Thesis
shahriar-ro
 
EMC NetWorker Module for Microsoft SQL Server Administrators ...
EMC NetWorker Module for Microsoft SQL Server Administrators ...EMC NetWorker Module for Microsoft SQL Server Administrators ...
EMC NetWorker Module for Microsoft SQL Server Administrators ...
webhostingguy
 
bkremer-report-final
bkremer-report-finalbkremer-report-final
bkremer-report-final
Ben Kremer
 
Mohan_Dissertation (1)
Mohan_Dissertation (1)Mohan_Dissertation (1)
Mohan_Dissertation (1)
Mohan Bhargav
 
15884086 Oracle Developer Build Forms I
15884086 Oracle Developer Build Forms I15884086 Oracle Developer Build Forms I
15884086 Oracle Developer Build Forms I
MadhuriR
 

Similar to Oracle ADF Hands-on Lab Practices (20)

AppSys-SDM Concepts and Practices_v0-02
AppSys-SDM Concepts and Practices_v0-02AppSys-SDM Concepts and Practices_v0-02
AppSys-SDM Concepts and Practices_v0-02
 
Book hudson
Book hudsonBook hudson
Book hudson
 
Oracle applications developer’s guide
Oracle applications developer’s guideOracle applications developer’s guide
Oracle applications developer’s guide
 
FRG_P4_Final_Project_Report_Modifications_to_edX_platform
FRG_P4_Final_Project_Report_Modifications_to_edX_platformFRG_P4_Final_Project_Report_Modifications_to_edX_platform
FRG_P4_Final_Project_Report_Modifications_to_edX_platform
 
FRG_P4_Final_Project_Report_Modifications_to_edX_platform
FRG_P4_Final_Project_Report_Modifications_to_edX_platformFRG_P4_Final_Project_Report_Modifications_to_edX_platform
FRG_P4_Final_Project_Report_Modifications_to_edX_platform
 
RAC Attack 12c Installation Instruction
RAC Attack 12c Installation InstructionRAC Attack 12c Installation Instruction
RAC Attack 12c Installation Instruction
 
Open edX Building and Running a Course
Open edX Building and Running a CourseOpen edX Building and Running a Course
Open edX Building and Running a Course
 
Shariar Rostami - Master Thesis
Shariar Rostami - Master ThesisShariar Rostami - Master Thesis
Shariar Rostami - Master Thesis
 
Db2 deployment guide
Db2 deployment guideDb2 deployment guide
Db2 deployment guide
 
web_based_ide
web_based_ideweb_based_ide
web_based_ide
 
EMC NetWorker Module for Microsoft SQL Server Administrators ...
EMC NetWorker Module for Microsoft SQL Server Administrators ...EMC NetWorker Module for Microsoft SQL Server Administrators ...
EMC NetWorker Module for Microsoft SQL Server Administrators ...
 
Thesis klausi
Thesis klausiThesis klausi
Thesis klausi
 
DBMS_Lab_Manual_&_Solution
DBMS_Lab_Manual_&_SolutionDBMS_Lab_Manual_&_Solution
DBMS_Lab_Manual_&_Solution
 
Own cloud manual
Own cloud manualOwn cloud manual
Own cloud manual
 
Getting started with entity framework 6 code first using mvc 5
Getting started with entity framework 6 code first using mvc 5Getting started with entity framework 6 code first using mvc 5
Getting started with entity framework 6 code first using mvc 5
 
bkremer-report-final
bkremer-report-finalbkremer-report-final
bkremer-report-final
 
Mohan_Dissertation (1)
Mohan_Dissertation (1)Mohan_Dissertation (1)
Mohan_Dissertation (1)
 
15884086 Oracle Developer Build Forms I
15884086 Oracle Developer Build Forms I15884086 Oracle Developer Build Forms I
15884086 Oracle Developer Build Forms I
 
Work flow api reference
Work flow api referenceWork flow api reference
Work flow api reference
 
Patterns: Implementing an SOA using an enterprise service bus (ESB)
Patterns: Implementing an SOA using an enterprise service bus (ESB)Patterns: Implementing an SOA using an enterprise service bus (ESB)
Patterns: Implementing an SOA using an enterprise service bus (ESB)
 

Recently uploaded

Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 

Recently uploaded (20)

%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - Keynote
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 

Oracle ADF Hands-on Lab Practices

  • 1. Author: Deepak Bhagat Fusion Functional Consultant, Solution Architect & ADF Corporate Trainer Free Downloadable Course material: GDrive Link Deepak Bhagat’s Oracle ADF Blogs Develop Rich Web Applications with ADF 12c Essentials Hands-on Lab Practices
  • 2. Develop Rich Web Application with ADF 12c Essentials – Hands-on Lab Practices i ADF Essentials Training by Deepak Bhagat Table of Contents 1 Overview of Fusion Middleware and ADF ..............................................................1 1.1 System Requirements for ADF Training -* ......................................................2 1.2 Oracle Technology Resource Account Login -*................................................3 1.3 Downloading and Installing Oracle XE Database -* .........................................4 1.4 Downloading and Installing JDeveloper -*......................................................5 1.5 Unlocking HR Schema -*...............................................................................9 1.6 Entity Relation Diagram of HR System -*......................................................11 1.7 Working with JDev IDE Configuration Files -o ...............................................13 1.8 Java for Beginners -o ..................................................................................14 1.9 References -o.............................................................................................15 1.10 Grouping of Hands-on Lab Practices -* ........................................................16 1.11 Important Abbreviation and Information -* ..................................................17 1.12 Downloading Training Materials -*...............................................................18 1.13 Important to go through after the training -o ...............................................19 2 Understanding Development Tool: JDeveloper....................................................20 2.1 Creating a New Fusion Application and Project -* .........................................21 2.2 Creating a New Database Connection and Initialize the Project -*..................25 2.3 Adding ADF Business Components and ADF Faces -* ....................................27 2.4 Exploring JDeveloper and New Application -* ...............................................33 2.5 Exploring Windows of JDeveloper -* ............................................................34 2.6 Working with Windows -*............................................................................35 2.7 Taking Help using F1 key -* ........................................................................36 2.8 Refactoring JDeveloper Artifacts -* ..............................................................37 2.9 Setting IDE Preferences -* ..........................................................................39 2.10 Setting Package Levels -*............................................................................41 2.11 Lab Solution ...............................................................................................42 3 Modeling Database Schema...............................................................................43 3.1 Copying Application -o ................................................................................44
  • 3. Develop Rich Web Application with ADF 12c Essentials – Hands-on Lab Practices ii ADF Essentials Training by Deepak Bhagat 3.2 Exploring HR System ER Diagram -* ............................................................45 3.3 Examining Training Lab Application – Lab Solution 22 -*...............................46 3.4 Creating an Offline Database Diagram with Existing Schema Objects-o ..........47 3.5 Adding New Offline Database Schema Objects -o .........................................49 3.6 Generating the SQL Scripts -o......................................................................51 3.7 Running the SQL Scripts on Database -o ......................................................55 3.8 Invoking PLSQL -x ......................................................................................56 4 Building Business Services with Default Business Components .............................57 4.1 Creating another New Application and Projects -*.........................................58 4.2 Creating Default ADF Business Components -* .............................................59 4.3 Examining Generated ADF Business Components Artifacts -*.........................62 4.4 Testing the Business Service (using Oracle ADF Model Tester) -* ..................63 4.5 Lab Solution ...............................................................................................64 5 Persisting Data Using Entity Objects...................................................................65 5.1 Copying Application -o ................................................................................66 5.2 Creating Multiple Entity Objects at Once -*...................................................67 5.3 Creating an Association -*...........................................................................68 5.4 Examining Attribute Settings -* ...................................................................69 5.5 Creating Entity Object based on Database View -o........................................71 5.6 Synchronizing an Entity Object with Table Structure Changes -o....................74 5.7 Lab Solution ...............................................................................................75 5.8 Applying Property Set -d .............................................................................76 6 Querying Data Using View Objects.....................................................................77 6.1 Copying Application -o ................................................................................78 6.2 Creating Read-Only View Object based on SQL Query -*...............................79 6.3 Creating Updatable Join View Object -*........................................................82 6.4 Adding View Object to Existing Application Module -* ...................................85 6.5 Testing View Objects -* ..............................................................................86 6.6 Internationalizing through Resource Bundle -o..............................................89
  • 4. Develop Rich Web Application with ADF 12c Essentials – Hands-on Lab Practices iii ADF Essentials Training by Deepak Bhagat 6.7 Creating Read-Only View Object based on Static List -o ................................90 6.8 Creating Multiple Read-Only View Objects at Once -o....................................92 6.9 Creating View Link -o..................................................................................94 6.10 Adding Child VO to Master VO Through Link in Existing AM -o .......................95 6.11 Testing View Objects and Link -o.................................................................96 6.12 Lab Solution ...............................................................................................97 7 Exposing Business Service through Application Module........................................98 7.1 Copying Application -o ................................................................................99 7.2 Creating New Nested Application Module -o................................................100 7.3 Lab Solution .............................................................................................102 8 Declaratively Customizing Business Services .....................................................103 8.1 Copying Application -o ..............................................................................104 8.2 Customizing Entity Objects by Defining Control Hints -* ..............................105 8.3 Customizing View Object by Adding Transient Attribute -*...........................107 8.4 Defining List of Values and Accessors -*.....................................................109 8.5 Creating View Object with Parameterized Where Clause -*..........................113 8.6 Creating and Using Parameterized View Criteria -o......................................115 8.7 Creating Alternate Key Entity Constraints -o ...............................................119 8.8 Declaratively Populating Primary Key with a Database Sequence -o .............120 8.9 Lab Solution .............................................................................................121 8.10 References for Groovy -o ..........................................................................122 8.11 Defining Dependent List of Values (LOV) -x................................................123 8.12 View Criteria using Custom Operator -d......................................................124 9 Validating in Business Services.........................................................................125 9.1 Copying Application -o ..............................................................................126 9.2 Adding Declarative Validation: Range Validator -*.......................................127 9.3 Generating Java Files for Entity Objects -* .................................................129 9.4 Adding Method Validator -* .......................................................................131 9.5 Adding Declarative Validation: Unique Key Validator -o ...............................134
  • 5. Develop Rich Web Application with ADF 12c Essentials – Hands-on Lab Practices iv ADF Essentials Training by Deepak Bhagat 9.6 Lab Solution .............................................................................................137 9.7 Adding Domain Validator -x.......................................................................138 9.8 Demonstrate Various Types of Validations -d..............................................139 10 Introducing User Interface Technologies .......................................................140 10.1 Running, Exploring and Familiarizing Lab 20 Application -*..........................141 11 Getting Started with User Interface and UI Components ................................149 11.1 Creating New Application with only ViewController Project -* ......................150 11.2 Setting Up the UI Project for Internationalization -*....................................152 11.3 Setting Up the Skin Preference -* ..............................................................153 11.4 Lab Solution .............................................................................................154 11.5 ADF Faces Rich Client Components -d........................................................155 12 Planning Pages using Layout Components.....................................................156 12.1 Copying Application -o ..............................................................................157 12.2 Creating New JSF Page -* .........................................................................158 12.3 Adding Default Layout Components -* .......................................................159 12.4 Customizing Layout Components -* ...........................................................163 12.5 Lab Solution .............................................................................................165 13 Designing User Interfaces and Page Flows ....................................................166 13.1 Copying Application -o ..............................................................................167 13.2 Creating Bounded Task Flows and Add View Activities -* ............................168 13.3 Creating New Page Fragments -*...............................................................169 13.4 Adding Task Flow Call Activities -* .............................................................171 13.5 Adding Return Activities -* ........................................................................172 13.6 Using Bounded Task Flows as a Region on a page -*..................................173 13.7 Creating Bounded Task Flow without Fragments -o.....................................175 13.8 Converting Bounded Task Flows to Use Page Fragments -o.........................176 13.9 Using Unbounded Task Flow with View and Control Flow Activities -o ..........177 13.10 Extracting Part of Task Flow -o..................................................................179 13.11 Lab Solution .............................................................................................181
  • 6. Develop Rich Web Application with ADF 12c Essentials – Hands-on Lab Practices v ADF Essentials Training by Deepak Bhagat 13.12 Using URL View Activity -d ........................................................................182 14 Interactively Controlling with Navigation Components ....................................183 14.1 Copying Application -o ..............................................................................184 14.2 Adding Links and Buttons for Navigation -* ................................................185 14.3 Using Menu and Menu Items -*.................................................................191 14.4 Assigning Internationalization and Accessibility -o.......................................193 14.5 Using BreadCrumbs -o ..............................................................................195 14.6 Using Popup Dialog -o...............................................................................197 14.7 Defining Sequence of Steps (Train) and Use Wild Card Activity -o................199 14.8 Lab Solution .............................................................................................204 15 Ensuring Reusability in Web Applications.......................................................205 15.1 Copying Application -o ..............................................................................206 15.2 Creating and Using Reusable Component -* ...............................................207 15.3 Creating Page Templates -o ......................................................................212 15.4 Applying Template to Existing Page Fragments -o.......................................216 15.5 Creating a New Header Template -o ..........................................................218 15.6 Applying Template to Existing Page -o .......................................................221 15.7 Creating a New Page with Template -o ......................................................222 15.8 Adding Panel Springboard Component -o ...................................................224 15.9 Converting JSPX to Facelets -o ..................................................................226 15.10 Refactoring Page and Page Definition File -o ..............................................229 15.11 Lab Solution .............................................................................................231 15.12 Bind Custom Declarative Components to ADF -d.........................................232 16 Working with Parameters, Scopes and Partial Page Refresh (PSP)...................233 16.1 Copying BATLab_16-PSP from Solution -o ..................................................234 16.2 Implementing Set Action Listener, Scopes and Partial Page Refresh -o.........235 16.3 Setting Conditional Display -o....................................................................236 16.4 Defining Task Flow Parameters -o..............................................................238 16.5 Defining Regions Parameters -o.................................................................239
  • 7. Develop Rich Web Application with ADF 12c Essentials – Hands-on Lab Practices vi ADF Essentials Training by Deepak Bhagat 16.6 Using Refresh Property in PageDef -o ........................................................240 16.7 Lab Solution .............................................................................................241 17 Responding to Managed Beans, Events and Listeners.....................................242 17.1 Creating new Application BATLab_17 with ViewController Project -* ............243 17.2 Creating Managed Bean -* ........................................................................245 17.3 Creating Action Listener and Adding Method Binding -*...............................251 17.4 Creating Value Change Listener -*.............................................................252 17.5 Adding Phase Listener -o...........................................................................253 17.6 Adding Validator -o ...................................................................................255 17.7 Adding Converter -o..................................................................................256 17.8 Lab Solution .............................................................................................257 18 Binding Model Layer with Business Services and Databound View ...................258 18.1 Copying Application -o ..............................................................................259 18.2 Creating a Read Only ADF Tables with Row Selection -* .............................260 18.3 Customizing Data and UI Components -o ...................................................264 18.4 Creating a Detail Forms -o.........................................................................270 18.5 Making a Table Non-Selectable -o..............................................................272 18.6 Using setCurrentRowWithKey -o ................................................................274 18.7 Using setCurrentRowWithKeyValue -o ........................................................277 18.8 Creating a Graph Component -o ................................................................280 18.9 Creating a Read Only Tree -o ....................................................................283 18.10 Lab Solution .............................................................................................287 18.11 More ADF Data-bound Components -d .......................................................288 19 Querying Data with Search Components .......................................................289 19.1 Copying Application -o ..............................................................................290 19.2 Adding Query Search and Result -*............................................................291 19.3 Customizing Query Search and Result -o....................................................295 19.4 Adding Quick Search -o.............................................................................296 19.5 Lab Solution .............................................................................................299
  • 8. Develop Rich Web Application with ADF 12c Essentials – Hands-on Lab Practices vii ADF Essentials Training by Deepak Bhagat 20 Implementing Transactions ..........................................................................300 20.1 Copying Application -o ..............................................................................301 20.2 Implementing Create Operation -*.............................................................302 20.3 Implementing Delete Operation and Creating Helper Method -* ..................310 20.4 Implementing Update Operation -o............................................................313 20.5 Lab Solution .............................................................................................316 20.6 More ADF Transaction Management -d.......................................................317 21 Understanding Data Controls and Bindings ....................................................318 21.1 Examining the Page’s Data Bindings -*.......................................................319 22 Programmatically Customizing Business Services ...........................................321 22.1 Copying Application -* ..............................................................................322 22.2 Migrating Project to Another Application -*.................................................323 22.3 Prog Custz EO: Including Override Method -*.............................................325 22.4 Prog Custz EO: Overriding Method -*.........................................................327 22.5 Programmatically Assigning a Database Sequence -* ..................................329 22.6 Prog Custz AM: Adding and Exposing Service Methods -*............................330 22.7 Prog Custz VO: Default Parameterized Where Clause -* ..............................334 22.8 Prog Custz VO: Default Parameterized View Criteria -o................................335 22.9 Prog Custz VO: Dynamic Parameterized Where Clause -o............................336 22.10 Prog Custz VO: Dynamic Parameterized View Criteria -o..............................337 22.11 Prog Custz VO: Resetting -o ......................................................................338 22.12 Prog Custz VO: CRUD Operation: Creating -o .............................................339 22.13 Prog Custz VO: CRUD Operation: Reading and findByPrimaryKey -o.............340 22.14 Prog Custz VO: CRUD Operation: Deleting and findByKey -o........................341 22.15 Testing Exposed Service Methods using ADF Model Tester -o ......................342 22.16 Creating and Running Test Clients -o .........................................................343 22.17 Calling Service Method from MVC Layer -o .................................................345 22.18 Lab Solution .............................................................................................348 23 Deploying ADF Applications ..........................................................................349
  • 9. Develop Rich Web Application with ADF 12c Essentials – Hands-on Lab Practices viii ADF Essentials Training by Deepak Bhagat 23.1 Copying Application -o ..............................................................................350 23.2 Creating a Business Service Deployment Profile -*......................................351 23.3 Creating a Web Module Deployment Profile -*............................................353 23.4 Creating an Application Deployment Profile -* ............................................355 23.5 Starting Integrated Weblogic Server -* ......................................................358 23.6 Deploying the Application from JDeveloper -*.............................................359 23.7 Running the Application -* ........................................................................360 23.8 Undeploying the Application -* ..................................................................361 23.9 Lab Solution .............................................................................................364 24 Securing ADF Applications ............................................................................365 24.1 Copying Application -o ..............................................................................366 24.2 Configuring the Application to use ADF Security -o......................................367 24.3 Defining Users in the Identity Store -o .......................................................369 24.4 Defining Application Roles -o .....................................................................370 24.5 Implementing Security on Task Flows and Pages -o....................................372 24.6 Testing Application Authentication and Authorization -o ..............................374 24.7 Lab Solution .............................................................................................375 24.8 ADF Basic Authentication -d ......................................................................376 25 Debugging and Troubleshooting ADF Applications..........................................377 25.1 Copying Solution -*...................................................................................378 25.2 Discovering Application Problems -*...........................................................379 25.3 Setting Breakpoints in the Debugger -*......................................................380 25.4 Running Application Module in Debug Mode -* ...........................................383 26 Best Practices ..............................................................................................390 27 Miscellaneous Topics....................................................................................391 27.1 Real-time End-to-end ADF Application -d....................................................392 28 Advance Topics............................................................................................393 28.1 UI and Page Flow Design ..........................................................................394 28.2 List of Existing Features ............................................................................395
  • 10. Develop Rich Web Application with ADF 12c Essentials – Hands-on Lab Practices ix ADF Essentials Training by Deepak Bhagat 28.3 Adding Custom View Criteria .....................................................................396 28.4 Traversing, Creating and Deleting Master-Detail .........................................397 28.5 Creating an Application Module Base Class .................................................398 28.6 Programmatically Calling EL, Scopes and Conditional Display.......................399 28.7 Adding Router Activity...............................................................................400 28.8 Programmatically Handling Confirm Dialog .................................................401 28.9 Programmatically Invoking Popup..............................................................402 28.10 Programmatically Closing Popup ................................................................403 28.11 Rendering Dynamic Region........................................................................404 28.12 Adding Context Menu................................................................................405 28.13 Creating Data Control Method from Backing Bean.......................................406 28.14 Contextual Events.....................................................................................407 28.15 Publishing Contextual Event ......................................................................408 28.16 Subscribing and Handling Contextual Event to Region.................................409 28.17 Subscribing and Handling Contextual Event to Page....................................410 28.18 Programmatically Adding Partial Page Refresh ............................................411 28.19 Programmatically Handling UI Create Transaction.......................................412 28.20 Programmatically Handling UI Delete Transaction.......................................413 28.21 Lab Solution .............................................................................................414 28.22 Advance ADF Extended Examples -x ..........................................................415 28.23 Entity-Level Triggers -d.............................................................................416 29 Integrating ADF with Web Service ...............................................................417 29.1 Creating REST Web Service with ADF Business Service ...............................418 29.2 Creating SOAP Web Service with ADF Business Service ...............................422 29.3 Consuming REST Web Service (ADF) .........................................................425 29.4 Consuming REST Web Service (Generic) ....................................................427 29.5 Consuming SOAP Web Service...................................................................429 29.6 Advance ADF Extended Examples -x ..........................................................431 29.7 More Examples on ADF Integration with Web Services -d............................432
  • 11. Develop Rich Web Application with ADF 12c Essentials – Hands-on Lab Practices x ADF Essentials Training by Deepak Bhagat 30 Integrating ADF with Enterprise Java Bean (EJB).........................................433 30.1 Consuming EJB Data Control .....................................................................434 30.2 Advance ADF Extended Example -x............................................................435 30.3 More Examples on Consuming EJB Data Control -d .....................................436 31 Integrating ADF with Service Orientated Architecture (SOA).........................437 31.1 Integrating SOA........................................................................................438 31.2 Advance ADF Extended Example -x............................................................440 31.3 More Examples on Integrating Oracle SOA with ADF -d...............................441 32 Integrating ADF with Mobile Application Framework (MAF)...........................442 32.1 Mobile Application Framework (MAF) .........................................................443 32.2 Advance ADF Extended Example -x............................................................453 32.3 More Examples on Integrating Oracle MAF with ADF -d...............................454 Free Downloadable Course material: GDrive Link Deepak Bhagat’s Oracle ADF Blogs: www.cloudadfdeepakb.blogspot.com
  • 12. Develop Rich Web Application with ADF 12c Essentials – Hands-on Lab Practices 1/465 ADF Essentials Training by Deepak Bhagat 1 Overview of Fusion Middleware and ADF For detail information refer handout “…BATHandoutsBATDocs- PreTrainingMaterialBAT ADF Hands-on Lab Setup Guide.pdf”. Download all Oracle ADF training documents and lab solutions, from shared folders on Google GDrive shared by the trainer. Unzip all lab solutions. These training materials consist of study guides, hands-on lab practices, reference guides, bookmarks, downloaded materials, extended samples, demos, books, tutorials, etc. This Hands-on Lab Practices is a beta version.
  • 13. 2/454 ADF Essentials Training by Deepak Bhagat 1.1 System Requirements for ADF Training -* 1) Personal laptop with admin access (Logged in user must be an Admin) 2) Software versions and requirements on your personal laptop, for ADF Training: Requirements Recommended Minimum Value RAM 4 GB of RAM (Preferably 8 GB). (I use 16 GB). Display 1024 X 768 resolution or more. Prefer extra extended large monitor, to attend lecture and lab simultaneously. Hard Drive Space 10+ GB OS MS Windows 8+, Linux Java JDK 1.7 Update 15+ Oracle XE Database 11.2.0.2.0 ADF, JDeveloper and Fusion Middleware (12c) 12.2.1.0.0 (not latest) (Do NOT use 12.2.1.1.0 or later) Oracle Technology Resource Account https://www.oracle.com/technical-resources -> View Accounts -> Oracle Account -> Sign-In
  • 14. 3/454 ADF Essentials Training by Deepak Bhagat 1.2 Oracle Technology Resource Account Login -* Login to your Oracle Resource account. Create one if necessary. The URL is https://www.oracle.com/technical-resources -> View Accounts -> Oracle Account -> Sign-In.
  • 15. 4/454 ADF Essentials Training by Deepak Bhagat 1.3 Downloading and Installing Oracle XE Database -* 1) Link to download latest Oracle XE 11gR2 database: a) https://download.oracle.com/otn/nt/oracle11g/xe/OracleXE112_Win64.zip or b) https://www.oracle.com/database/technologies/xe-prior-releases.html or c) copy an executable file from someone who has already downloaded. 2) Links for installing Oracle XE Database: http://docs.oracle.com/cd/E17781_01/install.112/e18803/toc.htm#XEINW123 While Installing Oracle DB it will ask for system (SYS or SYSTEM) password. So, enter a password and save it for later use. Example sysadmin (used for this lab). 3) Links for starting Oracle XE Database: http://docs.oracle.com/cd/E17781_01/install.112/e18803/toc.htm#XEINW133
  • 16. 5/454 ADF Essentials Training by Deepak Bhagat 1.4 Downloading and Installing JDeveloper -* 1) Link to download JDeveloper 12.2.1.0.0: https://www.oracle.com/tools/downloads/jdev-v12210-downloads.html. 2) Links for installing JDeveloper: https://docs.oracle.com/middleware/1221/jdev/install/GUID-311BD061-083E-403A-8FE7- 4D78EEAFCB45.htm#OJDIG114 3) Unzip jdev_suite_122100_win64-2.zip. 4) Right-click on jdev_suite_122100_win64.exe file and select Run as Administrator. Click Yes. Oracle JDeveloper Studio Installation wizard appears. 5) On the Welcome page of the wizard, click Next. 6) On the Auto Updates page of the wizard, ensure Skip Auto Updates is selected and click Next. 7) On the Installation Location page of the wizard, in the Oracle Home field, change the path to C:OracleMiddleware122100. 8) Click Next. Click Next. 9) On the Installation Summary page of the wizard, click Install. 10) On the Installation Progress page of the wizard, after installation is completed, click Next. 11) On the Installation Complete page of the wizard, a) select Customize Settings and Then Start JDeveloper. b) Click Finish. Note: Do NOT miss this Important Step. See image below.
  • 17. 6/454 ADF Essentials Training by Deepak Bhagat 12) Oracle JDeveloper Studio Settings wizard appears. a) In the Default User Directory field, enter D:<<User>>.jdeveloper. b) In the JDeveloper Work Directory field, enter D:<<User>>BATJDev122100. Click OK. 13) Links for starting JDeveloper: https://docs.oracle.com/middleware/1221/jdev/install/GUID-533986A2-EF19-44B3- B2BA-7090DB6F8891.htm#OJDIG129 14) After installing the JDeveloper run the Weblogic Server by clicking Run > Start Server Instance (as shown in below image) and giving the password as weblogic1 (as shown in below image) and test whether it is running successful or not. D:Deepak-PC.jdeveloper D:Deepak-PCBATJDev122100
  • 18. 7/454 ADF Essentials Training by Deepak Bhagat 15) To start JDeveloper, click on the Start menu > Oracle > Oracle JDeveloper Studio, or double-click on the desktop shortcut .
  • 19. 8/454 ADF Essentials Training by Deepak Bhagat
  • 20. 9/454 ADF Essentials Training by Deepak Bhagat 1.5 Unlocking HR Schema -* 1) After Installing Oracle XE, you can access ‘system’ schema but not ‘hr’ schema. ‘hr’ schema comes along with Oracle XE database, but locked. To unlock ‘hr’ schema from database to grant permission to the users to utilize this schema, follow below steps. a) Click Start > expand Oracle Database 11g Express Edition > select Run SQL Command Line. Run SQL Command Line editor opens. b) In the editor, enter connect; command c) Enter the user name and password for the ‘system’ Enter user-name: system (case insensitive) Enter password: sysadmin (case sensitive) d) Enter the following command to unlock the ‘hr’ Schema SQL> ALTER USER HR IDENTIFIED by hr ACCOUNT UNLOCK; e) Exit from the editor by giving command “exit” or by closing directly. f) Now login with ‘hr’ user and password User Name: hr (case insensitive) Password: hr (case sensitive) g) Now you can use all tables specified in tutorial. h) Unlocking the HR Schema OR 2) Alternatively, you can also unlock ‘hr’ Schema from JDeveloper as follows a) Once you are connected as system, expand the tree in the connection panel as Connections->SYSTEM->Other Users b) Right-click on HR to access the Edit User dialog.
  • 21. 10/454 ADF Essentials Training by Deepak Bhagat c) Within the dialog, simply uncheck the box entitled Account is Locked and click Apply. d) After completing this process, you should now have a fully functional Oracle XE database with the example HR schema unlocked.
  • 22. 11/454 ADF Essentials Training by Deepak Bhagat 1.6 Entity Relation Diagram of HR System -*
  • 23. 12/454 ADF Essentials Training by Deepak Bhagat
  • 24. 13/454 ADF Essentials Training by Deepak Bhagat 1.7 Working with JDev IDE Configuration Files -o 1) The locations from where you can start JDeveloper apart from the shortcuts are: a) MW_HOMEjdeveloperjdeveloper.exe b) MW_HOMEjdeveloperjdevbinjdevw.exe c) MW_HOMEjdeveloperjdevbinjdev.exe The first two options have the same purpose. The last option will open along with a console for diagnostic purposes. Example of MW_HOME is C:OracleMiddleware122100. 2) An alternate way for this is to set the JDEV_USER_DIR environment variable that points to the user's current working directory. JDEV_USER_HOME and JDEV_USER_DIR are the variables that are listed in the MW_HOMEjdeveloperjdevbinjdev.boot file. JDeveloper will look up these variables on startup to set the user's directory. For example: set JDEV_USER_HOME=C:Users<<User>>AppDataRoamingJDeveloper set JDEV_USER_DIR=D:<<User>>BATJDev122100mywork 3) Location of IDE configuration files: a) MW_HOMEjdeveloperidebinide.conf b) MW_HOMEjdeveloperjdevbinjdev.conf 4) Location of IDE boot files: a) MW_HOMEjdeveloperidebinide.boot b) MW_HOMEjdeveloperjdevbinjdev.boot
  • 25. 14/454 ADF Essentials Training by Deepak Bhagat 1.8 Java for Beginners -o Following links are limited Java necessary for ADF. Those moving to ADF from non-Java background may find these sufficient to learn Java. 1) http://www.javatpoint.com/simple-program-of-java 2) http://www.javatpoint.com/variable-datatype 3) http://www.javatpoint.com/operators-in-java 4) http://www.javatpoint.com/object-and-class-in-java 5) http://www.javatpoint.com/constructor 6) http://www.javatpoint.com/static-keyword-in-java 7) http://www.javatpoint.com/this-keyword 8) http://www.javatpoint.com/interface-in-java 9) http://www.javatpoint.com/access-modifiers 10) http://www.javatpoint.com/package
  • 26. 15/454 ADF Essentials Training by Deepak Bhagat 1.9 References -o 1) JDeveloper and ADF Release 12.2.1.0.0: https://www.oracle.com/tools/downloads/jdev-v12210-downloads.html 2) JDeveloper and ADF Latest Release, Technical Resources & Learn more: https://www.oracle.com/application-development/technologies/jdeveloper.html 3) ADF Homepage: https://www.oracle.com/database/technologies/developer-tools/adf/ 4) Step by Step Building Simple Demo Application with ADF: a) http://docs.oracle.com/cd/E53569_01/tutorials/tut_rich_app/tut_rich_app.html b) http://docs.oracle.com/cd/E53569_01/tutorials/tut_rich_app_alta/tut_rich_app_alta_ 1.html 5) ADF Faces Rich Component Demos: https://docs.oracle.com/middleware/1221/adf/develop-faces/GUID-EE22FD96-2723-4F07- 95A9-04931E42C365.htm 6) ADF Code Corner: https://www.oracle.com/application-development/technologies/adf/codecorner.html 7) ADF Forums: https://community.oracle.com/community/java/java_development_tools/application_devel opment_in_java/jdeveloper_and_adf
  • 27. 16/454 ADF Essentials Training by Deepak Bhagat 1.10 Grouping of Hands-on Lab Practices -* 1) There is no Lab 01, Lab 10 and Lab 21. 2) Lab 02, Lab 16, Lab 17 and Lab 25 are independent Lab practices and are not dependent on any other Lab. 3) Lab 02, Lab 04, Lab 11, Lab 16, Lab 17, Lab 25 are new starter Labs. 4) Lab 04 continues to Lab 09 and has practices on ADF BC. Later Lab 09 merges with Lab 22 into one Application. 5) Lab 11 continues to Lab 24 (excluding Lab 16, Lab 17). Later Lab 15 adds Lab 09 as ADF Model Library. 6) Lab 20, Lab 24 and Lab 28 are full applications like real-time project. 7) To get a feel of lab objectives and practices, run Lab 20 or Lab 22.
  • 28. 17/454 ADF Essentials Training by Deepak Bhagat 1.11 Important Abbreviation and Information -* Some of the abbreviations used in this documents are: 1) BAT stands for Bhagat’s (or Bright Wave’s) ADF Training. 2) Lxx where xx is a numeric value. L stands for Lab or Lesson. L04 means Lab04 or Lesson04. 3) -* are Hands-on Labs you must practice. 4) -o are optional example(s), as Advance ADF topics for self-paced Hands-on practice. 5) -x are extended example(s), as Advance ADF topics for self-paced Hands-on practice, provided separately under folder …BATHandoutsBATXtEg-Proprietary. These examples may also be found in my blog at https://cloudadfdeepakb.blogspot.com. 6) -d is downloaded examples from web, as Advance ADF topics for self-paced hands-on practice, provided separately under folder …BATHandoutsOADFXtEg-Downloaded. Important Information: 1) The labs marked with –o, -x and –d are extended example(s), as Advance ADF topics for optional self-paced Hands-on practice. 2) Some images may have the word AAT instead of BAT and aat instead of bat. Please read/replace them as BAT and bat respectively. 3) Steps provided for Hands-on Labs are beta version and not fully verified yet. All errors and omissions are regretted. 4) Kindly contribute with corrections to the Hands-on Lab Practices, to help the ADF community, as all Oracle ADF documents written by us, are free with no copyright. To participate send an email to adftraining.b@gmail.com. 5) Do share freely with larger ADF communities.
  • 29. 18/454 ADF Essentials Training by Deepak Bhagat 1.12 Downloading Training Materials -* Download all Oracle ADF training documents and lab solutions (prepared by Deepak Bhagat), from shared folders on Google GDrive. Unzip all lab solutions. These training materials consist of study guides, hands-on lab practices, reference guides, bookmarks, downloaded materials, extended samples, demos, etc. Hands-on Lab Practices is a beta version. You may also find some Advance ADF topic examples in Deepak Bhagat’s blog at https://cloudadfdeepakb.blogspot.com.
  • 30. 19/454 ADF Essentials Training by Deepak Bhagat 1.13 Important to go through after the training -o Codes, Scripts and Configurations: 1) ...BATHandoutsBATLabs-SrcCodesscrjdev.conf 2) ...BATHandoutsBATLabs-SrcCodesL28-SrcCodes-AdvanceADFvc-utilBATADFUtil.java 3) ...BATHandoutsBATLabs-SrcCodesL17-SrcCodes-Bean_Event_Listener 4) ...BATHandoutsBATLabs-SrcCodesL21-SrcCodes-Binding*.java 5) ...BATHandoutsBATXtEg-ProprietaryL28-BATXtEg-AdvanceADFBATVCContextualEventEg 6) ...BATHandoutsBATXtEg-ProprietaryL28-BATXtEg-AdvanceADFBATVCDynamicRegionEg 7) ...BATHandoutsBATXtEg-ProprietaryL28-BATXtEg-AdvanceADFBATVCProgHandleSimplePopupEg 8) ...BATHandoutsBATXtEg-ProprietaryL28-BATXtEg-AdvanceADFBATVCProgHandlePopupWithRegionEg 9) ...BATHandoutsBATXtEg-ProprietaryL29-BATXtEg-Integrating-WebService1Create_REST-WebService-withADFBS Documents: 10) ...BATHandoutsBATDocs-PreTrainingMaterialPrint- BAT ADF Handy Reference.pdf 11) ...BATHandoutsBATDocs-TrainingMaterialBAT ADF Study Guide - student.pdf 12) ...BATHandoutsBATDocs-TrainingReferenceBAT ADF Assorted Notes.pdf 13) ...BATHandoutsBATDocs-TrainingReferenceL08-BAT Introduction to Groovy.pdf 14) ...BATHandoutsBATDocs-TrainingReferenceOracle ADF Bookmarks 2016.html 15) ...BATHandoutsBATDocs-TrainingReferenceOracle ADF Feeds Firefox 2015.opml 16) ...BATHandoutsOADFDocs-DownloadedL26-ADFDocs-BestPractices 17) ...BATHandoutsOADFDocs-DownloadedL27-ADFDocs-MiscellaneousADF Programmer Cheat Sheet.pdf 18) ...BATHandoutsOADFDocs-DownloadedL35-ADFDocs-Books 19) ...BATHandoutsOADFDocs-DownloadedL35-ADFDocs-Tutorials Concepts: 20) Geometry Management 21) Scopes 22) Lifecycle and validation 23) Contextual event 24) Create or Expose as REST Web Service or as REST API
  • 31. 20/454 ADF Essentials Training by Deepak Bhagat 2 Understanding Development Tool: JDeveloper In this lab for this lesson, start JDeveloper, set preferences for the IDE, and create a JDeveloper application, project and database connection.
  • 32. 21/454 ADF Essentials Training by Deepak Bhagat 2.1 Creating a New Fusion Application and Project -* Start JDeveloper, create a new ADF Fusion Web Application named BATLab_02 with custom settings and database connection. Also explore data control, overview page and generated files. 1) Start JDeveloper using the default role. a) Double-click the desktop shortcut to start JDeveloper. b) In the Select Role dialog box, select the Role as Studio Developer (All Features). Click OK. c) Optionally, if system prompts the Confirm Import Preferences dialog box, click No. d) JDeveloper starts by displaying the Tip of the Day. Optionally, if you want, deselect the Show tips at startup check box. Click Close. e) Explore and then optionally close the Start page by clicking the X at the right of its tab. (The X is not visible until you position the cursor over the tab.) 2) Create a new ADF Fusion Web Application named BATLab_02 in the bat.lab.hrsystem package. Do not use an application template. Create the initial projects named HRService in the bat.lab.hrsystem.service package and HRViewController in the bat.lab.hrsystem.ui package. a) Click the File menu > New > select Application. Or In the Applications window, click the New Application link. New Gallery wizard appears.
  • 33. 22/454 ADF Essentials Training by Deepak Bhagat b) Expand the General (in the Categories list) > Applications > select ADF Fusion Web Application (in the Items list). Click OK. Create ADF Fusion Web Application wizard appears. c) On the Application Name page of the wizard, i) In the Application Name field, enter BATLab_02. ii) In the Application Package Prefix field, enter bat.lab.hrsystem. iii) Click Next. d) On the Project 1 Name page of the wizard, Page BAT BAT bat BAT BAT
  • 34. 23/454 ADF Essentials Training by Deepak Bhagat i) In the Project Name field, enter HRService. ii) Click Next. e) On the Project 1 Java Settings page of the wizard, i) In the Default Package field, enter bat.lab.hrsystem.service. ii) Click Next. f) On the Project 2 Name page of the wizard, i) In the Project Name field, enter HRViewController. ii) Click Next. g) On the Project 2 Java Settings page of the wizard, i) In the Default Package field, enter bat.lab.hrsystem.ui. ii) Click Next. h) Click Finish. 3) Notice that the Applications window displays your application and projects. BAT BAT BAT BAT BAT BAT BAT BAT BAT BAT BAT bat. bat
  • 35. 24/454 ADF Essentials Training by Deepak Bhagat 4) Explore all the default generated files. 5) Explore the empty Data Controls window (within Applications window). 6) Explore the BATLab_02 Overview. (Notice that the BATLab_02 Overview page is open in the editor. This page enables you to see all the aspects of your application at a glance, to obtain related help and to create new objects. You can spend some time exploring this overview objects if you want to, but it is not used in this lab.) BAT BAT
  • 36. 25/454 ADF Essentials Training by Deepak Bhagat 2.2 Creating a New Database Connection and Initialize the Project -* Create a new database connection and initialize the project. 1) Create a new database connection. a) Expand the Application Resources window. Right-click the Connections > New Connection > select Database. Create Database Connection wizard appears. b) Supply the following information. Connection Name Hrconn Connection Type Oracle (JDBC) Username hr (or if you are using a shared database, follow instructions given by your instructor.) Password hr (case sensitive) Save Password Select the check box (if not checked/selected) BAT
  • 37. 26/454 ADF Essentials Training by Deepak Bhagat c) In Oracle (JDBC) Settings section, leave the Driver field as thin, Host Name field as localhost, JDBC Port field as 1521, SID field as XE respectively. d) Click Test Connection. The status box should display the word Success!. e) Click OK. Click Save All .
  • 38. 27/454 ADF Essentials Training by Deepak Bhagat 2.3 Adding ADF Business Components and ADF Faces -* Create new default business components such as entity objects, view objects and application module. Also create a JSF page. 1) Create new default business components. a) Right-click the HRService > New > select Business Components from Tables. Initialize Business Components Project wizard appears. b) Ensure the Connection is hrconn (if the database connection is already created or else click icon and follow the 2.2 above to create a new database connection). Click OK. Create Business Components from Tables wizard appears. c) On the Entity Objects page of the wizard, Page bat
  • 39. 28/454 ADF Essentials Training by Deepak Bhagat i) In the Package field, enter bat.lab.hrsystem.service.eo (note eo). ii) Click the Query button to see the available tables. iii) From the Available pane, select DEPARTMENTS and EMPLOYEES, click to shuttle to the Selected pane. iv) In the Selected pane, select the DEPARTMENTS, in the Entity Name field, change to DepartmentEO (remove s). v) Similarly, select the EMPLOYEES, in the Entity Name field, change to EmployeeEO (remove s). vi) Click Next. d) On the Entity-based View Objects page of the wizard, i) In the Package field, enter bat.lab.hrsystem.service.vo (note vo). ii) From the Available pane, select DepartmentEO and EmployeeEO, click to shuttle to Selected pane. iii) In the Selected pane, select the DepartmentEOView, in the Object Name field, change to DepartmentVO (remove View and replace E to V). iv) Similarly, select the EmployeeEOView, in the Object Name field, change to EmployeeVO (remove View and replace E to V). v) Click Next. Page Pane Pane bat
  • 40. 29/454 ADF Essentials Training by Deepak Bhagat e) On the Query-based View Objects page of the wizard, i) In the Package field, enter bat.lab.hrsystem.service.vvo (note vvo replacing vo). ii) Click the Query button. iii) From the Available pane, select the JOBS, click to shuttle to the Selected pane. iv) In the Selected pane, select the JOBS, in the View Name field, change to JobsVVO (note sVVO). v) Click Next. f) On the Application Module page of the wizard, i) Ensure that the Add to Application Module check box is checked. ii) In the Package field, enter bat.lab.hrsystem.service.am (note am). iii) In the Name field, change to HRSystemAM. iv) Click Next. Page Page bat bat
  • 41. 30/454 ADF Essentials Training by Deepak Bhagat g) On the Diagram page of the wizard, i) Check the Add to Business Components Diagram check box to create business components diagram. (Leave Package as it is. We will refactor later). ii) Click Next. iii) Click Finish. Click Save All . 2) Explore the files generated and diagrams. Ensure following details: Type of Object Package Objects Based on Entity Object bat.lab.hrsystem.service.eo DepartmentEO, EmployeeEO DEPARTMENTS, EMPLOYEES tables Updatable VO bat.lab.hrsystem.service.vo DepartmentVO, EmployeeVO DepartmentEO, EmployeeEO Query-based VO bat.lab.hrsystem.service.vvo JobsVVO JOBS table Application Module bat.lab.hrsystem.service.am HRSystemAM Page bat bat
  • 42. 31/454 ADF Essentials Training by Deepak Bhagat 3) Test the default business components by running the application module. a) Right-click the (application module) HRSystemAM (in the bat.lab.hrsystem.service.am package) > select Run. Oracle ADF Model Tester wizard appears. b) Explore the view object instances in it. 2) Create a new JSF page named HRSystemIndex and run the page. BAT bat bat bat bat bat bat
  • 43. 32/454 ADF Essentials Training by Deepak Bhagat a) Right-click the HRViewController > New > select Page. Create JSF Page wizard appears. b) In the File Name field, enter HRSystemIndex. Keep remaining as defaults. c) Click OK. d) Explore the newly created page HRSystemIndex.jsf. e) Right-click the HRSystemIndex.jsf > select Run. System opens the HRSystemIndex page in web browser. Explore the URL and title. BAT BAT bat bat bat bat bat bat
  • 44. 33/454 ADF Essentials Training by Deepak Bhagat 2.4 Exploring JDeveloper and New Application -* Examine, explore, understand and familiarize with all generated artifacts. 1) Expand the HRService > Application Sources > bat.lab.hrsystem. 2) Double-click the HRService.jpx file (database connectivity) and explore it. Observe Connection details. 3) Expand the Data Controls window and explore newly displayed artifacts i.e., HRSystemAMDataControl and components under it. 4) Expand the bat.lab.hrsystem.service.am and double-click the Business Components Diagram.adfbc_diagram. 5) Explore all generated artifacts. 6) Expand the Application Resources window > Connections, explore HR System schema, tables, sequence, properties, etc. bat
  • 45. 34/454 ADF Essentials Training by Deepak Bhagat 2.5 Exploring Windows of JDeveloper -* Examine, explore, understand and familiarize with various windows of the JDeveloper. 1) Explore various windows of JDeveloper such as Applications, Data Controls, Databases, Structure, Editors (code and visual), Log and Debugger, Components, Resources (IDE and Application), Properties, etc. and other Windows. BATLab_02
  • 46. 35/454 ADF Essentials Training by Deepak Bhagat 2.6 Working with Windows -* Play around with windows and familiarize. 1) Right-click the window title, to work with following window options: Close / Open Maximize / Restore Float / Dock Split / Unsplit Resize Reposition 2) All JDev Menus and menu items like File, Edit, View, Application, Refactor, Search, etc. BAT
  • 47. 36/454 ADF Essentials Training by Deepak Bhagat 2.7 Taking Help using F1 key -* Familiarize with JDeveloper Help. 1) Select or place the cursor on the object or context of which you need help. 2) Press F1 key for help. Help window appears, which contains the detailed information regarding the selected object or context.
  • 48. 37/454 ADF Essentials Training by Deepak Bhagat 2.8 Refactoring JDeveloper Artifacts -* Refactor artifacts by renaming view object and moving diagram to appropriate package. 1) Rename (JobsVVO to JobVVO) and move diagram (from bat.lab.hrsystem.service.am to bat.lab.hrsystem.service.diagram). a) Right-click the JobsVVO > Refactor > select Rename. Rename wizard appears. b) In the Rename To field, change to JobVVO (remove s). Click OK. Notice the name JobsVVO changed to JobVVO. c) Expand the bat.lab.hrsystem.service.am, select Business Components Diagram.adfbc_diagram. d) Click the Refactor menu > select Move. bat
  • 49. 38/454 ADF Essentials Training by Deepak Bhagat Move Files window appears. e) Select the service folder, create a new folder diagram by clicking icon and select it. f) Click the Select button. Diagram moves from package bat.lab.hrsystem.service.am to bat.lab.hrsystem.service.diagram 2) Save All. BAT BAT BAT BAT bat
  • 50. 39/454 ADF Essentials Training by Deepak Bhagat 2.9 Setting IDE Preferences -* Configure JDeveloper preferences for Object Naming and Packages. 1) Set global naming preferences and packaging preferences for following ADF BC objects: entity object, domain, association, view object, view link and application module. a) Click the Tools menu > select Preferences. Preferences wizard appears. b) Expand the ADF Business Components > select Object Naming. c) In the Suffix column, enter values as follows: d) At the left pane, select Packages and enter Packages values as follows
  • 51. 40/454 ADF Essentials Training by Deepak Bhagat e) Click OK. Save All. 2) Click the Tools menu > select Switch Roles, to switch default role to start JDeveloper, if needed.
  • 52. 41/454 ADF Essentials Training by Deepak Bhagat 2.10 Setting Package Levels -* Set the project package and web content levels to reduce number of levels. 1) Click the Applications Window Options as shown below. 2) Change the both Package Level and Web Content Level to 5. 3) Save All. BAT bat bat bat bat bat bat
  • 53. 42/454 ADF Essentials Training by Deepak Bhagat 2.11 Lab Solution Lab solutions can be found under …BATHandoutsBATLabs-SolutionsBATLab_02.
  • 54. 43/454 ADF Essentials Training by Deepak Bhagat 3 Modeling Database Schema In this lab, you use the diagram modeler/editor to create a visual representation of the database schema. You also create a new database component (a table) and create the DDL (Data Definition Language) scripts to add the table to the schema.
  • 55. 44/454 ADF Essentials Training by Deepak Bhagat 3.1 Copying Application -o Make a copy of application BATLab_02 and rename it to BATLab_03. 1) In the File Explorer, open location …mywork. 2) Copy and paste the application BATLab_02 in the same location. 3) Rename the newly copied application from BATLab_02-Copy to BATLab_03. 4) Switch to JDeveloper. 5) Click the File menu > select Open. 6) Select the …myworkBATLab_03BATLab_02.jws from your local system. Click Open. 7) Click the Application menu > select Rename. Rename wizard appears. 8) In the File Name field, change to BATLab_03.jws. Click Save. 9) Click the Build menu > select Clean All and Refresh Application. Click Yes. BAT BAT BAT BAT
  • 56. 45/454 ADF Essentials Training by Deepak Bhagat 3.2 Exploring HR System ER Diagram -* Examine, explore, understand and familiarize with HR System ER diagram.
  • 57. 46/454 ADF Essentials Training by Deepak Bhagat 3.3 Examining Training Lab Application – Lab Solution 22 -* Open …BATHandoutsBATLabs-SolutionsBATLab_22 lab solution. Run and explore the application. <<to be done together at end>>
  • 58. 47/454 ADF Essentials Training by Deepak Bhagat 3.4 Creating an Offline Database Diagram with Existing Schema Objects-o Create a new offline database diagram (BAT_DB) with existing schema objects. 1) Expand the Application Resources window > Connections > Database > hrconn and explore. 2) Right-click the HRService > New > select From Gallery. New Gallery wizard appears. 3) Expand the General > Diagrams > select Database Diagram at right-side. Click OK. Create Database Diagram wizard appears. 4) In the Name field, enter BATSchema 5) In the Package field, enter bat.lab.hrsystem.service.db (note db). 6) Click OK. 7) BATSchema.db_diagram opens in the editor. Save All. bat BAT
  • 59. 48/454 ADF Essentials Training by Deepak Bhagat 8) Expand the Application Resources window > Connections > Database > hrconn > Tables. 9) Drag the DEPARTMENTS and EMPLOYEES tables to the diagram modeler/editor. Specify Location dialog box appears. 10) Select the Offline Database, in Offline Database field enter BAT_DB. 11) Click OK. Save All. BAT BAT BAT
  • 60. 49/454 ADF Essentials Training by Deepak Bhagat 3.5 Adding New Offline Database Schema Objects -o Add new database schema object (GENDERS) to the newly created offline database (BAT_DB). 1) From the Components window (ensure Database page is selected), drag Table component to the BATSchema.db_diagram editor. Specify Location wizard appears. 2) In the Offline Database list, select BAT_DB (If it is already not selected). Click OK. 3) In the diagram editor, change table name from TABLE1 to GENDERS. 4) Resize the table. 5) Double-click the GENDERS table diagram to invoke Edit Table page. a) Click the Columns page (left side). Page BAT BAT BAT
  • 61. 50/454 ADF Essentials Training by Deepak Bhagat b) Click the icon (right end) to add a new column GENDER_ID. i) In the Name column, enter GENDER_ID, ii) In the Data Type column, change to Number, iii) In the Size column, enter 4, iv) In the Not NULL column, check the check box, to make it mandatory, v) In the PK column, click inside column, to make it a primary key, vi) Save All. OR vii) Click the Constraints page. Click icon and select New Primary Key Constraint. From Available Columns, select GENDER_ID and shuttle it to Selected Columns. c) Similarly add another column GENDER_NAME with default values. i) In the Name column, enter GENDER_NAME. 6) Save All.
  • 62. 51/454 ADF Essentials Training by Deepak Bhagat 3.6 Generating the SQL Scripts -o Create and run scripts to create GENDER table in the Database and to insert data in it. 1) To generate DDL script, a) In the Projects window, expand Offline Database Sources > BAT_DB > HR. b) Right-click the GENDERS table > Generate To > select SQL Script. Generate SQL from Database Objects wizard appears. BAT BAT BAT BAT
  • 63. 52/454 ADF Essentials Training by Deepak Bhagat c) On the SQL Script page of the wizard, in the File Name field change to …databaseBAT_DBcreateTableGender.sql. Click Next. Click Next. Click Next. Click Next. Click Finish. It creates createTableGender.sql file and opens in the editor 2) Double-click the Employees table. a) Click the Columns page. b) Select the last column (i.e. DEPARTMENT_ID), click icon to add a new column. It inserts new column. c) In the Name column, change from COLUMN1 to GENDER_ID, d) In the Data Type column, change to Number, e) In the Size column, change to 4. Save All. 3) Go back to BATSchema.db_digram (if it is closed, expand the Recent Files window and double-click the diagram). 4) In the Components window, drag Foreign Key from GENDER_ID of GENDERS table to GENDER_ID of EMPLOYEES table. Click OK. Save All. BAT BAT
  • 64. 53/454 ADF Essentials Training by Deepak Bhagat 5) To generate DDL script, a) Expand the Offline Database Sources > BAT_DB > HR. b) Right-click the EMPLOYEES table > Generate To > select SQL Script. Generate SQL from Database Objects wizard appears. c) In the File Name field, change to …databaseBAT_DBalterTableEmp.sql. Click Next. Click Next. Click Next. d) On the Specify Operation page of the wizard, i) In the Operation option, select Alter radio button. ii) Check the With replace if necessary checkbox. iii) In the Target option, select Database Connection. iv) Ensure the Connection is hrconn (BATLab_03). v) Click Next. Click Finish. BAT BAT BAT
  • 65. 54/454 ADF Essentials Training by Deepak Bhagat 6) Expand the Offline Database Sources. 7) Right-click the BAT_DB > New > select From Gallery. New Gallery wizard, appears. a) Expand the Database Tier > select Database Files > SQL File. Click OK. Create SQL File wizard appears. b) In the File Name field, enter populateTableGender.sql. c) In the Directory field, change path to …HRServicedatabaseBAT_DB. d) Click OK. populateTableGender.sql opens in the editor. 8) Insert following content in populateTableGender.sql editor. INSERT INTO GENDERS (gender_id, gender_name) VALUES (1, 'MALE'); INSERT INTO GENDERS (gender_id, gender_name) VALUES (2, 'FEMALE'); 9) Save All. BAT BAT BAT BAT
  • 66. 55/454 ADF Essentials Training by Deepak Bhagat 3.7 Running the SQL Scripts on Database -o Run the all three scripts to create GENDER table and to insert data in the table. 1) Run the scripts in following order: createTableGender.sql, alterTableEmp.sql and populateTableGender.sql. a) Expand the Offline Database Sources > BAT_DB > HR. b) Double-click the createTableGender.sql to open it in the editor. c) Right-click in the editor, select Run Script. It creates new table GENDERS in database. 2) Similarly, Run Script on alterTableEmp.sql and populateTableGender.sql. 3) To verify, check the database that the GENDERS table is created and it has data.
  • 67. 56/454 ADF Essentials Training by Deepak Bhagat 3.8 Invoking PLSQL -x This is part of advance ADF topic and a copy of this extended example (named BATPLSQLIntgEg) may be found under …BATHandoutsBATXtEg-ProprietaryL03- BATXtEg-Database. For hands-on practice, please refer to Deepak Bhagat’s Blog at https://cloudadfdeepakb.blogspot.com or download from above location. It’s a lab sample on invoking PLSQL.
  • 68. 57/454 ADF Essentials Training by Deepak Bhagat 4 Building Business Services with Default Business Components In this lab, you create a business model by using the wizards that are built into JDeveloper. You see how to build a default model without any coding. In subsequent lessons and practices, you learn to build and customize components to meet your specific application requirements.
  • 69. 58/454 ADF Essentials Training by Deepak Bhagat 4.1 Creating another New Application and Projects -* Create an application BATLab_04 with default projects, with default packages and settings. 1) Create an application named BATLab_04 with package bat (as explained in Lab 2.1) and with default projects, packages and settings. a) Click the File menu > New > select Application. New Gallery wizard appears. b) Expand the General > Applications > select ADF Fusion Web Application. c) Click OK. Create ADF Fusion Web Application wizard appears. d) On the Application Name page of the wizard, i) In the Application Name field, enter BATLab_04. ii) In the Application Package Prefix field, enter bat. iii) Click Finish. (or Click Next > Next > Next > Next > Next > Finish). 2) The application gets created with default projects Model and ViewController and with default packages bat.model and bat.view respectively. 3) Optionally one may delete ViewController project. BAT BAT BAT BAT bat
  • 70. 59/454 ADF Essentials Training by Deepak Bhagat 4.2 Creating Default ADF Business Components -* Create default business components; Entity Objects, View Objects and Application Module. 1) Create Business Components by using Create Business Components from Tables with following details Type of Object Package Objects Based on Entity Object bat.model.eo DepartmentsEO, EmployeesEO DEPARTMENTS, EMPLOYEES tables Updatable VO bat.model.vo DepartmentsVO, EmployeesVO DepartmentsEO, EmployeesEO Query-based VO bat.model.vo JobsVO JOBS tables Application Module bat.model.am AppModuleAM a) Right-click the Model project > New > select Create Business Components from Tables. Initialize Business Components Project wizard appears. b) Click the icon, next to the Connection. Create Database Connection wizard appears.
  • 71. 60/454 ADF Essentials Training by Deepak Bhagat c) Supply the following information: Connection Name Hrconn Connection Type Oracle (JDBC) Username hr (or if you are using a shared database, follow the instructions given by your instructor.) Password hr (case sensitive) Save Password Select check box d) Click the Test Connection. The status box displays the word Success! Click OK. e) Click OK. Create Business Components from Tables wizard appears. f) To create default business components, follow below steps, as explained in step 2.1.9. BAT
  • 72. 61/454 ADF Essentials Training by Deepak Bhagat i) Click the Query button. From Available pane, select DEPARTMENTS and EMPLOYEES and shuttle them to Selected pane. Click Next. ii) On the Entity-based View Objects page of the wizard. From Available pane, shuttle DepartmentsEO and EmployeesEO to Selected pane. Click Next. iii) On the Query-based View Objects page of the wizard. Click Query button. From Available pane, select JOBS and shuttle them to Selected pane. Click Next. iv) Ensure the Add to Application Module checkbox is checked. v) Click Next. vi) Click Finish. g) Save All. Page bat
  • 73. 62/454 ADF Essentials Training by Deepak Bhagat 4.3 Examining Generated ADF Business Components Artifacts -* Examine, explore, understand and familiarize with all generated artifacts. BAT bat bat bat bat bat bat
  • 74. 63/454 ADF Essentials Training by Deepak Bhagat 4.4 Testing the Business Service (using Oracle ADF Model Tester) -* Test the business services which are created in earlier sections by using Oracle ADF Model Tester. 1) Run and test application module (AppModuleAM), using Oracle ADF Model Tester. a) Right-click the (application module) AppModuleAM, select Run. Oracle ADF Model Tester wizard appears. 2) Double-click the various object instances on the left side panel and test. a) For example, double-click the EmpDeptFkVL1 and Jobs and observe the details on right side panel. b) Navigate through records by clicking right-arrow and left arrow .
  • 75. 64/454 ADF Essentials Training by Deepak Bhagat 4.5 Lab Solution Lab solutions can be found under …BATHandoutsBATLabs-SolutionsBATLab_04
  • 76. 65/454 ADF Essentials Training by Deepak Bhagat 5 Persisting Data Using Entity Objects In this lab, you create entity objects for tables that the application will update and also create associations.
  • 77. 66/454 ADF Essentials Training by Deepak Bhagat 5.1 Copying Application -o Make a copy of application BATLab_04 and rename it to BATLab_05. Follow the steps, as explained in Lab 3.1. 1) In the File Explorer, open location …mywork. 2) Copy and paste the application BATLab_04 in the same location. 3) Rename the newly copied application from BATLab_04-Copy to BATLab_05. 4) Switch to JDeveloper. 5) Click the File menu > select Open. 6) Select …myworkBATLab_05BATLab_04.jws from your local system. Click Open. 7) Click the Application menu > select Rename. Rename wizard appears. 8) In the File Name field, change to BATLab_05.jws. Click Save. 9) Click the Build menu > select Clean All and Refresh Application. Click Yes. 10) Open the Model.jpx file in the editor. 11) If the Connection is selected None, then select Online Database.
  • 78. 67/454 ADF Essentials Training by Deepak Bhagat 5.2 Creating Multiple Entity Objects at Once -* Create following multiple entity objects at once by using Create Business Components from Tables. DB Tables Entity Objects (EO) COUNTRIES CountriesEO REGIONS RegionsEO JOB_HISTORY JobHistoryEO 1) Right-click the bat.model.eo package > New > select Business Components from Tables. Create Business Components from Tables wizard appears. 2) Click the Query button. 3) From the Available (left) pane, select COUNTRIES, REGIONS and JOB_HISTORY and shuttle them to Selected (right) pane. 4) Click Finish. bat
  • 79. 68/454 ADF Essentials Training by Deepak Bhagat 5.3 Creating an Association -* (dependent on 5.3) Manually create an association JobHistDeptAS between two entity objects DepartmentsEO and JobHistoryEO. 1) Right-click the bat.model.as > New > select Association. Create Association wizard appears. 2) On the Name page of the wizard, in the Name field enter JobHistDeptAS. Click Next. 3) On the Entity Objects page of the wizard, a) From the Select Source Attribute pane, expand DepartmentsEO > select DepartmentId and from Select Destination Attribute pane, expand JobHistoryEO > select DepartmentId. b) Click the Add button. 4) Click Next. Click Next. Click Next. Click Finish. Save All. bat bat bat
  • 80. 69/454 ADF Essentials Training by Deepak Bhagat 5.4 Examining Attribute Settings -* Examine, explore, understand and familiarize with all settings of an Attribute. 1) Property Set: Select a named property set to apply to this attribute. A property set is a version of an existing domain that is XML-only (no Java) and does not enforce a data type. 2) Effective Date: Specify effective date properties for the attribute. These options are available only if the attribute type is Date. 3) Start Date: Select to indicate that this attribute is the start attribute of an effective dated entity object. 4) End Date: Select to indicate that this attribute is the end attribute of an effective dated entity object. 5) Sequence Flag: Select to indicate that this attribute stores a flag indicating the most recent change in the sequence for an effective dated entity object. 6) Sequence: Select to indicate that this attribute stores a sequence of changes for an effective dated entity object. 7) Updatable: You can enable the attribute to Always or Never be updatable or enable it to be updated only before the entity is first posted (While New).
  • 81. 70/454 ADF Essentials Training by Deepak Bhagat 8) Queryable: Specify that this attribute can occur in the WHERE clause of a view object (selected by default except for LOBs). 9) Precision Rule: Specifies that a validator is applied by the framework at runtime to enforce the maximum precision and scale of the data type. If selected, the validation is performed by the entity. If not selected, the validation is not performed by the entity and may result in invalid precision/scale errors from the database when the transaction is committed. 10) Refresh on Insert/ Update: Specify whether to retrieve the value from the database after an insert or update. 11) Change Indicator: Select this option if the column is a change indicator, such as a timestamp, to be used to indicate that a row has been changed by another transaction. (If no columns are specified as change indicators, ADF BC does a column-by-column comparison.) 12) Effective Date: The attribute is either the start or end date of a date range for which the entity row is effective (used for a point of time snapshot to answer such questions as what an employee’s salary was on January 30, 2004.) 13) History Column: Select to use this column to log changes to the database. You can log changes only if you have implemented Java Authentication and Authorization Service (JAAS) authentication, the selected attribute is persistent, you have not selected Primary Key, Mandatory, or Discriminator, and the attribute is Char, Character, String, Date, Timestamp, or Number. After you have selected History Column, you can select the history column type (created on or modified on for a Date or Timestamp attribute, created by or modified by for a Char, Character, or Stringattribute, or version number for a Number attribute). 14) Generate Unique Constraint: Select to generate a UNIQUE constraint for this attribute. It is often useful to define an attribute so that its values must be unique. For example, you might want to enforce that every customer has a unique email address. 15) Sequence Name: Enter the name of the database sequence. The sequence name shown on the Sequence tab is applicable only at design time when you use the Create Database Tables feature. The sequence indicated here will be created along with the table on which the entity object is based. This field is not available for all attribute types. 16) Start At: Enter an integer value you want the sequence to start at, the default value is 1. This field is not available for all attribute types.
  • 82. 71/454 ADF Essentials Training by Deepak Bhagat 5.5 Creating Entity Object based on Database View -o Create Entity Object EmpDetailsViewEO in bat.model.eo package, based on Database View (EMP_DETAILS_VIEW). 1) In the Applications window, right-click the Model project (or bat.model.eo package) > New > select Entity Object. Create Entity Object wizard appears. 2) On the Name page of the wizard, in the Name field, enter EmpDetailsViewEO and click Browse (next to the Schema Object). Select Schema Object wizard appears. a) Check the Object Type as Views and uncheck Tables. b) Click the Query button. c) From the Available Objects select EMP_DETAILS_VIEW. Click OK. bat
  • 83. 72/454 ADF Essentials Training by Deepak Bhagat 3) Click Next. 4) On the Attributes page of the wizard, select last two columns (CounrtyName and RegionName). Click Remove. Click Next. (Removing is important for lab 5.4). 5) On the Attribute Settings page of the wizard, select EmployeeId and check Primay Key check box to make it as Primary Key. Click Next. Click Next. Click Next. Click Finish. (See lab 5.6 for details on each properties of the Attribute). bat
  • 84. 73/454 ADF Essentials Training by Deepak Bhagat
  • 85. 74/454 ADF Essentials Training by Deepak Bhagat 5.6 Synchronizing an Entity Object with Table Structure Changes -o (dependent on 5.5) Synchronize EmpDetailsViewEO entity object’s missing columns with database or structure changes in table. 1) Double-click the EmpDetailsViewEO to open in the editor. 2) Click the Attributes page. Verify that CounrtyName and RegionName attributes are missing. 3) Right-click the EmpDetailsViewEO > select Synchronize with Database. Synchronize with Database wizard appears. 4) Select statements with COUNTRY_NAME and REGION_NAME. Click Synchronize button. Click OK. Click OK. Save All. 5) Verify the CounrtyName and RegionName attributes are now present in the EmpDetailsViewEO.
  • 86. 75/454 ADF Essentials Training by Deepak Bhagat 5.7 Lab Solution Lab solutions can be found under …BATHandoutsBATLabs-SolutionsBATLab_05
  • 87. 76/454 ADF Essentials Training by Deepak Bhagat 5.8 Applying Property Set -d This Property Set topic is part of the Advance ADF extended example, taken from the web. For optional self-paced hands-on practice, it may be further downloaded from …BATHandoutsOADFXtEg-DownloadedL05-ADFXtEg-EntityObject.
  • 88. 77/454 ADF Essentials Training by Deepak Bhagat 6 Querying Data Using View Objects In this lab, you create view objects that are more customized for your application. You can also create LOV, read-only view objects to support those LOVs and updatable view objects based on entity objects and also create links between view objects. You can test these objects or instances by using tester.
  • 89. 78/454 ADF Essentials Training by Deepak Bhagat 6.1 Copying Application -o Make a copy of application BATLab_05 and rename it to BATLab_06. Follow the steps, as explained in Lab 5.1. 1) In the File Explorer, open location …mywork. 2) Copy and paste the application BATLab_05 in the same location. 3) Rename the newly copied application from BATLab_05-Copy to BATLab_06. 4) Switch to JDeveloper. 5) Click the File menu > select Open. 6) Select …myworkBATLab_06BATLab_05.jws from your local system. Click Open. 7) Click the Application menu > select Rename. Rename wizard appears. 8) In the File Name field, change to BATLab_06.jws. Click Save. 9) Click the Build menu > select Clean All and Refresh Application. Click Yes. 10) Open the Model.jpx file in the editor. 11) If the Connection is selected None, then select Online Database.
  • 90. 79/454 ADF Essentials Training by Deepak Bhagat 6.2 Creating Read-Only View Object based on SQL Query -* Create a read-only view object EmpSqlQueryVO based on SQL Query. 1) Right-click the bat.model.vo > New > select View Object. Create View Object wizard appears. 2) On the Name page of the wizard, a) In the Name field, enter EmpSqlQueryVO. b) Select the Custom SQL query radio button (under Data Source). Click Next. 3) On the Query page of the wizard, a) Click the Query Builder button to build a Query. SQL Statement wizard appears. b) Click the Query button. c) Expand the EMPLOYEES and select attributes EMPLOYEE_ID, FIRST_NAME, LAST_NAME, EMAIL, PHONE_NUMBER, HIRE_DATE, JOB_ID, SALARY, COMMISSION_PCT, MANAGER_ID, DEPARTMENT_ID from Available pane (left) and shuttle them to Selected pane (right). Click OK. bat
  • 91. 80/454 ADF Essentials Training by Deepak Bhagat 4) Verify the Query: SELECT EMPLOYEE_ID, FIRST_NAME, LAST_NAME, EMAIL, PHONE_NUMBER, HIRE_DATE, JOB_ID, SALARY, COMMISSION_PCT, MANAGER_ID, DEPARTMENT_ID FROM EMPLOYEES. 5) Click Next till Step 8 (i.e. Application Module page). 6) Check the Add to Application Module. 7) Click Finish. Save All. 8) Right-click the AppModuleAM > select Run.
  • 92. 81/454 ADF Essentials Training by Deepak Bhagat Oracle ADF Model Tester wizard appears. 9) Double-click the EmpSqlQuery1 and observe the result with read-only values.
  • 93. 82/454 ADF Essentials Training by Deepak Bhagat 6.3 Creating Updatable Join View Object -* (Dependent on 4.2) Create updatable join view object EmpSummaryVO in the bat.model.vo package, based on two entity objects EmployeesEO and DepartmentsEO. 1) Right-click the bat.model.vo > New > select View Object. Create View Object wizard appears. 2) On the Name page of the wizard, a) In the Name field, enter EmpSummaryVO and select Entity radio button (under Data Source). b) Click Next. 3) On the Entity Objects page of the wizard, a) From the Available pane, expand bat.model.eo > select first EmployeesEO and then DepartmentsEO and shuttle them to Selected pane. (Note Order of selection is important). bat bat
  • 94. 83/454 ADF Essentials Training by Deepak Bhagat b) In the Selected pane, select DepartmentsEO. Ensure that Association is set to EmpDeptFkAS.Departments1. c) Notice that default Join Type is inner join. d) Change the Join Type to left outer join. e) Ensure that Updatable check box is NOT checked, and that Reference check box is checked. f) Select the EmployeesEO and ensure Updatable checkbox is checked. Click Next. 4) On the Attributes page of the wizard, a) From Available pane, expand EmployeesEO > select attributes EmployeeId, FirstName, LastName, Email, PhoneNumber, HireDate, JobId, bat bat bat bat
  • 95. 84/454 ADF Essentials Training by Deepak Bhagat CommissionPct, Salary and shuttle them to Selected pane. (Note order of selection is very important). b) From Available pane, expand DepartmentsEO > select attributes DepartmentId, DepartmentName, ManagerId and shuttle them to Selected pane. Click Next till Application Module page. 5) Do NOT check Add to Application Module checkbox. Click Finish. 6) Save All your work and Make.
  • 96. 85/454 ADF Essentials Training by Deepak Bhagat 6.4 Adding View Object to Existing Application Module -* (Dependent on 6.6) Add a view object (EmpSummaryVO) to existing application module (AppModule). 1) Add a view object EmpSummaryVO to AppModuleAM a) Double-click the AppModuleAM (under bat.model.am) to open in the editor. b) Click the Data Model page. c) From Available View Objects pane, select EmpSummaryVO and shuttle it to Data Model pane (Observer it creates an instance EmpSummary1). d) Save All. bat bat bat
  • 97. 86/454 ADF Essentials Training by Deepak Bhagat 6.5 Testing View Objects -* Test view objects and view links by using Oracle ADF Model Tester. <<more elaborate steps req> 1) Right-click the AppModuleAM > select Run. Oracle ADF Model Tester wizard appears. 2) Test the view link DeptLocVL1 and master detail Locations1-Departments3. 3) Test the updatable view object EmpSummary1. 4) Double-click the EmpSummary1 and traverse through details by clicking icon.
  • 98. 87/454 ADF Essentials Training by Deepak Bhagat 5) Create a new employee and commit. 6) Find/Search this particular employee record. 7) Update this record and commit. 8) Now remove filter/search and get all records. 9) Again, find record and edit details of an employee. 10) Delete record and rollback. 11) Delete record and commit. 12) Now find that record. Verify that it shows empty non- editable fields, as record does not exist anymore. 13) For EmployeeId 100, change Salary to 240000 and tab out. Observe that there is no error thrown. Change Salary to 2400000 and observe that error is thrown because Salary range cannot be more than 6 digits. 14) Observe the format of HireDate is YYYY-MM-DD. Change HireDate to 2023-06-17 and tab out. Observe that there is no error thrown even though HireDate is greater than current date. 15) Observe that JobId is not an LOV and displays only the Job Id, not Job Title. 16) Observe that there is no field as Annual Salary.
  • 99. 88/454 ADF Essentials Training by Deepak Bhagat
  • 100. 89/454 ADF Essentials Training by Deepak Bhagat 6.6 Internationalizing through Resource Bundle -o Internationalize ADF Business Service through resource bundle. 1) Click the Application menu > select Project Properties. Project Properties wizard appears. 2) Select the Resource Bundle (at left side pane). 3) In the Default Project Bundle Name field, enter bat.model.rb.ModelBundle. 4) Click OK. Click Yes. Save All. BAT BAT bat
  • 101. 90/454 ADF Essentials Training by Deepak Bhagat 6.7 Creating Read-Only View Object based on Static List -o Create a read-only view object CurrencyStaticVO based on Static List. 1) Right-click the bat.model.vo > New > select View Object. Create View Object wizard appears. 2) On the Name page of the wizard, a) In the Name field, enter CurrencyStaticVO. b) Select the Static list radio button (under Data Source). c) Click Next. 3) On the Attributes page of the wizard, a) Click the New button. New View Object Attribute dialog box appears. b) In the Name field, enter Symbol. Click OK. 4) Follow the same steps, to add new attributes Country and Currency. bat
  • 102. 91/454 ADF Essentials Training by Deepak Bhagat 5) Click Next. Click Next. (if it prompts dialog box, click No). 6) On the Static List page of the wizard, a) Click the icon to add values for the Attributes, as shown in below table. b) Click on empty text boxes and provide values for the Attributes as shown in above table. Click Next. 7) On the Application Module page of the wizard, check Add to Application Module. Click Finish. Save All. 8) Right-click the AppModuleAM > select Run. Oracle ADF Model Tester, wizard appears. 9) Double-click the CurrencyStatic1 and observe the result with static values.
  • 103. 92/454 ADF Essentials Training by Deepak Bhagat 6.8 Creating Multiple Read-Only View Objects at Once -o Create following multiple read-only view objects at once by using Create Business Components from Tables. Tables Read Only View Objects COUNTRIES CountriesVO LOCATIONS LocationsVO REGIONS RegionsVO 1) Right-click the bat.model.vo > New > select Business Components from Tables. Create Business Components from Tables wizard appears. 2) Click Next till Query-based View Objects page. 3) On the Query-based View Objects page of the wizard, a) Click the Query button. b) Select COUNTRIES, LOCATIONS and REGIONS from Available pane and shuttle them to Selected pane. c) Click Next till Application Module page. 4) On the Application Module page of the wizard, check Add to Application Module. Click Finish. 5) Examine the newly generated links CountrRegFkVL and LocCIdFkVL that it is not based on association unlike others. 6) Right-click the AppModuleAM > select Run. Oracle ADF Model Tester wizard appears. 7) Double-click the LocCIdFkVL1 and CountrRegFkVL1 and observe the result with read- only values. bat
  • 104. 93/454 ADF Essentials Training by Deepak Bhagat
  • 105. 94/454 ADF Essentials Training by Deepak Bhagat 6.9 Creating View Link -o Manually create a Master-Detail relationship between two view objects (LocationsVO and DepartmentsVO) using view link (DeptLocVL). 1) Right-click the bat.model.vl > New > select View Link. Create View Link wizard appears. 2) On the Name page of the wizard, in the Name field enter DeptLocVL. Click Next. 3) On the View Objects page of the wizard, a) From Select Source Attribute pane, expand bat.model.vo > LocationsVO > select LocationId and from Select Destination Attribute pane expand DepartmentsVO > select LocationId. b) Click the Add button. c) Click Next. Click Finish. (Note Do NOT check Add to Application Module). bat bat
  • 106. 95/454 ADF Essentials Training by Deepak Bhagat 6.10 Adding Child VO to Master VO Through Link in Existing AM -o (Dependent on 6.9) Add master view object (LocationsVO) and child view object (DepartmentsVO) via view link (DeptLocVL) to application module (AppModuleAM). <<Make all other objectives clear>> 1) Open the AppModuleAM in the editor. 2) Click the Data Model page. 3) In the Data Model pane, select Locations1. 4) From Available View Objects pane, expand bat.model.vo > LocationsVO > select DepartmentsVO via DeptLocVL and shuttle it to Data Model pane. 5) Ensure that child instance Departments3 is created under Location1 in Data Model pane. Save All. bat
  • 107. 96/454 ADF Essentials Training by Deepak Bhagat 6.11 Testing View Objects and Link -o Test view objects and view links by using Oracle ADF Model Tester. 1) Right-click the AppModuleAM > select Run. Oracle ADF Model Tester wizard appears. 2) Test the view link DeptLocVL1 and master detail Locations1-Departments3.
  • 108. 97/454 ADF Essentials Training by Deepak Bhagat 6.12 Lab Solution Lab solutions can be found under …BATHandoutsBATLabs-SolutionsBATLab_06
  • 109. 98/454 ADF Essentials Training by Deepak Bhagat 7 Exposing Business Service through Application Module In this lab, you create nested application module and add view objects to that application module which are no longer required.
  • 110. 99/454 ADF Essentials Training by Deepak Bhagat 7.1 Copying Application -o Make a copy of application BATLab_06 and rename it to BATLab_07. Follow the steps, as explained in Lab 5.1 or Lab 6.1.
  • 111. 100/454 ADF Essentials Training by Deepak Bhagat 7.2 Creating New Nested Application Module -o Create new nested application module NestedAM in bat.model.am package. 1) Right-click the bat.model.am > New > select Application Module. Create Application Module wizard appears. 2) On the Name page of the wizard, a) In the Name field, enter NestedAM. b) Click Next. 3) On the Data Model page of the wizard, a) From the Available View Objects pane (under bat.model.vo), select CurrencyStaticVO, CountrRegFkVL and LocCIdFkVL and shuttle them to Data Model pane, under NestedAM. b) Click Next. 4) On the Application Modules page of the wizard, a) From the Available pane, select AppModuleAM and shuttle it to Selected pane. b) Click Next. Click Finish. bat bat bat bat
  • 112. 101/454 ADF Essentials Training by Deepak Bhagat 5) Open the AppModuleAM in the editor. 6) Click the Data Model page. a) From the Data Model pane, select and remove Countries1, CurrencyStatic1 and Regions1 object instances by shuttling them back (use back arrow) to Available View Objects pane. b) Save All. 7) Run the NestedAM and test. bat bat
  • 113. 102/454 ADF Essentials Training by Deepak Bhagat 7.3 Lab Solution Lab solutions can be found under …BATHandoutsBATLabs-SolutionsBATLab_07
  • 114. 103/454 ADF Essentials Training by Deepak Bhagat 8 Declaratively Customizing Business Services In this lab, you make declarative modifications to your business components such as defining control hints, creating alternate key, populating primary key, adding transient attribute, creating list of values, creating view criteria and using groovy.
  • 115. 104/454 ADF Essentials Training by Deepak Bhagat 8.1 Copying Application -o Make a copy of application BATLab_07 and rename it to BATLab_08. Follow the steps, as explained in Lab 5.1 or Lab 6.1.
  • 116. 105/454 ADF Essentials Training by Deepak Bhagat 8.2 Customizing Entity Objects by Defining Control Hints -* (Dependent on 4.3) Customize entity objects (EmployeesEO) by defining control hints. 1) Open the EmployeesEO in the editor. 2) Click the Attributes page. 3) Select the HireDate attribute. 4) Click the UI Hints tab (after the attributes). a) In the Tooltip field, enter Hire Date, b) In the Format Type field, select Simple Date, c) In the Format field, select dd-MMM-yyyy. If it prompts Warning message, click Yes. d) Save All. 5) Click the Details tab. a) Select the Expression radio button under Default Value section. b) Click the Edit expression icon. Edit Expression Editor wizard appears. c) In the Expression textbox, enter adf.currentDate.
  • 117. 106/454 ADF Essentials Training by Deepak Bhagat d) Click OK. Save All.
  • 118. 107/454 ADF Essentials Training by Deepak Bhagat 8.3 Customizing View Object by Adding Transient Attribute -* (Dependent on 6.6) Customize view object by adding a new transient attribute. 1) Open the EmpSummaryVO in the editor. 2) Click the Attributes page. 3) Click the icon (to add new attribute) > select New Attribute. New View Object Attribute dialog box appears. 4) In the Name field enter AnnualSalary, in the Type field select BigDecimal, Click OK. 5) Select the AnualSalary attribute, click UI Hints tab, in the Width field enter 10.
  • 119. 108/454 ADF Essentials Training by Deepak Bhagat 6) Click the Details tab, select Expression radio button under Default Value section, click Edit expression icon. Edit Expression Editor wizard appears. 7) In the Expression textbox, enter Salary!=null?Salary*12:null. Click OK. Save All.
  • 120. 109/454 ADF Essentials Training by Deepak Bhagat 8.4 Defining List of Values and Accessors -* (Dependent on 6.6) Define list of values and accessors. 1) Open the EmpSummaryVO in the editor. 2) Click the Attributes page. 3) Select the JobId attribute. 4) Click the List of Values tab. Click icon. Create List of Values wizard appears. a) In the List Data Source field, select JobsVO1 by clicking icon and selecting JobsVO from View Accessors dialog box. b) In the List Attribute field, select JobId from the drop-down. c) Click the UI Hints tab,
  • 121. 110/454 ADF Essentials Training by Deepak Bhagat i) In the Default List Type field, select Combo Box with List of Values from the drop-down ii) From the Available pane, select JobTitle and shuttle it to Selected pane. iii) Click OK. Save All. OR 5) Alternatively, Click the Accessors page and click icon. View Accessors wizard appears. a) Add the JobsVO. Click OK. Save All. 6) Go back to Attributes page. Select JobId attribute. 7) Click the List of Values tab and click icon. Create List of Values wizard appears. a) In the List Data Source field, select JobsVO1. bat bat
  • 122. 111/454 ADF Essentials Training by Deepak Bhagat b) In the List Attribute field, select JobId. c) Click the UI Hints tab. i) In the Default List Type field, select Combo Box with List of Values. ii) From the Available pane select JobTitle and shuttle it to Selected pane. d) Click OK. 8) Save All. 9) Click the Accessors page, observe the View Accessors. 10) Run the AppModuleAM and test. a) Double-click the AppModuleAM > select Run. Oracle ADF Model Tester wizard appears. b) Double-click the EmpSummary1. c) Observe the JobId field shows the list of values with Job Title. bat bat
  • 123. 112/454 ADF Essentials Training by Deepak Bhagat
  • 124. 113/454 ADF Essentials Training by Deepak Bhagat 8.5 Creating View Object with Parameterized Where Clause -* Create view object with Parameterized Where Clause. 1) Right-click the bat.model.vo > New > select View Object. Create View Object wizard appears. 2) On the Name page of the wizard, a) Select the Custom SQL query, b) In the Name field, enter EmpByEmailVO, c) Click Next. 3) On the Query page of the wizard, a) Write the query select FIRST_NAME, LAST_NAME, EMAIL from EMPLOYEES where EMAIL=:p_email. b) Click Next. 4) On the Bind Variables page of the wizard, a) Click the New button to add bind variable. b) In the Name field, enter p_email. c) Click Next till Attribute Settings page. 5) On the Attribute Settings page of the wizard, a) Click Next. (If it prompts dialog box click No). 6) On the Application Module page of the wizard, a) Check the Add to Application Module checkbox. b) In the Name field, change to AppModuleAM. 7) Click Finish. Save All. 8) Run the AppModuleAM and test. a) Double-click the AppModuleAM > select Run. bat
  • 125. 114/454 ADF Essentials Training by Deepak Bhagat Oracle ADF Model Tester wizard appears. b) Double-click the EmpByEmail1. Bind Variables dialog box appears. c) In the Value field, enter AKHOO. Click OK. d) It shows FirstName, LastName and Email values in read-only mode.
  • 126. 115/454 ADF Essentials Training by Deepak Bhagat 8.6 Creating and Using Parameterized View Criteria -o (Dependent on 6.4) Create two parameterized view criteria’s in EmpSqlQueryVO. 1) Open the EmpSqlQueryVO in the editor. 2) Click the View Criteria page. Click icon under View Criteria section. Create View Criteria wizard appears. 3) In the Criteria Name field, enter EmpByDeptVC. Click Add Item. 4) In the Definition section, a) In the Attribute field, select DepartmentId, b) In the Operator field, select Equals, c) In the Operand field, select Bind Variable. d) In the Parameter field, click icon to enter bind variable. New Variable dialog box appears. e) In the Name field enter p_deptId, in the Type field select Integer, click OK. 5) Click OK. Saver All.
  • 127. 116/454 ADF Essentials Training by Deepak Bhagat 6) Similarly, create another view criteria named EmpByEmailVC. In the Attribute field select Email, in the Operator field select Equals, in the Operand field select Bind Variable and add Parameter as p_email. Click OK. Save All. 7) Run the AppModuleAM and test. a) Double-click the AppModuleAM > select Run. Oracle ADF Model Tester wizard appears. b) Double-click the EmpSqlQuery1. c) Click the Search icon. View Criteria wizard appears. i) From the Available pane select EmpByDeptVC and shuttle it to Selected pane. ii) Click Find. iii) Bind Variables dialog box appears. iv) In the Value field, enter 80. Click OK.
  • 128. 117/454 ADF Essentials Training by Deepak Bhagat d) It shows the employee details with Department Id 80.
  • 129. 118/454 ADF Essentials Training by Deepak Bhagat e) Similarly, double-click the EmpSqlQuery1, click the Search icon. Shuttle EmpByEmailVC. (Move back EmpByDeptVC). Click Find. In the Value field enter AKHOO. Click OK. f) It shows the employee details with Email AKHOO.
  • 130. 119/454 ADF Essentials Training by Deepak Bhagat 8.7 Creating Alternate Key Entity Constraints -o (Dependent on 6.6) Explore how to create alternate key constraint. 1) Right-click the EmployeesEO > select New Entity Constraint (from context menu). Create Entity Constraint wizard appears. 2) On the Name page of the wizard, keep default values. Click Next. 3) On the Attributes page of the wizard, from the Available pane, select PhoneNumber and shuttle it to Selected pane. Click Next. 4) On the Properties page of the wizard, select Alternate radio button (under Key Type section). Click Cancel (Do NOT Save).
  • 131. 120/454 ADF Essentials Training by Deepak Bhagat 8.8 Declaratively Populating Primary Key with a Database Sequence -o (Dependent on 6.6) Declaratively populate primary key with Database sequence. 1) Open the EmployeesEO in the editor. 2) Click the Attributes page. 3) Select the EmployeeId attribute. 4) In the Details tab, in the Type field select DBSequence, in the Sequence Name field enter EMPLOYEES_SEQ. 5) Do NOT Save. (revert back) 6) Additional advance extended example BATDBSequenceEg may be found under ...BATXtEg-ProprietaryL08-BATXtEg-DeclCustomization.
  • 132. 121/454 ADF Essentials Training by Deepak Bhagat 8.9 Lab Solution Lab solutions can be found under …BATHandoutsBATLabs-SolutionsBATLab_08.
  • 133. 122/454 ADF Essentials Training by Deepak Bhagat 8.10 References for Groovy -o 1) Groovy Language, guides, examples: http://groovy.codehaus.org 2) …BATDocs-TrainingReferenceL08-BAT Introduction to Groovy.pdf 3) http://www.oracle.com/technetwork/developer-tools/jdev/introduction-to-groovy-128837.pdf
  • 134. 123/454 ADF Essentials Training by Deepak Bhagat 8.11 Defining Dependent List of Values (LOV) -x Create a new application, displaying Locations containing Country LOV and State Province LOV, where State Province LOV is dependent on Country LOV. This would demonstrate that State Province LOV is dependent on Country LOV and hence called Dependent LOV. This topic is part of advance ADF extended example (BATDependentLOV-Eg) may be found under …BATHandoutsBATXtEg-ProprietaryL08-BATXtEg-DeclCustomization. For hands-on practice, please refer to Deepak Bhagat’s Blog at https://cloudadfdeepakb.blogspot.com or download from the above location. It's a lab sample on creating dependent or cascading List of Values (LOV).
  • 135. 124/454 ADF Essentials Training by Deepak Bhagat 8.12 View Criteria using Custom Operator -d This topic is part of the Advance ADF extended example, taken from the web. For optional self- paced hands-on practice, it may be further downloaded from …BATHandoutsOADFXtEg-DownloadedL08-ADFXtEg-DeclCustomization.