com.ibm.commerce.emarketing.emailtemplate.tag

Class TagPromotionCode

  • java.lang.Object
    • com.ibm.commerce.emarketing.emailtemplate.tag.TagPromotionCode
  • All Implemented Interfaces:
    Tag


    public class TagPromotionCode
    extends java.lang.Object
    implements Tag
    This class provides the default implementation for parsing the TagPromotionCode tag. The tag can have a syntax similar to the following:
    <email:PromotionCode promotionId="10101" name="Furniture" assign="true" />
    • promotionId is a required parameter which is the promotion from which a promotion code will be allocated.
    • name is a parameter used for display in the E-Mail Template editor.
    • assign is an optional parameter. If assign has a value of true, then the promotion code will be assigned to the customer. Otherwise, the promotion code will be allocated but will remain unassigned.
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String COPYRIGHT
      COPYRIGHT
    • Constructor Summary

      Constructors 
      Constructor and Description
      TagPromotionCode()
      This method is the default constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.lang.String getTagValue()
      This method returns the tag replacement value.
      void setCommandContext(CommandContext cc)
      This method sets the command context.
      void setTagParameters(java.util.Hashtable tagParametersCopy)
      This method copies the hash table containing key-value parameters required to evaluate this tag into the class level variable.
      void setTagParameters(java.lang.String tagParamName, java.lang.String tagParamValue)
      This method sets a key-value parameter required to evaluate this tag.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TagPromotionCode

        public TagPromotionCode()
        This method is the default constructor. It initializes the tag parameters.
    • Method Detail

      • setCommandContext

        public void setCommandContext(CommandContext cc)
        This method sets the command context.
        Specified by:
        setCommandContext in interface Tag
        Parameters:
        cc - The command context
      • getTagValue

        public java.lang.String getTagValue()
                                     throws ECException
        This method returns the tag replacement value. It calls the task command AllocatePromotionCodeCmd to find an unassigned promotion code for the specified promotion. This method will throw an ECApplicationException in the following situations:
        • The promotionId parameter has not be specified.
        • The recipientId parameter has not be specified, and the assign parameter has a value of true.
        • A promotion code could not be allocated.
        Specified by:
        getTagValue in interface Tag
        Returns:
        The tag replacement value.
        Throws:
        ECException
      • setTagParameters

        public void setTagParameters(java.lang.String tagParamName,
                                     java.lang.String tagParamValue)
        This method sets a key-value parameter required to evaluate this tag. promotionId is a mandatory key that needs to be set. This is the promotion from which a promotion code will be allocated. assign is an optional parameter. If assign has a value of true, then the promotion code will be assigned to the customer. If assign is true, the the parameter recipientId must be set as well.
        Specified by:
        setTagParameters in interface Tag
        Parameters:
        tagParamName - The key name.
        tagParamValue - The value of the tag parameter.
      • setTagParameters

        public void setTagParameters(java.util.Hashtable tagParametersCopy)
        This method copies the hash table containing key-value parameters required to evaluate this tag into the class level variable.
        Specified by:
        setTagParameters in interface Tag
        Parameters:
        tagParametersCopy - The hashtable containing the key-value pairs needed to evaluate this tag.