SlideShare ist ein Scribd-Unternehmen logo
1 von 104
Oracle ADF one day training
OVERVIEW
2 Oracle ADF
First Half
• Introduction to Oracle Fusion Middleware and Oracle ADF
• Getting started with JDeveloper
• Building a Business Model with ADF Business Components
• Querying and persisting data
• Exposing Data
• Declaratively Customizing Data Services
• Programmatically Customizing Data Services
• Validating User Inputs
Second Half
• Understanding UI Technology
• Binding UI Components to Data
• Planning the User Interface
• Passing values between UI Elements
• Responding to Application Events
• Implementing Transactional Capabilities
Oracle ADF3
INTRODUCTION TO ORACLE FUSION
MIDDLEWARE AND ORACLE ADF
• Oracle Fusion Architecture
• Oracle ADF Framework
• How the Oracle ADF Framework Implements MVC
ORACLE FUSION ARCHITECTURE
4 Oracle ADF
ORACLE FUSION ARCHITECTURE…
5 Oracle ADF
Oracle Fusion Middleware (OFM, also known as Fusion Middleware) consists of
several software products from Oracle Corporation. OFM spans multiple services,
including Java EE and developer tools, integration services, business intelligence,
collaboration, and content management.
ORACLE ADF FRAMEWORK
6 Oracle ADF
Oracle Application Development Framework, usually called Oracle ADF, provides a
commercial Java framework for building enterprise applications. It provides visual
and declarative approaches to Java EE development.
It supports rapid application development based on ready-to-use design
patterns, metadata-driven and visual tools.
Oracle ADF simplifies Java EE development by minimizing the need to write code
that implements design patterns and the application infrastructure. These
implementations are provided as part of the framework.
HOW THE ORACLE ADF FRAMEWORK IMPLEMENTS MVC
7 Oracle ADF
Oracle ADF8
GETTING STARTED WITH JDEVELOPER
• Benefits of Using JDeveloper
• Launching JDeveloper
• Defining Roles
• Using JDeveloper Features
• Setting IDE Preferences
• Creating an ADF Application and project
• Creating Database Connections
BENEFITS OF USING JDEVELOPER
9 Oracle ADF
JDeveloper is a freeware IDE supplied by Oracle Corporation. It offers features for
development in Java, XML, SQL and PL/SQL, HTML, JavaScript, BPEL and PHP.
JDeveloper covers the full development lifecycle from design through coding,
debugging, optimization and profiling to deploying.
With JDeveloper, Oracle has aimed to simplify application development by focusing
on providing a visual and declarative approach to application development in
addition to building an advanced coding-environment. Oracle JDeveloper
integrates with the Oracle Application Development Framework (Oracle ADF) - an
end-to-end Java EE-based framework that further simplifies application
development.
LAUNCHING JDEVELOPER
10 Oracle ADF
You can launch Jdeveloper in one of the following ways:
• By selecting Start  Programs  Oracle Fusion Middleware 11.1.1.2.0 
Jdeveloper Studio 11.1.1.20
• By double clicking the Jdeveloper executable in home directory of Jdeveloper
installation
• From command line or shortcut with following command:
<Jdev Home>jdevbinjdev.exe
DEFINING ROLES
11 Oracle ADF
USING JDEVELOPER FEATURES
12 Oracle ADF
Jdeveloper features that facilitate ease of application development include:
• Application Navigator
• Database Navigator
• Editor (Code or Visual editor)
• Component Pallete
• Resource Pallete (IDE and Application)
• Data Controls Panel
• Structure Window
• Property Inspector
• Log Window
SETTING PREFERENCES
13 Oracle ADF
There are many preferences that you can set to affect the display and functionality
of the IDE. You can access the preferences window by selecting ToolsPreferences
CREATE AN ADF APPLICATION AND PROJECT
14 Oracle ADF
You create an application by invoking the Create Application dialog box in one of the following ways:
• If there is an application already open in JDeveloper, invoke the application drop-down list and select
New Application. If there is no open application, click New Application.
• Select File > New, and in the New Gallery dialog box, select General - Applications. Then select either
Generic Application, or a specific type of application from the list. Click OK.
There are two ways to create a project in JDeveloper. The first way is when you create an application.
Depending on the application template that you select, one or more projects are created automatically.
Sometimes you are presented with a wizard page enabling you to name the project and set its
technologies.
The second method of creating a project is to create a new one. You must first select an existing
application to contain the project. Then you can create a new project from the New Gallery in one of the
following ways:
• Invoke the application menu that appears to the right of the application name in the Applications
Navigator, or click the down arrow at the far right of the application name, and select New Project to
invoke the New Gallery.
• Select File > New from the menu.
• Click New on the Toolbar.
In the New Gallery, select the type of project to create, and then click OK.
When you are presented with the Create Project Wizard, you can name the project and specify where you
want to store the project files. Depending on the type of project, you may also need to select the
technologies to use, set Java or EJB settings, or define other types of project properties.
15 Oracle ADF
1 2 3
4 5
6 7
CREATING DATABASE CONNECTION
16 Oracle ADF
There are wo types of database connections
: • IDE – Available to be added to any application – Create in Database Navigator or
Resource Palette
– To add to an application, drag to Application Resources or to an application in
Database Navigator
• Application – Owned by a specific application – Create in Database Navigator or
Application Resources
Oracle ADF17
BUILDING A BUSINESS MODEL WITH ADF
BUSINESS COMPONENTS
• Describing ADF Business Components
• Types of ADF Business Components
• Create ADF Business Components from Tables Wizard
• Examining Created Objects
• Testing the Data Model
DESCRIBING ADF BUSINESS COMPONENTS
18 Oracle ADF
ADF. Business Components (ADF BC) characteristics:
• Provides data interaction and business logic execution
• Maps to a data source, such as an Oracle database
• Enables 4GL development
– Wizard-based or visual development
– Implemented in metadata, not code
• Enables business logic development
— Predefined Java methods for any event
– Declarative business rules
TYPES OF ADF BUSINESS COMPONENTS
19 Oracle ADF
There are two types of Oracle ADF Business Components objects that represent
features of your data source. If you have a well-designed data source, the structure
of these objects should reflect the structure of the data source. Data sources are
represented by the following types of
components:
• Entity objects, which represent objects in the data source (usually tables, views,
and synonyms in a database)
• Associations, which represent relationships between these objects (such as
foreign key relationships)
Other types of ADFBC objects collect data and present it to the client model. They
should be designed on the client’s specific data needs. For this reason, they are not
as reusable as entity objects and associations. There are three such components:
• View objects, which collect data from the data source, usually by a SQL query
• View links, which represent relationships (such as master-detail relationships)
between view object result sets
• Application modules, which provide a single point of access to the view objects
and view links
CREATE ADF BUSINESS COMPONENTS FROM TABLES
WIZARD
20 Oracle ADF
You can use the checklist to create the Business Components or you can create the
business components by your own or you can use Business Components from
Table. Here we will create Business Components by using Business Components
from Tables method.
• Right click the Model Project. Select New>From Gallery
• Select Business Components from Tables and Click OK
• A Initialize Business Components Project dialog box will appear. Here you need
to select the database connection. Select the connection and click ok. If there is
no connection available create a new one
• Now, use the wizard to create the ADF BC Components
21 Oracle ADF
22 Oracle ADF
EXAMINING CREATED OBJECTS
23 Oracle ADF
The Business components that you have created will be shown in application
navigator and you can examine it by double clicking it
TESTING THE DATA MODEL
24 Oracle ADF
JDeveloper provides a way to test the data model without creating a client
application. You can perform this testing by using the Business Components
Browser, sometimes also referred to as the Business Components Tester or the BC
Tester.
To use the Business Components Browser to test the data model, right-click the
application module in the Application Navigator and select Run from the context
menu.
A Connect dialog box appears, where you select your database connection and
click Connect. After the connection is established, the Business Components
Browser displays a tree with the application module and all of its view object and
view link instances. You can double-click a top-level view object instance to view it
alone, or double-click a view link instance to view both master and detail in a
hierarchy, with the master row displayed in form style and the detail rows
displayed in tabular style.
25 Oracle ADF
Oracle ADF26
QUERYING AND PERSISTING DATA
• Characteristics of View Objects
• Creating View Objects for queries
• Testing view objects
• Characteristics of Entity Objects
• Creating Entity Objects
• Synchronizing an Entity Objects with changes to Database Table
• Linking View Objects
• Refactoring View Objects
CHARACTERISTICS OF VIEW OBJECTS
27 Oracle ADF
• Represents a query
• Are used for joining, filtering, projecting, and sorting business data
• Enable you to have a view of data that is specific to one part of your application
• Can be constructed from a SQL statement, static values, or populated
programmatically
• Can also be based on any number of entity objects
CREATING VIEW OBJECTS FOR QUERIES
28 Oracle ADF
TESTING VIEW OBJECTS
29 Oracle ADF
CHARACTERISTICS OF ENTITY OBJECTS
30 Oracle ADF
• An entity object is the ADFBC component that represents a row in a database
table and simplifies modifying its data. It enables you to encapsulate domain
business logic for those rows to ensure that your business policies and rules are
consistently validated.
• Each entity object maps to a data source, usually a database table or database
view. Entity objects handle database caching so that changes to data are cached
in the entity object before being committed to the database.
• Entity objects are the foundation of the Business Components technology. Each
entity object represents abusiness object, or business entity, in your application.
Entity objects handle business rules and validation and can contain custom
business methods.
CREATING ENTITY OBJECTS
31 Oracle ADF
SYNCHRONIZING AN ENTITY OBJECTS WITH CHANGES TO
DATABASE TABLE
32 Oracle ADF
If you alter a table for which you have already created an entity object, the existing entity is
not disturbed by the presence of additional attributes in its underlying table. However, if you
want to access the new table column in your application, you first need to synchronize the
entity object with the database table. To perform this synchronization from JDeveloper, right-
click the entity object in question and select “Synchronize with Database” from the context
menu. For example, suppose you had issued the following SQL*Plus command to add a new
SECURITY_QUESTION column to the USERS table:
ALTER TABLE USERS ADD (security question VARCHAR2 (60));
When you use the synchronize feature on the existing User entity, the “Synchronize with
Database” dialog box proposes the changes that it can perform for you automatically. By
clicking the desired button, you can carry out the synchronization.
LINKING VIEW OBJECTS
33 Oracle ADF
Use create view link wizard to link View Objects
REFACTORING VIEW OBJECTS
34 Oracle ADF
With Refactoring you can:
• Rename/Delete Objects
• Move Objects or packages to a different package
• Change all references throughout the application
Oracle ADF35
EXPOSING DATA
• Characteristics of an Application Module
• Creating an Application Module
• Defining the Data Model for Application Module
• Nested and Shared Application Module
• Application Module Pooling
CHARACTERISTICS OF AN APPLICATION MODULE
36 Oracle ADF
• Represents the data model that the client uses and has one connection to the
database
• Provides transactional context for the application
• Enables you to gather data customized to a client interface so that data can be
retrieved in one network round-trip
• Can contain other application modules, called nested application modules
• Keeps track of all changes that affect data in the database
• Provides remotely accessible methods to implement application module behaviour
• ls deployable in multiple configurations
• Can be easily reused in business logic tiers of other applications
CREATING AN APPLICATION MODULE
37 Oracle ADF
DEFINING THE DATA MODEL FOR APPLICATION MODULE
38 Oracle ADF
NESTED AND SHARED APPLICATION MODULE
39 Oracle ADF
APPLICATION MODULE POOLING
40 Oracle ADF
Oracle ADF41
DECLARATIVELY CUSTOMIZING DATA
SERVICES
• Declaratively modify view objects, entity objects and
application modules
• Internationalizing the Data Model
• Create view criteria
• Create LOVs
DECLARATIVELY MODIFY VIEW OBJECTS, ENTITY OBJECTS
AND APPLICATION MODULES
42 Oracle ADF
INTERNATIONALIZING THE DATA MODEL
43 Oracle ADF
When an application is internationalized, the UI displays text based on a user’s
browser settings.
To use resource bundles for translatable strings, you can:
• Create one bundle per file or project
• Translate and append _<locale> to the file name
• Configure the UI
CREATE VIEW CRITERIA
44 Oracle ADF
CREATE LOV
45 Oracle ADF
Oracle ADF46
PROGRAMMATICALLY CUSTOMIZING DATA SERVICES
• Generating Java classes for adding code
• Supporting Entity Java Classes
• Supporting View Object Java Classes
• Changing View Object WHERE or ORDER BY clause at Runtime
• Finding an Entity Object by Primary Key
• Updating or Removing an Existing Entity Row
• Creating a New Entity Row
• Creating a Test Client
• Accessing View Criteria programmatically
GENERATING JAVA CLASSES FOR ADDING CODE
47 Oracle ADF
SUPPORTING ENTITY JAVA CLASSES
48 Oracle ADF
SUPPORTING ENTITY JAVA CLASSES
49 Oracle ADF
CREATING A TEST CLIENT
50 Oracle ADF
CHANGING VIEW OBJECT WHERE OR ORDER BY CLAUSE AT
RUNTIME
51 Oracle ADF
FINDING AN ENTITY OBJECT BY PRIMARY KEY
52 Oracle ADF
UPDATING OR REMOVING AN EXISTING ENTITY ROW
53 Oracle ADF
CREATING A NEW ENTITY ROW
54 Oracle ADF
ACCESSING VIEW CRITERIA PROGRAMMATICALLY
55 Oracle ADF
Oracle ADF56
VALIDATING USER INPUTS
• Using Declarative Validation
USING DECLARATIVE VALIDATION
57 Oracle ADF
Oracle ADF58
UNDERSTANDING UI TECHNOLOGY
• What are servlets?
• Java Server Pages (JSP)
• What are JavaBeans?
• What is Java Server Faces (JSF)?
• Defining Navigation by using JSF Controller
• Using JSF Components
• Using JSF Managed Beans
WHAT ARE SERVLETS?
59 Oracle ADF
Servlets:
• Are written in java
• Extend the Web Server
• Can be used to provide:
• Back-End Functionality
• User Interface
A Servlet is an object that receives a request and generates a response based on that request. The
basic Servlet package defines Java objects to represent servlet requests and responses, as well as
objects to reflect the servlet's configuration parameters and execution environment. The package
javax.servlet.http defines HTTP-specific subclasses of the generic servlet elements, including session
management objects that track multiple requests and responses between the web server and a
client. Servlets may be packaged in a WAR file as a web application.
Servlets can be generated automatically from Java Server Pages (JSP) by the Java Server Pages
compiler. The difference between servlets and JSP is that servlets typically embed HTML inside Java
code, while JSPs embed Java code in HTML. While the direct usage of servlets to generate HTML (as
shown in the example below) has become rare, the higher level MVC web framework in Java EE (JSF)
still explicitly uses the servlet technology for the low level request/response handling via the Faces
Servlet. A somewhat older usage is to use servlets in conjunction with JSPs in a pattern called "Model
2", which is a flavor of the model–view–controller.
JAVA SERVER PAGES (JSP)
60 Oracle ADF
Java Server Pages (JSP) is a technology that helps software developers create dynamically
generated web pages based on HTML, XML, or other document types. Released in 1999
by Sun Microsystems, JSP is similar to PHP and ASP, but it uses the Java programming
language.
JSP allows Java code and certain pre-defined actions to be
interleaved with static web markup content, such as HTML, with the resulting page being
compiled and executed on the server to deliver a document. The compiled pages, as well
as any dependent Java libraries, contain Java bytecode rather than machine code. Like any
other Java program, they must be executed within a Java virtual machine (JVM) that
interacts with the server's host operating system to provide an abstract, platform-neutral
environment.
JSPs are usually used to deliver HTML and XML documents, but
through the use of OutputStream, they can deliver other types of data as well.
The Web container creates JSP implicit objects like pageContext,
servletContext, session, request & response.
WHAT ARE JAVABEANS?
61 Oracle ADF
JavaBeans are classes that encapsulate many objects into a single object (the bean). They
are serializable, have a zero-argument constructor, and allow access to properties using
getter and setter methods.
Advantages:
• The properties, events, and methods of a bean that are exposed to another application
can be controlled.
• A bean may register to receive events from other objects and can generate events that
are sent to those other objects.
• Auxiliary software can be provided to help configure a java bean.
• The configuration settings of a bean can be saved to persistent storage and restored.
WHAT IS JAVA SERVER FACES (JSF)?
62 Oracle ADF
JavaServer Faces (JSF) is a Java-based web application framework intended to simplify
development integration of web-based user interfaces. JavaServer Faces is a standardized
display technology which was formalized in a specification through the Java Community
Process.
JSF reduces the effort in creating and maintaining applications which will run on a
Java application server and will render application UI on to a target client. JSF facilitates
Web application development by :-
• providing reusable UI components
• making easy data transfer between UI components
• managing UI state across multiple server requests
• enabling implementation of custom components
• wiring client side event to server side application code
DEFINING NAVIGATION BY USING JSF CONTROLLER
63 Oracle ADF
USING JSF COMPONENTS
64 Oracle ADF
USING JSF MANAGED BEANS
65 Oracle ADF
USING JSF MANAGED BEANS…
66 Oracle ADF
Application Scope
The application scope lasts until the application stops. Values that you store in a managed
bean with this scope are available to every session and every request that uses the
application.
Avoid using this scope in a task flow because it persists beyond the life span of the task
flow.
Session Scope
The session scope begins when a user first accesses a page in the application and ends
when the user's session times out due to inactivity, or when the application invalidates
the session.
Use this scope only for information that is relevant to the whole session, such as user or
context information. Avoid using it to pass values from one task flow to another. Instead,
use parameters to pass values between task flows. Using parameters gives your task flow
a clear contract with other task flows that call it or are called by it. Another reason to
avoid use of session scope is because it may persist beyond the life span of the task flow.
USING JSF MANAGED BEANS…
67 Oracle ADF
Page Flow Scope
Choose this scope if you want the managed bean to be accessible across the activities
within a task flow. A managed bean that has a pageFlow scope shares state with pages
from the task flow that access it. A managed bean that has a pageFlow scope exists for the
life span of the task flow.If another task flow's page references the managed bean, the
managed bean creates a separate instance of this object and adds it to the pageFlow
scope of its task flow.
View Scope
Use this scope for managed bean objects that are needed only within the current view
activity and not across view activities. It defines scope for each view port that ADF
Controller manages, for example, a root browser window or an ADF region.
The life span of this scope begins and ends when the current viewId of a view port
changes. If you specify view, the application retains managed bean objects used on a page
as long as the user continues to interact with the page. These objects are automatically
released when the user leaves the page.
USING JSF MANAGED BEANS…
68 Oracle ADF
Request Scope
Use request scope when the managed bean does not need to persist longer than the
current request.
Backing Bean Scope
A backing bean is a convention to describe a managed bean that stores accessors for UI
components and event handling code on a JSF page. It exists for the duration of a request
and should not be used to maintain state.
Use this scope if it is possible that your task flow appears in two ADF regions on the same
JSF page and you want to isolate each instance of ADF region.
None
When you create objects (such as a managed bean) that require you to define a scope,
you can set the scope to none, meaning that it will not live within any particular scope,
but will instead be instantiated each time it is referenced. You should set a bean's scope to
none when it is referenced by another bean.
Oracle ADF69
BINDING UI COMPONENTS TO DATA
• Create a JSF Page
• Add ADF Faces UI components to a page
• Include databound components on a page
• Create and edit data bindings
CREATE A JSF PAGE
70 Oracle ADF
ADD ADF FACES UI COMPONENTS TO A PAGE
71 Oracle ADF
INCLUDE DATA BOUND COMPONENTS ON A PAGE
72 Oracle ADF
CREATE AND EDIT DATA BINDINGS
73 Oracle ADF
Oracle ADF74
PLANNING THE USER INTERFACE
• Characteristics of ADF Task Flows
• Characteristics of ADF Bounded task flows
• Characteristics of ADF Unbounded task flows
• Converting task flows
• Using ADF Task Flow components
• Defining ADF Control flow rules
• Using Wildcards to define global navigation
• Using routers for conditional navigation
• Calling methods and other Task flows
• Defining a Task Flow Return Activity
CHARACTERISTICS OF ADF TASK FLOWS
75 Oracle ADF
Difference between JSF Page Flow & ADF Task Flow:
JSF Page Flow:
• The entire application must be represented in a single page navigation file (faces-config.xml). Although you can
have multiple copies of faces-config.xml in a project, the application loads these files as one at runtime.
• All nodes within a JSF page flow must be JSF pages. No other types of objects can exist within the JSF page flow.
• Navigation is only between pages.
• Application fragments cannot be reused.
• There is no shared memory scope between multiple requests except for session scope.
ADF Task Flow:
• The application can be broken up into a series of modular flows that call one another.
• You can add to the task flow diagram nodes such as views, method calls, and calls to other task flows.
• Navigation is between pages as well as other activities, including routers.
• ADF task flows are reusable within the same or an entirely different application. After you break up your
application into task flows, you may decide to reuse task flows containing common functionality.
• Shared memory scope (for example, page flow scope) enables data to be passed between activities within the
task flow. Page flow scope defines a unique storage area for each instance of an ADF bounded task flow.
• Task flows provide a more modular and transaction-aware approach to navigation and application control.
CHARACTERISTICS OF ADF UNBOUNDED TASK FLOWS
76 Oracle ADF
Unbounded Task Flows: A set of activities, control flow rules, and managed beans that
interact to allow a user to complete a task. An ADF unbounded task flow consists of all
activities and control flows in an application that are not included within any bounded
task flow.
• It is similar to the JSF page flow.
• When a project with the ADF Page Flow technology scope is created, it will contain a
task flow definition file called adfc-config.xml by default. This is an unbounded task
flow. Such task flows are called “unbounded” simply because they have no explicit
start or end.
• It can start from any view activity.
• An application can have one, and only one, unbounded task flow.
• It is possible to have several separate definition files containing unbounded task flow
definitions, but at runtime, these are all Merged into a single logical flow.
• No limits for entry and exit points.
• Can’t be creating on page fragments.
• An unbounded task flow cannot declaratively specify parameters.
• It cannot contain a default activity, an activity designated as the first to run in the
unbounded task flow.
CHARACTERISTICS OF ADF BOUNDED TASK FLOWS
77 Oracle ADF
• Reusable and parameterized and maintain private state.
• Can participate in transaction.
• Bounded task flow does not have an equivalent in the current JSF standard.
• Single entry point and zero or more exit point.
• Can be created as a page or page fragment.
• Data controls can be shared between task flows
• A bounded task flow can declaratively specify parameters.
• The bounded task flow always specifies a default activity, a single point of entry that
must execute immediately upon entry of the bounded task flow.
CONVERTING TASK FLOWS
78 Oracle ADF
USING ADF TASK FLOW COMPONENTS
79 Oracle ADF
DEFINING ADF CONTROL FLOW RULES
80 Oracle ADF
USING WILDCARDS TO DEFINE GLOBAL NAVIGATION
81 Oracle ADF
USING ROUTERS FOR CONDITIONAL NAVIGATION
82 Oracle ADF
CALLING METHODS AND OTHER TASK FLOWS
83 Oracle ADF
DEFINING A TASK FLOW RETURN ACTIVITY
84 Oracle ADF
Oracle ADF85
PASSING VALUES BETWEEN UI ELEMENTS
• Holding values in managed beans
• Using Parameters
• Returning values to a calling task flow
• Deciding which type of parameter to use
HOLDING VALUES IN MANAGED BEANS
86 Oracle ADF
USING PARAMETERS
87 Oracle ADF
• You can use:
• Page Parameter
• Region Parameter
• Task Flow Parameter
• View Activity Parameter
• Task Flow Call Parameter
You set the parameter values by using expressions (not by just entering a value).
The goal is increased reusability of pages and task flows
RETURNING VALUES TO A CALLING TASK FLOW
88 Oracle ADF
• To return a value, you must specify:
 Return value definition on the called task flow
 Return value on task flow call activity in the calling task flow
• Names must match
DECIDING WHICH TYPE OF PARAMETER TO USE
89 Oracle ADF
The use of one type of parameter does not preclude the use of another, because they all
have different functions. Defining parameters is all about providing reusability. Defining
parameter on a task flow improves reusability of that task flow. Defining parameters on a
page or page fragment improves its reusability. Parameters also make an object much
more encapsulated (self-contained).
Oracle ADF90
RESPONDING TO APPLICATION EVENTS
• Configure and use managed beans to contain code to
respond to events
• Describe different types of events
• Use phase listeners
• Create event listeners
• Define action listeners
• Create value change listeners
CONFIGURE AND USE MANAGED BEANS TO CONTAIN CODE
TO RESPOND TO EVENTS
91 Oracle ADF
DESCRIBE DIFFERENT TYPES OF EVENTS
92 Oracle ADF
JSF supports:
• Phase events
• Execute as part of the JSF and ADF life cycle
• Can be used to augment standard behavior
• 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
USE PHASE LISTENERS
93 Oracle ADF
It is possible to create event listeners, called phase listeners, that are triggered at
different stages of the JSF life cycle. This enables you to execute code processing that
should occur—for example, before the rendering of a page.
Using a phase listener, you can listen for phase events for any of the ADF life-cycle
phases, and execute your own code before and after the events.
The basic steps for implementing your own phase listener in an ADF application are
as follows:
1. Create a class that implements the javax. faces. event. PhaseListener interface.
2. 2. Add your own functionality in the beforePhase () and after Phase () methods of
your class.
3. 3. Use the Overview tab to register your listener with your faces-config. xml file.
You can accomplish similar functionality, but for a single page, by using a page phase
listener that implements the oracle. adf. controller. v2. lifecycle. PagePhaseListener
interface.
CREATE EVENT LISTENERS
94 Oracle ADF
Components can generate events, which are occurrences that take place as users
interact with an application, such as when they click a button or change a value.
There are also events, such as gaining or losing focus, that are not the result of user
interactions.
If there is a listener for the event, the event communicates some information about
what happened, so that the listener can respond. An event, then, is a component's
way of letting a listener know that something happened.
An event listener is a class that implements one of the listener interfaces and contains
code to respond to the event. A component has mechanisms to register and
deregister event listeners for the types of events that are generated by the
component.
DEFINE ACTION LISTENERS
95 Oracle ADF
Action listener differs from action methods:
• Action Listener
• Contain code to respond to an action
• Do not return a value
• Execute after a value change listeners
• Action methods
• Are used for navigation
• Return a String outcome
• Execute last
However, both can be initiated by the same action, such as button click.
CREATE VALUE CHANGE LISTENERS
96 Oracle ADF
• Select the input component in the visual editor. Edit the valueChangelistener
property and select a bean and method, or Create a new one.
• JDeveloper:
• Creates the method in the managed bean if it does not already exist
• Adds the method to the valueChangelistener property in the page source
• Add your code.
Oracle ADF97
IMPLEMENTING TRANSACTIONAL CAPABILITIES
• Explain ADF BC transaction handling
• Implement task flow transaction control
• Handle transaction exceptions
• Define response to browser’s Back Button
• Enable save for later functionality
EXPLAIN ADF BC TRANSACTION HANDLING
98 Oracle ADF
• Application modules handle transaction and concurrency support.
• No coding is required unless you want to customize the default behavior.
• For nested application modules, the outermost application module provides the
transaction context for the others.
IMPLEMENT TASK FLOW TRANSACTION CONTROL
99 Oracle ADF
• Transaction options on the called task flow definition specify whether a called
ADF bounded task flow should join an existing transaction, create a new one, or
create a new one only if there is no existing transaction.
• Savepoints: ADF creates a savepoint when a task flow is entered with an existing
transaction. The savepoint is a snapshot of the model state at the time the task
flow was entered. The savepoint enables the model state to be restored to what
it was at the time the task flow was entered.
• If the called ADF bounded task flow is able to start a new transaction (based on
the transaction option that you select), you can specify whether the transaction
is committed or rolled back when the task flow returns to its caller.
• In a called task flow definition, you can specify two different return task flow
activities that result in either committing or rolling back a transaction in the
called ADF bounded task flow.
• You can enable users to save the state of the UI and model at any point and come
back to it later.
• You can specify how a page should behave when users navigate to it by using the
Back button.
HANDLE TRANSACTION EXCEPTIONS
100 Oracle ADF
During the execution of an ADF task flow, exceptions can occur that may require
some kind of exception handling, such as when a method call activity throws an
exception or when a user is not authorized to execute the activity.
To handle exceptions thrown from an activity or caused by some other type of ADF
controller error, you can create an exception handler for an ADF bounded or
unbounded task flow. When an exception is raised within the task flow, the control
flow passes to the designated exception handling activity. The exception handler
activity can be any supported activity type, for example, a view that displays an error
message, or a router activity that passes the control flow to a method, based on an
expression that evaluates the type of exception.
DEFINE RESPONSE TO BROWSER’S BACK BUTTON
101 Oracle ADF
To deal with cases in which the end user clicks the Back button to navigate back into an ADF
bounded task flow that was already exited, you can specify the following task-flowreentry
options for the task flow definition that specify whether a page in the ADF bounded task flow
can be reentered:
reentry-allowed: Reentry is allowed on any view activity within the ADF bounded task flow.
reentry-not-allowed: Reentry of the ADF bounded task flow is not allowed. An end user can still
click the browser's Back button and return to a page within the bounded task flow. However, if
the user does anything on the page such as clicking a button, an exception (for example, Invalid
Task Flow Reentry) is thrown indicating that the bounded task flow was reentered improperly.
The actual reentry condition is identified upon the submit of the reentered page.
reentry-outcome-dependent: Reentry of an ADF bounded task flow using the browser's Back
button is dependent on the outcome that was received when the same ADF bounded task flow
was previously exited via task flow return activities. For example, a task flow representing a
shopping cart can be reentered if the user exited by cancelling an order, but not if the user
exited by completing the order. Upon reentry, ADF bounded task flow input parameters are
evaluated using the current state of the application, not the application state existing at the
time of the original ADF bounded task flow entry.
ENABLE SAVE FOR LATER FUNCTIONALITY
102 Oracle ADF
In some applications, an end user may need to stop without completing a task, for example, when
additional information is needed to answer questions. As the developer of the application, you
may want to retain the current state of the task if a user leaves a page without finalizing it. You can
also enable the user to complete the rest of the task at a future point, with former unsaved values
restored to the page. The ability to save the current application state is called save for later.
There are two general categories of saving for later:
• Explicit: For example, a page contains a button that the user can click to save all the data entered
so far on the page. Explicit save for later is available for both ADF unbounded and bounded task
flows. For example, a user may click a button to save, but not submit, a partial expense report, and
then may cancel out of the application. Later the user can invoke a list of saved expense reports
and select the one to continue working on.
• Implicit: For example, a user accidentally closes a browser window without saving data entered
on a page, a user logs out without saving the data, or the session times out. Implicit save for later
can originate only from a bounded task flow.
Save for later saves the data without enforcing validation rules or submitting it. The end user can
resume working on the application later with the same data that was saved at the point when save
for later was performed.
CONTACTS
103
Sopra Steria
AMSL
Building No 4, Plot No - 20&21,Sector - 135,
Dist- Gautam Buddha Nagar,Noida (UP)-201304
www.soprasteria.co.uk
Er Gurpreet Singh
Junior Software Engineer
CUG. 2142
M. +91-9803723925
Gurpreet.singh2@soprasteria.com
Presentation title
Presentation title104

Weitere ähnliche Inhalte

Was ist angesagt?

Presentation Spring, Spring MVC
Presentation Spring, Spring MVCPresentation Spring, Spring MVC
Presentation Spring, Spring MVCNathaniel Richand
 
RESTful API In Node Js using Express
RESTful API In Node Js using Express RESTful API In Node Js using Express
RESTful API In Node Js using Express Jeetendra singh
 
Access Denied: Real-World Use Cases for APEX and Real Application Security
Access Denied: Real-World Use Cases for APEX and Real Application SecurityAccess Denied: Real-World Use Cases for APEX and Real Application Security
Access Denied: Real-World Use Cases for APEX and Real Application SecurityJim Czuprynski
 
Alphorm.com : Formation Active directory 2008 R2 (70-640)
Alphorm.com : Formation Active directory 2008 R2 (70-640)Alphorm.com : Formation Active directory 2008 R2 (70-640)
Alphorm.com : Formation Active directory 2008 R2 (70-640)Alphorm
 
Writing simple web services in java using eclipse editor
Writing simple web services in java using eclipse editorWriting simple web services in java using eclipse editor
Writing simple web services in java using eclipse editorSantosh Kumar Kar
 
Dynamic Object-Oriented Requirements System (DOORS)
Dynamic Object-Oriented Requirements System (DOORS)Dynamic Object-Oriented Requirements System (DOORS)
Dynamic Object-Oriented Requirements System (DOORS)David Groff
 
Développement d'un site web jee de e commerce basé sur spring (m.youssfi)
Développement d'un site web jee de e commerce basé sur spring (m.youssfi)Développement d'un site web jee de e commerce basé sur spring (m.youssfi)
Développement d'un site web jee de e commerce basé sur spring (m.youssfi)ENSET, Université Hassan II Casablanca
 
iOS architecture patterns
iOS architecture patternsiOS architecture patterns
iOS architecture patternsallanh0526
 
Spring Framework - AOP
Spring Framework - AOPSpring Framework - AOP
Spring Framework - AOPDzmitry Naskou
 
WebLogic Scripting Tool Overview
WebLogic Scripting Tool OverviewWebLogic Scripting Tool Overview
WebLogic Scripting Tool OverviewJames Bayer
 

Was ist angesagt? (20)

Core java course syllabus
Core java course syllabusCore java course syllabus
Core java course syllabus
 
Presentation Spring, Spring MVC
Presentation Spring, Spring MVCPresentation Spring, Spring MVC
Presentation Spring, Spring MVC
 
Spring mvc
Spring mvcSpring mvc
Spring mvc
 
Presentation Spring
Presentation SpringPresentation Spring
Presentation Spring
 
RESTful API In Node Js using Express
RESTful API In Node Js using Express RESTful API In Node Js using Express
RESTful API In Node Js using Express
 
Spring Security 5
Spring Security 5Spring Security 5
Spring Security 5
 
Access Denied: Real-World Use Cases for APEX and Real Application Security
Access Denied: Real-World Use Cases for APEX and Real Application SecurityAccess Denied: Real-World Use Cases for APEX and Real Application Security
Access Denied: Real-World Use Cases for APEX and Real Application Security
 
Introduction to React JS
Introduction to React JSIntroduction to React JS
Introduction to React JS
 
Alphorm.com : Formation Active directory 2008 R2 (70-640)
Alphorm.com : Formation Active directory 2008 R2 (70-640)Alphorm.com : Formation Active directory 2008 R2 (70-640)
Alphorm.com : Formation Active directory 2008 R2 (70-640)
 
Writing simple web services in java using eclipse editor
Writing simple web services in java using eclipse editorWriting simple web services in java using eclipse editor
Writing simple web services in java using eclipse editor
 
Spring Security
Spring SecuritySpring Security
Spring Security
 
Spring AOP
Spring AOPSpring AOP
Spring AOP
 
Dynamic Object-Oriented Requirements System (DOORS)
Dynamic Object-Oriented Requirements System (DOORS)Dynamic Object-Oriented Requirements System (DOORS)
Dynamic Object-Oriented Requirements System (DOORS)
 
Java Spring Framework
Java Spring FrameworkJava Spring Framework
Java Spring Framework
 
Développement d'un site web jee de e commerce basé sur spring (m.youssfi)
Développement d'un site web jee de e commerce basé sur spring (m.youssfi)Développement d'un site web jee de e commerce basé sur spring (m.youssfi)
Développement d'un site web jee de e commerce basé sur spring (m.youssfi)
 
iOS architecture patterns
iOS architecture patternsiOS architecture patterns
iOS architecture patterns
 
Spring Framework - AOP
Spring Framework - AOPSpring Framework - AOP
Spring Framework - AOP
 
oracle-reports6i
oracle-reports6ioracle-reports6i
oracle-reports6i
 
WebLogic Scripting Tool Overview
WebLogic Scripting Tool OverviewWebLogic Scripting Tool Overview
WebLogic Scripting Tool Overview
 
IdP, SAML, OAuth
IdP, SAML, OAuthIdP, SAML, OAuth
IdP, SAML, OAuth
 

Ähnlich wie Oracle Application Developmenr Framework

Oracle9i application server oracle forms services
Oracle9i application server   oracle forms servicesOracle9i application server   oracle forms services
Oracle9i application server oracle forms servicesFITSFSd
 
Developing RIA Web Applications with Oracle ADF.pdf
Developing RIA Web Applications with Oracle ADF.pdfDeveloping RIA Web Applications with Oracle ADF.pdf
Developing RIA Web Applications with Oracle ADF.pdfsheriframadan18
 
Vesterli hot and_not_whitepaper_wildcard_2013
Vesterli hot and_not_whitepaper_wildcard_2013Vesterli hot and_not_whitepaper_wildcard_2013
Vesterli hot and_not_whitepaper_wildcard_2013Andrejs Vorobjovs
 
Ora_Case_Study_Oracle Application Development Framework
Ora_Case_Study_Oracle Application Development FrameworkOra_Case_Study_Oracle Application Development Framework
Ora_Case_Study_Oracle Application Development FrameworkNeha Singh
 
An introduction to microsoft power apps
An introduction to microsoft power appsAn introduction to microsoft power apps
An introduction to microsoft power appsMitul Rana
 
Oracle BPM workflow and Open-XDX web services (Part 2)
Oracle BPM workflow and Open-XDX web services (Part 2)Oracle BPM workflow and Open-XDX web services (Part 2)
Oracle BPM workflow and Open-XDX web services (Part 2)Bizagi Inc
 
The Five Ways of Building Oracle Applications
The Five Ways of Building Oracle ApplicationsThe Five Ways of Building Oracle Applications
The Five Ways of Building Oracle ApplicationsSten Vesterli
 
Oracle ADF Architecture TV - Design - Task Flow Overview
Oracle ADF Architecture TV - Design - Task Flow OverviewOracle ADF Architecture TV - Design - Task Flow Overview
Oracle ADF Architecture TV - Design - Task Flow OverviewChris Muir
 
4) databases
4) databases4) databases
4) databasestechbed
 
Oracle ADF Overview for Beginners
Oracle ADF Overview for BeginnersOracle ADF Overview for Beginners
Oracle ADF Overview for BeginnersJithin Kuriakose
 
Mt ADF 001 adf-course outlines
Mt ADF 001 adf-course outlinesMt ADF 001 adf-course outlines
Mt ADF 001 adf-course outlinesAbbas Qureshi
 
Oaf Course Content
Oaf Course ContentOaf Course Content
Oaf Course ContentERP KEY
 
OA Framwork Presentation.pptx
OA Framwork Presentation.pptxOA Framwork Presentation.pptx
OA Framwork Presentation.pptxwadierefky1
 
Application development and emerging technologies.pptx
Application development and emerging technologies.pptxApplication development and emerging technologies.pptx
Application development and emerging technologies.pptxMichael Angelo Marasigan
 
Oracel ADF Introduction
Oracel ADF IntroductionOracel ADF Introduction
Oracel ADF IntroductionHojjat Abedie
 
Database@Home : Data Driven Apps : Core-dev or Low Code UI
Database@Home : Data Driven Apps : Core-dev or Low Code UIDatabase@Home : Data Driven Apps : Core-dev or Low Code UI
Database@Home : Data Driven Apps : Core-dev or Low Code UITammy Bednar
 

Ähnlich wie Oracle Application Developmenr Framework (20)

Oracle9i application server oracle forms services
Oracle9i application server   oracle forms servicesOracle9i application server   oracle forms services
Oracle9i application server oracle forms services
 
Developing RIA Web Applications with Oracle ADF.pdf
Developing RIA Web Applications with Oracle ADF.pdfDeveloping RIA Web Applications with Oracle ADF.pdf
Developing RIA Web Applications with Oracle ADF.pdf
 
Vesterli hot and_not_whitepaper_wildcard_2013
Vesterli hot and_not_whitepaper_wildcard_2013Vesterli hot and_not_whitepaper_wildcard_2013
Vesterli hot and_not_whitepaper_wildcard_2013
 
Adf 11
Adf 11Adf 11
Adf 11
 
sql1
sql1sql1
sql1
 
Ora_Case_Study_Oracle Application Development Framework
Ora_Case_Study_Oracle Application Development FrameworkOra_Case_Study_Oracle Application Development Framework
Ora_Case_Study_Oracle Application Development Framework
 
An introduction to microsoft power apps
An introduction to microsoft power appsAn introduction to microsoft power apps
An introduction to microsoft power apps
 
Oracle BPM workflow and Open-XDX web services (Part 2)
Oracle BPM workflow and Open-XDX web services (Part 2)Oracle BPM workflow and Open-XDX web services (Part 2)
Oracle BPM workflow and Open-XDX web services (Part 2)
 
The Five Ways of Building Oracle Applications
The Five Ways of Building Oracle ApplicationsThe Five Ways of Building Oracle Applications
The Five Ways of Building Oracle Applications
 
J developer, oracle adf introduction
J developer, oracle adf   introductionJ developer, oracle adf   introduction
J developer, oracle adf introduction
 
Oracle ADF Architecture TV - Design - Task Flow Overview
Oracle ADF Architecture TV - Design - Task Flow OverviewOracle ADF Architecture TV - Design - Task Flow Overview
Oracle ADF Architecture TV - Design - Task Flow Overview
 
4) databases
4) databases4) databases
4) databases
 
Oracle ADF Overview for Beginners
Oracle ADF Overview for BeginnersOracle ADF Overview for Beginners
Oracle ADF Overview for Beginners
 
Mt ADF 001 adf-course outlines
Mt ADF 001 adf-course outlinesMt ADF 001 adf-course outlines
Mt ADF 001 adf-course outlines
 
Oaf Course Content
Oaf Course ContentOaf Course Content
Oaf Course Content
 
OAF & ADF.pptx
OAF & ADF.pptxOAF & ADF.pptx
OAF & ADF.pptx
 
OA Framwork Presentation.pptx
OA Framwork Presentation.pptxOA Framwork Presentation.pptx
OA Framwork Presentation.pptx
 
Application development and emerging technologies.pptx
Application development and emerging technologies.pptxApplication development and emerging technologies.pptx
Application development and emerging technologies.pptx
 
Oracel ADF Introduction
Oracel ADF IntroductionOracel ADF Introduction
Oracel ADF Introduction
 
Database@Home : Data Driven Apps : Core-dev or Low Code UI
Database@Home : Data Driven Apps : Core-dev or Low Code UIDatabase@Home : Data Driven Apps : Core-dev or Low Code UI
Database@Home : Data Driven Apps : Core-dev or Low Code UI
 

Mehr von Gurpreet singh

Introduction to Oracle Fusion BIP Reporting
Introduction to Oracle Fusion BIP ReportingIntroduction to Oracle Fusion BIP Reporting
Introduction to Oracle Fusion BIP ReportingGurpreet singh
 
Understanding Flex Fields with Accounting Flexfields(Chart of Accounts) in O...
Understanding Flex Fields with  Accounting Flexfields(Chart of Accounts) in O...Understanding Flex Fields with  Accounting Flexfields(Chart of Accounts) in O...
Understanding Flex Fields with Accounting Flexfields(Chart of Accounts) in O...Gurpreet singh
 
Oracle advanced queuing
Oracle advanced queuingOracle advanced queuing
Oracle advanced queuingGurpreet singh
 
Generics and collections in Java
Generics and collections in JavaGenerics and collections in Java
Generics and collections in JavaGurpreet singh
 
IO Streams, Serialization, de-serialization, autoboxing
IO Streams, Serialization, de-serialization, autoboxingIO Streams, Serialization, de-serialization, autoboxing
IO Streams, Serialization, de-serialization, autoboxingGurpreet singh
 
Creating business group in oracle apps
Creating business group in oracle appsCreating business group in oracle apps
Creating business group in oracle appsGurpreet singh
 
Defing locations in Oracle Apps
Defing locations in Oracle AppsDefing locations in Oracle Apps
Defing locations in Oracle AppsGurpreet singh
 
Assigning role AME_BUS_ANALYST
Assigning role AME_BUS_ANALYSTAssigning role AME_BUS_ANALYST
Assigning role AME_BUS_ANALYSTGurpreet singh
 
Introduction to Data Flow Diagram (DFD)
Introduction to Data Flow Diagram (DFD)Introduction to Data Flow Diagram (DFD)
Introduction to Data Flow Diagram (DFD)Gurpreet singh
 
Ingenium test(Exam Management System) Project Presentation (Full)
Ingenium test(Exam Management System) Project Presentation (Full)Ingenium test(Exam Management System) Project Presentation (Full)
Ingenium test(Exam Management System) Project Presentation (Full)Gurpreet singh
 

Mehr von Gurpreet singh (20)

Introduction to Oracle Fusion BIP Reporting
Introduction to Oracle Fusion BIP ReportingIntroduction to Oracle Fusion BIP Reporting
Introduction to Oracle Fusion BIP Reporting
 
Why Messaging system?
Why Messaging system?Why Messaging system?
Why Messaging system?
 
Understanding Flex Fields with Accounting Flexfields(Chart of Accounts) in O...
Understanding Flex Fields with  Accounting Flexfields(Chart of Accounts) in O...Understanding Flex Fields with  Accounting Flexfields(Chart of Accounts) in O...
Understanding Flex Fields with Accounting Flexfields(Chart of Accounts) in O...
 
Java Servlet part 3
Java Servlet part 3Java Servlet part 3
Java Servlet part 3
 
Oracle advanced queuing
Oracle advanced queuingOracle advanced queuing
Oracle advanced queuing
 
Oracle SQL Part 3
Oracle SQL Part 3Oracle SQL Part 3
Oracle SQL Part 3
 
Oracle SQL Part 2
Oracle SQL Part 2Oracle SQL Part 2
Oracle SQL Part 2
 
Oracle SQL Part1
Oracle SQL Part1Oracle SQL Part1
Oracle SQL Part1
 
Generics and collections in Java
Generics and collections in JavaGenerics and collections in Java
Generics and collections in Java
 
IO Streams, Serialization, de-serialization, autoboxing
IO Streams, Serialization, de-serialization, autoboxingIO Streams, Serialization, de-serialization, autoboxing
IO Streams, Serialization, de-serialization, autoboxing
 
Java Servlets Part 2
Java Servlets Part 2Java Servlets Part 2
Java Servlets Part 2
 
Creating business group in oracle apps
Creating business group in oracle appsCreating business group in oracle apps
Creating business group in oracle apps
 
Defing locations in Oracle Apps
Defing locations in Oracle AppsDefing locations in Oracle Apps
Defing locations in Oracle Apps
 
Assigning role AME_BUS_ANALYST
Assigning role AME_BUS_ANALYSTAssigning role AME_BUS_ANALYST
Assigning role AME_BUS_ANALYST
 
PL/SQL Part 5
PL/SQL Part 5PL/SQL Part 5
PL/SQL Part 5
 
PL/SQL Part 3
PL/SQL Part 3PL/SQL Part 3
PL/SQL Part 3
 
PL/SQL Part 2
PL/SQL Part 2PL/SQL Part 2
PL/SQL Part 2
 
PL/SQL Part 1
PL/SQL Part 1PL/SQL Part 1
PL/SQL Part 1
 
Introduction to Data Flow Diagram (DFD)
Introduction to Data Flow Diagram (DFD)Introduction to Data Flow Diagram (DFD)
Introduction to Data Flow Diagram (DFD)
 
Ingenium test(Exam Management System) Project Presentation (Full)
Ingenium test(Exam Management System) Project Presentation (Full)Ingenium test(Exam Management System) Project Presentation (Full)
Ingenium test(Exam Management System) Project Presentation (Full)
 

Kürzlich hochgeladen

SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 

Kürzlich hochgeladen (20)

SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 

Oracle Application Developmenr Framework

  • 1. Oracle ADF one day training
  • 2. OVERVIEW 2 Oracle ADF First Half • Introduction to Oracle Fusion Middleware and Oracle ADF • Getting started with JDeveloper • Building a Business Model with ADF Business Components • Querying and persisting data • Exposing Data • Declaratively Customizing Data Services • Programmatically Customizing Data Services • Validating User Inputs Second Half • Understanding UI Technology • Binding UI Components to Data • Planning the User Interface • Passing values between UI Elements • Responding to Application Events • Implementing Transactional Capabilities
  • 3. Oracle ADF3 INTRODUCTION TO ORACLE FUSION MIDDLEWARE AND ORACLE ADF • Oracle Fusion Architecture • Oracle ADF Framework • How the Oracle ADF Framework Implements MVC
  • 5. ORACLE FUSION ARCHITECTURE… 5 Oracle ADF Oracle Fusion Middleware (OFM, also known as Fusion Middleware) consists of several software products from Oracle Corporation. OFM spans multiple services, including Java EE and developer tools, integration services, business intelligence, collaboration, and content management.
  • 6. ORACLE ADF FRAMEWORK 6 Oracle ADF Oracle Application Development Framework, usually called Oracle ADF, provides a commercial Java framework for building enterprise applications. It provides visual and declarative approaches to Java EE development. It supports rapid application development based on ready-to-use design patterns, metadata-driven and visual tools. Oracle ADF simplifies Java EE development by minimizing the need to write code that implements design patterns and the application infrastructure. These implementations are provided as part of the framework.
  • 7. HOW THE ORACLE ADF FRAMEWORK IMPLEMENTS MVC 7 Oracle ADF
  • 8. Oracle ADF8 GETTING STARTED WITH JDEVELOPER • Benefits of Using JDeveloper • Launching JDeveloper • Defining Roles • Using JDeveloper Features • Setting IDE Preferences • Creating an ADF Application and project • Creating Database Connections
  • 9. BENEFITS OF USING JDEVELOPER 9 Oracle ADF JDeveloper is a freeware IDE supplied by Oracle Corporation. It offers features for development in Java, XML, SQL and PL/SQL, HTML, JavaScript, BPEL and PHP. JDeveloper covers the full development lifecycle from design through coding, debugging, optimization and profiling to deploying. With JDeveloper, Oracle has aimed to simplify application development by focusing on providing a visual and declarative approach to application development in addition to building an advanced coding-environment. Oracle JDeveloper integrates with the Oracle Application Development Framework (Oracle ADF) - an end-to-end Java EE-based framework that further simplifies application development.
  • 10. LAUNCHING JDEVELOPER 10 Oracle ADF You can launch Jdeveloper in one of the following ways: • By selecting Start  Programs  Oracle Fusion Middleware 11.1.1.2.0  Jdeveloper Studio 11.1.1.20 • By double clicking the Jdeveloper executable in home directory of Jdeveloper installation • From command line or shortcut with following command: <Jdev Home>jdevbinjdev.exe
  • 12. USING JDEVELOPER FEATURES 12 Oracle ADF Jdeveloper features that facilitate ease of application development include: • Application Navigator • Database Navigator • Editor (Code or Visual editor) • Component Pallete • Resource Pallete (IDE and Application) • Data Controls Panel • Structure Window • Property Inspector • Log Window
  • 13. SETTING PREFERENCES 13 Oracle ADF There are many preferences that you can set to affect the display and functionality of the IDE. You can access the preferences window by selecting ToolsPreferences
  • 14. CREATE AN ADF APPLICATION AND PROJECT 14 Oracle ADF You create an application by invoking the Create Application dialog box in one of the following ways: • If there is an application already open in JDeveloper, invoke the application drop-down list and select New Application. If there is no open application, click New Application. • Select File > New, and in the New Gallery dialog box, select General - Applications. Then select either Generic Application, or a specific type of application from the list. Click OK. There are two ways to create a project in JDeveloper. The first way is when you create an application. Depending on the application template that you select, one or more projects are created automatically. Sometimes you are presented with a wizard page enabling you to name the project and set its technologies. The second method of creating a project is to create a new one. You must first select an existing application to contain the project. Then you can create a new project from the New Gallery in one of the following ways: • Invoke the application menu that appears to the right of the application name in the Applications Navigator, or click the down arrow at the far right of the application name, and select New Project to invoke the New Gallery. • Select File > New from the menu. • Click New on the Toolbar. In the New Gallery, select the type of project to create, and then click OK. When you are presented with the Create Project Wizard, you can name the project and specify where you want to store the project files. Depending on the type of project, you may also need to select the technologies to use, set Java or EJB settings, or define other types of project properties.
  • 15. 15 Oracle ADF 1 2 3 4 5 6 7
  • 16. CREATING DATABASE CONNECTION 16 Oracle ADF There are wo types of database connections : • IDE – Available to be added to any application – Create in Database Navigator or Resource Palette – To add to an application, drag to Application Resources or to an application in Database Navigator • Application – Owned by a specific application – Create in Database Navigator or Application Resources
  • 17. Oracle ADF17 BUILDING A BUSINESS MODEL WITH ADF BUSINESS COMPONENTS • Describing ADF Business Components • Types of ADF Business Components • Create ADF Business Components from Tables Wizard • Examining Created Objects • Testing the Data Model
  • 18. DESCRIBING ADF BUSINESS COMPONENTS 18 Oracle ADF ADF. Business Components (ADF BC) characteristics: • Provides data interaction and business logic execution • Maps to a data source, such as an Oracle database • Enables 4GL development – Wizard-based or visual development – Implemented in metadata, not code • Enables business logic development — Predefined Java methods for any event – Declarative business rules
  • 19. TYPES OF ADF BUSINESS COMPONENTS 19 Oracle ADF There are two types of Oracle ADF Business Components objects that represent features of your data source. If you have a well-designed data source, the structure of these objects should reflect the structure of the data source. Data sources are represented by the following types of components: • Entity objects, which represent objects in the data source (usually tables, views, and synonyms in a database) • Associations, which represent relationships between these objects (such as foreign key relationships) Other types of ADFBC objects collect data and present it to the client model. They should be designed on the client’s specific data needs. For this reason, they are not as reusable as entity objects and associations. There are three such components: • View objects, which collect data from the data source, usually by a SQL query • View links, which represent relationships (such as master-detail relationships) between view object result sets • Application modules, which provide a single point of access to the view objects and view links
  • 20. CREATE ADF BUSINESS COMPONENTS FROM TABLES WIZARD 20 Oracle ADF You can use the checklist to create the Business Components or you can create the business components by your own or you can use Business Components from Table. Here we will create Business Components by using Business Components from Tables method. • Right click the Model Project. Select New>From Gallery • Select Business Components from Tables and Click OK • A Initialize Business Components Project dialog box will appear. Here you need to select the database connection. Select the connection and click ok. If there is no connection available create a new one • Now, use the wizard to create the ADF BC Components
  • 23. EXAMINING CREATED OBJECTS 23 Oracle ADF The Business components that you have created will be shown in application navigator and you can examine it by double clicking it
  • 24. TESTING THE DATA MODEL 24 Oracle ADF JDeveloper provides a way to test the data model without creating a client application. You can perform this testing by using the Business Components Browser, sometimes also referred to as the Business Components Tester or the BC Tester. To use the Business Components Browser to test the data model, right-click the application module in the Application Navigator and select Run from the context menu. A Connect dialog box appears, where you select your database connection and click Connect. After the connection is established, the Business Components Browser displays a tree with the application module and all of its view object and view link instances. You can double-click a top-level view object instance to view it alone, or double-click a view link instance to view both master and detail in a hierarchy, with the master row displayed in form style and the detail rows displayed in tabular style.
  • 26. Oracle ADF26 QUERYING AND PERSISTING DATA • Characteristics of View Objects • Creating View Objects for queries • Testing view objects • Characteristics of Entity Objects • Creating Entity Objects • Synchronizing an Entity Objects with changes to Database Table • Linking View Objects • Refactoring View Objects
  • 27. CHARACTERISTICS OF VIEW OBJECTS 27 Oracle ADF • Represents a query • Are used for joining, filtering, projecting, and sorting business data • Enable you to have a view of data that is specific to one part of your application • Can be constructed from a SQL statement, static values, or populated programmatically • Can also be based on any number of entity objects
  • 28. CREATING VIEW OBJECTS FOR QUERIES 28 Oracle ADF
  • 30. CHARACTERISTICS OF ENTITY OBJECTS 30 Oracle ADF • An entity object is the ADFBC component that represents a row in a database table and simplifies modifying its data. It enables you to encapsulate domain business logic for those rows to ensure that your business policies and rules are consistently validated. • Each entity object maps to a data source, usually a database table or database view. Entity objects handle database caching so that changes to data are cached in the entity object before being committed to the database. • Entity objects are the foundation of the Business Components technology. Each entity object represents abusiness object, or business entity, in your application. Entity objects handle business rules and validation and can contain custom business methods.
  • 32. SYNCHRONIZING AN ENTITY OBJECTS WITH CHANGES TO DATABASE TABLE 32 Oracle ADF If you alter a table for which you have already created an entity object, the existing entity is not disturbed by the presence of additional attributes in its underlying table. However, if you want to access the new table column in your application, you first need to synchronize the entity object with the database table. To perform this synchronization from JDeveloper, right- click the entity object in question and select “Synchronize with Database” from the context menu. For example, suppose you had issued the following SQL*Plus command to add a new SECURITY_QUESTION column to the USERS table: ALTER TABLE USERS ADD (security question VARCHAR2 (60)); When you use the synchronize feature on the existing User entity, the “Synchronize with Database” dialog box proposes the changes that it can perform for you automatically. By clicking the desired button, you can carry out the synchronization.
  • 33. LINKING VIEW OBJECTS 33 Oracle ADF Use create view link wizard to link View Objects
  • 34. REFACTORING VIEW OBJECTS 34 Oracle ADF With Refactoring you can: • Rename/Delete Objects • Move Objects or packages to a different package • Change all references throughout the application
  • 35. Oracle ADF35 EXPOSING DATA • Characteristics of an Application Module • Creating an Application Module • Defining the Data Model for Application Module • Nested and Shared Application Module • Application Module Pooling
  • 36. CHARACTERISTICS OF AN APPLICATION MODULE 36 Oracle ADF • Represents the data model that the client uses and has one connection to the database • Provides transactional context for the application • Enables you to gather data customized to a client interface so that data can be retrieved in one network round-trip • Can contain other application modules, called nested application modules • Keeps track of all changes that affect data in the database • Provides remotely accessible methods to implement application module behaviour • ls deployable in multiple configurations • Can be easily reused in business logic tiers of other applications
  • 37. CREATING AN APPLICATION MODULE 37 Oracle ADF
  • 38. DEFINING THE DATA MODEL FOR APPLICATION MODULE 38 Oracle ADF
  • 39. NESTED AND SHARED APPLICATION MODULE 39 Oracle ADF
  • 41. Oracle ADF41 DECLARATIVELY CUSTOMIZING DATA SERVICES • Declaratively modify view objects, entity objects and application modules • Internationalizing the Data Model • Create view criteria • Create LOVs
  • 42. DECLARATIVELY MODIFY VIEW OBJECTS, ENTITY OBJECTS AND APPLICATION MODULES 42 Oracle ADF
  • 43. INTERNATIONALIZING THE DATA MODEL 43 Oracle ADF When an application is internationalized, the UI displays text based on a user’s browser settings. To use resource bundles for translatable strings, you can: • Create one bundle per file or project • Translate and append _<locale> to the file name • Configure the UI
  • 46. Oracle ADF46 PROGRAMMATICALLY CUSTOMIZING DATA SERVICES • Generating Java classes for adding code • Supporting Entity Java Classes • Supporting View Object Java Classes • Changing View Object WHERE or ORDER BY clause at Runtime • Finding an Entity Object by Primary Key • Updating or Removing an Existing Entity Row • Creating a New Entity Row • Creating a Test Client • Accessing View Criteria programmatically
  • 47. GENERATING JAVA CLASSES FOR ADDING CODE 47 Oracle ADF
  • 48. SUPPORTING ENTITY JAVA CLASSES 48 Oracle ADF
  • 49. SUPPORTING ENTITY JAVA CLASSES 49 Oracle ADF
  • 50. CREATING A TEST CLIENT 50 Oracle ADF
  • 51. CHANGING VIEW OBJECT WHERE OR ORDER BY CLAUSE AT RUNTIME 51 Oracle ADF
  • 52. FINDING AN ENTITY OBJECT BY PRIMARY KEY 52 Oracle ADF
  • 53. UPDATING OR REMOVING AN EXISTING ENTITY ROW 53 Oracle ADF
  • 54. CREATING A NEW ENTITY ROW 54 Oracle ADF
  • 55. ACCESSING VIEW CRITERIA PROGRAMMATICALLY 55 Oracle ADF
  • 56. Oracle ADF56 VALIDATING USER INPUTS • Using Declarative Validation
  • 58. Oracle ADF58 UNDERSTANDING UI TECHNOLOGY • What are servlets? • Java Server Pages (JSP) • What are JavaBeans? • What is Java Server Faces (JSF)? • Defining Navigation by using JSF Controller • Using JSF Components • Using JSF Managed Beans
  • 59. WHAT ARE SERVLETS? 59 Oracle ADF Servlets: • Are written in java • Extend the Web Server • Can be used to provide: • Back-End Functionality • User Interface A Servlet is an object that receives a request and generates a response based on that request. The basic Servlet package defines Java objects to represent servlet requests and responses, as well as objects to reflect the servlet's configuration parameters and execution environment. The package javax.servlet.http defines HTTP-specific subclasses of the generic servlet elements, including session management objects that track multiple requests and responses between the web server and a client. Servlets may be packaged in a WAR file as a web application. Servlets can be generated automatically from Java Server Pages (JSP) by the Java Server Pages compiler. The difference between servlets and JSP is that servlets typically embed HTML inside Java code, while JSPs embed Java code in HTML. While the direct usage of servlets to generate HTML (as shown in the example below) has become rare, the higher level MVC web framework in Java EE (JSF) still explicitly uses the servlet technology for the low level request/response handling via the Faces Servlet. A somewhat older usage is to use servlets in conjunction with JSPs in a pattern called "Model 2", which is a flavor of the model–view–controller.
  • 60. JAVA SERVER PAGES (JSP) 60 Oracle ADF Java Server Pages (JSP) is a technology that helps software developers create dynamically generated web pages based on HTML, XML, or other document types. Released in 1999 by Sun Microsystems, JSP is similar to PHP and ASP, but it uses the Java programming language. JSP allows Java code and certain pre-defined actions to be interleaved with static web markup content, such as HTML, with the resulting page being compiled and executed on the server to deliver a document. The compiled pages, as well as any dependent Java libraries, contain Java bytecode rather than machine code. Like any other Java program, they must be executed within a Java virtual machine (JVM) that interacts with the server's host operating system to provide an abstract, platform-neutral environment. JSPs are usually used to deliver HTML and XML documents, but through the use of OutputStream, they can deliver other types of data as well. The Web container creates JSP implicit objects like pageContext, servletContext, session, request & response.
  • 61. WHAT ARE JAVABEANS? 61 Oracle ADF JavaBeans are classes that encapsulate many objects into a single object (the bean). They are serializable, have a zero-argument constructor, and allow access to properties using getter and setter methods. Advantages: • The properties, events, and methods of a bean that are exposed to another application can be controlled. • A bean may register to receive events from other objects and can generate events that are sent to those other objects. • Auxiliary software can be provided to help configure a java bean. • The configuration settings of a bean can be saved to persistent storage and restored.
  • 62. WHAT IS JAVA SERVER FACES (JSF)? 62 Oracle ADF JavaServer Faces (JSF) is a Java-based web application framework intended to simplify development integration of web-based user interfaces. JavaServer Faces is a standardized display technology which was formalized in a specification through the Java Community Process. JSF reduces the effort in creating and maintaining applications which will run on a Java application server and will render application UI on to a target client. JSF facilitates Web application development by :- • providing reusable UI components • making easy data transfer between UI components • managing UI state across multiple server requests • enabling implementation of custom components • wiring client side event to server side application code
  • 63. DEFINING NAVIGATION BY USING JSF CONTROLLER 63 Oracle ADF
  • 65. USING JSF MANAGED BEANS 65 Oracle ADF
  • 66. USING JSF MANAGED BEANS… 66 Oracle ADF Application Scope The application scope lasts until the application stops. Values that you store in a managed bean with this scope are available to every session and every request that uses the application. Avoid using this scope in a task flow because it persists beyond the life span of the task flow. Session Scope The session scope begins when a user first accesses a page in the application and ends when the user's session times out due to inactivity, or when the application invalidates the session. Use this scope only for information that is relevant to the whole session, such as user or context information. Avoid using it to pass values from one task flow to another. Instead, use parameters to pass values between task flows. Using parameters gives your task flow a clear contract with other task flows that call it or are called by it. Another reason to avoid use of session scope is because it may persist beyond the life span of the task flow.
  • 67. USING JSF MANAGED BEANS… 67 Oracle ADF Page Flow Scope Choose this scope if you want the managed bean to be accessible across the activities within a task flow. A managed bean that has a pageFlow scope shares state with pages from the task flow that access it. A managed bean that has a pageFlow scope exists for the life span of the task flow.If another task flow's page references the managed bean, the managed bean creates a separate instance of this object and adds it to the pageFlow scope of its task flow. View Scope Use this scope for managed bean objects that are needed only within the current view activity and not across view activities. It defines scope for each view port that ADF Controller manages, for example, a root browser window or an ADF region. The life span of this scope begins and ends when the current viewId of a view port changes. If you specify view, the application retains managed bean objects used on a page as long as the user continues to interact with the page. These objects are automatically released when the user leaves the page.
  • 68. USING JSF MANAGED BEANS… 68 Oracle ADF Request Scope Use request scope when the managed bean does not need to persist longer than the current request. Backing Bean Scope A backing bean is a convention to describe a managed bean that stores accessors for UI components and event handling code on a JSF page. It exists for the duration of a request and should not be used to maintain state. Use this scope if it is possible that your task flow appears in two ADF regions on the same JSF page and you want to isolate each instance of ADF region. None When you create objects (such as a managed bean) that require you to define a scope, you can set the scope to none, meaning that it will not live within any particular scope, but will instead be instantiated each time it is referenced. You should set a bean's scope to none when it is referenced by another bean.
  • 69. Oracle ADF69 BINDING UI COMPONENTS TO DATA • Create a JSF Page • Add ADF Faces UI components to a page • Include databound components on a page • Create and edit data bindings
  • 70. CREATE A JSF PAGE 70 Oracle ADF
  • 71. ADD ADF FACES UI COMPONENTS TO A PAGE 71 Oracle ADF
  • 72. INCLUDE DATA BOUND COMPONENTS ON A PAGE 72 Oracle ADF
  • 73. CREATE AND EDIT DATA BINDINGS 73 Oracle ADF
  • 74. Oracle ADF74 PLANNING THE USER INTERFACE • Characteristics of ADF Task Flows • Characteristics of ADF Bounded task flows • Characteristics of ADF Unbounded task flows • Converting task flows • Using ADF Task Flow components • Defining ADF Control flow rules • Using Wildcards to define global navigation • Using routers for conditional navigation • Calling methods and other Task flows • Defining a Task Flow Return Activity
  • 75. CHARACTERISTICS OF ADF TASK FLOWS 75 Oracle ADF Difference between JSF Page Flow & ADF Task Flow: JSF Page Flow: • The entire application must be represented in a single page navigation file (faces-config.xml). Although you can have multiple copies of faces-config.xml in a project, the application loads these files as one at runtime. • All nodes within a JSF page flow must be JSF pages. No other types of objects can exist within the JSF page flow. • Navigation is only between pages. • Application fragments cannot be reused. • There is no shared memory scope between multiple requests except for session scope. ADF Task Flow: • The application can be broken up into a series of modular flows that call one another. • You can add to the task flow diagram nodes such as views, method calls, and calls to other task flows. • Navigation is between pages as well as other activities, including routers. • ADF task flows are reusable within the same or an entirely different application. After you break up your application into task flows, you may decide to reuse task flows containing common functionality. • Shared memory scope (for example, page flow scope) enables data to be passed between activities within the task flow. Page flow scope defines a unique storage area for each instance of an ADF bounded task flow. • Task flows provide a more modular and transaction-aware approach to navigation and application control.
  • 76. CHARACTERISTICS OF ADF UNBOUNDED TASK FLOWS 76 Oracle ADF Unbounded Task Flows: A set of activities, control flow rules, and managed beans that interact to allow a user to complete a task. An ADF unbounded task flow consists of all activities and control flows in an application that are not included within any bounded task flow. • It is similar to the JSF page flow. • When a project with the ADF Page Flow technology scope is created, it will contain a task flow definition file called adfc-config.xml by default. This is an unbounded task flow. Such task flows are called “unbounded” simply because they have no explicit start or end. • It can start from any view activity. • An application can have one, and only one, unbounded task flow. • It is possible to have several separate definition files containing unbounded task flow definitions, but at runtime, these are all Merged into a single logical flow. • No limits for entry and exit points. • Can’t be creating on page fragments. • An unbounded task flow cannot declaratively specify parameters. • It cannot contain a default activity, an activity designated as the first to run in the unbounded task flow.
  • 77. CHARACTERISTICS OF ADF BOUNDED TASK FLOWS 77 Oracle ADF • Reusable and parameterized and maintain private state. • Can participate in transaction. • Bounded task flow does not have an equivalent in the current JSF standard. • Single entry point and zero or more exit point. • Can be created as a page or page fragment. • Data controls can be shared between task flows • A bounded task flow can declaratively specify parameters. • The bounded task flow always specifies a default activity, a single point of entry that must execute immediately upon entry of the bounded task flow.
  • 79. USING ADF TASK FLOW COMPONENTS 79 Oracle ADF
  • 80. DEFINING ADF CONTROL FLOW RULES 80 Oracle ADF
  • 81. USING WILDCARDS TO DEFINE GLOBAL NAVIGATION 81 Oracle ADF
  • 82. USING ROUTERS FOR CONDITIONAL NAVIGATION 82 Oracle ADF
  • 83. CALLING METHODS AND OTHER TASK FLOWS 83 Oracle ADF
  • 84. DEFINING A TASK FLOW RETURN ACTIVITY 84 Oracle ADF
  • 85. Oracle ADF85 PASSING VALUES BETWEEN UI ELEMENTS • Holding values in managed beans • Using Parameters • Returning values to a calling task flow • Deciding which type of parameter to use
  • 86. HOLDING VALUES IN MANAGED BEANS 86 Oracle ADF
  • 87. USING PARAMETERS 87 Oracle ADF • You can use: • Page Parameter • Region Parameter • Task Flow Parameter • View Activity Parameter • Task Flow Call Parameter You set the parameter values by using expressions (not by just entering a value). The goal is increased reusability of pages and task flows
  • 88. RETURNING VALUES TO A CALLING TASK FLOW 88 Oracle ADF • To return a value, you must specify:  Return value definition on the called task flow  Return value on task flow call activity in the calling task flow • Names must match
  • 89. DECIDING WHICH TYPE OF PARAMETER TO USE 89 Oracle ADF The use of one type of parameter does not preclude the use of another, because they all have different functions. Defining parameters is all about providing reusability. Defining parameter on a task flow improves reusability of that task flow. Defining parameters on a page or page fragment improves its reusability. Parameters also make an object much more encapsulated (self-contained).
  • 90. Oracle ADF90 RESPONDING TO APPLICATION EVENTS • Configure and use managed beans to contain code to respond to events • Describe different types of events • Use phase listeners • Create event listeners • Define action listeners • Create value change listeners
  • 91. CONFIGURE AND USE MANAGED BEANS TO CONTAIN CODE TO RESPOND TO EVENTS 91 Oracle ADF
  • 92. DESCRIBE DIFFERENT TYPES OF EVENTS 92 Oracle ADF JSF supports: • Phase events • Execute as part of the JSF and ADF life cycle • Can be used to augment standard behavior • 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
  • 93. USE PHASE LISTENERS 93 Oracle ADF It is possible to create event listeners, called phase listeners, that are triggered at different stages of the JSF life cycle. This enables you to execute code processing that should occur—for example, before the rendering of a page. Using a phase listener, you can listen for phase events for any of the ADF life-cycle phases, and execute your own code before and after the events. The basic steps for implementing your own phase listener in an ADF application are as follows: 1. Create a class that implements the javax. faces. event. PhaseListener interface. 2. 2. Add your own functionality in the beforePhase () and after Phase () methods of your class. 3. 3. Use the Overview tab to register your listener with your faces-config. xml file. You can accomplish similar functionality, but for a single page, by using a page phase listener that implements the oracle. adf. controller. v2. lifecycle. PagePhaseListener interface.
  • 94. CREATE EVENT LISTENERS 94 Oracle ADF Components can generate events, which are occurrences that take place as users interact with an application, such as when they click a button or change a value. There are also events, such as gaining or losing focus, that are not the result of user interactions. If there is a listener for the event, the event communicates some information about what happened, so that the listener can respond. An event, then, is a component's way of letting a listener know that something happened. An event listener is a class that implements one of the listener interfaces and contains code to respond to the event. A component has mechanisms to register and deregister event listeners for the types of events that are generated by the component.
  • 95. DEFINE ACTION LISTENERS 95 Oracle ADF Action listener differs from action methods: • Action Listener • Contain code to respond to an action • Do not return a value • Execute after a value change listeners • Action methods • Are used for navigation • Return a String outcome • Execute last However, both can be initiated by the same action, such as button click.
  • 96. CREATE VALUE CHANGE LISTENERS 96 Oracle ADF • Select the input component in the visual editor. Edit the valueChangelistener property and select a bean and method, or Create a new one. • JDeveloper: • Creates the method in the managed bean if it does not already exist • Adds the method to the valueChangelistener property in the page source • Add your code.
  • 97. Oracle ADF97 IMPLEMENTING TRANSACTIONAL CAPABILITIES • Explain ADF BC transaction handling • Implement task flow transaction control • Handle transaction exceptions • Define response to browser’s Back Button • Enable save for later functionality
  • 98. EXPLAIN ADF BC TRANSACTION HANDLING 98 Oracle ADF • Application modules handle transaction and concurrency support. • No coding is required unless you want to customize the default behavior. • For nested application modules, the outermost application module provides the transaction context for the others.
  • 99. IMPLEMENT TASK FLOW TRANSACTION CONTROL 99 Oracle ADF • Transaction options on the called task flow definition specify whether a called ADF bounded task flow should join an existing transaction, create a new one, or create a new one only if there is no existing transaction. • Savepoints: ADF creates a savepoint when a task flow is entered with an existing transaction. The savepoint is a snapshot of the model state at the time the task flow was entered. The savepoint enables the model state to be restored to what it was at the time the task flow was entered. • If the called ADF bounded task flow is able to start a new transaction (based on the transaction option that you select), you can specify whether the transaction is committed or rolled back when the task flow returns to its caller. • In a called task flow definition, you can specify two different return task flow activities that result in either committing or rolling back a transaction in the called ADF bounded task flow. • You can enable users to save the state of the UI and model at any point and come back to it later. • You can specify how a page should behave when users navigate to it by using the Back button.
  • 100. HANDLE TRANSACTION EXCEPTIONS 100 Oracle ADF During the execution of an ADF task flow, exceptions can occur that may require some kind of exception handling, such as when a method call activity throws an exception or when a user is not authorized to execute the activity. To handle exceptions thrown from an activity or caused by some other type of ADF controller error, you can create an exception handler for an ADF bounded or unbounded task flow. When an exception is raised within the task flow, the control flow passes to the designated exception handling activity. The exception handler activity can be any supported activity type, for example, a view that displays an error message, or a router activity that passes the control flow to a method, based on an expression that evaluates the type of exception.
  • 101. DEFINE RESPONSE TO BROWSER’S BACK BUTTON 101 Oracle ADF To deal with cases in which the end user clicks the Back button to navigate back into an ADF bounded task flow that was already exited, you can specify the following task-flowreentry options for the task flow definition that specify whether a page in the ADF bounded task flow can be reentered: reentry-allowed: Reentry is allowed on any view activity within the ADF bounded task flow. reentry-not-allowed: Reentry of the ADF bounded task flow is not allowed. An end user can still click the browser's Back button and return to a page within the bounded task flow. However, if the user does anything on the page such as clicking a button, an exception (for example, Invalid Task Flow Reentry) is thrown indicating that the bounded task flow was reentered improperly. The actual reentry condition is identified upon the submit of the reentered page. reentry-outcome-dependent: Reentry of an ADF bounded task flow using the browser's Back button is dependent on the outcome that was received when the same ADF bounded task flow was previously exited via task flow return activities. For example, a task flow representing a shopping cart can be reentered if the user exited by cancelling an order, but not if the user exited by completing the order. Upon reentry, ADF bounded task flow input parameters are evaluated using the current state of the application, not the application state existing at the time of the original ADF bounded task flow entry.
  • 102. ENABLE SAVE FOR LATER FUNCTIONALITY 102 Oracle ADF In some applications, an end user may need to stop without completing a task, for example, when additional information is needed to answer questions. As the developer of the application, you may want to retain the current state of the task if a user leaves a page without finalizing it. You can also enable the user to complete the rest of the task at a future point, with former unsaved values restored to the page. The ability to save the current application state is called save for later. There are two general categories of saving for later: • Explicit: For example, a page contains a button that the user can click to save all the data entered so far on the page. Explicit save for later is available for both ADF unbounded and bounded task flows. For example, a user may click a button to save, but not submit, a partial expense report, and then may cancel out of the application. Later the user can invoke a list of saved expense reports and select the one to continue working on. • Implicit: For example, a user accidentally closes a browser window without saving data entered on a page, a user logs out without saving the data, or the session times out. Implicit save for later can originate only from a bounded task flow. Save for later saves the data without enforcing validation rules or submitting it. The end user can resume working on the application later with the same data that was saved at the point when save for later was performed.
  • 103. CONTACTS 103 Sopra Steria AMSL Building No 4, Plot No - 20&21,Sector - 135, Dist- Gautam Buddha Nagar,Noida (UP)-201304 www.soprasteria.co.uk Er Gurpreet Singh Junior Software Engineer CUG. 2142 M. +91-9803723925 Gurpreet.singh2@soprasteria.com Presentation title