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
Class TurbineTemplate

    java.lang.Object
      org.apache.turbine.services.template.TurbineTemplate

    public abstract class TurbineTemplate

extends Object

This is a simple static accessor to common TemplateService tasks such as getting a Screen that is associated with a screen template.

Version:
  $Id: TurbineTemplate.java 615328 2008-01-25 20:25:05Z tv $
Author:
  John D. McNally

Constructor Summary
`TurbineTemplate()`

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

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### TurbineTemplate

    public TurbineTemplate()

Method Detail

### getService

    public static TemplateService getService()

  Utility method for accessing the service implementation

  Returns:
    a TemplateService implementation instance

### isCaching

    public static final boolean isCaching()

  Returns true if the Template Service has caching activated

  Returns:
    true if Caching is active.

### getDefaultExtension

    public static final String getDefaultExtension()

  Get the default extension given in the properties file.

  Returns:
    A String with the extension.

### getExtension

    public static final String getExtension(String template)

  Return Extension for a supplied template

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

### getDefaultTemplate

    public static final 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

    public static final 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 static final String getDefaultScreen()

  Get the Screen template given in the properties file.

  Returns:
    A String which is the value of the TemplateService default.screen property.

### getDefaultLayout

    public static final 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 static final String getDefaultNavigation()

  Get the default Navigation given in the properties file.

  Returns:
    A String which is the value of the TemplateService default.navigation property.

### getDefaultLayoutTemplate

    public static final String getDefaultLayoutTemplate()

  Get the default layout template given in the properties file.

  Returns:
    A String which is the value of the TemplateService default.layout.template property.

### getDefaultPageName

    public static final 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

    public static final 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

    public static final 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

    public static final 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

    public static final 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

    public static final 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 static final 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 static final String getScreenName(String name)
                                      throws Exception

  Locate and return the name of a Screen module.

  Parameters:
    `name` - A String with the name of the template.
  Returns:
    A String with the name of the screen.
  Throws:
    `Exception,` - a generic exception.
    `Exception`

### getLayoutName

    public static final 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

    public static final String getNavigationName(String template)
                                          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

    public static final String getScreenTemplateName(String key)
                                              throws Exception

  Locate and return the name of a screen template.

  Parameters:
    `key` - A String which is the key to the template.
  Returns:
    A String with the screen template path.
  Throws:
    `Exception,` - a generic exception.
    `Exception`

### getLayoutTemplateName

    public static final String getLayoutTemplateName(String name)
                                              throws Exception

  Locate and return the name of a layout template.

  Parameters:
    `name` - A String with the name of the template.
  Returns:
    A String with the layout template path.
  Throws:
    `Exception,` - a generic exception.
    `Exception`

### getNavigationTemplateName

    public static final String getNavigationTemplateName(String key)
                                                  throws Exception

  Locate and return the name of a navigation template.

  Parameters:
    `key` - A String which is the key to the template.
  Returns:
    A String with the navigation template path.
  Throws:
    `Exception,` - a generic exception.
    `Exception`

### translateTemplatePaths

    public static final 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

    public static final 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.

### registerTemplateEngineService

    public static final void registerTemplateEngineService(TemplateEngineService service)

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

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

### getTemplateEngineService

    public static final TemplateEngineService getTemplateEngineService(String template)

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

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

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.