Building Fusion Applications with Oracle JDeveloper and Oracle ...

135 downloads 578 Views 4MB Size Report
Author: The Quick Start Guide to Fusion Development:JDeveloper and ADF. Building Fusion ..... Oracle Fusion Middleware 11g: Build Applications with. ADF I .


Oracle ADF Bootcamp Grant Ronald Senior Group Product Manager Author: The Quick Start Guide to Fusion Development:JDeveloper and ADF

Building Fusion Applications with Oracle JDeveloper and Oracle ADF • • • •

The Fusion Development Platform Building Reusable Business Services Break Building the UI

Fusion: The Big Picture

Oracle Fusion – What Is It?

Oracle Fusion Applications

• Oracle Fusion Applications • Oracle’s next generation of enterprise applications

• Oracle Fusion Middleware • Integrated standards-based middleware platform

• Oracle Fusion Architecture • Recommended architecture for your custom applications



• Next generation enterprise applications • New set of applications • Merge functionality previously in Oracle EBS, Siebel, PeopleSoft into one offering • One of the largest software development projects in the world • Thousands of developers • Several years in the making

What We Wanted – Business Drivers • • • • • •

Cutting Edge UI Agility System Integration Standards Scalability, Security, Portability Time to market

The Challenge • On one side: • JPA, EJB, Ajax, JavaScript, BPEL, SOAP, WSDL, RMI, JNDI, JDBC, O/R, HTML, DOM….

• On the other side: • • • • • •

Thousands of developers Most don’t know these technologies Most come from 4GL background Expecting a visual and declarative approach Don’t have time to learn all these new technologies Need to focus on their specific application needs

• How do you make it easy and approachable? Java EE 5

SOA

Web 2.0

The Solution - Oracle ADF

An introduction to Oracle Application Development Framework (Oracle ADF)

• Development framework that simplifies development of Java EE-based SOA applications • Abstract developers from technology complexities • Example - UI Components abstract from Ajax, Flash, Javascript, DOM

• Provides end-to-end infrastructure solutions… • O/R Mapping, persistence, caching, controller, binding, UI framework, security

• …and an easy way to use them • JDeveloper - Visual editors, Property editors, dialogs etc…

Oracle ADF – High Level Architecture MVC – Model View Controller

Oracle ADF Components for Fusion Apps and what they do • ADF Faces Rich Client Components

View

• UI components with built-in Ajax support

• ADF Controller • Declarative definition of Web-pages and task flows

Controller

• ADF Model • Declarative way to bind UI to business services

Model

Business Services

• ADF Business Components • Reusable components to manage DB access and logic

Business Service Goals

ADF Business Components A framework that simplifies developing Java EE business services for developers familiar with 4GL tools, declarative development, and relational databases

• Bridge Object-Relational gap • Manage CRUD operations • Queries/DML

• Implement business rules

• • • • • •

• Data validation • Business logic

• Reusable • Standards-based

Simplify data access Simplify validation and business logic Uses SQL based data views Separate data views from business logic Implement best practices Easy customization

ADF Faces Rich Client Components

An introduction to the view (user interface)

• • • • • • • • •

150+ JSF components Drag-and-drop framework Dialog and popup framework Navigation menu framework Partial page rendering Advanced data streaming Complete JavaScript API Skinning Accessibility

As used in Fusion Applications



An introduction to the Controller

ADF Controller • Handles page flow • Visual development with page flow modeler • Draw the page flow

• ADF Controller extends JSF controllers



An introduction to Binding

• Reuse flows • Execute code as part of flow • Exception and transaction management

The Binding Problem

How do you connect your power source

Bindings MetaData Summary

To the consumer

…different sources exposed …adaptors adapts to the specifics of the consuming component in a consistent manner

Bindings MetaData Summary

ADF Model – Data Binding • Service oriented interface • Provides abstraction of business service • Loose coupling between services and application

Database

• Highly productive • Drag and drop data binding

• More reusability • Discover and share services

Web Services

POJO Data controls exposed business services in consistent manner

Bindings ensure consuming component gets information the way it expects it

The Fusion Architecture Business Logic

View

WebCenter

User Interface

Data

Business Services



ADF Business Components

ADF Faces components

Database Database Schema Schema

Data Binding SDO Services Events

Business Activity Monitoring

Human Workflow Service

Assign Task

Mediator /BPEL Process

Human interaction

Rules Engine

facts results

Task Complete

Monitoring

Demonstration: Building a Fusion Application in 5 minutes!

Orchestration

Policy evaluation

Building Business Services Agenda • Introduction to ADF Business Components • Entity objects • View objects • Application modules



Introduction to ADF Business Components

• Model driven list of values • Validation

ADF Business Components – High Level Overview • Manages persistence • • • •

O/R Mapping Queries DML Record locking

• Performs validation • Data validation • Business logic validation

ADF Business Components – More Details • Provides data interaction and business logic execution • Maps to database tables • 4GL development • Wizard-based or visual development • Implemented in metadata not code

• Simplifies business logic development • Pre-defined Java methods for events • Declarative business rules

• Can expose functionality as a service

The Building Blocks of ADF • Entity object • Acts as a cache

• View object • Defines and application specific view of data

• Application module • Transactional container representing a use case

The Building Blocks of ADF • Association • Defines a relationship beween entity objects • Manages entity coordination

• View link • Defines a link between view objects • Defines master/details links between views

Start with Your Database Tables

Entity Objects Encapsulate Business Rules, Logic, Defaults in a Consistent Way for a Table

View Objects Encapsulate SQL Queries to Project, Join, Filter, Order Data for External Client Interaction

Application Module Defines Data Model of View Object Usages for a Complete Application Use Case

User Interfaces Work with the Application Module as Their Backend Business Service

As You Build New Applications, Underlying Components Are Reusable





Demonstration: Building ADF Business Components

Managing Entity Objects

Creating and Managing Entity Objects

Defining Attribute Control Hints

• Generate entity objects from database table • Attributes • Type • Properties • Updatable, mandatory, etc • Control hints • Label, tooltip text, format mask

• Constraints • Validation

• Defines default UI representation

CustomerEO Id Name Status Email Database table

CUSTOMERS ID

NAME

STATUS

201 202

Steve Mike

Gold Silver

Email [email protected] [email protected]

• • • •

Label Tooltip text Format mask Control type

Creating and Managing View Objects

Managing View Objects

• Represent a query that shapes data for an application specific purpose • Join, filter, and sort business data

• Enables you to have an application specific view of data • Constructed from SQL statement, static values or populated programmatically • Can be based on any number of entity objects • Facilitates lookup

Conditional queries with named bind variables

Creating and Managing View Objects AllCustomersVO CustId

CustFirstName

CustLastName

NLS Territory

Account Manager

101

Constantine

Welles

AMERICA

148

102

Harrison

Pacino

ITALY

148

103

Manisha

Taylor

AMERICA

101

326

Hal

Olin

GERMANY

101

344

Marlon

Godard

JAPAM

149

105

Matthias

MacGraw

AMERICA

148

104

Harrison

Sutherland

AMERICA

148

CustomersEO CustId

CustFirstName

CustLastName

NLS Territory

Account Manager

101

Constantine

Welles

AMERICA

148

102

Harrison

Pacino

ITALY

148

103

Manisha

Taylor

AMERICA

101

326

Hal

Olin

GERMANY

101

344

Marlon

Godard

JAPAM

149

105

Matthias

MacGraw

AMERICA

148

104

Harrison

Sutherland

AMERICA

148

Creating and Managing View Objects

View Links

USCustomersVO CustId

CustFirstName

CustLastName

FirstName

105

Matthias

MacGraw

Cambrault

104

Harrison

Sutherland

Cambrault

103

Manisha

Taylor

Kocher

101

Constantine

Welles

Cambrault

• • • • EmployeesEO

CustomersEO CustId

CustFirstName

CustLastName

NLS Territory

Link related view objects Define a source attribute and destination attribute Can be based on associations Provide master/detail

Account Manager

EmpId

FirstName

LastName

101

Constantine

Welles

AMERICA

148

101

Nina

Kocher

102

Harrison

Pacino

ITALY

148

148

Gerald

Cambrault

103

Manisha

Taylor

AMERICA

101

326

Hal

Olin

GERMANY

101

344

Marlon

Godard

JAPAM

149

105

Matthias

MacGraw

AMERICA

148

104

Harrison

Sutherland

AMERICA

148

OrderItemsOrderIdFkLink

OrdersView

OrderItemsView

View Object Attributes

View Object Attributes

• Can be based on

• Transient attributes

• Entity object attribute • Select statement • Transient (e.g. calculations)

• Derived from Groovy expressions • LineTotal = Quantity * UnitPrice • adf.CurrentDate • SQL expressions • Customers.CUST_GEO_LOCATION.sdo_point.x

• Can define default values • Based on literal values • Expressions

View Object List of Values

View Object View Criteria

• Define a list of values for a view object attribute • • • • • •

Choice list Combo box Combo box with list of values Input text with list of values List box Radio group

• • • •

Named filter criteria Augments the where clause of the target view object Can be displayed as query panel Can include bind variables

• Correct UI components defaulted

ADF Application Modules

Managing Application Modules

• Contain instances of view objects to implement a use based • Control connection to database and transaction boundary (rollback, commit) • Provide remotely accessible methods • Easily reusable

Defining the Data Model for the Application Module

Demonstration: Refining your business services

Adding Validation

Adding validation

• Entity object provide declarative validation • Entity or attribute level • • • • • •

Compare List Key exists Regular expression Script Java method

• Define when validation fires • Define error or information messages • Can be parameterized

Compare Validation • Compare an attribute against • A static value • An expression • Attribute from another view object

List Validation • Compare an attribute against • A static list of values • A view object • A database query

Key Exists Validation

Regular Expression Validation

• Ensure value exists as a key

• Validate data against a pattern

• For example, ensure AcctMgr is valid Employee in Employees table

• For example • [A-Z][a-z]{0,10} • [A-Z0-9._%+-]+@[A-Z0-9.]+\.[A-Z]{2,4} • Built in patterns • Email address • US phone number

Script Expression Validation

Java Method Validation

• Validate against a Groovy expression

• Validate against a Java method

• Java like syntax • Allows quick development of conditional rules

• Gives you the full power of Java for your validation rules

Summary

Demonstration: Adding Business Service Validation

• Entity objects act as data cache



• Validation rules placed on entity objects

• Associations define relationships between entity objects • Views shape application data • Model driven list of values • Calculated transient attributes • View criteria

• View links allow view objects to define master/detail • Application module uses view object instances to implement use cases

Building ADF Faces Pages Agenda

JSF Key Concepts • UI Component

• Introduction to UI technologies • Introduction to ADF Faces Rich Client

• JSF is component based

• Managed Beans & Backing Beans

• ADF Faces components

• Encapsulates Application Logic, Data and Component Properties

• ADF Model • Binding business service to UI items

• Expression Language

• ADF Controller

• Binding data to the UI

• Navigation Case

• Bounded task flow • Unbounded task flow

• The rules that govern page flow

• Lifecycle • Cycle of creation, validation, data-binding and business service interactions of a page

How Oracle Improves JSF • ADF Faces Components

ADF Faces Rich Client

• More components • Better components

• Templating • ADF Task Flow • Extended JSF controller

• Page fragments • Page regions • Reusable flows

ADF Faces Components Examples

• • • • • • • • • •

150+ AJAX enabled JavaServer Faces components Dialog and popup framework Drag-and-drop framework Navigation menu framework Partial page rendering Active data framework Advanced data streaming – push to client Complete JavaScript API Templating Skinning

Templates • A template is a reusable ADF Faces page that contains place holders for custom page content • Templates are interpreted at runtime • Templates may accept parameters for passing information from the inheriting page to the template • Templates can be based on quick start layouts

Creating a Page Template Header (with Title)

Menu Regions

A Named Facets

Demonstration: Building a Page Template

B News Portlet

Layout Components

Introduction to ADF Faces Rich Client Components

• panelTabbed • Container of panels with tabs

• panelBox • Box with title area

• panelAccordion • Container of collapsable panels

• panelFormLayout • Lays out children in tabular form

• panelSplitter • Resizable split panels

Common Components • Regular components • Text items, buttons, check boxes, radio buttons

• List selection components • Single select, multiple select, combo box, shuttle

• Data layout components • Table, tree, tree table

• Choosers • Choose date, choose color

• Menus • Others • Progress bar, bread crumbs …

Using ADF Faces Input Components • inputNumberSlider • Input numerical data via a slider

• inputNumberSpinbox • Use can type or step through numbers

• inputRangeSlider • Input a range of values via a slider

• chooseDate • Select a date from calendar

• richTextEditor • Editor with formating

Operation Components • Instead of writing JavaScript • Validators • Convertors • Drag and drop • Pop up • Poll • Listeners • Export • Print

ADF Faces Popup Dialogs, Menus, Windows • dialog • Lays out children in dialog window

• menu • Traditional menu

• panelWindow • Like a dialog but without the buttons

• noteWindow • Read only note often used to show help or extra information

ADF Faces Carousel • Display images in a revolving carousel • ADF Faces components can be used on carousel pages

ADF Faces Data Visualization - Graphs • 50 graph types • Flash or PNG rendering • Interactive: • • • •

Zoom Scroll Time selector window Line and legend highlighting/fading • Dynamic reference lines and areas • Animation

ADF Faces Hierarchy Viewer • • • • •

Visualize relationships Expand/collapse nodes Include ADF Faces components in nodes Zoom in/out Flash based

ADF Faces Data Visualization - Gauges • Dial: standard and threshold • Status Meter: standard and threshold • LED

ADF Data Visualization - Geographic Map • Represents business data on a geographic map • Supports superimposing multiple layers of information on a single map • Available Map types are: • • • •

ADF Data Visualization - Pivot Table • Multiple layers of data labels on a row or a column edge • Automatic calculation of subtotals and totals • Drag and drop pivoting

Thematic Pie Bar Point

ADF Data Visualization - Gantt Chart • Track tasks and resources against a timeline • Gantt Chart types



Demonstration: Building the Customers Page

• Project Gantt • Scheduling Gantt • Resources Gantt

ADF Controller Task Flows

ADF Controller

• An extension to the JSF standard page flow engine that adds: • Page and flows re-use • Executing code in a flow (hence task flow not page flow) • Security • Flow control • Exception and transaction management • Declarative back button control

ADF Controller Task Flows

ADF Bounded Task Flow : Trains

• Bounded task flow

• Bounded task flows can define a train • The framework Maintains knowledge of where you are • Train control and navigation buttons automatically managed

• Reuable portion of an application • Single entry point • May accept parameters • Own memory scope

• Unbounded task flow • Top level task flow • Multiple entry points

ADF Bounded Task Flow : Region • Bounded task flows can be made up of page fragments • Such flows can then be embedded into pages as “regions” • This is a very common pattern allowing the creation of complex pages made up of a series of re-usable components (ie. Task Flows) • Just drag and drop the flow into the page

Additional Reusability Features in ADF • Page Fragments • Develop reusable areas

• Page Regions • Construct a page from fragments

• Declarative Components • Bundle components together to create a new component

Summary

Demonstration: Building Task Flows

• ADF Faces provides a rich set up UI components • Layout components • Input components • Data visualization graphs

• ADF Model provides abstraction of binding • ADF Controller • Extends JSF controller • Reuse of application flows



How Do You Prefer to Learn?

Learning ADF

Official Oracle University Courses

• http://download.oracle.com/otn_hosted_doc/jdeveloper/11 gdemos/ADFTour/ADFTour.html • Live Course • Online Course • Books • Online resources • Learn while doing

Books

• Oracle Fusion Middleware 11g: Java Programming • Oracle Fusion Middleware 11g: Build Applications with ADF I • Oracle Fusion Middleware 11g: Build Applications with ADF II • Oracle Fusion Middleware 11g: ADF Desktop Integration • Oracle Fusion Middleware 11g: Build Java EE Applications

Books • • • •

Quick Start Guide to Oracle Fusion Development Oracle JDeveloper 11g Handbook Oracle Fusion Developer Guide Oracle ADF Enterprise Application Development-Made Simple • Oracle JDeveloper 11gR2 Cookbook

Online Documentation

ADF Insider

OTN Resources

• • • •

• • • • •

ADF Insider Basics ADF Insider Advanced ADF Insider Essentials ADF Insider Essentials Tasks

Community Resources

Tutorials How-To’s Sample Applications - FOD & Summit ADF Code Corner OTN Harvest

The Step By Step Guide POC

ADF Insider

ADF Insider Essentials Tasks

Go through ADF tutorials Read JDeveloper Handbook OU Build Applications With ADF

Watch ADF Insider Basics Videos Read QuickStart Guide to ADF Get at least the basics of the Java language

Q U E S T I O N S

&

ANSWERS

Online resources/tutorials/videos

Fusion Developer Guide Events/User Groups/Community

• Searchable blogs/how-to’s repository

Code Corner

Blogs/OTN/Twitter/ADF Community

Blogs ADF Enterprise Methodology Group JDeveloper Discussion Forum http://www.connotea.org/user/jdeveloper/

Documentation/Developer Guides

• • • •

Suggest Documents