Package org.opencms.ade.detailpage
Class CmsDefaultDetailPageHandler
- java.lang.Object
-
- org.opencms.ade.detailpage.CmsDefaultDetailPageHandler
-
- All Implemented Interfaces:
I_CmsDetailPageHandler
,I_CmsConfigurationParameterHandler
public class CmsDefaultDetailPageHandler extends java.lang.Object implements I_CmsDetailPageHandler
This class uses information from the detail page information stored in the sitemap to find/recognize the detail pages for a given resource.- Since:
- 8.0.0
-
-
Field Summary
-
Fields inherited from interface org.opencms.configuration.I_CmsConfigurationParameterHandler
ADD_PARAMETER_METHOD, INIT_CONFIGURATION_METHOD
-
-
Constructor Summary
Constructors Constructor Description CmsDefaultDetailPageHandler()
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addConfigurationParameter(java.lang.String paramName, java.lang.String paramValue)
Adds the configuration parameter.java.util.Collection<java.lang.String>
getAllDetailPages(CmsObject cms, int resType)
Gets the all detail pages.CmsParameterConfiguration
getConfiguration()
Gets the configuration.java.lang.String
getDetailPage(CmsADEManager manager, CmsObject cms, java.lang.String contentRootPath, java.lang.String originPath, java.lang.String targetDetailPage)
Gets the detail page for a content element.java.lang.String
getDetailPage(CmsObject cms, java.lang.String rootPath, java.lang.String linkSource, java.lang.String targetDetailPage)
Gets the detail page to use for a detail resource.void
initConfiguration()
Inits the configuration.void
initialize(CmsObject offlineCms, CmsObject onlineCms)
Initialize.boolean
isValidDetailPage(CmsObject cms, CmsResource page, CmsResource detailRes)
Checks whether the given detail page is valid for the given resource.
-
-
-
Constructor Detail
-
CmsDefaultDetailPageHandler
public CmsDefaultDetailPageHandler()
Constructor.
-
-
Method Detail
-
addConfigurationParameter
public void addConfigurationParameter(java.lang.String paramName, java.lang.String paramValue)
Adds the configuration parameter.- Specified by:
addConfigurationParameter
in interfaceI_CmsConfigurationParameterHandler
- Parameters:
paramName
- the param nameparamValue
- the param value- See Also:
I_CmsConfigurationParameterHandler.addConfigurationParameter(java.lang.String, java.lang.String)
-
getAllDetailPages
public java.util.Collection<java.lang.String> getAllDetailPages(CmsObject cms, int resType) throws CmsException
Gets the all detail pages.- Specified by:
getAllDetailPages
in interfaceI_CmsDetailPageHandler
- Parameters:
cms
- the cmsresType
- the res type- Returns:
- the all detail pages
- Throws:
CmsException
- the cms exception- See Also:
I_CmsDetailPageHandler.getAllDetailPages(org.opencms.file.CmsObject, int)
-
getConfiguration
public CmsParameterConfiguration getConfiguration()
Gets the configuration.- Specified by:
getConfiguration
in interfaceI_CmsConfigurationParameterHandler
- Returns:
- the configuration
- See Also:
I_CmsConfigurationParameterHandler.getConfiguration()
-
getDetailPage
public java.lang.String getDetailPage(CmsADEManager manager, CmsObject cms, java.lang.String contentRootPath, java.lang.String originPath, java.lang.String targetDetailPage)
Gets the detail page for a content element.- Parameters:
manager
- the ADE manager instance.cms
- the CMS contextcontentRootPath
- the element's root pathoriginPath
- the site path from which the detail content is being linkedtargetDetailPage
- the target detail page to use- Returns:
- the detail page for the content element
-
getDetailPage
public java.lang.String getDetailPage(CmsObject cms, java.lang.String rootPath, java.lang.String linkSource, java.lang.String targetDetailPage)
Gets the detail page to use for a detail resource.- Specified by:
getDetailPage
in interfaceI_CmsDetailPageHandler
- Parameters:
cms
- the cmsrootPath
- the root pathlinkSource
- the link sourcetargetDetailPage
- the target detail page- Returns:
- the detail page
- See Also:
I_CmsDetailPageHandler.getDetailPage(org.opencms.file.CmsObject, java.lang.String, java.lang.String, java.lang.String)
-
initConfiguration
public void initConfiguration()
Inits the configuration.- Specified by:
initConfiguration
in interfaceI_CmsConfigurationParameterHandler
- See Also:
I_CmsConfigurationParameterHandler.initConfiguration()
-
initialize
public void initialize(CmsObject offlineCms, CmsObject onlineCms)
Initialize.- Specified by:
initialize
in interfaceI_CmsDetailPageHandler
- Parameters:
offlineCms
- the offline cmsonlineCms
- the online cms- See Also:
I_CmsDetailPageHandler.initialize(org.opencms.file.CmsObject, org.opencms.file.CmsObject)
-
isValidDetailPage
public boolean isValidDetailPage(CmsObject cms, CmsResource page, CmsResource detailRes)
Checks whether the given detail page is valid for the given resource.- Specified by:
isValidDetailPage
in interfaceI_CmsDetailPageHandler
- Parameters:
cms
- the CMS contextpage
- the detail pagedetailRes
- the detail resource- Returns:
- true if the given detail page is valid
-
-