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:
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Identifier to indicate that the new link should be handled by this tag - not by aI_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 -
Method Summary
Modifier and TypeMethodDescriptionstatic String
createResource
(CmsObject cmsObject, String newLink, Locale locale, String sitePath, String modelFileName, String mode, String postCreateHandler) Creates a new resource.int
doEndTag()
int
static String
getNewLink
(CmsObject cms, I_CmsResourceType resType, String creationSitemap) Creates the String specifying where which type of resource has to be created.static String
getRootPathFromNewLink
(String newLink) Returns the resource type name contained in the newLink parameter.static String
getTypeFromNewLink
(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, String createType, String creationSitemap, String postCreateHandler, String binaryUploadFolder) Inserts the opening direct edit tag.void
release()
void
Setter for the "create" attribute of the tag.void
setCreateType
(String typeName) Setter for the "createType" attribute of the tag.void
setCreationSiteMap
(String sitePath) Setter for the "creationSiteMap" attribute of the tag.void
Setter for the "delete" attribute of the tag.void
setPostCreateHandler
(String postCreateHandler) Setter for the "postCreateHandler" attribute of the tag.void
setUploadFolder
(String uploadFolder) Sets the upload folder.void
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
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
-
Field Details
-
NEW_LINK_IDENTIFIER
Identifier to indicate that the new link should be handled by this tag - not by aI_CmsResourceCollector
.- See Also:
-
-
Constructor Details
-
CmsJspTagEdit
public CmsJspTagEdit()
-
-
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 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
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:
-
getRootPathFromNewLink
Returns the resource type name contained in the newLink parameter.- Parameters:
newLink
- the newLink parameter- Returns:
- the resource type name
-
getTypeFromNewLink
Returns the resource type name contained in the newLink parameter.- Parameters:
newLink
- the newLink parameter- Returns:
- the resource type name
-
insertDirectEditEnd
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 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
- 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
- Specified by:
doStartTag
in interfacejavax.servlet.jsp.tagext.Tag
- Overrides:
doStartTag
in classjavax.servlet.jsp.tagext.BodyTagSupport
- Throws:
CmsIllegalArgumentException
- See Also:
-
Tag.doStartTag()
-
release
- Specified by:
release
in interfacejavax.servlet.jsp.tagext.Tag
- Overrides:
release
in classCmsJspScopedVarBodyTagSuport
- See Also:
-
setCreate
Setter for the "create" attribute of the tag.- Parameters:
canCreate
- value of the tag's attribute "create".
-
setCreateType
Setter for the "createType" attribute of the tag.- Parameters:
typeName
- value of the "createType" attribute of the tag.
-
setCreationSiteMap
Setter for the "creationSiteMap" attribute of the tag.- Parameters:
sitePath
- value of the "creationSiteMap" attribute of the tag.
-
setDelete
Setter for the "delete" attribute of the tag.- Parameters:
canDelete
- value of the "delete" attribute of the tag.
-
setPostCreateHandler
Setter for the "postCreateHandler" attribute of the tag.- Parameters:
postCreateHandler
- fully qualified class name of theI_CmsCollectorPostCreateHandler
to use.
-
setUploadFolder
Sets the upload folder.- Parameters:
uploadFolder
- the upload folder
-
setUuid
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.
-