Package org.opencms.jsp.util
Class CmsJspContentLoadBean
- java.lang.Object
-
- org.opencms.jsp.util.CmsJspContentLoadBean
-
public class CmsJspContentLoadBean extends java.lang.Object
Allows JSP access to the results of a <cms:contentload ... > operation using the JSTL and EL.- Since:
- 7.0.2
- See Also:
CmsJspTagContentLoad
,CmsJspContentAccessBean
-
-
Field Summary
Fields Modifier and Type Field Description protected CmsObject
m_cms
The OpenCms context of the current user.protected java.util.List<CmsJspContentAccessBean>
m_content
The List of results form the content loader.protected java.util.Locale
m_locale
The selected locale for accessing entries from the XML content.
-
Constructor Summary
Constructors Constructor Description CmsJspContentLoadBean()
No argument constructor, required for a JavaBean.CmsJspContentLoadBean(CmsObject cms, java.util.List<CmsResource> content)
Creates a new context bean using the OpenCms context of the current user.CmsJspContentLoadBean(CmsObject cms, java.util.Locale locale, java.util.List<CmsResource> content)
Creates a new context bean using the OpenCms context of the current user with the given locale.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.util.List<CmsJspContentAccessBean>
convertResourceList(CmsObject cms, java.util.List<CmsResource> resources)
Converts a list ofCmsResource
objects to a list ofCmsJspContentAccessBean
objects, using the current request context locale.static java.util.List<CmsJspContentAccessBean>
convertResourceList(CmsObject cms, java.util.Locale locale, java.util.List<CmsResource> resources)
Converts a list ofCmsResource
objects to a list ofCmsJspContentAccessBean
objects, using the given locale.CmsObject
getCmsObject()
Returns the OpenCms user context this bean was initialized with.java.util.List<CmsJspContentAccessBean>
getContent()
Returns a List ofCmsJspContentAccessBean
instances, which have been wrapped around the originalCmsResource
instances of the collector result.java.util.Locale
getLocale()
Returns the Locale this bean was initialized with.void
init(CmsObject cms, java.util.Locale locale, java.util.List<CmsResource> content)
Initialize this instance.
-
-
-
Field Detail
-
m_content
protected java.util.List<CmsJspContentAccessBean> m_content
The List of results form the content loader.
-
m_locale
protected java.util.Locale m_locale
The selected locale for accessing entries from the XML content.
-
-
Constructor Detail
-
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:
init(CmsObject, Locale, List)
-
CmsJspContentLoadBean
public CmsJspContentLoadBean(CmsObject cms, java.util.List<CmsResource> content)
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
public CmsJspContentLoadBean(CmsObject cms, java.util.Locale locale, java.util.List<CmsResource> content)
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 Detail
-
convertResourceList
public static java.util.List<CmsJspContentAccessBean> convertResourceList(CmsObject cms, java.util.List<CmsResource> resources)
Converts a list ofCmsResource
objects to a list ofCmsJspContentAccessBean
objects, using the current request context locale.- Parameters:
cms
- the current OpenCms user contextresources
- a list of ofCmsResource
objects that should be converted- Returns:
- a list of
CmsJspContentAccessBean
objects created from the givenCmsResource
objects
-
convertResourceList
public static java.util.List<CmsJspContentAccessBean> convertResourceList(CmsObject cms, java.util.Locale locale, java.util.List<CmsResource> resources)
Converts a list ofCmsResource
objects to a list ofCmsJspContentAccessBean
objects, using the given locale.- Parameters:
cms
- the current OpenCms user contextlocale
- the default locale to use when accessing the contentresources
- a list of ofCmsResource
objects that should be converted- Returns:
- a list of
CmsJspContentAccessBean
objects created from the givenCmsResource
objects
-
getCmsObject
public CmsObject getCmsObject()
Returns the OpenCms user context this bean was initialized with.- Returns:
- the OpenCms user context this bean was initialized with
-
getContent
public java.util.List<CmsJspContentAccessBean> getContent()
Returns a List ofCmsJspContentAccessBean
instances, which have been wrapped around the originalCmsResource
instances of the collector result.- Returns:
- a List of
CmsJspContentAccessBean
instances, which have been wrapped around the originalCmsResource
instances of the collector result.
-
getLocale
public java.util.Locale getLocale()
Returns the Locale this bean was initialized with.- Returns:
- the locale this bean was initialized with
-
init
public void init(CmsObject cms, java.util.Locale locale, java.util.List<CmsResource> content)
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
-
-