Adding a new custom service to the Management Center

You can define a custom service and associate it with a Management Center business object definition. Use a custom service to perform a processing action on a business object. For example, to activate a promotion. Do not use a custom service to perform the basic business operations: Create, Update, and Delete.

Before you begin

Before you customize the Management Center user interface, ensure you have customized the persistence layer and the Business Object Manager:
  1. Created a new WebSphere Commerce table in the schema.
  2. Generated object relational metadata and the physical SDO.
  3. Configured the Business Object Manager to include new properties in user data.
  4. Updated query templates for read and update.
  5. Created a Struts action that maps the processing action to a component service.

Procedure

  1. Open WebSphere Commerce Developer and switch to the Enterprise Explorer view.
  2. Complete one of the following steps:
    • WebSphere Commerce Version 7.0.0.0Feature Pack 1In the Enterprise Explorer view, expand LOBTools > WebContent > WEB-INF > src > lzx > commerce > Management_Center_component > objectDefinitions, where Management_Center_component is the name of the tool you want to customize. Custom services are declared as child nodes of primary object definitions using lzx/commerce/foundation/restricted/CustomService.lzx/wcfCustomService.
    • Introduced in Feature Pack 2In the Enterprise Explorer view, expand LOBTools > WebContent > config > commerce > Management_Center_component > objectDefinitions, where Management_Center_component is the name of the tool you want to customize. Custom services are declared by adding CustomService elements as child elements of primary object definitions.
  3. Identify the file that contains the object definition that you want to add the custom service to. Open the file and locate:
    • WebSphere Commerce Version 7.0.0.0Feature Pack 1the object definition class
    • Introduced in Feature Pack 2the object definition
  4. Update the object definition with the custom service. The following examples demonstrate:
    OptionDescription
    WebSphere Commerce Version 7.0.0.0Feature Pack 1The instantiation of a custom service that activates a promotion WebSphere Commerce Version 7.0.0.0Feature Pack 1The custom service declaration includes an enablement condition that ensures that the action is only available when the promotion is inactive.
    <wcfCustomService url="/cmc/ActivatePromotion" toolbarIcon="activateToolbarIcon" 
       displayName="${promotionResources.promotionList_activate_displayName.string}">
       <wcfEnablementCondition conditionId="activate" propertyName="status" enablementValue="Inactive" />
       <wcfServiceParam name="promotionId" propertyName="promotionId"/>
    </wcfCustomService>
    Introduced in Feature Pack 2The declaration of a custom service that activates a promotion Introduced in Feature Pack 2The custom service declaration includes an enablement condition that ensures that the action is only available when the promotion is inactive.
    <CustomService url="/cmc/ActivatePromotion" toolbarIcon="activateToolbarIcon" 
       displayName="${promotionResources.promotionList_activate_displayName}">
       <EnablementCondition conditionId="activate" propertyName="status"
    	enablementValue="Inactive" />
       <ServiceParam name="promotionId" propertyName="promotionId"/>
    </CustomService>

What to do next

After you complete your customization:
Version Steps
  1. Right-click LOBTools Project; then click Build OpenLaszlo Project to produce an updated ManagementCenter.swf file under the workspace_dir\LOBTools\WebContent directory. This setting is the default environment setting.
  2. Test your changes by viewing them in the Management Center, using this URL: https://hostname:8000/lobtools.
  3. Deploy your changes to your production environment.
Introduced in Feature Pack 2
  1. Test your changes by viewing them in the Management Center, using this URL: https://hostname:8000/lobtools.
  2. Deploy your changes to your production environment.