Class CmsPointerLoader
- All Implemented Interfaces:
I_CmsConfigurationParameterHandler,I_CmsResourceLoader
- Since:
- 6.0.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe configuration parameter for the OpenCms XML configuration to enable that the parameters in requests to pointer resources are appended to the pointer target link.protected static booleanFlag that controls if parameters in requests to pointer resources are appended to the target link when redirecting.static final intThe id of this loader.Fields inherited from class org.opencms.loader.CmsDumpLoader
RESOURCE_LOADER_IDFields inherited from interface org.opencms.configuration.I_CmsConfigurationParameterHandler
ADD_PARAMETER_METHOD, INIT_CONFIGURATION_METHODFields inherited from interface org.opencms.loader.I_CmsResourceLoader
PARAMETER_ELEMENT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddConfigurationParameter(String paramName, String paramValue) Adds a configuration parameter to this parameter configurable class instance.voiddestroy()Destroy this ResourceLoder, this is a NOOP so far.byte[]dump(CmsObject cms, CmsResource resource, String element, Locale locale, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) Dumps the processed content of the the requested file (and it's sub-elements) to a byte array.byte[]export(CmsObject cms, CmsResource resource, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) Static exports the contents of the requested file and it's sub-elements.Will always returnnullsince this loader does not need to be cnofigured.intReturns the id of the ResourceLoader.Return a String describing the ResourceLoader, which is (localized to the system default locale)"The OpenCms default resource loader for pointers".voidInitializes a configuration after all parameters have been added.static booleanReturnstrueif parameters in requests to pointer resources are appended to the target link when redirecting.booleanReturns true if request parameter support is disabled.booleanSignals if the loader implementation requires processing during static export of resources.booleanSignals if the loader implementation is usable for creating templates.booleanSignals if a loader that supports templates must be invoked on the template URI or the resource URI.voidload(CmsObject cms, CmsResource resource, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) Basic top-page processing method for a I_CmsResourceLoader, this method is called if the page is called as a sub-element on a page not already loaded with a I_CmsResourceLoader.voidservice(CmsObject cms, CmsResource file, javax.servlet.ServletRequest req, javax.servlet.ServletResponse res) Does the job of including the requested resource, this method is called directly if the element is called as a sub-element from another I_CmsResourceLoader.Methods inherited from class org.opencms.loader.CmsDumpLoader
canSendLastModifiedHeader
-
Field Details
-
CONFIGURATION_REQUEST_PARAM_SUPPORT_ENABLED
The configuration parameter for the OpenCms XML configuration to enable that the parameters in requests to pointer resources are appended to the pointer target link.- See Also:
-
RESOURCE_POINTER_LOADER_ID
The id of this loader.- See Also:
-
m_requestParamSupportEnabled
Flag that controls if parameters in requests to pointer resources are appended to the target link when redirecting.
-
-
Constructor Details
-
CmsPointerLoader
public CmsPointerLoader()The constructor of the class is empty and does nothing.
-
-
Method Details
-
isRequestParamSupportEnabled
Returnstrueif parameters in requests to pointer resources are appended to the target link when redirecting.This is controlled by the configuration of this loader in
opencms-system.xml.- Returns:
trueif parameters in requests to pointer resources are appended to the target link when redirecting.
-
addConfigurationParameter
Description copied from interface:I_CmsConfigurationParameterHandlerAdds a configuration parameter to this parameter configurable class instance.- Specified by:
addConfigurationParameterin interfaceI_CmsConfigurationParameterHandler- Overrides:
addConfigurationParameterin classCmsDumpLoader- Parameters:
paramName- the name of the parameterparamValue- the value for the parameter- See Also:
-
destroy
Destroy this ResourceLoder, this is a NOOP so far.- Specified by:
destroyin interfaceI_CmsResourceLoader- Overrides:
destroyin classCmsDumpLoader
-
dump
public byte[] dump(CmsObject cms, CmsResource resource, String element, Locale locale, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws CmsException Description copied from interface:I_CmsResourceLoaderDumps the processed content of the the requested file (and it's sub-elements) to a byte array.Dumping the content is like calling "load" where the result is not written to the response stream, but to the returned byte array. Dumping is different from an export because the export might actually require that the content is handled or modified in a special way, or set special http headers.
Moreover, if the page type is template based, calling "dump" will not trigger the template but directly deliver the contents from the selected element.
- Specified by:
dumpin interfaceI_CmsResourceLoader- Overrides:
dumpin classCmsDumpLoader- Parameters:
cms- used to access the OpenCms VFSresource- the requested resource in the VFSelement- the element in the file to displaylocale- the locale to displayreq- the servlet requestres- the servlet response- Returns:
- the content of the processed file
- Throws:
CmsException- in case of errors accessing OpenCms functions- See Also:
-
export
public byte[] export(CmsObject cms, CmsResource resource, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws IOException, CmsException Description copied from interface:I_CmsResourceLoaderStatic exports the contents of the requested file and it's sub-elements.During static export, the resource content may be written to 2 streams: The export stream, and the http response output stream. Which stream is actually used depends whether the export is in "on demand" or "after publish" mode. In "on demand" mode, the resource needs to be written both to the response stream and to the file stream. In "after publish" mode, it's usually only written to the file stream, but sometimes it's required to write to the response stream as well.
- Specified by:
exportin interfaceI_CmsResourceLoader- Overrides:
exportin classCmsDumpLoader- Parameters:
cms- the initialized CmsObject which provides user permissionsresource- the requested OpenCms VFS resourcereq- the servlet requestres- the servlet response- Returns:
- the contents to export, or
nullif no export is required - Throws:
IOException- might be thrown in the process of including the sub elementCmsException- in case something goes wrong- See Also:
-
getConfiguration
Will always returnnullsince this loader does not need to be cnofigured.- Specified by:
getConfigurationin interfaceI_CmsConfigurationParameterHandler- Overrides:
getConfigurationin classCmsDumpLoader- Returns:
- the parameters of this configurable class instance,
or
nullif the class does not need any parameters - See Also:
-
getLoaderId
Description copied from interface:I_CmsResourceLoaderReturns the id of the ResourceLoader.- Specified by:
getLoaderIdin interfaceI_CmsResourceLoader- Overrides:
getLoaderIdin classCmsDumpLoader- Returns:
- the id of the ResourceLoader
- See Also:
-
getResourceLoaderInfo
Return a String describing the ResourceLoader, which is (localized to the system default locale)"The OpenCms default resource loader for pointers".- Specified by:
getResourceLoaderInfoin interfaceI_CmsResourceLoader- Overrides:
getResourceLoaderInfoin classCmsDumpLoader- Returns:
- a describing String for the ResourceLoader
-
initConfiguration
Description copied from interface:I_CmsConfigurationParameterHandlerInitializes a configuration after all parameters have been added.- Specified by:
initConfigurationin interfaceI_CmsConfigurationParameterHandler- Overrides:
initConfigurationin classCmsDumpLoader- See Also:
-
isStaticExportEnabled
Returns true if request parameter support is disabled.- Specified by:
isStaticExportEnabledin interfaceI_CmsResourceLoader- Overrides:
isStaticExportEnabledin classCmsDumpLoader- Returns:
- true if request parameter support is disabled
- See Also:
-
isStaticExportProcessable
Description copied from interface:I_CmsResourceLoaderSignals if the loader implementation requires processing during static export of resources.- Specified by:
isStaticExportProcessablein interfaceI_CmsResourceLoader- Overrides:
isStaticExportProcessablein classCmsDumpLoader- Returns:
- true if static export processing is required, false otherwise
- See Also:
-
isUsableForTemplates
Description copied from interface:I_CmsResourceLoaderSignals if the loader implementation is usable for creating templates.- Specified by:
isUsableForTemplatesin interfaceI_CmsResourceLoader- Overrides:
isUsableForTemplatesin classCmsDumpLoader- Returns:
- true if the loader implementation is usable for creating templates, false otherwise
- See Also:
-
isUsingUriWhenLoadingTemplate
Description copied from interface:I_CmsResourceLoaderSignals if a loader that supports templates must be invoked on the template URI or the resource URI.- Specified by:
isUsingUriWhenLoadingTemplatein interfaceI_CmsResourceLoader- Overrides:
isUsingUriWhenLoadingTemplatein classCmsDumpLoader- Returns:
- true if the resource URI is to be used, false if the template URI is to be used
- See Also:
-
load
public void load(CmsObject cms, CmsResource resource, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws IOException, CmsException Description copied from interface:I_CmsResourceLoaderBasic top-page processing method for a I_CmsResourceLoader, this method is called if the page is called as a sub-element on a page not already loaded with a I_CmsResourceLoader.- Specified by:
loadin interfaceI_CmsResourceLoader- Overrides:
loadin classCmsDumpLoader- Parameters:
cms- the initialized CmsObject which provides user permissionsresource- the requested OpenCms VFS resourcereq- the servlet requestres- the servlet response- Throws:
IOException- might be thrown by the servlet environmentCmsException- in case of errors accessing OpenCms functions- See Also:
-
service
public void service(CmsObject cms, CmsResource file, javax.servlet.ServletRequest req, javax.servlet.ServletResponse res) Description copied from interface:I_CmsResourceLoaderDoes the job of including the requested resource, this method is called directly if the element is called as a sub-element from another I_CmsResourceLoader.- Specified by:
servicein interfaceI_CmsResourceLoader- Overrides:
servicein classCmsDumpLoader- Parameters:
cms- used to access the OpenCms VFSfile- the requested resource in the VFSreq- the servlet requestres- the servlet response- See Also:
-