Creating the properties view for the customer segment attribute

Declare the user interface widgets to capture the business user input for the new attribute. The properties view for a new customer segment attribute consists of one or more widgets. You can add the new widgets to any tab on the existing properties view for customer segments in the Marketing tool.

Before you begin

Review the following topics to ensure that you understand the properties view widgets available for use in Management Center and the wcfPropertyGroup class that you must extend:

About this task

The properties view for a new customer segment attribute is an extension class of the wcfPropertyGroup class. The properties view widgets have already been defined for use in the Management Center. When creating a new customer segment attribute, you must specify which of these widgets you need, and then arrange and customize them as required. At a minimum, a wcfPropertyCombobox widget is required, bound to the template property of the object defined for this customer segment attribute.

Procedure

  1. Review the available widgets for Management Center properties views and plan the user interface for your customer segment attribute.
  2. Open WebSphere Commerce Developer and switch to the Enterprise Explorer view.
  3. Create a directory to store your new properties view file.
    Use a directory structure similar to the following example:
    • WebSphere Commerce Version 7.0.0.0Feature Pack 1LOBTools/WebContent/WEB-INF/src/lzx/your_company_name/marketing/propertiesViews/customerSegment/
    • Introduced in Feature Pack 2LOBTools/WebContent/config/your_company_name/marketing/propertiesViews/customerSegment/
  4. Create the new properties view file:
    OptionDescription
    WebSphere Commerce Version 7.0.0.0Feature Pack 1OpenLaszlo class file WebSphere Commerce Version 7.0.0.0Feature Pack 1Name the file using this syntax: attribute_namePropertiesView.lzx, for example, LoyaltyPointsPropertiesView.lzx.
    Introduced in Feature Pack 2Definition file Introduced in Feature Pack 2Name the file using this syntax: attribute_namePropertiesView.def, for example, LoyaltyPointsPropertiesView.def.
  5. In the properties view file, define the new properties view as:
    OptionDescription
    WebSphere Commerce Version 7.0.0.0Feature Pack 1An extension class of wcfPropertyGroup WebSphere Commerce Version 7.0.0.0Feature Pack 1For example:
    <class
        name = "LoyaltyPointsProperties"
        extends = "wcfPropertyGroup"
        displayGrouping = "true"
        collapsable = "false">
        <wcfPropertyCombobox propertyName = "template" objectPath = "TopAndList/LoyaltyPoints" promptText = "Loyalty points"/>
        <wcfPropertyGroup name = "notBetween" collapsable = "false">
            <wcfEnablementOrCondition conditionId = "notBetween">
                <wcfEnablementCondition
                    conditionId = "lessThan"
                    objectPath = "TopAndList/LoyaltyPoints"
                    propertyName = "template"
                    enablementValue = "lessThan"/>
                <wcfEnablementCondition
                    conditionId = "greaterThan"
                    objectPath = "TopAndList/LoyaltyPoints"
                    propertyName = "template"
                    enablementValue = "greaterThan"/>
            </wcfEnablementOrCondition>
            <wcfPropertyStepper
                objectPath = "TopAndList/LoyaltyPoints/LoyaltyPointsList/LoyaltyPointsCondition"
                propertyName = "conditionValue"
                required = "true"
                promptText = "Number of loyalty points"
                minimumValue = "0"/>
        </wcfPropertyGroup>
        <wcfPropertyGroup name = "between" collapsable = "false">
            <wcfEnablementCondition
                conditionId = "between"
                objectPath = "TopAndList/LoyaltyPoints"
                propertyName = "template"
                enablementValue = "between"/>
            <wcfPropertyStepper
                objectPath = "TopAndList/LoyaltyPoints/LoyaltyPointsList/LoyaltyPointsCondition[conditionOperator=&gt;=]"
                propertyName = "conditionValue"
                required = "true"
                promptText = "Minimum number of points"
                minimumValue = "0"/>
            <wcfPropertyStepper
                objectPath = "TopAndList/LoyaltyPoints/LoyaltyPointsList/LoyaltyPointsCondition[conditionOperator=&lt;=]"
                propertyName = "conditionValue"
                required = "true"
                promptText = "Maximum number of points"
                minimumValue = "0"/>
        </wcfPropertyGroup>
    </class>
    Introduced in Feature Pack 2An extension of wcfPropertyGroup Introduced in Feature Pack 2For example, add this element as a child of the document root Definitions element:
    <PropertyGroup
       definitionName = "LoyaltyPointsProperties"
       displayGrouping = "true"
       collapsable = "false">
       <PropertyCombobox propertyName = "template" objectPath = "TopAndList/LoyaltyPoints"
          promptText = "Loyalty points"/>
       <PropertyGroup name = "notBetween" collapsable = "false">
          <EnablementOrCondition conditionId = "notBetween">
             <EnablementCondition
                conditionId = "lessThan"
                objectPath = "TopAndList/LoyaltyPoints"
                propertyName = "template"
                enablementValue = "lessThan"/>
             <EnablementCondition
                 conditionId = "greaterThan"
                 objectPath = "TopAndList/LoyaltyPoints"
                 propertyName = "template"
                 enablementValue = "greaterThan"/>
          </EnablementOrCondition>
          <PropertyStepper
             objectPath = "TopAndList/LoyaltyPoints/LoyaltyPointsList/LoyaltyPointsCondition"
             propertyName = "conditionValue"
             required = "true"
             promptText = "Number of loyalty points"
             minimumValue = "0"/>
       </PropertyGroup>
       <PropertyGroup name = "between" collapsable = "false">
          <EnablementCondition
             conditionId = "between"
             objectPath = "TopAndList/LoyaltyPoints"
             propertyName = "template"
             enablementValue = "between"/>
          <PropertyStepper
             objectPath = "TopAndList/LoyaltyPoints/LoyaltyPointsList/LoyaltyPointsCondition[conditionOperator=&gt;=]"
             propertyName = "conditionValue"
             required = "true"
             promptText = "Minimum number of points"
             minimumValue = "0"/>
          <PropertyStepper
             objectPath = "TopAndList/LoyaltyPoints/LoyaltyPointsList/LoyaltyPointsCondition[conditionOperator=<=]"
             propertyName = "conditionValue"
             required = "true"
             promptText = "Maximum number of points"
             minimumValue = "0"/>
        </PropertyGroup>
    </PropertyGroup>
  6. Save and close the file.
  7. WebSphere Commerce Version 7.0.0.0Feature Pack 1Add a reference to the new properties view 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 properties view file should look like the following example:

    <include href="../../your_company_name/marketing/propertiesViews/customerSegment/attribute_namePropertiesView.lzx"/>

  8. WebSphere Commerce Version 7.0.0.0Feature Pack 1Save and close the file.
  9. In the existing customer segment properties view:
    OptionDescription
    WebSphere Commerce Version 7.0.0.0Feature Pack 1Add the properties view for the new customer segment attribute to the appropriate tab WebSphere Commerce Version 7.0.0.0Feature Pack 1
    1. Open the LOBTools/WebContent/WEB-INF/src/lzx/commerce/marketing/propertiesViews/CustomerSegmentPropertiesView.lzx file in an editor.

      The CustomerSegmentPropertiesView.lzx file defines all the tabs in the customer segment properties view, such as the Demographics tab and the Address tab. For each tab, this file specifies the instance of the properties class for the customer segment attributes that display on the tab. The order of the properties class instances in this file determines the order of the customer segment attributes in the user interface.

    2. Add an instance of the properties class for your new customer segment attribute under the appropriate tab.
      For example, to instantiate the new loyalty points properties class (<LoyaltyPointsProperties/>) in the Miscellaneous tab, add the line of code shown in bold font:
      <wcfPropertyTabPane	name="miscTab" text="${mktMarketingResources.csMiscellaneousTab.string}">            	
         <wcfPropertyPane>
            <wcfPropertyGroup name="miscGroup" collapsable="false" displayGrouping="true" >
      	        <mktLastVisitDateProperties/>
               <LoyaltyPointsProperties/>
               <mktJobFunctionProperties/>
               <mktInterestsProperties/>
               <mktCompanyNameProperties/>
               <mktCurrencyProperties/>
               <mktLanguageProperties/>
               <mktComMethodProperties/>
            </wcfPropertyGroup>
         </wcfPropertyPane>
      </wcfPropertyTabPane>
    3. Save and close the file.
    Introduced in Feature Pack 2Add the properties view for the new customer segment to the appropriate tab Introduced in Feature Pack 2
    1. Open the LOBTools/WebContent/config/commerce/marketing/propertiesViews/CustomerSegmentPropertiesView.def file in an editor.

      The CustomerSegmentPropertiesView.def file defines all the tabs in the customer segment properties view, such as the Demographics tab and the Address tab. For each tab, this file specifies the property group definition for the customer segment attributes that display on the tab. The order of the property groups in this file determines the order of the customer segment attributes in the user interface.

    2. Add a PropertyGroup element for your new customer segment attribute under the appropriate tab.
      For example, to instantiate the new loyalty points property group (<LoyaltyPointsProperties/>) in the Miscellaneous tab, add the PropertyGroup element shown in bold font:
      <PropertyTabPane name="miscTab" text="${mktMarketingResources.csMiscellaneousTab}">
         <PropertyPane>
            <PropertyGroup collapsable="false" displayGrouping="true" name="miscGroup">
               <PropertyGroup baseDefinitionName="mktLastVisitDateProperties"/>
               <PropertyGroup baseDefinitionName="mktJobFunctionProperties"/>
               <PropertyGroup baseDefinitionName="mktInterestsProperties"/>
               <PropertyGroup baseDefinitionName="mktCompanyNameProperties"/>
               <PropertyGroup baseDefinitionName="mktCurrencyProperties"/>
               <PropertyGroup baseDefinitionName="mktLanguageProperties"/>
               <PropertyGroup baseDefinitionName="mktComMethodProperties"/>
               <PropertyGroup baseDefinitionName="LoyaltyPointsProperties"/>
            </PropertyGroup>
         </PropertyPane>
      </PropertyTabPane>
    3. Save and close the file.