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