public class CmsPointerLoader extends CmsDumpLoader
限定符和类型 | 字段和说明 |
---|---|
static java.lang.String |
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.
|
protected static boolean |
m_requestParamSupportEnabled
Flag that controls if parameters in requests to pointer resources are
appended to the target link when redirecting.
|
static int |
RESOURCE_POINTER_LOADER_ID
The id of this loader.
|
RESOURCE_LOADER_ID
PARAMETER_ELEMENT
ADD_PARAMETER_METHOD, INIT_CONFIGURATION_METHOD
构造器和说明 |
---|
CmsPointerLoader()
The constructor of the class is empty and does nothing.
|
限定符和类型 | 方法和说明 |
---|---|
void |
addConfigurationParameter(java.lang.String paramName,
java.lang.String paramValue)
Adds a configuration parameter to this parameter configurable class instance.
|
void |
destroy()
Destroy this ResourceLoder, this is a NOOP so far.
|
byte[] |
dump(CmsObject cms,
CmsResource resource,
java.lang.String element,
java.util.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.
|
CmsParameterConfiguration |
getConfiguration()
Will always return
null since this loader does not
need to be cnofigured. |
int |
getLoaderId()
Returns the id of the ResourceLoader.
|
java.lang.String |
getResourceLoaderInfo()
Return a String describing the ResourceLoader,
which is (localized to the system default locale)
"The OpenCms default resource loader for pointers" . |
void |
initConfiguration()
Initializes a configuration after all parameters have been added.
|
static boolean |
isRequestParamSupportEnabled()
Returns
true if parameters in requests to pointer resources
are appended to the target link when redirecting. |
boolean |
isStaticExportEnabled()
Returns true if request parameter support is disabled.
|
boolean |
isStaticExportProcessable()
Signals if the loader implementation requires processing during static export of resources.
|
boolean |
isUsableForTemplates()
Signals if the loader implementation is usable for creating templates.
|
boolean |
isUsingUriWhenLoadingTemplate()
Signals if a loader that supports templates must be invoked on the
template URI or the resource URI.
|
void |
load(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.
|
void |
service(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.
|
canSendLastModifiedHeader
public static final java.lang.String CONFIGURATION_REQUEST_PARAM_SUPPORT_ENABLED
public static final int RESOURCE_POINTER_LOADER_ID
protected static boolean m_requestParamSupportEnabled
public CmsPointerLoader()
public static boolean isRequestParamSupportEnabled()
true
if 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
.
true
if parameters in requests to pointer resources
are appended to the target link when redirecting.public void addConfigurationParameter(java.lang.String paramName, java.lang.String paramValue)
I_CmsConfigurationParameterHandler
addConfigurationParameter
在接口中 I_CmsConfigurationParameterHandler
addConfigurationParameter
在类中 CmsDumpLoader
paramName
- the name of the parameterparamValue
- the value for the parameterI_CmsConfigurationParameterHandler.addConfigurationParameter(java.lang.String, java.lang.String)
public void destroy()
destroy
在接口中 I_CmsResourceLoader
destroy
在类中 CmsDumpLoader
public byte[] dump(CmsObject cms, CmsResource resource, java.lang.String element, java.util.Locale locale, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws CmsException
I_CmsResourceLoader
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.
dump
在接口中 I_CmsResourceLoader
dump
在类中 CmsDumpLoader
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 responseCmsException
- in case of errors accessing OpenCms functionsI_CmsResourceLoader.dump(org.opencms.file.CmsObject, org.opencms.file.CmsResource, java.lang.String, java.util.Locale, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
public byte[] export(CmsObject cms, CmsResource resource, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws java.io.IOException, CmsException
I_CmsResourceLoader
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.
export
在接口中 I_CmsResourceLoader
export
在类中 CmsDumpLoader
cms
- the initialized CmsObject which provides user permissionsresource
- the requested OpenCms VFS resourcereq
- the servlet requestres
- the servlet responsenull
if no export is requiredjava.io.IOException
- might be thrown in the process of including the sub elementCmsException
- in case something goes wrongI_CmsResourceLoader.export(org.opencms.file.CmsObject, org.opencms.file.CmsResource, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
public CmsParameterConfiguration getConfiguration()
null
since this loader does not
need to be cnofigured.getConfiguration
在接口中 I_CmsConfigurationParameterHandler
getConfiguration
在类中 CmsDumpLoader
null
if the class does not need any parametersI_CmsConfigurationParameterHandler.getConfiguration()
public int getLoaderId()
I_CmsResourceLoader
getLoaderId
在接口中 I_CmsResourceLoader
getLoaderId
在类中 CmsDumpLoader
I_CmsResourceLoader.getLoaderId()
public java.lang.String getResourceLoaderInfo()
"The OpenCms default resource loader for pointers"
.getResourceLoaderInfo
在接口中 I_CmsResourceLoader
getResourceLoaderInfo
在类中 CmsDumpLoader
public void initConfiguration()
I_CmsConfigurationParameterHandler
public boolean isStaticExportEnabled()
isStaticExportEnabled
在接口中 I_CmsResourceLoader
isStaticExportEnabled
在类中 CmsDumpLoader
I_CmsResourceLoader.isStaticExportEnabled()
public boolean isStaticExportProcessable()
I_CmsResourceLoader
isStaticExportProcessable
在接口中 I_CmsResourceLoader
isStaticExportProcessable
在类中 CmsDumpLoader
I_CmsResourceLoader.isStaticExportProcessable()
public boolean isUsableForTemplates()
I_CmsResourceLoader
isUsableForTemplates
在接口中 I_CmsResourceLoader
isUsableForTemplates
在类中 CmsDumpLoader
I_CmsResourceLoader.isUsableForTemplates()
public boolean isUsingUriWhenLoadingTemplate()
I_CmsResourceLoader
isUsingUriWhenLoadingTemplate
在接口中 I_CmsResourceLoader
isUsingUriWhenLoadingTemplate
在类中 CmsDumpLoader
I_CmsResourceLoader.isUsingUriWhenLoadingTemplate()
public void load(CmsObject cms, CmsResource resource, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws java.io.IOException, CmsException
I_CmsResourceLoader
load
在接口中 I_CmsResourceLoader
load
在类中 CmsDumpLoader
cms
- the initialized CmsObject which provides user permissionsresource
- the requested OpenCms VFS resourcereq
- the servlet requestres
- the servlet responsejava.io.IOException
- might be thrown by the servlet environmentCmsException
- in case of errors accessing OpenCms functionsI_CmsResourceLoader.load(org.opencms.file.CmsObject, org.opencms.file.CmsResource, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
public void service(CmsObject cms, CmsResource file, javax.servlet.ServletRequest req, javax.servlet.ServletResponse res)
I_CmsResourceLoader
service
在接口中 I_CmsResourceLoader
service
在类中 CmsDumpLoader
cms
- used to access the OpenCms VFSfile
- the requested resource in the VFSreq
- the servlet requestres
- the servlet responseI_CmsResourceLoader.service(org.opencms.file.CmsObject, org.opencms.file.CmsResource, javax.servlet.ServletRequest, javax.servlet.ServletResponse)