WebSphere Commerce EnterpriseWebSphere Commerce Professional

Declaring a widget manager

A widget manager is responsible for providing the dynamic behavior for one or more widgets. To declare a widget manager, widget managers will use the managerType attribute on a control or table column declaration to determine if it should manage the widget or ignore it.

About this task

To declare a new widget manager:

Procedure

  1. Create a plug-in to hold your extensions.
  2. In your plug-in's plugin.xml file, define an extension to the com.ibm.commerce.telesales.widgets.widgetManagers extension point to declare the widget manager.
  3. Include the widget manager in the definition of the managed composite that includes the controls that the widget manager is going to be responsible for managing. Replace the managed composite with a new one that includes the new widget manager. Use referenceId to pull in the original managed composite definition and then add the new widget manager.

Results

Example:

  • Create a new widget manager class:
    public class ExtendedWidgetManager extends StandardWidgetManager { 
          // Handle your controls here 
    }
  • Extend the widget manager extension point in fragment.xml:
    <extension point="com.ibm.commerce.telesales.widgets.widgetManagers"> 
        <widgetManager 
            id="WidgetManager_ID" 
            managerClass="Fully qualified class path of widget manager class"> 
        </widgetManager> 
    </extension>
  • Associate it with managed composite:
    <extension point="com.ibm.commerce.telesales.widgets.managedComposites"> 
        <managedComposite 
            id="ManagedComposite_ID" 
            compositeId="Composite_ID"> 
            <widgetManager id="WidgetManager_ID"/> 
        </managedComposite> 
    </extension>