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 StringIdentifier 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
bodyContentFields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContextFields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAGFields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAINFields 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 StringcreateResource(CmsObject cmsObject, String newLink, Locale locale, String sitePath, String modelFileName, String mode, String postCreateHandler) Creates a new resource.intdoEndTag()intstatic StringgetNewLink(CmsObject cms, I_CmsResourceType resType, String creationSitemap) Creates the String specifying where which type of resource has to be created.static StringgetRootPathFromNewLink(String newLink) Returns the resource type name contained in the newLink parameter.static StringgetTypeFromNewLink(String newLink) Returns the resource type name contained in the newLink parameter.static voidinsertDirectEditEnd(javax.servlet.jsp.PageContext pageContext) Inserts the closing direct edit tag.static booleaninsertDirectEditStart(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.voidrelease()voidSetter for the "create" attribute of the tag.voidsetCreateType(String typeName) Setter for the "createType" attribute of the tag.voidsetCreationSiteMap(String sitePath) Setter for the "creationSiteMap" attribute of the tag.voidSetter for the "delete" attribute of the tag.voidsetPostCreateHandler(String postCreateHandler) Setter for the "postCreateHandler" attribute of the tag.voidsetUploadFolder(String uploadFolder) Sets the upload folder.voidSetter 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, storeAttributeMethods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doAfterBody, doInitBody, getBodyContent, getPreviousOut, setBodyContentMethods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValueMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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_CmsCollectorPostCreateHandlerwhich 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:
trueif an opening direct edit tag was inserted
-
doEndTag
- Specified by:
doEndTagin interfacejavax.servlet.jsp.tagext.Tag- Overrides:
doEndTagin classjavax.servlet.jsp.tagext.BodyTagSupport- Throws:
javax.servlet.jsp.JspException- See Also:
-
doStartTag
- Specified by:
doStartTagin interfacejavax.servlet.jsp.tagext.Tag- Overrides:
doStartTagin classjavax.servlet.jsp.tagext.BodyTagSupport- Throws:
CmsIllegalArgumentException- See Also:
-
release
- Specified by:
releasein interfacejavax.servlet.jsp.tagext.Tag- Overrides:
releasein 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_CmsCollectorPostCreateHandlerto 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.
-