Defining child objects for a primary object

You can use child object definitions when you need to have multiple property values or translatable data. For example, attributes are declared as child objects under Products. Child objects can have their own child objects. For example, attributes have translatable data and need their own language-sensitive child objects.

Before you begin

Before you define a child object for a primary object:
  1. Review the Management Center modeling guidelines.
  2. Create the Management Center services required to support the child 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. Review the lzx/commerce/foundation/restricted/ObjectDefinition.lzx/wcfChildObjectDefinition class for more information about child object definitions.
  6. Define a lzx/commerce/foundation/restricted/BrowseService.lzx/wcfGetChildrenService class under the parent lzx/commerce/foundation/restricted/ObjectDefinition.lzx/wcfPrimaryObjectDefinition class that returns instances of the new child object.

Procedure

  1. Select a unique object type, such as CatalogEntryDefiningAttribute.
  2. Open WebSphere Commerce Developer and switch to the Enterprise Explorer view.
  3. Complete one of the following steps:
    • WebSphere Commerce Version 7.0.0.0Feature Pack 1In the Enterprise Explorer view, 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.
    • Introduced in Feature Pack 2In the Enterprise Explorer view, expand LOBTools > WebContent > config > your_company_name > Management_Center_component > objectDefinitions, where Management_Center_component is the name of your new custom tool.
  4. Open the file that contains the primary object definition.
    For example:
    OptionDescription
    WebSphere Commerce Version 7.0.0.0Feature Pack 1ProductPrimaryObjectDefinition.lzx WebSphere Commerce Version 7.0.0.0Feature Pack 1
    1. Add the wcfChildObjectDefinition instance under the primary object definition. For example:
      <class name="extMyPrimaryObjectDefinition" 
      
          ... 
      
          <!-- Child Object Definitions --> 
          <wcfChildObjectDefinition 
              objectType="MyChildObject" 
              displayName="${myResources.myChildObject_DisplayName.string}" 
              idProperty="myIdProperty"> 
      
              ... 
      
          </wcfChildObjectDefinition> 
      
          ... 
      
      </class> 
    2. Specify the create, update, or delete services for the child object.
    3. Declare the property definitions for this child object.
    4. Declare the child objects for this child object.
    5. Declare the reference objects for this child object.
    Introduced in Feature Pack 2ProductPrimaryObjectDefinition.def Introduced in Feature Pack 2
    1. Add the child object definition under the primary object definition. For example:
      <PrimaryObjectDefinition definitionName="extMyPrimaryObjectDefinition" 
      
          ... 
      
          <!-- Child Object Definitions --> 
          <ChildObjectDefinition 
              objectType="MyChildObject" 
              displayName="${myResources.myChildObject_DisplayName}" 
              idProperty="myIdProperty"> 
      
              ... 
      
          </ChildObjectDefinition> 
      
          ... 
      
      </PrimaryObjectDefinition>
    2. Specify the create, update, or delete services for the child object.
    3. Declare the property definitions for this child object.
    4. Declare the child objects for this child object.
    5. Declare the reference objects for this child object.

What to do next

After you complete your customization:
Version Steps
  1. Right-click LOBTools Project; then click Build OpenLaszlo Project to produce an updated ManagementCenter.swf file under the workspace_dir\LOBTools\WebContent directory. This setting is the default environment setting.
  2. Test your changes by viewing them in the Management Center, using this URL: https://hostname:8000/lobtools.
  3. Deploy your changes to your production environment.
Introduced in Feature Pack 2
  1. Test your changes by viewing them in the Management Center, using this URL: https://hostname:8000/lobtools.
  2. Deploy your changes to your production environment.