public abstract class ProductBaseTag extends BaseTag
An abstract tag class which generates the data required for an analytics vendor to trigger
a product view event. The generated data is placed in a Vector
object named
paramVector
which the analytics vendor classes can consume. Each element in the
paramVector
will contain a HashMap
object. If the product viewed
is a product or an item, the paramVector
object will have one HashMap
object with the details of the viewed product or item. If the product viewed is a bundle or
package, the paramVector
object will contain data about the bundle or package
itself and the composite elements within the package or bundle. The value for all the keys
in the HashMap
, except for EXTRA_PARAMS, are String
objects. The
value for EXTRA_PARAMS will be an ArrayList
object which inturn contain
String
objects
Following is the structure of the HashMap
object. The keys used in the map are
defined in the TagConstants
class.
+--------------------------------------------------------------------------+ | PAGE_ID | The value of the pagename attribute | +--------------------------------------------------------------------------+ | PART_NUMBER | The part number of the viewed product | +--------------------------------------------------------------------------+ | PRODUCT_NAME | The part number of the viewed product | +--------------------------------------------------------------------------+ | CATEGORY | The category to which the product belong | | | in the current browsing catalog | +--------------------------------------------------------------------------+ | MASTER_CATALOG_CATEGORY | The category to which the product belong | | | in the master catalog | +--------------------------------------------------------------------------+ | EXTRA_PARAMS | The extra parameters which the users | | | want to send along with the product | | | tag. The value for this key will be an | | | object of type 'java.util.ArrayList' | | | which inturn contains String objects | +--------------------------------------------------------------------------+ | STORE_ID | The store identifier | +--------------------------------------------------------------------------+
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT
IBM copyright notice field.
|
Constructor and Description |
---|
ProductBaseTag() |
Modifier and Type | Method and Description |
---|---|
int |
doStartTag()
Gathers the required data to trigger a product view event.
|
java.lang.String |
getDataAsJSON(boolean useCatIdOverride)
Returns the analytics data in a JSON format
|
java.util.Vector<java.util.HashMap<java.lang.String,java.lang.Object>> |
getParamVector()
Returns a vector object which contain one or more
HashMap objects based on
the databean type. |
boolean |
isReturnAsJSON()
Checks whether the tag need to return the data as JSON
|
void |
setCatalogNavigationViewJSON(java.util.HashMap catalogNavigationViewJSONVar)
Sets the CatalogNavigationView JSON to be used to get the data for analysis
|
void |
setCatalogNavigationViewType(CatalogNavigationViewType catalogNavigationViewTypeVar)
Sets the CatalogNavigationViewType SDO to be used to get the data for analysis
|
void |
setCatentryId(java.lang.String catentryIdVar)
Sets the catalog entry ID parameter for this Tag.
|
void |
setDatabean(com.ibm.commerce.persistence.AbstractJpaEntityAccessBean databeanVar)
Sets the databean for this Tag.
|
void |
setExtraparms(java.lang.String extraparmsVar)
Sets the additional parameters that should be passed in the page view map
|
void |
setPagename(java.lang.String pagenameVar)
Sets the page name that need to be passed in the page view map
|
void |
setReturnAsJSON(boolean flag)
Sets the boolean value whether to return the data as JSON
|
getBiprovider, getCategoryIdForProduct, getCollator, getCommandContext, getConfig, getNumberFormat, getOptionValue, getStoreId, isDebug, isOptionDisabled, isOptionEnabled, setBiprovider, setDebug
public static final java.lang.String COPYRIGHT
public int doStartTag() throws javax.servlet.jsp.JspException
doStartTag
in interface javax.servlet.jsp.tagext.Tag
doStartTag
in class BaseTag
EVAL_PAGE
constantjavax.servlet.jsp.JspException
- on any Exceptionpublic void setCatentryId(java.lang.String catentryIdVar)
catentryIdVar
- the catalog entry ID parameter for this Tag.public void setDatabean(com.ibm.commerce.persistence.AbstractJpaEntityAccessBean databeanVar)
databeanVar
- The databean to set. Must be one of ProductDataBean
,
ItemDataBean
, BundleDataBean
, or PackageDataBean
.public void setCatalogNavigationViewType(CatalogNavigationViewType catalogNavigationViewTypeVar)
catalogNavigationViewTypeVar
- The CatalogNavigationViewType to set.public void setCatalogNavigationViewJSON(java.util.HashMap catalogNavigationViewJSONVar)
catalogNavigationViewJSONVar
- The CatalogNavigationView JSON to set.public void setExtraparms(java.lang.String extraparmsVar)
extraparmsVar
- The additional parameters that will be passed in the page
view map. Fields delimited by $ will be assumed to be methods applied to the type
of bean set. ie: one of ProductDataBean
, ItemDataBean
,
BundleDataBean
, or PackageDataBean
.public java.util.Vector<java.util.HashMap<java.lang.String,java.lang.Object>> getParamVector()
HashMap
objects based on
the databean type.public void setPagename(java.lang.String pagenameVar)
pagenameVar
- The page name that need to be passed in the page view mappublic java.lang.String getDataAsJSON(boolean useCatIdOverride)
useCatIdOverride
- A flag which specifies whether to override the categoryId
value with the one passed as the first extra parameter. This
parameter is used by Coremetrics customers who use the hosted
coremetrics librariespublic boolean isReturnAsJSON()
public void setReturnAsJSON(boolean flag)
flag
- The boolean value whether to return the data as JSON