Develop > Presentation layer > Management Center framework > Customize the Management Center user interface > Customizing an existing Management Center tool
Add 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:
- Created a new WebSphere Commerce table in the schema.
- Generated object relational metadata and the physical SDO.
- Configured the Business Object Manager to include new properties in user data.
- Updated query templates for read and update.
- Created a Struts action that maps the processing action to a component service.
To add a custom service to the Management Center:
Procedure
- Open WebSphere Commerce Developer and switch to the Enterprise Explorer view.
- In the Project Explorer view, expand LOBTools > WebContent > WEB-INF > src > lzx > commerce > Management_Center_component >objectDefinitions, where Management_Center_component is the name of the tool to customize. Custom services are declared as child nodes of primary object definitions using wcfCustomService.
- Identify the file that contains the object definition that to add the custom service to. Open the file and locate the object definition class.
- Update the object definition with the custom service. The following example demonstrates the instantiation of a custom service that activates a promotion. The 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>
What to do next
After you complete the customization:
- Right-click LOBTools Project; then click Build OpenLaszlo Project to produce an updated ManagementCenter.swf file under the workspace_dir\LOBTools\WebContent directory. This is the default environment setting.
- Test the changes by viewing them in the Management Center, using this URL: https://hostname:8000/lobtools.
- Deploy your changes to the production environment.
- Add a keyboard shortcut for a new custom service
If you have created a custom service for a Management Center business object, you can also associate a keyboard shortcut for the service.
Related concepts
Management Center user interface