org.opencms.jsp.util
Class CmsJspContentLoadBean

java.lang.Object
  extended by 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
Version:
$Revision: 1.8 $
Author:
Alexander Kandzior
See Also:
CmsJspTagContentLoad, CmsJspContentAccessBean

Field Summary
protected  CmsObject m_cms
          The OpenCms context of the current user.
protected  java.util.List 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
CmsJspContentLoadBean()
          No argument constructor, required for a JavaBean.
CmsJspContentLoadBean(CmsObject cms, java.util.List content)
          Creates a new context bean using the OpenCms context of the current user.
CmsJspContentLoadBean(CmsObject cms, java.util.Locale locale, java.util.List content)
          Creates a new context bean using the OpenCms context of the current user with the given locale.
 
Method Summary
static java.util.List convertResourceList(CmsObject cms, java.util.List resources)
          Converts a list of CmsResource objects to a list of CmsJspContentAccessBean objects, using the current request context locale.
static java.util.List convertResourceList(CmsObject cms, java.util.Locale locale, java.util.List 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.
 java.util.List getContent()
          Returns a List of CmsJspContentAccessBean instances, which have been wrapped around the original CmsResource 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 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 java.util.List 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 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,
                             java.util.Locale locale,
                             java.util.List 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 java.util.List convertResourceList(CmsObject cms,
                                                 java.util.List 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 java.util.List convertResourceList(CmsObject cms,
                                                 java.util.Locale locale,
                                                 java.util.List 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 java.util.List 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 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 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