1/*2 * Copyright 2000-2001,2004 The Apache Software Foundation.3 * 4 * Licensed under the Apache License, Version 2.0 (the "License");5 * you may not use this file except in compliance with the License.6 * You may obtain a copy of the License at7 * 8 * http://www.apache.org/licenses/LICENSE-2.09 * 10 * Unless required by applicable law or agreed to in writing, software11 * distributed under the License is distributed on an "AS IS" BASIS,12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.13 * See the License for the specific language governing permissions and14 * limitations under the License.15 */1617packageorg.apache.jetspeed.services.template;
1819import org.apache.turbine.services.Service;
20import org.apache.turbine.util.RunData;
2122import java.util.Locale;
2324/***25 * <p>This interface is a facade for all template location related operations.26 * Template location algorithms are different from the Velocity template location,27 * since Jetspeed has a specialized template directory structure.28 * This is a fix to get us through unti the TurbineTemplateService can locate29 * resources by NLS and mediatype. Then it can be removed</p>30 *31 * <p>The directory structure is currently layout out in the following order:32 * /templateType/mediaType/LanguageCode/CountryCode</p>33 * <p>Example: /screens/html/en/US/resource.vm</p>34 *35 * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>36 * @author <a href="mailto:paulsp@apache.org">Paul Spencer</a>37 * @author <a href="mailto:kimptoc_mail@yahoo.com">Chris Kimpton</a>38 * @version $Id: TemplateLocatorService.java,v 1.8 2004/02/23 03:38:54 jford Exp $39 */4041publicinterfaceTemplateLocatorServiceextends Service
42 {
4344/*** The name of this service */45public String SERVICE_NAME = "TemplateLocator";
4647/***48 * Locate a screen template using Jetspeed template location algorithm, searching by49 * mediatype and language criteria extracted from the request state in rundata.50 *51 * @param data The rundata for the request.52 * @param template The name of the template.53 *54 * @return The path relative to the screens directory for the requested screen template,55 * or null if not found.56 */57public String locateScreenTemplate(RunData data, String template);
5859/***60 * Locate a layout template using Jetspeed template location algorithm, searching by61 * mediatype and language criteria extracted from the request state in rundata.62 *63 * @param data The rundata for the request.64 * @param template The name of the template.65 *66 * @return The path relative to the layouts directory for the requested layout template,67 * or null if not found.68 */69public String locateLayoutTemplate(RunData data, String template);
7071/***72 * Locate a portlet template using Jetspeed template location algorithm, searching by73 * mediatype and language criteria extracted from the request state in rundata.74 *75 * @param data The rundata for the request.76 * @param template The name of the template.77 *78 * @return The path relative to the portlets directory for the requested portlet template,79 * or null if not found.80 */81public String locatePortletTemplate(RunData data, String template);
8283/***84 * Locate a control template using Jetspeed template location algorithm, searching by85 * mediatype and language criteria extracted from the request state in rundata.86 *87 * @param data The rundata for the request.88 * @param template The name of the template.89 *90 * @return The path relative to the controls directory for the requested control template,91 * or null if not found.92 */93public String locateControlTemplate(RunData data, String template);
9495/***96 * Locate a controller template using Jetspeed template location algorithm, searching by97 * mediatype and language criteria extracted from the request state in rundata.98 *99 * @param data The rundata for the request.100 * @param template The name of the template.101 *102 * @return The path relative to the controllers directory for the requested controller template,103 * or null if not found.104 */105public String locateControllerTemplate(RunData data, String template);
106107/***108 * Locate a navigation template using Jetspeed template location algorithm, searching by109 * mediatype and language criteria extracted from the request state in rundata.110 *111 * @param data The rundata for the request.112 * @param template The name of the template.113 *114 * @return The path relative to the controllers directory for the requested controller template,115 * or null if not found.116 */117public String locateNavigationTemplate(RunData data, String template);
118119/***120 * Locate an email template using Jetspeed template location algorithm, searching by121 * language criteria extracted from the request state in rundata.122 *123 * @param data The rundata for the request.124 * @param template The name of the template.125 *126 * @return The path relative to the emails directory for the requested email template,127 * or null if not found.128 */129public String locateEmailTemplate(RunData data, String template);
130131/***132 * Locate an email template using Jetspeed template location algorithm133 *134 * @param data The rundata for the request.135 * @param template The name of the template.136 * @param locale The locale of the template.137 *138 * @return The path relative to the emails directory for the requested email template,139 * or null if not found.140 */141public String locateEmailTemplate(RunData data, String template, Locale locale);
142143/***144 * Locate a parameter style template using Jetspeed template location algorithm, searching by145 * mediatype and language criteria extracted from the request state in rundata.146 *147 * @param data The rundata for the request.148 * @param template The name of the template.149 *150 * @return The path relative to the parameters directory for the requested portlet template,151 * or null if not found.152 */153public String locateParameterTemplate(RunData data, String template);
154155 }