Developer Tools
JDeveloper
You can easily install the schema and connect to the database, and then create an application and project 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 a web application based on the application template that includes the ADF Faces, ADF Page Flow, and ADF Business Components technologies.
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 Business Components from Tables wizard to create the business components that will provide access to data and implement the business logic.
Edit the View Object: Use the Attributes and Entity Objects pages in the view object editor to modify the view object.
Add Validation Logic: Add validators in the Add Validation Rule dialog.
Test the Application: Test the application in the Business Component Browser.
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...]
BrowseEditApp to follow along with the example.
oracle.fod.
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 in the Application Resources panel of the Application Navigator. [ 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...]
FODModule. Then click
Finish
.
The Create Business Components from Tables wizard does not create a user interface (this is governed by the "view" portion of the application), 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...]
A view object's main role is typically to fetch the data to be displayed by a client. You will modify the default view objects that you created earlier to reflect the data that will be displayed in your web pages. [ tell me more...]
Delete.
By removing attributes from the OrdersView view object you have reduced the number of columns in the view object's query. [ tell me more...]
A view object can be based on more than one entity object; you do this if you need your client pages to show data from multiple tables. In the list of order items on the client page you will show each item's id, quantity and price, from the OrderItems entity object, as well as the product name, from the ProductsBase entity object. [ tell me more...]
Add dropdown menu.
The OrdersView view object now contains attributes from both the Orders entity object and the ProductsBase entity object. Notice that OrderItemsView now contains two ProductId attributes: ProductId from the OrderItems entity object and ProductId1 from the ProductsBase entity object; this is necessary to specify the join between the two entity objects. [ tell me more...]
You can add validation logic to enforce a rule, in this case the rule that an order's ship date must occur after the date the order was placed. You will create your validation rule using the declarative validation capabilities in ADF Business Components, and define the logic using the Groovy scripting language. [ tell me more...]
Add.
OrderShippedDate == null || OrderShippedDate >= OrderDate in the
E
xpression
panel. Click
Test
to verify the expression, and click
OK when you see the expression syntax check message.
Add to add a row to the
Message Text
table.
Orders_10. Change the default
Message String to
{0} cannot be earlier than {1}. Then press Enter or Tab.
source.hints.OrderShippedDate.label as the
Expression. For
Message Token 1, enter
source.hints.OrderDate.label. Then click
OK.
You have created a custom error message for your validation rule; the
{0} and
{1} are placeholders for parameters that you will define as the labels of the
OrderShippedDate and
OrderDate attributes. ADF Business Components allow you to create custom labels for each attribute; these labels are stored in message bundles that can be translated for different locales, and they are automatically displayed as the attribute's label on client pages. In this example you have not defined custom labels, so the labels default to the names of the attributes. [
tell me more...]
You can test the validation rules you added, in the Oracle Business Component Browser. The browser is a dynamically generated Swing client that allows you to test your business components. It is useful for testing any enhancements, such as validation rules, LOVs or custom methods, that you have added to your business components; it is also a useful troubleshooting tool because it helps to narrow down problems by removing any client code from the picture. [ tell me more...]
2009-01-14, enter
2009-01-13 for the order shipped date.
2009-01-14, enter
2009-01-15 for the order shipped date, so that no error dialog displays.
Save changes to the database to save your changes.
After entering valid data, the Oracle Business Component Browser shows the data that you have just saved to the database: [ tell me more...]
Copyright © 1997, 2009, Oracle. All rights reserved.