com.ibm.commerce.pagelayout.internal.client.taglib

Class WidgetImportTag

  • java.lang.Object
    • javax.servlet.jsp.tagext.TagSupport
      • javax.servlet.jsp.tagext.BodyTagSupport
        • org.apache.taglibs.standard.tag.common.core.ImportSupport
          • org.apache.taglibs.standard.tag.rt.core.ImportTag
            • com.ibm.commerce.pagelayout.internal.client.taglib.WidgetImportTag
  • All Implemented Interfaces:
    com.ibm.commerce.foundation.internal.client.taglib.ParameterizedTag, java.io.Serializable, javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag, javax.servlet.jsp.tagext.TryCatchFinally, org.apache.taglibs.standard.tag.common.core.ParamParent


    public class WidgetImportTag
    extends org.apache.taglibs.standard.tag.rt.core.ImportTag
    implements com.ibm.commerce.foundation.internal.client.taglib.ParameterizedTag
    This is the tag handler class for wcpgl:widgetImport JSTL tag. It extends the functionality of c:import tag. c:import tag supports importing a JSP by using URL attribute. wcf:widgetImport tag supports importing a JSP by using either URL or layout definition or widget definition. The order of import is:
    • URL - If url attribute is not null, then import the JSP associated with the URL attribute. No further processing is done.
    • slotId - If slotId attribute is set, then based on the layout definition and the widgets associated with this slotId, appropriate widgets are imported.
    • identifier - If widget definition cannot be found using slotId ( or if slotId is null), identifier is used to find the widgets and those widgets are imported.
    This class allows importing multiple widgets at a time (applicable only for slotId). When multiple widgets are associated with a given slotId, then all the widgets are imported sequentially. To support dyna cache feature, the jspWriter is flushed after every import. If widget definition cannot be found, then further process will be done based on the value of isDebug attribute.
    • If isDebug is set to false, then the tag simply returns without any exception.
    • If isDebug is set to true, then error handling is done in the following order:
      • errorWidget attribute is set, then this value is used to look up error widget and the widget is imported.
      • Default error widget with identifier ErrorWidget is looked up and the widget is imported.
      • Exception is thrown.
    This tag handler class will help to identify the correct URL to import, but the final processing of the URL is done by the base class (ImportTag - Which is tag handler class for the c:import tag. This tag handler class will have access to any parameters set using the nested wcf:param sub-tag. These parameters, along with the parameters set in the widget definition and the parameters set by the business user for the widgets in the layouts are aggregated and gets passed to the base tag handler class.
    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 class org.apache.taglibs.standard.tag.common.core.ImportSupport

        DEFAULT_ENCODING, VALID_SCHEME_CHARS
      • Fields inherited from interface javax.servlet.jsp.tagext.BodyTag

        EVAL_BODY_BUFFERED, EVAL_BODY_TAG
      • 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
      WidgetImportTag() 
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      int doEndTag()
      Imports the list of URLs identified.
      int doStartTag()
      This method creates set of URLManager objects which will be processed in the end.
      java.util.Map getParameterMap()
      This method is called by the "param" sub-tag.
      void setDebug(java.lang.String debug)
      Set debug mode
      void setIdentifier(java.lang.String widgetIdentifier)
      Setter for the widget identifier
      void setSingletonKey(java.lang.String singeltonKeyValue)
      Setter for singletonKey attribute
      void setSlotId(java.lang.String newSlotId)
      Set slotId of current instance
      void setUniqueID(java.lang.String widgetUniqueID)
      Setter for the widget uniqueId
      void setUseIBMContextInSeparatedEnv(java.lang.String useIBMContextInSeparatedEnv)
      Setter for useIBMContextInSeparatedEnv attribute
      void setVarPageDesignDetails(java.lang.String varName)
      Setter for Page Design details variable name
      void setVarPageDesignDetailsJSON(java.lang.String varName)
      Setter for Page Design details JSON variable name
      java.lang.String toString()
      Override toString method.
      • Methods inherited from class org.apache.taglibs.standard.tag.rt.core.ImportTag

        setCharEncoding, setContext, setUrl
      • Methods inherited from class org.apache.taglibs.standard.tag.common.core.ImportSupport

        addParameter, doCatch, doFinally, isAbsoluteUrl, release, setScope, setVar, setVarReader, stripSession
      • Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport

        doAfterBody, doInitBody, getBodyContent, getPreviousOut, setBodyContent
      • Methods inherited from class javax.servlet.jsp.tagext.TagSupport

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

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface javax.servlet.jsp.tagext.Tag

        getParent, setPageContext, setParent
    • Field Detail

      • COPYRIGHT

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

      • WidgetImportTag

        public WidgetImportTag()
    • Method Detail

      • doStartTag

        public int doStartTag()
                       throws javax.servlet.jsp.JspException
        This method creates set of URLManager objects which will be processed in the end. Each URLManager object will point to one URL which will be imported. The URLManager objects will be created based on url,slotId,identifier in that order. Importing multiple URLs is supported only with slotId parameter. If multiple widgets are associated with a given slotId then all those widgets are imported sequentially
        Specified by:
        doStartTag in interface javax.servlet.jsp.tagext.Tag
        Overrides:
        doStartTag in class org.apache.taglibs.standard.tag.common.core.ImportSupport
        Returns:
        Always returns Tag.EVAL_BODY_INCLUDE
        Throws:
        javax.servlet.jsp.JspException
      • doEndTag

        public int doEndTag()
                     throws javax.servlet.jsp.JspException
        Imports the list of URLs identified. Enables auto flush flag before importing the URLs and resets it after the import
        Specified by:
        doEndTag in interface javax.servlet.jsp.tagext.Tag
        Overrides:
        doEndTag in class org.apache.taglibs.standard.tag.common.core.ImportSupport
        Throws:
        javax.servlet.jsp.JspException
      • setIdentifier

        public void setIdentifier(java.lang.String widgetIdentifier)
        Setter for the widget identifier
        Parameters:
        String - - Widget Identifier
      • setUniqueID

        public void setUniqueID(java.lang.String widgetUniqueID)
        Setter for the widget uniqueId
        Parameters:
        String - - Widget Unique ID
      • setSlotId

        public void setSlotId(java.lang.String newSlotId)
        Set slotId of current instance
        Parameters:
        newSlotId - - slotId used in the JSP
      • setDebug

        public void setDebug(java.lang.String debug)
        Set debug mode
        Parameters:
        debug - - either true or false.
      • setVarPageDesignDetails

        public void setVarPageDesignDetails(java.lang.String varName)
        Setter for Page Design details variable name
      • setVarPageDesignDetailsJSON

        public void setVarPageDesignDetailsJSON(java.lang.String varName)
        Setter for Page Design details JSON variable name
      • setSingletonKey

        public void setSingletonKey(java.lang.String singeltonKeyValue)
        Setter for singletonKey attribute
      • setUseIBMContextInSeparatedEnv

        public void setUseIBMContextInSeparatedEnv(java.lang.String useIBMContextInSeparatedEnv)
        Setter for useIBMContextInSeparatedEnv attribute
      • getParameterMap

        public java.util.Map getParameterMap()
        This method is called by the "param" sub-tag. The Map is a map of String names to List values. The value List is a list of String objects. "param" sub-tag is a SimpleTagSupport class which will add the name - value pair to the map returned by this method. This will allow the parent tag class (this class) to access the parameters.
        Specified by:
        getParameterMap in interface com.ibm.commerce.foundation.internal.client.taglib.ParameterizedTag
        Returns:
        parameter map
        See Also:
        ParameterizedTag.getParameterMap()
      • toString

        public java.lang.String toString()
        Override toString method. Prints details about the widgetImport tag if trace is enabled and log level is set to FINE
        Overrides:
        toString in class java.lang.Object
        Returns:
        - String representation of this object