com.ibm.commerce.bi.taglib

Class ProductBaseTag

  • All Implemented Interfaces:
    java.io.Serializable, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag


    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                      |
     +--------------------------------------------------------------------------+
     
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String COPYRIGHT
      IBM copyright notice field.
      • 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
      ProductBaseTag() 
    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        IBM copyright notice field.
        See Also:
        Constant Field Values
    • Constructor Detail

      • ProductBaseTag

        public ProductBaseTag()
    • Method Detail

      • doStartTag

        public int doStartTag()
                       throws javax.servlet.jsp.JspException
        Gathers the required data to trigger a product view event.
        Specified by:
        doStartTag in interface javax.servlet.jsp.tagext.Tag
        Overrides:
        doStartTag in class BaseTag
        Returns:
        always EVAL_PAGE constant
        Throws:
        javax.servlet.jsp.JspException - on any Exception
      • setCatentryId

        public void setCatentryId(java.lang.String catentryIdVar)
        Sets the catalog entry ID parameter for this Tag. If the databean is not set, this value will be used to create a databean.
        Parameters:
        catentryIdVar - the catalog entry ID parameter for this Tag.
      • setDatabean

        public void setDatabean(com.ibm.commerce.persistence.AbstractJpaEntityAccessBean databeanVar)
        Sets the databean for this Tag.
        Parameters:
        databeanVar - The databean to set. Must be one of ProductDataBean, ItemDataBean, BundleDataBean, or PackageDataBean.
      • setCatalogNavigationViewType

        public void setCatalogNavigationViewType(CatalogNavigationViewType catalogNavigationViewTypeVar)
        Sets the CatalogNavigationViewType SDO to be used to get the data for analysis
        Parameters:
        catalogNavigationViewTypeVar - The CatalogNavigationViewType to set.
      • setCatalogNavigationViewJSON

        public void setCatalogNavigationViewJSON(java.util.HashMap catalogNavigationViewJSONVar)
        Sets the CatalogNavigationView JSON to be used to get the data for analysis
        Parameters:
        catalogNavigationViewJSONVar - The CatalogNavigationView JSON to set.
      • setExtraparms

        public void setExtraparms(java.lang.String extraparmsVar)
        Sets the additional parameters that should be passed in the page view map
        Parameters:
        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.
      • getParamVector

        public 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.
        Returns:
        A vector object
      • setPagename

        public void setPagename(java.lang.String pagenameVar)
        Sets the page name that need to be passed in the page view map
        Parameters:
        pagenameVar - The page name that need to be passed in the page view map
      • getDataAsJSON

        public java.lang.String getDataAsJSON(boolean useCatIdOverride)
        Returns the analytics data in a JSON format
        Parameters:
        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 libraries
        Returns:
        A JSON String
      • isReturnAsJSON

        public boolean isReturnAsJSON()
        Checks whether the tag need to return the data as JSON
        Returns:
        A boolean value whether the tag need to return the data as JSON
      • setReturnAsJSON

        public void setReturnAsJSON(boolean flag)
        Sets the boolean value whether to return the data as JSON
        Parameters:
        flag - The boolean value whether to return the data as JSON