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
- Creating widgets in the Management Center: see the list of properties view widgets in this topic
- wcfPropertyGroup class
- wcfEnablementCondition class
- wcfEnablementOrCondition class
About this task
Procedure
- Review the available widgets for Management Center properties views and plan the user interface for your customer segment attribute.
- Open WebSphere Commerce Developer and switch to the Enterprise Explorer view.
- Create a directory to store your new properties view file.
Use a directory structure similar to the following example:
- LOBTools/WebContent/WEB-INF/src/lzx/your_company_name/marketing/propertiesViews/customerSegment/
- LOBTools/WebContent/config/your_company_name/marketing/propertiesViews/customerSegment/
- Create the new properties view file:
Option Description OpenLaszlo class file Name the file using this syntax: attribute_namePropertiesView.lzx
, for example, LoyaltyPointsPropertiesView.lzx.Definition file Name the file using this syntax: attribute_namePropertiesView.def
, for example, LoyaltyPointsPropertiesView.def. - In the properties view file, define the new properties
view as:
Option Description An extension class of wcfPropertyGroup For 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=>=]" propertyName = "conditionValue" required = "true" promptText = "Minimum number of points" minimumValue = "0"/> <wcfPropertyStepper objectPath = "TopAndList/LoyaltyPoints/LoyaltyPointsList/LoyaltyPointsCondition[conditionOperator=<=]" propertyName = "conditionValue" required = "true" promptText = "Maximum number of points" minimumValue = "0"/> </wcfPropertyGroup> </class>
An extension of wcfPropertyGroup For 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=>=]" 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>
- Save and close the file.
- Add 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"/>
- Save and close the file.
- In the existing customer segment properties view:
Option Description Add the properties view for the new customer segment attribute to the appropriate tab - 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.
- 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>
- Save and close the file.
Add the properties view for the new customer segment to the appropriate tab - 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.
- 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>
- Save and close the file.
- Open the LOBTools/WebContent/WEB-INF/src/lzx/commerce/marketing/propertiesViews/CustomerSegmentPropertiesView.lzx file
in an editor.