KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > turbine > services > template > TemplateEngineService


1 package org.apache.turbine.services.template;
2
3 /*
4  * Copyright 2001-2004 The Apache Software Foundation.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License")
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */

18
19 import java.util.Hashtable JavaDoc;
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,v 1.6.2.2 2004/05/20 03:06:47 seade Exp $ */

29 public interface TemplateEngineService
30 {
31     static final String JavaDoc TEMPLATE_EXTENSIONS = "template.extension";
32     static final String JavaDoc DEFAULT_TEMPLATE_EXTENSION = "template.default.extension";
33     static final String JavaDoc DEFAULT_PAGE = "default.page";
34     static final String JavaDoc DEFAULT_SCREEN = "default.screen";
35     static final String JavaDoc DEFAULT_LAYOUT = "default.layout";
36     static final String JavaDoc DEFAULT_NAVIGATION = "default.navigation";
37     static final String JavaDoc DEFAULT_ERROR_SCREEN = "default.error.screen";
38     static final String JavaDoc DEFAULT_LAYOUT_TEMPLATE = "default.layout.template";
39     static final String JavaDoc DEFAULT_SCREEN_TEMPLATE = "default.screen.template";
40     static final String JavaDoc 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 JavaDoc 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 JavaDoc 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 JavaDoc[] 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 JavaDoc template);
77 }
78
Popular Tags