org.opencms.jsp.util
Class CmsJspContentLoadBean

java.lang.Object
  extended by org.opencms.jsp.util.CmsJspContentLoadBean

public class CmsJspContentLoadBean
extends 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
protected  CmsObject m_cms
          The OpenCms context of the current user.
protected  List<CmsJspContentAccessBean> m_content
          The List of results form the content loader.
protected  Locale m_locale
          The selected locale for accessing entries from the XML content.
 
Constructor Summary
CmsJspContentLoadBean()
          No 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
static List<CmsJspContentAccessBean> convertResourceList(CmsObject cms, List<CmsResource> resources)
          Converts a list of CmsResource objects to a list of CmsJspContentAccessBean objects, using the current request context locale.
static List<CmsJspContentAccessBean> convertResourceList(CmsObject cms, Locale locale, List<CmsResource> resources)
          Converts a list of CmsResource objects to a list of CmsJspContentAccessBean objects, using the given locale.
 CmsObject getCmsObject()
          Returns the OpenCms user context this bean was initialized with.
 List<CmsJspContentAccessBean> getContent()
          Returns a List of CmsJspContentAccessBean instances, which have been wrapped around the original CmsResource instances of the collector result.
 Locale getLocale()
          Returns the Locale this bean was initialized with.
 void init(CmsObject cms, Locale locale, List<CmsResource> content)
          Initialize this instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_cms

protected CmsObject m_cms
The OpenCms context of the current user.


m_content

protected List<CmsJspContentAccessBean> m_content
The List of results form the content loader.


m_locale

protected 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,
                             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 user
content - the content to access, must contain Object of type CmsResource

CmsJspContentLoadBean

public 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.

Parameters:
cms - the OpenCms context of the current user
locale - the Locale to use when accessing the content
content - the content to access, must contain Object of type CmsResource
Method Detail

convertResourceList

public static List<CmsJspContentAccessBean> convertResourceList(CmsObject cms,
                                                                List<CmsResource> resources)
Converts a list of CmsResource objects to a list of CmsJspContentAccessBean objects, using the current request context locale.

Parameters:
cms - the current OpenCms user context
resources - a list of of CmsResource objects that should be converted
Returns:
a list of CmsJspContentAccessBean objects created from the given CmsResource objects

convertResourceList

public static List<CmsJspContentAccessBean> convertResourceList(CmsObject cms,
                                                                Locale locale,
                                                                List<CmsResource> resources)
Converts a list of CmsResource objects to a list of CmsJspContentAccessBean objects, using the given locale.

Parameters:
cms - the current OpenCms user context
locale - the default locale to use when accessing the content
resources - a list of of CmsResource objects that should be converted
Returns:
a list of CmsJspContentAccessBean objects created from the given CmsResource 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 List<CmsJspContentAccessBean> getContent()
Returns a List of CmsJspContentAccessBean instances, which have been wrapped around the original CmsResource instances of the collector result.

Returns:
a List of CmsJspContentAccessBean instances, which have been wrapped around the original CmsResource instances of the collector result.


getLocale

public Locale getLocale()
Returns the Locale this bean was initialized with.

Returns:
the locale this bean was initialized with

init

public void init(CmsObject cms,
                 Locale locale,
                 List<CmsResource> content)
Initialize this instance.

Parameters:
cms - the OpenCms context of the current user
locale - the Locale to use when accessing the content
content - the content to access, must contain Object of type CmsResource