Class CmsJspTagDisplay

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

    public class CmsJspTagDisplay
    extends javax.servlet.jsp.tagext.BodyTagSupport
    implements I_CmsJspTagParamParent
    The 'display' tag can be used to display a single resource using a formatter. It also allows to activate direct editing.

    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String DISPLAY_FORMATTER_SETTING
      Setting used to store the display formatter key.
      • Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport

        bodyContent
      • Fields inherited from class javax.servlet.jsp.tagext.TagSupport

        id, pageContext
      • 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 Description
      CmsJspTagDisplay()
      Constructor.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addDisplayFormatter​(java.lang.String type, java.lang.String path)
      Adds a display formatter.
      void addParameter​(java.lang.String name, java.lang.String value)
      Add a parameter to this tag.
      static void displayAction​(CmsResource elementResource, I_CmsFormatterBean formatter, java.util.Map<java.lang.String,​java.lang.String> settings, boolean cacheable, boolean editable, boolean canCreate, boolean canDelete, java.lang.String creationSiteMap, java.lang.String postCreateHandler, java.lang.String uploadFolder, javax.servlet.jsp.PageContext context, javax.servlet.ServletRequest request, javax.servlet.ServletResponse response)
      Includes the formatter rendering the given element.
      static void displayAction​(CmsContainerElementBean element, I_CmsFormatterBean formatter, boolean cacheable, boolean editable, boolean canCreate, boolean canDelete, java.lang.String creationSiteMap, java.lang.String postCreateHandler, java.lang.String uploadFolder, javax.servlet.jsp.PageContext context, javax.servlet.ServletRequest request, javax.servlet.ServletResponse response)
      Includes the formatter rendering the given element.
      static void displayAction​(CmsContainerElementBean element, I_CmsFormatterBean formatter, javax.servlet.jsp.PageContext context, javax.servlet.ServletRequest request, javax.servlet.ServletResponse response)
      Includes the formatter rendering the given element.
      int doEndTag()  
      int doStartTag()  
      boolean getEditable()
      Returns the editable.
      boolean getPassSettings()
      Returns the passSettings.
      static java.lang.String getSettingKeyForMatchingFormatterPrefix​(CmsADEConfigData config, I_CmsFormatterBean formatter, java.lang.String settingKey)
      If the setting key starts with the key or id of the given formatter, returns the remaining suffix, else null.
      java.util.Map<java.lang.String,​java.lang.String> getSettings()
      Returns the element settings to be used.
      java.lang.String getValue()
      Returns the value.
      void release()  
      void setBaseUri​(java.lang.String uri)
      Sets the base URI to use for finding the 'default' display formatter.
      void setCacheable​(boolean cacheable)
      Enables/disables the use of the flex cache for the display formatter include.
      void setCreate​(boolean canCreate)
      Setter for the "create" attribute of the tag.
      void setCreate​(java.lang.String canCreate)
      Setter for the "create" attribute of the tag.
      void setCreationSiteMap​(java.lang.String sitePath)
      Setter for the "creationSiteMap" attribute of the tag.
      void setDelete​(boolean canDelete)
      Setter for the "delete" attribute of the tag.
      void setDelete​(java.lang.String canDelete)
      Setter for the "delete" attribute of the tag.
      void setDisplayFormatters​(java.lang.Object displayFormatters)
      Sets the items.
      void setEditable​(boolean editable)
      Sets the editable.
      void setEditable​(java.lang.String editable)
      Sets the editable.
      void setPassSettings​(boolean passSettings)
      Sets the passSettings.
      void setPassSettings​(java.lang.String passSettings)
      Sets the passSettings.
      void setPostCreateHandler​(java.lang.String postCreateHandler)
      Setter for the "postCreateHandler" attribute of the tag.
      void setSettings​(java.util.Map<java.lang.String,​java.lang.String> settings)
      Sets the element settings to be used.
      void setUploadFolder​(java.lang.String uploadFolder)
      Sets the upload folder.
      void setValue​(java.lang.String value)
      Sets the value.
      • 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

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

        getParent, setPageContext, setParent
    • Method Detail

      • displayAction

        public static void displayAction​(CmsContainerElementBean element,
                                         I_CmsFormatterBean formatter,
                                         boolean cacheable,
                                         boolean editable,
                                         boolean canCreate,
                                         boolean canDelete,
                                         java.lang.String creationSiteMap,
                                         java.lang.String postCreateHandler,
                                         java.lang.String uploadFolder,
                                         javax.servlet.jsp.PageContext context,
                                         javax.servlet.ServletRequest request,
                                         javax.servlet.ServletResponse response)
        Includes the formatter rendering the given element.

        Parameters:
        element - the element
        formatter - the formatter configuration bean
        cacheable - true if the flex cache should be used for calling the display formatter
        editable - if editable
        canCreate - if new resources may be created
        canDelete - if the resource may be deleted
        creationSiteMap - the create location sub site
        postCreateHandler - the post create handler
        uploadFolder - the upload folder to use
        context - the page context
        request - the request
        response - the response
      • displayAction

        public static void displayAction​(CmsContainerElementBean element,
                                         I_CmsFormatterBean formatter,
                                         javax.servlet.jsp.PageContext context,
                                         javax.servlet.ServletRequest request,
                                         javax.servlet.ServletResponse response)
        Includes the formatter rendering the given element.

        Parameters:
        element - the element
        formatter - the formatter configuration bean
        context - the page context
        request - the request
        response - the response
      • displayAction

        public static void displayAction​(CmsResource elementResource,
                                         I_CmsFormatterBean formatter,
                                         java.util.Map<java.lang.String,​java.lang.String> settings,
                                         boolean cacheable,
                                         boolean editable,
                                         boolean canCreate,
                                         boolean canDelete,
                                         java.lang.String creationSiteMap,
                                         java.lang.String postCreateHandler,
                                         java.lang.String uploadFolder,
                                         javax.servlet.jsp.PageContext context,
                                         javax.servlet.ServletRequest request,
                                         javax.servlet.ServletResponse response)
        Includes the formatter rendering the given element.

        Parameters:
        elementResource - the element resource
        formatter - the formatter configuration bean
        settings - the element settings
        cacheable - true if the flex cache should be used for calling the display formatter
        editable - if editable
        canCreate - if new resources may be created
        canDelete - if the resource may be deleted
        creationSiteMap - the create location sub site
        postCreateHandler - the post create handler
        uploadFolder - the upload folder
        context - the page context
        request - the request
        response - the response
      • getSettingKeyForMatchingFormatterPrefix

        public static java.lang.String getSettingKeyForMatchingFormatterPrefix​(CmsADEConfigData config,
                                                                               I_CmsFormatterBean formatter,
                                                                               java.lang.String settingKey)
        If the setting key starts with the key or id of the given formatter, returns the remaining suffix, else null.
        Parameters:
        config - the current sitemap configuration
        formatter - the formatter bean
        settingKey - the setting key
        Returns:
        the remaining setting name suffix
      • addDisplayFormatter

        public void addDisplayFormatter​(java.lang.String type,
                                        java.lang.String path)
        Adds a display formatter.

        Parameters:
        type - the resource type
        path - the path to the formatter configuration file.

      • doEndTag

        public int doEndTag()
                     throws javax.servlet.jsp.JspException
        Specified by:
        doEndTag in interface javax.servlet.jsp.tagext.Tag
        Overrides:
        doEndTag in class javax.servlet.jsp.tagext.BodyTagSupport
        Throws:
        javax.servlet.jsp.JspException
        See Also:
        BodyTagSupport.doEndTag()
      • doStartTag

        public int doStartTag()
        Specified by:
        doStartTag in interface javax.servlet.jsp.tagext.Tag
        Overrides:
        doStartTag in class javax.servlet.jsp.tagext.BodyTagSupport
        See Also:
        BodyTagSupport.doStartTag()
      • getEditable

        public boolean getEditable()
        Returns the editable.

        Returns:
        the editable
      • getPassSettings

        public boolean getPassSettings()
        Returns the passSettings.

        Returns:
        the passSettings
      • getSettings

        public java.util.Map<java.lang.String,​java.lang.String> getSettings()
        Returns the element settings to be used.

        Returns:
        the element settings to be used
      • getValue

        public java.lang.String getValue()
        Returns the value.

        Returns:
        the value
      • release

        public void release()
        Specified by:
        release in interface javax.servlet.jsp.tagext.Tag
        Overrides:
        release in class javax.servlet.jsp.tagext.BodyTagSupport
        See Also:
        BodyTagSupport.release()
      • setBaseUri

        public void setBaseUri​(java.lang.String uri)
        Sets the base URI to use for finding the 'default' display formatter.
        Parameters:
        uri - the base URI
      • setCacheable

        public void setCacheable​(boolean cacheable)
        Enables/disables the use of the flex cache for the display formatter include.
        Parameters:
        cacheable - true if the flex cache should be used for the display formatter include
      • setCreate

        public void setCreate​(boolean canCreate)
        Setter for the "create" attribute of the tag.
        Parameters:
        canCreate - value of the tag's attribute "create".
      • setCreate

        public void setCreate​(java.lang.String canCreate)
        Setter for the "create" attribute of the tag.
        Parameters:
        canCreate - value of the tag's attribute "create".
      • setCreationSiteMap

        public void setCreationSiteMap​(java.lang.String sitePath)
        Setter for the "creationSiteMap" attribute of the tag.
        Parameters:
        sitePath - value of the "creationSiteMap" attribute of the tag.
      • setDelete

        public void setDelete​(boolean canDelete)
        Setter for the "delete" attribute of the tag.
        Parameters:
        canDelete - value of the "delete" attribute of the tag.
      • setDelete

        public void setDelete​(java.lang.String canDelete)
        Setter for the "delete" attribute of the tag.
        Parameters:
        canDelete - value of the "delete" attribute of the tag.
      • setDisplayFormatters

        public void setDisplayFormatters​(java.lang.Object displayFormatters)
        Sets the items.

        Parameters:
        displayFormatters - the items to set
      • setEditable

        public void setEditable​(boolean editable)
        Sets the editable.

        Parameters:
        editable - the editable to set
      • setEditable

        public void setEditable​(java.lang.String editable)
        Sets the editable.

        Parameters:
        editable - the editable to set
      • setPassSettings

        public void setPassSettings​(boolean passSettings)
        Sets the passSettings.

        Parameters:
        passSettings - the passSettings to set
      • setPassSettings

        public void setPassSettings​(java.lang.String passSettings)
        Sets the passSettings.

        Parameters:
        passSettings - the passSettings to set
      • setPostCreateHandler

        public void setPostCreateHandler​(java.lang.String postCreateHandler)
        Setter for the "postCreateHandler" attribute of the tag.
        Parameters:
        postCreateHandler - fully qualified class name of the I_CmsCollectorPostCreateHandler to use.
      • setSettings

        public void setSettings​(java.util.Map<java.lang.String,​java.lang.String> settings)
        Sets the element settings to be used.

        Parameters:
        settings - the element settings to be used
      • setUploadFolder

        public void setUploadFolder​(java.lang.String uploadFolder)
        Sets the upload folder.
        Parameters:
        uploadFolder - the upload folder
      • setValue

        public void setValue​(java.lang.String value)
        Sets the value.

        Parameters:
        value - the value to set