Package org.opencms.main
Interface I_CmsResourceInit
-
- All Known Implementing Classes:
CmsAliasResourceHandler
,CmsDetailPageResourceHandler
,CmsHistoryResourceHandler
,CmsJsonResourceHandler
,CmsPdfResourceHandler
,CmsPermalinkResourceHandler
,CmsProtectedStaticFileHandler
,CmsUserDataResourceHandler
,CmsUserTrackingResourceHandler
,CmsWorkplaceLoginHandler
public interface I_CmsResourceInit
This interface checks the requested resource from the OpenCms request context and returns it to the calling method, which will usually beOpenCms.initResource(CmsObject, String, HttpServletRequest, HttpServletResponse)
.- Since:
- 6.0.0
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ATTR_ALTERNATIVE_CMS_OBJECT
Resource init handlers can use this attribute to pass an alternative CmsObject for loading the resource returned by them.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default CmsParameterConfiguration
getConfiguration()
Gets the configuration data.default void
initParameters(CmsParameterConfiguration params)
Initializes parameters.CmsResource
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.
-
-
-
Field Detail
-
ATTR_ALTERNATIVE_CMS_OBJECT
static final java.lang.String ATTR_ALTERNATIVE_CMS_OBJECT
Resource init handlers can use this attribute to pass an alternative CmsObject for loading the resource returned by them.- See Also:
- Constant Field Values
-
-
Method Detail
-
getConfiguration
default CmsParameterConfiguration getConfiguration()
Gets the configuration data.- Returns:
- the configuration data
-
initParameters
default void initParameters(CmsParameterConfiguration params)
Initializes parameters.- Parameters:
params
- the configuration parameters
-
initResource
CmsResource initResource(CmsResource resource, CmsObject cms, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws CmsResourceInitException, CmsSecurityException
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.
- 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
-
-