public abstract class CartBaseTag extends BaseTag
An abstract tag class which generates the data required for an analytics vendor to trigger
a shopping cart 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. Each HashMap
object contains data about an item in the shopping cart. 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.
+--------------------------------------------------------------------------+ | PART_NUMBER | The part number of the product | +--------------------------------------------------------------------------+ | PRODUCT_NAME | The part number of the viewed product | +--------------------------------------------------------------------------+ | QUANTITY | Quantity | +--------------------------------------------------------------------------+ | BASE_PRICE | The unit price | +--------------------------------------------------------------------------+ | 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 | +--------------------------------------------------------------------------+ | CURRENCY | Currency | +--------------------------------------------------------------------------+ | EXTRA_PARAMS | The extra parameters which the users | | | want to send along with the shop cart | | | 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 |
---|
CartBaseTag() |
Modifier and Type | Method and Description |
---|---|
int |
doStartTag()
Gathers the data required for generating an analytics cart view event and places that in an attribute
for the vendor specific classes to consume.
|
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 or the SDO. |
boolean |
isReturnAsJSON()
Checks whether the tag need to return the data as JSON
|
void |
setDatabean(OrderDataBean databeanVar) |
void |
setExtraparms(java.lang.String extraparmsVar)
Sets the additional parameters that need to be passed in the
HashMap object. |
void |
setExtraparmsMap(java.util.HashMap extraparmsMapVar)
Sets the additional parameter that need to be passed with specific items in the cart.
|
void |
setIncludeDiscountsInUnitPrice(boolean discounted)
Sets the flag to pass discounted price in the Coremetrics cmCreateShopAction5() tag.
|
void |
setIncludeTaxInUnitPrice(boolean includeTaxInUnitPriceVar)
Sets the boolean parameter to conditionally include tax component in unit price
|
void |
setOrderId(java.lang.String orderIdVar)
Sets the order ID parameter.
|
void |
setOrderJSON(java.util.HashMap orderJSON)
Sets the
orderJSON JSON object to be used to get the data for analysis |
void |
setOrderType(OrderType orderTypeVar)
Sets the
OrderType SDO object |
void |
setReturnAsJSON(boolean flag)
Sets the boolean value whether to return the data as JSON
|
void |
setUseKitItems(boolean flag)
Whether the tags need to be generated for all the items in a pre-defined kit
|
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 setDatabean(OrderDataBean databeanVar)
databeanVar
- public void setOrderId(java.lang.String orderIdVar)
orderIdVar
- the order ID parameter to set.public void setOrderType(OrderType orderTypeVar)
OrderType
SDO objectorderTypeVar
- public void setOrderJSON(java.util.HashMap orderJSON)
orderJSON
JSON object to be used to get the data for analysisorderJSON
- public void setExtraparms(java.lang.String extraparmsVar)
HashMap
object.
The value of this parameter will be used for all the items in the cartextraparmsVar
- public java.util.Vector<java.util.HashMap<java.lang.String,java.lang.Object>> getParamVector()
HashMap
objects based on
the databean or the SDO.HashMap
object corresponding to every item in the
shop cartpublic void setIncludeTaxInUnitPrice(boolean includeTaxInUnitPriceVar)
includeTaxInUnitPriceVar
- public void setExtraparmsMap(java.util.HashMap extraparmsMapVar)
orderItemId
for each item in the
shop cart and the value will be the additional parameters that need to be appended
with the specific item dataextraparmsMapVar
- public void setUseKitItems(boolean flag)
flag
- public 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 JSONpublic void setIncludeDiscountsInUnitPrice(boolean discounted)
discounted
- The boolean value