Class DefaultFactory
java.lang.Object
com.opensymphony.module.sitemesh.Factory
com.opensymphony.module.sitemesh.factory.BaseFactory
com.opensymphony.module.sitemesh.factory.DefaultFactory
- All Implemented Interfaces:
PageParserSelector
DefaultFactory, reads configuration from the
sitemesh.configfile init param,
or /WEB-INF/sitemesh.xml if not specified, or uses the
default configuration if sitemesh.xml does not exist.
To use the sitemesh.configfile parameter, add the following to your web.xml:
<context-param>
<param-name>sitemesh.configfile</param-name>
<param-value>/WEB-INF/etc/sitemesh.xml</param-value>
</context-param>
- Version:
- $Revision: 1.8 $
- Author:
- Joe Walnes, Mathias Bogaert
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic long(package private) File(package private) Stringprivate long(package private) long(package private) Mapprivate static final String(package private) File(package private) StringFields inherited from class com.opensymphony.module.sitemesh.factory.BaseFactory
config, decoratorMapper, excludeUrls, pageParsers -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidLoad configuration from file.private voidloadDecoratorMappers(NodeList nodes) private voidprivate voidloadExcludeUrls(NodeList nodes) Reads in all the url patterns to exclude from decoration.private voidloadPageParsers(NodeList nodes) Loop through children of 'page-parsers' element and add all 'parser' mappings.private Elementvoidrefresh()Check if configuration file has been modified, and if so reload it.private StringreplaceProperties(String str) Replaces any properties that appear in the supplied string with their actual valuesMethods inherited from class com.opensymphony.module.sitemesh.factory.BaseFactory
addExcludeUrl, clearDecoratorMappers, clearExcludeUrls, clearParserMappings, getDecoratorMapper, getDecoratorMapper, getPageParser, isPathExcluded, mapParser, pushDecoratorMapper, shouldParsePageMethods inherited from class com.opensymphony.module.sitemesh.Factory
getInstance
-
Field Details
-
configFileName
String configFileName -
DEFAULT_CONFIG_FILENAME
- See Also:
-
configFile
File configFile -
configLastModified
long configLastModified -
configLastCheck
private long configLastCheck -
configCheckMillis
public static long configCheckMillis -
configProps
Map configProps -
excludesFileName
String excludesFileName -
excludesFile
File excludesFile
-
-
Constructor Details
-
DefaultFactory
-
-
Method Details
-
loadConfig
private void loadConfig()Load configuration from file. -
loadSitemeshXML
-
loadExcludes
-
loadPageParsers
Loop through children of 'page-parsers' element and add all 'parser' mappings. -
loadDecoratorMappers
-
loadExcludeUrls
Reads in all the url patterns to exclude from decoration. -
refresh
public void refresh()Check if configuration file has been modified, and if so reload it. -
replaceProperties
Replaces any properties that appear in the supplied string with their actual values- Parameters:
str- the string to replace the properties in- Returns:
- the same string but with any properties expanded out to their actual values
-