Package org.opencms.jsp
Class CmsJspTagDisplay
java.lang.Object
javax.servlet.jsp.tagext.TagSupport
javax.servlet.jsp.tagext.BodyTagSupport
org.opencms.jsp.CmsJspTagDisplay
- All Implemented Interfaces:
Serializable,javax.servlet.jsp.tagext.BodyTag,javax.servlet.jsp.tagext.IterationTag,javax.servlet.jsp.tagext.JspTag,javax.servlet.jsp.tagext.Tag,I_CmsJspTagParamParent
public class CmsJspTagDisplay
extends javax.servlet.jsp.tagext.BodyTagSupport
implements I_CmsJspTagParamParent
The 'display' tag can be used to display a single resource using a formatter. It also allows to activate direct editing.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringSetting used to store the display formatter key.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 TypeMethodDescriptionvoidaddDisplayFormatter(String type, String path) Adds a display formatter.voidaddDisplayFormatterKey(String type, String key) Adds a display formatter key for a type.voidaddParameter(String name, String value) Add a parameter to this tag.static voiddisplayAction(CmsResource elementResource, I_CmsFormatterBean formatter, Map<String, String> settings, boolean cacheable, boolean editable, boolean canCreate, boolean canDelete, String creationSiteMap, String postCreateHandler, String uploadFolder, javax.servlet.jsp.PageContext context, javax.servlet.ServletRequest request, javax.servlet.ServletResponse response) Includes the formatter rendering the given element.static voiddisplayAction(CmsContainerElementBean element, I_CmsFormatterBean formatter, boolean cacheable, boolean editable, boolean canCreate, boolean canDelete, String creationSiteMap, String postCreateHandler, String uploadFolder, javax.servlet.jsp.PageContext context, javax.servlet.ServletRequest request, javax.servlet.ServletResponse response) Includes the formatter rendering the given element.static voiddisplayAction(CmsContainerElementBean element, I_CmsFormatterBean formatter, javax.servlet.jsp.PageContext context, javax.servlet.ServletRequest request, javax.servlet.ServletResponse response) Includes the formatter rendering the given element.intdoEndTag()intbooleanReturns the editable.booleanReturns the passSettings.static StringgetSettingKeyForMatchingFormatterPrefix(CmsADEConfigData config, I_CmsFormatterBean formatter, String settingKey) If the setting key starts with the key or id of the given formatter, returns the remaining suffix, else null.Returns the element settings to be used.getValue()Returns the value.voidrelease()voidsetBaseUri(String uri) Sets the base URI to use for finding the 'default' display formatter.voidsetCacheable(boolean cacheable) Enables/disables the use of the flex cache for the display formatter include.voidsetContainerType(String containerType) Sets the container type used to select a formatter.voidsetCreate(boolean canCreate) Setter for the "create" attribute of the tag.voidSetter for the "create" attribute of the tag.voidsetCreationSiteMap(String sitePath) Setter for the "creationSiteMap" attribute of the tag.voidsetDelete(boolean canDelete) Setter for the "delete" attribute of the tag.voidSetter for the "delete" attribute of the tag.voidsetDisplayFormatters(Object displayFormatters) Sets the items.voidsetEditable(boolean editable) Sets the editable.voidsetEditable(String editable) Sets the editable.voidsetPassSettings(boolean passSettings) Sets the passSettings.voidsetPassSettings(String passSettings) Sets the passSettings.voidsetPostCreateHandler(String postCreateHandler) Setter for the "postCreateHandler" attribute of the tag.voidsetSettings(Map<String, String> settings) Sets the element settings to be used.voidsetUploadFolder(String uploadFolder) Sets the upload folder.voidSets the value.Methods 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
-
DISPLAY_FORMATTER_SETTING
Setting used to store the display formatter key.- See Also:
-
-
Constructor Details
-
CmsJspTagDisplay
public CmsJspTagDisplay()Constructor.
-
-
Method Details
-
displayAction
public static void displayAction(CmsContainerElementBean element, I_CmsFormatterBean formatter, boolean cacheable, boolean editable, boolean canCreate, boolean canDelete, String creationSiteMap, String postCreateHandler, String uploadFolder, javax.servlet.jsp.PageContext context, javax.servlet.ServletRequest request, javax.servlet.ServletResponse response) Includes the formatter rendering the given element.- Parameters:
element- the elementformatter- the formatter configuration beancacheable- true if the flex cache should be used for calling the display formattereditable- if editablecanCreate- if new resources may be createdcanDelete- if the resource may be deletedcreationSiteMap- the create location sub sitepostCreateHandler- the post create handleruploadFolder- the upload folder to usecontext- the page contextrequest- the requestresponse- the response
-
displayAction
public static void displayAction(CmsContainerElementBean element, I_CmsFormatterBean formatter, javax.servlet.jsp.PageContext context, javax.servlet.ServletRequest request, javax.servlet.ServletResponse response) Includes the formatter rendering the given element.- Parameters:
element- the elementformatter- the formatter configuration beancontext- the page contextrequest- the requestresponse- the response
-
displayAction
public static void displayAction(CmsResource elementResource, I_CmsFormatterBean formatter, Map<String, String> settings, boolean cacheable, boolean editable, boolean canCreate, boolean canDelete, String creationSiteMap, String postCreateHandler, String uploadFolder, javax.servlet.jsp.PageContext context, javax.servlet.ServletRequest request, javax.servlet.ServletResponse response) Includes the formatter rendering the given element.- Parameters:
elementResource- the element resourceformatter- the formatter configuration beansettings- the element settingscacheable- true if the flex cache should be used for calling the display formattereditable- if editablecanCreate- if new resources may be createdcanDelete- if the resource may be deletedcreationSiteMap- the create location sub sitepostCreateHandler- the post create handleruploadFolder- the upload foldercontext- the page contextrequest- the requestresponse- the response
-
getSettingKeyForMatchingFormatterPrefix
public static String getSettingKeyForMatchingFormatterPrefix(CmsADEConfigData config, I_CmsFormatterBean formatter, String settingKey) If the setting key starts with the key or id of the given formatter, returns the remaining suffix, else null.- Parameters:
config- the current sitemap configurationformatter- the formatter beansettingKey- the setting key- Returns:
- the remaining setting name suffix
-
addDisplayFormatter
Adds a display formatter.- Parameters:
type- the resource typepath- the path to the formatter configuration file.
-
addDisplayFormatterKey
Adds a display formatter key for a type.- Parameters:
type- the resource typekey- the display formatter key
-
addParameter
Description copied from interface:I_CmsJspTagParamParentAdd a parameter to this tag. The intent is that the <param> subtag will call this to register parameters. Assumes that 'name' and 'value' are appropriately encoded and do not contain any meaningful metacharacters; in order words, escaping is the responsibility of the caller.- Specified by:
addParameterin interfaceI_CmsJspTagParamParent- Parameters:
name- the name of the parametervalue- the value of the parameter- See Also:
-
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- See Also:
-
getEditable
Returns the editable.- Returns:
- the editable
-
getPassSettings
Returns the passSettings.- Returns:
- the passSettings
-
getSettings
Returns the element settings to be used.- Returns:
- the element settings to be used
-
getValue
Returns the value.- Returns:
- the value
-
release
- Specified by:
releasein interfacejavax.servlet.jsp.tagext.Tag- Overrides:
releasein classjavax.servlet.jsp.tagext.BodyTagSupport- See Also:
-
setBaseUri
Sets the base URI to use for finding the 'default' display formatter.- Parameters:
uri- the base URI
-
setCacheable
Enables/disables the use of the flex cache for the display formatter include.- Parameters:
cacheable- true if the flex cache should be used for the display formatter include
-
setContainerType
Sets the container type used to select a formatter.- Parameters:
containerType- the container type
-
setCreate
Setter for the "create" attribute of the tag.- Parameters:
canCreate- value of the tag's attribute "create".
-
setCreate
Setter for the "create" attribute of the tag.- Parameters:
canCreate- value of the tag's attribute "create".
-
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.
-
setDelete
Setter for the "delete" attribute of the tag.- Parameters:
canDelete- value of the "delete" attribute of the tag.
-
setDisplayFormatters
Sets the items.- Parameters:
displayFormatters- the items to set
-
setEditable
Sets the editable.- Parameters:
editable- the editable to set
-
setEditable
Sets the editable.- Parameters:
editable- the editable to set
-
setPassSettings
Sets the passSettings.- Parameters:
passSettings- the passSettings to set
-
setPassSettings
Sets the passSettings.- Parameters:
passSettings- the passSettings to set
-
setPostCreateHandler
Setter for the "postCreateHandler" attribute of the tag.- Parameters:
postCreateHandler- fully qualified class name of theI_CmsCollectorPostCreateHandlerto use.
-
setSettings
Sets the element settings to be used.- Parameters:
settings- the element settings to be used
-
setUploadFolder
Sets the upload folder.- Parameters:
uploadFolder- the upload folder
-
setValue
Sets the value.- Parameters:
value- the value to set
-