org.apache.turbine.services.template
Interface TemplateService

All Superinterfaces:
Initable, Service
All Known Implementing Classes:
TurbineTemplateService

public interface TemplateService
extends Service

This service provides a method for mapping templates to their appropriate Screens or Navigations. It also allows templates to define a layout/navigations/screen modularization within the template structure. It also performs caching if turned on in the properties file.

Version:
$Id: TemplateService.java,v 1.1.1.1 2001/08/16 05:09:22 jvanzyl Exp $
Author:
John D. McNally, Jason van Zyl, Daniel Rall, Ilkka Priha

Field Summary
static java.lang.String SERVICE_NAME
          The key under which this service is stored in TurbineServices.
 
Method Summary
 java.lang.String getDefaultExtension()
          Get the default template name extension specified in the template service properties.
 java.lang.String getDefaultLayout()
          Get the default layout module name of the template engine service corresponding to the default template name extension.
 java.lang.String getDefaultLayoutName(RunData data)
          Find the default layout module name for the given request.
 java.lang.String getDefaultLayoutName(java.lang.String template)
          Get the default layout module name of the template engine service corresponding to the template name extension of the named template.
 java.lang.String getDefaultLayoutTemplate()
          Get the default layout template name of the template engine service corresponding to the default template name extension.
 java.lang.String getDefaultLayoutTemplateName(java.lang.String template)
          Get the default layout template name of the template engine service corresponding to the template name extension of the named template.
 java.lang.String getDefaultNavigation()
          Get the default navigation module name of the template engine service corresponding to the default template name extension.
 java.lang.String getDefaultNavigationName(java.lang.String template)
          Get the default navigation module name of the template engine service corresponding to the template name extension of the named template.
 java.lang.String getDefaultPage()
          Get the default page module name of the template engine service corresponding to the default template name extension.
 java.lang.String getDefaultPageName(RunData data)
          Find the default page module name for the given request.
 java.lang.String getDefaultPageName(java.lang.String template)
          Get the default page module name of the template engine service corresponding to the template name extension of the named template.
 java.lang.String getDefaultScreen()
          Get the default screen module name of the template engine service corresponding to the default template name extension.
 java.lang.String getDefaultScreenName(java.lang.String template)
          Get the default screen module name of the template engine service corresponding to the template name extension of the named template.
 java.lang.String getLayoutName(java.lang.String template)
          Locate and return the name of the layout module to be used with the named layout template.
 java.lang.String getLayoutTemplateName(java.lang.String template)
          Locate and return the name of the layout template corresponding to the given screen template name parameter.
 java.lang.String getNavigationName(java.lang.String name)
          Locate and return the name of the navigation module to be used with the named navigation template.
 java.lang.String getScreenName(java.lang.String template)
          Locate and return the name of the screen module to be used with the named screen template.
 java.lang.String getScreenTemplateName(java.lang.String template)
          Locate and return the name of the screen template corresponding to the given template name parameter.
 void registerTemplateEngineService(TemplateEngineService service)
          Registers the provided template engine for use by the TemplateService.
 boolean templateExists(java.lang.String template, java.lang.String[] templatePaths)
          Delegates to the appropriate TemplateEngineService to check the existance of the specified template.
 java.lang.String[] translateTemplatePaths(java.lang.String[] templatePaths)
          Translates the supplied template paths into their Turbine-canonical equivalent (probably absolute paths).
 
Methods inherited from interface org.apache.turbine.services.Service
getConfiguration, getName, getProperties, setName, setServiceBroker
 
Methods inherited from interface org.apache.turbine.services.Initable
getInit, init, init, setInitableBroker, shutdown
 

Field Detail

SERVICE_NAME

public static final java.lang.String SERVICE_NAME
The key under which this service is stored in TurbineServices.
Method Detail

getDefaultExtension

public java.lang.String getDefaultExtension()
Get the default template name extension specified in the template service properties.
Returns:
The default the extension.

getDefaultPage

public java.lang.String getDefaultPage()
Get the default page module name of the template engine service corresponding to the default template name extension.
Returns:
The default page module name.

getDefaultScreen

public java.lang.String getDefaultScreen()
Get the default screen module name of the template engine service corresponding to the default template name extension.
Returns:
The default screen module name.

getDefaultLayout

public java.lang.String getDefaultLayout()
Get the default layout module name of the template engine service corresponding to the default template name extension.
Returns:
The default layout module name.

getDefaultNavigation

public java.lang.String getDefaultNavigation()
Get the default navigation module name of the template engine service corresponding to the default template name extension.
Returns:
The default navigation module name.

getDefaultLayoutTemplate

public java.lang.String getDefaultLayoutTemplate()
Get the default layout template name of the template engine service corresponding to the default template name extension.
Returns:
The default layout template name.

getDefaultPageName

public java.lang.String getDefaultPageName(java.lang.String template)
Get the default page module name of the template engine service corresponding to the template name extension of the named template.
Parameters:
template - The template name.
Returns:
The default page module name.

getDefaultScreenName

public java.lang.String getDefaultScreenName(java.lang.String template)
Get the default screen module name of the template engine service corresponding to the template name extension of the named template.
Parameters:
template - The template name.
Returns:
The default screen module name.

getDefaultLayoutName

public java.lang.String getDefaultLayoutName(java.lang.String template)
Get the default layout module name of the template engine service corresponding to the template name extension of the named template.
Parameters:
template - The template name.
Returns:
The default layout module name.

getDefaultNavigationName

public java.lang.String getDefaultNavigationName(java.lang.String template)
Get the default navigation module name of the template engine service corresponding to the template name extension of the named template.
Parameters:
template - The template name.
Returns:
The default navigation module name.

getDefaultLayoutTemplateName

public java.lang.String getDefaultLayoutTemplateName(java.lang.String template)
Get the default layout template name of the template engine service corresponding to the template name extension of the named template.
Parameters:
template - The template name.
Returns:
The default layout template name.

getDefaultPageName

public java.lang.String getDefaultPageName(RunData data)
Find the default page module name for the given request.
Parameters:
data - The encapsulation of the request to retrieve the default page for.
Returns:
The default page module name.

getDefaultLayoutName

public java.lang.String getDefaultLayoutName(RunData data)
Find the default layout module name for the given request.
Parameters:
data - The encapsulation of the request to retrieve the default layout for.
Returns:
The default layout module name.

getScreenName

public java.lang.String getScreenName(java.lang.String template)
                               throws java.lang.Exception
Locate and return the name of the screen module to be used with the named screen template.
Parameters:
template - The screen template name.
Returns:
The found screen module name.
Throws:
Exception, - a generic exception.

getLayoutName

public java.lang.String getLayoutName(java.lang.String template)
                               throws java.lang.Exception
Locate and return the name of the layout module to be used with the named layout template.
Parameters:
template - The layout template name.
Returns:
The found layout module name.
Throws:
Exception, - a generic exception.

getNavigationName

public java.lang.String getNavigationName(java.lang.String name)
                                   throws java.lang.Exception
Locate and return the name of the navigation module to be used with the named navigation template.
Parameters:
template - The navigation template name.
Returns:
The found navigation module name.
Throws:
Exception, - a generic exception.

getScreenTemplateName

public java.lang.String getScreenTemplateName(java.lang.String template)
                                       throws java.lang.Exception
Locate and return the name of the screen template corresponding to the given template name parameter.
Parameters:
template - The template name parameter.
Returns:
The found screen template name.
Throws:
Exception, - a generic exception.

getLayoutTemplateName

public java.lang.String getLayoutTemplateName(java.lang.String template)
                                       throws java.lang.Exception
Locate and return the name of the layout template corresponding to the given screen template name parameter.
Parameters:
template - The template name parameter.
Returns:
The found screen template name.
Throws:
Exception, - a generic exception.

translateTemplatePaths

public java.lang.String[] translateTemplatePaths(java.lang.String[] templatePaths)
Translates the supplied template paths into their Turbine-canonical equivalent (probably absolute paths).
Parameters:
templatePaths - An array of template paths.
Returns:
An array of translated template paths.

templateExists

public boolean templateExists(java.lang.String template,
                              java.lang.String[] templatePaths)
Delegates to the appropriate TemplateEngineService to check the existance of the specified template.
Parameters:
template - The template to check for the existance of.
templatePaths - The paths to check for the template.

registerTemplateEngineService

public void registerTemplateEngineService(TemplateEngineService service)
Registers the provided template engine for use by the TemplateService.
Parameters:
service - The TemplateEngineService to register.


Copyright © 2000-2002 Apache Software Foundation. All Rights Reserved.