Package org.opencms.jsp.util
Class CmsJspContentLoadBean
java.lang.Object
org.opencms.jsp.util.CmsJspContentLoadBean
Allows JSP access to the results of a <cms:contentload ... > operation using the JSTL and EL.
- Since:
- 7.0.2
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionNo argument constructor, required for a JavaBean.CmsJspContentLoadBean(CmsObject cms, List<CmsResource> content) Creates a new context bean using the OpenCms context of the current user.CmsJspContentLoadBean(CmsObject cms, Locale locale, List<CmsResource> content) Creates a new context bean using the OpenCms context of the current user with the given locale. -
Method Summary
Modifier and TypeMethodDescriptionstatic List<CmsJspContentAccessBean> convertResourceList(CmsObject cms, List<CmsResource> resources) Converts a list ofCmsResourceobjects to a list ofCmsJspContentAccessBeanobjects, using the current request context locale.static List<CmsJspContentAccessBean> convertResourceList(CmsObject cms, Locale locale, List<CmsResource> resources) Converts a list ofCmsResourceobjects to a list ofCmsJspContentAccessBeanobjects, using the given locale.Returns the OpenCms user context this bean was initialized with.Returns a List ofCmsJspContentAccessBeaninstances, which have been wrapped around the originalCmsResourceinstances of the collector result.Returns the Locale this bean was initialized with.voidinit(CmsObject cms, Locale locale, List<CmsResource> content) Initialize this instance.
-
Field Details
-
m_cms
The OpenCms context of the current user. -
m_content
The List of results form the content loader. -
m_locale
The selected locale for accessing entries from the XML content.
-
-
Constructor Details
-
CmsJspContentLoadBean
public CmsJspContentLoadBean()No argument constructor, required for a JavaBean.You must call
init(CmsObject, Locale, List)and provide the required values when you use this constructor.- See Also:
-
CmsJspContentLoadBean
Creates a new context bean using the OpenCms context of the current user.The current request context locale is used.
- Parameters:
cms- the OpenCms context of the current usercontent- the content to access, must contain Object of typeCmsResource
-
CmsJspContentLoadBean
Creates a new context bean using the OpenCms context of the current user with the given locale.- Parameters:
cms- the OpenCms context of the current userlocale- the Locale to use when accessing the contentcontent- the content to access, must contain Object of typeCmsResource
-
-
Method Details
-
convertResourceList
public static List<CmsJspContentAccessBean> convertResourceList(CmsObject cms, List<CmsResource> resources) Converts a list ofCmsResourceobjects to a list ofCmsJspContentAccessBeanobjects, using the current request context locale.- Parameters:
cms- the current OpenCms user contextresources- a list of ofCmsResourceobjects that should be converted- Returns:
- a list of
CmsJspContentAccessBeanobjects created from the givenCmsResourceobjects
-
convertResourceList
public static List<CmsJspContentAccessBean> convertResourceList(CmsObject cms, Locale locale, List<CmsResource> resources) Converts a list ofCmsResourceobjects to a list ofCmsJspContentAccessBeanobjects, using the given locale.- Parameters:
cms- the current OpenCms user contextlocale- the default locale to use when accessing the contentresources- a list of ofCmsResourceobjects that should be converted- Returns:
- a list of
CmsJspContentAccessBeanobjects created from the givenCmsResourceobjects
-
getCmsObject
Returns the OpenCms user context this bean was initialized with.- Returns:
- the OpenCms user context this bean was initialized with
-
getContent
Returns a List ofCmsJspContentAccessBeaninstances, which have been wrapped around the originalCmsResourceinstances of the collector result.- Returns:
- a List of
CmsJspContentAccessBeaninstances, which have been wrapped around the originalCmsResourceinstances of the collector result.
-
getLocale
Returns the Locale this bean was initialized with.- Returns:
- the locale this bean was initialized with
-
init
Initialize this instance.- Parameters:
cms- the OpenCms context of the current userlocale- the Locale to use when accessing the contentcontent- the content to access, must contain Object of typeCmsResource
-