com.ibm.commerce.bi.taglib

Class BaseTag

  • java.lang.Object
    • javax.servlet.jsp.tagext.TagSupport
      • com.ibm.commerce.bi.taglib.BaseTag
    • 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
      BaseTag()
      Upon construction, get the global configuration object and save it for later use
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method and Description
      int doStartTag()
      Executed when the tag is first reached.
      java.lang.String getBiprovider()
      Gets the BI provider as set on the tag
      java.lang.String getCategoryIdForProduct(java.lang.String catEntryId)
      Deprecated. 
      Use com.ibm.commerce.bi.taglib.TagUtils.findCategoryId( Long catEntryId, HttpServletRequest request, CommandContext ctx)
      com.ibm.icu.text.Collator getCollator()
      Returns the Collator of the current request in the current Locale.
      CommandContext getCommandContext()
      Returns the CommandContext of the current request.
      BIConfigRegistry getConfig()
      Gets the instance of the global BI configuration object.
      com.ibm.icu.text.NumberFormat getNumberFormat()
      Returns a NumberFormat instance which can be used for formatting purposes
      java.lang.String getOptionValue(java.lang.String option)
      Returns the value of the given option.
      java.lang.String getStoreId()
      Returns the store identifier
      boolean isDebug()
      Whether or not debug output will be shown on the JSP.
      boolean isOptionDisabled(java.lang.String option)
      Returns true if the given option is disabled.
      boolean isOptionEnabled(java.lang.String option)
      Returns true if the given option is enabled.
      void setBiprovider(java.lang.String biProvider)
      Sets the BI provider
      void setDebug(boolean d)
      Turns debugging information on or off for this particular tag instance.
      • Methods inherited from class javax.servlet.jsp.tagext.TagSupport

        doAfterBody, doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • COPYRIGHT

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

      • BaseTag

        public BaseTag()
        Upon construction, get the global configuration object and save it for later use
    • Method Detail

      • doStartTag

        public int doStartTag()
                       throws javax.servlet.jsp.JspException
        Executed when the tag is first reached. The current CommandContext is saved for other tags to use
        Specified by:
        doStartTag in interface javax.servlet.jsp.tagext.Tag
        Overrides:
        doStartTag in class javax.servlet.jsp.tagext.TagSupport
        Returns:
        SKIP_BODY constant as these tags are not body tags
        Throws:
        javax.servlet.jsp.JspException - on any Exception
      • isDebug

        public boolean isDebug()
        Whether or not debug output will be shown on the JSP. If true, all parameters set and displayed via generateJavaScript(Hashtable) will be displayed. If the debug parameter is not set in the tag on the JSP, the global configuration setting will be used.
        Returns:
        Returns whether or not debug output will be shown.
      • setDebug

        public void setDebug(boolean d)
        Turns debugging information on or off for this particular tag instance.
        Parameters:
        d - Turns debugging information on or off.
      • getCommandContext

        public CommandContext getCommandContext()
        Returns the CommandContext of the current request.
        Returns:
        the CommandContext of the current request.
      • getConfig

        public BIConfigRegistry getConfig()
        Gets the instance of the global BI configuration object.
        Returns:
        the instance of the global BI configuration object.
      • getCollator

        public com.ibm.icu.text.Collator getCollator()
        Returns the Collator of the current request in the current Locale.
        Returns:
        the Collator of the current request in the current Locale.
      • getStoreId

        public java.lang.String getStoreId()
        Returns the store identifier
        Returns:
        The store identifier
      • getNumberFormat

        public com.ibm.icu.text.NumberFormat getNumberFormat()
        Returns a NumberFormat instance which can be used for formatting purposes
        Returns:
        The NumberFormat instance
      • getCategoryIdForProduct

        public java.lang.String getCategoryIdForProduct(java.lang.String catEntryId)
        Deprecated. Use com.ibm.commerce.bi.taglib.TagUtils.findCategoryId( Long catEntryId, HttpServletRequest request, CommandContext ctx)
        Returns the categoryId associated with a product. CategoryId parameter is required to associate a product with its parent category. The categoryId is obtained using the following method: 1. The tag class will try to locate a request parameter named 'categoryId' and use that value of this parameter if present 2. If the categoryId request parameter is not found, the tag class will get all the categories to which the product is associated, in the current browsing catalog, from the data base. 3. If the product has only one category associated, the tag class will use that categoryId 4. If the product has multiple categories associated, the tag class will try to locate the categoryId from either the session or cookie based on the customer settings 5. If the value is not found in session/cookie, the tag class will use the categoryId which has the lowest numerical value found from the database
        Parameters:
        catEntryId - The catalog entry Id of the product
        Returns:
        The categoryId
      • getBiprovider

        public java.lang.String getBiprovider()
        Gets the BI provider as set on the tag
        Returns:
        The BI provider, if set. Null otherwise.
      • setBiprovider

        public void setBiprovider(java.lang.String biProvider)
        Sets the BI provider
        Parameters:
        biProvider - The BI provider name, as defined in biConfig.xml
      • getOptionValue

        public java.lang.String getOptionValue(java.lang.String option)
        Returns the value of the given option.
        Parameters:
        option - The option name
        Returns:
        The option value. Null if the option does not exist.
      • isOptionEnabled

        public boolean isOptionEnabled(java.lang.String option)
        Returns true if the given option is enabled. False otherwise.
        Parameters:
        option - The option name
        Returns:
        true if the given option is enabled. False otherwise.
      • isOptionDisabled

        public boolean isOptionDisabled(java.lang.String option)
        Returns true if the given option is disabled. False otherwise.
        Parameters:
        option - The option name
        Returns:
        true if the given option is disabled. False otherwise.