Package org.opencms.jsp
Class CmsJspTagContentLoad
java.lang.Object
javax.servlet.jsp.tagext.TagSupport
javax.servlet.jsp.tagext.BodyTagSupport
org.opencms.jsp.CmsJspScopedVarBodyTagSuport
org.opencms.jsp.CmsJspTagResourceLoad
org.opencms.jsp.CmsJspTagContentLoad
- 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_CmsResourceContainer,I_CmsXmlContentContainer
Implementation of the
<cms:contentload/> tag,
used to access and display XML content item information from the VFS.
Since version 7.0.2 it is also possible to store the results of the content load in the JSP context
using a CmsJspContentLoadBean. Using this bean the loaded XML content objects can be accessed
directly using the JSP EL and the JSTL. To use this feature, you need to add the var (and optionally
the scope) parameter to the content load tag. For example, if a parameter like
var="myVarName" is provided, then the result of the content load is stored in the JSP
context variable myVarName with an instance of a CmsJspContentLoadBean.
- Since:
- 6.0.0
- See Also:
-
Field Summary
Fields inherited from class org.opencms.jsp.CmsJspTagResourceLoad
m_cms, m_collector, m_collectorName, m_collectorParam, m_collectorResult, m_contentInfoBean, m_controller, m_pageIndex, m_pageNavLength, m_pageSize, m_param, m_preload, m_property, m_resource, m_resourceNameFields 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
ConstructorsConstructorDescriptionEmpty constructor, required for JSP tags.CmsJspTagContentLoad(I_CmsXmlContentContainer container, javax.servlet.jsp.PageContext context, String collectorName, String collectorParam, String pageIndex, String pageSize, Locale locale, boolean editable) Constructor used when usingcontentloadfrom scriptlet code.CmsJspTagContentLoad(I_CmsXmlContentContainer container, javax.servlet.jsp.PageContext context, String collectorName, String collectorParam, String pageIndex, String pageSize, Locale locale, CmsDirectEditMode editMode) Constructor used when usingcontentloadfrom scriptlet code.CmsJspTagContentLoad(I_CmsXmlContentContainer container, javax.servlet.jsp.PageContext context, String collectorName, String collectorParam, Locale locale, boolean editable) Constructor used when usingcontentloadfrom scriptlet code. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidLoad the next file name from the initialized list of file names.intReturns the editable flag.Returns the locale.Returns the currently loaded OpenCms XML content document.Returns the currently selected element name in the loaded XML content document.Returns the currently selected locale used for acessing the content in the loaded XML content document.booleanResource iteration method to be used by JSP scriptlet code.protected voidinit(I_CmsXmlContentContainer container) Initializes this content load tag.booleanReturns the edit empty attribute.voidrelease()voidsetEditable(String mode) Sets the editable mode.voidsetEditEmpty(boolean editEmpty) Sets the edit empty attribute.voidSets the locale.voidsetPostCreateHandler(String postCreateHandler) Sets the post-create handler class name.Methods inherited from class org.opencms.jsp.CmsJspTagResourceLoad
doAfterBody, doEndTag, doLoadNextResource, getCollector, getCollectorName, getCollectorParam, getCollectorResult, getContentInfoBean, getNextResource, getPageIndex, getPageNavLength, getPageSize, getParam, getPreload, getProperty, getResource, getResourceName, getResourceName, hasMoreContent, init, isPreloader, limitCollectorResult, setCollector, setPageIndex, setPageNavLength, setPageSize, setParam, setPreload, setPropertyMethods 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
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 org.opencms.jsp.I_CmsResourceContainer
getCollectorName, getCollectorParam, getCollectorResult, getResource, getResourceName, hasMoreContent, isPreloaderMethods inherited from interface javax.servlet.jsp.tagext.Tag
getParent, setPageContext, setParent
-
Constructor Details
-
CmsJspTagContentLoad
public CmsJspTagContentLoad()Empty constructor, required for JSP tags. -
CmsJspTagContentLoad
public CmsJspTagContentLoad(I_CmsXmlContentContainer container, javax.servlet.jsp.PageContext context, String collectorName, String collectorParam, Locale locale, boolean editable) throws javax.servlet.jsp.JspException Constructor used when usingcontentloadfrom scriptlet code.- Parameters:
container- the parent content container (could be a preloader)context- the JSP page contextcollectorName- the collector name to usecollectorParam- the collector param to uselocale- the locale to useeditable- indicates if "direct edit" support is wanted- Throws:
javax.servlet.jsp.JspException- in case something goes wrong
-
CmsJspTagContentLoad
public CmsJspTagContentLoad(I_CmsXmlContentContainer container, javax.servlet.jsp.PageContext context, String collectorName, String collectorParam, String pageIndex, String pageSize, Locale locale, boolean editable) throws javax.servlet.jsp.JspException Constructor used when usingcontentloadfrom scriptlet code.- Parameters:
container- the parent content container (could be a preloader)context- the JSP page contextcollectorName- the collector name to usecollectorParam- the collector param to usepageIndex- the display page index (may contain macros)pageSize- the display page size (may contain macros)locale- the locale to useeditable- indicates if "direct edit" support is wanted- Throws:
javax.servlet.jsp.JspException- in case something goes wrong
-
CmsJspTagContentLoad
public CmsJspTagContentLoad(I_CmsXmlContentContainer container, javax.servlet.jsp.PageContext context, String collectorName, String collectorParam, String pageIndex, String pageSize, Locale locale, CmsDirectEditMode editMode) throws javax.servlet.jsp.JspException Constructor used when usingcontentloadfrom scriptlet code.- Parameters:
container- the parent content container (could be a preloader)context- the JSP page contextcollectorName- the collector name to usecollectorParam- the collector param to usepageIndex- the display page index (may contain macros)pageSize- the display page size (may contain macros)locale- the locale to useeditMode- indicates which "direct edit" mode is wanted- Throws:
javax.servlet.jsp.JspException- in case something goes wrong
-
-
Method Details
-
doStartTag
- Specified by:
doStartTagin interfacejavax.servlet.jsp.tagext.Tag- Overrides:
doStartTagin classCmsJspTagResourceLoad- Throws:
javax.servlet.jsp.JspExceptionCmsIllegalArgumentException- See Also:
-
getEditable
Returns the editable flag.- Returns:
- the editable flag
-
getLocale
Returns the locale.- Returns:
- the locale
-
getXmlDocument
Description copied from interface:I_CmsXmlContentContainerReturns the currently loaded OpenCms XML content document.- Specified by:
getXmlDocumentin interfaceI_CmsXmlContentContainer- Returns:
- the currently loaded OpenCms XML content document
- See Also:
-
getXmlDocumentElement
Description copied from interface:I_CmsXmlContentContainerReturns the currently selected element name in the loaded XML content document.- Specified by:
getXmlDocumentElementin interfaceI_CmsXmlContentContainer- Returns:
- the currently selected element name in the loaded XML content document
- See Also:
-
getXmlDocumentLocale
Description copied from interface:I_CmsXmlContentContainerReturns the currently selected locale used for acessing the content in the loaded XML content document.- Specified by:
getXmlDocumentLocalein interfaceI_CmsXmlContentContainer- Returns:
- the currently selected locale used for acessing the content in the loaded XML content document
- See Also:
-
hasMoreResources
Description copied from interface:I_CmsResourceContainerResource iteration method to be used by JSP scriptlet code.Calling this method will insert "direct edit" HTML to the output page (if required).
- Specified by:
hasMoreResourcesin interfaceI_CmsResourceContainer- Overrides:
hasMoreResourcesin classCmsJspTagResourceLoad- Returns:
trueif more resources are to be iterated- Throws:
javax.servlet.jsp.JspException- in case something goes wrong- See Also:
-
isEditEmpty
Returns the edit empty attribute.- Returns:
- the edit empty attribute
-
release
- Specified by:
releasein interfacejavax.servlet.jsp.tagext.Tag- Overrides:
releasein classCmsJspTagResourceLoad- See Also:
-
setEditable
Sets the editable mode.- Parameters:
mode- the mode to set
-
setEditEmpty
Sets the edit empty attribute.- Parameters:
editEmpty- the edit empty attribute to set
-
setLocale
Sets the locale.- Parameters:
locale- the locale to set
-
setPostCreateHandler
Sets the post-create handler class name.- Parameters:
postCreateHandler- the post-create handler class name
-
doLoadNextFile
Load the next file name from the initialized list of file names.- Throws:
CmsException- if something goes wrong
-
init
Initializes this content load tag.- Parameters:
container- the parent container (could be a preloader)- Throws:
javax.servlet.jsp.JspException- in case something goes wrong
-