public interface TemplateManager extends ModuleManager
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEFAULT_TEMPLATE
The name of the default template.
|
static java.lang.String |
DIRECTORY
The default directory for the properties.
|
static java.lang.String |
I18NDEFAULT_LOCALE
I18N string to mark the default locale
|
static java.lang.String |
I18NRESOURCE_EN
The default (en) RESOURCE name and id.
|
static java.lang.String |
I18NRESOURCE_EN_ID |
static java.lang.String |
I18NRESOURCE_PREFIX
Location of I18N Resource bundles, and path prefix and suffixes
|
static java.lang.String |
I18NRESOURCE_SUFFIX |
static java.lang.String |
I18NSERVER_TIMEZONE
I18N string to mark the server timezone
|
static java.lang.String |
PROPERTYFILE
Name of the file that contains the properties.
|
static java.lang.String |
RESOURCE_HTTPHEADER
Requests a HTTP header.
|
static java.lang.String |
RESOURCE_INCLUDES
The name under which the resource includes map is stored in the WikiContext.
|
static java.lang.String |
RESOURCE_INLINECSS
Requests inlined CSS.
|
static java.lang.String |
RESOURCE_JSFUNCTION
Requests a JavaScript function to be called during window.onload.
|
static java.lang.String |
RESOURCE_JSLOCALIZEDSTRINGS
Requests a JavaScript associative array with all localized strings.
|
static java.lang.String |
RESOURCE_SCRIPT
Requests a script to be loaded.
|
static java.lang.String |
RESOURCE_STYLESHEET
Requests a stylesheet to be inserted.
|
static java.lang.String |
SKIN_DIRECTORY |
static java.lang.String |
TIMEFORMATPROPERTIES
Prefix of the default timeformat properties.
|
PLUGIN_RESOURCE_LOCATION| Modifier and Type | Method and Description |
|---|---|
static void |
addResourceRequest(Context ctx,
java.lang.String type,
java.lang.String resource)
Adds a resource request to the current request context.
|
java.lang.String |
findJSP(javax.servlet.jsp.PageContext pageContext,
java.lang.String name)
A utility method for finding a JSP page.
|
java.lang.String |
findJSP(javax.servlet.jsp.PageContext pageContext,
java.lang.String template,
java.lang.String name)
Attempts to locate a resource under the given template.
|
java.lang.String |
findResource(Context ctx,
java.lang.String template,
java.lang.String name)
Attempts to locate a resource under the given template.
|
static java.lang.String |
getJSLocalizedStrings(Context context)
Extract all i18n strings in the javascript domain.
|
static java.lang.String |
getMarker(Context context,
java.lang.String type)
Returns the include resources marker for a given type.
|
static java.lang.String[] |
getResourceRequests(Context ctx,
java.lang.String type)
Returns resource requests for a particular type.
|
static java.lang.String[] |
getResourceTypes(Context ctx)
Returns all those types that have been requested so far.
|
default java.util.Map<java.lang.String,java.lang.String> |
listLanguages(javax.servlet.jsp.PageContext pageContext)
List all installed i18n language properties by classpath searching for files like :
templates/default_*.properties
templates/default.properties
|
java.util.Set<java.lang.String> |
listSkins(javax.servlet.jsp.PageContext pageContext,
java.lang.String template)
Lists the skins available under this template.
|
java.util.Map<java.lang.String,java.lang.String> |
listTimeFormats(javax.servlet.jsp.PageContext pageContext)
List all available timeformats, read from the jspwiki.properties
|
default java.util.Map<java.lang.String,java.lang.String> |
listTimeZones(javax.servlet.jsp.PageContext pageContext)
List all timezones, with special marker for server timezone
|
boolean |
templateExists(java.lang.String templateName)
Check the existence of a template.
|
checkCompatibility, getModuleInfo, modulesstatic final java.lang.String SKIN_DIRECTORY
static final java.lang.String RESOURCE_JSFUNCTION
static final java.lang.String RESOURCE_JSLOCALIZEDSTRINGS
static final java.lang.String RESOURCE_STYLESHEET
static final java.lang.String RESOURCE_SCRIPT
static final java.lang.String RESOURCE_INLINECSS
static final java.lang.String DIRECTORY
static final java.lang.String DEFAULT_TEMPLATE
static final java.lang.String PROPERTYFILE
static final java.lang.String I18NRESOURCE_PREFIX
static final java.lang.String I18NRESOURCE_SUFFIX
static final java.lang.String I18NRESOURCE_EN
static final java.lang.String I18NRESOURCE_EN_ID
static final java.lang.String I18NDEFAULT_LOCALE
static final java.lang.String I18NSERVER_TIMEZONE
static final java.lang.String TIMEFORMATPROPERTIES
static final java.lang.String RESOURCE_INCLUDES
static final java.lang.String RESOURCE_HTTPHEADER
boolean templateExists(java.lang.String templateName)
java.lang.String findJSP(javax.servlet.jsp.PageContext pageContext, java.lang.String name)
pageContext - the JSP PageContextname - The name of the JSP page to look for (e.g "Wiki.jsp")java.lang.String findJSP(javax.servlet.jsp.PageContext pageContext, java.lang.String template, java.lang.String name)
Even though the name suggests only JSP files can be located, but in fact this method can find also other resources than JSP files.
pageContext - The JSP PageContexttemplate - From which template we should seek initially?name - Which resource are we looking for (e.g. "ViewTemplate.jsp")java.lang.String findResource(Context ctx, java.lang.String template, java.lang.String name)
This method is typically used to locate any resource, including JSP pages, images, scripts, etc.
ctx - the wiki contexttemplate - the name of the template to usename - the name of the resource to finejava.util.Set<java.lang.String> listSkins(javax.servlet.jsp.PageContext pageContext, java.lang.String template)
pageContext - the JSP PageContexttemplate - The template to searchdefault java.util.Map<java.lang.String,java.lang.String> listLanguages(javax.servlet.jsp.PageContext pageContext)
pageContext - page contextjava.util.Map<java.lang.String,java.lang.String> listTimeFormats(javax.servlet.jsp.PageContext pageContext)
pageContext - page contextdefault java.util.Map<java.lang.String,java.lang.String> listTimeZones(javax.servlet.jsp.PageContext pageContext)
pageContext - page contextstatic java.lang.String getMarker(Context context, java.lang.String type)
context - the wiki contexttype - the markerstatic java.lang.String getJSLocalizedStrings(Context context)
context - the Contextstatic void addResourceRequest(Context ctx, java.lang.String type, java.lang.String resource)
The resources can be of different types. For RESOURCE_SCRIPT and RESOURCE_STYLESHEET this is a URI path to the resource (a script file or an external stylesheet) that needs to be included. For RESOURCE_INLINECSS the resource should be something that can be added between <style></style> in the header file (commonheader.jsp). For RESOURCE_JSFUNCTION it is the name of the Javascript function that should be run at page load.
The IncludeResourceTag inserts code in the template files, which is then filled by the WikiFilter after the request has been rendered but not yet sent to the recipient.
Note that ALL resource requests get rendered, so this method does not check if the request already exists in the resources. Therefore, if you have a plugin which makes a new resource request every time, you'll end up with multiple resource requests rendered. It's thus a good idea to make this request only once during the page life cycle.
ctx - The current wiki contexttype - What kind of resource should be added?resource - The resource to add.static java.lang.String[] getResourceRequests(Context ctx, java.lang.String type)
ctx - WikiContexttype - The resource request typestatic java.lang.String[] getResourceTypes(Context ctx)
ctx - the wiki contextCopyright (c) 2001-2022 The Apache Software Foundation. All rights reserved.