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

  1. Open WebSphere Commerce Developer and switch to the Enterprise Explorer view.

  2. In the Enterprise Explorer view, expand...

      LOBTools | WebContent | WEB-INF | src | lzx

  3. 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.

  4. 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

  5. Within the top object library file:

    1. 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.

    2. Instantiate the new class as a child of the wcfBusinessObjectEditor instance:

      class name="extMyTool" extends="wcfBusinessObjectEditor"> 
      ... 
      <!-- Instantiate the top object definition --> 
      <extMyTopObject/> 
      ... 
      

  6. Add this new top object library file to the application.


What to do next

After you complete the work:

  1. Right-click LOBTools Project; then click Build OpenLaszlo Project to produce an updated ManagementCenter.swf file under...

    This is the default environment setting.

  2. Test the work by viewing them in the Management Center, using this URL:

      https://hostname:8000/lobtools

  3. Deploy your files to the production environment.


Related concepts

Object definitions

Property definitions

Business Object Editor definitions

Navigation list definitions

Search definitions

Management Center user interface


Related tasks

Create a new tool for the Management Center

Define OpenLaszlo classes instantiated in a tool definition class


+

Search Tips   |   Advanced Search