Package org.opencms.ade.containerpage
Class CmsDetailOnlyContainerUtil
java.lang.Object
org.opencms.ade.containerpage.CmsDetailOnlyContainerUtil
Static utility class for functions related to detail-only containers.
- 
Field SummaryFields
- 
Method SummaryModifier and TypeMethodDescriptionstatic StringgetDetailContainerLocale(CmsObject cms, String contentLocale, CmsResource resource) Returns the detail container resource locale appropriate for the given detail page.static StringgetDetailContentPath(String detailContainersPage) Returns the path to the associated detail content.static CmsContainerPageBeangetDetailOnlyPage(CmsObject cms, javax.servlet.ServletRequest req, String pageRootPath) Returns the detail only container page bean ornullif none available.static CmsContainerPageBeangetDetailOnlyPage(CmsObject cms, javax.servlet.ServletRequest req, String pageRootPath, boolean lookupContextFirst) Returns the detail only container page bean ornullif none available.static com.google.common.base.Optional<CmsResource> getDetailOnlyPage(CmsObject cms, CmsResource detailContent, String contentLocale) Gets the detail only page for a detail content.static StringgetDetailOnlyPageName(CmsObject cms, CmsResource pageResource, String detailPath, String locale) Returns the site/root path to the detail only container page, for site/root path of the detail content.static com.google.common.base.Optional<CmsResource> getDetailOnlyResource(CmsObject cms, String contentLocale, CmsResource detailContentRes, CmsResource pageRes) Gets the detail only resource for a given detail content and locale.static List<CmsResource> getDetailOnlyResources(CmsObject cms, CmsResource resource) Returns a list of detail only container pages associated with the given resource.static booleanisDetailContainersPage(CmsObject cms, String detailContainersPage) Checks whether the given resource path is of a detail containers page.static CmsResourcereadOrCreateDetailOnlyPage(CmsObject cms, CmsUUID detailId, String detailOnlyRootPath) Creates an empty detail-only page for a content, or just reads the resource if the detail-only page already exists.static CmsXmlContainerPagesaveDetailOnlyPage(CmsObject cms, CmsResource content, String locale, CmsContainerPageBean page) Saves a detail-only page for a content.static booleanuseSingleLocaleDetailContainers(String siteRoot) Checks whether single locale detail containers should be used for the given site root.
- 
Field Details- 
DETAIL_CONTAINERS_FOLDER_NAMEThe detail containers folder name.- See Also:
 
- 
LOCALE_ALLUse this locale string for locale independent detail only container resources.- See Also:
 
 
- 
- 
Method Details- 
getDetailContainerLocalepublic static String getDetailContainerLocale(CmsObject cms, String contentLocale, CmsResource resource) Returns the detail container resource locale appropriate for the given detail page.- Parameters:
- cms- the cms context
- contentLocale- the content locale
- resource- the detail page resource
- Returns:
- the locale String
 
- 
getDetailContentPathReturns the path to the associated detail content.- Parameters:
- detailContainersPage- the detail containers page path
- Returns:
- the path to the associated detail content
 
- 
getDetailOnlyPagepublic static com.google.common.base.Optional<CmsResource> getDetailOnlyPage(CmsObject cms, CmsResource detailContent, String contentLocale) Gets the detail only page for a detail content.- Parameters:
- cms- the CMS context
- detailContent- the detail content
- contentLocale- the content locale
- Returns:
- the detail only page, or Optional.absent() if there is no detail only page
 
- 
getDetailOnlyPagepublic static CmsContainerPageBean getDetailOnlyPage(CmsObject cms, javax.servlet.ServletRequest req, String pageRootPath) Returns the detail only container page bean ornullif none available.- Parameters:
- cms- the cms context
- req- the current request
- pageRootPath- the root path of the page
- Returns:
- the container page bean
 
- 
getDetailOnlyPagepublic static CmsContainerPageBean getDetailOnlyPage(CmsObject cms, javax.servlet.ServletRequest req, String pageRootPath, boolean lookupContextFirst) Returns the detail only container page bean ornullif none available.- Parameters:
- cms- the cms context
- req- the current request
- pageRootPath- the root path of the page
- lookupContextFirst- flag, indicating if the bean should be looked up in the standard context first.
- Returns:
- the container page bean
 
- 
getDetailOnlyPageNamepublic static String getDetailOnlyPageName(CmsObject cms, CmsResource pageResource, String detailPath, String locale) Returns the site/root path to the detail only container page, for site/root path of the detail content.- Parameters:
- cms- the current cms context
- pageResource- the detail page resource
- detailPath- the site or root path to the detail content (accordingly site or root path's will be returned)
- locale- the locale for which we want the detail only page
- Returns:
- the site or root path to the detail only container page (dependent on providing site or root path for the detailPath).
 
- 
getDetailOnlyResourcepublic static com.google.common.base.Optional<CmsResource> getDetailOnlyResource(CmsObject cms, String contentLocale, CmsResource detailContentRes, CmsResource pageRes) Gets the detail only resource for a given detail content and locale.- Parameters:
- cms- the current cms context
- contentLocale- the locale for which we want the detail only resource
- detailContentRes- the detail content resource
- pageRes- the page resource
- Returns:
- an Optional wrapping a detail only resource
 
- 
getDetailOnlyResourcesReturns a list of detail only container pages associated with the given resource.- Parameters:
- cms- the cms context
- resource- the resource
- Returns:
- the list of detail only container pages
 
- 
isDetailContainersPageChecks whether the given resource path is of a detail containers page.- Parameters:
- cms- the cms context
- detailContainersPage- the resource site path
- Returns:
- trueif the given resource path is of a detail containers page
 
- 
readOrCreateDetailOnlyPagepublic static CmsResource readOrCreateDetailOnlyPage(CmsObject cms, CmsUUID detailId, String detailOnlyRootPath) throws CmsException Creates an empty detail-only page for a content, or just reads the resource if the detail-only page already exists.- Parameters:
- cms- the current CMS context
- detailId- the structure id of the detail content
- detailOnlyRootPath- the path of the detail only page
- Returns:
- the detail-only page
- Throws:
- CmsException- if something goes wrong
 
- 
saveDetailOnlyPagepublic static CmsXmlContainerPage saveDetailOnlyPage(CmsObject cms, CmsResource content, String locale, CmsContainerPageBean page) throws CmsException Saves a detail-only page for a content.If the detail-only page already exists, it is overwritten. - Parameters:
- cms- the current CMS context
- content- the content for which to save the detail-only page
- locale- the locale
- page- the container page data to save in the detail-only page
- Returns:
- the container page that was saved
- Throws:
- CmsException- if something goes wrong
 
- 
useSingleLocaleDetailContainersChecks whether single locale detail containers should be used for the given site root.- Parameters:
- siteRoot- the site root to check
- Returns:
- trueif single locale detail containers should be used for the given site root
 
 
-