01: /*
02: * Created on Apr 26, 2006
03: */
04: package uk.org.ponder.rsf.templateresolver;
05:
06: import uk.org.ponder.rsf.viewstate.ViewParameters;
07: import uk.org.ponder.stringutil.StringList;
08:
09: /**
10: * Resolves an incoming set of ViewParameters onto a list of template path names
11: * (minus extension) to be searched for an appropriate template file.
12: * <p>
13: * Use of this interface implies the use of templates from webapp-local
14: * storage, as in general served by the DefaultServlet. For more finegrained
15: * control over template location and mapping, use the
16: * {@link BaseAwareTemplateResolverStrategy}.
17: *
18: * @author Antranig Basman (antranig@caret.cam.ac.uk)
19: *
20: */
21:
22: public interface TemplateResolverStrategy {
23: /**
24: * @param viewparams The view parameters for the view being rendered.
25: * @return A (modifiable) list of resource names (as supplied to some kind of
26: * InputStreamSource) MINUS extension, that will be searched, IN
27: * ORDER, for a view template to be used for the current view. These
28: * are *relative* paths from the context root of the webapp, omitting
29: * the leading slash.
30: */
31: public StringList resolveTemplatePath(ViewParameters viewparams);
32:
33: /** Determines whether this resolver strategy is "static" - that is, whether
34: * it returns results which are not specific to the current view. The primary
35: * usage of this return is to determine whether to import *all* branch
36: * IDs into global resolution, or just branch IDs which occur at top level
37: * in the returned templates.
38: * @return false if this resolver returns templates which are view-specific
39: */
40: public boolean isStatic();
41:
42: }
|