public class TagEMarketingSpotCache
extends javax.servlet.jsp.tagext.TagSupport
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.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_NAME
The name of this class.
|
static java.lang.String |
COPYRIGHT
COPYRIGHT
|
Constructor and Description |
---|
TagEMarketingSpotCache()
The default constructor performs no actions.
|
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.
|
public static final java.lang.String COPYRIGHT
public static final java.lang.String CLASS_NAME
public TagEMarketingSpotCache()
public void setCachedObjectDependency(java.lang.String dependencyName, java.lang.String id, com.ibm.websphere.servlet.cache.FragmentInfo coFragmentInfo)
dependencyName
- The dependency name.id
- The dependency value.coFragmentInfo
- The FragmentInfo
object in which to add variables unique to externally cacheable pages.public int doStartTag() throws javax.servlet.jsp.JspTagException
emsName
request
parameter.doStartTag
in interface javax.servlet.jsp.tagext.Tag
doStartTag
in class javax.servlet.jsp.tagext.TagSupport
SKIP_BODY
constant.javax.servlet.jsp.JspTagException
public int doEndTag() throws javax.servlet.jsp.JspTagException
doEndTag
in interface javax.servlet.jsp.tagext.Tag
doEndTag
in class javax.servlet.jsp.tagext.TagSupport
EVAL_PAGE
constant.javax.servlet.jsp.JspTagException
public void setMarketingSpotData(MarketingSpotDataType dataVar)
dataVar
- The marketing spot data.public void setMarketingSpotDataJSON(java.util.Map dataVar)
dataVar
- The marketing spot data in JSON format.public void setCategoryDependencyName(java.lang.String nameVar)
nameVar
- The category dependency name.public void setCatalogEntryDependencyName(java.lang.String nameVar)
nameVar
- The catalog entry dependency name.public void setContentDependencyName(java.lang.String nameVar)
nameVar
- The content dependency name.