SlideShare a Scribd company logo
Oracle ADF & JDeveloper
for Forms Developers
Presented by: John Jay King
King Training Resources - john@kingtraining.com
Download this paper from: http://www.kingtraining.com
Copyright @ 2010, John Jay King
Copyright @ 2010, John Jay King2http://www.kingtraining.com
Objectives
– Learn how JDeveloper may be used to create
ADF-based applications
– Become familiar with ADF Faces and how it is
used to create user interfaces
– Use ADF BC to model data and address
business rules
Copyright @ 2010, John Jay King3http://www.kingtraining.com
Who Am I?
• John King – Partner, King Training Resources
• Providing training to Oracle and IT community for
over 20 years – http://www.kingtraining.com
• “Techie” who knows Oracle, SQL, Java, and
PL/SQL pretty well (along with many other topics)
• Leader in Service Oriented Architecture (SOA)
design and implementation
• Home is Centennial, Colorado – I love it here!
• Member of ODTUG (Oracle Development Tools
User Group) Board of Directors
• Active member of Rocky Mountain Oracle Users
Group (RMOUG)
Copyright @ 2010, John Jay King4http://www.kingtraining.com
Who Are You?
• Forms Developer
• Java Developer
• Both
• Neither
Copyright @ 2010, John Jay King5http://www.kingtraining.com
Is Forms Going Away?
• NO, NO, NO, NO, NO
• Oracle is committed to supporting Oracle Forms for
many years to come
• A new version of Oracle Forms (12g) is on the way!
Copyright @ 2010, John Jay King6http://www.kingtraining.com
Why ADF?
• Oracle Application Development Framework (ADF)
is a Java-based development tool (much like Forms
is a PL/SQL-based tool) designed to take full
advantage of Java Enterprise Edition or Java EE
• Java EE is one of the most widespread application
environments today
• Oracle is rewriting their ERP stack as “Fusion
Applications” using ADF; the already rich toolset
gets richer every day
Copyright @ 2010, John Jay King7http://www.kingtraining.com
Do I Need To Know Java?
• Probably not well
– Much the same as someone with basic PL/SQL
could create very basic Oracle Forms
– Someone with very basic Java and Web Skills
can easily create applications with ADF
• Someone on your team needs to know Java very
well
• Someone on your team needs to understand ADF
and its available components very well
Copyright @ 2010, John Jay King8http://www.kingtraining.com
What is ADF?
• ADF is a “meta-Framework” interacting with a variety of
underlying software components (including Frameworks) to
provide:
– Database connectivity and transfer
– Mapping of application views to data sources
– Database interaction: constraints, keys, data types,
master/detail, null handling
– Data caching via entity objects
– Transaction management (locks, commit, rollback, etc...)
– Declarative validation
– Business logic and event handling
– User Interface (UI) logic, flow, look & feel
– Data-bound UI Components
– UI properties including: formatting, colors, defaults, visual
components, LOVs, etc...
Copyright @ 2010, John Jay King9http://www.kingtraining.com
ADF Technology Stack
• ADF Technology simplifies interaction with “Java” EE
and Oracle’s Fusion Middleware
Copyright @ 2010, John Jay King10http://www.kingtraining.com
ADF: Two Major Pieces
• ADF has many parts but two are central to creating
applications
– ADF BC Business Components (data)
– ADF Faces Graphical User Interface
Copyright @ 2010, John Jay King11http://www.kingtraining.com
ADF Business Components (ADF BC)
• ADF Business Components is a framework that
simplifies developing Java EE business services
• ADF BC is part of the ADF Business Services layer
and is used to:
– Provide persistence and data retrieval with SQL
using data views
– Object-Relational Mapping (ORM) between Java
classes and database data
– Simplified data access, validation, and business
logic
– Provide transactional infrastructure
– Implement best practices
Copyright @ 2010, John Jay King12http://www.kingtraining.com
ADF BC Objects
• ADF BC is implemented using a variety of objects to:
– Define query views (read-only)
– Define Insert-Update-Delete views to perform
data manipulation
– Define links between queries
Copyright @ 2010, John Jay King13http://www.kingtraining.com
ADF BC - Component Structure
Copyright @ 2010, John Jay King14http://www.kingtraining.com
ADF BC Components
• ADF BC uses a variety of object types to represent data:
– Database tables and views Application Base Data
– Entity Objects Business rules, validations,
defaults for a table (or view)
– View Objects SQL output to query, filter,
join,modify, or sequence data
– Application Modules Use View Objects to
access/modify data acting as
a back-end data service
– Appl. Module Data Model Describes actual View
Object uses
• Objects may be reused in multiple Application Modules
Copyright @ 2010, John Jay King15http://www.kingtraining.com
ADF Data Binding
• After identifying Entity Objects and View Objects two
additional ADF Data Model components are used
– Data Controls Java objects used to
abstract View Object
Business Services
– Binding Containers Java object; provides
data access to a single
ADF application page,
fragment, or activity
Copyright @ 2010, John Jay King16http://www.kingtraining.com
Java Server Faces (JSF)
• Java Server Faces (JSF) is a Web-tier framework of
JSP technology and JSP Tag libraries to create and
use User Interface components
• JSF is extended by components of Oracle ADF
Faces
• JSF includes:
– Runtime architecture
– Library of JSF components
– JSF “Life Cycle”
– Many JSF-Oriented Files
Copyright @ 2010, John Jay King17http://www.kingtraining.com
ADF Faces
• Even though JSF sought to simplify user interface; it
is often felt to be too complex
• Oracle has extended JSF as “ADF Faces” providing
a set of libraries and tags that include enhanced UI
components and easier use
• Oracle has presented ADF Faces to the Open
Source community where it is part of the Apache
Foundation Trinidad MyFaces project
http://myfaces.apache.org/trinidad/index.html
Copyright @ 2010, John Jay King18http://www.kingtraining.com
Using ADF
• Using ADF Faces is simple using JDeveloper:
– Application layout containers
– Add ADF Faces components to layout containers
– All UI is done with ADF Faces; no HTML coding
• Features added by ADF Faces:
– Pop-ups and Dialog boxes
– Data Visualization Tools: Charts, graphics, etc...
– Declarative AJAX support
– More…
Copyright @ 2010, John Jay King19http://www.kingtraining.com
ADF Controller
• The ADF Controller extends the JSF controller and
controls ADF’s MVC (Model-View-Controller) in
ADF
• ADF Controller features include:
– Sequence of page displays (may be conditional)
– Allows partial-page processing in the same way
as full page processing; only the necessary part
of a page is rendered, the rest is unchanged
– Allows reuse of page parts
– Provides conditional control of page flow
Copyright @ 2010, John Jay King20http://www.kingtraining.com
ADF Faces “Rich-Client” Features
• ADF Faces is designed to create “rich-client” (RC)
interfaces; full-featured and declarative including:
– Complete JDeveloper support graphic
development (screen-painter) and property
palettes
– Visual Editor
– Property Inspector
– Changeable “skins” to easily alter look-and-feel
– Modifiable look-and-feel properties (declarative)
– Layout control
Copyright @ 2010, John Jay King21http://www.kingtraining.com
Oracle JDeveloper
• JDeveloper provides a world-class, easy to use IDE
• JDeveloper 11g is Oracle's latest release
• Oracle has extended JDeveloper beyond Java to include:
– Oracle ADF modeling, business services, and GUI design
– XML edit including Syntax Checking & Schema Validation
– SQL development including debugging of stored PL/SQL
– UML Modeling and MDA (Model Driven Architecture)
– Web Services development
– ESB design
– BPEL design
– Portlets
Copyright @ 2010, John Jay King22http://www.kingtraining.com
Downloading JDeveloper
• JDeveloper is Free!
• To learn more about JDeveloper, see Oracle's
website:
http://www.oracle.com/technology/products/jdev/index.html
Copyright @ 2010, John Jay King23http://www.kingtraining.com
Oracle WebLogic Server
• Oracle WebLogic Server is Oracle's preferred
platform to provide both a standard Java EE
environment and an environment specifically tailored
to Oracle Fusion Middleware; providing:
– Complete Java EE 5 compatibility
– Complete Java SE 6 compatibility
– Web Services support
– Integration with Oracle's Fusion Middleware tools
Copyright @ 2010, John Jay King24http://www.kingtraining.com
Oracle AS and OC4J?
• Oracle WebLogic Server is the replacement for
Oracle Application Server (OAS) and OC4J
• OAS and OC4J are still supported and may be used
instead of WebLogic if desired
• To learn more about Oracle WebLogic Server see
Oracle's website:
http://www.oracle.com/appserver/index.html
Copyright @ 2010, John Jay King25http://www.kingtraining.com
Starting JDeveloper
Copyright @ 2010, John Jay King26http://www.kingtraining.com
JDeveloper - Select Role
Copyright @ 2010, John Jay King27http://www.kingtraining.com
JDeveloper - Start Page
Copyright @ 2010, John Jay King28http://www.kingtraining.com
Exploring JDeveloper
Copyright @ 2010, John Jay King29http://www.kingtraining.com
Applications and Projects
• JDeveloper uses a non-standard, Oracle-specific
“Application” to group a collection of “Projects”
• All files representing an “Application” share a
common root directory (folder) on a disk
• Many Applications may be open at once in
JDeveloper; but only one at a time will be visible in
the Application Navigator
Copyright @ 2010, John Jay King30http://www.kingtraining.com
JDeveloper Directory Structure
Copyright @ 2010, John Jay King31http://www.kingtraining.com
JDeveloper Editing
• JDeveloper has a variety of Code Editors and Visual Editors;
including: Java, XML, HTML, JSP, JSF/ADF Faces, BPEL, and
more
Copyright @ 2010, John Jay King32http://www.kingtraining.com
JDeveloper Debugging
• JDeveloper allows both local and remote debugging
Copyright @ 2010, John Jay King33http://www.kingtraining.com
JDeveloper Preferences
• JDeveloper is customizable; preferences may be
viewed/modified using Tools->Preferences
Copyright @ 2010, John Jay King34http://www.kingtraining.com
New Application
• To create a new application use the JDeveloper menu's File-
>New->General->Applications option
Copyright @ 2010, John Jay King35http://www.kingtraining.com
New Gallery
Copyright @ 2010, John Jay King36http://www.kingtraining.com
Application Structure
• When a JDeveloper ADF Web Application is created
ADF uses the MVC (Model-View Controller) pattern
• JDeveloper creates two subordinate projects
– Model Data and Business Rules
– ViewController User Interface
– ADF provides the “Controller”
Copyright @ 2010, John Jay King37http://www.kingtraining.com
File Structure
• Review the directory structure created to support the
application and the associated projects
Copyright @ 2010, John Jay King38http://www.kingtraining.com
How It Looks In JDeveloper
Copyright @ 2010, John Jay King39http://www.kingtraining.com
Create ADF BC Objects
• The following pages show how to create ADF BC
objects using the Wizards provided by JDeveloper
• Each object created may be created individually
using JDeveloper's features or by coding them
manually rather than using the Wizards
• JDeveloper's database modeling capabilities are
shown to good effect by the use of Database
Connections and Wizards
Copyright @ 2010, John Jay King40http://www.kingtraining.com
Wizard-Based Development
• The “Create Business Objects from Tables” Wizard
follows a few simple steps:
– Create Business Component, select type of
Business Component to be built
– Select Database Connection to be used
(may create Database Connection via Wizard)
– Build Entity Objects using database Tables/Views
– Build Updateable View Objects (if desired)
– Build Read-Only View Objects (if desired)
– Save Application Module
Copyright @ 2010, John Jay King41http://www.kingtraining.com
New ADF BC Object: 1
• Start building new components as follows:
• Right-click on the application's “Model” project
and choose “New”
Copyright @ 2010, John Jay King42http://www.kingtraining.com
New ADF BC Object: 2
• Choose Business Tier -> ADF Business Components ->
Business Components from Tables from the “New Gallery
Copyright @ 2010, John Jay King43http://www.kingtraining.com
Choosing Database Connection
• Choose an existing Database Connection from the drop-down
list or build a new one by clicking the green plus sign
(Oracle client and tnsname.or not required!)
Copyright @ 2010, John Jay King44http://www.kingtraining.com
Create Database Connection
Copyright @ 2010, John Jay King45http://www.kingtraining.com
Create BC from Tables, 1
• Add, verify, or alter package name as desired; verify Schema to
be used; modify filter (if desired) using SQL “LIKE” wild cards;
click “Query” to view accessible database objects
Copyright @ 2010, John Jay King46http://www.kingtraining.com
Create BC from Tables, 2
• Choose the tables and/or views to be part of the Entity Object
and move them to the “Selected” side of the wizard display
Copyright @ 2010, John Jay King47http://www.kingtraining.com
Create BC from Tables, 3
• After creating Entity Objects; the wizard offers to create
Updateable View Objects -- View Objects represent the output
of SQL (used to query, filter, join, modify, or sequence data)
Copyright @ 2010, John Jay King48http://www.kingtraining.com
Create BC from Tables, 4
• Select Entity Objects to be used by the view being
created; move them to the “Selected” side of panel
Copyright @ 2010, John Jay King49http://www.kingtraining.com
Create BC from Tables, 5
• After creating Updateable View Objects; the wizard
goes on to create Read-Only View Objects
(might be useful to support an LOV (List-of-Values))
Copyright @ 2010, John Jay King50http://www.kingtraining.com
Create BC from Tables, 6
• Name the Application Module and save it; click Finish
Copyright @ 2010, John Jay King51http://www.kingtraining.com
Business Component Files
• Note the use of XML to declaratively support ADF BC
Copyright @ 2010, John Jay King52http://www.kingtraining.com
Business Component Browser
• JDeveloper provides a
tool to “browse”
ADF BC Application
Module objects
graphically; using the
Application Navigator,
find the Application
Module to be viewed;
right-click and choose
“Run” to start
Copyright @ 2010, John Jay King53http://www.kingtraining.com
Component Browser Choices
• Choose the Business Component to be tested
Copyright @ 2010, John Jay King54http://www.kingtraining.com
Component Browser – Display, 1
• Oracle’s Business Component Browser displays
data from the underlying database objects
(this should look familiar to Forms users)
• If referential keys are defined in the database
(Primary Keys and Foreign Keys) the ADF BC
Wizard automatically arranges the tables into a
Master-Detail relationship
Copyright @ 2010, John Jay King55http://www.kingtraining.com
Component Browser – Display, 2
Copyright @ 2010, John Jay King56http://www.kingtraining.com
Searching Data
• Use the “Specify View Criteria” (Binocular) icon to Search
Copyright @ 2010, John Jay King57http://www.kingtraining.com
Search View Criteria
• Enter Search criteria and click “Find”
Copyright @ 2010, John Jay King58http://www.kingtraining.com
Search Results
Copyright @ 2010, John Jay King59http://www.kingtraining.com
Browsing Database Objects
• JDeveloper’s Database Navigator allows browsing of
database objects (parts of Oracle's SQL Developer
tool have been incorporated into JDeveloper)
Copyright @ 2010, John Jay King60http://www.kingtraining.com
Modification of Application
• Once the initial Business Components are created in
the application, it might be useful to:
– set default values
– define formatting
– validate data
Copyright @ 2010, John Jay King61http://www.kingtraining.com
Object Properties
• Like Oracle Forms (and other 4GLs) properties are
listed
Copyright @ 2010, John Jay King62http://www.kingtraining.com
Properties in XML Files
• ADF uses XML files to store declared definitions
Copyright @ 2010, John Jay King63http://www.kingtraining.com
Modify Appearance and Formatting
• Use JDeveloper to modify appearance of database
column values by double-clicking an Entity Object
Copyright @ 2010, John Jay King64http://www.kingtraining.com
Entity Object Edit Panel
Copyright @ 2010, John Jay King65http://www.kingtraining.com
Entity Object Attributes
Copyright @ 2010, John Jay King66http://www.kingtraining.com
Entity Object Validators
Copyright @ 2010, John Jay King67http://www.kingtraining.com
Validations and Business Logic
• Validations and Business Logic may be added including:
– Client-side validation
– Format masks
– Default Values
– Declarative Range (and other) Validation
– CSS (Visual Attributes)
– List of Values
– Calculated field
– Code Validation
– Extensible for complex application validation
– Transactional Triggers
Copyright @ 2010, John Jay King68http://www.kingtraining.com
Validation Rules
Copyright @ 2010, John Jay King69http://www.kingtraining.com
Validation Error Messages
Copyright @ 2010, John Jay King70http://www.kingtraining.com
Attribute Defaults
• Using the Property Palette, open the “Value”
properties and set the default value (in this case
“adf.currentDate” using ADF’s “Groovy” support)
Copyright @ 2010, John Jay King71http://www.kingtraining.com
Attribute Formatting
• Use an Attribute's Property Palette “UI Hints”
section to control formatting, label, tool tip, etc…
(note this formatting uses Java SimpleDateFormat
options)
Copyright @ 2010, John Jay King72http://www.kingtraining.com
What Does the XML Look Like?
Copyright @ 2010, John Jay King73http://www.kingtraining.com
Date Mask Properties File
Copyright @ 2010, John Jay King74http://www.kingtraining.com
Comparison to Oracle Forms
• In Oracle Forms we defined “data blocks” that
represented tables and views that would be used in
our forms
• ADF BC components do that and more, plus they
may be shared by many applications
• In Oracle Forms once the “data block” was created
we would then use it to create the presentation
• With ADF we use ADF Faces to accomplish the
same thing and more
(again creating components that may be reused by
other applications)
Copyright @ 2010, John Jay King75http://www.kingtraining.com
Creating Web Applications
• Oracle’s Business Component Browser is
impressive, but it's hardly a customer-facing user
interface
• ADF Faces extends the Java Server Faces (JSF)
framework using XML tags to describe the user
interface
• ADF Faces provides a Rich-Client Interface that
uses JavaScript and AJAX components; therefore
users must have a reasonably up-to-date browser
(Internet Explorer 7.0 or higher, Mozilla Firefox 2.0
or higher, Safari 3.0 or higher) to use all of its
features
• ADF Faces is designed to make creation of “rich-
client” (RC) interfaces full-featured and declarative
where possible
Copyright @ 2010, John Jay King76http://www.kingtraining.com
Review of Web Processing
Copyright @ 2010, John Jay King77http://www.kingtraining.com
HTML, CSS, and Forms
• Even though the ultimate page delivered to the Client Browser
is HTML; with JDeveloper's Visual Editor and the combination
of ADF Faces and JSF Faces it uses to create .jspx pages
there is little need for ADF Developers to code HTML or CSS
• Yield to JDeveloper's declarative mechanism and refrain from
coding
Copyright @ 2010, John Jay King78http://www.kingtraining.com
ADF Controller
• The ADF Controller extends the standard JSF
controller and controls the MVC in ADF
• ADF Controller features include:
– Sequence of page displays (may be conditional)
– Allows partial-page processing in the same way
as full page processing; only the necessary part
of a page is rendered, the rest is unchanged
(makes page processing faster)
– Allows reuse of page parts
– Provides conditional control of page flow
Copyright @ 2010, John Jay King79http://www.kingtraining.com
JSF Life Cycle
• JSF (and ADF Faces) perform a predictable cycle as follows:
1. Restore Components
2. Apply Request Values
3. Process Validations
4. Update Model Values
5. Invoke Application
6. Render Response
• This Life Cycle is normally transparent; however, it is useful to understand
it when debugging
Copyright @ 2010, John Jay King80http://www.kingtraining.com
JDeveloper Visual Designer
• JDeveloper's Visual Designer may be used to “paint”
a User Interface using the Component Palette
• The JDeveloper Visual Designer is intended to be
WYSIWYG (What You See Is What You Get);
however the nature of the web and HTML is that it's
really WYSIKOWYG (What You See Is Kind-Of
What You Get)
Copyright @ 2010, John Jay King81http://www.kingtraining.com
ADF Faces Component Palette
• The ADF Faces
Component Palette
includes icons representing
various User Interface
objects
• Drag-and-drop desired
components into the
position desired
Copyright @ 2010, John Jay King82http://www.kingtraining.com
Property Inspector
• When editing Web Pages, the Property Inspector
shows properties for the various “facets” and
components displayed upon the page
Copyright @ 2010, John Jay King83http://www.kingtraining.com
Facets in Structure Window
• The “facets” are components
that are used to contain
groups of other components
• JDeveloper’s “Structure”
Window” lists facets in the
current page
Copyright @ 2010, John Jay King84http://www.kingtraining.com
Panel and Panel Splitter
• Pages in ADF are sometimes divided by Panels;
pre-existing templates exist to help create the
number of desired Panels
• Each Panel in turn may be divided into smaller
areas using a Panel Splitter
– By default Panel Splitters split an area
horizontally
– Panel Splitters have an “Orientation” property that
allow the split to be vertical
Copyright @ 2010, John Jay King85http://www.kingtraining.com
Panel Collections, Accordions, Tabbed Panels
• Panel Collections are facets that contain other
objects
• Panel Accordions are facets that contain other
objects but shrink-and-grow depending upon mouse
movement
• Tabbed Panels are facets that allow components to
be placed into a tabbed structure
Copyright @ 2010, John Jay King86http://www.kingtraining.com
User Interface (UI) Components
• UI Components provided by ADF Faces include:
– Buttons
– Calendars
– Choose Color
– Forms
– Input Text
– Output Text
– Panel Collection
– Submit
– Tables
– more…
Copyright @ 2010, John Jay King87http://www.kingtraining.com
Binding Data
• JDeveloper's interface will allow not only the
creation of web components using drag-and-drop
processing
• Drag-and-drop may also be used to associate View
Objects with UI Components
• This has the effect of “binding” the data to the data
control object
Copyright @ 2010, John Jay King88http://www.kingtraining.com
Creating ADF Faces / JSF Pages
• The following pages walk through the creation of a
simple Web Application using ADF Faces and ADF
BC objects as follows:
1. Design Web Page
2. Create new JSF Page using JDeveloper
3. Add Visual Components to JSF Page
4. Bind Visual Components to ADF BC Objects
Copyright @ 2010, John Jay King89http://www.kingtraining.com
Create ADF Faces Page
• To create an ADF Faces page, right-click on an
Application's ViewController Project and choose “New”
to display the “New Gallery” dialog
Copyright @ 2010, John Jay King90http://www.kingtraining.com
New Gallery
Copyright @ 2010, John Jay King91http://www.kingtraining.com
Naming Web Page
– Note the “Create as XML Document (*.jspx)” box
Copyright @ 2010, John Jay King92http://www.kingtraining.com
Visual Display with Initial Screen
Copyright @ 2010, John Jay King93http://www.kingtraining.com
Three-Column Layout
• The supplied three-column layout is ready to have
objects dropped into it
Copyright @ 2010, John Jay King94http://www.kingtraining.com
Deleting Panel from Layout
• Sometimes you want a two-column layout rather
than three; just select the panel you don’t want and
delete
Copyright @ 2010, John Jay King95http://www.kingtraining.com
Common Components
Copyright @ 2010, John Jay King96http://www.kingtraining.com
Layout Components
Copyright @ 2010, John Jay King97http://www.kingtraining.com
Operations Components
Copyright @ 2010, John Jay King98http://www.kingtraining.com
Adding Accordion Component
• To add an Accordion Component to the web page;
Panel Accordion component from the pallet to the
desired column (“start”)
Copyright @ 2010, John Jay King99http://www.kingtraining.com
Change Accordion Title Property
• To alter the Accordion's
title, click on the
Accordion and modify
its Property Inspector
Text item
(changed to “Depts”)
Copyright @ 2010, John Jay King100http://www.kingtraining.com
Add Data Component
• Right-click in the “Depts” Accordion; when prompted
choose “Insert After Show Details Item - Depts ->
Show Detail Item” to add another Accordion to the
page (not used further in this demo…)
Copyright @ 2010, John Jay King101http://www.kingtraining.com
Using Panel Splitter
• To divide the right-part
of the page (Center)
into two parts; find the
“Panel Splitter”
component then drag it
to the column marked
“Center”
• Next, change it's
“Orientation” property to
“Vertical”
Copyright @ 2010, John Jay King102http://www.kingtraining.com
Page After Splitting
• After splitting; the page looks something like this:
– The “Depts” part will hold specifics for one Department
– The “first” part will hold a list of Department employees
– The “second” part of the page will hold details for an
individual Employee
Copyright @ 2010, John Jay King103http://www.kingtraining.com
Adding Collection and Tabbed Area
• Find the “Panel Collection”
component in the Layout
components and drag it to the
“first” (top) part of the Splitter
area
• Find the “Panel Tabbed”
component in the Layout
components and drag it to the
“second” (bottom) part of the
Splitter area
Copyright @ 2010, John Jay King104http://www.kingtraining.com
Data Binding: Adding Data, 1
• To “bind” data to web page components, simply
drag ADF BC data objects to the Visual Editor
• Open the “Application Navigator” and expand the
“Data Controls” accordion to see the ADF BC
components created earlier then drag “DeptView1”
to the “Depts” accordion
Copyright @ 2010, John Jay King105http://www.kingtraining.com
Data Binding: Adding Data, 2
• When prompted;
choose “Create Forms -
> ADF Read-Only
Form” to populate the
Department data
display
Copyright @ 2010, John Jay King106http://www.kingtraining.com
Adding Navigation Controls
• Check the “Include Navigation Controls” box
• You may also modify display labels and add, delete, or
reorganize the values displayed
Copyright @ 2010, John Jay King107http://www.kingtraining.com
Department Display Area
• After adding the Department information; the “Depts”
accordion should look like the following
Copyright @ 2010, John Jay King108http://www.kingtraining.com
Adding Department Employees
• Next, to add Department
Employees to the page,
drag the EmpView2 data
control
• When prompted, choose
“Create Tables -> ADF
Read-Only Table” again
Copyright @ 2010, John Jay King109http://www.kingtraining.com
Add Employee Navigation Controls
• Check all three navigation controls:
• Row Selection (user may select), filtering (user may
search), and sort; as before columns may be
relabelled, added, deleted, reorganized
Copyright @ 2010, John Jay King110http://www.kingtraining.com
Department Employee Area
Copyright @ 2010, John Jay King111http://www.kingtraining.com
Adding Individual Employee
• Finally, add the individual Employee
display to the Tabbed area at the
bottom of the page
• When prompted, choose “Create Forms -> ADF Form” to
select the display format (this part of the form will be
editable)
Copyright @ 2010, John Jay King112http://www.kingtraining.com
Add Employee Navigation
• Delete the COMM and DEPTNO data from the display
(highlight & click X); check “Include Submit Button”
Copyright @ 2010, John Jay King113http://www.kingtraining.com
Completed Web Application Page
Copyright @ 2010, John Jay King114http://www.kingtraining.com
Testing the Web Application
• To begin testing the Web Application; right-click the
“.jspx” file created in the ViewController project and
choose “Run”
Copyright @ 2010, John Jay King115http://www.kingtraining.com
Be Patient!
• The first time you execute a Web application JDeveloper will
start its built-in WebLogic Application Server; this takes a while
• You can track the progress of the Server's startup in
JDeveloper's DefaultServer Log
• Once the Server is “up” your web page should be displayed in a
browser (again, please be patient!)
Copyright @ 2010, John Jay King116http://www.kingtraining.com
Web Page in Browser
Copyright @ 2010, John Jay King117http://www.kingtraining.com
Files Supporting Web Application
• Several files make up the typical ADF Web
Application
– A .jspx file is used to define each web page
– Web pages reference a page definition XML file
(.xml)
– Bindings are described in another XML file (.cpx)
Copyright @ 2010, John Jay King118http://www.kingtraining.com
JSF .jspx File
• ADF defines a web page using an XML .jspx file
Copyright @ 2010, John Jay King119http://www.kingtraining.com
ADF Web Page Definition file (.xml)
Copyright @ 2010, John Jay King120http://www.kingtraining.com
ADF Bindings XML file (.cpx)
Copyright @ 2010, John Jay King121http://www.kingtraining.com
ADF Faces ViewController Files
• The XML files representing
the ViewController project are
distributed using a directory
structure
Copyright @ 2010, John Jay King122http://www.kingtraining.com
Available Books
• Oracle JDevloper 11g Handbook
– Duncan Mills,
Peter Koletzke,
Dr. Avrom Roy-Federman
– Oracle Press
• Oracle Fusion Developer's Guide
– Frank Nimphius,
Lynn Munsinger
– Oracle Press
Copyright @ 2010, John Jay King123http://www.kingtraining.com
Wrapping It Up
• Oracle Forms is not going anywhere; it is not
necessary to “convert” things to ADF
• Oracle’s design emphasis and new features will
support the Java-based ADF mechanism; Oracle
Forms probably won’t see much in the way of new
functionality
• JDeveloper and ADF allow me to create simple
forms almost as easily as in forms except:
• ADF BC for data creates reusable components
• ADF Faces for view creates reusable components
• I did not write a single line of Java in this demo!
Training Days 2011
February 15-17 2011
Save the dates!
June 27-July 1 2010
Washington, DC
ODTUG Kaleidoscope 2010
Oracle ADF & JDeveloper
for Forms Developers
To contact the author:
John King
King Training Resources
6341 South Williams Street
Littleton, CO 80121-2627 USA
1.800.252.0652 - 1.303.798.5727
Email: john@kingtraining.com
Today’s slides are on the web:TodayToday’’s slides are on the web:s slides are on the web:
http://www.kingtraining.com
Thanks for your attention!
▬
Please fill out session Evaluations

More Related Content

PDF
Oracle adfj developer slides
PPTX
ADF in Action - getting (re)acquainted with Oracle’s premier application deve...
PDF
Oracle ADF Architecture TV - Design - Application Customization and MDS
PDF
Oracle ADF Architecture TV - Design - Designing for Security
PPT
Seamless Integrations between WebCenter Content, Site Studio, and WebCenter S...
PPT
Apex ace update
PDF
Oracle ADF Architecture TV - Design - ADF Architectural Patterns
PDF
Programming-best practices( beginner) ADF_fusionapps
Oracle adfj developer slides
ADF in Action - getting (re)acquainted with Oracle’s premier application deve...
Oracle ADF Architecture TV - Design - Application Customization and MDS
Oracle ADF Architecture TV - Design - Designing for Security
Seamless Integrations between WebCenter Content, Site Studio, and WebCenter S...
Apex ace update
Oracle ADF Architecture TV - Design - ADF Architectural Patterns
Programming-best practices( beginner) ADF_fusionapps

What's hot (20)

PPT
Deep Dive: Oracle WebCenter Content Tips and Traps!
PDF
Oracle Application Express 20.2 New Features
PPSX
Oracle ADF Overview for Beginners
PPT
WebCenter Content & Portal Methodology Deep Dive with Case Studies
PPTX
An Oracle ADF Introduction
KEY
FatWire Tutorial For Site Studio Developers
PPTX
Oracle Apex Technical Introduction
PDF
Oracle ADF Architecture TV - Deployment - Deployment Options
PPT
Oracle WebCenter Solutions
PPTX
ADF Bindings & Data Controls
PPT
JSF On Rails - Devoxx 2008
PPTX
Oracle Alta UI Patterns for Enterprise Applications and Responsive UI Support
PDF
Integrating ECM (WebCenter Content) with your Enterprise! 5 Tips to Try, 5 Tr...
PPTX
Sitecore xDB - Architecture and Configuration
PPTX
Adf & Jdeveloper overview
PDF
The dashboarding problem
PDF
Oracle ADF Architecture TV - Deployment - Build Options
DOC
Chalam_JAVA_Portal
PDF
LinkedIn Data Infrastructure Slides (Version 2)
DOC
My Resume_Uday -
Deep Dive: Oracle WebCenter Content Tips and Traps!
Oracle Application Express 20.2 New Features
Oracle ADF Overview for Beginners
WebCenter Content & Portal Methodology Deep Dive with Case Studies
An Oracle ADF Introduction
FatWire Tutorial For Site Studio Developers
Oracle Apex Technical Introduction
Oracle ADF Architecture TV - Deployment - Deployment Options
Oracle WebCenter Solutions
ADF Bindings & Data Controls
JSF On Rails - Devoxx 2008
Oracle Alta UI Patterns for Enterprise Applications and Responsive UI Support
Integrating ECM (WebCenter Content) with your Enterprise! 5 Tips to Try, 5 Tr...
Sitecore xDB - Architecture and Configuration
Adf & Jdeveloper overview
The dashboarding problem
Oracle ADF Architecture TV - Deployment - Build Options
Chalam_JAVA_Portal
LinkedIn Data Infrastructure Slides (Version 2)
My Resume_Uday -
Ad

Similar to Oracle ADF (Application Development Framework) for Forms, Developers Slides (20)

PPT
Greate Introduction to Oracle Fusion Middleware and ADF
PPTX
Oracle Application Developmenr Framework
PPT
SOA 11g Foundation - G - ADF Development.ppt
PPT
Application development framework
PPT
J developer, oracle adf introduction
PDF
Mt ADF 001 adf-course outlines
PDF
ADF Introduction By Sandeep Sharda
PDF
A guide to ADF fusion development
PDF
Vesterli hot and_not_whitepaper_wildcard_2013
PDF
Oracle® Fusion Middleware
PPTX
OAF & ADF.pptx
PPTX
TeKslate Oracle ADF
PDF
Oracle Master Serials Technology Experience Program 2013 - ADF
PPTX
Oracel ADF Introduction
PDF
Oracle ADF Tutorial
PPTX
The Five Ways of Building Oracle Applications
PPT
Dms 2.0 Direction
PPT
Metamorphosis from Forms to Java: A technical lead's perspective, part II
PPT
01FusionADFIntro_01FusionADFIntro___.ppt
Greate Introduction to Oracle Fusion Middleware and ADF
Oracle Application Developmenr Framework
SOA 11g Foundation - G - ADF Development.ppt
Application development framework
J developer, oracle adf introduction
Mt ADF 001 adf-course outlines
ADF Introduction By Sandeep Sharda
A guide to ADF fusion development
Vesterli hot and_not_whitepaper_wildcard_2013
Oracle® Fusion Middleware
OAF & ADF.pptx
TeKslate Oracle ADF
Oracle Master Serials Technology Experience Program 2013 - ADF
Oracel ADF Introduction
Oracle ADF Tutorial
The Five Ways of Building Oracle Applications
Dms 2.0 Direction
Metamorphosis from Forms to Java: A technical lead's perspective, part II
01FusionADFIntro_01FusionADFIntro___.ppt
Ad

Recently uploaded (20)

PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PPTX
Operating system designcfffgfgggggggvggggggggg
PPTX
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
PPTX
ai tools demonstartion for schools and inter college
PPTX
ISO 45001 Occupational Health and Safety Management System
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PPT
Introduction Database Management System for Course Database
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
PTS Company Brochure 2025 (1).pdf.......
PPTX
CHAPTER 2 - PM Management and IT Context
PPTX
Odoo POS Development Services by CandidRoot Solutions
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
Understanding Forklifts - TECH EHS Solution
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
top salesforce developer skills in 2025.pdf
PDF
Nekopoi APK 2025 free lastest update
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
How to Migrate SBCGlobal Email to Yahoo Easily
Operating system designcfffgfgggggggvggggggggg
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
ai tools demonstartion for schools and inter college
ISO 45001 Occupational Health and Safety Management System
Odoo Companies in India – Driving Business Transformation.pdf
Introduction Database Management System for Course Database
Navsoft: AI-Powered Business Solutions & Custom Software Development
PTS Company Brochure 2025 (1).pdf.......
CHAPTER 2 - PM Management and IT Context
Odoo POS Development Services by CandidRoot Solutions
VVF-Customer-Presentation2025-Ver1.9.pptx
Understanding Forklifts - TECH EHS Solution
Wondershare Filmora 15 Crack With Activation Key [2025
top salesforce developer skills in 2025.pdf
Nekopoi APK 2025 free lastest update
Internet Downloader Manager (IDM) Crack 6.42 Build 41
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Upgrade and Innovation Strategies for SAP ERP Customers

Oracle ADF (Application Development Framework) for Forms, Developers Slides

  • 1. Oracle ADF & JDeveloper for Forms Developers Presented by: John Jay King King Training Resources - john@kingtraining.com Download this paper from: http://www.kingtraining.com Copyright @ 2010, John Jay King
  • 2. Copyright @ 2010, John Jay King2http://www.kingtraining.com Objectives – Learn how JDeveloper may be used to create ADF-based applications – Become familiar with ADF Faces and how it is used to create user interfaces – Use ADF BC to model data and address business rules
  • 3. Copyright @ 2010, John Jay King3http://www.kingtraining.com Who Am I? • John King – Partner, King Training Resources • Providing training to Oracle and IT community for over 20 years – http://www.kingtraining.com • “Techie” who knows Oracle, SQL, Java, and PL/SQL pretty well (along with many other topics) • Leader in Service Oriented Architecture (SOA) design and implementation • Home is Centennial, Colorado – I love it here! • Member of ODTUG (Oracle Development Tools User Group) Board of Directors • Active member of Rocky Mountain Oracle Users Group (RMOUG)
  • 4. Copyright @ 2010, John Jay King4http://www.kingtraining.com Who Are You? • Forms Developer • Java Developer • Both • Neither
  • 5. Copyright @ 2010, John Jay King5http://www.kingtraining.com Is Forms Going Away? • NO, NO, NO, NO, NO • Oracle is committed to supporting Oracle Forms for many years to come • A new version of Oracle Forms (12g) is on the way!
  • 6. Copyright @ 2010, John Jay King6http://www.kingtraining.com Why ADF? • Oracle Application Development Framework (ADF) is a Java-based development tool (much like Forms is a PL/SQL-based tool) designed to take full advantage of Java Enterprise Edition or Java EE • Java EE is one of the most widespread application environments today • Oracle is rewriting their ERP stack as “Fusion Applications” using ADF; the already rich toolset gets richer every day
  • 7. Copyright @ 2010, John Jay King7http://www.kingtraining.com Do I Need To Know Java? • Probably not well – Much the same as someone with basic PL/SQL could create very basic Oracle Forms – Someone with very basic Java and Web Skills can easily create applications with ADF • Someone on your team needs to know Java very well • Someone on your team needs to understand ADF and its available components very well
  • 8. Copyright @ 2010, John Jay King8http://www.kingtraining.com What is ADF? • ADF is a “meta-Framework” interacting with a variety of underlying software components (including Frameworks) to provide: – Database connectivity and transfer – Mapping of application views to data sources – Database interaction: constraints, keys, data types, master/detail, null handling – Data caching via entity objects – Transaction management (locks, commit, rollback, etc...) – Declarative validation – Business logic and event handling – User Interface (UI) logic, flow, look & feel – Data-bound UI Components – UI properties including: formatting, colors, defaults, visual components, LOVs, etc...
  • 9. Copyright @ 2010, John Jay King9http://www.kingtraining.com ADF Technology Stack • ADF Technology simplifies interaction with “Java” EE and Oracle’s Fusion Middleware
  • 10. Copyright @ 2010, John Jay King10http://www.kingtraining.com ADF: Two Major Pieces • ADF has many parts but two are central to creating applications – ADF BC Business Components (data) – ADF Faces Graphical User Interface
  • 11. Copyright @ 2010, John Jay King11http://www.kingtraining.com ADF Business Components (ADF BC) • ADF Business Components is a framework that simplifies developing Java EE business services • ADF BC is part of the ADF Business Services layer and is used to: – Provide persistence and data retrieval with SQL using data views – Object-Relational Mapping (ORM) between Java classes and database data – Simplified data access, validation, and business logic – Provide transactional infrastructure – Implement best practices
  • 12. Copyright @ 2010, John Jay King12http://www.kingtraining.com ADF BC Objects • ADF BC is implemented using a variety of objects to: – Define query views (read-only) – Define Insert-Update-Delete views to perform data manipulation – Define links between queries
  • 13. Copyright @ 2010, John Jay King13http://www.kingtraining.com ADF BC - Component Structure
  • 14. Copyright @ 2010, John Jay King14http://www.kingtraining.com ADF BC Components • ADF BC uses a variety of object types to represent data: – Database tables and views Application Base Data – Entity Objects Business rules, validations, defaults for a table (or view) – View Objects SQL output to query, filter, join,modify, or sequence data – Application Modules Use View Objects to access/modify data acting as a back-end data service – Appl. Module Data Model Describes actual View Object uses • Objects may be reused in multiple Application Modules
  • 15. Copyright @ 2010, John Jay King15http://www.kingtraining.com ADF Data Binding • After identifying Entity Objects and View Objects two additional ADF Data Model components are used – Data Controls Java objects used to abstract View Object Business Services – Binding Containers Java object; provides data access to a single ADF application page, fragment, or activity
  • 16. Copyright @ 2010, John Jay King16http://www.kingtraining.com Java Server Faces (JSF) • Java Server Faces (JSF) is a Web-tier framework of JSP technology and JSP Tag libraries to create and use User Interface components • JSF is extended by components of Oracle ADF Faces • JSF includes: – Runtime architecture – Library of JSF components – JSF “Life Cycle” – Many JSF-Oriented Files
  • 17. Copyright @ 2010, John Jay King17http://www.kingtraining.com ADF Faces • Even though JSF sought to simplify user interface; it is often felt to be too complex • Oracle has extended JSF as “ADF Faces” providing a set of libraries and tags that include enhanced UI components and easier use • Oracle has presented ADF Faces to the Open Source community where it is part of the Apache Foundation Trinidad MyFaces project http://myfaces.apache.org/trinidad/index.html
  • 18. Copyright @ 2010, John Jay King18http://www.kingtraining.com Using ADF • Using ADF Faces is simple using JDeveloper: – Application layout containers – Add ADF Faces components to layout containers – All UI is done with ADF Faces; no HTML coding • Features added by ADF Faces: – Pop-ups and Dialog boxes – Data Visualization Tools: Charts, graphics, etc... – Declarative AJAX support – More…
  • 19. Copyright @ 2010, John Jay King19http://www.kingtraining.com ADF Controller • The ADF Controller extends the JSF controller and controls ADF’s MVC (Model-View-Controller) in ADF • ADF Controller features include: – Sequence of page displays (may be conditional) – Allows partial-page processing in the same way as full page processing; only the necessary part of a page is rendered, the rest is unchanged – Allows reuse of page parts – Provides conditional control of page flow
  • 20. Copyright @ 2010, John Jay King20http://www.kingtraining.com ADF Faces “Rich-Client” Features • ADF Faces is designed to create “rich-client” (RC) interfaces; full-featured and declarative including: – Complete JDeveloper support graphic development (screen-painter) and property palettes – Visual Editor – Property Inspector – Changeable “skins” to easily alter look-and-feel – Modifiable look-and-feel properties (declarative) – Layout control
  • 21. Copyright @ 2010, John Jay King21http://www.kingtraining.com Oracle JDeveloper • JDeveloper provides a world-class, easy to use IDE • JDeveloper 11g is Oracle's latest release • Oracle has extended JDeveloper beyond Java to include: – Oracle ADF modeling, business services, and GUI design – XML edit including Syntax Checking & Schema Validation – SQL development including debugging of stored PL/SQL – UML Modeling and MDA (Model Driven Architecture) – Web Services development – ESB design – BPEL design – Portlets
  • 22. Copyright @ 2010, John Jay King22http://www.kingtraining.com Downloading JDeveloper • JDeveloper is Free! • To learn more about JDeveloper, see Oracle's website: http://www.oracle.com/technology/products/jdev/index.html
  • 23. Copyright @ 2010, John Jay King23http://www.kingtraining.com Oracle WebLogic Server • Oracle WebLogic Server is Oracle's preferred platform to provide both a standard Java EE environment and an environment specifically tailored to Oracle Fusion Middleware; providing: – Complete Java EE 5 compatibility – Complete Java SE 6 compatibility – Web Services support – Integration with Oracle's Fusion Middleware tools
  • 24. Copyright @ 2010, John Jay King24http://www.kingtraining.com Oracle AS and OC4J? • Oracle WebLogic Server is the replacement for Oracle Application Server (OAS) and OC4J • OAS and OC4J are still supported and may be used instead of WebLogic if desired • To learn more about Oracle WebLogic Server see Oracle's website: http://www.oracle.com/appserver/index.html
  • 25. Copyright @ 2010, John Jay King25http://www.kingtraining.com Starting JDeveloper
  • 26. Copyright @ 2010, John Jay King26http://www.kingtraining.com JDeveloper - Select Role
  • 27. Copyright @ 2010, John Jay King27http://www.kingtraining.com JDeveloper - Start Page
  • 28. Copyright @ 2010, John Jay King28http://www.kingtraining.com Exploring JDeveloper
  • 29. Copyright @ 2010, John Jay King29http://www.kingtraining.com Applications and Projects • JDeveloper uses a non-standard, Oracle-specific “Application” to group a collection of “Projects” • All files representing an “Application” share a common root directory (folder) on a disk • Many Applications may be open at once in JDeveloper; but only one at a time will be visible in the Application Navigator
  • 30. Copyright @ 2010, John Jay King30http://www.kingtraining.com JDeveloper Directory Structure
  • 31. Copyright @ 2010, John Jay King31http://www.kingtraining.com JDeveloper Editing • JDeveloper has a variety of Code Editors and Visual Editors; including: Java, XML, HTML, JSP, JSF/ADF Faces, BPEL, and more
  • 32. Copyright @ 2010, John Jay King32http://www.kingtraining.com JDeveloper Debugging • JDeveloper allows both local and remote debugging
  • 33. Copyright @ 2010, John Jay King33http://www.kingtraining.com JDeveloper Preferences • JDeveloper is customizable; preferences may be viewed/modified using Tools->Preferences
  • 34. Copyright @ 2010, John Jay King34http://www.kingtraining.com New Application • To create a new application use the JDeveloper menu's File- >New->General->Applications option
  • 35. Copyright @ 2010, John Jay King35http://www.kingtraining.com New Gallery
  • 36. Copyright @ 2010, John Jay King36http://www.kingtraining.com Application Structure • When a JDeveloper ADF Web Application is created ADF uses the MVC (Model-View Controller) pattern • JDeveloper creates two subordinate projects – Model Data and Business Rules – ViewController User Interface – ADF provides the “Controller”
  • 37. Copyright @ 2010, John Jay King37http://www.kingtraining.com File Structure • Review the directory structure created to support the application and the associated projects
  • 38. Copyright @ 2010, John Jay King38http://www.kingtraining.com How It Looks In JDeveloper
  • 39. Copyright @ 2010, John Jay King39http://www.kingtraining.com Create ADF BC Objects • The following pages show how to create ADF BC objects using the Wizards provided by JDeveloper • Each object created may be created individually using JDeveloper's features or by coding them manually rather than using the Wizards • JDeveloper's database modeling capabilities are shown to good effect by the use of Database Connections and Wizards
  • 40. Copyright @ 2010, John Jay King40http://www.kingtraining.com Wizard-Based Development • The “Create Business Objects from Tables” Wizard follows a few simple steps: – Create Business Component, select type of Business Component to be built – Select Database Connection to be used (may create Database Connection via Wizard) – Build Entity Objects using database Tables/Views – Build Updateable View Objects (if desired) – Build Read-Only View Objects (if desired) – Save Application Module
  • 41. Copyright @ 2010, John Jay King41http://www.kingtraining.com New ADF BC Object: 1 • Start building new components as follows: • Right-click on the application's “Model” project and choose “New”
  • 42. Copyright @ 2010, John Jay King42http://www.kingtraining.com New ADF BC Object: 2 • Choose Business Tier -> ADF Business Components -> Business Components from Tables from the “New Gallery
  • 43. Copyright @ 2010, John Jay King43http://www.kingtraining.com Choosing Database Connection • Choose an existing Database Connection from the drop-down list or build a new one by clicking the green plus sign (Oracle client and tnsname.or not required!)
  • 44. Copyright @ 2010, John Jay King44http://www.kingtraining.com Create Database Connection
  • 45. Copyright @ 2010, John Jay King45http://www.kingtraining.com Create BC from Tables, 1 • Add, verify, or alter package name as desired; verify Schema to be used; modify filter (if desired) using SQL “LIKE” wild cards; click “Query” to view accessible database objects
  • 46. Copyright @ 2010, John Jay King46http://www.kingtraining.com Create BC from Tables, 2 • Choose the tables and/or views to be part of the Entity Object and move them to the “Selected” side of the wizard display
  • 47. Copyright @ 2010, John Jay King47http://www.kingtraining.com Create BC from Tables, 3 • After creating Entity Objects; the wizard offers to create Updateable View Objects -- View Objects represent the output of SQL (used to query, filter, join, modify, or sequence data)
  • 48. Copyright @ 2010, John Jay King48http://www.kingtraining.com Create BC from Tables, 4 • Select Entity Objects to be used by the view being created; move them to the “Selected” side of panel
  • 49. Copyright @ 2010, John Jay King49http://www.kingtraining.com Create BC from Tables, 5 • After creating Updateable View Objects; the wizard goes on to create Read-Only View Objects (might be useful to support an LOV (List-of-Values))
  • 50. Copyright @ 2010, John Jay King50http://www.kingtraining.com Create BC from Tables, 6 • Name the Application Module and save it; click Finish
  • 51. Copyright @ 2010, John Jay King51http://www.kingtraining.com Business Component Files • Note the use of XML to declaratively support ADF BC
  • 52. Copyright @ 2010, John Jay King52http://www.kingtraining.com Business Component Browser • JDeveloper provides a tool to “browse” ADF BC Application Module objects graphically; using the Application Navigator, find the Application Module to be viewed; right-click and choose “Run” to start
  • 53. Copyright @ 2010, John Jay King53http://www.kingtraining.com Component Browser Choices • Choose the Business Component to be tested
  • 54. Copyright @ 2010, John Jay King54http://www.kingtraining.com Component Browser – Display, 1 • Oracle’s Business Component Browser displays data from the underlying database objects (this should look familiar to Forms users) • If referential keys are defined in the database (Primary Keys and Foreign Keys) the ADF BC Wizard automatically arranges the tables into a Master-Detail relationship
  • 55. Copyright @ 2010, John Jay King55http://www.kingtraining.com Component Browser – Display, 2
  • 56. Copyright @ 2010, John Jay King56http://www.kingtraining.com Searching Data • Use the “Specify View Criteria” (Binocular) icon to Search
  • 57. Copyright @ 2010, John Jay King57http://www.kingtraining.com Search View Criteria • Enter Search criteria and click “Find”
  • 58. Copyright @ 2010, John Jay King58http://www.kingtraining.com Search Results
  • 59. Copyright @ 2010, John Jay King59http://www.kingtraining.com Browsing Database Objects • JDeveloper’s Database Navigator allows browsing of database objects (parts of Oracle's SQL Developer tool have been incorporated into JDeveloper)
  • 60. Copyright @ 2010, John Jay King60http://www.kingtraining.com Modification of Application • Once the initial Business Components are created in the application, it might be useful to: – set default values – define formatting – validate data
  • 61. Copyright @ 2010, John Jay King61http://www.kingtraining.com Object Properties • Like Oracle Forms (and other 4GLs) properties are listed
  • 62. Copyright @ 2010, John Jay King62http://www.kingtraining.com Properties in XML Files • ADF uses XML files to store declared definitions
  • 63. Copyright @ 2010, John Jay King63http://www.kingtraining.com Modify Appearance and Formatting • Use JDeveloper to modify appearance of database column values by double-clicking an Entity Object
  • 64. Copyright @ 2010, John Jay King64http://www.kingtraining.com Entity Object Edit Panel
  • 65. Copyright @ 2010, John Jay King65http://www.kingtraining.com Entity Object Attributes
  • 66. Copyright @ 2010, John Jay King66http://www.kingtraining.com Entity Object Validators
  • 67. Copyright @ 2010, John Jay King67http://www.kingtraining.com Validations and Business Logic • Validations and Business Logic may be added including: – Client-side validation – Format masks – Default Values – Declarative Range (and other) Validation – CSS (Visual Attributes) – List of Values – Calculated field – Code Validation – Extensible for complex application validation – Transactional Triggers
  • 68. Copyright @ 2010, John Jay King68http://www.kingtraining.com Validation Rules
  • 69. Copyright @ 2010, John Jay King69http://www.kingtraining.com Validation Error Messages
  • 70. Copyright @ 2010, John Jay King70http://www.kingtraining.com Attribute Defaults • Using the Property Palette, open the “Value” properties and set the default value (in this case “adf.currentDate” using ADF’s “Groovy” support)
  • 71. Copyright @ 2010, John Jay King71http://www.kingtraining.com Attribute Formatting • Use an Attribute's Property Palette “UI Hints” section to control formatting, label, tool tip, etc… (note this formatting uses Java SimpleDateFormat options)
  • 72. Copyright @ 2010, John Jay King72http://www.kingtraining.com What Does the XML Look Like?
  • 73. Copyright @ 2010, John Jay King73http://www.kingtraining.com Date Mask Properties File
  • 74. Copyright @ 2010, John Jay King74http://www.kingtraining.com Comparison to Oracle Forms • In Oracle Forms we defined “data blocks” that represented tables and views that would be used in our forms • ADF BC components do that and more, plus they may be shared by many applications • In Oracle Forms once the “data block” was created we would then use it to create the presentation • With ADF we use ADF Faces to accomplish the same thing and more (again creating components that may be reused by other applications)
  • 75. Copyright @ 2010, John Jay King75http://www.kingtraining.com Creating Web Applications • Oracle’s Business Component Browser is impressive, but it's hardly a customer-facing user interface • ADF Faces extends the Java Server Faces (JSF) framework using XML tags to describe the user interface • ADF Faces provides a Rich-Client Interface that uses JavaScript and AJAX components; therefore users must have a reasonably up-to-date browser (Internet Explorer 7.0 or higher, Mozilla Firefox 2.0 or higher, Safari 3.0 or higher) to use all of its features • ADF Faces is designed to make creation of “rich- client” (RC) interfaces full-featured and declarative where possible
  • 76. Copyright @ 2010, John Jay King76http://www.kingtraining.com Review of Web Processing
  • 77. Copyright @ 2010, John Jay King77http://www.kingtraining.com HTML, CSS, and Forms • Even though the ultimate page delivered to the Client Browser is HTML; with JDeveloper's Visual Editor and the combination of ADF Faces and JSF Faces it uses to create .jspx pages there is little need for ADF Developers to code HTML or CSS • Yield to JDeveloper's declarative mechanism and refrain from coding
  • 78. Copyright @ 2010, John Jay King78http://www.kingtraining.com ADF Controller • The ADF Controller extends the standard JSF controller and controls the MVC in ADF • ADF Controller features include: – Sequence of page displays (may be conditional) – Allows partial-page processing in the same way as full page processing; only the necessary part of a page is rendered, the rest is unchanged (makes page processing faster) – Allows reuse of page parts – Provides conditional control of page flow
  • 79. Copyright @ 2010, John Jay King79http://www.kingtraining.com JSF Life Cycle • JSF (and ADF Faces) perform a predictable cycle as follows: 1. Restore Components 2. Apply Request Values 3. Process Validations 4. Update Model Values 5. Invoke Application 6. Render Response • This Life Cycle is normally transparent; however, it is useful to understand it when debugging
  • 80. Copyright @ 2010, John Jay King80http://www.kingtraining.com JDeveloper Visual Designer • JDeveloper's Visual Designer may be used to “paint” a User Interface using the Component Palette • The JDeveloper Visual Designer is intended to be WYSIWYG (What You See Is What You Get); however the nature of the web and HTML is that it's really WYSIKOWYG (What You See Is Kind-Of What You Get)
  • 81. Copyright @ 2010, John Jay King81http://www.kingtraining.com ADF Faces Component Palette • The ADF Faces Component Palette includes icons representing various User Interface objects • Drag-and-drop desired components into the position desired
  • 82. Copyright @ 2010, John Jay King82http://www.kingtraining.com Property Inspector • When editing Web Pages, the Property Inspector shows properties for the various “facets” and components displayed upon the page
  • 83. Copyright @ 2010, John Jay King83http://www.kingtraining.com Facets in Structure Window • The “facets” are components that are used to contain groups of other components • JDeveloper’s “Structure” Window” lists facets in the current page
  • 84. Copyright @ 2010, John Jay King84http://www.kingtraining.com Panel and Panel Splitter • Pages in ADF are sometimes divided by Panels; pre-existing templates exist to help create the number of desired Panels • Each Panel in turn may be divided into smaller areas using a Panel Splitter – By default Panel Splitters split an area horizontally – Panel Splitters have an “Orientation” property that allow the split to be vertical
  • 85. Copyright @ 2010, John Jay King85http://www.kingtraining.com Panel Collections, Accordions, Tabbed Panels • Panel Collections are facets that contain other objects • Panel Accordions are facets that contain other objects but shrink-and-grow depending upon mouse movement • Tabbed Panels are facets that allow components to be placed into a tabbed structure
  • 86. Copyright @ 2010, John Jay King86http://www.kingtraining.com User Interface (UI) Components • UI Components provided by ADF Faces include: – Buttons – Calendars – Choose Color – Forms – Input Text – Output Text – Panel Collection – Submit – Tables – more…
  • 87. Copyright @ 2010, John Jay King87http://www.kingtraining.com Binding Data • JDeveloper's interface will allow not only the creation of web components using drag-and-drop processing • Drag-and-drop may also be used to associate View Objects with UI Components • This has the effect of “binding” the data to the data control object
  • 88. Copyright @ 2010, John Jay King88http://www.kingtraining.com Creating ADF Faces / JSF Pages • The following pages walk through the creation of a simple Web Application using ADF Faces and ADF BC objects as follows: 1. Design Web Page 2. Create new JSF Page using JDeveloper 3. Add Visual Components to JSF Page 4. Bind Visual Components to ADF BC Objects
  • 89. Copyright @ 2010, John Jay King89http://www.kingtraining.com Create ADF Faces Page • To create an ADF Faces page, right-click on an Application's ViewController Project and choose “New” to display the “New Gallery” dialog
  • 90. Copyright @ 2010, John Jay King90http://www.kingtraining.com New Gallery
  • 91. Copyright @ 2010, John Jay King91http://www.kingtraining.com Naming Web Page – Note the “Create as XML Document (*.jspx)” box
  • 92. Copyright @ 2010, John Jay King92http://www.kingtraining.com Visual Display with Initial Screen
  • 93. Copyright @ 2010, John Jay King93http://www.kingtraining.com Three-Column Layout • The supplied three-column layout is ready to have objects dropped into it
  • 94. Copyright @ 2010, John Jay King94http://www.kingtraining.com Deleting Panel from Layout • Sometimes you want a two-column layout rather than three; just select the panel you don’t want and delete
  • 95. Copyright @ 2010, John Jay King95http://www.kingtraining.com Common Components
  • 96. Copyright @ 2010, John Jay King96http://www.kingtraining.com Layout Components
  • 97. Copyright @ 2010, John Jay King97http://www.kingtraining.com Operations Components
  • 98. Copyright @ 2010, John Jay King98http://www.kingtraining.com Adding Accordion Component • To add an Accordion Component to the web page; Panel Accordion component from the pallet to the desired column (“start”)
  • 99. Copyright @ 2010, John Jay King99http://www.kingtraining.com Change Accordion Title Property • To alter the Accordion's title, click on the Accordion and modify its Property Inspector Text item (changed to “Depts”)
  • 100. Copyright @ 2010, John Jay King100http://www.kingtraining.com Add Data Component • Right-click in the “Depts” Accordion; when prompted choose “Insert After Show Details Item - Depts -> Show Detail Item” to add another Accordion to the page (not used further in this demo…)
  • 101. Copyright @ 2010, John Jay King101http://www.kingtraining.com Using Panel Splitter • To divide the right-part of the page (Center) into two parts; find the “Panel Splitter” component then drag it to the column marked “Center” • Next, change it's “Orientation” property to “Vertical”
  • 102. Copyright @ 2010, John Jay King102http://www.kingtraining.com Page After Splitting • After splitting; the page looks something like this: – The “Depts” part will hold specifics for one Department – The “first” part will hold a list of Department employees – The “second” part of the page will hold details for an individual Employee
  • 103. Copyright @ 2010, John Jay King103http://www.kingtraining.com Adding Collection and Tabbed Area • Find the “Panel Collection” component in the Layout components and drag it to the “first” (top) part of the Splitter area • Find the “Panel Tabbed” component in the Layout components and drag it to the “second” (bottom) part of the Splitter area
  • 104. Copyright @ 2010, John Jay King104http://www.kingtraining.com Data Binding: Adding Data, 1 • To “bind” data to web page components, simply drag ADF BC data objects to the Visual Editor • Open the “Application Navigator” and expand the “Data Controls” accordion to see the ADF BC components created earlier then drag “DeptView1” to the “Depts” accordion
  • 105. Copyright @ 2010, John Jay King105http://www.kingtraining.com Data Binding: Adding Data, 2 • When prompted; choose “Create Forms - > ADF Read-Only Form” to populate the Department data display
  • 106. Copyright @ 2010, John Jay King106http://www.kingtraining.com Adding Navigation Controls • Check the “Include Navigation Controls” box • You may also modify display labels and add, delete, or reorganize the values displayed
  • 107. Copyright @ 2010, John Jay King107http://www.kingtraining.com Department Display Area • After adding the Department information; the “Depts” accordion should look like the following
  • 108. Copyright @ 2010, John Jay King108http://www.kingtraining.com Adding Department Employees • Next, to add Department Employees to the page, drag the EmpView2 data control • When prompted, choose “Create Tables -> ADF Read-Only Table” again
  • 109. Copyright @ 2010, John Jay King109http://www.kingtraining.com Add Employee Navigation Controls • Check all three navigation controls: • Row Selection (user may select), filtering (user may search), and sort; as before columns may be relabelled, added, deleted, reorganized
  • 110. Copyright @ 2010, John Jay King110http://www.kingtraining.com Department Employee Area
  • 111. Copyright @ 2010, John Jay King111http://www.kingtraining.com Adding Individual Employee • Finally, add the individual Employee display to the Tabbed area at the bottom of the page • When prompted, choose “Create Forms -> ADF Form” to select the display format (this part of the form will be editable)
  • 112. Copyright @ 2010, John Jay King112http://www.kingtraining.com Add Employee Navigation • Delete the COMM and DEPTNO data from the display (highlight & click X); check “Include Submit Button”
  • 113. Copyright @ 2010, John Jay King113http://www.kingtraining.com Completed Web Application Page
  • 114. Copyright @ 2010, John Jay King114http://www.kingtraining.com Testing the Web Application • To begin testing the Web Application; right-click the “.jspx” file created in the ViewController project and choose “Run”
  • 115. Copyright @ 2010, John Jay King115http://www.kingtraining.com Be Patient! • The first time you execute a Web application JDeveloper will start its built-in WebLogic Application Server; this takes a while • You can track the progress of the Server's startup in JDeveloper's DefaultServer Log • Once the Server is “up” your web page should be displayed in a browser (again, please be patient!)
  • 116. Copyright @ 2010, John Jay King116http://www.kingtraining.com Web Page in Browser
  • 117. Copyright @ 2010, John Jay King117http://www.kingtraining.com Files Supporting Web Application • Several files make up the typical ADF Web Application – A .jspx file is used to define each web page – Web pages reference a page definition XML file (.xml) – Bindings are described in another XML file (.cpx)
  • 118. Copyright @ 2010, John Jay King118http://www.kingtraining.com JSF .jspx File • ADF defines a web page using an XML .jspx file
  • 119. Copyright @ 2010, John Jay King119http://www.kingtraining.com ADF Web Page Definition file (.xml)
  • 120. Copyright @ 2010, John Jay King120http://www.kingtraining.com ADF Bindings XML file (.cpx)
  • 121. Copyright @ 2010, John Jay King121http://www.kingtraining.com ADF Faces ViewController Files • The XML files representing the ViewController project are distributed using a directory structure
  • 122. Copyright @ 2010, John Jay King122http://www.kingtraining.com Available Books • Oracle JDevloper 11g Handbook – Duncan Mills, Peter Koletzke, Dr. Avrom Roy-Federman – Oracle Press • Oracle Fusion Developer's Guide – Frank Nimphius, Lynn Munsinger – Oracle Press
  • 123. Copyright @ 2010, John Jay King123http://www.kingtraining.com Wrapping It Up • Oracle Forms is not going anywhere; it is not necessary to “convert” things to ADF • Oracle’s design emphasis and new features will support the Java-based ADF mechanism; Oracle Forms probably won’t see much in the way of new functionality • JDeveloper and ADF allow me to create simple forms almost as easily as in forms except: • ADF BC for data creates reusable components • ADF Faces for view creates reusable components • I did not write a single line of Java in this demo!
  • 124. Training Days 2011 February 15-17 2011 Save the dates!
  • 125. June 27-July 1 2010 Washington, DC ODTUG Kaleidoscope 2010
  • 126. Oracle ADF & JDeveloper for Forms Developers To contact the author: John King King Training Resources 6341 South Williams Street Littleton, CO 80121-2627 USA 1.800.252.0652 - 1.303.798.5727 Email: john@kingtraining.com Today’s slides are on the web:TodayToday’’s slides are on the web:s slides are on the web: http://www.kingtraining.com Thanks for your attention! ▬ Please fill out session Evaluations