Package org.opencms.jsp.util
Class CmsJspContentAttachmentsBean
java.lang.Object
org.opencms.jsp.util.CmsJspContentAttachmentsBean
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
-
Constructor Summary
ConstructorDescriptionCreates an 'undefined' attachments bean.CmsJspContentAttachmentsBean
(CmsObject cms, CmsResource pageResource) Initializes this bean with the contents of a detail-only page. -
Method Summary
Modifier and TypeMethodDescriptiongetAttachmentLocales
(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, String locale) Loads the attachments for a given content.Gets lazy map that returns lists of element beans for the container whose name is given as a key.Gets lazy map that maps type names to lists of container elements of that type.Converts this to a container page wrapper.Gets the set of container names.protected CmsContainerPageBean
getPage()
Gets the container page bean for the detail-only page.boolean
Returns true if the attachments are undefined.
-
Field Details
-
m_page
The container page bean.
-
-
Constructor Details
-
CmsJspContentAttachmentsBean
public CmsJspContentAttachmentsBean()Creates an 'undefined' attachments bean. -
CmsJspContentAttachmentsBean
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 Details
-
getAttachmentLocales
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, 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
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
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
-
getContainerPage
Converts this to a container page wrapper.- Returns:
- the container page wrapper
-
getContainers
Gets the set of container names.- Returns:
- the set of container names
-
isUndefined
Returns true if the attachments are undefined.- Returns:
- true if the attachments are undefined
-
getPage
Gets the container page bean for the detail-only page.- Returns:
- the container page bean
-