Developer Tools
JDeveloper
You can easily install the schema and connect to the database, and then create an application and projects in which to organize your application files. Then work in JDeveloper's IDE to create the business services for your application.
Install the Schema: Download the schema zip file from OTN and install it. The cue cards use tables that are part of the Fusion Order Demo (FOD) schema.
Create a New Application: Use the Create Application wizard to create an application and projects for the EJB Components model and the user interface portions of the application.
Create a Database Connection: Use the Create Database Connection dialog to create a connection to the schema.
Create Oracle ADF Business Components: Use the Create Entities from Tables wizard to create the model layer for the application.
Create a Task Flow: Use the diagrammer, Component Palette and Property Inspector to create an ADF task flow.
Create a Page Template: Use the Create JSF Page Template dialog to begin creating a template for all the pages in the application.
Create JSF Pages: Use the Create JSF Page dialog to create the starter pages for the application.
Enable ADF Security: Use the Configure ADF Security wizard to enable security in the application.
Define Users and Roles: Use the
jazn-data.xml overview editor to define application roles and users.
Define ADF Security Policies: Use the ADF Policies page in the editor to define security policies for the application.
Add a Login Link and User Information: Use the Expression Builder to add login links to the page.
Hide Menu Items and Page Components: Add conditional logic to the application, and test run it.
The steps and examples in the cue cards are based on tables that are part of the Fusion Order Demo (FOD) schema. This schema is also used as the database for the sample application that ships with Oracle JDeveloper 11g, as well as other collateral in this release. It will be convenient to have this schema installed, and you only need to do it once. If you have already installed the FOD schema, you can skip this step and go directly to the next card. [ tell me more...]
c:\temp).
c:\temp\Infrastructure\Infrastructure.jws.
jdeveloper.home, and all the
jdbc.* and
db.* settings). Keep all other properties set to their default values. The demo user must be named
FOD.
/jdeveloper directory where you have JDeveloper installed, for example,
c:/JDeveloper_11/jdeveloper/
jdbc:oracle:thin:@localhost
1521
XE or
ORCL
system
USERS
After running the Ant task, you should see a build successful message in the JDeveloper Log window. [ tell me more...]
The JDeveloper application is the highest level in the organizational structure. It stores information about the objects you are working with, while you are creating your application. It keeps track of your projects and the environment settings while you are developing. [ tell me more...]
SecureApplication to follow along with the example.
oracle.
Application templates provide you with a quick way to create the project structure for standard applications with the appropriate combination of technologies already specified. The new application created from the template appears in the Application Navigator already partitioned into tiered projects, with the associated technology scopes set in each project. [ tell me more...]
The application template that you used for your application partitions your application into two projects: Model and ViewController. In the Application Navigator, projects are displayed as the top level in the hierarchy. The Application Navigator should now look like this: [ tell me more...]
You can connect to any database for which you have connection details, or install the sample schema used in the cue card examples and then establish a connection to it. If you installed the sample schema, you will be able to follow the steps in the cue cards exactly as written. If you work with your own database, you can supply your own values as needed. [ tell me more...]
FOD for the connection name and
fod for the username.
The database connection is now included as a resource for your application. [ tell me more...]
Oracle ADF Business Components is a model layer technology in the Oracle Application Development Framework (Oracle ADF). Oracle ADF Business Components is a fully-featured, XML-based framework for creating business services. That is, it governs interaction between the rest of the application and the data stored in the data source, providing validation, specific services, and other business logic. [ tell me more...]
ProductsModule. Then click
Finish
.
The Create Business Components from Tables wizard does not create a user interface, nor does it determine other application logic such as control flow. It just provides a representation of, and access to, data, and implements business logic. [ tell me more...]
After completing the Create Business Components from Tables wizard, the Model project in the Application Navigator should look like this: [ tell me more...]
An ADF task flow includes the view activities and control flow rules that define an application's page flow. There are two types of task flows: bounded and unbounded. A bounded task flow has a single entry point and zero or more exit points; it contains its own set of private control flow rules, activities, and managed beans. An unbounded task flow is for top-level application flows; it consists of all activities and control flows in an application that are not included within any bounded task flow. A typical application is a combination of an unbounded and one or more bounded task flows. [ tell me more...]
By using a task flow diagram you can plan out the pages in your application and define the navigation rules for users to navigate between the pages. [ tell me more...]
welcome.
products and
stock.
welcome for the outcome label.
products for the outcome label.
stock for the outcome label.
The task flow contains three view activities: welcome, products and stock, and three control flow cases. The first activity you dropped is the default, as indicated by the green halo or circle. Currently the task flow does not do anything: the ! icon on each view activity indicates that the view activity is not bound to any page. Later you will tie a page to each view activity, and add navigation. [ tell me more...]
In this card, you will create an initial page template with the layout and components that are common to all pages in your application. Typically you would create and bind navigation components on a JSF page template, then use the template to create your pages. Using a page template also provides the same layout and look and feel for your application pages. [ tell me more...]
productTemplate.jspx in the
File Name
field.
ADF Faces provides a number of components that you can use to define the overall template layout of the page. JDeveloper includes pre-defined page layouts that use these layout components to provide you with a quick and easy way to correctly determine the template layout. [ tell me more...]
to add a facet. Enter
main_content in the
Name field. Then click
OK.
To create the user interface, you add ADF Faces components to your pages. [ tell me more...]
Product Information as the
Value. Expand the
Style section, select the
Text tab, and select
White from the
Color dropdown list,
medium from the
Size dropdown list, and
bold from the
Bold dropdown list.
welcome as the
Text and the
Action property fields.
products as the
Text and
Action property of the first, and
stock as the
Text and
Action property of the second link.
When you complete the steps, the page template should look similar to this in the visual editor: [ tell me more...]
The JSF pages you create for a web application using ADF Faces are JSP documents (which have the file extension
.jspx). [
tell me more...]
welcome.jspx. Under
Initial Page Layout and Content, select
Page Template
. Then select
productTemplate and click
OK.
<p> Please log in to get started. Valid users are:</p><ul><li><b>dfaviet</b> (customer)</li><li><b>sking</b> (staff)</li><li><b>achen</b> (supplier)</li></ul> <p>The password for all users is welcome1.</p>
The role of the browse page is to allow the user to view and navigate the data objects, one at a time. You will add databound components to the
products.jspx page to create a read-only form. At runtime, the products are shown one at a time. [
tell me more...]
Delete.
Graph is one of many data visualization components available in JDeveloper. In addition to Graph, data visualization components include Gauge, Gantt chart, Geographic Map, and Pivot Table. You can choose the type of graph you want to create from the Component Gallery. [ tell me more...]
The stock.jspx page, the last page you updated, should look similar to this page in the visual editor: [ tell me more...]
In this section you enable ADF security for your application. To begin configuring security, you will use the Configure ADF Security Wizard. To open the wizard, from the
Application
menu, choose
Secure
Configure ADF
Security
. [
tell me more...]
Adding authentication means that users must be authenticated (usually by a login form) before they can access the application. Authorization determines which parts of an application users can access once they are in the application. [ tell me more...]
After you run the Configure ADF Security wizard with the default ADF Authentication and Authorization option selected in the ADF Security page, you will have: [ tell me more...]
In ADF security, as in Java EE security, users are assigned one or more roles, and permissions are granted to roles. [ tell me more...]
to the right of
Roles three times to add three application roles. Enter
customer,
staff and
supplier as the names of the three new roles.
In the jazn-data.xml overview editor you can create both application and enterprise roles. [ tell me more...]
to the right of
Users to add a new user. Enter
dfaviet as the name and
welcome1 as the password. Click
to the right of
Assigned Roles and choose
Assign Application Role. Select
customer from the Select Roles dialog and click
OK.
to the right of
Users again. Enter
sking as the name and
welcome1 as the password. Click
to the right of
Assigned Roles and choose
Assign Application Role. Select
staff from the Select Role dialog and click
OK.
achen as the name and
welcome1 as the password. Select
supplier as the application role.
The Users page of the jazn-data.xml overview editor should now look like this: [ tell me more...]
A security policy is an access right that you define to allow users to access a resource in your application. You can define ADF security policies for web pages and task flows. [ tell me more...]
to the right of
Granted to Roles. Select
authenticated-role and click
OK.
It is a common requirement that some web pages be available to all users, regardless of their specific access privileges. For example, the home or welcome page should be seen by all visitors to the site, while a corporate site should be available only to those who have identified themselves through authentication. [ tell me more...]
to the right of
Granted to Roles. Select
supplier and click
OK.
The ADF Security Policies page should now look like this: [ tell me more...]
In this step you add a link to your page template that allows users to log in and log out of your application, and text to display the name of the current user. [ tell me more...]
#{securityContext.authenticated} is the expression and click
OK.
Welcome followed by a space. Expand
ADF Bindings and
securityContext and select
userName. Confirm that
Welcome #{securityContext.userName} is the expression and click
OK.
jdev_homejdeveloperideliboicons.jaroraclejavatoolsicons, select
key.png then click
OK. Click
Yes to copy the image to your project's document root, then click
Save to save it, then click
OK.
jdev_homejdeveloperideliboicons.jaroraclejavatoolsicons, select
listLockIcon.png and click
OK, then click
Yes and
Save to copy the image into your project. Then enter
#{securityContext.authenticated ? "/listLockIcon.png" : "/key.png"} in the
Source field of the Property Inspector.
The conditional expression entered for the image sets the image to show a different icon depending on whether you are authenticated (logged in) or not. You selected the image source file twice to copy both image files into your project. [ tell me more...]
#{securityContext.authenticated ? "Logout" : "Login"} in the
Text field. Enter the following in the
Destination field:
#{securityContext.authenticated ? "/adfAuthentication?logout=true&end_url=/faces/welcome.jspx"
: "/adfAuthentication?success_url=/faces/products.jspx"}
The productTemplate.jspx page now looks similar to this in the visual editor: [ tell me more...]
In this step, you add conditional logic to hide the menu links for pages that the current user is not permitted to access. You also use conditional logic to hide the Cost Price field in the
products.jspx page, so that only staff can view that field. [
tell me more...]
#{securityContext.userInRole['staff']} in the
Expression
field and click
OK.
#{securityContext.authenticated} in the
Expression
field and click
OK.
Menu items and page components are hidden in this application through the use of the following three expressions: [ tell me more...]
#{securityContext.regionViewable['oracle.view.pageDefs.stockPageDef']} in the
Expression
field and click
OK.
The
welcome.jspx page should now look like this in your browser before you log in: [
tell me more...]
Copyright © 1997, 2009, Oracle. All rights reserved.