Develop > Presentation layer > Customize marketing > Marketing customization: Management Center > Customizing customer segments > Add a new customer segment attribute to Management Center


Create the object definition for the customer segment attribute

Create a new OpenLaszlo object definition for the new customer segment attribute to collect input from the Management Center user interface. When business users fill in data about the new attribute in a customer segment, the object definition persists the data in the MGPCONDELE database table.


Before you begin

Review the following topics to ensure that you understand object definitions in Management Center and the wcfChildObjectDefinition class that extend:

You must also understand these base object definition classes:

Review the MGPCONDELE table:

In the Marketing tool, each customer segment attribute must have an object definition. Each object definition is an extension class of the wcfChildObjectDefinition class.


Procedure

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

  2. Create a directory to store the new customer segment object definition. Use a directory structure similar to the following example:

    LOBTools/WebContent/WEB-INF/src/lzx/your_company_name/marketing/objectDefinitions/customerSegment/

  3. Create an OpenLaszlo class file for the customer segment attribute object definition. Name the file using this syntax: attribute_nameObjectDefinition.lzx; for example, LoyaltyPointsObjectDefinition.lzx.

  4. Define a new child object class to represent a customer segment attribute OR list or AND list condition that:

    Here is an example:

    <library> 
    <class
        name = "mktLoyaltyPointsListObjectDefinition"
        extends = "wcfChildObjectDefinition"
        objectType = "LoyaltyPointsList"
        baseType = "mktCSElementAndOrListConditionObjectDefinition">    
    <wcfChildObjectDefinition
            objectType = "LoyaltyPointsCondition"
            baseType = "mktCSElementSimpleConditionObjectDefinition">        
    <dataset name = "template">            
    <conditionVariable>loyalty</conditionVariable>        
    </dataset>        
    <wcfPropertyDefinition
                propertyName = "conditionValue"
                required = "true"
                type = "integer"
                displayName = "Number of points"/>    
    </wcfChildObjectDefinition>
    </class>
    

  5. In the same file, define a new child object class that:

    • Extends from wcfChildObjectDefinition.

    • Has a globally unique objectType value.

    • Is a singleInstance object.

    • Has a templateTypeProperty defined.

    • Has an idProperty of elementName.

    • Has a dataset named template.

    • Has one or more child wcfObjectTemplate objects defined.

    • Contains a child instance of a class that extends from mktCSElementAndOrListConditionObjectDefinition.

    Here is an example:

    <class
        name = "extLoyaltyPointsObjectDefinition"
        extends = "wcfChildObjectDefinition"
        objectType = "LoyaltyPoints"
        singleInstance = "true"
        templateTypeProperty = "template"
        idProperty = "elementName">    
    <dataset name = "template">        
    <elementName>LoyaltyPoints</elementName>        
    <template>ignore</template>    
    </dataset>    
    <mktLoyaltyPointsListObjectDefinition/>    
    <wcfObjectTemplate templateType = "ignore" displayName = "Ignore customer loyalty points">        
    <dataset name = "template"/>    
    </wcfObjectTemplate>    
    <wcfObjectTemplate templateType = "lessThan" displayName = "Number of points is less than or equal to the following number">        
    <dataset name = "template">            
    <object objectType = "LoyaltyPointsList">                
    <elementName>loyalty</elementName>                
    <conditionUsage>orListCondition</conditionUsage>                
    <object objectType = "LoyaltyPointsCondition">                    
    <conditionOperator>&lt;=</conditionOperator>                
    </object>            
    </object>        
    </dataset>    
    </wcfObjectTemplate>    
    <wcfObjectTemplate templateType = "greaterThan" displayName = "Number of points is greater than or equal to the following number">        
    <dataset name = "template">            
    <object objectType = "LoyaltyPointsList">                
    <elementName>loyalty</elementName>                
    <conditionUsage>orListCondition</conditionUsage>                
    <object objectType = "LoyaltyPointsCondition">                    
    <conditionOperator>&gt;=</conditionOperator>                
    </object>            
    </object>        
    </dataset>    
    </wcfObjectTemplate>    
    <wcfObjectTemplate templateType = "between" displayName = "Number of points is within the following range">        
    <dataset name = "template">            
    <object objectType = "LoyaltyPointsList">                
    <elementName>loyalty</elementName>                
    <conditionUsage>andListCondition</conditionUsage>                
    <object objectType = "LoyaltyPointsCondition" name="upperBound">                    
    <conditionOperator>&lt;=</conditionOperator>                
    </object>                
    <object objectType = "LoyaltyPointsCondition" name="lowerBound">                    
    <conditionOperator>&gt;=</conditionOperator>                
    </object>            
    </object>        
    </dataset>    
    </wcfObjectTemplate>
    </class>
    </library> 
    

  6. Add a reference to the new object definition file in the MarketingExtensionsLibrary.lzx file.

    The file is stored at this path:

    LOBTools/WebContent/WEB-INF/src/lzx/commerce/marketing/

    The line of code that references the new object definition should look like the following example:

    <include href="../../your_company_name/marketing/objectDefinitions/customerSegment/attribute_nameObjectDefinition.lzx"/>

  7. Register the new object with the top customer segment AND list object definition:

    1. Open the TopAndListObjectDefinition.lzx file at this path:

      /LOBTools/WebContent/WEB-INF/src/lzx/commerce/marketing/objectDefinitions/customerSegment/

    2. Add an instance of the new customer segment condition single instance object by inserting a line similar to the following example (see the line in bold font):

      <class name="mktTopAndListObjectDefinition"
          extends="wcfChildObjectDefinition"
          objectType="TopAndList" idProperty="elementName"> 
          <!-- ... -->     <extLoyaltyPointsObjectDefinition/>
          <!-- ... -->
      </class>
      

    3. Save and close the file.


+

Search Tips   |   Advanced Search