Package org.opencms.jsp
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:
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 aI_CmsResourceCollector
.
-
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 org.opencms.jsp.CmsJspScopedVarBodyTagSuport
getScope, getScopeAsInt, getScopeAsString, getScopeInt, getVar, isScopeVarSet, setScope, setVar, storeAttribute, storeAttribute
-
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
-
-
-
-
Field Detail
-
NEW_LINK_IDENTIFIER
public static final java.lang.String NEW_LINK_IDENTIFIER
Identifier to indicate that the new link should be handled by this tag - not by aI_CmsResourceCollector
.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CmsJspTagEdit
public CmsJspTagEdit()
-
-
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 thesitePath
- site path of the currently edited content.modelFileName
- not used.mode
- optional creation modepostCreateHandler
- optional class name of anI_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 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.- Parameters:
cms
- the CMS contextresType
- the resource type to createcreationSitemap
- the creation sitemap parameter- Returns:
- The String identifying which type of resource has to be created where.
- See Also:
createResource(CmsObject, String, Locale, String, String, String, String)
-
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 contextpageContext
- the page contextresource
- the resource to editcanCreate
- if resource creation is allowedcanDelete
- if resource deletion is allowedcreateType
- the resource type to create, default to the type of the edited resourcecreationSitemap
- the sitemap context to create the resource in, default to the current requested URIpostCreateHandler
- the post create handler if requiredbinaryUploadFolder
- 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 interfacejavax.servlet.jsp.tagext.Tag
- Overrides:
doEndTag
in classjavax.servlet.jsp.tagext.BodyTagSupport
- Throws:
javax.servlet.jsp.JspException
- See Also:
BodyTagSupport.doEndTag()
-
doStartTag
public int doStartTag() throws CmsIllegalArgumentException
- Specified by:
doStartTag
in interfacejavax.servlet.jsp.tagext.Tag
- Overrides:
doStartTag
in classjavax.servlet.jsp.tagext.BodyTagSupport
- Throws:
CmsIllegalArgumentException
- See Also:
Tag.doStartTag()
-
release
public void release()
- Specified by:
release
in interfacejavax.servlet.jsp.tagext.Tag
- Overrides:
release
in classCmsJspScopedVarBodyTagSuport
- See Also:
CmsJspScopedVarBodyTagSuport.release()
-
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 theI_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.
-
-