Portlet Factory, Version 6.1.2


 

Creating a new model wizard

You can create your own wizard for creating a model in IBM® WebSphere Portlet Factory. Your wizard appears as additional choice in the Select Model dialog that appears whenever you create a new model. It is easy to build such a wizard because the same tools and technologies used for making model-based builders are used to create wizards.

To create a wizard that builds a new model:

  1. Create a model containing the builders you want to have in the model that is generated when your wizard is run.

  2. Profile any inputs that you want to expose as inputs in the wizard.

    If there are builders you want to conditionally appear, profile the Enable Builder property of that builder.

  3. In Builder Skeleton builder and pick the Model-Based Wizard choice.

    Fill in the inputs much as you would for a model-based builder, including specifying the parameters of each of the wizard inputs. You will probably want to enable the Generate Coordinator choice.

  4. In the Builder Pages section, type in the names and text for your wizard pages.

  5. In the Builder Inputs section, set the Page ID input for the page where you want each input to appear.

    Note: The Page ID input appears only if you are creating a wizard since it is not used for builders.

  6. Click OK and Builder Skeleton generates the following items.

    A .wdef file that defines the wizard

    .wdef files are just like .bdef files, except that they have extra PageDefinition and Page elements to control wizard pages. The Domain elements in the .wdef must be set to the builder domain plus _Wizard. For example, WebApp_Wizard.

    A starter coordinator class

    This class can be used to provide custom logic when the wizard is running, in the same way that a Builder Coordinator does for a builder.

  7. To see your new wizard in action, restart WebSphere Portlet Factory Designer and, in the builder picker, navigate to and click the entry for the wizard.

At this point you can work with your Coordinator class to control things like showing or hiding inputs, or setting any inputs that need to be calculated based on other inputs. You can also edit your .wdef, for example to adjust the InputDefinitions. You can take advantage of all the functionality available there, including the ability to inherit input types and even to inherit Coordinator functionality.

For an example of a simple wizard, the Tutorials and Samples Builders feature set has a wizard called Sample Main and Page. You can examine and modify the .wdef, Coordinator, and base model for that wizard.

Parent topic: Overview of builder architecture


Library | Support |