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


Add a universal dialog

The content page in the WebSphere Commerce Accelerator uses the Universal dialog. The examples below refer to this page.


Procedure

  1. Create a universal dialog definition XML file. This file defines all the sections in the universal dialog. This file should be stored...

    • WC_INSTALL/xml/tools/componentname

    • workspace_dir/wc/xml/tools/componentname

    where componentname is the name of the component to which the new universal dialog belongs.

    For content, the universal dialog definition XML file is in the directory:


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

    • WC_INSTALL/xml/tools/component/resources.xml

    • workspace_dir/wc/xml/tools/componentname/resources.xml

    where componentname is the component to which you are adding the universal dialog.

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

    <XML name=" myUniversalDialog" file="component/newUniversalDialog .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.

    For content, the correct resources.xml file is in the following directory:


  3. Create a resource bundle adding text for the universal dialog. The resource bundle files are in the following directory:

    • 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 universal dialog.

    # content panel
    collateralDialogTitle=content Properties
    collateralDialogSuccessConfirmation=The content was successfully saved.
    collateralGeneralPanelPrompt=content Properties
    collateralNamePrompt=Name (required)
    

    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

    For content the resource bundle is...

    • WC_EAR/properties/com/ibm/commerce/tools/campaigns/properties/campaignsRB_locale.properties

    • workspace_dir/wc/properties/com/ibm/commerce/tools/campaign/properties/campaignsRB_ locale.properties

    where locale is the local to which you are adding the universal dialog.

  4. Create any custom JavaScript or JSP files required. Although not necessary, you can define custom JavaScript functions and JSP files. For example, if an already existing JSP segment exists, you can include it as part of the universal dialog.

  5. Write a custom data bean to pre-populate fields. See Use data beans to populate values in a universal dialog and Example: Universal dialog data bean class for more information.

  6. Write custom controller commands for business logic. 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.

  7. Write custom validators, if necessary. WebSphere Commerce provides default Universal dialog JavaScript functions. However, if you require custom functions you can write them and include them in the universal dialog.

    To include them use the <jsfile/> tag for JavaScript or the <include> tag for JSP segments in the universal dialog definition XML file.

  8. Optional: Add context-sensitive help. Refer to Add context-sensitive help into the tools user interface center

  9. (Panel mode only) Create a notebook definition XML file.

    This is almost identical to step 1 in Add a notebook. The only difference is that each notebook panel is a section of the universal dialog. For example,

    <panel name="section1"
    url="UniversalDialogView?XMLFile=common.UDSample2&amp;section=section1"
    
    helpKey="" /> 
    <panel name="section2"
    url="UniversalDialogView?XMLFile=common.UDSample2&amp;section=section2"
    
    helpKey="" />
    

  10. Add the universal dialog to a Tools User Interface Center menu.

    For stand-alone mode, add the new universal dialog to a Tools User Interface Center menu system (for example, WebSphere Commerce Accelerator). Refer to Integrate tools into the Tools User Interface Center for more information.

    For panel mode, follow the same instructions, adding the notebook to a Tools User Interface Center.


Related concepts

Universal dialog

Tools framework

Notebooks


Related tasks

Add a dialog

Add a search dialog

Related reference

Universal dialog runtime flow

Universal dialog JavaScript functions

Universal dialog definition


+

Search Tips   |   Advanced Search