Presentation is loading. Please wait.

Presentation is loading. Please wait.

Oracle ADF Quick Handy Reference. Important Concepts on fingertips.

Similar presentations


Presentation on theme: "Oracle ADF Quick Handy Reference. Important Concepts on fingertips. "— Presentation transcript:

1 Free Downloadable Course material: GDrive Link Deepak Bhagat’s Oracle ADF BlogsGDrive LinkOracle ADF Blogs

2 MVC & Application Architecture Metadata Services JDeveloper Model (JSR227) View Controller Business Services Relational Data XML Data Packaged Apps Legacy Data Data Services ADF Faces JSF/ADFc/Taskflow ADF Model ADF BC JSP Struts ADF Swing Swing Office ADFdi EJB Web Services POJO Toplink Hibernate Portlet BI XML Web / WirelessRich Client / Desktop User Actions Modify View ViewController/ User Interface Project Model/ Service Project Model Presentation Layer v m bc BAM BPL JSF

3

4 Types of Objects of ADF BC DepartmentEO DepartmentVO EmployeeVO Employee SummaryVO Employee SummaryVO EmployeeBy EmailVO EmployeeBy EmailVO Department1 Employee3 Employee Summary1 Employee Summary1 EmployeeBy Email1 EmployeeBy Email1 applyManagerVO Criteria() Business Services Relational Data / App Schema Application Module HRSystemAM with View Object Instances EmpDeptFkAS EmpDeptFkVL View Objects and View Links Entity Objects and Associations EmployeeEO Department2 ADF Business Components Business Domain Components Data Model Components Data Model XML Java XML Java XML Java Nested AM Row Set Iterator Service Layer Employee2

5 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

6 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)

7 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)

8 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 )

9 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

10 Categories & Subcategories of Validations in BC  Declarative Validation: Built-in Rules  Defined only at the entity level:  Collection validator  Unique key validator  Defined at the entity or attribute level, but pertain to an EO attribute:  Compare validator  Key Exists validator  Length validator  List validator  Range validator  Regular Expression validator  Defined at the entity or attribute level, to validate the EO or the attribute:  Script Expression validator  Declarative Validation: Custom Rules  Method validator  Programmatic Validation: Global Rules  Domains: Pre-validated Custom Datatypes

11 Overview of Java Server Faces and ADF Faces  Java Server Faces (JSF):  Tech-Stack / Architecture  Functionalities / Concepts (4)  JSF UI Components Server-side component Tag Libraries Render Kits Renderers  Navigation using JSF Controller  Managed and Backing Beans  Life Cycle and Helper Objects  Features  ADF Faces (extends JSF):  Tech-Stack / Architecture  Functionalities / Concepts (23+)  ADF Rich UI Components (L11-L19)  Navigation using ADF Controller (L14)  Managed and Backing Bean (L17)  Life Cycle and Helper Objects (L17)  Features

12 Skins Render Kits UI Component Tree 1. UI Component is rendered through Renderer class 2. Expression Language Value Binding is used to access managed bean also know as a "backing bean" 3. Managed bean accesses J2EE persistence layer 1. UI Component is rendered through Renderer class 2. Expression Language Value Binding is used to access managed bean also know as a "backing bean" 3. Managed bean accesses J2EE persistence layer faces-config.xml trinidad.xml 1. EL accesses “bindings” object to value bind UI components 2. ADF “bindings” object is set through ADF Filter in web.xml 3. Bindings object accesses ADF Binding container, which then accesses DataControl 4. Business Services provide access to various data sources 1. EL accesses “bindings” object to value bind UI components 2. ADF “bindings” object is set through ADF Filter in web.xml 3. Bindings object accesses ADF Binding container, which then accesses DataControl 4. Business Services provide access to various data sources ADF Model /Binding Context /Data Binding Tech-Stack of View Layer View Controller Business Services ADF Faces Components ADF “binding” object ADF BC JSF Components Struts Swing Component ADFdi EJB POJO Toplink Portlet BI XML WebRich Client / Desktop Relational DataXML DataLegacy DataPackaged Apps ADF Binding Container / ADF Bindings ADF Data Controls Data Services WirelessIndustrial Faces Servlet / Front Controller ITS XML Swing L&F HTML Renderer WML Renderer Telnet Swing Renderer SVG ADF Faces Model (JSR227) Metadata Services JDeveloper Managed Bean ADF Faces Expr. Language J2EE Persistence JSF Page

13 Functionalities of ADF Faces  200+ featured Rich UI Components  Internationalization (Lesson 11)  Skinning (Lesson 11)  Active Geometry Management (L 12)  Advance Page Flow and Task Flow (Lesson 13)  Navigation (Lesson 14)  Accessibility (Lesson 14)  Reusability using Templating and Declarative Component (Lesson 15)  Memory Scopes (Lesson 16)  Parameter Passing (Lesson 16)  Partial Page Rendering (Ajax support) (Lesson 16)  Event and Listener Handling (L 17)  Managed and Backing Beans (L 17)  Enhanced Lifecycle (Lesson 17)  Drag and Drop Data Binding (L 18)  Advance Databound Search Capability (Lesson 19)  Transaction Management (Lesson 20)  ADF Model support (Lesson 21)

14 ADF Faces Functionality: ADF Faces Components  Layout Components: (L 12)  Headers, Layout, Grouping, Spacing, etc.  Navigation Control Components: (L14)  Button, Link, Train, Navigation, etc.  Menu and Toolbar explorer-type containers: (L 14)  Menu, Toolbar, Toolbox, etc.  Secondary Windows Layout: (L 14)  Popup, Dialog, Window, etc.  Text and Selection Components: (L18)  Output, Input, LOV, etc.  Data Views: (L 18)  Table, Tree, List, Carousel, Calendar, etc.  Advance Data Visualization Components (L 18)  Chart, Graph, Gauge, NBox, Pivot Table, Map, Gantt, Timeline, Hierarchy Viewer, Sunburst, Diagram, etc.  Data Query Components (L 19)  Query and Quick Query

15 ADF Faces Functionality: ADF Life Cycle Phases

16 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

17 Types of Event Listeners  ActionListener  Fired by submit buttons, image maps, and hypertext links with attached JavaScript   Automatically submit the form  ValueChangeListener  Fired by combo boxes, checkboxes, radio buttons, textfields, and others   Do not automatically submit the form

18 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()); }

19 ADF Faces ADF Binding Layer Model (JSR227) Business Services Application Module/ Services Data Control /Binding Context ADF BC Binding Container / Bindings View Controller /Data Binding ADFm  Provides public interfaces of business services  Gives access to service layer  Defines all the bindings for a page by connecting UI components to data or actions and data control  Created automatically when a data- bound component is added to a page  Maps pages to page definitions  Declares data control usages  Binds page components to data without writing any code

20 Types of Bindings Model (JSR227) Business Services Application Module/ Services /Binding Context ADF BC View ADFm #{Binding Expression} Value bindings  Attribute binding  List binding  Table binding  Tree binding Iterator bindings  Iterator  Method iterator  Accessor iterator  Variable iterator Action bindings  Operation binding  Method binding … … … … … ADF Faces/ JSF/ JSFF/ JSPX Binding Container / /Data Binding #{bindings.DepartmentName.hints.label} Data Control Bindings

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

22 ADF Faces ADF Configuration and Metadata Files Model (JSR227) Business Services Application Module/ Services Data Control /Binding Context ADF BC Binding Container /.jsf /.jspx* PageDef.xml* View Controller /Data Binding ADFm ViewController/ User Interface Project (.jpr) Model/ Service Project (.jpr).xml bc4j.xcfg DataControls.dcx DataBindings.cpx.jpx web.xml adfc-config.xml faces-config.xml (ADFBindingFilter) trinidad-config.xml.xml adfm.xml Web Configuration Files Data Binding Files Data Control Files Presentation Layer Application Configuration Files adf-config.xml ADF Configuration Files adf-settings.xml Metadata Services JDeveloper Bindings

23 ADF Faces ADF Binding Control: Run Time Model (JSR227) Business Services Application Module/ Services Data Control /Binding Context ADF BC Binding Container.jsf /.jspx* PageDef.xml* View Controller /Data Binding ADFm.xml bc4j.xcfg DataBindings.cpx web.xml (ADFBindingFilter) adfm.xml Web Configuration Files Data Binding Files Data Control Files / Bindings

24 ADF Binding Control: File Hierarchy web.xml adfBindings adfm.xml … DataBindings.cpx.jsf /.jspx* <af:xxx.xml bc4j.xcfg PageDef.xml* oracle.adf.model.servlet.ADFBindingFilter “ Configuration=“ Local”…/> “ Configuration=“ Local”…/> PageDef" path=“ “/>… PageDef" path=“ “/>… Local”>… ” ViewObjectName=“ ”/> value="#{bindings..inputValue}“ columns="#{bindings..hints.displayWidth}" label="#{bindings..hints.label}“ Iterator” Binds=” ”/> … Iterator” Binds=” ”/> … Iterator”>… /> … Iterator”>… /> … Model (JSR227) Business Services View Controller

25 Class Files in Programmatic Approach Model (JSR227) /Binding Context ADFm Value bindings  Attribute binding  List binding  Table binding  Tree binding Iterator bindings  Iterator  Method iterator  Accessor iterator  Variable iterator Action bindings  Operation binding  Method binding Binding Container / /Data Binding Data Control oracle.adf.model. BindingContext bctx = BindingContext.getCurrent(); oracle.adf.model.binding. DCBindingContainer bctr = bctx.getCurrentBindingsEntry(); oracle.adf.model.binding. DCIteratorBinding itrb = bctr.findIteratorBinding("ViewObject1Itr"); oracle.binding. OperationBinding oprb = bctr.getOperationBinding(oprName); oracle.adf.model.binding. DCControlBinding valb = bctr.getControlBinding(valuename); oracle.adf.model.binding. DCDataControl dc = bctr.findDataControl(“MyAMDataControl”); Bindings * 1 1 * 1 * 0..* 1 1 1 * * 1

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

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

28 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

29 Set Of Defines Query to Produce Class Diagram of ADF BC EntityDefinition ApplicationModule ViewCriteriaRow RowSetIterator Key ViewCriteria RowSet Row ViewObject StructureDef AttributeHints AttributeDef Entity Key Transaction Table Rows Set Of Can Be Filtered Using Query by Example Iterates Rows in Group Of Uses Transaction Contains Data Model Instances Identified By HasUIHints Identified By Represents Row in and Encapsulates Validation For Manages Associated To Linked To RELATED_TO Uses Attributes From 1 0..1 1 1 1 * 1 * * * * * * 1 * * * 1 * 1 1 1 * * Defines Mapping To Delegates Storage and Validation To 0..1 *

30 Programmatically Customizing Entity Object (EO)  Default metadata -.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

31 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

32 Programmatically Customizing View Object (VO)  Default metadata -.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)

33 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

34 Programmatically Customizing AM  Default metadata .xml  bc4j.xcfg  Java classes (generate)  Service Methods  Add  Implement  EO and AS  VO and VL  Publish  Test  Transactions  Access transaction  Commit transaction  Post Phase  Commit Phase  Locking  Testing AM (using ADF Model Tester)


Download ppt "Oracle ADF Quick Handy Reference. Important Concepts on fingertips. "

Similar presentations


Ads by Google