Develop > Presentation layer > Management Center framework > Customize the Management Center user interface > Create a new tool for the Management Center > Define OpenLaszlo classes instantiated in a tool definition class
Define a top object definition in the explorer view
Overview
When you open a tool and select a store, the Management Center framework populates the explorer view with each child of the top object. You can load these child objects dynamically using the wcfGetChildrenService class, or you can instantiate the child objects as part of the top object definition's template. Before defining a top object definition, review the following classes:
Define a top object
- Open WebSphere Commerce Developer and switch to the Enterprise Explorer view.
- In the Enterprise Explorer view, expand...
LOBTools | WebContent | WEB-INF | src | lzx
- Create a directory to store the new OpenLaszlo library file. Use a directory structure similar to the following example:
LOBTools/WebContent/WEB-INF/src/lzx/your_company_name/Management_Center_component/objectDefinitions
... where Management_Center_component is the name of the new custom tool.
- Create an OpenLaszlo top object library file with this syntax:
Management_Center_componentname
...in camel caseTopObjectDefinition.lzx. For example...
CatalogTopObjectDefinition.lzx
Within this file, the class name must follow this syntax:
three-character Management Center
For example...
catCatalogTopObjectDefinition
- Within the top object library file:
- Create the new top object definition class. The following code snippet shows a sample top object definition class:
<class name="catCatalogTopObjectDefinition" extends="wcfTopObjectDefinition" organizedObjectTypes="SalesCatalog"> <!--- Retrieves the {@link catCatalogPrimaryObjectDefinition} child objects. --> 1 <wcfGetChildrenService url="/cmc/GetMasterCatalogObject" objectTypes="Catalog"> <wcfServiceParam name="storeId"/> </wcfGetChildrenService> <!--- Retrieves the {@link catSalesCatalogPrimaryObjectDefinition} child objects. --> 1 <wcfGetChildrenService url="/cmc/GetSalesCatalogs" objectTypes="SalesCatalog"> 2 <wcfServiceParam name="storeId"/> <wcfServiceParam name="defaultLanguageId"/> </wcfGetChildrenService> <dataset name="template"> 3 <object objectType="UnassignedCatalogEntries"/> </dataset> </class>
- 1 wcfGetChildrenService
- Returns the master catalog and the sales catalogs.
- 2 organizedObjectTypes
- Instructs the Management Center framework to include each new instance of SalesCatalog as a child of the top object.
- 3 template
- Instantiates an organizational object that is the parent of all unassigned catalog entries.
- Instantiate the new class as a child of the wcfBusinessObjectEditor instance:
class name="extMyTool" extends="wcfBusinessObjectEditor"> ... <!-- Instantiate the top object definition --> <extMyTopObject/> ...
- Add this new top object library file to the application.
What to do next
After you complete the work:
- Right-click LOBTools Project; then click Build OpenLaszlo Project to produce an updated ManagementCenter.swf file under...
WCDE_INSTALL\workspace\LOBTools\WebContent
This is the default environment setting.
- Test the work by viewing them in the Management Center, using this URL:
https://hostname:8000/lobtools
- Deploy your files to the production environment.
Related concepts
Business Object Editor definitions
Management Center user interface
Related tasks
Create a new tool for the Management Center
Define OpenLaszlo classes instantiated in a tool definition class