0% found this document useful (0 votes)
135 views34 pages

Oracle ADF Quick Handy Reference

This document provides a high-level summary of Oracle Application Development Framework (ADF) architecture and components. It discusses the presentation layer with ADF Faces JSF components, the controller layer with taskflows, and the model layer with ADF Business Components (ADFbc) including entity objects, view objects, and application modules. It also summarizes the different types of objects in ADFbc like entity objects, view objects, and application modules and how their default behaviors can be customized.

Uploaded by

Deepak Bhagat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
135 views34 pages

Oracle ADF Quick Handy Reference

This document provides a high-level summary of Oracle Application Development Framework (ADF) architecture and components. It discusses the presentation layer with ADF Faces JSF components, the controller layer with taskflows, and the model layer with ADF Business Components (ADFbc) including entity objects, view objects, and application modules. It also summarizes the different types of objects in ADFbc like entity objects, view objects, and application modules and how their default behaviors can be customized.

Uploaded by

Deepak Bhagat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 34

Free Downloadable Course material: GDrive Link

Deepak Bhagat’s Oracle ADF Blogs


MVC & Application Architecture
Web / Wireless Rich Client / Desktop
View
ADFv Faces JSF JSP ADF Swing Swing Office
Metadata Services
Presentation Layer

User Actions Modify View

JDeveloper
Controller ViewController/
JSF/ADFc/Taskflow Struts ADFdi
User Interface
Project
Model (JSR227) ADFm Model

Business Services Model/ Service


Model EJB POJO BPL BAM
ADFbc Web Project
BC Services Toplink Hibernate Portlet XML BI

Data
Services
Relational Data XML Data Legacy Data Packaged Apps
Types of Objects of ADF BC

Service Layer
Data Model HRSystemAM
EmployeeBy applyManagerVO Application Module
Department1 Employee3 Email1 Criteria() with View Object

ADF Business Components


Instances XML
Employee Nested AM Java
Department2 Employee2
Summary1

Components
Data Model
Business Services
DepartmentVO Employee EmployeeBy View ObjectsXML
Row Set EmployeeVO Java
Iterator EmpDeptFkVL SummaryVO EmailVO and View Links

Business Domain
Components
DepartmentEO EmployeeEO XML Entity Objects
Java
EmpDeptFkAS and Associations

Relational Data / App Schema


Types of Objects of ADF BC contd…
 Types of Objects of ADF Business Components (BC)
 Business Domain Components
 Entity Object (Data Persistence Business Object)
 Java
 PL/SQL
 Association
 Data Model Components
 View Object (Data
Query Business Object)
 Read only
 Updateable
 View Link
 Application Module
 Business Service
 Service Data Object
Types of VOs

 Read Only VO (No Entity)


 Static List (JDev demo)
 SQL Query
 Programmatic (Lesson 22)
 Updatable VO (Single Entity)
 Join VO (Multiple Entities)
 Referenced Entity (JDev demo)
 Updateable Entities (slides demo)
 Master Detail VOs (Link)
Customizing EO’s Default Behavior
Declaratively customize EO’s default behavior:
 Customize attribute control hints (JDev):
 Example: HireDate – Simple Date
 Alternate key entity constraints
 Synchronize columns with trigger-assigned values
 Validate user input (Lesson 9 - Validation)
Customizing VO’s Default Behavior
 Define attribute control hints: (Example: HireDate – Simple Date, AnnualSalary -- Width)
 Perform calculations: Add transient attribute: (Example: AnnualSalary – 12*salary)
 Projection: Restrict the columns retrieved by a query:
 Example: select FIRST_NAME, LAST_NAME, EMAIL from employees (EmpSqlQueryVO)
 Sorting: reorder of queried rows using ORDER BY clause:
 Example: select * from employees ORDER BY LAST_NAME (EmpSqlQueryVO)
 Selection: Restrict the rows retrieved by a query:
 Where clause
 Example: select * from EMPLOYEES WHERE email = ‘SKING’
 Parameterized where clause with bind variable
 Example: select * from employees WHERE email = :p_email (EmployeeByEmailVO)
 Structured/ Named where clause (View Criteria)
 Parameterized structured/ named where clause (Example: p_email -- EmpSqlQueryVOCriteria)
 Define a list of values (LOV): (Example: EmployeeSummaryVO-JobId -- JobVVO)
Customizing AM’s Default Behavior
The Application Module editor has the following tabs:
 General: Set tuning parameters and define custom properties
 Data Model: Refine the data model
 Java: Create Java classes and expose methods to the client interface
 Web Service: Enable Web Service support
 Configurations: Create or modify sets of configuration parameters
Categories & Subcategories of Validations in BC
 Declarative Validation: Built-in Rules  Defined at the entity or attribute
 Defined only at the entity level: level, to validate the EO or the
 Collection validator
attribute:
 Unique key validator  Script Expression validator
 Defined at the entity or attribute  Declarative Validation: Custom
level, but pertain to an EO attribute: Rules
 Compare validator  Method validator
 Key Exists validator  Programmatic Validation: Global
 Length validator Rules
 List validator
 Range validator  Domains: Pre-validated Custom
 Regular Expression validator Datatypes
Overview of Java Server Faces and ADF Faces
 Java Server Faces (JSF):  ADF Faces (extends JSF):
 Tech-Stack / Architecture  Tech-Stack / Architecture
 Functionalities / Concepts (4)  Functionalities / Concepts (23+)
 JSF UI Components  ADF Rich UI Components (L11-L19)
 Server-side component Tag Libraries
 Render Kits
 Renderers
 Navigation using JSF Controller  Navigation using ADF Controller (L14)
 Managed and Backing Beans  Managed and Backing Bean (L17)
 Life Cycle and Helper Objects  Life Cycle and Helper Objects (L17)
 Features  Features
Tech-Stack of View Layer
View Wireless Web Industrial Rich Client / Desktop
1. UI Component is rendered Page JSF
through Renderer class ADF Faces Faces Servlet / Front Controller ITS
2. Expression Language Value Skins
trinidad.xml XML XML Swing L&F
Metadata Services

Binding is used to access managed


Render Kits
bean also know as a "backing faces-config.xml HTML Renderer WML Renderer SVG Telnet Swing Renderer
bean"

JDeveloper
3. Managed bean accesses J2EE UI ComponentTree ADF Faces Components JSF Components ADF Faces Swing Component
persistence layer
Expr. Language
1. EL accesses “bindings” Controller
object to value bind UI ADF “binding” object Managed Bean Struts ADFdi
components
2. ADF “bindings” object is set Model
through ADF Filter in web.xml (JSR227) ADF Binding Container / ADF Bindings
3. Bindings object accesses ADF Data Controls ADF Model /Binding Context /Data Binding
ADF Binding container, which
then accesses DataControl Business
Services ADF BC J2EE Persistence Toplink EJB POJO Portlet XML BI
4. Business Services provide
access to various data sources
Data Relational Data XML Data Legacy Data Packaged Apps
Services
Functionalities of ADF Faces
 200+ featured Rich UI Components  Parameter Passing (Lesson 16)
 Internationalization (Lesson 11)  Partial Page Rendering (Ajax support)
 Skinning (Lesson 11) (Lesson 16)
 Active Geometry Management (L 12)  Event and Listener Handling (L 17)
 Advance Page Flow and Task Flow  Managed and Backing Beans (L 17)
(Lesson 13)  Enhanced Lifecycle (Lesson 17)
 Navigation (Lesson 14)  Drag and Drop Data Binding (L 18)
 Accessibility (Lesson 14)  Advance Databound Search Capability
 Reusability using Templating and (Lesson 19)
Declarative Component (Lesson 15)  Transaction Management (Lesson 20)
 Memory Scopes (Lesson 16)  ADF Model support (Lesson 21)
ADF Faces Functionality: ADF Faces Components
 Layout Components: (L 12)  Output, Input, LOV, etc.
 Headers, Layout, Grouping, Spacing, etc.  Data Views: (L 18)
 Navigation Control Components: (L14)  Table, Tree, List, Carousel, Calendar, etc.
 Button, Link, Train, Navigation, etc.  Advance Data Visualization
 Menu and Toolbar explorer-type Components (L 18)
containers: (L 14)  Chart, Graph, Gauge, NBox, Pivot Table,
 Menu, Toolbar, Toolbox, etc.
Map, Gantt, Timeline, Hierarchy Viewer,
Sunburst, Diagram, etc.
 Secondary Windows Layout: (L 14)
 Data Query Components (L 19)
 Popup, Dialog, Window, etc.
 Query and Quick Query
 Text and Selection Components: (L18)
ADF Faces Functionality: ADF Life Cycle Phases
Describing Types of Events
 Action events
 Occur when a command component is activated, such as when a user clicks
a button or a link
 Return a control flow outcome
 Value change events
 Occur when the local value of a input component changes, such as when a
user selects a check box
 Are used for managing UI elements
 Phase events
 Execute as part of the JSF and ADF life cycle
 Can be used to augment standard behavior
Types of Event Listeners
 ActionListener
 Fired by submit buttons, image maps, and hypertext links with attached JavaScript
 <h:commandButton value="..." .../>
 <h:commandButton image="..." .../>
 <h:commandLink .../>
 Automatically submit the form
 ValueChangeListener
 Fired by combo boxes, checkboxes, radio buttons, textfields, and others
 <h:selectOneMenu .../>
 <h:selectBooleanCheckbox.../>
 <h:selectOneRadio .../>
 <h:inputText .../>
 Do not automatically submit the form
Phase Listener
 Execute custom functions at a specific time during the request
processing lifecycle
 getPhaseId is called by the JSF framework to register the custom
PhaseListener
 PhaseListener is registered in faces-config.xml
public class HRLifeCycleListener implements PhaseListener{
public PhaseId getPhaseId() {
return PhaseId.ANY_PHASE;
}
public void beforePhase(PhaseEvent event) {
System.out.println("START PHASE " + event.getPhaseId());
}
public void afterPhase(PhaseEvent event) {
System.out.println("END PHASE " + event.getPhaseId());
}
}
ADF Binding Layer
View
ADF Faces  Defines all the bindings for a page by
connecting UI components to data or
Controller actions and data control
 Created automatically when a data-
bound component is added to a page

Model Binding Container / Bindings  Provides public interfaces of


(JSR227) business services
 Gives access to service layer

Data Control  Maps pages to page definitions


 Declares data control usages

ADFm /Binding Context /Data Binding


 Binds page components to
Business data without writing any code
Services
ADF BC Application Module/ Services
Types of Bindings
View
#{Binding Expression} #{bindings.DepartmentName.hints.label} ADF Faces/ JSF/ JSFF/ JSPX

Model
(JSR227) Value bindings Action bindings ADFm /Binding Context
Binding Container /
 Attribute binding  Operation binding /Data Binding
Bindings
 List binding  Method binding
 Table binding
 Tree binding
… …
Iterator bindings
 Iterator
 Method iterator
 Accessor iterator
 Variable iterator

Data Control

Business …
Services ADF BC Application Module/ Services
Types of Bindings: Source View
View
<af:inputText value=“#{bindings.DepartmentName.inputValue}” label =“#{bindings.DepartmentName.hints.label}”
ADF Faces/ JSF/ JSFF/ JSPX
Model
(JSR227) ADFm /Binding Context
<executables> Binding Container /
<iterator id="Department1Iterator" /Data Binding
Bindings
DataControl="HRSystemAMDataControl"
Binds="Department1"/>
</executables>

<bindings>
<attributeValues IterBinding="Department1Iterator“ id="DepartmentName">
<AttrNames> <Item Value="DepartmentName"/> </AttrNames>
</attributeValues> ...
</bindings>

Data Control

Business
Services ADF BC Application Module/ Services
ADF Configuration and Metadata Files
View * Denotes multiple files of
<pagename>.jsf /.jspx*

Application Configuration Files


ADF Faces this type may exist in
the project
Controller Web Configuration Files  Solid lines indicate
faces-config.xml web.xml(ADFBindingFilter) hierarchy of metadata
Metadata Services

adfc-config.xml trinidad-config.xml
ADF Configuration Files --> Dotted lines indicate
adf-settings.xml <task-flow-definition>.xml references to objects in
Presentation Layer

the ADF binding context

JDeveloper
Data Binding Files adfm.xml
Model

adf-config.xml
(JSR227)
Binding Container / Bindings <pagename>PageDef.xml*
ViewController/ User
Interface Project
Data Control DataControls.dcx (<ViewController>.jpr)

ADFm /Binding Context /Data Binding DataBindings.cpx

Business Data Control Files <Model>.jpx bc4j.xcfg


Model/ Service
Services Project (<Model>.jpr)
ADF BC Application Module/ Services <ApplicationModuleName>.xml
ADF Binding Control: Run Time
View * Denotes multiple files of
<pagename>.jsf /.jspx* ADF Faces this type may exist in the
project

Controller Web Configuration Files web.xml(ADFBindingFilter)  Solid lines indicate


hierarchy of metadata
--> Dotted lines indicate
references to objects in
the ADF binding context
Data Binding Files adfm.xml
Model (JSR227)
Binding Container/ Bindings <pagename>PageDef.xml*

Data Control

ADFm /Binding Context /Data Binding DataBindings.cpx

Business Services Data Control Files bc4j.xcfg


ADF BC Application Module/ Services <ApplicationModuleName>.xml
View
ADF Binding Control: File Hierarchy
<pagename>.jsf /.jspx* Controller
<af:xxx web.xml
value="#{bindings.<Attribute>.inputValue}“
<filter>
label="#{bindings.<Attribute>.hints.label}“ <filter-name>adfBindings</filter-name>
columns="#{bindings.<Attribute>.hints.displayWidth}" <filter-class>oracle.adf.model.servlet.ADFBindingFilter</filter-class>
</af:xxx> </filter>

Model
(JSR227) <pagename>PageDef.xml* adfm.xml
<pageDefinition> <MetadataDirectory> …
<executables> <DataBindingRegistry path=".../DataBindings.cpx"/>
<Iterator id=“<voname>Iterator” Binds=”<voname>”/> … </MetadataDirectory>
</executables>
<bindings> DataBindings.cpx
<… <IterBinding=“<voname>Iterator”>… /> … <Application >
</bindings > <pageDefinitionUsages>
</pageDefinition> <page id="<pagename>PageDef" path=“<pkgname>“/>…
</pageDefinitionUsages>
<dataControlUsages>
<BC4JDataControl id=“<amname>“ Configuration=“<AM>Local”…/>
</dataControlUsages>
</Application>
Business bc4j.xcfg
Services <ApplicationModuleName>.xml <BC4JConfig>
<ViewUsage Name=“<voname>” ViewObjectName=“<ViewObject>”/> <AppModuleConfigBag> <AppModuleConfigname=“<AM>Local”>…
</BC4JConfig>
Class Files in Programmatic Approach
Value bindings oracle.adf.model.binding.DCControlBinding Action bindings oracle.binding.OperationBinding
Model  Attribute binding  Operation binding
(JSR227)  List binding valb = bctr.getControlBinding(valuename); oprb = bctr.getOperationBinding(oprName);
 Method binding
 Table binding 0..*
 Tree binding
* 1 *
Iterator bindings oracle.adf.model.binding.DCIteratorBinding 0..*
 Iterator
itrb = bctr.findIteratorBinding("ViewObject1Itr");
 Method iterator
 Accessor iterator *
 Variable iterator
1 1
oracle.adf.model.binding.DCBindingContainer
bctr = bctx.getCurrentBindingsEntry(); 1 Binding Container / Bindings
* 1 1

* oracle.adf.model.binding.DCDataControl
Data Control
dc = bctr.findDataControl(“MyAMDataControl”);

1 oracle.adf.model.BindingContext
bctx = BindingContext.getCurrent(); ADFm /Binding Context /Data Binding
ADF Binding Class Hierarchy contd…
Prefix Package
DC* oracle.adf.model.binding
JU* oracle.jobo.uicli.binding
Others oracle.adf.model or
oracle.binding

Value bindings Action bindings


 Attribute binding  Operation binding
 List binding  Method binding
 Table binding
 Tree binding
Iterator bindings
 Iterator
 Method iterator
 Accessor iterator Bindings /
 Variable iterator Binding Container
Data Control
ADFm /Binding Context /Data Binding
ADF Binding Class Hierarchy contd…
DCControlBinding Package
Prefix
DC* oracle.adf.model.binding
JU* oracle.jobo.uicli.binding
JUControlBinding
Others oracle.adf.model or
oracle.binding

JUCtrlValueBinding JUCtrlActionBinding Value bindings Action bindings


 Attribute binding  Operation binding
 List binding  Method binding
 Table binding
 Tree binding
JUCtrlRangeBinding JUCtrlAttrsBinding
Iterator bindings
 Iterator
 Method iterator
 Accessor iterator Bindings /
JUCtrlHierBinding JUCtrlListBinding  Variable iterator Binding Container
Data Control
ADFm /Binding Context /Data Binding
JUCtrlTreeBinding
Types of Programmatic Customization of ADF
Business Component
 Use ADF Business Component APIs
 Programmatically customizing entity object (EO)
 Programmatically customizing view object (VO)
 Programmatically customizing application module (AM)
 Programmatically accessing business component objects from
java client
Class Diagram of ADF BC
ApplicationModule * Uses Transaction 1 Transaction
1 Contains Data Model Instances
Can Be Filtered Using
Query by Example * 0..1 0..1 Associated To
Linked To
1 *
* *
ViewObject 0..1 Uses Attributes From * EntityDefinition
ViewCriteria
1 1 1 RELATED_TO
Set Of Defines Query StructureDef Defines 0..1
to Produce
* 1 Mapping To
Group Of
ViewCriteriaRow *
* Manages
1 Table *
RowSet AttributeDef Represents
Iterates Rows in Rows
* 1 Row in and
HasUIHints Encapsulates
RowSetIterator 0..1 1 Validation For
Set Of
* AttributeHints *
0..1
Key Row * Entity Key
Identified By Delegates Storage and Identified By
Validation To
Programmatically Customizing Entity Object (EO)
 Default metadata - <EntityObjectEO>.xml
 Java classes (generate)
 Programmatically customizing default behavior (within EO)
 Business rules
 Override methods
 Programmatic operations (from outside EO)
 Placement of entity operations
 CRUD operations
Programmatic Operations on EO
 Programmatic operations (from outside EO)
 Placement of entity operations
 Another entity object class
 A service method of an application module class (through view object)
 Java client accessing business components like EO, VO and services
 CRUD operations
 Read (Find) entity object
 By primary key
 By traversing association from
» Master entity to detail entity
» Detail entity to master entity
 Through view object
 Update (modify) entity object
 Delete (remove) entity object
 Create (add) entity object
Programmatically Customizing View Object (VO)
 Default metadata - <ViewObjectVO>.xml
 Java classes (generate)
 Programmatically customizing default behavior (within VO)
 Business rules
 Override methods
 Examine VO methods
 Programmatic operations (from outside VO)
 Placement of view object operations
 CRUD operations
 Programmatic customization of default sorting and selection (from outside VO)
 Order by (sorting)
 Where clause
 Parameterize where clause
 Structure where clause (view criteria)
Programmatic Operations on VO
 Programmatic operations (from outside VO)
 Placement of view operations
 Another view object class
 A service method of an application module class (through view object)
 Java client accessing business components
 CRUD operations
 Read (Find) view object
 By foreign key
 By traversing links from
» Master view to detail view
» Detail view to master view
» Retain and reuse a view link accessor row set
 Update (modify) view object
 Delete (remove) view object
 Create (add) view object
Programmatically Customizing AM
 Default metadata  Test
 <AppModuleAM>.xml  Transactions
 bc4j.xcfg  Access transaction
 Java classes (generate)  Commit transaction
 Post Phase
 Service Methods
 Commit Phase
 Add
 Locking
 Implement
 Testing AM (using ADF Model
 EO and AS
Tester)
 VO and VL
 Publish

You might also like