Creating the summary for the campaign element

If you want to display summary text below the campaign element in the Activity Builder work area, create a new extension class for this summary. In the Activity Builder, business users can read the summary text to quickly understand how an element is being used in a Web or Dialog activity.

WebSphere Commerce ProfessionalWebSphere Commerce EnterpriseDialog activities are available only in the Professional and Enterprise editions of WebSphere Commerce.

Before you begin

The summary class for a new campaign element is an extension class of one of the following classes:

About this task

This is an example of the summary for a target as it would display to a business user in the Activity Builder work area. The summary is the text Level of support is: Gold:
Example of a campaign element summary

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 class of an existing, similar campaign element as a starting point for your new campaign element. The existing summary class files are stored here:

LOBTools/WebContent/WEB-INF/src/lzx/commerce/marketing/restricted/propertiesViews/activityBuilder/

Procedure

  1. Open WebSphere Commerce Developer and switch to the Enterprise Explorer view.
  2. Create a directory to store your new summary file.
    Use a directory structure similar to the following example:

    LOBTools/WebContent/WEB-INF/src/lzx/your_company_name/marketing/propertiesViews/activityBuilder/

  3. Create an OpenLaszlo class file with this syntax: campaign_element_nameSummary.lzx.
    For example, CustomLevelOfSupportSummary.lzx.
  4. Define the new summary class.
    Here is the code that produces the summary class in the previous example:WebSphere Commerce Version 7.0.0.0Feature Pack 1
    <class name="extCustomLevelOfSupportSummary" extends="mktFlowElementSummary">
        <mktFlowSummaryParam 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>
    Introduced in Feature Pack 2
    <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.
  5. Register this new summary class 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 summary class should look like the following example:

    <include href="../../your_company_name/marketing/propertiesViews/activityBuilder/campaign_element_nameSummary.lzx"/>