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 reference objects for a primary object

You can use reference objects, collection reference objects, and parent reference objects to represent relationships between primary objects. Reference objects represent association relationships between two primary objects, such as merchandising associations. Parent reference objects represent parent-child relationships between two primary objects in which each child can only have one parent, such as a product in a master category. Collection reference objects represent a parent-child relationship between two primary objects in which each child can have more than one parent, such as a sales category within another sales category.


Before you begin

Before defining a reference object for a primary object:

  1. Review the Management Center modeling guidelines.

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

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

  4. Create new Management Center objects.

  5. For more information about reference object definitions, review the following classes:

  6. Define a wcfGetChildrenService class under the parent wcfPrimaryObjectDefinition class hat returns instances of the new reference object.


Procedure

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

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

  3. Expand 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. Open the library file that contains the primary object definition. For example, ProductPrimaryObjectDefinition.lzx.

    1. Add the wcfReferenceObjectDefinition, wcfParentReferenceObjectDefinition , or wcfCollectionReferenceObjectDefinition instance under the primary object definition and specify the referenced object type for this reference object. For example:

      <class name="extMyPrimaryObjectDefinition" 
      
          ... 
      
         
      <!-- Reference Object Definitions --> 
         
      <wcfReferenceObjectDefinition 
              objectType="MyReferenceObject" 
              displayName="${myResources.myReferenceObject_DisplayName.string}" 
              idProperty="myIdProperty" 
              referencedType="MyOtherPrimaryObject"> 
      
          ... 
      
         
      </wcfReferenceObjectDefinition> 
      
          ... 
      
      </class> 
      

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

    3. Declare the property definitions for this reference object.


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.


+

Search Tips   |   Advanced Search