Package org.opencms.ade.detailpage
Class CmsDetailPageResourceHandler
java.lang.Object
org.opencms.ade.detailpage.CmsDetailPageResourceHandler
- All Implemented Interfaces:
I_CmsResourceInit
Resource init handler for detail-pages.
- Since:
- 8.0.0
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The attribute containing the detail content resource.static final String
The attribute containing the detail function page resource.Fields inherited from interface org.opencms.main.I_CmsResourceInit
ATTR_ALTERNATIVE_CMS_OBJECT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic CmsResource
getDetailFunctionPage
(javax.servlet.ServletRequest req) Returns the detail function page resource, if available.static CmsUUID
getDetailId
(javax.servlet.ServletRequest req) Returns the current detail content UUID, ornull
if this is not a request to a content detail page.static CmsResource
getDetailResource
(javax.servlet.ServletRequest req) Returns the current detail content resource, ornull
if this is not a request to a content detail page.initResource
(CmsResource resource, CmsObject cms, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) Possibility to modify or change the CmsFile with the CmsObject.protected boolean
isValidDetailPage
(CmsObject cms, CmsResource page, CmsResource detailRes) Checks whether the given detail page is valid for the given resource.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.opencms.main.I_CmsResourceInit
getConfiguration, initParameters
-
Field Details
-
ATTR_DETAIL_CONTENT_RESOURCE
The attribute containing the detail content resource.- See Also:
-
ATTR_DETAIL_FUNCTION_PAGE
The attribute containing the detail function page resource.- See Also:
-
-
Constructor Details
-
CmsDetailPageResourceHandler
public CmsDetailPageResourceHandler()Default constructor.
-
-
Method Details
-
getDetailFunctionPage
Returns the detail function page resource, if available.- Parameters:
req
- the current request- Returns:
- the detail function page resource
-
getDetailId
Returns the current detail content UUID, ornull
if this is not a request to a content detail page.- Parameters:
req
- the current request- Returns:
- the current detail content UUID, or
null
if this is not a request to a content detail page
-
getDetailResource
Returns the current detail content resource, ornull
if this is not a request to a content detail page.- Parameters:
req
- the current request- Returns:
- the current detail content resource, or
null
if this is not a request to a content detail page
-
initResource
public CmsResource initResource(CmsResource resource, CmsObject cms, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws CmsResourceInitException, CmsSecurityException Description copied from interface:I_CmsResourceInit
Possibility to modify or change the CmsFile with the CmsObject.Caution: reading parameters from the request, destroys special characters in all parameters, because the encoding for the request was not set yet.
- Specified by:
initResource
in interfaceI_CmsResourceInit
- Parameters:
resource
- the requested filecms
- the current CmsObjectreq
- the current requestres
- the current response- Returns:
- a resource in the OpenCms VFS
- Throws:
CmsResourceInitException
- if other implementations of the interface should not be executedCmsSecurityException
- if other implementations of the interface should not be executed, and the security exception should be escalated- See Also:
-
isValidDetailPage
Checks whether the given detail page is valid for the given resource.- Parameters:
cms
- the CMS contextpage
- the detail pagedetailRes
- the detail resource- Returns:
- true if the given detail page is valid
-