Class ElementBaseTag

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

    public abstract class ElementBaseTag
    extends BaseTag

    An abstract tag class which generates the data required for an analytics vendor to trigger a intra-page content event. The generated data is placed in a HashMap object paramMap which the analytics vendor classes can consume. 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.

     | ELEMENT_ID     | The value of the elementId attribute      | 
     | CATEGORY       | The category to which the element belongs |
     | PAGE_ID        | The page identifier where the element is  | 
     |                | placed                                    |
     | PAGE_CATEGORY  | The category of the page                  |
     | EXTRA_PARAMS   | The extra parameters which the users      |
     |                | want to send along with the element       |
     |                | 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

      Modifier and Type Field and Description
      static java.lang.String COPYRIGHT
      IBM copyright notice field.
      • Fields inherited from interface javax.servlet.jsp.tagext.IterationTag

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

    • Constructor Summary

      Constructor and Description
    • Field Detail


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

      • ElementBaseTag

        public ElementBaseTag()
    • Method Detail

      • doStartTag

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

        public java.util.HashMap<java.lang.String,java.lang.Object> getParamMap()
        Returns the element data map which contain the data required for an analytics vendor to invoke a element view event
        The page view map
      • setCategory

        public void setCategory(java.lang.String categoryVar)
        Sets the category to which the element belongs
        categoryVar - The category to which the element belongs
      • setExtraparms

        public void setExtraparms(java.lang.String extraparmsVar)
        Sets the additional parameters that should be passed in the page view map
        extraparmsVar - The additional parameters that will be passed in the page view map. Fields delimited by $ will be assumed to be methods applied to
      • getDataAsJSON

        public java.lang.String getDataAsJSON()
        Returns the analytics data in a JSON format
        A JSON String
      • isReturnAsJSON

        public boolean isReturnAsJSON()
        Checks whether the tag need to return the data as JSON
        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
        flag - The boolean value whether to return the data as JSON
      • setElementId

        public void setElementId(java.lang.String elementIdVar)
        Sets the elementId value
        elementIdVar - The elementId to set
      • setPageId

        public void setPageId(java.lang.String pageIdVar)
        Sets the pageId value
        pageIdVar - The pageId value to set
      • setPageCategory

        public void setPageCategory(java.lang.String pageCategoryVar)
        Sets the page category value
        pageCategoryVar - The page category value to set
      • setLocation

        public void setLocation(java.lang.String locationVar)
        Sets the location value
        locationVar - The location value to set