1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.jetspeed.locator;
18
19 import java.util.Iterator;
20
21 /***
22 * TemplateLocator interface
23 *
24 * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
25 * @version $Id: TemplateLocator.java 516448 2007-03-09 16:25:47Z ate $
26 */
27 public interface TemplateLocator
28 {
29 /***
30 * Locate an template using Jetspeed template location algorithm
31 *
32 * @param locator The template locator
33 * @return The template found, or null if not found.
34 * @throws TemplateLocatorException
35 */
36 TemplateDescriptor locateTemplate(LocatorDescriptor locator)
37 throws TemplateLocatorException;
38
39 /***
40 * Factory to create template locators of the given type.
41 * Known supported locator types, but not limited to:
42 * <code>portlet</code>
43 * <code>email</code>
44 *
45 * @param The type of locator to create
46 * @return a general template locator of the given type
47 * @throws TemplateLocatorException if factory exception or if not valid locator type
48 */
49 LocatorDescriptor createLocatorDescriptor(String type)
50 throws TemplateLocatorException;
51
52 /***
53 * Creates a locator from a string of format (where brackets are optional]:
54 *
55 * template/<templateType>/[media-type/<mediaType>]/[language/<language>]/[country/<country>]]/name/<templateName
56 *
57 * @param string the string representation of a template locator
58 * @throws TemplateLocatorException
59 */
60 LocatorDescriptor createFromString(String string)
61 throws TemplateLocatorException;
62
63 /***
64 * Query for a collection of templates given template locator criteria.
65 *
66 * @param locator The template locator criteria.
67 * @return The result list of {@link Template} objects matching the locator criteria.
68 */
69 public Iterator query(LocatorDescriptor locator);
70
71 }