Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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 615328 2008-01-25 20:25:05Z tv $
Author:
  John D. McNally, Jason van Zyl, Daniel Rall, Ilkka Priha

Field Summary
`static String` | `DEFAULT_EXTENSION_KEY` Default Extension for the template names.
`static String` | `DEFAULT_EXTENSION_VALUE` Default value of the Turbine Module Caching
`static String` | `DEFAULT_NAME` "Default" name for Classes and Templates
`static String` | `DEFAULT_TEMPLATE_KEY` Default Template Name.
`static String` | `DEFAULT_TEMPLATE_VALUE` Default value for the Template Name
`static char` | `EXTENSION_SEPARATOR` Character that separates a Template Name from the Extension
`static String` | `SERVICE_NAME` The key under which this service is stored in TurbineServices.
`static char` | `TEMPLATE_PARTS_SEPARATOR` Character that separates the various Template Parts

Method Summary
`String` | `getDefaultExtension()` Get the default template name extension specified in the template service properties.
`String` | `getDefaultLayout()` Get the default layout module name of the template engine service corresponding to the default template name extension.
`String` | `getDefaultLayoutName(RunData data)` Find the default layout module name for the given request.
`String` | `getDefaultLayoutName(String template)` Get the default layout module name of the template engine service corresponding to the template name extension of the named template.
`String` | `getDefaultLayoutTemplate()` Get the default layout template name of the template engine service corresponding to the default template name extension.
`String` | `getDefaultLayoutTemplateName(String template)` Get the default layout template name of the template engine service corresponding to the template name extension of the named template.
`String` | `getDefaultNavigation()` Get the default navigation module name of the template engine service corresponding to the default template name extension.
`String` | `getDefaultNavigationName(String template)` Get the default navigation module name of the template engine service corresponding to the template name extension of the named template.
`String` | `getDefaultPage()` Get the default page module name of the template engine service corresponding to the default template name extension.
`String` | `getDefaultPageName(RunData data)` Find the default page module name for the given request.
`String` | `getDefaultPageName(String template)` Get the default page module name of the template engine service corresponding to the template name extension of the named template.
`String` | `getDefaultScreen()` Get the default screen module name of the template engine service corresponding to the default template name extension.
`String` | `getDefaultScreenName(String template)` Get the default screen module name of the template engine service corresponding to the template name extension of the named template.
`String` | `getDefaultTemplate()` Returns the Default Template Name with the Default Extension.
`String` | `getExtension(String template)` Return Extension for a supplied template
`String` | `getLayoutName(String template)` Locate and return the name of the layout module to be used with the named layout template.
`String` | `getLayoutTemplateName(String template)` Locate and return the name of the layout template corresponding to the given screen template name parameter.
`String` | `getNavigationName(String name)` Locate and return the name of the navigation module to be used with the named navigation template.
`String` | `getNavigationTemplateName(String template)` Locate and return the name of the navigation template corresponding to the given template name parameter.
`String` | `getScreenName(String template)` Locate and return the name of the screen module to be used with the named screen template.
`String` | `getScreenTemplateName(String template)` Locate and return the name of the screen template corresponding to the given template name parameter.
`TemplateEngineService` | `getTemplateEngineService(String template)` The `TemplateEngineService` associated with the specified template's file extension.
`boolean` | `isCaching()` Returns true if the Template Service has caching activated
`void` | `registerTemplateEngineService(TemplateEngineService service)` Registers the provided template engine for use by the `TemplateService`.
`boolean` | `templateExists(String template, String[] templatePaths)` Deprecated. Use templateExists from the various Templating Engines
`String[]` | `translateTemplatePaths(String[] templatePaths)` Deprecated. Each template engine service should know how to translate a request onto a file.

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

    static final String SERVICE_NAME

  The key under which this service is stored in TurbineServices.

  See Also:
    Constant Field Values

### DEFAULT_TEMPLATE_KEY

    static final String DEFAULT_TEMPLATE_KEY

  Default Template Name.

  See Also:
    Constant Field Values

### DEFAULT_TEMPLATE_VALUE

    static final String DEFAULT_TEMPLATE_VALUE

  Default value for the Template Name

  See Also:
    Constant Field Values

### DEFAULT_EXTENSION_KEY

    static final String DEFAULT_EXTENSION_KEY

  Default Extension for the template names.

  See Also:
    Constant Field Values

### DEFAULT_EXTENSION_VALUE

    static final String DEFAULT_EXTENSION_VALUE

  Default value of the Turbine Module Caching

  See Also:
    Constant Field Values

### EXTENSION_SEPARATOR

    static final char EXTENSION_SEPARATOR

  Character that separates a Template Name from the Extension

  See Also:
    Constant Field Values

### TEMPLATE_PARTS_SEPARATOR

    static final char TEMPLATE_PARTS_SEPARATOR

  Character that separates the various Template Parts

  See Also:
    Constant Field Values

### DEFAULT_NAME

    static final String DEFAULT_NAME

  "Default" name for Classes and Templates

  See Also:
    Constant Field Values

Method Detail

### isCaching

    boolean isCaching()

  Returns true if the Template Service has caching activated

  Returns:
    true if Caching is active.

### getDefaultExtension

    String getDefaultExtension()

  Get the default template name extension specified in the template service properties.

  Returns:
    The default the extension.

### getExtension

    String getExtension(String template)

  Return Extension for a supplied template

  Parameters:
    `template` - The template name
  Returns:
    extension The extension for the supplied template

### getDefaultTemplate

    String getDefaultTemplate()

  Returns the Default Template Name with the Default Extension. If the extension is unset, return only the template name

  Returns:
    The default template Name

### getDefaultPage

    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

    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

    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

    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

    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

    String getDefaultPageName(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

    String getDefaultScreenName(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

    String getDefaultLayoutName(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

    String getDefaultNavigationName(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

    String getDefaultLayoutTemplateName(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

    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

    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

    String getScreenName(String template)
                         throws 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.
    `Exception`

### getLayoutName

    String getLayoutName(String template)
                         throws 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.
    `Exception`

### getNavigationName

    String getNavigationName(String name)
                             throws 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.
    `Exception`

### getScreenTemplateName

    String getScreenTemplateName(String template)
                                 throws 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.
    `Exception`

### getLayoutTemplateName

    String getLayoutTemplateName(String template)
                                 throws 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.
    `Exception`

### getNavigationTemplateName

    String getNavigationTemplateName(String template)
                                     throws Exception

  Locate and return the name of the navigation template corresponding to the given template name parameter.

  Parameters:
    `template` - The template name parameter.
  Returns:
    The found navigation template name.
  Throws:
    `Exception,` - a generic exception.
    `Exception`

### translateTemplatePaths

    String[] translateTemplatePaths(String[] templatePaths)

  Deprecated. Each template engine service should know how to translate a request onto a file.

  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

    boolean templateExists(String template,
                           String[] templatePaths)

  Deprecated. Use templateExists from the various Templating Engines

  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.

### getTemplateEngineService

    TemplateEngineService getTemplateEngineService(String template)

  The `TemplateEngineService` associated with the specified template's file extension.

  Parameters:
    `template` - The template name.
  Returns:
    The template engine service.

### registerTemplateEngineService

    void registerTemplateEngineService(TemplateEngineService service)

  Registers the provided template engine for use by the `TemplateService`.

  Parameters:
    `service` - The `TemplateEngineService` to register.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000-2011 The Apache Software Foundation. All Rights Reserved.