|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opencms.flex.CmsFlexDummyLoader
public class CmsFlexDummyLoader
A resource loader which does nothing, except provide access to the last flex cache instance set
with setFlexCache(org.opencms.flex.CmsFlexCache)
.
The instance can be accessed via the package static variable m_flexCache
.
This allows unit tests in this package to do some white-box testing on the flex cache system.
Field Summary | |
---|---|
static int |
LOADER_ID
The dummy id of this dummy loader. |
static String |
LOADER_INFO
Loader info. |
protected static CmsFlexCache |
m_flexCache
Provides access to the Flex cache. |
Fields inherited from interface org.opencms.loader.I_CmsResourceLoader |
---|
PARAMETER_ELEMENT |
Fields inherited from interface org.opencms.configuration.I_CmsConfigurationParameterHandler |
---|
ADD_PARAMETER_METHOD, INIT_CONFIGURATION_METHOD |
Constructor Summary | |
---|---|
CmsFlexDummyLoader()
|
Method Summary | |
---|---|
void |
addConfigurationParameter(String paramName,
String paramValue)
Adds a configuration parameter to this parameter configurable class instance. |
void |
destroy()
Destroys this ResourceLoder. |
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. |
CmsParameterConfiguration |
getConfiguration()
Returns the parameters of this configurable class instance, or null if the class does not need any parameters. |
static CmsFlexCache |
getFlexCache()
Allows static access to the internal CmsFlexCache . |
int |
getLoaderId()
Returns the id of the ResourceLoader. |
String |
getResourceLoaderInfo()
Returns a String describing the ResourceLoader. |
void |
initConfiguration()
Initializes a configuration after all parameters have been added. |
boolean |
isStaticExportEnabled()
Signals if the loader implementation supports static export of resources. |
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 resource,
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. |
void |
setFlexCache(CmsFlexCache cache)
Will be called after the resource manager was initialized. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int LOADER_ID
public static final String LOADER_INFO
protected static CmsFlexCache m_flexCache
Constructor Detail |
---|
public CmsFlexDummyLoader()
Method Detail |
---|
public static CmsFlexCache getFlexCache()
CmsFlexCache
.
CmsFlexCache
used by this OpenCms instancepublic void addConfigurationParameter(String paramName, String paramValue)
I_CmsConfigurationParameterHandler
addConfigurationParameter
in interface I_CmsConfigurationParameterHandler
paramName
- the name of the parameterparamValue
- the value for the parameterI_CmsConfigurationParameterHandler.addConfigurationParameter(java.lang.String, java.lang.String)
public void destroy()
I_CmsResourceLoader
destroy
in interface I_CmsResourceLoader
I_CmsResourceLoader.destroy()
public byte[] dump(CmsObject cms, CmsResource resource, String element, Locale locale, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws javax.servlet.ServletException
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
in interface I_CmsResourceLoader
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
javax.servlet.ServletException
- might be thrown by the servlet environmentI_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 javax.servlet.ServletException
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
in interface I_CmsResourceLoader
cms
- the initialized CmsObject which provides user permissionsresource
- the requested OpenCms VFS resourcereq
- the servlet requestres
- the servlet response
null
if no export is required
javax.servlet.ServletException
- might be thrown in the process of including the sub elementI_CmsResourceLoader.export(org.opencms.file.CmsObject, org.opencms.file.CmsResource, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
public CmsParameterConfiguration getConfiguration()
I_CmsConfigurationParameterHandler
null
if the class does not need any parameters.
getConfiguration
in interface I_CmsConfigurationParameterHandler
null
if the class does not need any parametersI_CmsConfigurationParameterHandler.getConfiguration()
public int getLoaderId()
I_CmsResourceLoader
getLoaderId
in interface I_CmsResourceLoader
I_CmsResourceLoader.getLoaderId()
public String getResourceLoaderInfo()
I_CmsResourceLoader
getResourceLoaderInfo
in interface I_CmsResourceLoader
I_CmsResourceLoader.getResourceLoaderInfo()
public void initConfiguration()
I_CmsConfigurationParameterHandler
initConfiguration
in interface I_CmsConfigurationParameterHandler
I_CmsConfigurationParameterHandler.initConfiguration()
public boolean isStaticExportEnabled()
I_CmsResourceLoader
isStaticExportEnabled
in interface I_CmsResourceLoader
I_CmsResourceLoader.isStaticExportEnabled()
public boolean isStaticExportProcessable()
I_CmsResourceLoader
isStaticExportProcessable
in interface I_CmsResourceLoader
I_CmsResourceLoader.isStaticExportProcessable()
public boolean isUsableForTemplates()
I_CmsResourceLoader
isUsableForTemplates
in interface I_CmsResourceLoader
I_CmsResourceLoader.isUsableForTemplates()
public boolean isUsingUriWhenLoadingTemplate()
I_CmsResourceLoader
isUsingUriWhenLoadingTemplate
in interface I_CmsResourceLoader
I_CmsResourceLoader.isUsingUriWhenLoadingTemplate()
public void load(CmsObject cms, CmsResource resource, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws javax.servlet.ServletException
I_CmsResourceLoader
load
in interface I_CmsResourceLoader
cms
- the initialized CmsObject which provides user permissionsresource
- the requested OpenCms VFS resourcereq
- the servlet requestres
- the servlet response
javax.servlet.ServletException
- might be thrown by the servlet environmentI_CmsResourceLoader.load(org.opencms.file.CmsObject, org.opencms.file.CmsResource, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
public void service(CmsObject cms, CmsResource resource, javax.servlet.ServletRequest req, javax.servlet.ServletResponse res) throws javax.servlet.ServletException
I_CmsResourceLoader
service
in interface I_CmsResourceLoader
cms
- used to access the OpenCms VFSresource
- the requested resource in the VFSreq
- the servlet requestres
- the servlet response
javax.servlet.ServletException
- might be thrown by the servlet environmentI_CmsResourceLoader.service(org.opencms.file.CmsObject, org.opencms.file.CmsResource, javax.servlet.ServletRequest, javax.servlet.ServletResponse)
public void setFlexCache(CmsFlexCache cache)
I_CmsFlexCacheEnabledLoader
setFlexCache
in interface I_CmsFlexCacheEnabledLoader
cache
- the (optional) flex cache instance to useI_CmsFlexCacheEnabledLoader.setFlexCache(org.opencms.flex.CmsFlexCache)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |