com.opencms.template
Interface I_CmsXmlTemplate

All Superinterfaces:
I_CmsTemplate
All Known Implementing Classes:
CmsXmlTemplate

public interface I_CmsXmlTemplate
extends I_CmsTemplate

Interface for OpenCms XML template classes.

All methods extending the functionality of the common template class interface to the special behaviour of XML template classes may be defined here.

Primarily, this interface is important for the launcher, NOT for the template engine. The CmsXmlLauncher can launch all templates that implement the I_CmsXmlTemplate interface.

For subtemplates, the I_CmsTemplate interface is all that must be implemented, so you can load all kind of templates (eg. type I_CmsDumpTemplate) as subtemplate.

Version:
$Revision: 1.9 $ $Date: 2003/01/20 23:59:21 $
Author:
Alexander Lucas

Method Summary
 CmsXmlTemplateFile getOwnTemplateFile(CmsObject cms, String templateFile, String elementName, Hashtable parameters, String templateSelector)
          Reads in the template file and starts the XML parser for the expected content type.
 Object templateElement(CmsObject cms, String tagcontent, A_CmsXmlContent doc, Object userObject)
          Handles any occurence of an "ELEMENT" tag.
 
Methods inherited from interface com.opencms.template.I_CmsTemplate
collectCacheDirectives, createElement, getContent, getContent, getKey, isCacheable, isExportable, isProxyPrivateCacheable, isProxyPublicCacheable, isStreamable, isTemplateCacheSet, setTemplateCache, shouldReload
 

Method Detail

getOwnTemplateFile

public CmsXmlTemplateFile getOwnTemplateFile(CmsObject cms,
                                             String templateFile,
                                             String elementName,
                                             Hashtable parameters,
                                             String templateSelector)
                                      throws CmsException
Reads in the template file and starts the XML parser for the expected content type.

Every extending class not using CmsXmlTemplateFile as content type should override this method.

Parameters:
cms - CmsObject Object for accessing system resources.
templateFile - Filename of the template file.
elementName - Element name of this template in our parent template.
parameters - Hashtable with all template class parameters.
templateSelector - template section that should be processed.
CmsException

templateElement

public Object templateElement(CmsObject cms,
                              String tagcontent,
                              A_CmsXmlContent doc,
                              Object userObject)
                       throws CmsException
Handles any occurence of an "ELEMENT" tag.

Every XML template class should use CmsXmlTemplateFile as the interface to the XML file. Since CmsXmlTemplateFile is an extension of A_CmsXmlContent by the additional tag "ELEMENT" this user method ist mandatory.

Parameters:
cms - CmsObject Object for accessing system resources.
tagcontent - Unused in this special case of a user method. Can be ignored.
doc - Reference to the A_CmsXmlContent object the initiating XLM document.
Returns:
String or byte[] with the content of this subelement.
Throws:
CmsException