|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.arsdigita.templating.PatternStylesheetResolver
This stylesheet resolver is used by the *PresentationManager
class to work out which XSLT stylesheet to apply to the current Bebop
XML output.
This particular stylesheet resolver uses a flat file containing a list
of stylesheet patterns, one per line. The file is called
WEB-INF/resources/stylesheet-paths.txt
.
Such a file could look like this:
# Comments and empty lines are ignored. /packages/aplaws/xsl/::vhost::/cms_::locale::.xsl /packages/aplaws/xsl/::vhost::/cms.xsl /packages/aplaws/xsl/default/cms_::locale::.xsl /packages/aplaws/xsl/default/cms.xsl /packages/content-section/xsl/cms_::locale::.xsl /packages/content-section/xsl/cms.xsl
You may use the
com.arsdigita.templating.stylesheet_paths
system
property to change the file from which the stylesheet patterns are
drawn.
The patterns, such as ::vhost::
, are substituted
for string values:
Pattern | Meaning | Examples |
---|---|---|
::locale:: |
Current locale | fr_FR |
::vhost:: |
Virtual hostname. | business.camden.gov.uk |
::outputtype:: |
Output format. | text_html |
Each substituted string is cleaned up using the following rules:
The resolver looks at each stylesheet in turn, and the first one which actually exists on disk is returned.
Field Summary |
Fields inherited from interface com.arsdigita.templating.StylesheetResolver |
versionId |
Constructor Summary | |
PatternStylesheetResolver()
|
Method Summary | |
static void |
registerPatternGenerator(String key,
PatternGenerator gen)
Registers a new pattern generator for the given key. |
URL |
resolve(javax.servlet.http.HttpServletRequest request)
Resolves a template for the request. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PatternStylesheetResolver()
Method Detail |
public static void registerPatternGenerator(String key, PatternGenerator gen)
key
- the key as it appears in the pattern stringgen
- a pattern generator for producing values to be
substituted for key
public URL resolve(javax.servlet.http.HttpServletRequest request)
StylesheetResolver
resolve
in interface StylesheetResolver
request
- the HttpServletRequest
for which to
resolve a template
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |