Fusion Middleware Documentation
Advanced Search


Developing Fusion Web Applications with Oracle Application Development Framework
Close Window

Table of Contents

Show All | Collapse

2 Introduction to the ADF Sample Application

This chapter describes how to run the Summit sample applications for Oracle ADF. These samples exist to demonstrate the use of the Fusion web application technology stack to create transaction-based web applications. Details about the schema and features that implement the Summit sample applications for Oracle ADF are also provided.

Before examining the individual components and their source code in depth, you may find it helpful to install and become familiar with the functionality of the Summit sample applications for Oracle ADF. The demonstration application is used as an example throughout this guide to illustrate points and provide code samples.

This chapter includes the following sections:

2.1 About the Summit Sample Applications for Oracle ADF

The Summit sample applications for Oracle ADF are a set of applications developed with the purpose of demonstrating common use cases in Fusion web applications, including the integration between the components of the Oracle ADF technology stack (ADF Business Components, ADF Faces, ADF Data Visualization Tools (DVT), ADF Controller, and ADF Desktop Integration).

The sample applications are organized into several JDeveloper application workspaces that focus on particular features of the ADF component functionality. Each of the application workspaces uses the same underlying database schema. This approach makes it very easy to access the source code, and also to experience the runtime behavior of the samples in its workspace. Collectively, these sample applications cover the breadth of Oracle ADF functionality for Fusion web applications and are referred to as Summit sample applications for Oracle ADF. Chapters of this guide describe sample code drawn from these sample applications.

The core Summit ADF sample application, supported by the underlying Summit ADF schema, serves as a good introduction to Oracle ADF. It provides a runnable application based on a fictional customer management website and demonstrates many user interface design and database transaction features of Oracle ADF. For a detailed description of the core Summit ADF sample application and the features that it implements, see Section 2.3.2, "Taking a Look at the Sample Application in the SummitADF Workspace."

A more comprehensive introduction to Oracle ADF functionality is provided by the remaining Summit ADF sample applications, some of which are small standalone samples, while others are extensions of the core sample application. For a list of the Summit ADF sample application workspaces and a description of what functionality each sample provides, see Table 2-1.

In order to view and run any of the samples from its application workspace, you need to install Oracle JDeveloper Studio. You then need to download the ZIP archive files containing the Summit ADF schema and sample applications for this demonstration. Instructions to complete these tasks appear in this chapter. To begin, see Section 2.2, "Setting Up the Summit Sample Applications for Oracle ADF."

2.2 Setting Up the Summit Sample Applications for Oracle ADF

The Summit sample applications for Oracle ADF run using an Oracle database and JDeveloper. The platforms supported are the same as those supported by JDeveloper.

To prepare the environment and run the sample applications, you must download the required application resources. Included among those resources are ZIP archive files that contain the Summit ADF sample application workspaces.

Table 2-1 identifies the sample application archive files that are available for download on the Oracle Technology Network (OTN) website. You may choose to download all of the sample applications in a single archive file; or, when you want to focus on particular Oracle ADF technologies, you may select among the archive files to download just the desired samples.

Table 2-1 The Summit Sample Application Downloadable ZIP Archive Files

Downloadable Samples ZIP Archive Description

SummitADF1212.zip

Contains all the Summit sample applications for Oracle ADF in one convenient download file. It also contains the build file that you will need to install the Summit ADF schema on your database.

Note: When this ZIP file is expanded, you will have a separate application workspace for each of the sample applications listed below.

SummitADF_Schema1212.zip

Contains an application workspace that includes the build file needed to install the Summit ADF schema on your database. The Summit ADF schema is required to run any Summit ADF sample application. For complete details about installing the schema, see Section 2.2.2, "How to Install the Summit ADF Schema."

SummitADF_Core1212.zip

Contains an application workspace that includes the core Summit ADF sample application. This basic application consists of a web user interface and business service layer to demonstrate Oracle ADF technology in Fusion web applications. For a detailed description of this application, see Section 2.3.2, "Taking a Look at the Sample Application in the SummitADF Workspace."

SummitADF_TaskFlows1212.zip

Contains an application workspace that includes the Summit sample application for ADF task flows. This application builds on the core Summit ADF sample application by more fully utilizing ADF task flows to demonstrate ADF Security, contextual events, and task flows in Fusion web applications.

SummitADF_DVT1212.zip

Contains an application workspace that includes the Summit sample application for ADF DVT components. This application workspace consists of a set of standalone sample pages that demonstrate creation and configuration of ADF DVT components.

SummitADF_Examples1212.zip

Contains an application workspace that includes the Summit standalone sample applications for Oracle ADF. This application workspace consists of small sample applications that allow you to investigate Oracle ADF functionality that does not appear in any of the other sample applications.

SummitADF_DI1212.zip

Contains an application workspace that includes the Summit sample application for ADF Desktop Integration. This sample application builds on the core Summit sample application by more fully utilizing ADF Desktop Integration functionality.

Note: This sample is not described in this guide. For complete details about the Summit sample for ADF Desktop Integration, see "Introduction to the ADF Desktop Integration Sample Application" in Developing Applications with Oracle ADF Desktop Integration.


2.2.1 How to Download the Application Resources

The Summit sample applications for Oracle ADF require an existing Oracle database for its data. You run the sample applications using JDeveloper.

Do the following before installing the sample applications:

To download the application resources to prepare your environment:

  1. Install Oracle JDeveloper Release 12c, as described in Installing Oracle JDeveloper.

    You will need to install the Studio configuration of Oracle JDeveloper Release 12c to view the application's projects and run the application in Integrated WebLogic Server. You can download JDeveloper from:

    http://www.oracle.com/technetwork/developer-tools/jdev/overview/index.html
    

    Note:

    When you download and install JDeveloper, ensure that it is the Studio configuration, not the Java configuration. You can verify these details in JDeveloper from the Help > About menu option.

  2. Download the ZIP archive files for the desired Summit ADF sample application workspaces, as identified in Table 2-1. When you want to install all available samples, you can download the single archive file SummitADF1212.zip.

    Download the desired Summit ADF sample application archive files from the following web page on the Oracle Technology Network website.

    http://www.oracle.com/pls/topic/lookup?ctx=E26099_01&id=jdevcodesamples
    
  3. Install an Oracle database.

    The SQL scripts were written for an Oracle database, so you will need some version of an Oracle RDBMS, such as 11g, or Oracle Database Express Edition (Oracle Database XE). The scripts will not install into Oracle Database Lite. If you wish to use Oracle Database Lite or some other database, then you will need to modify the database scripts accordingly. You can download an Oracle database from:

    http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html
    

    Specifically, the small footprint of Oracle Database XE is ideally suited for setting up the database on your local machine. You can download it from:

    http://www.oracle.com/technetwork/database/express-edition/overview/index.html
    

2.2.2 How to Install the Summit ADF Schema

To install the Summit ADF schema, extract the schema files, configure the database connection, and execute the build_summit_schema.sql script in JDeveloper.

Before you begin:

It may be helpful to have an understanding of the schema that the Summit sample applications for Oracle ADF use. For more information, see Section 2.2.3, "What Happens When You Install the Summit ADF Schema."

You will need to complete these tasks:

To install the Summit ADF schema to your database:

  1. Navigate to the location where you downloaded the Summit ADF schema archive file and unzip it.

  2. Start JDeveloper and in the main menu, choose File and then Open.

  3. In the Open dialog, navigate to where you expanded the ZIP file for the SummitADF_Schema directory, select the Summit_Schema.jws application workspace and click Open.

    Note:

    If you downloaded the single archive file SummitADF1212.zip, the Summit_Schema.jws file is in the Schema folder. Double-click the Schema folder. Select Summit_Schema.jws and click Open.

  4. In the Applications window, expand the Application Resources panel.

  5. Right-click Connections and choose New Connection and then Database.

  6. In the Create Database Connection dialog, modify the properties shown in Table 2-2 for your environment. For help with the dialog, press F1 or click Help.

    Table 2-2 Properties Required to Install a Summit ADF Sample Application

    Property Description

    Connection Name

    Descriptive name for the connection. This name must be a valid Java identifier, such as system_for_summit.

    User Name

    The system user for your database. For example:

    system

    Password

    The password for the system user.

    Driver

    The JDBC driver for the database. Select a value from the dropdown menu. The default is thin, which is also the default value to specify for Oracle Database XE and any other Oracle database that is not using Oracle Call Interface (OCI).

    Host Name

    The name of the server running the Oracle database. Use an IP address or a host name that can be resolved by TCP/IP. The default value is localhost.

    SID

    The unique system identifier (SID) of an Oracle Database instance. The default is XE, which is also the default value to specify if your database server is running Oracle Database XE. If your server is running another Oracle database, the SID is typically ORCL.

    JDBC Port

    The port of your database. The default value is 1521.


    Note:

    If your server resides on a remote machine, you may also need to modify the script that builds the schema. To open the script, right-click build_summit_schema.sql and choose Open.

    Figure 2-1 shows the completed Create Database Connection dialog. In this example, the connection is made to an Oracle Database XE instance residing on a local machine.

    Figure 2-1 Create Database Connection Dialog for Summit ADF Schema

    Create Database Connection dialog for Summit schema
  7. Click Test Connection to verify that you have a working connection.

  8. Click OK to create the connection and exit the dialog.

  9. In the Applications window, in the Projects panel, expand Database and then Resources.

  10. Right-click build_summit_schema.sql and choose Run in Sql*Plus > connection name.

    The connection name displayed is the one you configured in Step 6.

  11. In the SQL*Plus Connection dialog, verify that the information matches the configuration you specified in Step 6 and click OK.

  12. In the SQL*Plus Location dialog, click Browse and locate the sqlplus.exe executable for your database.

    Typically, the executable is installed in the BIN directory under $ORACLE_HOME, where $ORACLE_HOME represents the path to your Oracle database installation.

  13. Click Open to select the sqlplus.exe executable and then OK to exit the dialog.

  14. In the SQL*Plus window, enter the password for the system user you specified in Step 6.

    Once you enter the password, the Ant build script creates the Summit ADF sample application users and populates the tables in the Summit ADF schema. In the Messages - Log window, you will see a series of SQL scripts and finally:

    Commit complete.
    
    Commit complete.
    SQL> 
    
  15. At the SQL prompt, enter quit to exit the SQL*Plus window.

  16. In JDeveloper, in the main menu, choose Application and then Close to close the Summit ADF schema application.

2.2.3 What Happens When You Install the Summit ADF Schema

Figure 2-2 shows a simplified representation of the schema for the Summit sample applications for Oracle ADF. The green shapes in the diagram represent the seven core tables. The other tables are shown as yellow shapes. Some of the tables use sequences, but only those used by the core tables are shown. To minimize the number of crossed lines, the schema is displayed in a bottom-to-top hierarchy.

Figure 2-2 Schema Diagram for the Summit Sample Applications for Oracle ADF

Schema diagram for the Summit application

The core tables represented by the green diagram elements include:

  • S_ITEM: For each order, there may be many order items recorded. This table stores the unit price and quantity of each order item. The order line item and its order ID uniquely identify each order item.

  • S_ORD: This table represents activity by specific customers. When an order is created, the date of the order, the total amount of the order, the ID of the customer who created it, and the name of the sales representative is recorded. After the order is fulfilled, the order status and order shipped date are updated. All orders are uniquely identified by a sequence-assigned ID.

  • S_CUSTOMER: This table stores the name and address of all Summit customers. Each customer is uniquely identified by a sequence-assigned ID. The table also includes a foreign key that associates each customer with a Summit sales representative.

  • S_EMP: This table stores all the employees who interact with the system. The first name, last name, email address, and address details of each user is stored. A user is uniquely identified by an ID. Other IDs provide foreign keys to tables with title and department information, and, in the case of the employee's manager, a self-referential association.

  • S_PRODUCT: This table stores all of the products available in the store. For each product, the name and suggested wholesale price are recorded. All products are uniquely identified by a sequence-assigned ID. The image of the product and its description are stored in separate tables, which each reference the product ID.

  • S_WAREHOUSE: This table stores the location and manager of each warehouse that carries stock for the Summit products. For each warehouse, the location and manager are recorded. The warehouses are uniquely identified by a sequence-assigned ID.

  • S_INVENTORY: This table stores inventory data for the Summit products. For each product, the amount in stock, reorder point, and maximum stock levels are recorded for each warehouse that carries the product.

The sequences that the core tables use include:

  • S_ITEM_ID: Populates the ID for each new order item.

  • S_ORD_ID: Populates the ID for each new order.

  • S_CUSTOMER_ID: Populates the ID for for each new customer.

  • S_EMP_ID: Populates the ID for each new employee.

  • S_PRODUCT_ID: Populates the ID for each new product.

2.2.4 How to Create the Database Connection for Summit Sample Applications for Oracle ADF

The Summit sample applications for Oracle ADF require a connection to the Summit database for data access. By default, each application is configured to use a local connection to an Oracle database that you must verify and modify as needed for your environment. The steps to modify a database connection for any of the Summit sample applications for Oracle ADF are the same for all workspaces and are performed after you have opened the application in JDeveloper.

Before you begin:

It may be helpful to have an understanding of the Summit ADF schema. For more information, see Section 2.2.3, "What Happens When You Install the Summit ADF Schema."

You will need to complete these tasks:

To create the database connection for Summit sample applications for Oracle ADF:

  1. In the Applications window, expand the Application Resources panel.

  2. In the Application Resources panel, expand Connection and then Database.

    The existing database connection is displayed. For the core Summit ADF application, the database connection is summit_adf.

  3. Right-click the database connection and choose Properties.

    For example, right-click summit_adf and choose Properties.

  4. In the Edit Database Connection dialog, modify the properties shown in Table 2-3 for your environment. For help with the dialog, press F1 or click Help.

    Table 2-3 Properties to Create a Database Connection for a Summit ADF Sample Application

    Property Description

    User Name

    The user name for the Summit ADF sample database. You must use summit_adf for this property.

    Password

    The password for the Summit ADF sample database. You must use summit_adf for this value.

    Driver

    The JDBC driver for the database. Select a value from the dropdown menu. The default is thin, which is also the default value to specify for Oracle Database XE instances and any other Oracle database that is not using Oracle Call Interface (OCI).

    Host Name

    The host name for your database. For example:

    localhost

    JDBC Port

    The port for your database. For example:

    1521

    SID

    The unique system identifier (SID) of an Oracle Database instance. The default is XE, which is also the default value to specify if your database server is running Oracle Database XE. If your server is running another Oracle database, the SID is typically ORCL.


    Figure 2-3 shows the completed Edit Database Connection dialog. In this example, the connection is made to an Oracle Database XE instance residing on a local machine.

    Figure 2-3 Edit Database Connection Dialog for a Summit ADF Sample Application

    Edit Database Connection dialog for Summit ADF samples
  5. Click Test Connection to verify that you have a working connection.

  6. Click OK to create the connection and exit the dialog.

  7. In the Applications window, in the Projects panel, right-click Model and choose Rebuild Model.jpr.

2.3 Running the Core Summit ADF Sample Application in the SummitADF Workspace

In the core Summit ADF sample application, sporting goods equipment is sold to international customers by a fictional sporting goods supplier called Summit Management. Employees of Summit Management can visit the website, and manage customer orders by fulfilling orders for products while monitoring the status of product inventory. The functionality in this core sample application has been intentionally restricted to demonstrate a limited number of potential Fusion web application use cases that are suitable for anyone new to Oracle ADF technology.

The core Summit ADF sample application consist of a web user interface and a business service layer. Specifically, the following projects are part of the core Summit ADF sample application:

  • Model: Provides access to the customer management data and provides transaction support to update data for customer information and orders.

  • ViewController: Provides the JSF web page and JSFF page fragments that the Summit user interacts with to browse the customers list, place orders, view order details, check order status, and inspect product inventory.

2.3.1 How to Run the Core Summit ADF Sample Application

You run the core Summit ADF sample application in JDeveloper by running the index.jspx page in the ViewController project. The ViewController project uses JavaServer Faces (JSF) as the view technology, and relies on the ADF Model layer to interact with ADF Business Components in the Model project. To learn more about the core Summit ADF sample application and to understand its implementation details, see Section 2.3.2, "Taking a Look at the Sample Application in the SummitADF Workspace."

Before you begin:

It may be helpful to have an understanding of the Summit ADF schema. For more information, see Section 2.2.3, "What Happens When You Install the Summit ADF Schema."

You will need to complete these tasks:

To run the sample application in the SummitADF application workspace:

  1. Open the application in JDeveloper:

    1. In the main menu, choose File and then Open.

    2. Navigate to the location where you expanded the ZIP file for the SummitADF directory, select the SummitADF.jws application workspace and click Open.

      Figure 2-4 shows the Applications window after you open the file for the SummitADF.jws application workspace file in JDeveloper. For a description of each of the projects in the workspace, see Section 2.3.2, "Taking a Look at the Sample Application in the SummitADF Workspace."

      Figure 2-4 Projects in the SummitADF Application Workspace

      Summit ADF sample application project folders
  2. Create a connection to the Summit database. For details, see Section 2.2.4, "How to Create the Database Connection for Summit Sample Applications for Oracle ADF."

  3. In the Applications window, expand ViewController, right-click index.jsf and choose Run.

    The Configure Default Domain dialog appears the first time you run the application and start a new domain in Integrated WebLogic Server. Use the dialog to define an administrator password for the new domain. Passwords you enter can be eight characters or more and must have a numeric character.

    The index.jspx page within the ViewController project is the run target. When you run the page, JDeveloper will launch the browser and display the Summit Management web page of the core Summit ADF sample application.

Once the Summit Management web page appears, you can browse the website. Note that the core Summit ADF sample application does not implement security for the Oracle ADF application resources and login in not required.

2.3.2 Taking a Look at the Sample Application in the SummitADF Workspace

Once you have opened the projects in JDeveloper, you can then begin to review the artifacts within each project. The development environment for the core Summit ADF sample application is divided into two projects: the Model project and the ViewController project.

The Model project contains the classes that allow the product data to be displayed in the web application. Figure 2-5 shows the Model project and its associated directories.

Figure 2-5 The ADF Model Project of the SummitADF Workspace

Summit ADF sample data model project

The ViewController project contains the following folders:

  • Application Sources: Contains the files used to access the product data. Included are the metadata files used by Oracle ADF to bind the data to the view.

  • META-INF: Contains a file used in deployment.

The ViewController project contains the files for the web interface, including the backing beans, deployment files, and JSF and JSFF files. Figure 2-6 shows the ViewController project and its associated folders.

Figure 2-6 The ViewController Project of the SummitADF Workspace

Summit ADF sample user interface project

The ViewController project contains the following directories:

  • Application Sources: Contains the code used by the web client, including the managed and backing beans, property files used for internationalization, and the metadata used by Oracle ADF to display bound data.

  • Web Content: Contains the web files, including the JSP files, images, skin files, deployment descriptors, and libraries.

2.3.2.1 Browsing the Application

Start the core Summit ADF sample application by running the index.jspx page in the ViewController project. For details about running the application using the default target, index.jsf, see Section 2.3, "Running the Core Summit ADF Sample Application in the SummitADF Workspace."

The index.jsf page is organized by an ADF page template which provides the structure for the page and contains uses an af:panelTabbed component to identify the page fragments to display in each of the tab panels.

When you enter the Summit ADF website, the site opens on the index page with three tabs displayed: Welcome, Summit Management, and Inventory Control. Click on each tab to view the separate page fragments referenced as regions by the index page.

The Summit Management region is the main region where you can browse the list of customers and their orders. This regions is defined by the customers.jsff page fragment and is itself organized by ADF Faces components that provide tabbed panels. The Browse and Search panels are one af:panelTabbed component and the Customer, Order, and Order Dashboard panels belong to another af:panelTabbed component.

Figure 2-7 shows the index page with an order displayed in the Summit Management region.

Figure 2-7 Index Page with Multiple Regions

Summit ADF sample main page

Where to Find Implementation Details

Following are the sections of Developing Fusion Web Applications with Oracle Application Development Framework that describe how to create a databound web page:

  • Providing the structure for the web page

    The index page separates features of the site into regions that are implemented using a combination of ADF Faces templates and JavaServer Faces (JSF) page fragments. ADF Faces templates and the fragments allow you to add ADF databound components. For information about the steps you perform before adding databound user interface components to a web page, see Section 26.1, "About Developing a Web Application with ADF Faces."

  • Displaying data in a web page

    To support data binding, the featured items on the tabbed Customers page fragment of the Summit Management region use EL (Expression Language) expressions to reference ADF data control usages in the declarative ADF page definition file. The page definition file, which JDeveloper creates for you when you work with the Data Controls panel to drag and drop databound ADF Faces components, is unique to each web page or page fragment. The ADF data control usages enable queries to the database and ultimately works with the JSF runtime to render the databound ADF Faces components, such as the ADF Faces image component used to display customer details such as their name and phone number from the S_CUSTOMER table. For information about creating a databound web page that references the ADF page definition file, see Section 28.1, "About Creating a Basic Databound Page."

  • Designing the user interface using a variety of components

    JDeveloper allows you to create databound components declaratively for your JSF pages, meaning you can design most aspects of your pages without needing to look at the code. By dragging and dropping items from the Data Controls panel, JDeveloper declaratively binds ADF Faces UI components and ADF Data Visualization graph components to attributes on a data control using an ADF binding. For more information, see Section 35.1, "About ADF Data Visualization Graph and Gauge Components."

  • Managing entry points to the application

    The page fragments of the index page are supported by individual ADF task flows. In general, the Fusion web application relies on this ADF Controller feature to define entry points to the application. When your application uses more than one page, you define an unbounded task flow to control the entry point of the application. JDeveloper helps you to create task flows with visual design elements that you drag and drop from the Components window. For more information about specifying the entry points to the application using an ADF unbounded task flows, see Section 20.1, "About ADF Task Flows."

2.3.2.1.1 Browsing the Customers List

To view the list of customers, click the Browse tab and in the Customers tree, expand a country node to view the list of customers for that country. The customers list is layed out with collapsing nodes organized by an ADF Faces af:tree component. The dropdown menu on the tree component lets you choose to organize the branches by country or by sale representative. The nodes of the tree display data from the database corresponding to the name and ID of each customer.

Figure 2-8 shows the tree expanded with a customer node selection.

Figure 2-8 Databound Tree Component Displays Customer Names and ID

Summit Customer tree with one node expanded

Where to Find Implementation Details

Following are the sections of Developing Fusion Web Applications with Oracle Application Development Framework that describe how to develop the components used to support browsing product details:

  • Triggering an action to display data

    To display data from the data model, user interface components in the web page are bound to ADF Model layer binding objects using JSF Expression Language (EL) expressions. For example, when the user expands a country node in the Customers tree to display the list of customers for that country, the JSF runtime evaluates the EL expression for the UI component and pulls the value from the ADF Model layer. At design time, when you work with the Data Controls panel to drag an attribute for an item of a data collection into you web page, and then choose an ADF Faces component to display the value, JDeveloper creates all the necessary JSF tag and binding code needed to display and update the associated data. For more information about the Data Controls panel and the declarative binding experience, see Section 17.1, "About Using ADF Model in a Fusion Web Application."

2.3.2.1.2 Searching for Customers

To search the customer list, click the Search tab in the Summit Management region. When you click the tab, the Browse panel changes to allow you to enter a search criteria in the query search form and view the search results in the table below. The layout of the search panel is defined by an ADF Faces af:query component.

You use the input fields on the Search form to perform a simple keyword search against the attributes common to all customers, such as customer names or cities. For example, you might query the database for the list of customers that begin with a particular letter.

Figure 2-9 shows the search results returned for the customers residing in a city that begins with "S".

Figure 2-9 Query Search Component Filters Customer List

Summit search form with results

Where to Find Implementation Details

Following are the sections of Developing Fusion Web Applications with Oracle Application Development Framework that describe how to define queries and create query search forms:

  • Defining the query for the search form to display

    A query is associated with an ADF Business Components view object that you create for the data model project to define a particular query against the database. In particular, a query component is the visual representation of the view criteria defined on that view object. If there are multiple view criteria defined, each of the view criteria can be selected from the Saved Search dropdown list. These saved searches are created at design time by the developer. When the query associated with that view object is executed, both view criteria are available for selection. For more information, see Section 33.1, "About Creating Search Forms."

  • Creating a search form

    You create a query search form by dropping a named view criteria item from the Data Controls panel onto a page. You have a choice of dropping only a search panel, dropping a search panel with a results table, or dropping a search panel with a tree table. For more information, see Section 33.2, "Creating Query Search Forms."

  • Displaying the results of a query search

    Normally, you would drop a query search panel with the results table or tree table. JDeveloper will automatically wire up the results table or tree table with the query panel. If you drop a query panel by itself and want a separate results component, you can set the query component's resultComponentId attribute to the relative expression of the results component. For more information, see Section 33.2.3, "How to Create a Query Search Form and Add a Results Component Later."

2.3.2.1.3 Viewing Customer Details

To begin browsing the orders for a customer, click the Summit Management tab and make a selection in the expanded Customers tree from the Browse tab or Search tab. This action changes the details displayed in the Summit Customer Management tab to display details about the selected customer.

In the Customer details tab you can collapse and expand the panels to view various details of the selected customer. The first three panels display input forms consisting of individual input fields corresponding to the customer details. The customer you select also has one or more orders displayed in the Orders panel as a table, where each row comprises a single order and its details.

This relationship between a customer and their orders represents a business object relationship known as master and detail. In this case, the master, or parent object, can have many detail rows, or child objects. In turn the business objects in the core Summit ADF sample application, correspond to the S_CUSTOMER and S_ORD tables in the database.

The table of orders is defined by an ADF Faces af:table component. You can sort the table rows by clicking the sort buttons in any cell of the table header.

Figure 2-10 shows the customers page fragment with the details of the customer displayed in the top portion and the list of orders specific to the customer in the bottom portion.

Figure 2-10 Customers Page Fragment with Orders List

Summit Customer detail page fragment

Where to Find Implementation Details

Following are the sections of Developing Fusion Web Applications with Oracle Application Development Framework that describe how to use tables and forms to display master-detail related objects:

  • Dragging and dropping master and detail components

    You can create pages that display master-detail data using the Data Controls panel. The Data Controls panel displays master-detail related objects in a hierarchy that mirrors the one you defined in the data model for the ADF application module, where the detail objects are children of the master objects. All you have to do is drop the collections on the page and choose the type of component you want to use. For example, in the core Summit ADF sample application, the page fragment customers.jsff displays the master list of customer categories in an af:tree component and displays the detail list of orders in an af:table component. For more information about the data model, see Section 17.3, "Exposing Application Modules with ADF Data Controls." For more information about various types of pages that display master-detail related data, see Section 31.1, "About Displaying Master-Detail Data."

  • Sorting data that displays in tables

    When you create an ADF Faces table component you bind the table to the complete collection or to a range of data objects from the collection. The specific components that display the data in the columns are then bound to the attributes of the collection. The iterator binding handles displaying the correct data for each object, while the table component handles displaying each object in a row. You can set the Sort property for any column when you want the iterator to perform an order-by query to determine the order. You can also specify an ORDER BY clause for the query that the view object in the data model project defines. For more information about binding table components to a collection, see Section 29.1, "About Creating ADF Databound Tables." For more information about creating queries that sort data in the data model, see Section 5.2, "Populating View Object Rows from a Single Database Table."

2.3.2.1.4 Viewing Order Details

To update the details of an existing order, select an order from the Orders table displayed in the Customer tab and click the Order tab. The Order tab displays the same data that appeared in the row you selected, but organized as an edit form with fields that you can update. To change the order status, for example, you can select a choice from the OrderFilled radio button. The selection you make on the ADF Faces af:selectOneRadio component updates the corresponding S_ORD table column.

Figure 2-11 shows the Order page fragment with Order 1075 selected in the Customer details tab. Data for Order 1075 in both the order form and the Customer details tab are coordinated by the application to reflect changes in the database. Change the status of OrderFilled to Yes, and return to the Customer details tab to verify that the status is consistent.

Figure 2-11 Orders Page Fragment Displays Order Details

Summit Orders detail page fragment

Other types of data, such as dates and currency, can be displayed using ADF Faces components to handle formatting of the values. Figure 2-12 shows the Order page fragment with a system error that enforces date formats that have been defined on the attribute underlying the Date Shipped field.

Figure 2-12 Orders Page Fragment Displays Format Mask Error

Summit Orders detail page fragment with format error

Validation rules based on Groovy calculated expressions can be defined on data updates. Figure 2-13 shows the Order page fragment with a validation error that calculates the customer's credit score before allowing a Payment Type of CREDIT to be selected.

Figure 2-13 Orders Page Fragment Displays Payment Type Validation Error

Summit Orders detail page fragment with validation error

Where to Find Implementation Details

Following are the sections of Developing Fusion Web Applications with Oracle Application Development Framework that describe how to create edit forms:

  • Creating a databound edit form

    When you want to create a basic form that collects values from the user, instead of having to drop individual attributes, JDeveloper allows you to drop all attributes for an object at once as an input form. You can create forms that display values, forms that allow users to edit values, and forms that collect values. For example, in the core Summit ADF sample application, the page fragment Orders.jsff displays a form to display order information. For more information, see Section 28.6, "Creating a Form to Edit an Existing Record."

  • Requiring values to complete a form

    The input form displays attributes of a data collection that you drop from the Data Controls panel. You can set the required property of individual components in the form to control whether an attribute value is mandatory. For details about how to customize the required property, see Section 28.2, "Creating Text Fields Using Data Control Attributes." Alternatively, you can set a display control hint property directly on the attribute where it is defined by an ADF Business Components entity object. The entity object is a data model component that represents a row from a specific table in the database and that simplifies modifying its associated attributes. For details about using control hints to make an attribute mandatory, see Section 4.10, "Setting Attribute Properties."

  • Defining a list of values for selection lists

    Input forms displayed in the user interface can utilize databound ADF Faces selection components to display a list of values (LOV) for individual attributes of the data collection. To facilitate this common design task, ADF Business Components provides declarative support to specify the LOV usage for attributes in the data model project. For example, in the core Summit ADF sample application, the af:selectOneChoice component for the payment type field displayed in the page fragment Orders.jsff is bound to an LOV-enabled attribute configured for the OrdVO view object. For more information about configuring attributes for LOV usage, see Section 5.12, "Working with List of Values (LOV) in View Object Attributes."

  • Defining format masks for forms

    Format masks help ensure the user supplies attribute values in the required format. To facilitate this task, ADF Business Components provides declarative support known as control hints for attributes in the data model project. For example, in the core Summit ADF sample application, the attribute for the OrdVO view object used to specify the date shipped is configured with a format mask hint and enforced in the page fragment Orders.jsff. For information on defining format masks for input form components, see Section 5.13, "Defining UI Hints for View Objects."

  • Defining validation rules for data updates

    Validation rules help ensure the user supplies attribute values that meet particular business needs. To facilitate this task, ADF Business Components provides declarative validation for attributes in the data model project. For example, in the core Summit ADF sample application, the attribute for the OrdEO entity object used to specify the payment type is configured with a validation rule and enforced in the page fragment Orders.jsff. For information on defining validation rules for attributes of entity objects and view objects, see Chapter 11, "Defining Validation and Business Rules Declaratively."

2.3.2.2 The Ordering Process

Creating a new customer order requires a database transaction that involves updating the records of the customer's order while decreasing the quantity of products remaining in the Summit inventory. When you click New on Customer page above the list of orders, the site creates a new order form with only the date displayed.

Figure 2-14 shows the new order form with no products added.

Figure 2-14 Order Page Fragment Displays New Empty Order

FOD shopping cart summary

To create the order, click New above the empty list of products. Then, next to the ProductId field, click the Search icon. The af:inputListOfValues component launches the popup window that you can use to search the database for the product. To make searching easier, the popup window displays a limited number of fields from the S_PRODUCT table, including product ID and product Name. This type of filtering for display at runtime is performed by the ADF data binding that backs the databound af:inputListOfValues component.

Select a product in the popup window and click OK. The Order tab updates to display the selection in the product table.

Figure 2-15 shows the Order tab with an order comprising a single product.

Figure 2-15 Order Page Fragment DIsplays Order Entry

FOD order details view

To complete the order enter the ID of a sales representative and then click the Commit button in the top right corner of the Summit Customer Management page. This updates the database with the new order detail and reduced product inventory.

To visualize the customer's order history, click the Orders Dashboard tab. The dashboard displays various graphs using ADF Faces DVT components. The Shipping Time graph is an dvt:barGraph component. This component relies on information that is calculated only when the order ship date is updated; the data to display is not obtained from a database table since it must be determined at runtime. To display the Shipping Time data the bar graph relies on an ADF Business Components method call to return the number of days for shipping for each order.

Figure 2-16 shows dashboard information for three orders made by the Acme Sporting Goods company.

Figure 2-16 Order Page Fragment Displays Dashboard Details

FOD payment details dialog

To visualize how orders affect the product inventory, click the Inventory Control tab, next to the Summit Management tab. The Inventory Control page displays only those products that are below the reorder threshold. The low stock is displayed both visually with the af:carousel component and in table format with the af:table component. Select an item from the low stock carousel and notice that the table updates to make the selected item the current row. The current row in a table is the one that is highlighted. These two components are synchronized through the ADF data binding layer with a Java method call that is executed when the carousel selection is made.

Figure 2-17 shows the inventory status of item 13 out of 26. The current row selection in the low stock table reflects the selection displayed in the inventory carousel.

Figure 2-17 Inventory Control Page Fragment Displays Low Stock Items

FOD payment details with date mask

Where to Find Implementation Details

Following are the sections of Developing Fusion Web Applications with Oracle Application Development Framework that describe how to develop database forms like the ones used to update the database in the Orders and Inventory Control page fragments:

  • Triggering data updates with command components

    To support data updating, the Orders page fragment of the Summit Management region uses command components represented as af:button components to allow users to execute specific ADF data control operations in the declarative ADF page definition file. The built operations of the ADF data control enable you to declaratively handle common form functions such as navigating between records and committing changes to a database. Most operations are available for individual data collections in a data control. The Commit and Rollback operations are available on the whole data control. By dragging and dropping an operation from the Data Controls panel, you are prompted to choose what kind of command component to create, such as a button or a link. For information about triggering built-in operations, see Section 28.4, "Creating Command Components Using Data Control Operations."

  • Triggering backing bean method calls with command components

    To support operations that may require custom logic to handle an interaction with the database, the InventoryControl page fragment of the Summit Management region uses the carouselSpinListener on the af:carousel components to trigger a custom method handleCarouselSpin() defined on the backing bean InventoryControl.java. When you select an item in the carousel, the action listener triggers the backing bean method which updates the current row for the af:table component iterator binding. For details about executing Java code in backing beans, see Section 34.3.1, "How to Create a Databound Carousel Component."

  • Keeping track of transient session information and triggering business component method calls

    When you create a data model project that maps attributes to columns in an underlying table, your ADF view objects can include transient attributes that display calculated values (for example, using Java or Groovy expressions) or that are value holders. For example, in the core Summit ADF sample application, the Orders Dashboard tab on the page fragment Orders.jsff displays the value of the TimeToShip attribute calculated by the expression defined on the OrdVO view object. The calculateTimeToShip expression invokes a method on the OrdVORowImpl.java client interface for the view row. For more information about defining transient attributes in the data model project, see Section 4.11, "Adding Transient and Calculated Attributes to an Entity Object." For more information about implementing custom Java methods in view objects, see Section 13.9.3, "How to Generate Client Interfaces for View Objects and View Rows."

2.4 Running the Standalone Samples from the SummitADF_Examples Workspace

The Summit standalone sample applications for Oracle ADF include a set of sample packages that allow you to investigate Oracle ADF functionality that does not appear in the SummitADF workspace. Collectively, these sample packages are referred to as Summit ADF standalone sample applications. The standalone applications appear in the Model project of the SummitADF_Examples application workspace, located in the SummitADF_Examples folder where you extracted the Summit ADF standalone sample applications ZIP file.

In general, the standalone applications demonstrate concepts of ADF Business Components and data model projects. References to these standalone applications appear throughout the chapters contained in Part II, "Building Your Business Services" of this developer's guide. As you read sections this guide, you may want to run the corresponding standalone applications to investigate the concepts further. For a brief description of each standalone application and links to the documentation, refer to the table in Section 2.4.2.

2.4.1 How to Run the Summit ADF Standalone Sample Applications

The approach you use in JDeveloper to run a standalone application depends on the individual package. Some packages are set up to use the interactive testing tool JDeveloper provides for the ADF Business Components data model project (this tool is known as the Oracle ADF Model Tester). Other applications provide Java test clients (with file names like TestClientAaa.java) that use the ADF Business Components API to execute queries and display results. In the case of the Oracle ADF Model Tester, you work entirely within the tool, which essentially provides a convenient user interface for interacting with business components. In the case of the Java clients, the program files output their results and print statements to the JDeveloper Log window.

2.4.1.1 How to Run the Standalone Sample Applications From a Java Test Client

When the standalone application has a test client to programmatically exercise the ADF Business Components API, you will use the test client to run the applications.

Before you begin:

It may be helpful to have an understanding of individual Summit ADF standalone sample applications. For more information, see Section 2.4.2.

You will need to complete these tasks:

To run a standalone application from its provided test client:

  1. Open the application in JDeveloper:

    1. In the main menu, choose File and then Open.

    2. Navigate to the location where you expanded the ZIP file for the SummitADF_Examples directory, select the SummitADF_Examples.jws application workspace and then click Open.

  2. Create a database connection for the standalone applications. For details, see Section 2.2.4, "How to Create the Database Connection for Summit Sample Applications for Oracle ADF."

  3. Run the SQL script in JDeveloper for standalone samples that require it. Some of the standalone applications work with a modified version of the Summit ADF schema. For standalone applications that require schema changes, the application's project contains a SQL script that you must run in JDeveloper. Once you are through running a standalone application, you can use the script to back out the schema changes

  4. In the Applications window, expand the project node and locate the test client (.java) file node. In some cases, the test client is added to a package located under the Application Sources node. In other cases, the Resources node contains the test client.

    For example, Figure 2-18 shows the expanded inMemoryOperations node with the Java file node TestClientRowMatch.java selected.

    Figure 2-18 Test Client Selected in Applications Window

    Selected test client in data model project
  5. Right-click the test client and choose Run.

    For the names and location of the test clients provided with the standalone applications, see the table in Section 2.4.2.

    The Configure Default Domain dialog appears the first time you run an executable and start a new domain in Integrated WebLogic Server. Use the dialog to define an administrator password for the new domain. Passwords you enter must be eight characters or more and have a numeric character.

  6. Examine the JDeveloper Log window for the test client's output.

    Refer to the referenced documentation for details about the expected results.

2.4.1.2 How to Run the Standalone Applications Without a Test Client

When the standalone application does not provide a test client to programmatically exercise the ADF Business Components API, you will use the interactive testing tool, known as the Oracle ADF Model Tester.

Before you begin:

It may be helpful to have an understanding of individual Summit ADF standalone sample applications. For more information, see Section 2.4.2.

It also may be helpful to have an understanding of the Oracle ADF Model Tester. For more information, see Section 8.3, "Testing View Object Instances Using the Oracle ADF Model Tester."

You will need to complete these tasks:

To run a standalone application in the Oracle ADF Model Tester:

  1. Open the application in JDeveloper:

    1. In the main menu, choose File and then Open.

    2. Navigate to the location where you expanded the ZIP file for the SummitADF_Examples directory, select the SummitADF_Examples.jws application workspace file and then click Open.

  2. Create a database connection for the standalone applications. For details, see Section 2.2.4, "How to Create the Database Connection for Summit Sample Applications for Oracle ADF."

  3. Run the SQL script in JDeveloper for standalone samples that require it. Some of the standalone applications work with a modified version of the Summit ADF schema. For standalone applications that require schema changes, the application's project contains a SQL script that you must run in JDeveloper. Once you are through running a standalone application, you can use the script to back out the schema changes

  4. In the Applications window, expand the project node and locate the application module in a package under the Application Sources node.

    For example, Figure 2-19 shows the expanded controlpostorder project with the application module AppModule selected and a tooltip for the node displayed.

    Figure 2-19 Application Module Node Selected in Applications Window

    Selected application module in data model project
  5. Right-click the application module node and choose Run.

    For the names of the runnable application modules, see the table in Section 2.4.2.

    The Configure Default Domain dialog displays the first time you run an executable and start a new domain in Integrated WebLogic Server. Use the dialog to define an administrator password for the new domain. Passwords you enter must be eight characters or more and have a numeric character.

  6. Use the Oracle ADF Model Tester to interact with the view instances of the standalone application.

    Refer to the referenced documentation for details about the application. For details about using the tester to interact with the data model, see Section 8.3, "Testing View Object Instances Using the Oracle ADF Model Tester."

2.4.2 Overview of the Summit ADF Standalone Sample Applications

Some of the standalone applications in the SummitADF_Examples application workspace use programmatic test clients to demonstrate concepts related to the ADF Business Components framework. Others demonstrate framework functionality when you run the application in the Oracle ADF Model Tester.

Figure 2-20 shows the Applications window after you open the SummitADF_Examples application workspace.

Figure 2-20 Standalone Applications in the SummitADF_Examples Workspace

Summit ADF standalone samples project folders

Note that the test clients for the standalone applications provide a good starting point for understanding how to exercise methods of the ADF Business Components API. They also make good samples for test clients that you may want to create to test business component queries in a data model project. For background on working with test clients, see Section 8.4, "Testing View Object Instances Programmatically."

Note:

The ADF Business Components API is available when you need to generate custom classes to augment the default runtime behavior of the business components. For background about the ADF Business Components framework, see Chapter 3, "Getting Started with ADF Business Components."

Table 2-4 describes the standalone applications in the SummitADF_Examples application workspace. Examples from these applications appear throughout the chapters contained in Part II, "Building Your Business Services" of this guide.

Table 2-4 Standalone Applications in the SummitADF_Examples Application Workspace

Package Name Runnable Class or Project Target Documentation

amservice

Run ServiceAppModule using the Oracle ADF Model Tester.

For information about the application module service interface, see Section 15.2, "Publishing Service-Enabled Application Modules."

appmodule

Run TestAM.java under the service node.

Run TestCustomEntity.java under the service node.

These test clients exercise custom methods of application module's client interface and print to the JDeveloper Log window to indicate the results.

For details about the test client, see Section 13.10.1, "How to Work Programmatically with an Application Module's Client Interface."

For details about the methods of the client interface, see the examples in Section 4.14, "Working Programmatically with Entity Objects and Associations."

buslogic

Run AppModule using the Oracle ADF Model Tester.

For information about business logic units and groups, see Section 4.8, "Defining Business Logic Groups."

controlpostorder

Run AppModule using the Oracle ADF Model Tester.

For information about controlling the posting order resulting from DML operations to save changes to a number of related entity objects, see Section 4.14.7, "How to Control Entity Posting Order to Prevent Constraint Violations."

custommessages

Run AppModule using the Oracle ADF Model Tester.

For information about how to provide an alternative message string for the builtin error codes in a custom message bundle, see Section 16.7, "Customizing Business Components Error Messages."

declblock

Run AppModule using the Oracle ADF Model Tester.

For information about how to use custom metadata properties to control insert, update, or delete on a view object, see Section 10.8, "Declaratively Preventing Insert, Update, and Delete."

domains

Run AppModule using the Oracle ADF Model Tester.

For information about creating custom data types, see Section 4.15, "Creating Custom, Validated Data Types Using Domains."

extend

Run TestClient.java.

This client casts the results of the productByName.first() method to the ProductViewRow interface so that it can make method calls, and prints to the JDeveloper Log window to display the results.

For information about how to extend business components to create a customized versions of the original, see Section 16.8, "Creating Extended Components Using Inheritance."

For information about iterating over a collection using the view row accessor attribute, see Section 10.1.1.3, "Exposing View Row Accessors to Clients."

inMemoryOperations

Run the test clients:

  • TestClientFilterEntityCache.java

  • TestClientFindByViewCriteria.java

  • TestClientRowMatch.java

  • TestClientSetSortBy.java

These test clients illustrate how to use the in-memory sorting and filtering functionality from the client side using methods on the interfaces in the oracle.jbo package, and print to the JDeveloper Log window to display the results.

For information about how to use view objects to perform in-memory searches and sorting to avoid unnecessary trips to the database, see Section 10.3, "Performing In-Memory Sorting and Filtering of Row Sets."

invokingstoredprocedure

Run the ExampleSQLPackage.sql script against the summit_adf database connection to set up the additional database objects required for the example.

Run TestClient.java.

The test client exercises custom methods of application module's client interface to invoke database stored procedures and functions, and prints to the JDeveloper Log window to indicate the results.

For information about how to code custom Java classes for business components that invoke database stored procedures and functions, see Section 16.5, "Invoking Stored Procedures and Functions."

multieoupdate

Run AppModule using the Oracle ADF Model Tester.

For information about creating a view object with multiple updatable entities to support creating new rows, see Section 10.6, "Creating a View Object with Multiple Updatable Entities."

multinamedviewcriteria

Run MultiNamedViewCriteriaTestClient.java.

The test client exercises custom methods on the view object interface and prints to the JDeveloper Log window to display the results.

For information about how to programmatically filter query results, see Section 10.2, "Working Programmatically with Multiple Named View Criteria."

polymorphic

Run AppModule (under the service node) using the Oracle ADF Model Tester.

For details about creating an entity object inheritance hierarchy, see Section 4.19, "Using Inheritance in Your Business Domain Layer."

processChange

Run processChangeTestClient.java.

The test client exercises custom methods on the view object interface and prints to the JDeveloper Log window to display the results.

For information about invoking database change notifications, see Section 14.4.10, "What You May Need to Know About Programmatically Invoking Database Change Notifications."

For details about the test client, see Section 13.10.1, "How to Work Programmatically with an Application Module's Client Interface."

readandwritexml

Run TestClientReadXML.java under the client node, then run TestClientWriteXML.java.

For details about how to produce XML from queried data, see Section 10.4, "Reading and Writing XML."

viewobjectonrefcursor

Run the CreateRefCursorPackage.sql script against the summit_adf database connection to set up the additional database objects required for the example.

Run AppModule using the Oracle ADF Model Tester.

For details about how to use PL/SQL to open a cursor to iterate through the results of a query, see Section 10.5.4, "How to Create a View Object on a REF CURSOR."

viewobjects

Run TestClient.java.

Programmatically iterates over the customers view instance using methods of the Business Components API RowIterator interface and prints to the JDeveloper Log window.

For details about iterating over a collection, see Section 8.4.5, "How to Count the Number of Rows in a Row Set."

For details about how to create test clients, see Section 8.4, "Testing View Object Instances Programmatically."

Run TestClient2.java.

Programmatically iterates over the customers view instance, accesses the detail collection of orders using a view link accessor attribute, and prints to the JDeveloper Log window.

For details about iterating over a detail collection, see Section 6.2.6, "How to Access the Detail Collection Using the View Link Accessor."

For more details about the test client, see Section 8.4.6, "How to Access a Detail Collection Using the View Link Accessor."

Run TestClient3.java.

Finds and updates a foreign key value and prints to the JDeveloper Log window.

For details, see Section 8.4.8, "How to Find a Row and Update a Foreign Key Value."

Run TestClient4.java.

Finds a view instance, creates a new row, inserts it into the row set, and prints to the JDeveloper Log window.

For details, see Section 8.4.9, "How to Create a New Row for a View Object Instance."

Run TestClient5.java.

Finds a view instance, accesses the row set, iterates over the rows to display the key, and prints to the JDeveloper Log window.

For details, see Section 8.4.10, "How to Retrieve the Row Key Identifying a Row."

wrapplsql

Run AppModule using the Oracle ADF Model Tester.

For details about overriding the default DML processing event for an entity object to invoke methods in a PL/SQL API package that encapsulates insert, update, and delete access to an underlying table, see Section 4.17, "Basing an Entity Object on a PL/SQL Package API."


2.5 Running the Sample Application in the SummitADF_TaskFlows Workspace

The Summit sample application for ADF task flows demonstrates how you can implement security, contextual events, and task flows in your Fusion web application.

2.5.1 How to Run the Summit Sample Application for ADF Task Flows

The easiest way to run the Summit ADF task flow sample application is to expand the ViewController project and run the index.jsf page from within this project.

Before you begin:

It may be helpful to have an understanding of the schema that the Summit ADF task flow sample application uses. For more information, see Section 2.2.3, "What Happens When You Install the Summit ADF Schema."

You will need to complete these tasks:

To run the Summit sample application for ADF task flows:

  1. Open the application in JDeveloper:

    1. In the main menu, choose File and then Open.

    2. Navigate to the location where you expanded the ZIP file for the SummitADF_Taskflows directory, select the SummitADF_Taskflows.jws application workspace and click Open.

      Figure 2-21 shows the Applications window after you open the SummitADF_Taskflows.jws application workspace file and expand a number of the nodes. For a description of each of the task flows in the workspace, see Section 2.5.2, "Overview of the Summit Sample Application for ADF Task Flows."

      Figure 2-21 Projects in the Summit ADF TaskFlows Application Workspace

      Summit ADF Task Flow sample project folders
  2. Create a database connection for the Summit ADF task flow sample application. For details, see Section 2.2.4, "How to Create the Database Connection for Summit Sample Applications for Oracle ADF."

  3. In the Applications window, expand the ViewController and Web Content nodes, then right-click index.jsf and choose Run.

    The Configure Default Domain dialog appears the first time you run an application and start a new domain in Integrated WebLogic Server. Use the dialog to define an administrator password for the new domain. Passwords you enter can be eight characters or more and must have a numeric character.

  4. Once the index.jsf page renders in your browser, you can log in using one of the user accounts listed in Table 2-5 to view the functionality that is configured for an employee or a customer in the application.

    Table 2-5 Supplied Users in the Summit ADF Task Flow Sample Application

    Username Password Application Role Notes

    cmagee

    welcome1

    Application Employee Role

    This is the only user who is preregistered as an employee in the Summit ADF task flow sample application.

    214

    welcome1

    Application Customer Role

    This is the only user who is preregistered as a customer in the Summit ADF task flow sample application. The user ID of the customer, Ojibway Retail, serves as the username.


2.5.2 Overview of the Summit Sample Application for ADF Task Flows

The application in the SummitADF_Taskflows workspace demonstrates how you can implement security, contextual events and task flows in your Fusion web application.

The following list shows the filenames of the task flows in the SummitADF_Taskflows workspace. Expand the Page Flows node under the ViewController project in the Applications window to view these task flows.

|   adfc-config.xml
|
\---flows
    |   customers-task-flow-definition.xml
    |   edit-customer-task-flow-definition.xml
    |   emp-reg-task-flow-definition.xml
    |   product-inventory-task-flow-definition.xml
    |   show-products-task-flow-definition.xml
    |
    \---orders
            create-edit-orders-task-flow-definition.xml
            orders-select-many-items.xml

Table 2-6 briefly describes these task flows and provides references to the sections in this guide that use these task flows to demonstrate concepts related to security, contextual events, data rendering and data input.

Apart from these task flows, the SummitADF_Taskflows workspace also contains a jazn-data.xml file where JDeveloper saves all policy store and identity store changes for the application. For more information about this file and its use, see Section 41.2, "ADF Security Process Overview."

Table 2-6 Task Flows in the Summit ADF Task Flow Sample Application

Task Flow Name Documentation

adfc-config.xml

Every Fusion web application contains this file. It is the source file for the unbounded task flow that JDeveloper creates by default when you create a Fusion web application.

In the Summit ADF task flow sample application, this task flow contains the index view activity that renders the index.jsf page end users see at runtime.

This task flow also registers the managed bean (oracle.summit.bean.LoginBean) that handles authentication of users who want to access resources that require authentication. For more information, see Section 41.7.1, "How to Create a Login Link Component and Add it to a Public Web Page for Explicit Authentication."

customers-task-flow-definition.xml

This task flow contains a router, a view and a method call activity to navigate an authenticated customer to the row that the customer selects within the Customer.jsff page fragment. For more information, see Chapter 21, "Working with Task Flow Activities."

ADF Security secures this task flow so that only authenticated customers can access the functionality it configures or the web pages it exposes. For more information, see Section 41.1, "About ADF Security."

edit-customer-task-flow-definition.xml

This task flow renders a number of page fragments in an ADF region that provide controls to authenticated users to edit data. For more information, see Section 23.1.3, "Task Flows and ADF Region Use Cases and Examples."

emp-reg-task-flow-definition.xml

The Summit ADF task flow sample application renders this task flow in an ADF dynamic region when an end user clicks the Register as Employee link that appears in the index.jsf page at runtime. For more information, see Section 23.9, "Creating ADF Dynamic Regions."

Unlike other task flows (for example, customers-task-flow-definition.xml) users do not have to be authenticated to access this task flow. For this reason, the security policy for this task flow grants view privileges to the builtin anonymous-role application role, as described in Section 41.5.7, "What Happens When You Define the Security Policy."

product-inventory-task-flow-definition.xml

This task flow renders the showInventory.jsff page fragment that appears in the Inventory Control tab. This tab is enabled when you log in as an employee. The application uses contextual events to determine what data to display in the showInventory.jsff page fragment in response to the end user selecting data in another ADF region.

For more information about this task flow's use of contextual events, see Chapter 40, "Using Contextual Events."

show-products-task-flow-definition.xml

This task flow renders the showProducts.jsff page fragment that renders an ADF Faces table component containing data about products. At runtime, an end-user's selection of a product broadcasts a contextual event that the product-inventory-task-flow-definition.xml task flow consumes so that it can display the inventory for the product.

For more information about this task flow's use of contextual events, see Chapter 40, "Using Contextual Events."

create-edit-orders-task-flow-definition.xml

This task flow renders the Orders.jsff page fragment where an end user can add a new product to an order. It also calls another task flow (orders-select-many-items), as described in Section 21.6.1, "How to Call a Bounded Task Flow Using a Task Flow Call Activity."

orders-select-many-items.xml

This task flow renders a modal dialog, as described in Section 25.2, "Running a Bounded Task Flow in a Modal Dialog."


2.6 Running the Standalone Samples in the SummitADF_DVT Workspace

The Summit sample application for ADF DVT components includes a set of standalone sample pages that demonstrate creation and configuration of ADF DVT components using ADF Business Components and data binding.

References to these standalone pages appear throughout the following chapters:

2.6.1 Overview of the Summit ADF DVT Standalone Samples

Each of the standalone pages in the Summit ADF DVT sample application uses the Summit ADF schema to demonstrate creation and configuration of a databound Oracle ADF Data Visualization component.

Figure 2-22 shows the Applications window after you open the SummitADF_DVT application workspace.

Figure 2-22 Runnable Pages in the Summit ADF DVT Application Workspace

Summit DVT sample user interface project

Table 2-7 describes the standalone pages in the SummitADF_DVT application workspace. Each page is runnable on its own.

Table 2-7 Standalone Pages in the Summit ADF DVT Application Workspace

Page Name Page Description Documentation

gaugeDemo.jsf

Demonstrates creation of a DVT dial gauge from a data control

Section 35.3, "Creating Databound Gauges"

gaugeInTableDemo.jsf

Demonstrates creation of a databound ADF table that stamps a status meter gauge in one of its columns

Section 35.3.5, "Including Gauges in Databound ADF Tables"

gaugeSetDemo.jsf

Demonstrates creation of a databound gauge set

Section 35.3.3, "How to Create a Databound Status Meter Gauge Set"

geoColorTheme.jsf

Demonstrates creation of a geographic map with a databound color theme

Section 37.2.6, "How to Create a Geographic Map with a Color Theme"

geoGraphTheme.jsf

Demonstrates creation of a geographic map with a databound pie and bar graph theme

Section 37.2.9, "How to Create a Geographic Map with a Pie or Bar Graph Theme"

geoPointDemo.jsf

Demonstrates creation of a geographic map with a databound point theme

Section 37.2.2, "How to Create a Geographic Map with a Point Theme"

graphDrillDemo.jsf

Demonstrates configuration of a master-detail graph for data drilling

Section 35.2.9, "Configuring Databound Graphs for Drilling"

hvDemo.jsf

Demonstrates creation of a databound hierarchy viewer rendering an organizational chart of Summit employees

Section 39.2.1, "How to Create a Hierarchy Viewer Using ADF Data Controls"

hvPanelCardVODemo.jsf

Demonstrates creation of a databound hierarchy viewer using an alternate view object for one of its panel cards

Section 39.2.3, "How to Configure an Alternate View Object for a Databound Panel Card"

hvSearchDemo.jsf

Demonstrates hierarchy viewer search configuration

Section 39.2.4, "How to Create a Databound Search in a Hierarchy Viewer"

pivotTableBarDemo.jsf

Demonstrates creation of a pivot table and pivot filter bar using data controls

Section 36.2.1, "How to Create a Pivot Table Using ADF Data Controls"

projectGanttDemo.jsf

Demonstrates creation of a project Gantt chart using data controls

Section 38.2.1, "How to Create a Databound Project Gantt Chart"

RUGGanttDemo.jsf

Demonstrates creation of a resource utilization Gantt chart using data controls

Section 38.2.3, "How to Create a Databound Resource Utilization Gantt Chart"

schedGanttDemo.jsf

Demonstrates creation of a scheduling Gantt chart using data controls

Section 38.2.5, "How to Create a Databound Scheduling Gantt Chart"

sunburstDemo.jsf

Demonstrates creation of a sunburst using data controls

Section 39.3.1, "How to Create Treemaps and Sunbursts Using ADF Data Controls"

thematicMapDemo.jsf

Demonstrates creation of a thematic map using data controls

Section 37.3.1, "How to Create a Thematic Map Using ADF Data Controls"

timelineDemo.jsf

Demonstrates creation of a timeline component using data controls

Section 38.3.1, "How to Create a Timeline Using ADF Data Controls"

treemapDemo.jsf

Demonstrates creation of a treemap using data controls

Section 39.3.1, "How to Create Treemaps and Sunbursts Using ADF Data Controls"


2.6.2 How to Run the Summit ADF DVT Sample Application Pages

To run the Summit ADF DVT sample application JSF pages, open the application, expand the View Controller project and run any of the sample.jsf files.

Before you begin:

It may be helpful to have an understanding of the schema that the Summit ADF DVT sample application uses. For more information, see Section 2.2.3, "What Happens When You Install the Summit ADF Schema."

You will need to complete these tasks:

To run the Summit ADF DVT sample application pages:

  1. Open the application in JDeveloper:

    1. In the main menu, choose File and then Open.

    2. Navigate to the location where you expanded the ZIP file for the SummitADF_DVT directory, select the SummitADF_DVT.jws application workspace and click Open.

  2. Create a database connection for the Summit ADF DVT sample application. For details, see Section 2.2.4, "How to Create the Database Connection for Summit Sample Applications for Oracle ADF."

  3. In the Applications window, expand the ViewController and Web Content nodes.

    Figure 2-22 shows the Applications window after you open the SummitADF_DVT.jws application workspace file for the Summit ADF DVT sample application and expand the View Controller and Web Content nodes. For a description of each page in the application, see Table 2-7, "Standalone Pages in the Summit ADF DVT Application Workspace".

  4. To run a page, right-click the desired .jsf page and choose Run.

    The Configure Default Domain dialog appears the first time you run an application and start a new domain in Integrated WebLogic Server. Use the dialog to define an administrator password for the new domain. Passwords you enter can be eight characters or more and must have a numeric character.