Creating the summary for the campaign element
About this task
Typically, summary text can be either static text or a combination of static and dynamic text. In the previous example, the text Level of support is: is static, whereas the text Gold changes dynamically, depending on whether the business user specifies, Gold, Silver, or Bronze in the properties of the target. You can review additional examples of summaries by looking at Web and Dialog activities in the Marketing tool.
Consider using the summary of an existing, similar campaign element as a starting point for your new campaign element. The existing summary files are stored here:
LOBTools/WebContent/WEB-INF/src/xml/commerce/marketing/restricted/propertiesViews/activityBuilder/
Procedure
- Open WebSphere Commerce Developer and switch to the Enterprise Explorer view.
-
Create a directory to store your new summary file.
Use a directory structure similar to the following example:
LOBTools/WebContent/WEB-INF/src/xml/your_company_name/marketing/propertiesViews/activityBuilder/
-
Create an XML file with this syntax:
campaign_element_nameSummary.xml
.For example, CustomLevelOfSupportSummary.xml. -
Define the new summary.
Here is the code that produces the summary class in the previous example, as defined in the FlowElementSummary.xml file:
<class name="extCustomLevelOfSupportSummary" extends="wcfFlowElementSummary"> <wcfFlowSummaryParam name="support" propertyName="supportLevel"/> <method name="updateSummary" args="e"> 1 <![CDATA[ var summary=""; if((this.resolvedParams["support"] !=null) && (this.resolvedParams["support"] !="")) { summary="Level of support is: " + this.resolvedParams["support"]); } this.setSummaryText(summary); 2 ]]> </method> </class>
The following describes the lines with black numbered callouts:
- 1 The updateSummary method sets the summary text for the campaign element.
- 2 The updateSummary method must call the setSummaryText method with the summary text.
-
Register this new summary as an object definition.
Create a CustomLevelOfSupportSummaryObjectDefinition.xml file similar to the object definition files in LOBTools/WebContent/WEB-INF/src/xml/commerce/marketing/objectDefinitions/activityBuilder/