|
|||||||||
| Home >> All >> com >> opencms >> [ launcher overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
com.opencms.launcher
Class CmsXmlLauncher

java.lang.Objectcom.opencms.launcher.A_CmsLauncher
com.opencms.launcher.CmsXmlLauncher
- All Implemented Interfaces:
- com.opencms.core.I_CmsConstants, I_CmsLauncher, com.opencms.boot.I_CmsLogChannels
- public class CmsXmlLauncher
- extends A_CmsLauncher
- implements com.opencms.boot.I_CmsLogChannels, com.opencms.core.I_CmsConstants
- extends A_CmsLauncher
OpenCms launcher class for XML templates.
This can be used generating output for XML body files using XML template and subtemplate technology.
The selected body should define a start template class using
<PAGE>
<CLASS>...</CLASS>
</PAGE>
If no start template is defined, the class given by the parameters will be used. If even this is not defined, CmsXmlTemplate will be used to create output.
- Version:
- $Revision: 1.44 $ $Date: 2003/02/26 10:30:36 $
| Field Summary | |
static java.lang.String |
C_ELEMENT_REPLACE
Magic elemet replace name |
protected static I_CmsTemplateCache |
m_templateCache
The template cache that holds all cached templates |
| Fields inherited from interface com.opencms.boot.I_CmsLogChannels |
C_FLEX_CACHE, C_FLEX_LOADER, C_LOGGING, C_MODULE_CRITICAL, C_MODULE_DEBUG, C_MODULE_INFO, C_OPENCMS_CACHE, C_OPENCMS_CRITICAL, C_OPENCMS_CRONSCHEDULER, C_OPENCMS_DEBUG, C_OPENCMS_ELEMENTCACHE, C_OPENCMS_INFO, C_OPENCMS_INIT, C_OPENCMS_POOL, C_OPENCMS_STATICEXPORT, C_OPENCMS_STREAMING, C_PREPROCESSOR_IS_LOGGING |
| Fields inherited from interface com.opencms.launcher.I_CmsLauncher |
C_TYPE_DUMP, C_TYPE_JAVASCRIPT, C_TYPE_JSP, C_TYPE_LINK, C_TYPE_PDF, C_TYPE_VELOCITY, C_TYPE_XML |
| Constructor Summary | |
CmsXmlLauncher()
|
|
| Method Summary | |
protected byte[] |
callCanonicalRoot(com.opencms.file.CmsObject cms,
com.opencms.template.I_CmsTemplate templateClass,
com.opencms.file.CmsFile masterTemplate,
java.util.Hashtable parameters)
Utility method used by the launcher implementation to give control to the CanonicalRoot. |
void |
clearCache()
Method for clearing this launchers template cache. |
static void |
clearLauncherCache(com.opencms.file.CmsObject cms)
Clear the XML template cache that is maintained in the launcher. |
protected byte[] |
generateOutput(com.opencms.file.CmsObject cms,
com.opencms.file.CmsFile file,
java.lang.String startTemplateClass,
com.opencms.core.I_CmsRequest req)
Starts generating the output. |
protected java.lang.String |
getClassName()
Gets the name of the class in the form "[ClassName] " This can be used for error logging purposes. |
int |
getLauncherId()
Gets the ID that indicates the type of the launcher. |
static I_CmsTemplateCache |
getTemplateCache()
Gets a reference to the global template cache |
protected com.opencms.template.I_CmsTemplate |
getTemplateClass(com.opencms.file.CmsObject cms,
java.lang.String classname)
Calls the CmsClassManager to get an instance of the given template class. |
void |
handleException(com.opencms.file.CmsObject cms,
java.lang.Exception e,
java.lang.String errorText)
Utility method to handle any occurence of an execption. |
void |
initlaunch(com.opencms.file.CmsObject cms,
com.opencms.file.CmsFile file,
java.lang.String startTemplateClass,
com.opencms.core.A_OpenCms openCms)
Start method called by the OpenCms system to show a resource. |
protected void |
launch(com.opencms.file.CmsObject cms,
com.opencms.file.CmsFile file,
java.lang.String startTemplateClass,
com.opencms.core.A_OpenCms openCms)
Unitary method to start generating the output. |
private com.opencms.file.CmsFile |
loadMasterTemplateFile(com.opencms.file.CmsObject cms,
java.lang.String templateName,
com.opencms.template.CmsXmlControlFile doc)
Internal utility method for checking and loading a given template file. |
void |
setOpenCms(com.opencms.core.A_OpenCms openCms)
Sets the currently running OpenCms instance. |
protected void |
writeBytesToResponse(com.opencms.file.CmsObject cms,
byte[] result)
Writes a given byte array to the HttpServletRespose output stream. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
C_ELEMENT_REPLACE
public static final java.lang.String C_ELEMENT_REPLACE
- Magic elemet replace name
- See Also:
- Constant Field Values
m_templateCache
protected static I_CmsTemplateCache m_templateCache
- The template cache that holds all cached templates
| Constructor Detail |
CmsXmlLauncher
public CmsXmlLauncher()
| Method Detail |
generateOutput
protected byte[] generateOutput(com.opencms.file.CmsObject cms, com.opencms.file.CmsFile file, java.lang.String startTemplateClass, com.opencms.core.I_CmsRequest req) throws com.opencms.core.CmsException
- Starts generating the output.
Calls the canonical root with the appropriate template class.
getLauncherId
public int getLauncherId()
- Gets the ID that indicates the type of the launcher.
- Specified by:
getLauncherIdin interfaceI_CmsLauncher- Specified by:
getLauncherIdin classA_CmsLauncher
launch
protected void launch(com.opencms.file.CmsObject cms, com.opencms.file.CmsFile file, java.lang.String startTemplateClass, com.opencms.core.A_OpenCms openCms) throws com.opencms.core.CmsException
- Unitary method to start generating the output.
Every launcher has to implement this method.
In it possibly the selected file will be analyzed, and the
Canonical Root will be called with the appropriate
template class, template file and parameters. At least the
canonical root's output must be written to the HttpServletResponse.
- Specified by:
launchin classA_CmsLauncher
loadMasterTemplateFile
private com.opencms.file.CmsFile loadMasterTemplateFile(com.opencms.file.CmsObject cms, java.lang.String templateName, com.opencms.template.CmsXmlControlFile doc) throws com.opencms.core.CmsException
- Internal utility method for checking and loading a given template file.
callCanonicalRoot
protected byte[] callCanonicalRoot(com.opencms.file.CmsObject cms, com.opencms.template.I_CmsTemplate templateClass, com.opencms.file.CmsFile masterTemplate, java.util.Hashtable parameters) throws com.opencms.core.CmsException
- Utility method used by the launcher implementation to give control
to the CanonicalRoot.
The CanonicalRoot will call the master template and return a byte array of the
generated output.
clearCache
public void clearCache()
- Method for clearing this launchers template cache.
- Specified by:
clearCachein interfaceI_CmsLauncher
getClassName
protected java.lang.String getClassName()
- Gets the name of the class in the form "[ClassName] "
This can be used for error logging purposes.
getTemplateCache
public static I_CmsTemplateCache getTemplateCache()
- Gets a reference to the global template cache
getTemplateClass
protected com.opencms.template.I_CmsTemplate getTemplateClass(com.opencms.file.CmsObject cms, java.lang.String classname) throws com.opencms.core.CmsException
- Calls the CmsClassManager to get an instance of the given template class.
The returned object is checked to be an implementing class of the interface
I_CmsTemplate.
If the template cache of the template class is not yet setted, this will
be done, too.
handleException
public void handleException(com.opencms.file.CmsObject cms, java.lang.Exception e, java.lang.String errorText) throws com.opencms.core.CmsException
- Utility method to handle any occurence of an execption.
If the Exception is NO CmsException (i.e. it was not detected previously) it will be written to the logfile.
If the current user is the anonymous user, no further execption will be thrown, but a server error will be sent (we want to prevent the user from seeing any exeptions). Otherwise a new Exception will be thrown.
initlaunch
public void initlaunch(com.opencms.file.CmsObject cms, com.opencms.file.CmsFile file, java.lang.String startTemplateClass, com.opencms.core.A_OpenCms openCms) throws com.opencms.core.CmsException
- Start method called by the OpenCms system to show a resource.
In this method initial values valid for all launchers can be set and the _clearcache parameter is checked. After this the abstract method launch(...) is called to invoke the customized part of the launcher.
- Specified by:
initlaunchin interfaceI_CmsLauncher
clearLauncherCache
public static void clearLauncherCache(com.opencms.file.CmsObject cms)
- Clear the XML template cache that is maintained in the launcher.
To use this method, call it on one of the classes that extend
A_CmsLauncher (e.g. com.opencms.launcher.CmsXmlLauncher.clearLauncherCache()).
writeBytesToResponse
protected void writeBytesToResponse(com.opencms.file.CmsObject cms, byte[] result) throws com.opencms.core.CmsException
- Writes a given byte array to the HttpServletRespose output stream.
setOpenCms
public void setOpenCms(com.opencms.core.A_OpenCms openCms)
- Sets the currently running OpenCms instance.
- Specified by:
setOpenCmsin interfaceI_CmsLauncher
|
|||||||||
| Home >> All >> com >> opencms >> [ launcher overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC