com.ibm.commerce.marketing.cache

Class TagEMarketingSpotCache

  • java.lang.Object
    • javax.servlet.jsp.tagext.TagSupport
      • com.ibm.commerce.marketing.cache.TagEMarketingSpotCache
  • All Implemented Interfaces:
    java.io.Serializable, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag


    public class TagEMarketingSpotCache
    extends javax.servlet.jsp.tagext.TagSupport
    This class is used to assist in determining how an e-Marketing Spot can cache its results based on the definition of the web activities and default content scheduled to the e-Marketing Spot. The default value for do-not-consume should be true and for do-not-cache should be true. This specifies to not cache the e-Marketing Spot JSP fragment. This class will dynamically set the e-Marketing Spot JSP fragment to be consumed if the e-Marketing Spot displays the same results to all customers. This class will also dynamically set dependency IDs to invalidate the cached JSP when the e-Marketing Spot definition changes (web activity changes, default content changes, content changes, product changes, and category changes).
    e-Marketing Spot parent JSP e-Marketing Spot JSP cache behavior e-Marketing Spot JSP consume behavior time out
    static cached cached in parent JSP consumed by parent JSP earliest of all activities on all e-Marketing Spots on the page
    static not cached cached separately not consumed earliest of all activities on the e-Marketing Spot
    dynamic cached not cached not consumed not applicable
    dynamic not cached not cached not consumed not applicable

    Here is an example of including this tag on the e-Marketing Spot JSP fragment:

      <wcf:eMarketingSpotCache marketingSpotData="${marketingSpotDatas}" />
     
    or
      <wcf:eMarketingSpotCache marketingSpotDataJSON="${eSpotDatas}" />
     
    If the e-Marketing Spot is static, the tag will generate dependency IDs for the e-Marketing Spot. If you want dependency IDs generated for any content, products, or categories displayed in the e-Marketing Spot, then set the contentDependencyName, catalogEntryDependencyName, and categoryDependencyName parameters respectively. These values should match the names issued by any database invalidation triggers and the names defined in the cachespec. Here is an example of including this tag on the e-Marketing Spot JSP fragment and specifying to generate all dependency IDs:
      <wcf:eMarketingSpotCache marketingSpotData="${marketingSpotDatas}" 
      contentDependencyName="contentId" 
      catalogEntryDependencyName="productId"
      categoryDependencyName="categoryId" />
     
    The marketingSpotData parameter is the result returned from the Get MarketingSpotData service call.

    or

      <wcf:eMarketingSpotCache marketingSpotDataJSON="${eSpotDatas}" 
      contentDependencyName="contentId" 
      catalogEntryDependencyName="productId"
      categoryDependencyName="categoryId" />
     
    The marketingSpotDataJSON parameter is the result in JSON format that is returned from the Get MarketingSpotData REST service call.

    The JSP that included the e-Marketing Spot must specify the emsName parameter. You must specify the metadatagenerator element in the e-Marketing Spot JSP cachespec definition. See EMarketingSpotMetaDataGenerator for details.

    If the e-Marketing Spot JSP fragment is cached separately, then the time out of the cached fragment will be set to be the earliest of any start date or end date (that is after the current time) of the activities scheduled to the e-Marketing Spot. If the e-Marketing Spot JSP fragment is cached separately, then the time out of the parent cached page will be set to be the earliest of any start date or end date (that is after the current time) of the activities scheduled to all the e-Marketing Spots included on the page. The time out is only set if it is earlier than the currently configured time out value for the page.

    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String CLASS_NAME
      The name of this class.
      static java.lang.String COPYRIGHT
      COPYRIGHT
      • Fields inherited from interface javax.servlet.jsp.tagext.IterationTag

        EVAL_BODY_AGAIN
      • Fields inherited from interface javax.servlet.jsp.tagext.Tag

        EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
    • Constructor Summary

      Constructors 
      Constructor and Description
      TagEMarketingSpotCache()
      The default constructor performs no actions.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      int doEndTag()
      This method performs no actions.
      int doStartTag()
      This method reads the attribute in the request named DM_emsBehavior-.
      void setCachedObjectDependency(java.lang.String dependencyName, java.lang.String id, com.ibm.websphere.servlet.cache.FragmentInfo coFragmentInfo)
      This method dynamically creates a dependency for a cached page.
      void setCatalogEntryDependencyName(java.lang.String nameVar)
      This method sets the string to use to create dependencies for catalog entries displayed in the e-Marketing Spot.
      void setCategoryDependencyName(java.lang.String nameVar)
      This method sets the string to use to create dependencies for categories displayed in the e-Marketing Spot.
      void setContentDependencyName(java.lang.String nameVar)
      This method sets the string to use to create dependencies for content displayed in the e-Marketing Spot.
      void setMarketingSpotData(MarketingSpotDataType dataVar)
      This method sets the marketing spot data returned from the Get MarketingSpotData service call.
      void setMarketingSpotDataJSON(java.util.Map dataVar)
      This method sets the marketing spot data JSON object returned from the Get MarketingSpotData REST service call.
      • Methods inherited from class javax.servlet.jsp.tagext.TagSupport

        doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue
      • Methods inherited from class java.lang.Object

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

      • CLASS_NAME

        public static final java.lang.String CLASS_NAME
        The name of this class.
    • Constructor Detail

      • TagEMarketingSpotCache

        public TagEMarketingSpotCache()
        The default constructor performs no actions.
    • Method Detail

      • setCachedObjectDependency

        public void setCachedObjectDependency(java.lang.String dependencyName,
                                              java.lang.String id,
                                              com.ibm.websphere.servlet.cache.FragmentInfo coFragmentInfo)
        This method dynamically creates a dependency for a cached page. The dependency will have the format dependencyName:id
        Parameters:
        dependencyName - The dependency name.
        id - The dependency value.
        coFragmentInfo - The FragmentInfo object in which to add variables unique to externally cacheable pages.
      • doStartTag

        public int doStartTag()
                       throws javax.servlet.jsp.JspTagException
        This method reads the attribute in the request named DM_emsBehavior-. If the attribute has a value of 0, then the e-Marketing Spot is static and dependencies will be created. The e-Marketing Spot name must be in the emsName request parameter.
        Specified by:
        doStartTag in interface javax.servlet.jsp.tagext.Tag
        Overrides:
        doStartTag in class javax.servlet.jsp.tagext.TagSupport
        Returns:
        Always returns the SKIP_BODY constant.
        Throws:
        javax.servlet.jsp.JspTagException
      • doEndTag

        public int doEndTag()
                     throws javax.servlet.jsp.JspTagException
        This method performs no actions.
        Specified by:
        doEndTag in interface javax.servlet.jsp.tagext.Tag
        Overrides:
        doEndTag in class javax.servlet.jsp.tagext.TagSupport
        Returns:
        Always returns the EVAL_PAGE constant.
        Throws:
        javax.servlet.jsp.JspTagException
      • setMarketingSpotData

        public void setMarketingSpotData(MarketingSpotDataType dataVar)
        This method sets the marketing spot data returned from the Get MarketingSpotData service call.
        Parameters:
        dataVar - The marketing spot data.
      • setMarketingSpotDataJSON

        public void setMarketingSpotDataJSON(java.util.Map dataVar)
        This method sets the marketing spot data JSON object returned from the Get MarketingSpotData REST service call.
        Parameters:
        dataVar - The marketing spot data in JSON format.
      • setCategoryDependencyName

        public void setCategoryDependencyName(java.lang.String nameVar)
        This method sets the string to use to create dependencies for categories displayed in the e-Marketing Spot.
        Parameters:
        nameVar - The category dependency name.
      • setCatalogEntryDependencyName

        public void setCatalogEntryDependencyName(java.lang.String nameVar)
        This method sets the string to use to create dependencies for catalog entries displayed in the e-Marketing Spot.
        Parameters:
        nameVar - The catalog entry dependency name.
      • setContentDependencyName

        public void setContentDependencyName(java.lang.String nameVar)
        This method sets the string to use to create dependencies for content displayed in the e-Marketing Spot.
        Parameters:
        nameVar - The content dependency name.