Class CmsJspTagEdit

  • 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

    public class CmsJspTagEdit
    extends CmsJspScopedVarBodyTagSuport
    This tag is used to attach an edit provider to a snippet of HTML.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String NEW_LINK_IDENTIFIER
      Identifier to indicate that the new link should be handled by this tag - not by a I_CmsResourceCollector.
      • 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
      CmsJspTagEdit()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String createResource​(CmsObject cmsObject, java.lang.String newLink, java.util.Locale locale, java.lang.String sitePath, java.lang.String modelFileName, java.lang.String mode, java.lang.String postCreateHandler)
      Creates a new resource.
      int doEndTag()  
      int doStartTag()  
      static java.lang.String getNewLink​(CmsObject cms, I_CmsResourceType resType, java.lang.String creationSitemap)
      Creates the String specifying where which type of resource has to be created.
      static java.lang.String getRootPathFromNewLink​(java.lang.String newLink)
      Returns the resource type name contained in the newLink parameter.
      static java.lang.String getTypeFromNewLink​(java.lang.String newLink)
      Returns the resource type name contained in the newLink parameter.
      static void insertDirectEditEnd​(javax.servlet.jsp.PageContext pageContext)
      Inserts the closing direct edit tag.
      static boolean insertDirectEditStart​(CmsObject cms, javax.servlet.jsp.PageContext pageContext, CmsResource resource, boolean canCreate, boolean canDelete, java.lang.String createType, java.lang.String creationSitemap, java.lang.String postCreateHandler, java.lang.String binaryUploadFolder)
      Inserts the opening direct edit tag.
      void release()  
      void setCreate​(java.lang.Boolean canCreate)
      Setter for the "create" attribute of the tag.
      void setCreateType​(java.lang.String typeName)
      Setter for the "createType" attribute of the tag.
      void setCreationSiteMap​(java.lang.String sitePath)
      Setter for the "creationSiteMap" attribute of the tag.
      void setDelete​(java.lang.Boolean canDelete)
      Setter for the "delete" attribute of the tag.
      void setPostCreateHandler​(java.lang.String postCreateHandler)
      Setter for the "postCreateHandler" attribute of the tag.
      void setUploadFolder​(java.lang.String uploadFolder)
      Sets the upload folder.
      void setUuid​(java.lang.String uuid)
      Setter for the uuid attribute of the tag, providing the uuid of content that should be edited.
      • 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

      • createResource

        public static java.lang.String createResource​(CmsObject cmsObject,
                                                      java.lang.String newLink,
                                                      java.util.Locale locale,
                                                      java.lang.String sitePath,
                                                      java.lang.String modelFileName,
                                                      java.lang.String mode,
                                                      java.lang.String postCreateHandler)
                                               throws CmsException
        Creates a new resource.
        Parameters:
        cmsObject - The CmsObject of the current request context.
        newLink - A string, specifying where which new content should be created.
        locale - The locale for which the
        sitePath - site path of the currently edited content.
        modelFileName - not used.
        mode - optional creation mode
        postCreateHandler - optional class name of an I_CmsCollectorPostCreateHandler which is invoked after the content has been created. The fully qualified class name can be followed by a "|" symbol and a handler specific configuration string.
        Returns:
        The site-path of the newly created resource.
        Throws:
        CmsException - if something goes wrong
      • getRootPathFromNewLink

        public static java.lang.String getRootPathFromNewLink​(java.lang.String newLink)
        Returns the resource type name contained in the newLink parameter.

        Parameters:
        newLink - the newLink parameter
        Returns:
        the resource type name
      • getTypeFromNewLink

        public static java.lang.String getTypeFromNewLink​(java.lang.String newLink)
        Returns the resource type name contained in the newLink parameter.

        Parameters:
        newLink - the newLink parameter
        Returns:
        the resource type name
      • insertDirectEditEnd

        public static void insertDirectEditEnd​(javax.servlet.jsp.PageContext pageContext)
        Inserts the closing direct edit tag.

        Parameters:
        pageContext - the page context
      • insertDirectEditStart

        public static boolean insertDirectEditStart​(CmsObject cms,
                                                    javax.servlet.jsp.PageContext pageContext,
                                                    CmsResource resource,
                                                    boolean canCreate,
                                                    boolean canDelete,
                                                    java.lang.String createType,
                                                    java.lang.String creationSitemap,
                                                    java.lang.String postCreateHandler,
                                                    java.lang.String binaryUploadFolder)
        Inserts the opening direct edit tag.

        Parameters:
        cms - the CMS context
        pageContext - the page context
        resource - the resource to edit
        canCreate - if resource creation is allowed
        canDelete - if resource deletion is allowed
        createType - the resource type to create, default to the type of the edited resource
        creationSitemap - the sitemap context to create the resource in, default to the current requested URI
        postCreateHandler - the post create handler if required
        binaryUploadFolder - the upload folder for binary files
        Returns:
        true if an opening direct edit tag was inserted
      • 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()
      • setCreate

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

        public void setCreateType​(java.lang.String typeName)
        Setter for the "createType" attribute of the tag.

        Parameters:
        typeName - value of the "createType" attribute of the tag.
      • 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​(java.lang.Boolean canDelete)
        Setter for the "delete" attribute of the tag.
        Parameters:
        canDelete - value of the "delete" attribute of the tag.
      • 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.
      • setUploadFolder

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

        public void setUuid​(java.lang.String uuid)
        Setter for the uuid attribute of the tag, providing the uuid of content that should be edited. If no valid uuid of an existing resource is given, it is assumed the tag is only used for creating new contents.
        Parameters:
        uuid - the uuid of the content that should be edited.