Develop > Presentation layer > Customize WebSphere Commerce Accelerator, Organization Administration Console, or Administration Console > Tools framework > Wizards


Add a wizard

The following files are created or modified by creating a wizard:

Files created:

Files modified:

To add a wizard:


Procedure

  1. Create a wizard definition XML file that describes the flow among panels and data bean usage. Create the file, for example named newWizard.xml, in the directory:

    • WC_INSTALL/xml/tools/componentname

    • workspace_dir/wc/xml/tools/componentname

    where componentname is the name of the component to which the wizard belongs.

    For more information, see the valid XML tags in the Wizard definition.


  2. Register the wizard definition XML file in the resources.xml file for the component you are modifying. Multiple versions of this file exist, one for each component,...

    • WC_INSTALL/xml/tools/componentname

    • workspace_dir/wc/xml/tools/componentname

    Make an entry similar to the following in resources.xml:

    <resourceXML name="sampleWizard" file="componentname/newWizard.xml"/> 
    

    The name attribute becomes a key which will be used in a later step.

    Since the WebSphere Commerce configuration file references the resources.xml files, also update the WebSphere Commerce configuration file to register any new resources.xml files.

    This Sample: Wizard resources.xml file defines several wizards.


  3. Write JSP files for each panel, and JavaScript files as required. These JSP files define the panels that display in the content frame into which users enters data. All of the panels that you create must include the following JavaScript functions:

    Function Name Description
    savePanelData() Stores data from the HTML form into the object model in the parent frame.
    validatePanelData() Validates data entered by user.

  4. Write custom commands to update the database and perform custom functionality. These controller commands update the database with the information entered, or perform some function when the user clicks on the Finish button. See Example: Wizard, dialog or notebook controller command for more information.

    Also, if you chose the panel URL in the wizard XML file to be a viewCommand, write a custom viewCommand.

  5. Register the custom commands and JSP files in the database. Once required commands are created, register them in the database. Verify the URL field in the database matches the value of the finishURL attribute in the XML file. For details on how to register commands see Design patterns.


  6. Create a resource bundle adding text naming each panel. This text appears in the table of contents frame, titling each panel. These files are...

    • WC_EAR/properties/com/ibm/commerce/tools/componentname/properties

    • workspace_dir/wc/properties/com/ibm/commerce/tools/componentname/properties

    where componentname is the component to which you are adding the wizard.

    The following is a example resource bundle based on the data from the wizard XML file in step 1.

    # Panels name for TOC panel
    Profile1=General
    Profile2=Description
    Profile3=Attributes
    Address=Address
    # Button Labels
    sampleButtonName1=Test Button 1
    sampleButtonName2=Test Button 2
    sampleButtonName3=Test Button 3
    

    If national languages are supported, create the national language resource bundles with the appropriate language text. The national language file names must end with the locale supported. For example, for a French-language resource bundle, the file name should be filename_fr_FR.properties

  7. (Optional) Write context sensitive help files for your container element and panels and update the Tools User Interface Center help map XML file to include the help files. See Add context-sensitive help into a Tools User Interface Center for more information.


  8. Add the new wizard to a Tools User Interface Center menu system, for example, WebSphere Commerce Accelerator. Refer to Integrate tools into a Tools User Interface Center for more information.

  9. Launch and test the wizard:

    Stop and start WebSphere Commerce. Test the wizard by launched the menu registered in the previous step. Although not preferred, if it is necessary to launch the wizard outside of the Tools User Interface Center then the URL is:

    https:// host_name :8000/webapp/wcs/tools/servlet/WizardView?XMLFile= sample .sampleWizard

    where sample is a namespace defined in resources.xml.


Related concepts

Tools framework

Wizards


Related tasks

Create branching wizards

Related reference

Wizard navigation behavior

Wizard JavaScript functions

Wizard definition


+

Search Tips   |   Advanced Search