|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.wiki.util.PropertyReader
public final class PropertyReader
Property Reader for the WikiEngine. Reads the properties for the WikiEngine and implements the feature of cascading properties and variable substitution, which come in handy in a multi wiki installation environment: It reduces the need for (shell) scripting in order to generate different jspwiki.properties to a minimum.
Field Summary | |
---|---|
static String |
CUSTOM_JSPWIKI_CONFIG
|
static String |
DEFAULT_JSPWIKI_CONFIG
Path to the base property file, usually overridden by values provided in a jspwiki-custom.properties file "/ini/jspwiki.properties" |
static String |
PARAM_CUSTOMCONFIG
The servlet context parameter (from web.xml) that defines where the config file is to be found. |
static String |
PARAM_CUSTOMCONFIG_CASCADEPREFIX
The prefix when you are cascading properties. |
Method Summary | |
---|---|
static void |
expandVars(Properties properties)
You define a property variable by using the prefix "var.x" as a property. |
static Properties |
getCombinedProperties(String fileName)
Returns a property set consisting of the default Property Set overlaid with a custom property set |
static Properties |
getDefaultProperties()
Returns the property set as a Properties object. |
static Properties |
loadWebAppProps(javax.servlet.ServletContext context)
Loads the webapp properties based on servlet context information, or (if absent) based on the Java System Property PARAM_CUSTOMCONFIG . |
static InputStream |
locateClassPathResource(javax.servlet.ServletContext context,
String resourceName)
Locate a resource stored in the class path. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String DEFAULT_JSPWIKI_CONFIG
public static final String PARAM_CUSTOMCONFIG
public static final String PARAM_CUSTOMCONFIG_CASCADEPREFIX
loadWebAppProps(ServletContext)
,
Constant Field Valuespublic static final String CUSTOM_JSPWIKI_CONFIG
Method Detail |
---|
public static Properties loadWebAppProps(javax.servlet.ServletContext context)
You can define additional property files and merge them into the default properties file in a similar process to how you define cascading style sheets; hence we call this cascading property files. This way you can overwrite the default values and only specify the properties you need to change in a multiple wiki environment.
You define a cascade in the context mapping of your servlet container.
jspwiki.custom.cascade.1 jspwiki.custom.cascade.2 jspwiki.custom.cascade.3and so on. You have to number your cascade in a descending way starting with "1". This means you cannot leave out numbers in your cascade. This method is based on an idea by Olaf Kaus, see [JSPWiki:MultipleWikis].
context
- A Servlet Context which is used to find the properties
public static Properties getDefaultProperties()
public static Properties getCombinedProperties(String fileName)
fileName
- Reference to the custom override file
public static void expandVars(Properties properties)
var.basedir = /p/mywiki; jspwiki.fileSystemProvider.pageDir = $basedir/www/ jspwiki.basicAttachmentProvider.storageDir = $basedir/www/ jspwiki.workDir = $basedir/wrk/
properties
- - properties to expand;public static InputStream locateClassPathResource(javax.servlet.ServletContext context, String resourceName)
context
- the servlet contextresourceName
- the name of the resource
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |