Appendix A. Platform End-to-End Example

Introduction

This appendix presents an example of an end-to-end application that uses different parts of WebLogic Platform in a variety of ways. The application is used by a fictitious multinational corporation, Avitek, with a number of subsidiaries that use WebLogic Platform to integrate internal and external systems. These systems include external business-to-consumer (B2C) portals, internal human resource portals, and business-to-business (B2B) portals. WebLogic Platform is used in each case.

The example is presented as three different use cases. The first use case is focused primarily on WebLogic Portal. The second highlights features and functionality of WebLogic Workshop. The third use case demonstrates WebLogic Integration.

You will be looking at these three use cases from a user perspective, and then from an architectural perspective. The user perspective shows each use case from the perspective of a user of the Avitek site. When going through each use case, you assume the identity of a particular user performing a particular task. The architectural perspective dives into implementing the use case.

Caution

Although the sample application contains a great deal of content that’s intended for examination, many pages have links that appear to be active but are not actual working links. Because this appendix focuses only on specific parts of the example and does not explore other parts, you might find problems with some links and examples that are outside the scope of this discussion. However, it’s important to note that this is a working example, and that real code is used to implement the sample application.

Note

A BEA team consisting of Herain Oberoi, Curtis Mager, Joe Hilany, Sam Ramji, and Eduardo Alverez developed the end-to-end example for this appendix. The examples have been developed and tested by this team and others. The author wishes to sincerely thank them and all the people who worked on the example.

Installation

The example is supplied as a single zip file to be extracted into an already working copy of WebLogic Platform 7. The example has been tested with WebLogic Platform 7 GA, 7 SP1, and 7 SP2. Your installation should include the sample applications included with WebLogic Platform 7. (This is the default during installation.)

The installation instructions assume that you installed WebLogic Platform into the C:ea directory. This is your BEA home directory. You need to adjust the directory paths referenced in these instructions if your BEA home directory is somewhere else.

By default, WebLogic Platform creates a directory structure under the BEA home directory that looks like this:

c:ea

    jdk131_06

    license.bea

    logs

    registry.xml

    UpdateLicense.bat

    user_projects

    utils

    weblogic700

Under the weblogic700 directory is a series of directories:

samples

    platform

        e2eDomain

To install the example, unzip the zip file into the samplesplatform directory (c:eaweblogic700samplesplatform). This creates a directory named demoDomain. When you are done, there should be two directories under the platform directory: e2eDomain (which is part of the Platform installation) and demoDomain. The installation of the example and the Platform combined with the disk space for running the Platform requires approximately 1GB of free disk space. Your system should have at least 512MB of memory and be a minimum of a 500MHz Intel Pentium II. WebLogic Platform 7 SP2 is supported on the following Microsoft Windows platforms:

  • Windows 2000 Professional Edition with Service Pack 2 or later. This platform is certified only for design and development, not for production.

  • Windows 2000 Server with Service Pack 2 or later.

  • Windows NT 4.0 with Service Pack 6 or later.

  • Windows XP. This platform is also certified only for design and development, not production.

Note

The latest information about hardware and operating system certifications for WebLogic Platform 7 is available from http://edocs.bea.com/.

If you are installing with WebLogic Platform 7 SP1 (7.0.1.0) or WebLogic Platform 7 SP2 (7.0.2.0), you also need to copy the file c:eaweblogic700samplesplatformdemoDomainsp1ejbadvisor.jar to c:eaweblogic700samplesplatformdemoDomaineaAppse2eApp. If you forget this step, the server will not start up correctly under 7 SP1 or 7 SP2. Do not install this file if you are using the general availability (GA) release of WebLogic Platform 7 (7.0.0.1). You can determine the version of WebLogic Platform you have installed by looking at the file c:ea egistry.xml. Within that file is version information for each component that was installed. The version information looks like this:

<component name="WebLogic Server" version="7.0.2.0">

This shows that your WebLogic server is at version 7.0.2.0, which is the same as 7 SP2.

Restrictions

This demo is available only for the Windows platform. Additionally, WebLogic Platform must be on the same machine as the browser. The standard server alias localhost is used to access sample applications in the browser. For this particular example, you can’t run the server on one machine and the browser on another.

Any current browser should work with this example. However, there are known problems with the Netscape 4.x series of browsers. Netscape 6.x and 7.x, the Mozilla browser, Microsoft Internet Explorer 5.x and 6.x, and the Opera browser all work well.

Starting the Server

After installation, you can start the example’s domain by running startServer.bat from within the demoDomain directory. Again, this directory is in c:eaweblogic700samplesplatformdemoDomain. On the first startup, the server might take several minutes to start. Additionally, when entering a new portal or subsection of the example site, there can be delays while the server compiles JSP or instantiates EJBs. These delays happen only during the first time you access a subsection, however.

The server will be ready to use when you see messages that look similar to the following in the window in which you started the server:

<Apr 30, 2003 10:45:49 AM MDT> <Notice> <WebLogicServer> <000365>
    <Server state changed to RUNNING>
<Apr 30, 2003 10:45:49 AM MDT> <Notice> <WebLogicServer> <000360>
    <Server started in RUNNING mode>

Use Case One: WebLogic Portal Features

The initial page for all the example’s use cases is accessed at http://localhost:7501/ (see Figure A.1). You can access the three use cases at this page. If your environment is configured for it, the server will attempt to start your browser for you. It might start the browser using the machine name you are on. For example, if your machine is named mymachine, a browser might be started for you with the address http://mymachine:7501/. This is not a problem so long as the server is also accessible through the localhost address.

The example’s main page.

Figure A.1. The example’s main page.

Additionally, throughout this example are pop-up windows that provide context-sensitive hints and information about the portion of the use case you are exploring.

Click the Visit the Site link under the Digital Imaging section to enter the portal associated with the first use case; the page shown in Figure A.2 is displayed.

The first page for use case one.

Figure A.2. The first page for use case one.

On the page the username and password should already be filled in. If they are not, log in as the user radams with the password password. A pop-up window should also appear to tell you this information. Click the Login button to log in.

Use case one is that Rachel Adams is an existing customer of Avitek Digital Imaging. She wants to buy a camera for a birthday that falls on the following day. However, Rachel cannot complete the order because Avitek Digital Imaging needs at least two days to deliver the camera to her. This delivery schedule is a problem for Avitek because it has lost revenue from an existing customer. The use case goes on to show how Avitek can make existing functionality available to give customers correct and timely information and, therefore, close the sale.

After you have logged in as Rachel, you see a window that looks like the one in Figure A.3.

Use case one after logging in.

Figure A.3. Use case one after logging in.

Next, you are going to try to buy a camera. To get to the catalog view page, click the Products tab at the top of the page (see Figure A.4).

The catalog view page for use case one.

Figure A.4. The catalog view page for use case one.

On the catalog view page, you can select from the catalog items that are displayed. If you select the AviPix camera, you see the three cameras that Avitek offers. Select the AviPix 1000 camera, and then click Express Checkout. Notice on this page that the order will not arrive for two days (see Figure A.5). As Rachel needs the camera tomorrow, this delivery date is not acceptable, so you (as Rachel) cancel the order. Simply click the Cancel button at the bottom of the window.

The order page for use case one.

Figure A.5. The order page for use case one.

Capturing the Sale

Avitek wants to expand its portal so that customers can pick up a purchase from any Avitek partner store. In this way, Avitek would not lose a sale if the merchandise was available at a “brick and mortar” store. Acting as the administrator for the Avitek site, you will add functionality to the Avitek Web site by enabling the Clicks and Bricks portlet. With this portlet, physical stores can provide customers with merchandise if they have it in stock. Avitek communicates with the stores using a Web service interface, and you will use this Web service to help Avitek capture the sale.

Adding a Web Service–Based Portlet

The E-Business Control Center (EBCC) enables you to easily add a portlet from a Web service. A portlet is a subsection on a Web page used for displaying any type of information. For example, a single page might have a portlet to display stock prices, a portlet for accessing an e-mail server, and a portlet for displaying current news headlines. You can interact with each portlet to varying degrees, depending on the portlet’s purpose.

For this example, a Web service to interact with stores’ inventory systems has already been created for you. This Web service contains the business logic to properly communicate with the stores. Although the Web service is prepackaged with the example, you still get an overview of creating a portlet with Web Services Description Language (WSDL). WSDL is an XML format for describing Web services. It describes the Web service as a set of endpoints operating on messages sent between the endpoints.

Again, as the Web service and portlet have already been created for you, creating the portlet in the EBCC is not a requirement. However, you can walk through the steps for creating a Web service–based portlet to see how it is done.

To start the EBCC, you use the Windows Start menu. In a standard installation, you can find it under Start, All Programs (Windows XP) or Programs, BEA WebLogic Platform 7.0, WebLogic Portal 7.0, E-Business Control Center (Windows 2000). When first starting the EBCC, you see a window that looks like Figure A.6.

The EBCC startup window.

Figure A.6. The EBCC startup window.

To create a Web service portlet, you use an already existing project. After the EBCC is started, select File, Open Project from the main menu. A dialog box representing the physical file system opens. It starts out at %BEA_HOME%weblogic700. You should navigate to the demoDomain project directory. Select samples, platform, demoDomain, beaApps, e2eApp-project, and then click Open.

To experiment with creating a portlet based on WSDL, choose File, New, Presentation, Portlet. Select the Use the Portlet Wizard radio button. You can then walk through creating a new portlet using WSDL. Make sure that in step 4, Content Types, you select the Web Service(s) option, as shown in Figure A.7.

The EBCC Content Types dialog box.

Figure A.7. The EBCC Content Types dialog box.

Because the portlet wizard cannot predict any customized presentation logic, a portlet has already been created for you that accesses the AviClicks & Bricks Web service. The next step is to make this service available on the Avitek Web site. You will log in as an administrator over the entire Avitek site and make the portlet available for the Avitek Digital Imaging portal. To access the Portal Administration pages, go to http://localhost:7501/e2eAppTools with your browser. Your browser should display a login dialog box. Enter administrator for the username and password for the password. Remember that usernames and passwords are case sensitive in this installation.

After entering the username and password, you see the portal’s Administration Tools home page (see Figure A.8).

The portal’s Administration Tools home page.

Figure A.8. The portal’s Administration Tools home page.

Click the Portal Management icon to display the Portal Management page (see Figure A.9).

The Portal Management page.

Figure A.9. The Portal Management page.

Click the Default Digital Imaging Portal (Everyone) link under the b2cPortal heading. (Make sure to select the link under b2cPortal.) On the next page, click the Manage Pages and Portlets link (see Figure A.10).

The Pages and Portlets page.

Figure A.10. The Pages and Portlets page.

Toward the bottom of this page is the Unused Pages section. Click the Attributes button to the right of the Profile entry to display the Profile page, and select the Available and Visible check boxes (see Figure A.11).

Setting page attributes.

Figure A.11. Setting page attributes.

Click the Save button to continue.

After you have saved the page attributes, you can log back in as Rachel. An additional tab named Profile, representing the Profile portal page, is now available at the top of the page. You (as Rachel) can use this page to update her profile so that she is able to search in more than just the online store (see Figure A.12).

The Profile page.

Figure A.12. The Profile page.

To take advantage of the new service, you need to do the following:

  1. Select the Use Clicks and Bricks radio button to enable Rachel to use the new Web service.

  2. Click the Submit button.

  3. Return to the catalog by selecting the Products tab.

  4. Select the AviPix image.

  5. Select the AviPix 1000 image. The ZIP code should already be filled in for you with 94108.

  6. You might need to click the Go icon to see the stores that have the merchandise in stock (see Figure A.13).

    The new catalog page with stores that have the camera in stock.

    Figure A.13. The new catalog page with stores that have the camera in stock.

An existing bug in the demo when using WebLogic Platform GA (7.0.0.1) or 7 SP1 (7.0.1.0) sometimes displays a message saying that the functionality is temporarily unavailable. Additionally, a long stack trace is printed to the console. Neither of these two messages affects the running of the demo or the underlying code, however. After you have selected a ZIP code, the sample runs fine. You should not experience this bug if you’re using WebLogic Platform 7 SP2 (7.0.2.0).

After you have selected a store by clicking the Buy Now button under the store address, continue through the buying process. Your checkout proceeds as before, but the confirmation shows that the merchandise will be shipped to the store you selected (see Figure A.14).

The AviClicks & Bricks checkout page.

Figure A.14. The AviClicks & Bricks checkout page.

Use Case Two: WebLogic Workshop Features

The second use case of the example is aimed at a business-to-business scenario. In this use case, Jason Tang is the purchasing agent for Avitek Digital Imaging. He logs into an Avitek intranet site (that is, internal to Avitek and not available to the outside) known as the Avitek InWeb and notices that a shipment of the AviPix 1000 camera has not arrived yet and is still in shipping. The existing Avitek order management process specifies only a status of “Open” or “Shipped” on orders that have been placed. Jason knows he is below his required stock amount because of the missing shipment but has no additional details on why the shipment is missing. The goal is to give Jason more visibility into the shipping process so that he can more effectively manage the stock shortage of AviPix 1000 cameras.

The second use case is under the Intranet section on the main page (http://localhost:7501/index.jsp). Click the Visit the Site link to enter the Avitek InWeb home page (see Figure A.15).

The Avitek InWeb intranet page.

Figure A.15. The Avitek InWeb intranet page.

The username and password should already be filled in for you, but if they are not, enter jtang for the username and password for the password. Log in to the portal to get Jason’s home page, shown in Figure A.16.

Jason’s home page.

Figure A.16. Jason’s home page.

An order-tracking Web service called Avitek Tracking has already been created that enables Jason to track orders better. Before the Avitek Tracking Web service was available, each functional component needed a proprietary point-to-point integration with the back-end systems.

The order-tracking Web service acts as an integration point for three internal systems: material requirements planning (MRP), order management, and inventory. The Web service communicates with these services through WebLogic Workshop Controls and WebLogic Integration. Additionally, the order-tracking Web service integrates information from a shipping partner’s Web service. These systems are brought together under a single Web service that provides shipping details and order status to a portlet in the Avitek InWeb portal.

On the left side of the window, under the Avitek Alerts section, click the Deploy Avitek Tracking link on Jason’s home page to deploy the Web service. After you have deployed the Web service, you need to refresh the page to see two additional tabs, Product Status and Order Status.

Under the Covers of the Order-Tracking Web Service

WebLogic Workshop makes creating a Web service easier. Start Workshop by choosing Start, All Programs (Windows XP) or Programs, BEA WebLogic Platform 7.0, WebLogic Workshop, WebLogic WorkShop (Windows 2000). In Workshop, open the order-tracking Web service by choosing File, Open Project. Click the Choose Directory button in the dialog box to open an informational dialog box; continue by clicking OK. Next, navigate to the c:eaweblogic700samplesplatformdemoDomainapplicationsAvitekTracking directory (it should be three directories up and then three down a different branch) and click the Open Project button. Last, select AvitekTracking.jws under the Project Tree section to see a view of the order-tracking Web service, as shown in Figure A.17. You can also double-click AvitekTracking.jws.

The Avitek Tracking Web service in WebLogic Workshop.

Figure A.17. The Avitek Tracking Web service in WebLogic Workshop.

By examining the Avitek Tracking Web service, you can see how it is constructed to expose the functionality of underlying systems. For example, the MRP system is backed by a database table in this case. You can modify the SQL used to retrieve information from this system.

You can view the Java code for the Avitek Tracking Web service by clicking the Source View tab for AvitekTracking.jws, as shown in Figure A.18.

The source view for the Avitek Tracking Web service.

Figure A.18. The source view for the Avitek Tracking Web service.

Using the New Web Service

After the new Web service is deployed, you can see its functionality by selecting the Product Status tab at the top of the page. This step displays a page containing better status information and functionality than the previous system had (see Figure A.19).

The new Product Status page.

Figure A.19. The new Product Status page.

The new functionality includes two new portlets: Product in Transit Detail and Outstanding Product. The Product in Transit Detail portlet, accessed via the Product Status tab, provides new functionality to give Jason detailed information about in-transit orders. It performs this functionality through the Web service that interacts with a Web service at the shipping vendors. This portlet can supply additional information about a particular shipment when you click the Details link at the right side of each order summary line. Clicking this link displays a page that shows in detail the order’s movement through the system, based on information from the shipper’s Web service (see Figure A.20).

The detailed view in the Product in Transit Detail portlet.

Figure A.20. The detailed view in the Product in Transit Detail portlet.

The detailed view also ties in with the shipping vendor’s messaging system so that Jason can contact a representative with any questions. Being able to track the order and resolve any issues quickly helps Jason solve any delivery problems.

The other portlet, Outstanding Product, uses the new Web service to poll a vendor’s Web service asynchronously for detailed status information on an order. This functionality enables Jason to get a better insight on each order’s status in the supply chain and gives him detailed information on any delays. Click the Refresh button at the lower left of this portlet (not the browser’s Refresh option) to see that the status of some orders has changed.

The new Avitek Tracking Web service has helped Jason gain control over the ordering process, which, in turn, helps Avitek supply the products its customers want on time.

Use Case Three: WebLogic Integration Features

The use case for the third use case of the example explores the implementation of the Avitek InWeb portal, which uses WebLogic Integration to communicate with Avitek’s back-end inventory management systems and partner supply networks. This communication enables Jason, in his role as purchasing agent, to view existing inventory. In this scenario, Jason is notified that the quantity of AviPix 1000 cameras in the inventory is below the minimum required stock level. He needs to figure out why the stock is low and how he can best fix the problem.

To get to the third use case, use the same process you used in the second use case: Click the Visit the Site link under the Intranet section on the main page. Log in as username jtang with the password of password. At the bottom of the window, notice that the AviPix 1000 camera is highlighted. Click the Check Parts Inventory button to determine why the stock is low on this camera (see Figure A.21).

The Avitek purchasing process, showing the low inventory.

Figure A.21. The Avitek purchasing process, showing the low inventory.

From this view of the Product Parts Inventory, you can see that the lens for the AviPix 1000 is below the minimum quantity needed. Jason decides to get a quote from his suppliers to bring the inventory up to a safe level. He clicks the Request Quote button to the right of the pixlens1000 line to get a price and availability quote (see Figure A.22).

Getting a price and availability quote after clicking the Request Quote button.

Figure A.22. Getting a price and availability quote after clicking the Request Quote button.

As shown in Figure A.22, after you click the Request Quote button, the system determines that Jason needs at least 325 lenses. He decides he is willing to pay $50 for the lenses, so acting as Jason, enter 50 in the Unit Price text box, select a date that falls after the current date, and click the Send QPA Request button. (You might have to wait a few seconds after clicking Send QPA Request before a quote is available.) The request is sent to the suppliers who can handle a request for the lenses. The suppliers then decide if they will accept the price and delivery date. If so, they respond with their bid. Click the Check for Quotes button under the Quotes for Price and Availability section. The resulting page shows you that two suppliers have bid on the order (see Figure A.23).

Reviewing the information in the Quotes for Price and Availability section.

Figure A.23. Reviewing the information in the Quotes for Price and Availability section.

As the next step in this process, Jason would select one of the suppliers and create an electronic purchase order. Acting as Jason, select either supplier and then click the Create Purchase Order button. An order is automatically created and displayed in the Purchase Order for Review section, as shown in Figure A.24.

Creating a purchase order.

Figure A.24. Creating a purchase order.

The purchase order page shows information about the purchase order; Jason would use this page to submit his purchase order. Acting as Jason again, click the Submit Purchase Order button to send the purchase order to the vendor. This action takes you to a page showing your outstanding orders (see Figure A.25). The system might take a few seconds to display your new purchase order. To check whether the purchase order has been received and accepted, click the Check P.O. Acknowledgement button.

The Outstanding Orders page, showing the new purchase order.

Figure A.25. The Outstanding Orders page, showing the new purchase order.

Under the Covers of the Third Use Case

The third use case relies on the features of WebLogic Integration (WLI) to translate between the Avitek inventory system and the suppliers. The communication takes place via Electronic Business using Extensible Markup Language (ebXML). ebXML is a standard business-to-business communication protocol created by the United Nations Center for Trade Facilitation and Electronic Business (UN/CEFACT) and OASIS. OASIS is a nonprofit, global consortium that drives the development, convergence, and adoption of e-business standards. To view the work that WLI is doing, run WebLogic Integration Studio. From the Windows Start menu, choose BEA WebLogic Platform 7.0, WebLogic Integration 7.0, Studio. A dialog box opens, asking for login information. Enter admin for the username and security for the password. Also, you must change the URL to use port 7501, so change t3://localhost:7001 to t3://localhost:7501. In WebLogic Integration Studio, you might have to change the setting in the Organization drop-down list from CDExpress to ORG1. Select ORG1 in the drop-down list to get the initial WebLogic Integration Studio window shown in Figure A.26.

The initial WebLogic Integration Studio window.

Figure A.26. The initial WebLogic Integration Studio window.

Next, you should examine the instance of the template used for the third use case. In the tree view on the left, open the Templates item. Right-click on E2E_BuyerQPAProcessor and select Instances to display a window with the instances of the E2E_BuyerQPAProcessor template. Double-click the instance shown to see the flowchart view of the process (see Figure A.27).

WebLogic Integration Studio showing the flowchart of the service behind the third use case.

Figure A.27. WebLogic Integration Studio showing the flowchart of the service behind the third use case.

It is also interesting to see the workflow required to run this instance. Click the Display as a List icon (second from the left on the icon bar, showing the mouseover text Display as list) to see the steps involved (see Figure A.28).

WebLogic Integration Studio showing the workflow of the service behind the third use case.

Figure A.28. WebLogic Integration Studio showing the workflow of the service behind the third use case.

Summary

This example shows some of the features of WebLogic 7 Platform. Not all features of the products that make up WebLogic Platform have been examined, but this example gives you an introduction to many of the highlights. All the source code and JSP for this example are available in the c:eaweblogic700samplesplatformdemoDomaineaAppse2eAppsrc directory. Feel free to experiment with this example to help you understand the platform better.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset