1 package org.apache.turbine.services.template;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import java.util.Hashtable;
23
24 /***
25 * This is the interface that all template engine services must adhere
26 * to. This includes the Velocity, WebMacro, FreeMarker, and JSP
27 * services.
28 *
29 * @author <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>
30 * @author <a href="mailto:dlr@finemaltcoding.com">Daniel Rall</a>
31 * @version $Id: TemplateEngineService.java 534527 2007-05-02 16:10:59Z tv $ */
32 public interface TemplateEngineService
33 {
34 String TEMPLATE_EXTENSIONS = "template.extension";
35 String DEFAULT_TEMPLATE_EXTENSION = "template.default.extension";
36 String DEFAULT_PAGE = "default.page";
37 String DEFAULT_SCREEN = "default.screen";
38 String DEFAULT_LAYOUT = "default.layout";
39 String DEFAULT_NAVIGATION = "default.navigation";
40 String DEFAULT_ERROR_SCREEN = "default.error.screen";
41 String DEFAULT_LAYOUT_TEMPLATE = "default.layout.template";
42 String DEFAULT_SCREEN_TEMPLATE = "default.screen.template";
43 String DEFAULT_NAVIGATION_TEMPLATE = "default.navigation.template";
44
45 /***
46 * Return the configuration of the template engine in
47 * the form of a Hashtable.
48 */
49 Hashtable getTemplateEngineServiceConfiguration();
50
51 /***
52 * Initializes file extension associations and registers with the
53 * template service.
54 *
55 * @param defaultExt The default file extension association to use
56 * in case of properties file misconfiguration.
57 */
58 void registerConfiguration(String defaultExt);
59
60 /***
61 * Supplies the file extension to key this engine in {@link
62 * org.apache.turbine.services.template.TemplateService}'s
63 * registry with.
64 */
65 String[] getAssociatedFileExtensions();
66
67 /***
68 * Use the specific template engine to determine whether
69 * a given template exists. This allows Turbine the TemplateService
70 * to delegate the search for a template to the template
71 * engine being used for the view. This gives us the
72 * advantage of fully utilizing the capabilities of
73 * template engine with respect to retrieving templates
74 * from arbitrary sources.
75 *
76 * @param template The name of the template to check the existance of.
77 * @return Whether the specified template exists.
78 */
79 boolean templateExists(String template);
80 }