Package org.opencms.jsp.util
Class CmsJspContentAttachmentsBean
- java.lang.Object
-
- org.opencms.jsp.util.CmsJspContentAttachmentsBean
-
public class CmsJspContentAttachmentsBean extends java.lang.Object
Allows accessing 'attachments' of an XML content via the EL in JSP code, which in OpenCms are defined as the contents of its detail-only containers.
-
-
Field Summary
Fields Modifier and Type Field Description protected CmsContainerPageBean
m_page
The container page bean.
-
Constructor Summary
Constructors Constructor Description CmsJspContentAttachmentsBean()
Creates an 'undefined' attachments bean.CmsJspContentAttachmentsBean(CmsObject cms, CmsResource pageResource)
Initializes this bean with the contents of a detail-only page.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.util.List<java.lang.String>
getAttachmentLocales(CmsObject cms, CmsResource content)
Gets the list of locales for which attachments / detail-only containers are available.static CmsJspContentAttachmentsBean
getAttachmentsForCurrentPage(CmsObject cms, CmsResource content)
Gets the attachments / detail-only contents for the current page (i.e.static CmsJspContentAttachmentsBean
getAttachmentsForLocale(CmsObject cms, CmsResource content, java.lang.String locale)
Loads the attachments for a given content.java.util.Map<java.lang.String,java.util.List<CmsContainerElementBean>>
getByContainer()
Gets lazy map that returns lists of element beans for the container whose name is given as a key.java.util.Map<java.lang.String,java.util.List<CmsContainerElementBean>>
getByType()
Gets lazy map that maps type names to lists of container elements of that type.java.util.Set<java.lang.String>
getContainers()
Gets the set of container names.protected CmsContainerPageBean
getPage()
Gets the container page bean for the detail-only page.boolean
isUndefined()
Returns true if the attachments are undefined.
-
-
-
Field Detail
-
m_page
protected CmsContainerPageBean m_page
The container page bean.
-
-
Constructor Detail
-
CmsJspContentAttachmentsBean
public CmsJspContentAttachmentsBean()
Creates an 'undefined' attachments bean.
-
CmsJspContentAttachmentsBean
public CmsJspContentAttachmentsBean(CmsObject cms, CmsResource pageResource) throws CmsException
Initializes this bean with the contents of a detail-only page.- Parameters:
cms
- the CMS contextpageResource
- the detail-only container page- Throws:
CmsException
- if something goes wrong
-
-
Method Detail
-
getAttachmentLocales
public static java.util.List<java.lang.String> getAttachmentLocales(CmsObject cms, CmsResource content)
Gets the list of locales for which attachments / detail-only containers are available.- Parameters:
cms
- the current CMS contextcontent
- the content resource- Returns:
- the list of locales for which there are attachments
-
getAttachmentsForCurrentPage
public static CmsJspContentAttachmentsBean getAttachmentsForCurrentPage(CmsObject cms, CmsResource content) throws CmsException
Gets the attachments / detail-only contents for the current page (i.e. cms.getRequestContext().getUri()).- Parameters:
cms
- the CMS contextcontent
- the content for which to get the attachments- Returns:
- a bean providing access to the attachments for the resource
- Throws:
CmsException
- if something goes wrong
-
getAttachmentsForLocale
public static CmsJspContentAttachmentsBean getAttachmentsForLocale(CmsObject cms, CmsResource content, java.lang.String locale)
Loads the attachments for a given content.- Parameters:
cms
- the CMS contextcontent
- the contentlocale
- the locale- Returns:
- the attachment bean for the given content and locale
-
getByContainer
public java.util.Map<java.lang.String,java.util.List<CmsContainerElementBean>> getByContainer()
Gets lazy map that returns lists of element beans for the container whose name is given as a key.- Returns:
- a lazy map to fetch contents of a container
-
getByType
public java.util.Map<java.lang.String,java.util.List<CmsContainerElementBean>> getByType()
Gets lazy map that maps type names to lists of container elements of that type.- Returns:
- a map from type names to lists of container elements
-
getContainers
public java.util.Set<java.lang.String> getContainers()
Gets the set of container names.- Returns:
- the set of container names
-
isUndefined
public boolean isUndefined()
Returns true if the attachments are undefined.- Returns:
- true if the attachments are undefined
-
getPage
protected CmsContainerPageBean getPage()
Gets the container page bean for the detail-only page.- Returns:
- the container page bean
-
-