Defining a main tool definition
The first step to adding a new custom tool to
the Management Center is to create a new OpenLaszlo library file containing
a class that extends the wcfBusinessObjectEditor class or to create a new definition file containing
a definition that extends the wcfBusinessObjectEditor class.
Before you begin
- 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.
Procedure
- Open WebSphere Commerce Developer and switch to the Enterprise Explorer view.
- Complete one of the following steps:
- In the Enterprise Explorer view, expand .
- In the Enterprise Explorer view, expand .
- Create a directory to store your new file:
Option Description OpenLaszlo library file Use a directory structure similar to the following example: LOBTools/WebContent/WEB-INF/src/lzx/your_company_name/Management_Center_component, where Management_Center_component is the name of your new custom tool. Definition file Use a directory structure similar to the following example: LOBTools/WebContent/config/your_company_name/Management_Center_component, where Management_Center_component is the name of your new custom tool. - Create the new file:
Option Description OpenLaszlo library file Use the following syntax for your library file: ToolNameManagementToolDefinition.lzx
For example, the Catalogs tool business object editor class is contained in a file named CatalogManagementToolDefinition.lzx.
Definition file Use the following syntax for your definition file: ToolNameManagementToolDefinition.def
For example, the Catalogs tool business object editor definition is contained in the file named CatalogManagementToolDefinition.def.
- Within this new file, complete one of the following steps:
Option Description OpenLaszlo library file Create a class that extends the lzx/commerce/foundation/restricted/BusinessObjectEditor.lzx/wcfBusinessObjectEditor class. For example:<library> <class name="extMyTool" extends="wcfBusinessObjectEditor">. <!—- Add the context value definitions --> ... <!—- Add the instantiations for the init service definitions --> ... <!—- Add the instantiations for the filter definitions --> ... <!—- Add the instantiations for organizational and primary business objects --> ... <!—- Add the instantiations for all search definitions --> ... </class> </library>
Definition file Create a definition that extends the lzx/commerce/foundation/restricted/BusinessObjectEditor.lzx/wcfBusinessObjectEditor class. For example:<Definitions> <BusinessObjectEditor definitionName="extMyTool"> <!-- Add the context value definitions --> ... <!-- Add the init service definitions --> ... <!-- Add the filter definitions --> ... <!-- Add the organizational and primary business objects --> ... <!-- Add the search definitions --> ... </BusinessObjectEditor> </Definitions>