com.ibm.commerce.marketing.promotion.code

Class MultipleCodesPromotionCodeResolver

  • java.lang.Object
    • com.ibm.commerce.marketing.promotion.code.MultipleCodesPromotionCodeResolver
  • All Implemented Interfaces:
    GenericPromotionCodeResolver, XMLizable, java.io.Serializable


    public class MultipleCodesPromotionCodeResolver
    extends java.lang.Object
    implements GenericPromotionCodeResolver
    The MultipleCodesPromotionCodeResolver class implements the GenericPromotionCodeResolver interface and is used to decipher a promotion code. The Separator element defines the character used to delineate multiple promotion codes for a promotion. If you are defining a promotion that accepts multiple codes, separate them using this character. If you would like to use a different character, define the new character using this element.

    If Commerce Version 7 Feature pack 1 is enabled, this class supports unique promotion code code as well. The PromotionCodeResolver will likely require changes if a custom promotion code application is used.

    XML Snippet of MultipleCodesPromotionCodeResolver is as follows:

          <PromotionCodeResolver impl="com.ibm.commerce.marketing.promotion.code.MultipleCodesPromotionCodeResolver">
            <Separator>;</Separator>
          </PromotionCodeResolver>
     
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String COPYRIGHT
      IBM copyright notice field.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void fromXML(org.w3c.dom.Node node)
      Transforms the XML node into its corresponding real Object.
      java.lang.String getSeparator()
      This method is used to get the delimiter used to separate different promotion codes.
      PromotionKey[] resolveCode(java.lang.String promotionCode, java.util.Hashtable nvp)
      This method is used to get the PromotionKey of the promotions which have a promotion code same as the passed promotionCode parameter.
      PromotionKey[] resolveCode(java.lang.String promotionCode, PromotionContext context)
      This method is used to get the PromotionKey of the promotions which have a promotion code same as the passed promotionCode parameter.
      java.lang.String retrievePromotionCode(PromotionKey pKey)
      This method is used to retrieve the promotion code for a promotion identified by its PromotionKey.
      void setSeparator(java.lang.String string)
      This method is used to set the delimiter used to separate different promotion codes.
      java.lang.String toXML()
      Converts the object into its corresponding XML format representation.
      • Methods inherited from class java.lang.Object

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

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        IBM copyright notice field.
        See Also:
        Constant Field Values
    • Constructor Detail

      • MultipleCodesPromotionCodeResolver

        public MultipleCodesPromotionCodeResolver()
        The constructor of MultipleCodesPromotionCodeResolver.
    • Method Detail

      • resolveCode

        public PromotionKey[] resolveCode(java.lang.String promotionCode,
                                          java.util.Hashtable nvp)
                                   throws PromotionApplicationException
        This method is used to get the PromotionKey of the promotions which have a promotion code same as the passed promotionCode parameter. The nvp Hashtable is used to obtain additional properties defined to help with the resolution process of the promotion code to the promotion, for example the "StoreKey". This method will lookup the eligible promotions from store path only when current store does not return any promotion.
        Specified by:
        resolveCode in interface GenericPromotionCodeResolver
        Parameters:
        promotionCode - the promotion code
        nvp - custom properties passed to the resolver for promotion code resolution.
        Returns:
        the key to the promotion which is identified by this promotion code
        Throws:
        PromotionApplicationException - when an error is encountered during code resolution.
        See Also:
        GenericPromotionCodeResolver.resolveCode(String, Hashtable)
      • getSeparator

        public java.lang.String getSeparator()
        This method is used to get the delimiter used to separate different promotion codes. Default delimiter is ;
        Returns:
        The delimiter used to separate different codes.
      • setSeparator

        public void setSeparator(java.lang.String string)
        This method is used to set the delimiter used to separate different promotion codes.
        Parameters:
        string - The delimiter used to separate different codes.