WebStart Wizard SDK Tutorial for Hierarchical Wizards


CONTENTS

  1. Introduction: Hierarchical Wizards

  2. The Basics

  3. Step-by-Step Install Wizards Example

  4. Conclusion


1. Introduction: Hierarchical Wizards

This tutorial covers the basic notion of a hierarchical wizard, and how to use these concepts to implement a set of hierarchical wizards. It is assumed that you have a basic understanding of Web Start Wizards, and their purpose. It is also assumed that you have read and understood the Hierarchical specification from the SDK Userguide.

The Web Start Wizard API can be used to create singular wizards that are designed to do a specific task, such as doing disk defragmentation. The user steps through a sequence of screens and performs the task, then exits. This is the standard usage for the wizard model.

Another possibility is that someone wants to perform many tasks, each of which has an associated wizard already designed to perform the task. In this case, rather than having the user run each separate wizard, they can be combined, or aggregated to form a single wizard, with each wizard part of a hierarchy, with one wizard at the top of the hierarchy in a tree-like fasion. This is what is known as hierarchical wizards, where all wizards work together to perform many tasks, while providing a single user interface experience.

A wizard hierarchy allows multiple wizards to work together. For example, one application of wizards is software installation. Generally, an install wizard would be designed to install a single product. It would be nice if multiple products could be installed from the same wizard. A CD-ROM with four products on it could be installed from a single wizard in the root directory of the CD-ROM that connects four single product install wizards into one user experience. The wizard hierarchy preserves the user's ability to use the single product install wizards, as well as provide a multi-product installation solution described above.

2. The Basics

Every wizard has a sequence of components, some of which are actual graphical panels, others of which are groups, or containers of panels, called Nodes that it steps through to provide the user experience. A set of components can grouped by adding them all to a Node, which is a container for components. This subtree of components will then be visted in left-to-right order. In an upper-level wizard, custom nodes can be created and placed into the tree that do more than just group components together. One special type that we have provided in the Web Start Wizards SDK is the HierarchyNode.

The HierarchyNode is a special type of grouper (container). The HierarchyNode does dynamic, or run-time, grouping of components. It collects it's components at runtime from other wizards that exist in the same VM. When the user clicks next and advances onto one of these HierarchyNodes, the node goes off and retrieves the components that it should contain at that time, then automatically adds the group of components to itself, causing the user to proceed automatically onto the sequence of components that the HierarchyNode gathered.

These HierarchyNodes are used in a top-level wizard, or "connector" wizard as they are sometimes called, to group similar sets of components from lower-level wizards, and to display all of the similar groups of components at the same time. They will, at runtime, collect groups of components from other wizards and add them into a single set of panels, grouped by a HierarchyNode.

  • How does a HierarchyNode know which components to aggregate?

    First and foremost, HierarchyNodes only exist in connector wizards. The lowest-level wizards have no knowledge of what might be in the upper-level wizards.

    In a lower-level wizard, the only components that are candidates for later aggregation into an upper-level wizard are those components that exist directly below the root node in the client panel tree. When building the lower-level wizards, care must be taken to give a name to the WizardComponents that might be later aggregated into a HierarchyNode in a top-level wizard (using the setName() and getName() API, or the API that might exist in the constructor).

    Then, when building an upper-level, or connector wizard, care must be taken to name the HierarchyNode with the same exact name as the components that this HierarchyNode is supposed to aggregate. This is how the HierarchyNode knows which components to gather. These topics are discussed below.

    3. Step-by-Step Install Wizards Example

    Suppose you have many products, each of which you want to be able to install separately. You can create separate wizards for each of your products and ship them separately. You can also create a top-level wizard, and combine all of your product-level wizards into a hierarchy, and have them all install in a single user experience. This is the goal of the hierarchical wizards paradigm.

    An example of this is Sun Microsystems' Solaris Easy Access Server product. This product contains several other products, each of which might be installed separately. In addition, you can install the entire product by using a single wizard, which pulls pieces of each lower-level, or product-level, wizard, into a single wizard. The pieces pulled are the pieces that are responsible for customizing the install, such as install location, which components to install, etc.

    4. Conclusion

    This tutorial has shown how to use the Install API to create wizards that can later be aggregated by upper-level wizards, using the HierarchyNode concept. Generic non-install Wizards can also be created, and, using a HierarchyNode, components can be referenced from upper-level wizards and be stepped through.

    The wizard hierarchy is not limited to one or two levels. Any number of upper-level wizards can be created. In this example, we have shown a product level install wizard and an upper level install wizard put together in a wizard hierarchy. A level above that upper level could be created to allow one installer to install products from multiple connector installers.


    This concludes this Hierarchy Tutorial. For more information on creating wizards for Solaris, please visit our website at www.sun.com/solaris/webstart/wizards/.