org.apache.turbine.services.template
Class BaseTemplateEngineService
java.lang.Object
|
+--org.apache.turbine.services.BaseInitable
|
+--org.apache.turbine.services.BaseService
|
+--org.apache.turbine.services.TurbineBaseService
|
+--org.apache.turbine.services.template.BaseTemplateEngineService
- All Implemented Interfaces:
- Initable, Service, TemplateEngineService
- Direct Known Subclasses:
- TurbineJspService, TurbineVelocityService, TurbineWebMacroService
- public abstract class BaseTemplateEngineService
- extends TurbineBaseService
- implements TemplateEngineService
The base implementation of Turbine TemplateEngineService
.
- Version:
- $Id$
- Author:
- Daniel Rall, Jason van Zyl
Field Summary |
private java.util.Hashtable |
configuration
A Map containing the configuration for the template
engine service. |
Method Summary |
java.lang.String[] |
getAssociatedFileExtensions()
Supplies the file extension to key this engine in TemplateService 's
registry with. |
java.util.Hashtable |
getTemplateEngineServiceConfiguration()
Return the configuration of the template engine in
the form of a Hashtable. |
protected void |
initConfiguration(java.lang.String defaultExt)
Note engine file extension associations. |
void |
registerConfiguration(java.lang.String defaultExt)
Initializes file extension associations and registers with the
template service. |
abstract boolean |
templateExists(java.lang.String template)
Use the specific template engine to determine whether
a given template exists. |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
configuration
private java.util.Hashtable configuration
- A Map containing the configuration for the template
engine service. The configuration contains:
1) template extensions
2) default page
3) default screen
4) default layout
5) default navigation
6) default error screen
BaseTemplateEngineService
public BaseTemplateEngineService()
registerConfiguration
public void registerConfiguration(java.lang.String defaultExt)
- Description copied from interface:
TemplateEngineService
- Initializes file extension associations and registers with the
template service.
- Specified by:
registerConfiguration
in interface TemplateEngineService
- See Also:
TemplateEngineService.registerConfiguration(java.lang.String)
getTemplateEngineServiceConfiguration
public java.util.Hashtable getTemplateEngineServiceConfiguration()
- Description copied from interface:
TemplateEngineService
- Return the configuration of the template engine in
the form of a Hashtable.
- Specified by:
getTemplateEngineServiceConfiguration
in interface TemplateEngineService
- See Also:
TemplateEngineService.getTemplateEngineServiceConfiguration()
getAssociatedFileExtensions
public java.lang.String[] getAssociatedFileExtensions()
- Description copied from interface:
TemplateEngineService
- Supplies the file extension to key this engine in
TemplateService
's
registry with.
- Specified by:
getAssociatedFileExtensions
in interface TemplateEngineService
- See Also:
TemplateEngineService.getAssociatedFileExtensions()
initConfiguration
protected void initConfiguration(java.lang.String defaultExt)
- Note engine file extension associations. First attempts to
pull a list of custom extensions from the property file value
keyed by
template.extension
. If none are defined,
uses the value keyed by
template.default.extension
, defaulting to the
emergency value supplied by defaultExt
.
- Parameters:
defaultExt
- The default used when the default defined in the
properties file is missing or misconfigured.
templateExists
public abstract boolean templateExists(java.lang.String template)
- Description copied from interface:
TemplateEngineService
- Use the specific template engine to determine whether
a given template exists. This allows Turbine the TemplateService
to delegate the search for a template to the template
engine being used for the view. This gives us the
advantage of fully utilizing the capabilities of
template engine with respect to retrieving templates
from arbitrary sources.
- Specified by:
templateExists
in interface TemplateEngineService
- See Also:
TemplateEngineService.templateExists(java.lang.String)
Copyright © 1999-2001 Apache Software Foundation. All Rights Reserved.