Running the Demo


The following steps below describe how Developer 1, Developer 2, and the end user use Network Deployment in the Travel Services Demo. These sections assume the instructions in the sections above have been completed successfully.

Stocking the FlightInfoDap and FlightSelector beans

In this section, Developer 1 stocks the FlightInfoDap bean in FlightInfo.jar to Warehouse Server 1 and lists it on the Catalog Server 1. He then stocks the FlightSelector bean to Warehouse Server 1, and adds a catalog item for it on Catalog Server 1.

For the purposes of this demo a version of FlightInfo.jar has been provided. Since it will be overwritten with a newer version later on, copy the file to a temporary location, for example d:\tmp. Assuming Bean Extender is stored in x:\product, copy x:\product\jars\FlightInfo.jar to d:\tmp.

To stock FlightInfo.jar to the warehouse, perform the following steps:

  1. Start the Client standalone GUI by typing, java com.ibm.beans.netdeploy.client.ClientMain in a command line window.
  2. Select Stock Warehouse Content and click on the Next button .
  3. Assuming you copied FlightInfo.jar into d:\tmp, enter d:\tmp\FlightInfo.jar into the Pathname of content field. and click on the Next button.
  4. You can skip the Externally visible classnames of content panel by clicking on the Next button (Note: this panel is used to specify all class names that might be referenced externally so that classes comprising the warehouse item being being added can be located and dynamically downloaded with com.ibm.beans.netdeploy.client.NetworkClassLoader.)
  5. FlightInfo.jar has no dependecies, so you can skip this Dependency panel by clicking on the Next button.
  6. Finally, select Commit Current Content & perform Operation and click on the Next button to stock the content on the Warehouse Server. When the operation is complete, you will advance to the next panel.
  7. This panel displays the results of the operation. Press the Next button to return to the main panel.
  8. Deselect Stock Warehouse Content in the main panel.
Now, add a catalog item for the FlightInfoDap bean to Catalog Server 1 by performing the following steps:

  1. In the Stock/Restock/Order operations panel, select Stock Catalog Content and click on the Next button.
  2. Click on the Browse Navigator button to bring up the Client Path Dialog window.
  3. Enter travel.flight.dap in the Path Node Name field. You can enter any path title and path description. Click on the OK button to close the window. This returns you to the original panel. Press the Next button to continue to the next panel.

    Note: The title and description just entered describe the path you are adding. Each path you add can have a title and description. The actual catalog item title and description will be entered next. The path title, for example, is displayed whenever the mouse pointer is on the end node of a previously entered path. The title and description for a catalog item do not display until you click on the icon representing that catalog item.

  4. Now, enter "FlightInfoDap Bean" in the Title field and enter some description. Click on the Next button when you are done.
  5. In this step, the new catalog item will be associated with the FlightInfoDap bean. Click on the Browse Client Registry button to display the Warehouse Table Entry Viewer dialog. From this dialog, select the warehouse content which is to be associated with this catalog item. Select the entry for FlightInfo.jar. Press the Done button to close it and return to the original panel. With this association now created, the catalog item, once added, can be used to order FlightInfo.jar. Click on the Next button to continue to the next panel.
  6. In this step, optionally enter any attribute/value pairs desired. Attributes can be used to restrict catalog queries to catalog entries with specified attribute values. For example, since this catalog item represents a Java bean, you could specify PLAT=ALL since your bean will run on all platforms. There are no predefined attributes. Click on the "Add" button to add each attribute and value. When all desired attribute/value pairs have been entered, click on the Next button to continue to the next panel.
  7. Next, enter any relevant keywords which might help users to locate this catalog item in catalog searches. When all desired keywords have been entered, click on the Next button to continue to the next panel.
  8. Catalog items can contain references to other catalog items. The "Specify References for the Catalog Item" panel is used to add such references. However, this feature is not yet exploited by the Network Deployment client. Press the Next button to skip to the next panel.
  9. Next select Commit Current Content & Perform Operation and click on the Next button to list the FlightInfoDap bean in the Catalog. When the operation is complete you will advance to the next panel.
  10. This panel displays the results of the operation. Press the Next button to return to the main panel.
  11. Deselect Stock Catalog Content in the main panel.
The steps required to stock FlightSelector.jar to the warehouse will be very similar to the steps taken to stock FlightInfo.jar. To stock FlightSelector.jar to the warehouse, use the Client standalone GUI to perform the following steps:
  1. Select Stock Warehouse Content and click on the Next button .
  2. Enter the fully-qualified pathname to the content next to "Pathname of content" label. Assuming Bean Extender is stored in x:\product, enter x:\product\jars\FlightSelector.jar and click on the Next button.
  3. As before, you can skip the Externally visible classnames of content panel by clicking on the Next button.
  4. Since the FlightSelector bean is dependent on the FlightInfoDap bean, FlightInfo.jar must be listed as a dependency. Click the Browse Client Registry to display the Warehouse Table Entry Viewer window. From there, select the entry for FlightInfo.jar and press the Done button. Press the Next button to continue to the next panel.
  5. Finally, select Commit Current Content & perform Operation and click on the Next button to stock the content to the Warehouse Server. When the operation is complete, you will advance to the next panel.
  6. This panel displays the results of the operation. Press the Next button to return to the main panel.
  7. Deselect Stock Warehouse Content in the main panel.
Adding a catalog item for the FlightSelector bean will be very similar to the steps taken to add a catalog item for the FlightInfoDap bean. To add a catalog item for the FlightSelector bean to Catalog Server 1, perform the following steps:
  1. Select Stock Catalog Content and click on the Next button
  2. Click on the Browse Navigator button to bring up the Client Path Dialog window.
  3. Enter travel.flight.viewer in the Path Node Name field. Enter a path title and path description. Click the OK button to record the data and close the window. Press the Next button to advance to the next panel.
  4. To enter catalog item data, enter "FlightSelector" in the Title field and enter a description. Click on the OK button when you are done.
  5. In this step, the new catalog item will be associated with the FileSelector bean. Click on the Browse Client Registry button to display the Warehouse Table Entry Viewer dialog. From this dialog, select the warehouse content which is to be associated with this catalog item. In the case, select the entry for FlightSelector.jar. Press the Done button to close it and return to the original panel. With this association now created, the catalog item, once added, can be used to order FlightSelector.jar. Click on the Next button to continue to the next panel.
  6. As with the FlightInfoDap bean, enter any attribute/value pairs desired, such as PLAT=ALL. Click on the "Add" button to add it. When all desired attribute values have been added, press the Next button.
  7. Again, as with the FlightInfoDap bean, add any relevant keywords and press the Next button.
  8. As before, press the Next button to skip the Specify References for the Catalog Item panel.
  9. Next select Commit Current Content & Perform Operation and click on the Next button to list this FlightSelector bean on the Catalog Server. When the operation is complete, you will advance to the next panel.
  10. This panel displays the results of the operation. Press the Next button to return to the main panel.
  11. Deselect Stock Catalog Content in the main panel.

Creating and stocking the TravelDemo bean

In this section, Developer 2 in this scenario is going to build Travel Demo consisting of FlightSelector bean (in FlightSelector.jar), the FlightInfoDap bean (in FlightInfo.jar), and the Itinerary bean (Travel.jar). Itinerary depends on the following jar files at runtime: controls.jar, media.jar, calendar.jar, and awidgets.jar. It is assumed that Developer 2 already has Travel.jar, controls.jar, media.jar, and calendar.jar, and that they are not available on any warehouse. Make sure these jar files are in your CLASSPATH, as described in the section Start Warehouse Server 2 and the Client Daemon on the second machine.
  1. Start the Assembly Surface. Enter
    java com.ibm.beans.tools.assembly.AssemblySurfaceMain
    to start the Assembly Surface.
  2. Add the FlightSelector bean. In the Repositories panel under the Beans tab, press the Add network repository button. This brings up the Network Deployment Catalog window. In this window, open the catalog top-level folder. Inside that folder, you will find a travel folder. Open it and the flight folder inside it. You will then find the two entries: dap and viewer. Click on viewer, and the Open network repository button will then be enabled. Press the Open network repository button. A viewer repository is created with a tab of the same name. In the viewer tab, you will see an icon for the FlightSelector bean. Click on the icon and press the Add beans button at the bottom of the Assembly Surface.
  3. Add the FlightInfoDap bean. In the Repositories panel under the Beans tab, press the Add network repository button. Perform the same actions as with FlightSelector.jar above, but this time, select the icon labled dap under the travel folder. As before, a new repository is added to the Assembly Surface this time with a label of dap. Click on the dap tab and you will see an icon for the FlightInfoDap bean. Click on it and press the Add beans button at the bottom of the Assembly Surface.
  4. Add Itinerary bean. In the Repositories panel under the Beans tab, press the Add file repository button. Using the file dialog that pops up, select the file x:\product\jars\Travel.jar. A new repository is added to the Assembly Surface with a label of Travel.jar. Click on the Travel.jar tab and you will see an icon for the Itinerary bean. Click on it and press the Add beans button at the bottom of the Assembly Surface.
  5. Layout the Itinerary bean. Click on View/Layout from the menu bar. The Layout notebook page is displayed in the center section of the Assembly Surface working area and the Layout tab is added to the view.
  6. Connect the FlightSelector bean to the Itinerary bean:
    A. Click on View/Event Connections on the menu bar.
    B. Connect the FlightSelector bean to the Itinerary bean by picking the following connections from the Event Connections view:

    Event Source

    FlightSelector

    Source Events

    FlightRequested

    Event Targets

    Itinerary

    Target Methods

    FlightRequested

    The columns are filled in automatically as you make selections from left to right, so your choices are limited.

    C. Click on the Connect button at the bottom of the Assembly Surface. The current event connections are displayed at the bottom of the Event Connections notebook page.
  7. Connect the Itinerary bean to the FlightInfoDap bean:
    A. Click on View/Event Connection on the menu bar.
    B. Pick the following connections from the columns in the Event Connections view:

    Event Sources

    Itinerary

    Source Events

    TravelInfoChanged

    Event Targets

    FlightInfoDap

    Target Methods

    TravelInfoChanged

    C. Click on the Connect button at the bottom of the Assembly Surface. The current event connections are displayed at the bottom of the Event Connections notebook page.
    D. Connect the FlightInfoDap bean to the FlightSelector bean by selecting:

    Event Sources

    FlightInfoDap

    Source Events

    FlightInformationChanged

    Event Targets

    FlightSelector

    Target Methods

    FlightInformationChanged

    E. Click on the Connect button at the bottom of the Assembly Surface. The current event connections are displayed at the bottom of the Event Connections notebook page.
    F. Connect the Itinerary bean to the FlightInfoDap bean by selecting:

    Event Sources

    Itinerary

    Source Events

    FlightRequested

    Event Targets

    FlightInfoDap

    Target Methods

    FlightRequested

    F. Click on the Connect button at the bottom of the Assembly Surface. The current event connections are displayed at the bottom of the Event Connections notebook page.
    G. Connect the FlightInfoDap bean to the Itinerary bean by selecting:

    Event Sources

    FlightInfoDap

    Source Events

    FlightReserved

    Event Targets

    Itinerary

    Target Methods

    FlightReserved

    H. Click on the Connect button at the bottom of the Assembly Surface. The current event connections are displayed at the bottom of the Event Connections notebook page.
  8. Script the FlightSelector bean and the Itinerary bean to interact. This procedure sets up three scripts as the first step toward making the FlightSelector bean respond to events from the DAP and the itinerary. To define these scripts:
    A. Click on View/Scripting on the menu bar to display the Scripting notebook page, if the Scripting view is not already displayed. Three icons and a combination box are displayed on the notebook page.
    B. Click on the blue ball icon. A tree view of available objects to script is displayed.
    C. Click on the Script0 object.
    Note:You can select the Script0 object by clicking on the "Script0" text.
    The center section divides into two sections. The left section continues to display the tree view of available objects to script. The right-hand section is a scripting area containing:
    • An icon in the upper left-hand corner.
    • A combination box beside the icon.
    • A text area beneath the icon and combination box.
    D. Click on Script Globals in the combination box at the top of the new (right-hand) section.
    E. Click on the text area and enter:
    java.awt.Frame myFSFrame=null;
        
    F. Click on public void initialize() in the combination box.
    G. Click on the text area. Ensure that the cursor is positioned between the curly braces and enter:
    myFSFrame=new java.awt.Frame();
        myFSFrame.add(FlightSelector);
        myFSFrame.pack();
        
    H. Click on the FlightSelector bean in the tree view of available objects to script.
    I. Click on public void FlightSelector_actionPerformed(java.awt.event.ActionEvent arg0 in the combination box.
    J. Click on the text area. Ensure that the cursor is positioned between the curly braces and enter:
       myFSFrame.setVisible(false);
        
  9. Script the FlightSelectorDap bean and the FlightSelector bean to interact:
    A. Click on FlightInfoDap bean from the list of instantiated beans.
    Note:Click on the word "FlightInfoDap" not on the plus sign (+) beside it.
    B. Click on public void FlightInfoDap_FlightInformationChanged(...) in the combination box.
    C. Position the cursor between the curly braces and enter:
    Point pt = Itinerary.getLocationOnScreen(); myFSFrame.setLocation(pt);
        myFSFrame.setVisible(true);
        FlightSelector.setVisible(true);
        
    Alternatively, if you have the code in a file, you can click on the icon above the curly braces (the icon that resembles a piece of paper) to import the contents of the file.
  10. Clean up the Assembly Surface:
    A. Remove the Event Connections view from the Assembly Surface. You can either right-click the Event Connections tab and click on Close view on the pop-up menu or click on View/Event Connections on the menu bar.
    B. Remove the Scripting view from the Assembly Surface.
  11. Generate the new aggregate bean:
    A. Supply information about the new bean in the Class, Extends, Package, and Repository fields in the control area of the Assembly Surface.

    The class and package cannot be the same and cannot start with a number. For this demo, enter TravelDemo for the class, com.ibm.beans.demos for the package, and d:\path\TravelDemo.jar for the repository, where d:\path is the pathname to the directory where you want to save TravelDemo.jar. Do not change the default contents of the Extends field (the default contents are java.awt.Panel).

    B. Click on the Generate button in the action area of the Assembly Surface. Status messages are displayed in the status area of the action area of the Assembly Surface. The generation is complete when the "Successfully generated..." message is displayed in the status area and the Run button in the action area of the Assembly Surface is enabled. At this point TravelDemo.jar has been saved out.

    Run the new aggregate bean:
    A. Click on the Run button in the action area of the Assembly Surface. A window opens to run the new aggregate bean. This window contains a logo at the top and a row of buttons at the bottom. If necessary, resize the window so that the buttons are visible.
    B. Click the Add Flight button at the bottom of the window. Two input fields are displayed in the right-hand side of the window.
    C. Enter the city of origin (Austin) into the Depart from field and a destination city (either Dallas or Chicago) into the Arrive at field.
    D. Click on the Click HERE to select flight label. The FlightSelector bean displays the corresponding flight choices for the stated parameters in a new window. Click on the desired flight and click on the Ok button. Information about the selected flight is displayed in the main window of the aggregate bean. To select alternate flights, click on the Click HERE to select flight label again and repeat the procedure. To add additional flights, click on the Add Flight button at the bottom of the window and repeat the procedure.
    E. When finished viewing the running aggregate bean, close the window by clicking the Stop button in the action area of the Assembly Surface.

  12. Open the Network Deployment view. Select the Views/Network Deployment menu item. The Network Deployment Client GUI will appear as an Assembly Surface view.
  13. Stock the TravelDemo bean to the warehouse. This procedure is very similar to the one Developer 1 followed to stock jar files to the warehouse, except in this case, much of the data is already filled out for you. In particular, note that dependencies available as warehouse items are already listed.

    Note: You will receive a warning that Travel.jar could not be added to the dependency list. This is a normal situation arising from the fact that the TravelDemo bean is dependent on a bean not obtained from a warehouse. Any user who orders the TravelDemo bean must know of this dependency and ensure that Travel.jar is added to their CLASSPATH. The catalog is a good place to note this type of information.

  14. Add a catalog listing for the TravelDemo bean to the warehouse.. This procedure is very similar to the one Developer 1 followed to add a catalog item to the catalog. Follow the same procedure, except specify a path of travel.flight.traveldemo.
  15. Close the Network Deployment view by clicking on the Views/Network Deployment menu item.

Ordering and running the TravelDemo bean

In this section, the end user, on machine 3, runs the standalone Network Deployment client GUI to browse the catalog and order the TravelDemo bean.

To order the TravelDemo bean, perform the following steps:

  1. Start the Client standalone GUI by typing, java com.ibm.beans.netdeploy.client.ClientMain in a command line window.
  2. Select Place Order and click on the Next button to proceed to the next panel.
  3. Press the Browse Navigator button to diplay the Client Navigator Dialog window. In this window, open the catalog top-level folder. Under inside that folder, you will find a travel folder. Open it and the demo folder inside it. You will then find the an entry labeled traveldemo. Select it by clicking on it. The title and description for the TravelDemo bean's catalog item should appear. Also, the OK button will then be enabled. Press the OK button to return to the original panel. Once back in the Client GUI panel, press the Next button to proceed to the next panel.
  4. Enter the pathname to the subdirectory into which you want to download the TravelDemo bean on your machine. The subdirectory specified should be in your CLASSPATH. Press the Next button to proceed to the next panel.
  5. You can choose to request a one-time order or a subscription. A one-time order can always be updated with the latest version with manual initiation. A subscription will cause your Network Deployment client daemon to daily check the warehouse for updated content, and update your machine with any updated content. Choose either option and press Next to proceed to the next panel.
  6. In this panel, click the checkbox to indicate that you want to go through with the order. Press Next to begin processing. After processing is complete, you will advance to the next panel.
  7. At this point the order is complete. This panel displays the order results. Press Next to return to the main client panel.
  8. Deselect Place Order in the main panel.
Since the TravelDemo bean has runtime dependencies that are not stored on any warehouse, we will assume that she has obtained these dependencies according to the instructions posted in the TravelDemo bean catalog entry and added the jar files to her CLASSPATH. Dependencies which reside on a warehouse, such as FlightInfo.jar, are downloaded automatically and extracted (if a jar or zip file) into the order directory, which should be in the CLASSPATH.

As mentioned in Start the Client Daemon on the third machine, the jar files Travel.jar, controls.jar, media.jar, calendar.jar, and awidgets.jar must be included in your CLASSPATH.

To run the TravelDemo bean, perform the following steps:

  1. From a command line window, type the following command:

    java com.ibm.beans.tools.BeanLauncher com.ibm.beans.demos.TravelDemo

Restocking warehouse with modified version of the FlightInfoDap bean

In this section, Developer 1 has made a modification to the FlightInfoDap code and wants to restock the warehouse with this new version of FlightInfo.jar. As before, his Network Deployment client is connected to Warehouse Server 1 and Catalog Server 1.

The modification to FlightInfoDap has already been made for you for the purposes of this demo. In this scenario, the FlightInfoDap code was changed to fix a bug that prevented some flights from being displayed. The newer version will display more flights.

Assuming that you copied FlightInfo.jar to the temporary directory d:\tmp as described in Stock and list the FlightInfoDap and FlightSelector beans, copy the newer version of FlightInfo.jar to your temporary directory by running the following command:

java com.ibm.beans.mb.gel x:\product\src\com\ibm\beans\demos\travel\flight\modified\FlightInfo.jar d:\tmp\FlightInfo.jar

Note: Even though the above command effectively copies the file, it ensures that the timestamp of the new file set to a more recent time than the file it is overwriting. This is necessary for order updates to function properly.

To restock FlightInfo.jar to the warehouse, perform the following steps:

  1. Start the Client standalone GUI by typing, java com.ibm.beans.netdeploy.client.ClientMain in a command line window.
  2. Select Restock Warehouse Content and click on the Next button .
  3. Press the Browse Client Registry button to view the list of warehouse items that have been stocked from or ordered by your client. Select the entry for FlightInfo.jar and press the Done button. Then press the Next button to continue to the next panel.
  4. Since, no changes to any subsequent panels are necessary, continue to press Next until you reach the Perform Current Operation panel.
  5. Finally, select Commit Current Content & perform Operation and click on the Next button to restock the Warehouse with the newer content. When the operation is complete, you will advance to the next panel.
  6. This panel displays the results of the operation. Press the Next button to return to the main panel.
  7. Deselect Restock Warehouse Content in the main panel.
For the purposes of this demo, we will assume that no update to the FlightInfoDap bean's catalog item is necessary.

Updating the TravelDemo order and re-running the TravelDemo bean

In this section, the end user will refresh her TraveDemo order. An order refresh causes updated warehouse items associated with the order to be downloaded to the client, including dependencies. Content is not downloaded again if it has not changed. If the end user has subscribed to the TravelDemo bean, the order will be refreshed for her periodically. In any case, she can manually initiate an order refresh at any time. In this scenario, she will manually initiate the order refresh.

To refresh the TravelDemo order, perform the following steps:

  1. Start the Client standalone GUI by typing, java com.ibm.beans.netdeploy.client.ClientMain in a command line window.
  2. Select Refresh Order and click on the Next button .
  3. Press the Browse Client Registry button to view a list of orders that have placed by the user. Select the entry for TravelDemo and press the Done button. Then press the Next button to continue to the next panel.
  4. Select Commit Current Content & perform Operation and click on the Next button to start the order refresh. You will advance to the next panel when the refresh is complete.
  5. This panel displays the results of the operation. Press the Next button to return to the main panel.
  6. Deselect Refresh Order in the main panel.
Now, run the TravelDemo bean as described above.


[ Top of Page |Previous Page |Next Page | Table of Contents | Documentation Homepage ]