org.opencms.ade.detailpage
Class CmsDetailPageUtil

java.lang.Object
  extended by org.opencms.ade.detailpage.CmsDetailPageUtil

public final class CmsDetailPageUtil
extends Object

This is a utility class which provides convenience methods for finding detail page names for resources which include the URL names of the resources themselves.

Since:
8.0.0
See Also:
I_CmsDetailPageFinder

Method Summary
static List<String> getAllDetailPagesWithUrlName(CmsObject cms, CmsResource res)
          Gets a list of detail page URIs for the given resource, with its URL name appended.
static String getBestUrlName(CmsObject cms, CmsUUID id)
          Returns either the newest URL name for a structure id, or the structure id as a string if there is no URL name.
static CmsResource lookupPage(CmsObject cms, String uri)
          Looks up a page by URI (which may be a detail page URI, or a normal VFS uri).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getAllDetailPagesWithUrlName

public static List<String> getAllDetailPagesWithUrlName(CmsObject cms,
                                                        CmsResource res)
                                                 throws CmsException
Gets a list of detail page URIs for the given resource, with its URL name appended.

Parameters:
cms - the current CMS context
res - the resource for which the detail pages should be retrieved
Returns:
the list of detail page URIs
Throws:
CmsException - if something goes wrong

getBestUrlName

public static String getBestUrlName(CmsObject cms,
                                    CmsUUID id)
                             throws CmsException
Returns either the newest URL name for a structure id, or the structure id as a string if there is no URL name.

Parameters:
cms - the current CMS context
id - the structure id of a resource
Returns:
the best URL name for the structure id
Throws:
CmsException - if something goes wrong

lookupPage

public static CmsResource lookupPage(CmsObject cms,
                                     String uri)
                              throws CmsException
Looks up a page by URI (which may be a detail page URI, or a normal VFS uri).

Parameters:
cms - the current CMS context
uri - the detail page or VFS uri
Returns:
the resource with the given uri
Throws:
CmsException - if something goes wrong