Defining 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 have only 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 you define 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 lzx/commerce/foundation/restricted/BrowseService.lzx/wcfGetChildrenService class under the parent lzx/commerce/foundation/restricted/ObjectDefinition.lzx/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 your new custom tool.
  4. Open the library file that contains the primary object definition.
    For example, ProductPrimaryObjectDefinition.lzx.
    1. Add the lzx/commerce/foundation/restricted/ObjectDefinition.lzx/wcfReferenceObjectDefinition, lzx/commerce/foundation/restricted/ObjectDefinition.lzx/wcfParentReferenceObjectDefinition, or lzx/commerce/foundation/restricted/ObjectDefinition.lzx/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 your work:
  1. Right-click LOBTools Project; then click Build OpenLaszlo Project to produce an updated ManagementCenter.swf file under the WCDE_installdir\workspace\LOBTools\WebContent directory. This setting is the default environment setting.
  2. Test your work by viewing them in the Management Center, using this URL: https://hostname:8000/lobtools.
  3. Deploy your files to your production environment.