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
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.
Before you begin
Before you add a keyboard shortcut to the Management Center user interface, ensure you have completed the following steps:
- Defined the custom action.
- You can use any combination of keys on the keyboard, to create your keyboard shortcut; however, keep the following logistics in mind when creating the keyboard shortcut:
- Ensure the keyboard shortcut to use for the custom action is not one that is already used for the Management Center. If you define a keyboard shortcut that is already used, when the business user uses the keyboard shortcut, two actions will take place.
- Ensure the keyboard shortcut to use for the custom action is not one that is already used for the browser that the business user will use with the Management Center (that is, Internet Explorer or FireFox).
- The order of the combination of keys is the order that the business user will need to press when using the keyboard shortcut. For example, if you define a keyboard shortcut as shortcutKeys="['Control', '1'], then a business user must hold down the Ctrl key, and then the 1 key on the keyboard.
- Keyboard shortcuts are not case sensitive. For example, shortcutKeys="['Control', 'p'] and shortcutKeys="['Control', 'P' both mean that a user can press the Ctrl key plus the P key (that is, there is no need for the user to press Ctrl+Shift+P).
- Keyboard shortcuts can be any number of keys (including a single key), but consider the usability of complicated or lengthy keyboard combinations. Typically, you do not want to create a keyboard shortcut that involves more than three keys.
To add a custom service to the Management Center :
Procedure
- Open WebSphere Commerce Developer and switch to the Enterprise Explorer view.
- In 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 to customize.
- Open the file that contains the custom service declaration that to modify.
- Within the instance of the wcfCustomService class, include the shortcutKeys attribute within the wcfCustomService tag. Here's an example, which specifies that pressing Ctrl+1 would perform the custom action called "activate":
<wcfCustomService url="/jsp/commerce/test/ActivateTestObject.jsp" displayName="Activate" shortcutKeys="['Control', '1']" toolbarIcon="active"> <wcfEnablementCondition propertyName="active" enablementValue="false"/> <wcfServiceParam name="storeId"/> <wcfServiceParam name="testObjectId" propertyName="testObjectId"/> </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.
Once you have implemented the new keyboard shortcut, to use it, first select the object, and then press the keyboard combination. For example, if you added a keyboard shortcut to activate a Web activity, then select it in the activity from the activities list view, then press the custom keyboard shortcut combination.
Related concepts
Management Center user interface
Related tasks
Add a new custom service to the Management Center