public final class CmsDetailOnlyContainerUtil extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DETAIL_CONTAINERS_FOLDER_NAME
The detail containers folder name.
|
static java.lang.String |
LOCALE_ALL
Use this locale string for locale independent detail only container resources.
|
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getDetailContainerLocale(CmsObject cms,
java.lang.String contentLocale,
CmsResource resource)
Returns the detail container resource locale appropriate for the given detail page.
|
static java.lang.String |
getDetailContentPath(java.lang.String detailContainersPage)
Returns the path to the associated detail content.
|
static com.google.common.base.Optional<CmsResource> |
getDetailOnlyPage(CmsObject cms,
CmsResource detailContent,
java.lang.String contentLocale)
Gets the detail only page for a detail content.
|
static CmsContainerPageBean |
getDetailOnlyPage(CmsObject cms,
javax.servlet.ServletRequest req,
java.lang.String pageRootPath)
Returns the detail only container page bean or
null if none available. |
static java.lang.String |
getDetailOnlyPageName(CmsObject cms,
CmsResource pageResource,
java.lang.String detailPath,
java.lang.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,
java.lang.String contentLocale,
CmsResource detailContentRes,
CmsResource pageRes)
Gets the detail only resource for a given detail content and locale.
|
static java.util.List<CmsResource> |
getDetailOnlyResources(CmsObject cms,
CmsResource resource)
Returns a list of detail only container pages associated with the given resource.
|
static boolean |
isDetailContainersPage(CmsObject cms,
java.lang.String detailContainersPage)
Checks whether the given resource path is of a detail containers page.
|
static CmsResource |
readOrCreateDetailOnlyPage(CmsObject cms,
CmsUUID detailId,
java.lang.String detailOnlyRootPath)
Creates an empty detail-only page for a content, or just reads the resource if the detail-only page already exists.
|
static CmsXmlContainerPage |
saveDetailOnlyPage(CmsObject cms,
CmsResource content,
java.lang.String locale,
CmsContainerPageBean page)
Saves a detail-only page for a content.
|
static boolean |
useSingleLocaleDetailContainers(java.lang.String siteRoot)
Checks whether single locale detail containers should be used for the given site root.
|
public static final java.lang.String DETAIL_CONTAINERS_FOLDER_NAME
public static final java.lang.String LOCALE_ALL
public static java.lang.String getDetailContainerLocale(CmsObject cms, java.lang.String contentLocale, CmsResource resource)
cms
- the cms contextcontentLocale
- the content localeresource
- the detail page resourcepublic static java.lang.String getDetailContentPath(java.lang.String detailContainersPage)
detailContainersPage
- the detail containers page pathpublic static com.google.common.base.Optional<CmsResource> getDetailOnlyPage(CmsObject cms, CmsResource detailContent, java.lang.String contentLocale)
cms
- the CMS contextdetailContent
- the detail contentcontentLocale
- the content localepublic static CmsContainerPageBean getDetailOnlyPage(CmsObject cms, javax.servlet.ServletRequest req, java.lang.String pageRootPath)
null
if none available.cms
- the cms contextreq
- the current requestpageRootPath
- the root path of the pagepublic static java.lang.String getDetailOnlyPageName(CmsObject cms, CmsResource pageResource, java.lang.String detailPath, java.lang.String locale)
cms
- the current cms contextpageResource
- the detail page resourcedetailPath
- 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 pagepublic static com.google.common.base.Optional<CmsResource> getDetailOnlyResource(CmsObject cms, java.lang.String contentLocale, CmsResource detailContentRes, CmsResource pageRes)
cms
- the current cms contextcontentLocale
- the locale for which we want the detail only resourcedetailContentRes
- the detail content resourcepageRes
- the page resourcepublic static java.util.List<CmsResource> getDetailOnlyResources(CmsObject cms, CmsResource resource)
cms
- the cms contextresource
- the resourcepublic static boolean isDetailContainersPage(CmsObject cms, java.lang.String detailContainersPage)
cms
- the cms contextdetailContainersPage
- the resource site pathtrue
if the given resource path is of a detail containers pagepublic static CmsResource readOrCreateDetailOnlyPage(CmsObject cms, CmsUUID detailId, java.lang.String detailOnlyRootPath) throws CmsException
cms
- the current CMS contextdetailId
- the structure id of the detail contentdetailOnlyRootPath
- the path of the detail only pageCmsException
- if something goes wrongpublic static CmsXmlContainerPage saveDetailOnlyPage(CmsObject cms, CmsResource content, java.lang.String locale, CmsContainerPageBean page) throws CmsException
If the detail-only page already exists, it is overwritten.
cms
- the current CMS contextcontent
- the content for which to save the detail-only pagelocale
- the localepage
- the container page data to save in the detail-only pageCmsException
- if something goes wrongpublic static boolean useSingleLocaleDetailContainers(java.lang.String siteRoot)
siteRoot
- the site root to checktrue
if single locale detail containers should be used for the given site root