Class CmsJspTagEdit

java.lang.Object
javax.servlet.jsp.tagext.TagSupport
javax.servlet.jsp.tagext.BodyTagSupport
org.opencms.jsp.CmsJspScopedVarBodyTagSuport
org.opencms.jsp.CmsJspTagEdit
All Implemented Interfaces:
Serializable, javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag

This tag is used to attach an edit provider to a snippet of HTML.
See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • createResource

      public static String createResource(CmsObject cmsObject, String newLink, Locale locale, String sitePath, String modelFileName, String mode, 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
    • getNewLink

      public static String getNewLink(CmsObject cms, I_CmsResourceType resType, String creationSitemap)
      Creates the String specifying where which type of resource has to be created.

      Parameters:
      cms - the CMS context
      resType - the resource type to create
      creationSitemap - the creation sitemap parameter
      Returns:
      The String identifying which type of resource has to be created where.

      See Also:
    • getRootPathFromNewLink

      public static String getRootPathFromNewLink(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 String getTypeFromNewLink(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, String createType, String creationSitemap, String postCreateHandler, 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()
    • doStartTag

      Specified by:
      doStartTag in interface javax.servlet.jsp.tagext.Tag
      Overrides:
      doStartTag in class javax.servlet.jsp.tagext.BodyTagSupport
      Throws:
      CmsIllegalArgumentException
      See Also:
      • Tag.doStartTag()
    • release

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

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

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

      Parameters:
      typeName - value of the "createType" attribute of the tag.
    • setCreationSiteMap

      public void setCreationSiteMap(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.
    • setPostCreateHandler

      public void setPostCreateHandler(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(String uploadFolder)
      Sets the upload folder.
      Parameters:
      uploadFolder - the upload folder
    • setUuid

      public void setUuid(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.