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 primary object

You can use primary object definitions to describe the business objects that are managed by a business object editor, such as products, campaigns, and promotions.


Before you begin

Before defining a primary object, ensure that you:

  1. Review the Management Center modeling guidelines.

  2. Create the Management Center services required to support the primary object, such as create, update, delete, or search services.

  3. Work with these services to develop client libraries, new commands, and business logic.

  4. Create new Management Center objects.

  5. Review the wcfPrimaryObjectDefinition class for more information about primary object definitions.


Procedure

  1. Select a unique object type, such as Product.

  2. Define an image that the Management Center can use to display instances of this object type.

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

  4. In the Enterprise Explorer view, expand LOBTools > WebContent > WEB-INF > src > lzx.

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

  6. Create an OpenLaszlo primary object library file. For example, ProductPrimaryObjectDefinition.lzx. Within this file, the class name must follow this syntax: three-character Management Center component code in lower caseManagement_Center_componentPrimaryObjectDefinition. For example, catProductPrimaryObjectDefinition.

  7. Within the primary object library file:

    1. Create the new primary object class:

      <class name="extMyPrimaryObjectDefinition" 
          extends="wcfPrimaryObjectDefinition" 
          objectType="MyPrimaryObject" 
          icon="myPrimaryObjectIcon" 
          headerIcon="myPrimaryObjectHeaderIcon" 
          propertiesClass="myPrimaryObjectProperties" 
          idProperty="myIdProperty" 
          displayNameProperty="myDisplayNameProperty" 
          displayName="${myResources.myPrimaryObject_DisplayName.string}" 
          newDisplayName="${myResources.myPrimaryObject_NewDisplayName.string}"> 
      
          ... 
      
      </class> 
      

    2. Specify the create, update, or delete services for the primary object.

    3. Specify any custom services to be used by the primary object.

    4. Declare the property definitions for this primary object.

    5. Declare the child objects for this primary object.

    6. Declare the reference objects for this primary object.

  8. Open the file that contains the business object editor and instantiate the new primary object definition class as a child of the business object editor class. For example:

    <class name="extMyTool" extends="wcfBusinessObjectEditor"> 
    
        ... 
    
       
    <!—- Primary object definitions --> 
       
    <extMyPrimaryObjectDefinition/> 
    
        ... 
    
    </class> 
    

  9. Add the new primary 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 the WCDE_INSTALL\workspace\LOBTools\WebContent directory. 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

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