com.ibm.commerce.marketing.promotion.runtime

Class Template

  • java.lang.Object
    • com.ibm.commerce.marketing.promotion.runtime.Template
  • All Implemented Interfaces:
    XMLizable, java.io.Serializable


    public class Template
    extends java.lang.Object
    implements XMLizable
    A template is a prescribed way of calling the promotion engine. Templates are scoped by store. A template contains an ordered list of promotion groups. Promotions in these promotion groups are evaluated when the promotion engine is called using a specific template.Templates are configured in the promotion engine configuration XML file.

    XML Snippet of Template:

      <Template>
            <TemplateKey>
                    <StoreKey>
                            <DN>o=root organization</DN>
                            <Identifier>NullEntity</Identifier>
                    </StoreKey>
                    <Name>All Promotions</Name>
            </TemplateKey>
            <MonetaryValuePresence>
                    <Price>true</Price>
                    <ShippingCharge>false</ShippingCharge>
                    <Tax>false</Tax>
                    <ShippingTax>false</ShippingTax>
            </MonetaryValuePresence>
            <PromotionGroupKey>
                    <StoreKey>
                            <DN>o=root organization</DN>
                            <Identifier>NullEntity</Identifier>
                    </StoreKey>
                    <GroupName>ProductLevelPromotion</GroupName>
            </PromotionGroupKey>
            <PromotionGroupKey>
                    <StoreKey>
                            <DN>o=root organization</DN>
                            <Identifier>NullEntity</Identifier>
                    </StoreKey>
                    <GroupName>OrderLevelPromotion</GroupName>
            </PromotionGroupKey>
            <PromotionGroupKey>
                    <StoreKey>
                            <DN>o=root organization</DN>
                            <Identifier>NullEntity</Identifier>
                    </StoreKey>
                    <GroupName>ShippingPromotion</GroupName>
            </PromotionGroupKey>
      </Template>
     
      
     
    See Also:
    Serialized Form
    • Field Summary

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

      Constructors 
      Constructor and Description
      Template()
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void fromXML(org.w3c.dom.Node anXMLNode)
      Transforms the XML node into its corresponding real Object.
      com.ibm.commerce.marketing.promotion.group.PromotionGroupKey[] getGroupKeys()
      Returns the list of groups defined in the template.
      TemplateKey getKey()
      Returns key of this template.
      boolean isPricePresent()
      Indicates if price is calculated when this template is invoked.
      boolean isShippingChargePresent()
      Indicates if shipping charge is calculated when this template is invoked.
      boolean isShippingTaxPresent()
      Indicates if shipping tax is calculated when this template is invoked.
      boolean isTaxPresent()
      Indicates if tax is calculated when this template is invoked.
      void setGroupKeys(com.ibm.commerce.marketing.promotion.group.PromotionGroupKey[] keies)
      Sets the array of the promotion group keys in this template
      void setKey(TemplateKey akey)
      Sets the key of this template.
      void setPricePresent(boolean b)
      Sets the flag value that tells whether or not price is calculated at the time this template is invoked.
      void setShippingChargePresent(boolean b)
      Sets the flag value that tells whether or not shipping charge is calculated at the time this template is invoked.
      void setShippingTaxPresent(boolean b)
      Sets the flag value that tells whether or not shipping tax is calculated at the time this template is invoked.
      void setTaxPresent(boolean b)
      Sets the flag value that tells whether or not tax is calculated at the time this template is invoked.
      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
        See Also:
        Constant Field Values
    • Constructor Detail

      • Template

        public Template()
        Constructor.
    • Method Detail

      • getKey

        public TemplateKey getKey()
        Returns key of this template.
        Returns:
        key of this template
      • isPricePresent

        public boolean isPricePresent()
        Indicates if price is calculated when this template is invoked.
        Returns:
        true if price is already calculated, false otherwise.
      • isShippingChargePresent

        public boolean isShippingChargePresent()
        Indicates if shipping charge is calculated when this template is invoked.
        Returns:
        true if shipping charge is already calculated, false otherwise.
      • isShippingTaxPresent

        public boolean isShippingTaxPresent()
        Indicates if shipping tax is calculated when this template is invoked.
        Returns:
        true if shipping tax is already calculated, false otherwise.
      • isTaxPresent

        public boolean isTaxPresent()
        Indicates if tax is calculated when this template is invoked.
        Returns:
        true if tax is already calculated, false otherwise.
      • setKey

        public void setKey(TemplateKey akey)
        Sets the key of this template.
        Parameters:
        akey - key of this template
      • setPricePresent

        public void setPricePresent(boolean b)
        Sets the flag value that tells whether or not price is calculated at the time this template is invoked.
        Parameters:
        b - the flag value, true if price is already calculated, false otherwise.
      • setShippingChargePresent

        public void setShippingChargePresent(boolean b)
        Sets the flag value that tells whether or not shipping charge is calculated at the time this template is invoked.
        Parameters:
        b - the flag value, true if shipping charge is already calculated, false otherwise.
      • setShippingTaxPresent

        public void setShippingTaxPresent(boolean b)
        Sets the flag value that tells whether or not shipping tax is calculated at the time this template is invoked.
        Parameters:
        b - the flag value, true if shipping tax is already calculated, false otherwise.
      • setTaxPresent

        public void setTaxPresent(boolean b)
        Sets the flag value that tells whether or not tax is calculated at the time this template is invoked.
        Parameters:
        b - the flag value, true if tax is already calculated, false otherwise.
      • getGroupKeys

        public com.ibm.commerce.marketing.promotion.group.PromotionGroupKey[] getGroupKeys()
        Returns the list of groups defined in the template.
        Returns:
        an array of promotion groups
      • setGroupKeys

        public void setGroupKeys(com.ibm.commerce.marketing.promotion.group.PromotionGroupKey[] keies)
        Sets the array of the promotion group keys in this template
        Parameters:
        keies - the array of promotion group keys