1 package org.apache.turbine.services.template;
2
3 /* ====================================================================
4 * The Apache Software License, Version 1.1
5 *
6 * Copyright (c) 2001 The Apache Software Foundation. All rights
7 * reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 *
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 *
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in
18 * the documentation and/or other materials provided with the
19 * distribution.
20 *
21 * 3. The end-user documentation included with the redistribution,
22 * if any, must include the following acknowledgment:
23 * "This product includes software developed by the
24 * Apache Software Foundation (http://www.apache.org/)."
25 * Alternately, this acknowledgment may appear in the software itself,
26 * if and wherever such third-party acknowledgments normally appear.
27 *
28 * 4. The names "Apache" and "Apache Software Foundation" and
29 * "Apache Turbine" must not be used to endorse or promote products
30 * derived from this software without prior written permission. For
31 * written permission, please contact apache@apache.org.
32 *
33 * 5. Products derived from this software may not be called "Apache",
34 * "Apache Turbine", nor may "Apache" appear in their name, without
35 * prior written permission of the Apache Software Foundation.
36 *
37 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
38 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
39 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
40 * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
41 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
42 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
43 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
44 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
45 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
46 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
47 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
48 * SUCH DAMAGE.
49 * ====================================================================
50 *
51 * This software consists of voluntary contributions made by many
52 * individuals on behalf of the Apache Software Foundation. For more
53 * information on the Apache Software Foundation, please see
54 * <http://www.apache.org/>.
55 */
56
57 import org.apache.turbine.util.RunData;
58
59 import org.apache.turbine.services.Service;
60
61 /***
62 * This service provides a method for mapping templates to their
63 * appropriate Screens or Navigations. It also allows templates to
64 * define a layout/navigations/screen modularization within the
65 * template structure. It also performs caching if turned on in the
66 * properties file.
67 *
68 * @author <a href="mailto:john.mcnally@clearink.com">John D. McNally</a>
69 * @author <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>
70 * @author <a href="mailto:dlr@finemaltcoding.com">Daniel Rall</a>
71 * @author <a href="mailto:ilkka.priha@simsoft.fi">Ilkka Priha</a>
72 * @version $Id: TemplateService.java,v 1.1.1.1 2001/08/16 05:09:22 jvanzyl Exp $
73 */
74 public interface TemplateService extends Service
75 {
76 /***
77 * The key under which this service is stored in TurbineServices.
78 */
79 public static final String SERVICE_NAME = "TemplateService";
80
81 /***
82 * Get the default template name extension specified
83 * in the template service properties.
84 *
85 * @return The default the extension.
86 */
87 public String getDefaultExtension();
88
89 /***
90 * Get the default page module name of the template engine
91 * service corresponding to the default template name extension.
92 *
93 * @return The default page module name.
94 */
95 public String getDefaultPage();
96
97 /***
98 * Get the default screen module name of the template engine
99 * service corresponding to the default template name extension.
100 *
101 * @return The default screen module name.
102 */
103 public String getDefaultScreen();
104
105 /***
106 * Get the default layout module name of the template engine
107 * service corresponding to the default template name extension.
108 *
109 * @return The default layout module name.
110 */
111 public String getDefaultLayout();
112
113 /***
114 * Get the default navigation module name of the template engine
115 * service corresponding to the default template name extension.
116 *
117 * @return The default navigation module name.
118 */
119 public String getDefaultNavigation();
120
121 /***
122 * Get the default layout template name of the template engine
123 * service corresponding to the default template name extension.
124 *
125 * @return The default layout template name.
126 */
127 public String getDefaultLayoutTemplate();
128
129 /***
130 * Get the default page module name of the template engine
131 * service corresponding to the template name extension of
132 * the named template.
133 *
134 * @param template The template name.
135 * @return The default page module name.
136 */
137 public String getDefaultPageName(String template);
138
139 /***
140 * Get the default screen module name of the template engine
141 * service corresponding to the template name extension of
142 * the named template.
143 *
144 * @param template The template name.
145 * @return The default screen module name.
146 */
147 public String getDefaultScreenName(String template);
148
149 /***
150 * Get the default layout module name of the template engine
151 * service corresponding to the template name extension of
152 * the named template.
153 *
154 * @param template The template name.
155 * @return The default layout module name.
156 */
157 public String getDefaultLayoutName(String template);
158
159 /***
160 * Get the default navigation module name of the template engine
161 * service corresponding to the template name extension of
162 * the named template.
163 *
164 * @param template The template name.
165 * @return The default navigation module name.
166 */
167 public String getDefaultNavigationName(String template);
168
169 /***
170 * Get the default layout template name of the template engine
171 * service corresponding to the template name extension of
172 * the named template.
173 *
174 * @param template The template name.
175 * @return The default layout template name.
176 */
177 public String getDefaultLayoutTemplateName(String template);
178
179 /***
180 * Find the default page module name for the given request.
181 *
182 * @param data The encapsulation of the request to retrieve the
183 * default page for.
184 * @return The default page module name.
185 */
186 public String getDefaultPageName(RunData data);
187
188 /***
189 * Find the default layout module name for the given request.
190 *
191 * @param data The encapsulation of the request to retrieve the
192 * default layout for.
193 * @return The default layout module name.
194 */
195 public String getDefaultLayoutName(RunData data);
196
197 /***
198 * Locate and return the name of the screen module to be used
199 * with the named screen template.
200 *
201 * @param template The screen template name.
202 * @return The found screen module name.
203 * @exception Exception, a generic exception.
204 */
205 public String getScreenName(String template)
206 throws Exception;
207
208 /***
209 * Locate and return the name of the layout module to be used
210 * with the named layout template.
211 *
212 * @param template The layout template name.
213 * @return The found layout module name.
214 * @exception Exception, a generic exception.
215 */
216 public String getLayoutName(String template)
217 throws Exception;
218
219 /***
220 * Locate and return the name of the navigation module to be used
221 * with the named navigation template.
222 *
223 * @param template The navigation template name.
224 * @return The found navigation module name.
225 * @exception Exception, a generic exception.
226 */
227 public String getNavigationName(String name)
228 throws Exception;
229
230 /***
231 * Locate and return the name of the screen template corresponding
232 * to the given template name parameter.
233 *
234 * @param template The template name parameter.
235 * @return The found screen template name.
236 * @exception Exception, a generic exception.
237 */
238 public String getScreenTemplateName(String template)
239 throws Exception;
240
241 /***
242 * Locate and return the name of the layout template corresponding
243 * to the given screen template name parameter.
244 *
245 * @param template The template name parameter.
246 * @return The found screen template name.
247 * @exception Exception, a generic exception.
248 */
249 public String getLayoutTemplateName(String template)
250 throws Exception;
251
252 /***
253 * Translates the supplied template paths into their Turbine-canonical
254 * equivalent (probably absolute paths).
255 *
256 * @param templatePaths An array of template paths.
257 * @return An array of translated template paths.
258 */
259 public String[] translateTemplatePaths(String[] templatePaths);
260
261 /***
262 * Delegates to the appropriate {@link
263 * org.apache.turbine.services.template.TemplateEngineService} to
264 * check the existance of the specified template.
265 *
266 * @param template The template to check for the existance of.
267 * @param templatePaths The paths to check for the template.
268 */
269 public boolean templateExists(String template,
270 String[] templatePaths);
271
272 /***
273 * Registers the provided template engine for use by the
274 * <code>TemplateService</code>.
275 *
276 * @param service The <code>TemplateEngineService</code> to register.
277 */
278 public void registerTemplateEngineService(TemplateEngineService service);
279 }
This page was automatically generated by Maven