Professional Documents
Culture Documents
D68162
July 2010
Edition 2.0
D53979GC20
ADF I
Activity Guide
Oracle Fusion Middleware
11g: Build Applications with
Disclaimer
This document contains proprietary information and is protected by copyright and other intellectual property laws. You may copy and
print this document solely for your own use in an Oracle training course. The document may not be modified or altered in any way.
Except where your use constitutes "fair use" under copyright law, you may not use, share, download, upload, copy, print, display,
perform, reproduce, publish, license, post, transmit, or distribute this document in whole or in part without the express authorization
of Oracle.
The information contained in this document is subject to change without notice. If you find any problems in the document, please
report them in writing to: Oracle University, 500 Oracle Parkway, Redwood Shores, California 94065 USA. This document is not
warranted to be error-free.
If this documentation is delivered to the United States Government or anyone using the documentation on behalf of the United
States Government, the following notice is applicable:
Trademark Notice
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective
owners.
Authors
Kate Heap, Patrice Daux
Table of Contents
Oracle Fusion Middleware 11g: Build Applications with ADF I Table of Contents
i
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Oracle Fusion Middleware 11g: Build Applications with ADF I Table of Contents
ii
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Oracle Fusion Middleware 11g: Build Applications with ADF I Table of Contents
iii
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Oracle Fusion Middleware 11g: Build Applications with ADF I Table of Contents
iv
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
c. Select Packages in the list at the left and set the following values:
Entity entity
View Object uiview
Application Module module
d.
Chapter 2 - Page 5
Copyright 2010, Oracle and/or its affiliates. All rights reserved.
Oracle University and Egabi Solutions use only
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
c. Also, note that the application overview page, Storefront Overview, is open in the
editor. This page enables you to see all the aspects of your application at a glance, to
obtain related help, and to create new objects. You can spend some time exploring this
overview if you want to, but it is not used in these practices.
Copyright 2010, Oracle and/or its affiliates. All rights reserved.
When you have finished looking at the overview, close it by clicking the X on its tab.
(The X is not visible until you move the cursor over the tab.) If you want to display it
again, right-click a project and select Show Overview.
d. Click Create a new database connection to the right of the Connection field.
e. In the Create Database Connection dialog box:
1) Supply the information in the table below.
Connection Name FOD
Connection Type Oracle (JDBC)
Username fod (or follow the instructions given by
your instructor if you are using a shared
database)
Password fusion
Save Password Select the check box.
2) In the lower half of the page, Oracle (JDBC) Settings, leave the Driver field at its
default, thin, and enter the Host Name, JDBC Port, and SID as given to you by the
instructor if using a shared database, or localhost, 1521, and XE if using a local
XE database.
3) Click Test Connection. You should see that the Status box displays the word
Success!.
f. Click OK to dismiss the Create Database Connection dialog box and return to the
h. Click Save All to save your work. You should get into the habit of frequently
saving your work.
b. When you select to open a new application, a file dialog box enables you to navigate to
the directory where the application resides:
1) Navigate to your courses \Labs directory and open the Storefront-
CompletedApp folder.
2) Select Storefront-CompletedApp.jws and click Open.
Copyright 2010, Oracle and/or its affiliates. All rights reserved.
4. Examine the connection information and change it if necessary to point to your database.
a. Right-click the StorefrontModel project and select Project Properties. (You can also
double-click StorefrontModel to display the Project Properties Editor.)
b. Select Business Components in the tree at the left.
c. Next to Connection, click Edit.
d. Edit the connection information to your database connection (FOD) (see Practice 2-3,
step 1(e)).
e. Test the connection, and if successful, click OK.
f. Click OK to close the Project Properties Editor and save the settings.
5. To run the application, in the adfc-config diagram, right-click the
FODShoppingDashboard view and select Run. Test the functionality of the shopping
application.
b. A list of Music products appears in the right panel. Note that there are breadcrumbs
along the top of the table that enable you to navigate to the Media subcategory, or to
the main-level list of categories if you click Store. For now, click the name of one of
the products.
c. Details about the selected product are shown. Buttons enable you to add the item to
your cart, to search for products, or to return to the shopping page. For now, click
Search.
e. Click the Playstation Portable link to display details about this product.
f. Click Add Item to Cart to add the Playstation Portable to the shopping cart and display
the cart.
g. The shopping cart is displayed. It is populated with the shopping cart items of a default
user, and the Playstation Portable has been added. Resize the right panel of the page
so that the line total is visible, and then change the quantity of the Playstation Portable
to 2. Click Update to show the updated line total.
i. Click Details to display details about the selected product in a separate pop-up
window.
j. Click OK to close the pop-up window, and then click Checkout to begin the checkout
process.
Copyright 2010, Oracle and/or its affiliates. All rights reserved.
k. The first page of the checkout process displays the shipping information. Navigate to
the next page either by clicking Next or by clicking the Billing train stop at the top of
the panel.
m. The final page of the checkout process displays all the informationshipping, billing,
and order items. Click Submit to submit the order and return to the shopping page.
Note: The Submit button does not actually do anything except perform navigation, but
in a complete application, it could fire off some additional services, such as creating an
order in the database, sending information about the order to the shipping department
and the billing department, and sending an email confirmation to the customer. This
functionality is outside the scope of the course application.
c. The New Supplier page initializes. Enter any supplier name and select a supplier status
from the drop-down list, and then click Save.
d. The new row appears at the top of the list, with a supplier ID that is automatically
assigned. Click Delete to delete the supplier.
e. Select ORDERS in the Selected pane and change the Entity Name to OrderEO
(instead of OrdersEO).
d. Click Next.
5. Complete the wizard to finish creating the business components. Do not create a business
components diagram.
a. On the Diagram page of the wizard, ensure that the Business Components Diagram
check box is not selected.
b. Click Next.
c. The last page of the wizard shows the components that you have chosen to create. It
should show the following components to be created:
Note that the wizard created not only EOs, VOs, and an AM, but also two associations
and a view link based on the foreign key relationships that are defined in the database.
2) Specify that the view object should have Read-only access through SQL query.
3) Click Next.
f. Continue clicking Next until you reach the Application Module page:
1) Select the Application Module check box.
2) Click Browse next to the Package field.
3) Click the Hierarchy tab in Package Browser and browse to and select the oracle
> fod > storefront > test package. Click OK.
e. Click Edit Bind Variables to invoke the Bind Variables dialog box to modify the
value. You can enter different values for bind variables to test whatever lookup codes
you want to check from the following lookup types:
SHIPPING_CLASS_CODE USAGE_TYPE_CODE
CONTACT_METHOD_CODE PRODUCT_STATUS_CODE
OWNER_TYPE_CODE PERSON_TITLE_CODE
DISCOUNT_TYPE_CODE CARD_TYPE_CODE
PERSON_TYPE_CODE MEMBERSHIP_TYPE_CODE
GENDER_CODE ORDER_STATUS_CODE
MARITAL_STATUS_CODE ID_TYPE_CODE
VERIFICATION_METHOD_CODE SUPPLIER_STATUS_CODE
PAYMENT_TYPE_CODE
f. When you have finished testing, close the Business Components Browser.
4) Click Next.
c. On the Application Module page of the wizard, place the view objects in your
application module as you did before by using the Browse buttons to navigate to, and
select the proper package (test) and application module (TestAM).
d. Click Finish to create the view objects.
e. Save your work. The Application Navigator should look like this:
2. Optional step (If you choose not to create these associations, you must begin the
practices for the next lesson by opening the starter application.)
In a similar manner, create the following additional associations, with accessors in both
source and destination (leave both check boxes selected):
Name Source Destination
OrdersOrderItemsAssoc OrderEO.OrderId OrderItemEO.OrderId
ProductCategoriesProductsAssoc ProductCategoryEO. ProductEO.CategoryId
CategoryId
3. Optional step (If you choose not to create this association, you must begin the
practices for the next lesson by opening the starter application.)
1) Click Add All to shuttle all attributes into the Selected pane.
2) Click Next.
e. On the Attribute Settings page, click Next.
e. Click Add.
e. Close the Business Components Browser when you have finished testing.
d. Confirm that you would like to create the package by clicking Yes.
e. JDeveloper creates the assoc package and moves the associations into it. This may
take several minutes.
3. Test the application module to ensure that all view links still function correctly.
2. Optional step: Similarly, edit OrderItemEO to format UnitPrice as Currency and set its
Label Text to have a space between words.
3. Test the changes by running TestAM in the oracle.fod.storefront.test package.
a. Double-click ShoppingCart1 > OrderItemsOrdersFkLink1.
b. Look at the labels and formatting that you defined.
c. Position the cursor over OrderTotal, OrderDate, and OrderShippedDate to see the
tool tip text.
d.
g. Click OK.
h. To populate the history columns for created by and modified by, there must be a
logged-in user. You later designate these attributes as history columns, but to test with
the Business Components Tester with no logged-in user, you simply give these
columns default values. Set the default Value of the CreatedBy and LastUpdatedBy
attributes to anonymous. (Ensure that Literal is selected as the option for Value Type.)
2. Optional step: (If you choose not to complete this step, you must begin the practices
for the next lesson by opening the starter application.)
Similarly, modify the same five attributes for OrderItemEO and for OrderEO.
3. Save your work.
4. Test SupplierVO to ensure that you can actually insert and commit a record.
c. Click Insert .
d. Ensure that a temporary SupplierId appears (it should be a negative number) and that
the history columns are populated.
f. Click Save .
g. Ensure that the SupplierId value is populated from the database sequence.
5. Optional step: (Perform this step only if you added history columns to these entities.)
Test OrderEO and OrderItemEO, making sure that when you insert a record the history
columns are populated.
a. Double-click ShoppingCart1 > OrderItemsOrdersFkLink1.
e. In the Criteria Item section of the Create View Criteria dialog box, select the following
values from the drop-down lists:
List Name Value
Attribute CustomerId
Operator Equal to
Operand Bind Variable
Parameter Click New and define a variable named
PersonId of type Number.
Validation Optional
e. In the Bind Variables dialog box, enter a value of 110 and click OK.
2) In the Attributes Editor, select PersonEO in the Available list and shuttle it to the
Selected listthis adds all of its attributes.
b. Add the reference entities and attributes shown in the table above, accepting the
default join types. If all attributes are added automatically, delete all attributes that are
added except for those shown in the table above.
d. Expand the List of Values section in the editor and click Add list of values .
c. Note that the Structure window shows the methods that are included in the class. (If
the Structure window is not visiblethat is, the default location is at the lower left of the
IDEthen you can select View > Structure to open it.) You can see accessors (getters
and setters) for all the OrderEO attributes. You can double-click any method to
OrderItemEOImpl row;
boolean found = false;
for (row = (OrderItemEOImpl)orderItems.first(); row != null;
row = (OrderItemEOImpl)orderItems.next()) {
if (row.getProductId().equals(productId)) {
found = true;
break;
}
}
if (found) {
Number qty = row.getQuantity();
if (qty == null)
Copyright 2010, Oracle and/or its affiliates. All rights reserved.
EntityImpl productEO =
newItem.setProductId(new Number(productId));
newItem.setQuantity(new Number(1));
newItem.setUnitPrice(unitPrice);
try {
getDBTransaction().validate();
} catch (TxnValException e) {
System.out.println(e.getMessage());
for (Throwable t : e.getExceptions()) {
System.out.println(t.getMessage());
}
} catch (JboException e) {
System.out.println(e.getMessage());
}
}
}
f. Right-click the method name initDefaults, and then select the Quick JavaDoc option
from the context menu. JDeveloper displays an explanation of the method. Click
c. Click Insert a new row in the bottom pane of the window (the OrderItems
section).
d. Note that the row is created with a LineItemId value defaulted from the database
sequence ORDER_SEQ.
e. Because there are a number of mandatory columns, do not commit the new row.
f. Close the BC Browser without committing the row.
2. Optional step: (If you choose not to complete this step, you must begin the practices
for the next lesson by opening the starter application.)
Similarly, designate the same columns as history columns in OrderEO and OrderItemEO.
3. As you did previously for OrderEO and OrderItemEO, generate the entity object class for
SupplierEO.
4. In the entity object class for SupplierEO, override the
getHistoryContextForAttribute() method with the following code, which you can
copy from the getHistoryContextForAttribute.txt file in the \files subdirectory
of your \labs directory:
protected Object getHistoryContextForAttribute(AttributeDefImpl
attributeDefImpl) {
Object value =
super.getHistoryContextForAttribute(attributeDefImpl);
// If value is null and is modify user or create user
// history column then return "anonymous"
if (value == null && (attributeDefImpl.getHistoryKind() ==
AttributeDefImpl.HISTORY_MODIFY_USER ||
attributeDefImpl.getHistoryKind() ==
AttributeDefImpl.HISTORY_CREATE_USER))
{
return "anonymous";
}
return value; }
a. Open the Java class in the editor.
b. From either the main menu or the context menu, select Source > Override Methods.
c. In the Override Methods dialog box, select the check box to the left of the
getHistoryContextForAttribute(AttributeDefImpl) : Object method
and click OK. (You can use the filter field.)
5. Optional step: (If you choose not to complete this step, you must begin the practices
for the next lesson by opening the starter application.)
Similarly, override the getHistoryContextForAttribute() method with the same
code in the entity object classes for OrderEO and OrderItemEO.
6. Run the TestAM application module and perform the same tests as you did in step 4 of
practice 6-3, (Supplier1 and also ShoppingCart1>OrderItemsOrdersFKLink1) except
that if you test the shopping cart, you will not be able to see how the history columns
appear in the shopping cart item record because the history columns are no longer part of
the ShoppingCartItemVO view object.
ViewObject vo = am.findViewObject("PaymentOptionV1");
c. After the line:
// Work with your appmodule and view object here
and above the line:
Configuration.releaseRootApplicationModule(am, true);
add the following code: (You can copy it from the TestClient.txt file in the \files
subdirectory of your \labs directory.)
System.out.println("The table contains " +
vo.getEstimatedRowCount() + " rows:");
vo.executeQuery();
while (vo.hasNext()){
4. Right-click the editor and select Run. The test client runs and should display the data in the
log window. It ends when the log displays the message: Process exited with exit
code 0.
}
return mCurrentUser;
cart.setAttribute("OrderDate",
((DBTransactionImpl)getDBTransaction()).getCurrentDbTime());
cart.setAttribute("OrderStatusCode", "CART");
vo.insertRow(cart);
}
}
}
a. In the Application Navigator, expand FODShoppingCartAM and double-click
FODShoppingCartAMImpl.java to open it in the editor.
b. Add the code shown above just before the closing right brace.
c. Press Alt + Enter if prompted to import the following:
ViewRowImpl shoppingCartRow =
(ViewRowImpl)shoppingCartVO.first();
assert shoppingCartRow != null;
OrderEOImpl orderEO =
(OrderEOImpl)shoppingCartRow.getEntity(0);
orderEO.addItemToOrder(productId);
}
a. Insert the code just before the closing brace in FODShoppingCartAMImpl.java.
b. Press Alt + Enter if prompted, to import the following:
oracle.jbo.ViewObject
oracle.jbo.server.ViewRowImpl
oracle.fod.storefront.entity.OrderEOImpl.
c. The code shows an error when calling the addItemToOrder() method. To fix it,
manually add the following import statement to the import section of the file:
import oracle.jbo.domain.Number;
d. Right-click the editor and select Make.
e. Save your work.
4. Now that you have written the service methods to initialize and add items to the shopping
cart, expose the new methods to the client interface.
a. Examine the Data Controls panel again. It looks the same as before. The new methods
are not yet available to the client interface.
Copyright 2010, Oracle and/or its affiliates. All rights reserved.
2. Test the shopping cart. Execute the init() method, but do not supply a value for the bind
variable, because that comes from the init() method.
a. Run FODShoppingCartAM.
Copyright 2010, Oracle and/or its affiliates. All rights reserved.
g. One record should be returned by the query: the status CART order for DRAPHEAL.
f. If you choose to define a text resource, simply click this option . In the Select Text
g. Click OK to save your validation definition, and then click OK to close the Attribute
Editor if you used it to invoke the Add Validation Rule dialog box.
2. Save your work. You will test this validation after all validations are defined.
2. Save your work. You will test this validation after all validations are defined.
e. Click OK to save your validation definition. (Click OK again to dismiss the Attribute
Editor if you used it to invoke the Add Validation Rule dialog box.)
f. In the Application Navigator, expand the OrderEO node and double-click
OrderEOImpl.java to open it in the editor (by adding the Method validator, this file
would have been automatically generated if it did not already exist).
g. In the Structure window, double-click the validateShippedDateAfterOrderDate
method to locate it in the editor.
3) Click OK.
3. Save your work.
c. Tab out of the field. You should receive the error message that you defined.
b. Enter the same value in Order Shipped Date that is in Order Date. You should be able
to tab out of the field with no error.
c. Enter a value in Order Shipped Date that is earlier than the value in Order Date. You
should receive the warning message that you defined. (The JBO key is different if you
entered hard-coded message text rather than defining a text resource.)
d. Click OK to acknowledge the message. You should notice that navigation to the next
field was successful, because you defined failure handling to be an informational
warning rather than an error.
e. Close the Business Components Browser.
4. Run TestAM to test the domain that you defined and applied to the SupplierEO entity
object.
a. In the Application Navigator, right-click TestAM and select Run.
b. If necessary, click Connect to establish the connection.
c. When the Business Components Browser appears, double-click the Supplier1 node.
d. Navigate to a supplier with a phone number. Change the phone number in various
ways, such as by deleting the dots (.) or by making the phone number longer. Each
time that the phone number does not conform to the format xxx.xxx.xxxx, you
b. In the Structure window, click the Show Fields button, and then right-click
mCurrentUser:String and select Create Watchpoint.
b. The Breakpoints window shows the breakpoints that you have set, in addition to those
persistent breakpoints that are set by default.
c. Right-click the Breakpoints window to see the options that are available in the context
menu (but do not make any changes).
2) If the Stack window is not visible, from the JDeveloper main menu, select View >
Debugger > Stack. You can see in the Stack window that the
BaseApplicationModuleImpl class is in the process of being initialized, and
that it was called by the initialization of FODShoppingCartAMImpl.
c. Step through the code and use the debugger features to figure out the problem.
1) Click Step Into on the JDeveloper toolbar. You can see the pointer move to the
next executable line of code in the editor window.
2) In the Data, expand the this node. Note that the value of mCurrentUser is null.
Also, mCurrentUser appears as its own in the SmartData. You want to keep
track of the value of this variable, so right-click it in the Smart Data or in the Data
panel and select Watch. This adds the variable to a watch list where you can keep
track of various values all in one place.
6) If you step into the code at this point, you would need to have the ADF source
because ADF source classes are called in the next lines. Because you do not have
the source, click Step Over to advance to the next line of code in this class
everything still executes, but you just do not step into the called classes. Note: Be
sure to click Step Over and not Step To End of Method, whose icon looks similar.
7) Click Step Over again to advance to the line of code that assigns a value to the
user variable. This assignment calls the getUserPrincipalName() method of
the application module base class, which is overridden in
BaseApplicationModuleImpl.java.
8) You are interested in two variable values: user and mCurrentUser. Click the
Smart Data tab. (If it is not available, use the View > Debugger menu to invoke
it.)
9) On the Smart Data tab, collapse all nodes, and then right-click user and select
Watch.
14) In the Modify Value dialog box, change the value to DRAPHEAL, which is the
correct spelling for the username of the user whose shopping cart you want to
display, and then click OK.
21) Click Resume , and then in the Business Components Browser, double-click
ShoppingCart1. Click Cancel in the Bind Variables dialog box so that the value
set by the init method is used. You should see that the correct record appears
now.
You have seen some features of the debugger and how being able to view variable and
parameter values as the code runs can help you to figure out a coding problem. This
code was so simple that you probably could have easily figured it out just by looking at it,
but the debugger can be very useful for troubleshooting complex code. You were able to
change a value while code execution was paused, so that you could see the outcome.
Of course, you would also have to fix the code itself instead of just changing a variable
value in the debugger, but that is not part of this exercise.
Copyright 2010, Oracle and/or its affiliates. All rights reserved.
2. After the designer initializes, the new blank page opens in the editor. Add to the page two
databound tables for product categories and subcategories as master-detail tables.
a. In the Data Controls panel, expand FODProductAMDataControl >
BrowseCategory1.
b. Delete the columns that you do not want to display by selecting them and clicking
Delete , and you can use the arrows at the right of the Edit Table Columns dialog
box to reorder the columns. Set the column list to match the following:
CategoryName
CategoryDescription
Hint: When you select an attribute, it is best to select the first column, Display Label,
because that is the only column that does not invoke a pop-up list.
Note: Although this short list of attributes is easy to reorder, a quick way to reorder
attributes is to select the one that you want last in the list (in this case,
CategoryDescription), and then click the up arrow to move it to the top of the list.
Then working from the bottom up, repeat for each desired attribute (in this case,
CategoryName). Finally, select all the attributes below the desired attributes and delete
them.
c. Make sure that Row Selection is selected in the Enable ADF Behavior section at the
top of the window, and then click OK to apply the changes.
c. Select one of the Categories and note that the SubCategories change to reflect the
selected row. Select another category and note the change. You may have to scroll
down to see the SubCategories.
The page should look similar to the following screenshot, in which some of the extra
white space has been cut out:
Answer: Category Name comes from the entity object attributes control hints for
Label.
6. At run time, what appears in the browser for the first columns values? Where do these
values come from?
__________________________________________________________________
__________________________________________________________________
Answer: Office, Electronics, and Media are the category names in the rowset;
they are the input values for the category names in the rows.
7. In the Application Navigator, right-click the page and select Go to Page Definition. What is
the name of the page definition file? (You can also view data bindings by clicking the
Bindings tab of the page itself.)
__________________________________________________________________
__________________________________________________________________
Answer: It shows the data controls that are used in the application.
14. Close the browser and the files that you have open in the JDeveloper editor. As you add
pages to the application, you can reexamine the data-binding registry to see how page
mappings, page definition usages, and data control usages are shown for the additional
pages.
2. Run the page to test it. Now, when you run the page, the log window shows that the
application is undeployed and then redeployed to the default server.
a. You should note that although the top two tables are coordinated with one another, the
products that appear in the bottom table are those of the first category/subcategory,
and the display of products does not change when different categories or
subcategories are selected. In the practice for the lesson titled Achieving the Required
Layout, you use partial page rendering to refresh the Products table so that it
coordinates with the record that is selected in the Subcategory table.
b. Close the browser when you have finished and undeploy the application as described
in step 6(i) of Practice 2-4.
d. When you have finished, close the browser and undeploy the application as described
in step 6(i) of Practice 2-4.
3. The Access Denied error that you received is indicative of a problem with data bindings.
Fix the problem without re-creating the tables on the page.
a. Click the Bindings tab in the editor of the ProductCatalog page to see that there are
no data bindings for the page.
b. In the Application Navigator, navigate to StorefrontUI > Application Sources >
oracle.storefront.ui and open DataBindings.cpx.
c. Map the existing page definition file to the renamed page: In the Page Mappings
section of DataBindings.cpx, edit the path. Change Products in the path to
ProductCatalog. You can do this by selecting the page mapping, and then editing
the path in the Property Inspector.
d. Reopen JDeveloper.
e. In the Application Navigator, navigate to StorefrontUI > Application Sources >
oracle.storefront.ui > pages and select ProductCatalogPageDef.xml.
f. In the Structure window, right-click the ProductsPageDef node and select Refactor >
Rename.
c. Select the view activity in the task flow editor and look at its Property Inspector. You
can see that it is linked to the ProductCatalog page that you created.
b. Change the name of the view activity to ProductSearch by entering the new name
either directly on the diagram or in the Property Inspector.
Note the yellow warning symbol on the view activities that you just created. This
means that they do not yet point to pages.
3. Add a Control Flow Case from ProductSearch to ProductDetails and name it detail.
a. Click Control Flow Case in the Component Palette.
b. Click inside ProductSearch, and then click inside ProductDetails.
4. In the same way, add a Control Flow Case from ProductDetails to ProductSearch and
name it search.
5. Add a Control Flow Case from ProductCatalog to ProductSearch and name it search.
6. You can move the view activities to make the diagram look better. For example, you can
arrange the view activities as shown:
9. Create a fourth View activity named ProductCategory. The page is to display a category
tree for user navigation.
10. Finally, create a View activity called FODShoppingDashboard. The page for this view
activity will be the main page of the application from which all parts of the application are
accessed.
Chapter 12 - Page 9
Copyright 2010, Oracle and/or its affiliates. All rights reserved.
Oracle University and Egabi Solutions use only
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
5) Click OK.
e. Note that the newly created task flow appears in the Application Navigator in two
places, both under WEB-INF and under Page Flows.
Note that the view activity is surrounded with a green halo. This indicates that it is the
default activity, or entry point, of the task flow. A bounded task flow must have one, and
only one, default activity. Only bounded task flows show default activities, because
unbounded task flows do not have a defined entry point.
g. Add a Task Flow Return and name it Shop.
h. In the Property Inspector for the Shop task flow return activity, set the Outcome name
to shop. This means that when the task flow returns to the one that called it, it
navigates by using a control flow case whose from-outcome is named shop.
j. Similarly, add another task flow return activity called Checkout, with the outcome
name checkout.
2) A task flow return activity named Save whose outcome is named done
d. On the Extract Task Flow warning, click Yes to accept and proceed.
e. In the Extract Bounded Task Flow dialog box, enter a file name of ShoppingFlow,
add \oracle\storefront\ui\flow to the directory path, and then click OK.
g. Right-click the ProductCatalog view activity and select Mark Activity > Default
Activity.
Note: Select and remove the other attributes by clicking Delete. You can reorder the
attributes by selecting an attribute and using the up and down arrows as required.
Hint: An easy way to reorder many attributes is to first select the last attribute that you
want in the display (in this case, LineTotal) and click the top arrow, which places the
attribute at the top of the list. Then select the next-to-last attribute (in this case
Quantity) and place it at the top of the list. Continue with all the attributes, from last to
first. Finally, select all the other attributes and delete them.
d. Click OK.
3. Test the page.
Copyright 2010, Oracle and/or its affiliates. All rights reserved.
a. Right-click the editor for the ShoppingCart page and select Run.
b. If necessary, in the Confirm Run JSF JSP dialog box, click Yes.
d. Close the browser when you have finished and undeploy the application as described
in step 6(i) of Practice 2-4.
4. Add to the page an invocation of the application modules init() method that initializes
the application to show shopping cart data for a specific user. The method interrogates the
system user (a hard-coded name is used until security is implemented in a later practice)
and uses that name as the username for the shopping cart. Hint: This involves adding a
method action binding and an invoke action binding to the page definition.
a. Click the Bindings tab in the editor for the ShoppingCart page.
b. Add a Method Action binding to the init() method in the
FODShoppingCartAMDataControl:
2) In the Insert Item dialog box, select methodAction and click OK.
2) In the Insert Item dialog box, select invokeAction, and then click OK.
3) In the Insert invokeAction dialog box:
5) In the Executables panel, drag the invokeInit executable to the top position, so
that the init() method is invoked before the iterator.
d. Save your work and run the page again to check that you can see items in the
shopping cart.
You should be able to select any row in the table, and the page should look similar to
the following:
e. Close your browser when you have finished and undeploy the application as described
in step 6(i) of Practice 2-4.
Note that the table does not fill up the page. You must scroll to see all the columns.
You later improve the look of the table in the practice for the lesson titled Achieving the
Required Layout.
c. Experiment with the functionality of the page.
1) Enter a percentage sign (%) in the ProductName field and click Search. All of the
products appear.
6) Enter Pla in the ProductName search field and click Search. Note that the table
displays products that contain Pla.
10) When you have finished, close the browser and undeploy the application as
described in step 6(i) of Practice 2-4.
3. Run the page to test it. Run it directly rather than from the task flow because you have not
added navigation yet. The page should look similar to the following, displaying only one
record, which may not be the same as the record shown:
4. When you have finished, close the browser and undeploy the application as described in
c. When you have finished, close the browser and undeploy the application as described
in step 6(i) of Practice 2-4.
b. In the Edit Tree Binding dialog box, select SubCategory from the Add Rule drop-
down list.
Note: This shows up at run time as a hierarchical tree with nodes and subnodes
displaying category names and subcategory names. Note that both RootCategoryVO
and BrowseSubCategoryVO are based on the same entity object, ProductCategoryEO.
The queries are differently defined to select those with no parent category for
RootCategoryVO and all categories for BrowseSubCategory. The view link defined to
link the two view objects restricts the second view to display only those subcategories
whose parent category is the root category. This becomes clearer when you run the
page.
g. The page should look similar to the following:
e. In the Properties Inspector, set the Text to #{node}. (You can use Expression
Builder and select the expression from JSP Objects.)
b. Note that you can expand the nodes, but nothing happens when you click the links
other than that the tree is refreshed. You change this behavior in a later practice.
c. When finished, close the browser and undeploy the application as described in step
6(i) of Practice 2-4.
k. You can see that the view accessor limits the view to those rows where the lookup type
is SUPPLIER_STATUS_CODE.
l. Click Cancel to close the window, and then close the EO and VO editors.
2. In the ManageSupplierFlow task flow, create the SupplierUpdate page, using an LOV for
the SupplierStatus attribute. Place this page in a \supplier subdirectory where you have
c. Drag the data control FODSupplierAMDataControl > Supplier1 to the page and
create an ADF Form.
Click OK. Note that the Component to Use field for the SupplierStatus attribute is
ADF Select One Choice; this is determined by the setting in the ADF BC model.
Although you can change the setting here, it is better to let the model determine the list
type.
The page should look something like the following:
e. Test the page by running it directly. The page should look similar to the following with
the list of values dropped down:
f. When you have finished, close the browser and undeploy the application as described
in step 6(i) of Practice 2-4.
d. To define text for the button label and store it in a resource bundle, in the Property
Inspector, click the arrow to the right of the Text property and select Select Text
Resource from the context menu.
(Alternatively, you can right-click the button in the editor or in the Structure window and
select Select Text Resource for > Text from the context menu.)
Copyright 2010, Oracle and/or its affiliates. All rights reserved.
g. Select the button and in the Property Inspector, click the Action drop-down list and
select cancel.
This ensures that the cancel control flow is executed when the user clicks the Cancel
button.
h. To enable users to cancel and leave the form without entering the required fields, set
the Immediate property to true on the Behavior panel of the Property Inspector.
3. Similarly, in the ShoppingFlow task flow, open the ProductCatalog page. Add a button
above the panelHeader component, and using the Text Resource, label it Search. Set the
Action to search.
c. The file should look similar to the following (not all of these entries are present if you
skipped any optional steps):
3) In the Edit Table Columns dialog box, deselect the Row Selection check box, and
then click OK.
c. Change the ProductName to be a link that calls the ADF method that sets the row and
then navigates to the detail page:
1) In the Structure window, expand the first af:column under af:table.
2) Right-click af:outputText for ProductName in the Structure window and select
Surround With.
3) In the Surround With dialog box, select ADF Faces > Link and click OK.
d. If you run the page from the task flow at this point (see step f below for how to do that if
you want to try), the link navigates to the detail page but always displays details for the
first product. The reason for this behavior is that when you disabled row selection you
also disabled row concurrency. Add a method called setCurrentRowWithKey that
sets the row of the Product iterator to whatever the current row is on the page.
1) In the Data Controls panel, expand FODProductAMDataControl >
BrowseProduct > Operations.
4) If you did not complete the optional steps of defining additional buttons, click the
Back button of your browser, otherwise perform the following actions:
a) On the detail page, click Search to return to the search page to try another
link.
b) On the ProductDetails page, click Shop to return to the ProductCatalog page.
5) When you have finished, close the browser and undeploy the application as
described in step 6(i) of Practice 2-4.
2. In the ShoppingFlow task flow, add a drill-down link from the ProductCatalog page to the
ProductDetails page.
a. Open the ProductCatalog page.
b. Select the af:outputText of ProductName in the bottom table.
c. Press Ctrl + C to copy the Value property #{row.ProductName}.
3. Coordinating the ProductCatalog and ProductDetails pages is made more complex by the
fact that the two pages use different iterators. The ProductDetails page uses the top-level
BrowseProduct iterator, whereas the ProductCatalog page uses the BrowseProduct1
iterator that is a detail of BrowseCategory > BrowseSubCategory. Therefore, you must use
the setCurrentRowWithKeyValue() method from the BrowseProduct data control to
coordinate the pages.
a. In the Data Controls panel, expand FODProductAMDataControl > BrowseProduct >
Operations.
When you created the Product table for this page, you excluded the ProductId because you
do not want to display it. Because it was excluded, it is not in the page bindings. Before you
can use ProductId as an argument to the setCurrentRowWithKeyValue method, you
have to add it to the bindings. After you add it, you can set the NDValue property of
setCurrentRowWithKeyValue.
a. Go to the Overview tab of the ProductCatalog page definition, or to the Bindings tab
of the page.
b. In the Bindings section, select the BrowseProduct1 binding and click Edit.
c. In the Attributes section of the Tree Binding Editor, shuttle the ProductId from the
Available Attributes to the Display Attributes, and then click OK.
e. Test the page by running it from the ShoppingFlow task flow. (Open the task flow,
right-click the default activity, and select Run.) Remember that the Products table is
not yet coordinated with the Categories and Subcategories tables, so just scroll to the
bottom table and try out the ProductName links.
f. Click Shop to return to the ProductCatalog page to try different links. (If you did not
define the Shop button in the optional steps, use the browsers Back button to return to
c. Create a control flow case from BrowseSuppliers to ManageSupplierFlow and set its
from-outcome to update.
d. Create a control flow case from ManageSupplierFlow to BrowseSuppliers and set its
from-outcome to done. (It should default to done because that is the outcome of the
task flow return activities in ManageSupplierFlow.)
However, the page does not yet commit any updates you may make for the selected
supplier; you implement that in a later practice.
h. When you have finished, close the browser and undeploy the application as described
in step 6i of Practice 2-4.
f. Click OK.
4. Create the following three View Activities on CheckoutFlow, and note that because of the
train choice, JDeveloper creates a navigation path as you create the activities:
CheckoutShipping
CheckoutPayment
CheckoutConfirm
b. Name the other task flow return CancelOrder, and set the name of its outcome in the
Property Inspector to cancel.
c. Add a wildcard control flow rule.
d. Add two control flow cases:
1) One named submit from CheckoutConfirm to SubmitOrder
2) One named cancel from the wildcard to CancelOrder
When finished, close the browser and undeploy the application as described in step 6(i) of
Practice 2-4.
8. Establish the context for the shopping cart by calling the init() method defined in the
FODCheckoutAMDataControl application module. Add a reference to the init()
method and execute the method as part of the page load process. This init() method
retrieves the current username (now hard coded, but when security is implemented will be
set programmatically), sets the value in a named WHERE clause, and then reexecutes the
query. The result is that the shopping cart is populated with data from the current user.
To use the init() method, you define a reference for it in the page definition file. Then
you add an invokeAction to the page definition executables. invokeAction executes
when the page is loaded.
a. Open the Page Definition for the CheckoutShipping page (right-click anywhere on
the page and select Go To Page Definition), or click the Bindings tab on the page.
b. Click the Add icon (green plus sign) on the Bindings pane.
2) Select methodAction.
3) Click OK.
d. In the Create Action Binding dialog box:
1) Select FODCheckoutAMDataControl. Note that the Operation defaults to
init(). This is because the init() method is the only method in the application
module.
9. Add the ability to navigate to the next page by adding a Train component to the page. The
Train component shows the users relative position in the train. It has train stops (small
boxes) for each of the pages in the train. The current position is highlighted with a slightly
larger box. The Train component can also be used for navigation. The user can click the
previous or next train stop to navigate to that page.
a. In the page editor for the CheckoutShipping page, drag a Train component from the
Component Palette just inside the top of the form.
b. In the Bind Train dialog box, click OK to accept the default trainModel to bind to.
10. Add a train button bar to the page. A train button bar displays Back and Next buttons to
navigate to the next or previous train stop.
a. Drag a Train Button Bar from the Component Palette to the Structure window just
11. Add labels for the train stops: Shipping, Billing, and Confirmation. JDeveloper
currently does not provide a way to use a text resource from a resource bundle file, so you
can just enter the text directly.
a. Open the CheckoutFlow task flow.
b. In the Structure pane, expand the view CheckoutShipping node.
c. Right-click the Train Stop and select Insert inside train-stop > Display Name from
context.
However, because you have added the train component and train button bar to only the
first page, you cannot navigate to the other pages from the payment page. You take
care of that problem when you create the real pages.
e. When finished, close the browser and undeploy the application as described in step
6(i) of Practice 2-4.
f. Delete the two temporary pages:
1) In the CheckoutFlow task flow, select the CheckoutPayment and
CheckoutConfirm view activities and delete the value in their page property.
2) In the Application Navigator, multiselect the CheckoutConfirm and
CheckoutPayment pages. Right-click and select Delete.
e. Select one of the detail control flow rules and in the Property Palette, change its
from-activity-id to the wildcard rule by selecting it from the drop-down list.
f. Delete the other detail control flow rule. The diagram should now look similar to the
following screenshot:
g. Select the shop control flow rule and in the Property Palette, change its from-activity-
b. Drag a Control Flow Case from the wildcard to CheckoutFlow and name the
outcome checkout.
c. From the Application Navigator, drag the ShoppingCartFlow to the ShoppingFlow
task flow diagram in the editor to create a task flow call activity.
d. In the Property Inspector, change the Activity ID of the task flow call activity to
AddShoppingCart. Do not change the ID in the Task Flow Reference section.
You later add logic to the application so that there is a difference between displaying
the cart and adding an item to the cart.
i. Open the ProductCatalog page and to the right of the Search button, add a button.
1) Using the resource bundle, set the text property to Show Cart.
2) Set the action to cart to navigate to the DisplayShoppingCart activity.
5) When you have finished, close the browser and undeploy the application as
described in step 6(i) of Practice 2-4.
e. Apply the same type of stretching to the other two tables on the page: the one for
subcategories and the one for products. However, in the Products table (table2),
stretch the middle column (column3), because it is the one that contains a large
amount of text. To do so, follow these steps:
1) Select the middle column and give it the Id of Description.
2) Optional: (You may get errors when nondefault values of Id and TestId are not
identical. To avoid this possibility, reset the TestId to its default value.)
3) Select the table and set Column Stretching to column:Description.
f. Save your work.
g. Optional step: (If you choose not to complete this step, you must begin the
practices for the next lesson by opening the starter application.)
Copyright 2010, Oracle and/or its affiliates. All rights reserved.
Similarly, stretch the table and the last column for all tables on the following pages:
ProductSearch (Search results table)
ShoppingCart (Items table)
BrowseSuppliers (Suppliers table)
2) In the Property Inspector, change the Text property to Categories. Ensure that
you use a resource bundle.
3) Similarly, set the Text property for the af:panelHeader BrowseSubCategory1
to Subcategories.
2. On the ProductCatalog page, two of the tables and panel headers are grouped under an
af:panelGroupLayout component. Enable this component to display scroll bars when the
browser is too small to display all of its contents, and place the third table in the same panel
group layout.
a. In the Structure window, select af:panelGroupLayout.
b. In the Property Inspector, select scroll from the Layout drop-down list.
3. Optional step: (If you choose not to complete this step, you must begin the practices
for the next lesson by opening the starter application.)
Similarly, open ProductSearch page and set the default Panel Group Layout component
to scroll.
g. Drag a Toolbar from the Component Palette to the toolbar facet of the panel header, in
either the Structure window or in the editor.
i. Save your work. When you have finished, the page should look similar to this
3. Optional step: (If you choose not to complete this step, you must begin the practices
for the next lesson by opening the starter application.)
Similarly, on the SupplierUpdate page, put the Supplier form that is contained in a panel
form layout into a panel header. You do not need to change the heading.
Hint: The SupplierUpdate page is in the supplier subdirectory of the
\oracle\storefront\ui\pages directory.
a. Surround the Panel Form Layout with a Panel Header, but do not change the Text
(heading).
b. Add a Toolbar component and move the existing buttons to the toolbar facet of the
panel header.
c. For now, do not change the text of the panel header, because later you add a
conditional text display.
d. Using the Style property group and the Box tab, set the Width of the panel header to
e. Save your work. When you have finished, the page should look like this
4. Optional step: (If you choose not to complete this step, you must begin the practices
for the next lesson by opening the starter application:)
Similarly, on the BrowseSuppliers page, put the Supplier table into a panel header with
the heading Select a Supplier for Update.
a. Surround the Supplier table with a Panel Header.
b. Using the resource bundle, change the Text to Select a Supplier for Update.
c. Save your work.
5. Optional step: (If you choose not to complete this step, you must begin the practices
for the next lesson by opening the starter application.)
Similarly, on the ShoppingCart page, put the table into a panel header labeled Shopping
Cart.
a. Surround the table with a Panel Header.
c. Drag a Panel Group Layout from the Component Palette to the page and set its
Layout property to scroll.
d. Drag two Panel Headers to the page, one below the other and both within the panel
group layout. You may find it easier to drag the panel headers to the
af:panelGroupLayout in the Structure window.
e. Set the Text of the top panel header to Billing Address and of the other to
Payment Options, optionally using a resource bundle.
2. Now that you have the layout defined, you can add databound components. First, you add
the billing address.
a. Drag the FODCheckoutAMDataControl > ShoppingCart1 > PaymentOption1 >
BillingAddress to the first panel header.
f. Save your work. The page should now look like this:
6. Optional Step: To test your checkout pages, you must add the same train components to
the second and third train stops. In the lesson titled Ensuring Reusability, you define a
page template to use for all these pages, and the train components are on it rather than on
the individual pages. However, for now you temporarily add them to each page for testing.
Copyright 2010, Oracle and/or its affiliates. All rights reserved.
Copy the train and train button bar from the CheckoutShipping page to each of the other
two pages in the CheckoutFlow.
a. Open the CheckoutShipping page.
b. In the Structure window, expand jsp:root > f:view > af:document > af:form.
c. Multiselect af:train and af:trainButtonBar.
d. Right-click and select Copy.
In the list at the left of the Expression Builder, select ADF Bindings > bindings >
PaymentTypeCodeValue > inputValue, which inserts
#{bindings.PaymentTypeCodeValue.inputValue} into the expression. You
then can add the condition to the end of the expression and click OK.
Note: Be sure to select the PaymentTypeCodeValue attribute binding and not the
PaymentTypeCode binding.
3) Click OK.
4. Now set ExpireDate to be visible only if the Payment Type Code Value is CC. Define the
Visible and PartialTriggers properties.
a. Select af:inputDate for the ExpireDate attribute in either the visual editor or the
Structure window.
b. Set the Visible attribute (in the Advanced panel) to:
#{bindings.PaymentTypeCodeValue.inputValue eq 'CC'}
If this expression evaluates to true, the attribute is visible in the UI.
Note: You can use the Expression Builder to help build the expression. To get to
Expression Builder, click the arrow icon to the right of the Visible property on the
Advanced tab of the Property Inspector and select Expression Builder.
In the list at the left of the Expression Builder, select ADF Bindings > bindings >
2. Set the Products table to be the PPR target that is refreshed when the selected
subcategory changes.
a. Select the Products table (table2).
b. In the Property Inspector, select Edit to set the Partial Triggers property to
SubCategory.
c. In the Edit Property dialog box, shuttle SubCategory in the Selected pane.
2. So that you can use all bounded task flows as regions on a main page, repeat the above
steps to convert all the bounded task flows to use page fragments,
ManageSupplierFlow, ShoppingCartFlow, ShoppingFlow, and
ShowSuppliersFlow. Note that all.jspx files (except for ProductCategory.jspx)
are now converted to .jsff (page fragment) files.
Save your work.
3. There is only one full page left, which is ProductCategory.jspx. This is a page on the
unbounded task flow. Extract this page into its own bounded task flow named
ProductCategoryFlow, and then convert it to use page fragments as well.
3) Click OK.
d. The task flow opens in the editor. Right-click the ProductCategory view activity and
mark it as the default activity.
e. Convert ProductCategoryFlow to use page fragments as you did the other task flows.
f. When you extract a task flow, JDeveloper creates a task flow call on the original task
flow. Delete the task flow call activity from adfc-config.xml.
Directory: <ProjHome>\public_html\oracle\storefront\ui\
pages\templates
Page Template Name: CheckoutPageTemplate
Facet Definitions tab (Click the Add icon to add the facet.)
Name: content
e. Click OK.
2. To the page template, add the layout and train components that you want to use on all the
checkout pages.
a. Add a Panel Group Layout on af:pageTemplateDef.
1) Set its Layout property to scroll.
2) If necessary, drag the panel group layout above af:xmlContent in the Structure
window.
f. Expand the af:panelHeader > Panel Header facets node in the Structure pane.
g. Add a Toolbar to af:panelHeader > Panel Header facets > toolbar.
4. Apply the template to the checkout pages. (You cannot use the IDE to apply a template to
an existing page. However, you can add the template-related code to an existing page.)
a. Open CheckoutShipping.jsff.
b. Click the Source tab.
c. In the Structure window, select af:train and af:trainButtonBar. These components are
no longer needed in the page fragment because they are contained in the page
template.
d. Back in the Source editor, replace the highlighted code with the following: (You can
copy the code from PageTemplate.txt in your files directory.)
<af:pageTemplate
viewId="/oracle/storefront/ui/pages/templates/CheckoutPageTempla
te.jspx">
5. The template contains the outermost Panel Group Layout (which holds the train, buttons,
and the Panel Header). Therefore, when you apply the template to your page, you must
move the content to the template content facet.
a. Using the Structure window, drag af:panelHeader Shipping Address to the
content facet.
6. Apply the template to the other pages in the checkout flow, using Billing as the title for the
CheckoutPayment page and Confirmation as the title for the CheckoutConfirm page.
a. Open CheckoutPayment.jsff.
Copyright 2010, Oracle and/or its affiliates. All rights reserved.
b. Repeat the steps above, changing the value of the title attribute to Billing. (The
content area of this page is in the panelGroupLayout.)
c. Open CheckoutConfirm.jsff.
3. You want the company logo image and the company name to be arranged horizontally in
the top portion of the page. Add a layout component to accomplish that, and add the
company logo and name.
a. In the Structure window, expand af:panelSplitter and Panel Splitter facets.
b. Drag a Panel Form Layout to the first facet and set the following properties:
1) Set Rows to 1 (so that the components you add are in one horizontal row).
2) Set Width to 500 pixels (so that the components you add are next to one
another, instead of spreading out to fit the browser width).
4. Below the header section that has the company logo and name, you want two resizable
panels that consume the remainder of the browser area. The left panel should contain two
tabs where page designers can place content, and the right panel should contain the main
content area. Add the layout and components for this area.
a. Drag a Panel Splitter to the second facet of the root af:panelSplitter and set its
Orientation property to horizontal.
b. Expand af:panelSplitter >Panel Splitter facets for the panel splitter that you just
added.
c. Drag a Panel Tabbed component to the first panel splitter facet.
Copyright 2010, Oracle and/or its affiliates. All rights reserved.
d. One detail item (corresponding to a tab) is created by default for the af:panelTabbed
component. Drag a second Show Detail Item to the af:panelTabbed component.
f. Drag a Facet Ref to the second af:showDetailItem and select tab2Content as the
facet name.
g. Drag a Facet Ref to the second facet of the af:panelSplitter and select mainContent
as the facet name. This provides a spot for page designers to place the main content of
the application.
h. Your template should look like the following:
i. Save your work. You must save a page template before you can use it.
5. On the main unbounded task flow for the application, create the FODShoppingDashboard
page, applying the template that you just created.
a. Open adfc-config.xml.
b. Double-click the FODShoppingDashboard view activity to create the page, setting the
following properties:
2) In the Insert Image dialog box, click the arrow next to Source, click Edit, and
navigate to the \images subdirectory of your Labs main directory.
3) Select store.gif and click OK.
4) In the Image Location Problem warning box, click Yes to copy the image into the
document root of your project.
6) Back in the Insert Image dialog box, provide a ShortDesc if desired, and then click
OK. You should now see the image on the page.
e. Save your work.
7. Change the company name to display in red rather than in blue.
a. Open MainPageTemplate.jspx.
b. Expand af:pageTemplateDef > af:panelSplitter - vertical > Panel Splitter facets >
first > af:panelFormLayout - 1.
c. Select af:outputText - #{attrs.companyName}.
d. On the Style > Text section of the Property Inspector, set Color to Red.
e. Save your work. You must save the changes to a page template for them to be picked
up by pages that use the template.
f. Open FODShoppingDashboard. If it is already open, click its tab and select View >
3. Add the main content. You should display the ShoppingFlow in this area.
a. From the Application Navigator, drag ShoppingFlow to the mainContent facet.
b. Click the Suppliers tab. Click one of the links. You can see that the update supplier
page appears and displays the selected record, but with no way to navigate back to the
browse page (you fix this later).
c. In the main shopping region, note that you must scroll down to see the other tables on
the page (you fix this shortly). Select a new subcategory and verify that the correct
products appear in the Products table.
d. Click Show Cart to verify that the cart is displayed correctly.
e. Click Shop to return to the main shopping region.
f. Click Search. Enter a search criteria to verify that the search functionality works. Note
that there is no way to return to the main shopping page from this page. You soon fix
this problem.
g. Click the link on one of the products. The page should now show the product detail.
h. Click Shop to return to the main shopping page.
i. Click Show Cart again, and then click Checkout.
j. Verify that you can navigate through the checkout train, both by using the train and by
using the train buttons.
k. Close the browser when you have finished, and undeploy the application as described
in step 6(i) of Practice 2-4.
5. Optional step: (If you choose not to complete this step, you must begin the practices
for the next lesson by opening the starter application.)
There is no way to return to the main shopping page from the ProductSearch page.
Implement navigation on that page to return to the main shopping task flow. Also add some
layout to the page to improve its appearance: Change the heading of the table to Search
Products and place all components under a root panel header with scrollbars.
a. Open the ProductSearch page fragment.
b. In the existing af:panelHeader, use the resource bundle to change the text from
ProductEO to Search Products.
c. Move af:table to the af:panelHeader.
f. Run FODShoppingDashboard again from the unbounded task flow to ensure that the
Shop button on the Product Search page navigates back to the shopping flow (Product
Catalog page).
id Value
param_CategoryId #{pageFlowScope.CategoryId}
param_SubCategoryId #{pageFlowScope.SubCategoryId}
param_CategoryName #{pageFlowScope.CategoryName}
param_SubCategoryName #{pageFlowScope.SubCategoryName}
The Page Definitions Parameters section should look like the following:
Leave the page definition file open for the next step.
3. There is a method named setCurrentCategory() in the FODProductAM application
module. This method takes two arguments: a category ID and a subcategory ID. It
reexecutes the BrowseCategory, BrowseSubcategory, and BrowseProduct view object
c. In the Create Action Binding dialog box, in the Parameters section, set these values
for the following parameters:
Name Value
categoryId #{bindings.param_CategoryId}
subCategoryId #{bindings.param_SubCategoryId}
(You can use Expression Builder; the parameters are shown under ADF Bindings >
bindings.)
The Parameters section of the Create Action Binding Editor should look like the
Click OK.
d. Add an InvokeAction to the Executables.
h. Save your work, and leave the page definition file open for the next step.
4. You have defined parameters that take their values from pageFlowScope variables. But
how do those values get stored in the pageFlowScope variables? In this step, you store
these values.
In the Category and Subcategory tables, convert the category name to a link that
stores the name and ID in pageFlowScope variables. Use a Set Action Listener
operation to store each variable value.
Hint: You must first add the category ID to the page bindings.
a. Add CategoryId to the page bindings for both BrowseCategory1 and
BrowseSubCategory1.
1) Still in the page definition file for ProductCatalog, edit the BrowseCategory1
binding and add CategoryId as a display attribute. Hint: Click the
BrowseCategory1 binding; click Edit; select the rule in the Tree Binding editor;
shuttle the CategoryId from Available to Display Attributes.
2) Repeat this step for BrowseSubCategory1 because you are going to use the
CategoryId that is selected in the SubCategories table to set the
subcategory-related parameters.
b. On the ProductCatalog page, convert the CategoryName field in the Categories
table to be a link. When a user clicks the link, the page should use setActionListeners
to set the pageFlowScope parameters.
1) Click the Design tab and in the Structure window for the ProductCatalog page,
and expand af:table - masterDetail1.
2) Expand the first af:column node, and then click af:outputText for
CategoryName and copy (Ctrl + C) the Value property (to keep its content before
losing it when converting the outputText to a Link).
a. Select the first af:table (masterDetail1) and, using the Expression Builder, set the
Rendered property so that the table appears if the param_CategoryId and the
param_SubCategoryId are both null. (This means that there were no parameters
set). The EL code is:
#{bindings.param_CategoryId eq null and
bindings.param_SubCategoryId eq null}
d. Select af:panelHeader and in the Text property, replace the existing text with:
#{bindings.param_CategoryId eq null ||
bindings.param_SubCategoryId eq null ?
storefrontuiBundle.CATEGORIES : storefrontuiBundle.PRODUCTS}
e. Move the command buttons on the page to a toolbar in the toolbar facet of the panel
header.
1) Expand Panel Header facets.
2) Drag a toolbar to the toolbar facet.
3) Drag the Search and Show Cart buttons to the toolbar.
4) The Structure should now look something like:
2. Set the second breadcrumb to appear only if the user has clicked a category name in the
Categories table. Label the breadcrumb with the Category name that the user clicked in the
Categories table. Set the second breadcrumb to display the Subcategory table when
a user clicks it.
a. Select the second of the three navigation items in the Structure window.
b. Set the Text property to #{bindings.param_CategoryName}. You can use
Expression Builder to set this (ADF Bindings > bindings > param_CategoryName).
c. Set the Rendered property to
#{bindings.param_CategoryId ne null}.
d. If a user clicks the second breadcrumb, he or she wants to see SubCategories. You
use the setActionListeners to reset just the SubCategory parameters.
Add two setActionListeners with the following properties:
From To
#{null} #{pageFlowScope.SubCategoryId}
#{null} #{pageFlowScope.SubCategoryName}
3. Set the third breadcrumb to appear only if the user has clicked a category name in the
SubCategories table. Label the breadcrumb with the Category name that the user clicked
in the SubCategories table. Set the third breadcrumb to display the Products table
when a user clicks it.
a. Select the last of the three navigation items in the Structure window.
b. Set the Text property to #{bindings.param_SubCategoryName}.
c. Set the Rendered property to:
#{bindings.param_CategoryId ne null and
bindings.param_SubCategoryId ne null}
d. The Structure should look like the following:
2. Add a method call to the shopping cart flow that calls the addItemToCart() method of
FODShoppingCartAM. Set the value of its productId argument to
#{pageFlowScope.ProductId}. Navigate to the ShoppingCart view when finished.
a. In the Data Controls panel, expand FODShoppingCartAMDataControl.
b. Drag addItemToCart(Number) to the shopping cart flow diagram.
c. In the Edit Action Binding dialog box, set the Value of the productId parameter to
#{pageFlowScope.ProductId}, and then click OK.
d. Add a Control Flow Case from addItemToCart to ShoppingCart and label it done.
(You can later change this to include a commit function, but for now you simply want to
go to the cart after the method call.)
e. In the addItemToCart method call, change the fixed-outcome property to done.
3. Add a router named ChooseAction as the default activity for the shopping cart flow. The
router should either display the shopping cart (display control flow case) or add an item
to it (add control flow case), depending on whether pageFlowScope.Action has a value
of Display or Add. The default action should be to display the cart.
a. Add a Router to the flow and name it ChooseAction.
b. Mark the ChooseAction router as the default activity for the page flow.
c. Create two Control Flow Cases from ChooseAction: one to addItemToCart named
add, and the other to ShoppingCart named display.
4. The shopping cart flow is expecting parameters named Action and optionally,
ProductId. Modify the shopping flow to send the correct parameters.
a. Open the ShoppingFlow diagram.
b. Select DisplayShoppingCart. Two parameters have been added to the
DisplayShoppingCart task flow call in the Parameters section of the Property
Inspector. Set a value for the Action parameter as follows:
Name Value
Action Display
ProductId Leave blank (or empty)
c. In the ShoppingFlow, the same two parameters have been added to the
AddShoppingCart task flow call; select AddShoppingCart and in the parameters
section, set the values as follows:
Name Value
d. Return to the Design of the page and add a setActionListener to the Add Item to
Cart button and set the value of From to #{bindings.ProductId.inputValue}
and the value of To #{requestScope.ProductId}.
Hint: Right-click af:commandButton, select Insert inside > ADF Faces > Set
Action Listener and set the From and To values. Make sure to put the correct
2. Add a method call to the ManageSupplierFlow task flow to call the CreateInsert operation
for a new supplier and connect it to the SupplierUpdate activity when finished.
a. Open the ManageSupplierFlow task flow.
b. In the Data Controls panel, expand FODSupplierAMDataControl > Supplier1 >
Operations and drag the CreateInsert operation to the task flow diagram to create a
method call activity.
c. Change fixed-outcome of the CreateInsert method call activity to done.
d. Drag a Control Flow Case from CreateInsert to SupplierUpdate. from-outcome
should default to done.
3. Set up the task flow so that a new supplier is created when a parameter passed to it has a
value of New, or that an existing supplier is updated when the parameter value is Update.
a. Add a Router to the flow and name it ChooseAction.
b. Right-click the ChooseAction router and mark the activity as the default activity for
the page flow.
c. Create two Control Flow Cases from ChooseAction: one to SupplierUpdate named
update, and the other to CreateInsert named new.
d. Add two expressions to the ChooseAction router that evaluate
pageFlowScope.SupplierAction. If the value is New, use the new outcome. If it is
Update, use the update outcome. Hint: The new expression is:
#{pageFlowScope.SupplierAction == 'New'}
Note: You define these expressions in the Cases section under the Common tab of
the Property Inspector.
4. The manage suppliers flow is expecting a parameter named SupplierAction. Modify the
show suppliers flow to send the correct parameter.
a. Open the ShowSuppliersFlow diagram.
SupplierAction #{requestScope.SupplierAction}
5. Set the requestScope variable SupplierAction. The calls to create a new supplier or
update an existing one should be placed on the BrowseSuppliers page.
a. Open the BrowseSuppliers page.
b. Add a toolbar to the panel headers toolbar facet.
c. Add a toolbar button to the toolbar and label it New Supplier. Set its Action to
update.
d. Add a setActionListener to the New Supplier button that sets the value of
#{requestScope.SupplierAction} to New when the button is clicked.
Set the From property to #{'New'} and the To property to
#{requestScope.SupplierAction}.
you have finished, close the browser and undeploy the application as described in step 6(i)
of Practice 2-4.
c. Use the Parameters section of the Property Inspector to create the following input
parameters:
Name Value
CategoryId #{pageFlowScope.CategoryId}
CategoryName #{pageFlowScope.CategoryName}
SubCategoryId #{pageFlowScope.SubCategoryId}
SubCategoryName #{pageFlowScope.SubCategoryName}
The Property Inspector should look like the following:
Note that this is just another way to set the pageFlowScope variables in the
ShoppingFlow task flow. The values are set either by clicking links on the
ProductCatalog page, as you defined in the previous set of practices, or they can be
set by receiving values via these input parameters on the task flow. After the values are
received, they have the same effect of setting the correct table to appear and setting
the breadcrumbs.
In the remaining practices in this lesson, you use a contextual event to pass values to
these parameters when a node in the category tree is clicked.
import java.util.Map;
import javax.el.ELContext;
import javax.el.Expression;
import javax.el.ExpressionFactory;
import javax.el.MethodExpression;
import javax.el.ValueExpression;
import javax.faces.context.FacesContext;
import oracle.adf.model.BindingContext;
import oracle.adf.model.DataControlFrame;
/**
* Provides various utility methods that are handy to
* have around when working with ADF.
*/
public class ADFUtil {
/**
* When a bounded task flow manages a transaction (marked as
* requires-transaction, requires-new-transaction, or
* requires- existing-transaction), then the task flow must
* issue any commits or rollbacks that are needed.
* This is essentially to keep the state of the transaction
* that the task flow understands in synch with the state
* of the transaction in the ADFbc layer.
* Use this method to issue a commit in the middle of a task
* flow while staying in the task flow.
Copyright 2010, Oracle and/or its affiliates. All rights reserved.
*/
public static void saveAndContinue() {
Map sessionMap =
FacesContext.getCurrentInstance().getExternalContext().getSessio
nMap();
BindingContext context =
(BindingContext)sessionMap.get(BindingContext.CONTEXT_ID);
String currentFrameName =
context.getCurrentDataControlFrame();
DataControlFrame dcFrame =
dcFrame.commit();
dcFrame.beginTransaction(null);
}
/**
* Programmatic evaluation of EL.
*
* @param el EL to evaluate
* @return Result of the evaluation
*/
public static Object evaluateEL(String el) {
FacesContext facesContext =
FacesContext.getCurrentInstance();
ELContext elContext = facesContext.getELContext();
ExpressionFactory expressionFactory =
facesContext.getApplication().getExpressionFactory();
ValueExpression exp =
expressionFactory.createValueExpression(elContext,
el, Object.class);
return exp.getValue(elContext);
}
/**
* Programmatic invocation of a method that an EL evaluates
* to. The method must not take any parameters.
*
* @param el EL of the method to invoke
* @return Object that the method returns
*/
public static Object invokeEL(String el) {
return invokeEL(el, new Class[0], new Object[0]);
}
/**
* Programmatic invocation of a method that an EL evaluates to.
*
* @param el EL of the method to invoke
* @param paramTypes Array of Class defining the types of the
* parameters
facesContext.getApplication().getExpressionFactory();
MethodExpression exp =
expressionFactory.createMethodExpression(elContext,
el, Object.class, paramTypes);
return exp.invoke(elContext, params);
}
/**
* Sets a value into an EL object. Provides similar
* functionality to
* the <af:setActionListener> tag, except the
* <code>from</code> is
* not an EL. You can get similar behavior by using the
* following...<br>
* <code>setEL(<b>to</b>, evaluateEL(<b>from</b>))</code>
*
* @param el EL object to assign a value
* @param val Value to assign
*/
public static void setEL(String el, Object val) {
FacesContext facesContext =
Copyright 2010, Oracle and/or its affiliates. All rights reserved.
FacesContext.getCurrentInstance();
ELContext elContext = facesContext.getELContext();
ExpressionFactory expressionFactory =
facesContext.getApplication().getExpressionFactory();
ValueExpression exp =
expressionFactory.createValueExpression(elContext,
el, Object.class);
exp.setValue(elContext, val);
}
}
public FODCategoryBean() {
super();
}
f. Generate accessors for these variables using either the toolbar button (on the
visual editor pane) or the menu Source > Generate Accessors. Click the select all
button. Click OK to generate the accessors.
2. Add a method named onNodeClicked() that returns a bean with values set based on the
values of the node that the user clicked: (You can copy it from onNodeClicked.txt in the
\files subdirectory of the Labs directory.)
/**
* Evaluates the currently selected node in the tree returns a
* bean representing that node.
*
* @return FODCategoryBean with all properties set
*/
public FODCategoryBean onNodeClicked() {
JUCtrlHierNodeBinding node =
(JUCtrlHierNodeBinding)ADFUtil.evaluateEL("#{node}");
Row nodeRow = node.getRow();
setCategoryId(categoryId);
setSubCategoryId(subCategoryId);
setCategoryName(categoryName);
setSubCategoryName(subCategoryName);
return this;
}
3. JDeveloper prompts you to import the supporting packages. Make sure that you have the
following imports statements:
oracle.jbo.Row;
oracle.jbo.domain.Number;
oracle.jbo.uicli.binding.JUCtrlHierNodeBinding;
oracle.storefront.ui.common.ADFUtil;
Important Note: If you are not prompted for the oracle.jbo.domain.Number
package, add it to the imports manually. Otherwise, the code will use the wrong Number
class and you will get errors when you call it.
d. Insert an event inside the event list and set the name property to
FODSelectCategory.
ADFUtil.setEL("#{requestScope.refreshLocalArea}",
Boolean.TRUE);
}
3. JDeveloper prompts you to import the supporting package. Import the following:
oracle.storefront.ui.common.ADFUtil;
4. As you did with the other bean, compile the class and create a data control from it. The
Data Control panel should now look like this:
2. Set region parameter values to the requestScope values that are set by the
refreshCategory() method in the FODShoppingDashboard bean.
a. Click the Parameters tab in the Property Inspector. Note that the task flow binding
parameters are listed.
b. Set the value property of the parameters to the following values.
Name Value
CategoryId #{requestScope.CategoryId}
CategoryName #{requestScope.CategoryName}
SubCategoryId #{requestScope.SubCategoryId}
SubCategoryName #{requestScope.SubCategoryName}
3. Run the page and test the functionality.
a. You should see that when you click a Category in the tree, ProductCatalog displays
the related SubCategories.
b. When you click a SubCategory, the page displays the related Products.
c. When you have finished, close the browser and undeploy the application as described
in step 6(i) of Practice 2-4.
4. Extra credit (if you have time): When you click a Category in the tree, you should notice
that the tree seems to be refreshed as well. Prevent that from happening so that only the
ProductCatalog region is refreshed.
e. Add a private String attribute named storedViewId to store the view ID by adding
the following on the line just after the first left brace:
private String storedViewId = null;
f. Modify the getPhaseId() method to return the PhaseId of whatever life-cycle phase
being executed with the following code:
public PhaseId getPhaseId() {
return PhaseId.ANY_PHASE;
}
g. Modify the afterPhase() method to store the view ID when the view is first restored:
public void afterPhase(PhaseEvent phaseEvent) {
if (phaseEvent.getPhaseId() == PhaseId.RESTORE_VIEW) {
storedViewId =
phaseEvent.getFacesContext().getViewRoot().getViewId();
}
}
h. Modify the beforePhase() method so that just before the page is rendered a
message appears if the current view ID is not the same as the stored view ID:
public void beforePhase(PhaseEvent phaseEvent) {
if (phaseEvent.getPhaseId() == PhaseId.RENDER_RESPONSE) {
String viewId =
phaseEvent.getFacesContext().getViewRoot().getViewId();
if (storedViewId != null &&
!viewId.equalsIgnoreCase(storedViewId)) {
System.out.println("Changing pages");
}
storedViewId = null;
3. Test the functionality by invoking the application and changing views. Because you have
only one view activity in the application, with all others being part of a region on the same
page, you must add another page to the application to test it.
a. Open adfc-config and add a view activity called Start.
b. Add a control flow case from Start to FODShoppingDashboard whose from-
outcome is start.
c. Create the Start.jspx page by double-clicking the Start view activity in the editor.
Select the Blank Page option.
Copyright 2010, Oracle and/or its affiliates. All rights reserved.
d. Add a button to the page labeled Start Shopping and set its Action to start.
e. Run the Start page from the adfc-config diagram.
f. When the page appears, switch back to JDeveloper, and right-click the JDeveloper log
and select Clear.
g. Switch back to your browser window and click Start Shopping. You should see the
message in the log, Changing pages.
h. When you have finished, close the browser and undeploy the application as described
in step 6(i) of Practice 2-4.
Name FODCommitDeleteBean
Class oracle.storefront.ui.bean.FODCommitDeleteBean
Scope request
Copyright 2010, Oracle and/or its affiliates. All rights reserved.
4. Complete the ShoppingCart page by adding buttons for Update, Delete, and Details; these
buttons should relate to the rows of the table. Add a panel collection around the table to
contain the buttons.
a. Open the ShoppingCart page fragment.
b. Surround the af:table with a Panel Collection.
page definition.
Action <default>
5. The method you added in the managed bean uses a commit binding and a delete binding.
When you added the commit button from the Data Control panel, JDeveloper added the
commit binding for you. Now manually add the delete binding to the page.
a. Click the Bindings tab in the editor of the ShoppingCart page fragment.
c. Remove the value from the Label attribute on the Input Text.
8. Test the functionality.
a. Run FODShoppingDashboard, add an item to the cart, update a quantity or two,
delete an item by using the Delete button (be sure to leave at least one item in the
cart), and so on. (The only button that you have not yet connected is the details
buttonyou do this next.)
When you update a quantity and click the Update button, you should notice that the
line item total also changes.
b. When you have finished, close the browser and undeploy the application as described
in step 6(i) of Practice 2-4.
9. Use a pop-up window to display the details of the item when a user clicks the Details
button.
b. When you have finished, close the browser and undeploy the application as described
in step 6(i) of Practice 2-4.
f. To improve the appearance of the buttons, return to the Design view, and change the
Width of the Panel Header to 500 Pixels.
g. To ensure that the table is refreshed after the record is removed, use the Edit option,
to set the Partial Triggers property on the table, to the ID of the Delete button.
3. Reexamine the files in the Application Resources panel. You can see that the Configure
ADF Security Wizard created a new file, jazn-data.xml.
4. If you look in the file system, you can compare the modified dates to see which files have
been changed.
a. Click the Enterprise Roles tab, and then click Add in the Roles panel.
b. In the Add Role dialog box, enter the Name manager.
c. Repeat steps a and b to add the other three roles; the roles appear in the Enterprise
Roles list along with the test-user role that the security configuration created.
4. To each application role, add its corresponding enterprise roles (for example, add
customer to fod_customer).
a. Select fod_manager in the Roles pane.
b. Click the Members tab and select the Add enterprise role from the Add button.
c. Select the manager role and click OK.
d. Repeat steps a, b, and c for each role you created.
d. By default, each selected role is assigned with the View Action. Keep this option
selected.
Note: When using Internet Explorer, you may receive an HTTP error instead of seeing
the error page.
2. Test authorization.
a. Click the browsers Back button.
b. On the login page, enter the username sking, a valid user who is not authorized to
use the shopping application. Enter the password welcome1, and then click Submit.
The FODShoppingDashboard page appears, but the shopping application is not
visible. You see data only when you click the Suppliers tab.
Note: If you encounter an error when you enter the login information after using the
Browsers Back button, rerun the application.
c. Click the Suppliers tab, and then click the SupplierId in one of the rows. The supplier
detail is shown.
d. When finished, close the browser and undeploy the application as described in step
6(i) of Practice 2-4.
e. Run the application again and enter credentials for DRAPHEAL, who has access to the
shopping application. The FODShoppingDashboard page should then appear with the
shopping application visible.
f. Click the Suppliers tab, and then click the SupplierId in one of the rows. You should
receive an error indicating that the authorization check failed, because DRAPHEAL does
not have access to the ManageSupplierFlow task flow.
Privileges Roles
Read fod_user
Update fod_clerk, fod_developer, fod_manager
Delete fod_clerk, fod_developer
b. In the JAAS Security login dialog box, enter DRAPHEAL as Principal and welcome1 as
Credentials, and then click OK.
b. Run the application again and log in as a user in one of the other roles, such as
sking. The button should appear now.
3. Although this works when you know the role that has access to the task flow, you do not
want to have to change the code if other roles are created or if grants for customers should
change. Set the button property so that the button does not appear for any user who does
not have permission to view the task flow.
a. Obtain the complete name of the task flow.
1) Open jazn-data.xml and click the Task Flows tab.
2) Click the Source tab at the bottom of the editor.
3) In the search field, enter ManageSupplier.
4) Copy (Ctrl + C) the entire task flow name (everything between the <name> and
</name> tags).
4. Ensure that the button appears if authentication security is not enabled. Instead of using a
global security expression, write a security proxy bean to check the security. Name the
bean FODSecurityBean.
a. Create a new Java class, accepting default values, named FODSecurityBean in the
oracle.storefront.ui.bean package with the following code: (You can copy the code
from SecurityBean.txt in the \files subdirectory.)
package oracle.storefront.ui.bean;
import oracle.adf.share.ADFContext;
return
(ADFContext.getCurrent().getSecurityContext().isAuthorizationEna
bled());
}
}
b. Register FODSecurityBean as a managed bean:
1) Open adfc-config.xml and click the Overview tab.
2) Click the Managed Beans tab.
3) In the Managed Beans section of the page, click Add .
4) Set the following properties:
Property Value
c. Test the functionality as before, making sure that the button appears for clerks,
managers, or developers, and that it does not appear for customers.
5. Run the application again to ensure that the button appears and that the shopping cart has
items. Notice that no login screen is required anymore.
You can probably see that security should be considered from the beginning, rather than
adding it at the end, so that the UI could be better designed to consider roles and their
access to task flows.
b. Use Ctrl-click to multiselect the Orders and Order_Items tables and drag them to the
diagram surface.
d. The two tables are depicted on your diagram. Notice that the table icon has two
compartments. The top compartment displays the column names and their data types,
and the bottom compartment displays information about primary and foreign keys. Your
2. Generate the DDL for adding the new table to the database, but do not actually add the
table.
a. Right-click the SHIPPERS table in the diagram, and from the context menu, select
Synchronize with Database > Generate To > SQL Script. (You can also choose to
generate to FOD, which brings up the same dialog box with different default options
that you can change.)
b. In the Generate SQL from Database Objects Wizard:
1) Click Back until you are on the Specify Source page.
2) On the Specify Source page, check the location of the objects to be generated (it
should be Source from project), and then click Next.
e. Click OK twice.
2. Create a deployment profile named myStorefront for the application, specifying that it
should contain the myStorefrontUI WAR file and the JAR file for the StorefrontModel
project.
a. Invoke the Application menu and select Application Properties.
Port 1521
Database User <your schema>, such as fod01
Name
Password fusion
f. On the next page of the wizard, click Test Configuration. If the test is successful, click
Next. (Do not click Finish.)
g. On the next page of the wizard, select the AdminServer check box as a target to
deploy the data source, and then click Finish. You should receive a message that the
changes are activated, and your new data source should be listed.
2. Configure the application modules to use the data source, rather than the JDBC URL
connection that you have been using.
3) Repeat steps 1 and 2 for all five application server data control usages.
e. The connection appears in the Application Server Navigator. Expand the myWLS and
deployments nodes so that you can see what is already deployed.
b. In the Application Server Navigator, click Refresh to see the myStorefront deployment.
e. Select the Install this deployment as an application option and click Next.
f. Select the Copy this application onto every target for me option and click Next.
g. Select the Yes, take me to the deployment's configuration screen option and click
Finish.
h. Review the configuration options, but do not change them. Click Save.
i. Click Deployments on the menu. You should see that the application is deployed.
3. Test the deployment as you did above.