Package org.opencms.jsp
Class CmsJspTagResourceLoad
java.lang.Object
javax.servlet.jsp.tagext.TagSupport
javax.servlet.jsp.tagext.BodyTagSupport
org.opencms.jsp.CmsJspScopedVarBodyTagSuport
org.opencms.jsp.CmsJspTagResourceLoad
- 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
- Direct Known Subclasses:
CmsJspTagContentLoad
public class CmsJspTagResourceLoad
extends CmsJspScopedVarBodyTagSuport
implements I_CmsResourceContainer
Implementation of the
<cms:resourceload/> tag,
used to access and display resource information from the VFS.- Since:
- 8.0
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CmsObjectThe CmsObject for the current user.protected StringThe name of the collector to use for list building.protected StringThe name of the resource collector used.protected StringThe parameters of the resource collector uses.protected List<CmsResource> The list of collected resource items.protected CmsContentInfoBeanThe bean to store information required to make the result list browsable.protected CmsFlexControllerThe FlexController for the current request.protected StringThe index of the current page that gets displayed.protected StringThe number of page links in the Google-like page navigation.protected StringThe size of a page to be displayed.protected StringParameter used for the collector.protected booleanIndicates if the collector results should be preloaded.protected StringThe (optional) property to extend the parameter with.protected CmsResourceReference to the last loaded resource element.protected StringThe file name to load the current content value from.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
ConstructorsConstructorDescriptionEmpty constructor, required for JSP tags.CmsJspTagResourceLoad(I_CmsResourceContainer container, javax.servlet.jsp.PageContext context, String collectorName, String collectorParam) Constructor used when usingresourceloadfrom scriptlet code.CmsJspTagResourceLoad(I_CmsResourceContainer container, javax.servlet.jsp.PageContext context, String collectorName, String collectorParam, String pageIndex, String pageSize) Constructor used when usingresourceloadfrom scriptlet code. -
Method Summary
Modifier and TypeMethodDescriptionintintdoEndTag()protected voidLoad the next resource from the initialized list of resources.intReturns the collector.Returns the name of the currently used resource collector.Returns the parameters of the currently used resource collector.Returns the list of all currently loaded resources (instances of).CmsResourceprotected CmsContentInfoBeanReturns the content info bean.protected CmsResourceReturns the next resource from the collector.Returns the index of the page to be displayed.Returns the number of page links in the Google-like page navigation.Returns the size of a single page to be displayed.getParam()Returns the collector parameter.Returns"true"if this content load tag should only preload the values from the collector.Returns the property.Returns the currently loaded resource.Returns the resource name in the VFS for the currently loaded resource.protected static StringgetResourceName(CmsObject cms, I_CmsResourceContainer contentContainer) Returns the resource name currently processed.booleanDeprecated.booleanResource iteration method to be used by JSP scriptlet code.protected voidinit(I_CmsResourceContainer container) Initializes this content load tag.booleanReturnstrueif this container is used as a resource preloader.protected static List<CmsResource> limitCollectorResult(CmsContentInfoBean contentInfoBean, List<CmsResource> collectorResult) Limits the collector's result list to the size of a page to be displayed in a JSP.voidrelease()voidsetCollector(String collector) Sets the collector name.voidsetPageIndex(String pageIndex) Sets the index of the page to be displayed.voidsetPageNavLength(String pageNavLength) Sets the number of page links in the Google-like page navigation.voidsetPageSize(String pageSize) Sets the size of a single page to be displayed.voidSets the collector parameter.voidsetPreload(String preload) Sets the preload flag for this resource load tag.voidsetProperty(String property) Sets the property.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
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
-
m_cms
The CmsObject for the current user. -
m_collector
The name of the collector to use for list building. -
m_collectorName
The name of the resource collector used. -
m_collectorParam
The parameters of the resource collector uses. -
m_collectorResult
The list of collected resource items. -
m_contentInfoBean
The bean to store information required to make the result list browsable. -
m_controller
The FlexController for the current request. -
m_pageIndex
The index of the current page that gets displayed. -
m_pageSize
The size of a page to be displayed. -
m_param
Parameter used for the collector. -
m_preload
Indicates if the collector results should be preloaded. -
m_property
The (optional) property to extend the parameter with. -
m_resource
Reference to the last loaded resource element. -
m_resourceName
The file name to load the current content value from.
-
-
Constructor Details
-
CmsJspTagResourceLoad
public CmsJspTagResourceLoad()Empty constructor, required for JSP tags. -
CmsJspTagResourceLoad
public CmsJspTagResourceLoad(I_CmsResourceContainer container, javax.servlet.jsp.PageContext context, String collectorName, String collectorParam) throws javax.servlet.jsp.JspException Constructor used when usingresourceloadfrom scriptlet code.- Parameters:
container- the parent resource container (could be a preloader)context- the JSP page contextcollectorName- the collector name to usecollectorParam- the collector param to use- Throws:
javax.servlet.jsp.JspException- in case something goes wrong
-
CmsJspTagResourceLoad
public CmsJspTagResourceLoad(I_CmsResourceContainer container, javax.servlet.jsp.PageContext context, String collectorName, String collectorParam, String pageIndex, String pageSize) throws javax.servlet.jsp.JspException Constructor used when usingresourceloadfrom scriptlet code.- Parameters:
container- the parent resource 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)- Throws:
javax.servlet.jsp.JspException- in case something goes wrong
-
-
Method Details
-
getResourceName
Returns the resource name currently processed.- Parameters:
cms- the current OpenCms user contextcontentContainer- the current resource container- Returns:
- the resource name currently processed
-
limitCollectorResult
protected static List<CmsResource> limitCollectorResult(CmsContentInfoBean contentInfoBean, List<CmsResource> collectorResult) Limits the collector's result list to the size of a page to be displayed in a JSP.- Parameters:
contentInfoBean- the info bean of the collectorcollectorResult- the result list of the collector- Returns:
- a limited collector's result list
-
doAfterBody
- Specified by:
doAfterBodyin interfacejavax.servlet.jsp.tagext.IterationTag- Overrides:
doAfterBodyin classjavax.servlet.jsp.tagext.BodyTagSupport- Throws:
javax.servlet.jsp.JspException- See Also:
-
doEndTag
- Specified by:
doEndTagin interfacejavax.servlet.jsp.tagext.Tag- Overrides:
doEndTagin classjavax.servlet.jsp.tagext.BodyTagSupport- See Also:
-
doStartTag
- Specified by:
doStartTagin interfacejavax.servlet.jsp.tagext.Tag- Overrides:
doStartTagin classjavax.servlet.jsp.tagext.BodyTagSupport- Throws:
javax.servlet.jsp.JspExceptionCmsIllegalArgumentException- See Also:
-
getCollector
Returns the collector.- Returns:
- the collector
-
getCollectorName
Description copied from interface:I_CmsResourceContainerReturns the name of the currently used resource collector.- Specified by:
getCollectorNamein interfaceI_CmsResourceContainer- Returns:
- the name of the currently used resource collector
- See Also:
-
getCollectorParam
Description copied from interface:I_CmsResourceContainerReturns the parameters of the currently used resource collector.- Specified by:
getCollectorParamin interfaceI_CmsResourceContainer- Returns:
- the parameters of the currently used resource collector
- See Also:
-
getCollectorResult
Description copied from interface:I_CmsResourceContainerReturns the list of all currently loaded resources (instances of).CmsResource- Specified by:
getCollectorResultin interfaceI_CmsResourceContainer- Returns:
- the list of all currently loaded resources
- See Also:
-
getPageIndex
Returns the index of the page to be displayed.- Returns:
- the index of the page to be displayed
-
getPageSize
Returns the size of a single page to be displayed.- Returns:
- the size of a single page to be displayed
-
getParam
Returns the collector parameter.- Returns:
- the collector parameter
-
getPreload
Returns"true"if this content load tag should only preload the values from the collector.- Returns:
"true"if this content load tag should only preload the values from the collector
-
getProperty
Returns the property.- Returns:
- the property
-
getResource
Description copied from interface:I_CmsResourceContainerReturns the currently loaded resource.- Specified by:
getResourcein interfaceI_CmsResourceContainer- Returns:
- the currently loaded resource
- See Also:
-
getResourceName
Description copied from interface:I_CmsResourceContainerReturns the resource name in the VFS for the currently loaded resource.- Specified by:
getResourceNamein interfaceI_CmsResourceContainer- Returns:
- the resource name in the VFS for the currently loaded resource
- See Also:
-
hasMoreContent
Deprecated.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:
hasMoreContentin interfaceI_CmsResourceContainer- Returns:
trueif more resources are to be iterated- Throws:
javax.servlet.jsp.JspException- in case something goes wrong- 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- Returns:
trueif more resources are to be iterated- Throws:
javax.servlet.jsp.JspException- in case something goes wrong- See Also:
-
isPreloader
Description copied from interface:I_CmsResourceContainerReturnstrueif this container is used as a resource preloader.A resource preloader is used to load resources without looping through it.
- Specified by:
isPreloaderin interfaceI_CmsResourceContainer- Returns:
trueif this container is used as a resource preloader- See Also:
-
release
- Specified by:
releasein interfacejavax.servlet.jsp.tagext.Tag- Overrides:
releasein classCmsJspScopedVarBodyTagSuport- See Also:
-
setCollector
Sets the collector name.- Parameters:
collector- the collector name to set
-
setPageIndex
Sets the index of the page to be displayed.- Parameters:
pageIndex- the index of the page to be displayed
-
setPageSize
Sets the size of a single page to be displayed.- Parameters:
pageSize- the size of a single page to be displayed
-
setParam
Sets the collector parameter.- Parameters:
param- the collector parameter to set
-
setPreload
Sets the preload flag for this resource load tag.If this is set to
true, then the collector result will only be preloaded, but not iterated.- Parameters:
preload- the preload flag to set
-
setProperty
Sets the property.- Parameters:
property- the property to set
-
doLoadNextResource
Load the next resource from the initialized list of resources. -
getContentInfoBean
Returns the content info bean.- Returns:
- the content info bean
-
getNextResource
Returns the next resource from the collector.- Returns:
- the next resource from the collector
-
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
-