This is a brief overview of the Avitek Sample Retail Application (RTLApp) that is included with a complete BEA AquaLogic Data Services Platform installation. This chapter describes the data sources and other application components used to develop the RTLApp.
Avitek is an imaginary retailer that has grown through acquisitions. The company started out selling apparel but recently merged with an electronic retailer to expand business and consolidate cost centers such as accounting and web development. Because of this acquisition the company now has two very different order management systems (OMS), one each for electronics and apparel orders. Avitek also has a customer relationship management (CRM) system to manage customer profile information. Finally, Avitek has a Customer Service system to manage the support cases for Electronic products.
General immediate and mid-range goals for the newly consolidated IT department include:
An early "low-hanging fruit" project is to build a customer self-service web site which can also be used by support representatives. This web site needs to provide an easy solution to integrating different back-end resources and to providing two-way communication (read/update). It will also need to provide an abstraction layer to hide the complexities in the different systems.
The front-end architecture of the web site will provide a Java-based Customer Self-Service portal where customers can update their profile information and review or modify their orders. The back-end architecture will access the following five different sources of data (as shown in Figure 6-1):
The project also needs a code name. RTLApp is selected.
Make sure that both the RTLApp development environment and Web application are available. To start the RTLApp in the IDE, follow the instructions outline in Verifying the Installation, including starting your BEA WebLogic Server.
The steps involved in running RTLApp from inside WebLogic Workshop are similar to starting the IDE. (If you have already build and deployed RTLApp in Workshop you can skip to step 4.)
BEA WebLogic Platform 8.1
BEA AquaLogic Data Services Platform 2.5
Launch RTL Demo Sample Server
|Note:||Samples, sample tutorials, and the RTLApp sample application are all designed to be run on the ldplatform domain, located at:|
|Note:||It is in this domain where data required by various samples and examples is located.|
|Note:||You can go on to Step 2 while starting the sample domain server.|
RTLApp.workfile located in the following directory:
Right-click on RTLApp (top node in the Application pane), and choose Build Application from the context-sensitive menu. WebLogic Workshop displays the status of the build. Confirm that the build was successful, as indicated by the build status messages.
demoPageFlowController.jpf. It is located in the following folder:
Log in using one of the names shown in the dialog box. Simply move your mouse over the login name of your choice to automatically fill-in the name and password (Figure 6-2).
The sample retail application illustrates in simplified form the kinds of data integration challenges often encountered by Information Technology (IT) managers and staff. Issues include:
Other questions may occur. Is the data-rich solution scalable? Is it reusable throughout the enterprise? Are the original data sources transparent to the application — or do they become an issue each time you want to make a minor adjustment? When changes to underlying data inevitably occur, how difficult will it be to propagate those changes to the application layer?
So many questions...
A survey commissioned by Avitek Marketing found customers to be dissatisfied with the call-in wait time required to track orders or update customer information. In a focus group the idea of a self-service web site resonated. Customer Service agreed; they have been requesting such a site for years, but the internal costs were always above budget. But now that Marketing is on board ...
Site requirements seem simple. Fulfillment identifies that customers will need to be able to:
Bottom line: If customers can perform this level of self-service the company will save a lot of money.
A cross-sectional team of marketing and customer service develop maintenance requirements for the web application:
An application/UI designer begins "specing out" the required JSPs. Pages are the easy part. Data is needed so he shoots off an email to the consolidated IT department.
When an IT data architect analyzes the requirements she turns up a problem. In surveying the information needed by the application -- customer data for one data source, order data from two very separate divisions of the company (two more data sources), and customer support data (a fourth data source) — the architect realizes that integrating data from these diverse data sources will be complicated and time consuming with additional maintenance problems down the road. Challenges included:
Perhaps most frustrating: little of the specialized code needed by the application can be reused.
So much for low-hanging fruit.
Developing a unified view into distributed data is one of the most persistent challenges faced by IT departments. Just when you get all the available data sources normalized, new sources appear that must be dealt with, but which also make yesterday's data integration solution obsolete.
This problem is so pervasive that each year thousands of arguably critically-needed applications go unwritten, are delayed, or are delivered in highly-compromised form because of the data integration challenges faced by even the most sophisticated enterprises.
Compared to the above, the RTLApp team preferred a solution that:
When Avitek looked at AquaLogic Data Services Platform, they found a product that addressed the underlying challenges posed by the apparently simple RTLApp:
Specifically, the features that the team found most appealing included:
Data Access. AquaLogic Data Services Platform allows the application to access information from anywhere in the company — or beyond — through an easily-created virtual data access layer. Once accessed, data can easily be aggregated through a combination of reusable queries and views that are maintained in the AquaLogic Data Services Platform server.
Query Development. Then, once the data is collected under a single point of access, it is not difficult to create query functions that consolidate data from these disparate sources and present a common, reusable view ready for more specialized queries.
The declarative form of AquaLogic Data Services Platform artifacts (query functions in data services) makes them very readable.
Query Deployment. Once developed, queries are easily integrated into a client application thorough a variety of access methods such as the AquaLogic Data Services Platform Mediator API, a data service control, JDBC, or Web service.
Integration. Business logic for the RTLApp is provided by the NetUI and page flow features of Workshop. However, AquaLogic Data Services Platform query functions could have as easily been integrated and maintained within the business logic of any J2EE application.
The RTLApp is designed to illustrate how AquaLogic Data Services Platform-generated queries can aggregate data from potentially highly disparate data sources, allowing access to that data through a single point of access that itself is easily integrated with the application.
|Note:||To simplify the running of the RTLApp, the multiple data sources described in this document are simulated using the PointBase RDBMS which is shipped with AquaLogic Data Services Platform. In the original implementation, these databases were represented by major vendor RDBMS systems.|
The RTLApp is located in the following directory:
RTLApp controls, pages, processes, and resources used to create the SampleApp can be found at:
Some of the schemas used in the RTLApp are in the following directory:
Others are located in their respective data service.
.work file for the SampleApp is located at:
When you install AquaLogic Data Services Platform with the WebLogic Platform, the source code for the RTLApp can be accessed from Workshop. For instructions, see Viewing RTLApp Source.
For additional information and references, see:
Several BEA technologies are exercised by the RTLApp.
Although the RTLApp is very simple, the underlying data acquisition is challenging because data comes from four heterogeneous data sources. These are:
The following section describes work done by some of the RTLApp data services.
These physical data services correspond with the physical data sources needed by the application.
In RTLApp physical data services typically have a read function and, often, one or several navigation functions that correlate to the primary key/foreign key relationship between relational sources.
Logical data services (services based on physical data services or other logical data services) are located in a folder called RTLServices. It is in these logical data services that read and navigation functions drawing on multiple data sources are developed and maintained.
Table 6-1 shows the relationship between the data sources, major data elements (for RDBMS systems: tables and columns), sample application JSPs, and the RTLApp web pages.
If you have not already done so, use Quick Start Instructions for the Avitek Sample Application (RTLApp) to start Retail Sample Application. You can choose from users Steve, Jack, Tim, Homer, or Jerry. Each uses the password
Once a customer logs in, she or he sees their MyProfile screen. From there he or she can navigate to information on open orders, order history, support, search, and logout. Customers can edit open orders (see Figure 6-4) and get details on completed orders. Search allows the user to supply product description information, start or end date, or order amount brackets.
The application also demonstrates some AquaLogic Data Services Platform facilities including the ability to:
The My Profile page illustrates AquaLogic Data Services Platform's ability to perform automatic read/write on distributed data.
My Profile page consolidates Customer and Credit Card information. Users can change their personal profile information, address information, and credit card information. Changes are initially reflected on their MyProfile page. If satisfied, the user can click Submit All Changes to persist changes to the respective data sources.
The page is based on
ProfileView.jsp and the ProfileView data service (
The RTLApp Open Order page consolidates a customer's electronics and apparel open orders.
From the user's perspective, changing data is simply a matter of select and type. However, the underlying update mechanisms for electronic orders (which are maintained as a web service) and apparel orders are quite different.
Electronic orders are derived from a web service. In this case, updating a electronic order demonstrates web service custom update capabilities.
Apparel orders are derived from a relational database and updates are automatic.
The Enable Cache option turns on caching for the function underlying the Open Orders page. You can use the Refresh button to verify that the execution time when cache is enabled is significantly faster than when it is not.
Click the Make Electronics Source Unavailable button to disable the web service. This action also refreshes your Open Orders page. Notice that you can still retrieve partial results (apparel orders) when a data source becomes unavailable.
The Show SQL Report button illustrates accessing data through JDBC. This demonstrates the integration of AquaLogic Data Services Platform query functions with reporting and business intelligence tools such as Crystal Reports.
The Open Order page is controlled by a JSP named
defaultView.jsp. Call-outs in Figure 6-4 show underlying data sources. The page derives its font and other look-and-feel characteristics from a cascading stylesheet.
The RTLApp Order History page displays historical order information for electronic and apparel orders.
Users have several options associated with viewing their previous orders:
An Apply button is provided to control page refresh.
AquaLogic Data Services Platform security can be demonstrated when the number of orders is set to All. Then when the Restrict Access option is selected, data is automatically redacted to show only orders where order amounts are less than $500.00.
The Order History page is controlled by a
The Support page provides information on any open support cases for the currently logged-in customer.
The underlying JSP is
Users can search for specific orders based on order dates, items, or amounts. The underlying code executes ad hoc AquaLogic Data Services Platform query functions.
Users can search on any combination of search field criteria including product description, start or end data, and a range of order amounts.
The JSP for this page initiates a small Java program that incorporates customer input and generates an XQuery based on the selected parameters.
The data services, functions, JSP pages, and connection logic for the RTLApp were created in Workshop. You can view the source for the RTLApp in Workshop as well.
To open the RTLApp application, open the
RTLApp.work file in Workshop. The full path is:
|Note:||If you are already running WebLogic Workshop or have previously run it with a different server setting, you may need to change your application server properties settings. If necessary, select the following from the WebLogic Workshop menu:|
When opening the RTLApp in WebLogic Workshop, you initially see the application components and the work area.
WebLogic Workshop allows you to work with the application you have under development as components or files. Web pages can be displayed and run, page flows and application logic can be developed and tested.
|Note:||fully describes the IDE and how it can be used to build enterprise applications. The on-line document includes numerous examples and tutorials.|
The WebLogic Workshop Samples application contains a number of samples relevant to data access and XML. See:
Like all WebLogic Workshop applications, components of the RTLApp are arranged in folders. This section briefly describes some of these folders and their contents.
The Data Services folder contains both physical and logical data services.
Physical data services, which are based on physical data sources, include apparel orders (ApparelDB), electronic orders (ElectronicsWS), credit card information (BillingDB), and customer service information (ServiceDB). Logical data services are all grouped in the RTLServices folder.
Model diagrams based on both physical and logical data services are contained in the MODELS folder. Of particular interest is the EnterpriseDataModel, which models all the physical data services in the application. Logical model diagrams include the RTLApp model, which summarizes the data service relationships that make up the RTLApp.
|Note:||The DataServices/Demo directory contains simple examples of delimited file data, XML file data, and Java functions being used as the basis for data services.|
The ElecWS folder contains the web service that serves as the basis for the electronics orders data service used by RTLApp.
Many of the building blocks of the Retail Sample Application are available from the RTLSelfService folder.
The following components are of special interest:
RTLControl.jcxfile. This is a file generated by the data service control that contains methods for each query function used in the AquaLogic Data Services Platform application. In Design View each function is listed. Clicking on a name switches you to Source View where you can see details about the function including:
For additional information on the RTLControl see Controls.
demoPageFlowController.jpf, that make up the RTLApp web application.
For additional information on the pages see Application Pages.
The RTLApp/Schemas folder contains schemas developed for logical data services and associated XML Bean classes.
RTLControl.jcx contains automatically-generated methods based on a set of stored queries selected by the developer of the data service controls. For information on accessing AquaLogic Data Services Platform queries in WebLogic Workshop see the section "Select Data Service Functions to Add to a Control" in in the Application Developer's Guide.
A portion of the Source View of the RTLOrderSummary method of the RTLControl JCX file is shown in Figure 6-12. Note that the name of the target schema for the query appears in comments.
Each method in the data service control corresponds to a query function. Each method returns an XMLBean type. The XMLBeans are generated when the control is created, and are stored in the Libraries directory of the WebLogic Workshop application.
In the RTLSelfService/Pages folder you can find the Java Server Pages (JSPs) that make up the RTLApp. These were constructed in WebLogic Workshop using queries RTLControl and NetUI graphical elements.
The RTLApp is composed of java server pages (JSPs) that are managed by a WebLogic Workshop PageFlowController. The PageFlowController is named
From an application logic perspective, whenever a user releases control of a page by selecting an option such as Next, Previous, Ok, Cancel, and so forth, application logic returns to the PageFlowController. Once that logic is processed, the user sees the appropriate web page.
Using WebLogic Workshop you can inspect, change and extend page flow programmatically or graphically. There are three views of page flow: Flow View, Action View, and Source View.
The Workshop page flow schematic (Figure 6-14) illustrates graphically the relationship between JSPs, including has modeless page flow is determined by user actions.
When you click on a particular page name, the page opens in the WebLogic Workshop development browser.
The three primary elements found in Page Flow View are:
The Action View tab helps in finding the location of page flow actions associated with the RTLApp.
Clicking on an action items opens demoPageFlowController to the relevant section of code.
The PageFlowController file contains several parts:
In summary, the RTLApp provides:
Links to additional resources for learning more about AquaLogic Data Services Platform are readily available from the BEA edocs site: