Oracle® Application Development Framework Developer's Guide
10g Release 3 (10.1.3) B25386-01 |
|
![]() Previous |
![]() Next |
The SRDemo application is a realistic web portal application that allows customers to obtain appliance servicing information from qualified technicians. After the customer opens a new service request, a service manager assigns the request to a technician with suitable expertise. The technician sees the open request and updates the customer's service request with information that may help the customer solve their problem.
The application recognizes three user roles (customer, manager, and technician). Roles are determined based on standard J2EE container managed security features of the Oracle Application Server. As the following sections show, the application features available to the user depend on the user's role.
Log in as the customer:
User name: dfaviet
Password: welcome
To enter the web portal click the Start button.
This action displays the customer's list of open service requests, as shown in Figure 2-6.
When you log in as the customer, the list page displays a menu with only two tabs, with the subtabs for My Service Requests selected.
Note that additional tabs will be visible when you log in as the manager or technician.
Select the menu subtab All Requests to display both closed and open requests.
To browse a description of any request, select the radio button corresponding to the row of the desired request and click View.
The same operation can also be performed by clicking on the service request link in Request Id column.
The customer uses the resulting page to update the service request with their response. To append a note to the current service request, click Add a note.
Figure 2-7 shows an open service request selected by a customer and the note they are about to append. Notice that the buttons above the text input field appear disabled to prevent the user from selecting those operations until the task is completed. Below the note field, is the list of previous notes for this master service request.
Where to Find Implementation Details
The Oracle ADF Developers Guide describes the following major features of this section.
Using dynamic navigation menus: The menu tabs and subtabs which let the user access the desired pages of the application, are created declaratively by binding each menu component to a menu model object and using the menu model to display the appropriate menu items. See Section 11.2, "Using Dynamic Menus for Navigation".
Displaying data items in tables: The list of service requests is formatted by a UI table component bound to a collection. The Data Control Palette lets you easily drop databound components into your page. See Section 7.2, "Creating a Basic Table".
Displaying a page by passing parameter values: The user may select a service request from the list of open requests and edit the details in the edit page. The commandLink
is used to both navigate to the detail page and to send the parameters that the form creation method uses to display the detail page data. See Section 10.4, "Passing Parameter Values to Another Page Using a Command Component".
Using a method with parameters to create a form: The user drills down to a browse form that gets created using a finder method from the service. Instead of the method returning all service requests, it displays only the specific service request passed by the previous page. See Section 10.6, "Creating a Form or Table Using a Method that Takes Parameters".
Displaying master-detail information: The user can browse the service history for a single service request in one form. The enter form can be created using the Data Control Palette. See Section 8.3, "Using Tables and Forms to Display Master-Detail Relationships".
To create a new service request, select the New Service Request tab.
This action displays the first page of a two-step process train for creating the service request. Figure 2-8 shows the first page.
The input fields that your page displays can raise validation errors when the user fails to supply required information. To see a validation error, click the Logout menu item before entering a problem description for the new service request.
Figure 2-9 shows the validation error that occurs in the create-service-request page when the problem description is not entered. Notice the text below the field that raised the validation error directs the user to enter a description.
You can see another way of handling validation errors by clicking the Continue button before entering a problem description.
Figure 2-10 shows the validation error that displays within a dialog when the problem description is not entered. Notice the text below the field that raised the validation error directs the user to enter a description.
To proceed to the next page of the process train, first type some text into the problem description field, then either choose Confirm from the dropdown menu or click the Continue button.
In the next step, the customer confirms the information is correct before submitting the request to the data source. Figure 2-11 shows the final page. Notice that the progress bar at the top of the page identifies Confirm is the last step in this two-page create-service-request process chain.
Click the Back button to returns to the create-service-request page.
Click the Submit Request button to enter the new service request into the database. A confirmation page displays after the new entry is created.
To continue the application as the manager role, click the Logout menu item to return to the login page.
Where to Find Implementation Details
The Oracle ADF Developers Guide describes the following major features of this section.
Creating a new record: The user creates a new service request using a form that commits the data to the data source. JDeveloper lets you create default constructor methods on the service as an easy way to drop record creation forms. Alternatively, custom methods on the service may be used. See Section 10.7, "Creating an Input Form for a New Record".
Multipage process: The ADF Faces components processTrain
and processChoiceBar
guide the user through the process of creating a new service request. See Section 11.5, "Creating a Multipage Process".
Showing validation errors in the page: There are several ways to handle data-entry validation in an ADF application. You can take advantage of validation rules provided by the ADF Model layer. See Section 12.3, "Adding Validation".
Handling page navigation using a command button: The application displays the appropriate page when the user chooses the Cancel or Submit button. Navigation rules, with defined outcomes, determine which pages is displayed after the button click. See Section 9.1, "Introduction to Page Navigation Using Outcomes".
Log in as the manager:
User name: sking
Password: welcome
Click the Start button.
This action displays the manager's list of open service requests. The list page displays four menu tabs, with the subtabs for the My Service Requests tab selected.
To see a description of any request, select a radio button corresponding to the row of the desired request and click View.
Figure 2-12 shows an open service request. Notice that when logged in as the manager, the page displays an Edit button and a Delete Service History Record button. These two operations are role-based and only available to the manager.
To edit the current service request, click Edit.
Figure 2-13 shows the detail edit page for a service request. Unlike the page displayed for the technician, the manager can change the status and the assigned technician.
To find another technician to assign, click the symbol next to the assigned person's name.
Figure 2-14 shows the query by criteria search page that allows the manager to search for staff members (managers and technicians). This type of search allows wild card characters, such as the % and * symbols.
To assign another staff member to this service request, click the selection button next to the desired staff's name.
To update the open service request with the selected staff member, click the Select button.
Where to Find Implementation Details
The Oracle ADF Developers Guide describes the following major features of this section.
Databound dropdown lists: The ADF Faces component selectOneChoice
allows the user to change the status of the service request or to pick the type of service request to perform a search on. See Section 11.7, "Creating Databound Dropdown Lists".
Searching for a record: The user can search existing service requests using a query-by-example search form. In this type of query, the user enters criteria info a form based on known attributes of an object. Wild card search is supported. See Section 10.8, "Creating Search Pages".
Using a popup dialog: At times you may prefer to display information in a separate dialog that lets the user postback information to the page. The search window uses a popup dialog rather than display the search function in the page. See Section 12.7, "Displaying Error Messages" and Section 11.3, "Using Popup Dialogs".
Using Partial Page Rendering: When the user clicks the flashlight icon (which is a commandLink
component with an objectImage
component), a popup dialog displays to allow the user to search and select a name. After selecting a name, the popup dialog closes and the Assigned to display-only fields are refreshed with the selected name; other parts of the edit page are not refreshed. See Section 11.4, "Enabling Partial Page Rendering".
Using managed bean to store information: Pages often require information from other pages in order to display correct information. Instead of setting this information directly on a page, which essentially hardcodes the information, you can store this information on a managed bean. For example, the managed bean allows the application to save the page which displays the SREdit page and to use the information in order to determine where to navigate for the Cancel action. See Section 10.2, "Using a Managed Bean to Store Information".
Passing parameters between pages: The commandLink
component is used to both navigate to the SREdit page and to set the needed parameter for the findServiceRequestById(Integer)
method used to create the form that displays the data on the SREdit page. You can use the ADF Faces setActionListener
component to set parameters. See Section 10.4, "Passing Parameter Values to Another Page Using a Command Component".
To access the manager-only page, select the Management tab.
This action displays the staff members and their service requests in a master-detail ADF Faces tree table component. Figure 2-15 shows the tree table with an expanded technician node.
Each child node in the tree table is linked to a detail service request report. Click the child node link Defroster is not working properly
to display the detail:
Each staff name is linked to a detail of the staff member's assigned skills. Click the staff name link Alexander Hunold
to display the list of assigned skills:
To access the skills assignment page, select the Technician Skills subtab.
This action displays a staff selection dropdown list and an ADF Faces shuttle component. Figure 2-16 shows the shuttle component populated with the skills of the selected staff member.
Use the supplied Move
, Move All
, Remove
, or Remove All
links to shuttle items between the two lists. The manager can make multiple changes to the Assigned Skills list before committing the changes. No changes to the list are committed until the Save skill changes button is clicked.
To continue the application as the technician role, click the Logout menu item to return to the login page.
Where to Find Implementation Details
The Oracle ADF Developers Guide describes the following major features of this section.
Creating a shuttle control: The ADF Faces component selectManyShuttle
lets managers assign product skills to a technician. The component renders two list boxes, and buttons that allow the user to select multiple items from the leading (or "available") list box and move or shuttle the items over to the trailing (or "selected") list box, and vice versa. See Section 11.8, "Creating a Databound Shuttle".
Role-based authorization: You can set authorization policies against resources and users. For example, you can allow only certain groups of users the ability to view, create or change certain data or invoke certain methods. Or you can prevent components from rendering based on the group a user belongs to. See Section 18.7, "Implementing Authorization Programmatically".
Log in as the technician:
User name: ahunold
Password: welcome
Click the Start button.
This action displays the technician's list of open service requests. The list page displays two tabs, with the subtabs for the My Service Requests tab selected.
To open a request, select a radio button corresponding to the row with the desired request and click View.
The technician uses the displayed page to update the service request with their response. To attach a document to the current service request, click Upload a document.
Figure 2-17 shows an open service request and the note text input field. Notice only the Edit button above the text input field is not disabled while the note field is active.
Where to Find Implementation Details
File uploading: Standard J2EE technologies such as Servlets and JSP, and JSF 1.1.x, do not directly support file uploading. The ADF Faces framework, however, has integrated file uploading support at the component level via the inputFile
component. See Section 11.6, "Providing File Upload Capability".
Changing application look and feel: Skins allow you to globally change the appearance of ADF Faces components within an application. A skin is a global style sheet that only needs to be set in one place for the entire application. Instead of having to style each component, or having to insert a style sheet on each page, you can create one skin for the entire application. See Section 14.3, "Using Skins to Change the Look and Feel".
Automatic locale-specific UI translation: ADF Faces components provide automatic translation. The resource bundle used for the components' skin (which determines look and feel, as well as the text within the component) is translated into 28 languages. For example, if a user sets the browser to use the German language, any text contained within the components will automatically display in German. See Section 14.4, "Internationalizing Your Application".