public interface Engine
This is the main interface through which everything should go.
There's basically only a single Engine for each web application, and you should always get it using either the
Context#getEngine() method or through Wiki.engine().find(..) DSL methods.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEFAULT_INLINEPATTERN
The default inlining pattern.
|
static java.lang.String |
DEFAULT_TEMPLATE_NAME
The name used for the default template.
|
static java.lang.String |
PREFS_COOKIE_NAME
The name of the cookie that gets stored to the user browser.
|
static java.lang.String |
PROP_ACL_MANAGER_IMPL
The name of the property containing the ACLManager implementing class.
|
static java.lang.String |
PROP_ALLOW_CREATION_OF_EMPTY_PAGES
If this property is set to false, we don't allow the creation of empty pages
|
static java.lang.String |
PROP_APPNAME
Property for application name
|
static java.lang.String |
PROP_ENCODING
Define the used encoding.
|
static java.lang.String |
PROP_FRONTPAGE
Property name for the default front page.
|
static java.lang.String |
PROP_INLINEIMAGEPTRN
This property defines the inline image pattern.
|
static java.lang.String |
PROP_INTERWIKIREF
Property start for any interwiki reference.
|
static java.lang.String |
PROP_MATCHPLURALS
Property name for the "match english plurals" -hack.
|
static java.lang.String |
PROP_NO_FILTER_ENCODING
Do not use encoding in WikiJSPFilter, default is false for most servers.
|
static java.lang.String |
PROP_SEARCHPATH
The property name defining which packages will be searched for plugin classes.
|
static java.lang.String |
PROP_STOREUSERNAME
If true, then the user name will be stored with the page data.
|
static java.lang.String |
PROP_TEMPLATEDIR
Property name for the template that is used.
|
static java.lang.String |
PROP_URLCONSTRUCTOR
Property name for setting the url generator instance
|
static java.lang.String |
PROP_WORKDIR
Property name for where the jspwiki work directory should be.
|
| Modifier and Type | Method and Description |
|---|---|
default <E extends Engine> |
adapt(java.lang.Class<E> cls)
Adapt Engine to a concrete type.
|
void |
addWikiEventListener(WikiEventListener listener)
Registers a WikiEventListener with this instance.
|
java.lang.String |
decodeName(java.lang.String pagerequest)
Decodes a URL-encoded request back to regular life.
|
java.lang.String |
encodeName(java.lang.String pagename)
Turns a WikiName into something that can be called through using an URL.
|
default java.net.URL |
findConfigFile(java.lang.String name)
Looks up and obtains a configuration file inside the WEB-INF folder of a wiki webapp.
|
java.util.Collection<java.lang.String> |
getAllInlinedImagePatterns()
Returns a collection of all image types that get inlined.
|
java.util.Collection<java.lang.String> |
getAllInterWikiLinks()
Returns a collection of all supported InterWiki links.
|
java.lang.String |
getApplicationName()
Returns the name of the application.
|
<T> T |
getAttribute(java.lang.String key)
Gets an attribute from the engine.
|
java.lang.String |
getBaseURL()
Returns the base URL, telling where this Wiki actually lives.
|
java.nio.charset.Charset |
getContentEncoding()
Returns the IANA name of the character set encoding we're supposed to be using right now.
|
java.lang.String |
getFinalPageName(java.lang.String page)
Returns the correct page name, or null, if no such page can be found.
|
java.lang.String |
getFrontPage()
Returns the default front page, if no page is used.
|
java.lang.String |
getGlobalRSSURL()
Returns the URL of the global RSS file.
|
java.lang.String |
getInterWikiURL(java.lang.String wikiName)
Returns an URL to some other Wiki that we know.
|
<T> T |
getManager(java.lang.Class<T> manager)
Retrieves the object instantiated by the Engine matching the requested type.
|
<T> java.util.List<T> |
getManagers(java.lang.Class<T> manager)
Retrieves the objects instantiated by the Engine that can be assigned to the requested type.
|
default java.lang.String |
getPluginSearchPath()
Returns plugins' search path.
|
java.lang.String |
getRootPath()
Returns the root path.
|
javax.servlet.ServletContext |
getServletContext()
Returns the ServletContext that this particular Engine was initialized with.
|
java.lang.String |
getSpecialPageReference(java.lang.String original)
If the page is a special page, then returns a direct URL to that page.
|
java.util.Date |
getStartTime()
Returns the moment when this engine was started.
|
java.lang.String |
getTemplateDir()
Returns the current template directory.
|
java.lang.String |
getURL(java.lang.String context,
java.lang.String pageName,
java.lang.String params)
Returns an URL if a WikiContext is not available.
|
java.util.Properties |
getWikiProperties()
Returns the set of properties that the Engine was initialized with.
|
java.lang.String |
getWorkDir()
Returns the JSPWiki working directory set with "jspwiki.workDir".
|
boolean |
isConfigured()
check if the Engine has been configured.
|
<T> T |
removeAttribute(java.lang.String key)
Removes an attribute.
|
void |
removeWikiEventListener(WikiEventListener listener)
Un-registers a WikiEventListener with this instance.
|
void |
setAttribute(java.lang.String key,
java.lang.Object value)
Adds an attribute to the engine for the duration of this engine.
|
void |
shutdown()
Signals that the Engine will be shut down by the servlet container.
|
static final java.lang.String DEFAULT_INLINEPATTERN
static final java.lang.String DEFAULT_TEMPLATE_NAME
static final java.lang.String PROP_APPNAME
static final java.lang.String PROP_INLINEIMAGEPTRN
static final java.lang.String PROP_INTERWIKIREF
static final java.lang.String PROP_SEARCHPATH
static final java.lang.String PROP_STOREUSERNAME
static final java.lang.String PROP_ENCODING
static final java.lang.String PROP_NO_FILTER_ENCODING
static final java.lang.String PROP_WORKDIR
static final java.lang.String PREFS_COOKIE_NAME
static final java.lang.String PROP_MATCHPLURALS
static final java.lang.String PROP_TEMPLATEDIR
static final java.lang.String PROP_FRONTPAGE
static final java.lang.String PROP_URLCONSTRUCTOR
static final java.lang.String PROP_ACL_MANAGER_IMPL
static final java.lang.String PROP_ALLOW_CREATION_OF_EMPTY_PAGES
default <E extends Engine> E adapt(java.lang.Class<E> cls)
E - type to adapt to.cls - class denoting the type to adapt to.<T> T getManager(java.lang.Class<T> manager)
T - type of the requested object.manager - requested object instantiated by the Engine.null if not available.<T> java.util.List<T> getManagers(java.lang.Class<T> manager)
T - type of the requested object.manager - requested objectx instantiated by the Engine.empty list if none available.boolean isConfigured()
true if it has, false otherwise.java.util.Properties getWikiProperties()
java.lang.String getWorkDir()
java.lang.String getTemplateDir()
default java.lang.String getPluginSearchPath()
java.util.Date getStartTime()
java.lang.String getBaseURL()
java.lang.String getGlobalRSSURL()
java.lang.String getInterWikiURL(java.lang.String wikiName)
wikiName - The name of the other wiki.java.lang.String getURL(java.lang.String context, java.lang.String pageName, java.lang.String params)
context - The WikiContext (VIEW, EDIT, etc...)pageName - Name of the page, as usualparams - List of parameters. May be null, if no parameters.java.lang.String getFrontPage()
javax.servlet.ServletContext getServletContext()
null,
if the Engine is not running inside a servlet container!null.default java.net.URL findConfigFile(java.lang.String name)
name - the file to obtain, e.g., jspwiki.policyjava.util.Collection<java.lang.String> getAllInterWikiLinks()
java.util.Collection<java.lang.String> getAllInlinedImagePatterns()
java.lang.String getSpecialPageReference(java.lang.String original)
If the page is a special page, then returns a direct URL to that page. Otherwise returns null.
This method delegates requests to org.apache.wiki.ui.CommandResolver#getSpecialPageReference(String).
Special pages are defined in jspwiki.properties using the jspwiki.specialPage setting. They're typically used to give Wiki page names to e.g. custom JSP pages.
original - The page to checkjava.lang.String getApplicationName()
java.lang.String getRootPath()
java.lang.String getFinalPageName(java.lang.String page) throws ProviderException
org.apache.wiki.ui.CommandResolver#getFinalPageName(String).page - Page name.ProviderException - If something goes wrong in the backend.java.lang.String encodeName(java.lang.String pagename)
pagename - A name. Can be actually any string.decodeName(String)java.lang.String decodeName(java.lang.String pagerequest)
pagerequest - The URL-encoded string to decodeencodeName(String)java.nio.charset.Charset getContentEncoding()
void addWikiEventListener(WikiEventListener listener)
listener - the event listenervoid removeWikiEventListener(WikiEventListener listener)
listener - the event listenervoid setAttribute(java.lang.String key, java.lang.Object value)
key - the attribute namevalue - the value<T> T getAttribute(java.lang.String key)
key - the attribute name<T> T removeAttribute(java.lang.String key)
key - The key of the attribute to remove.void shutdown()
Copyright (c) 2001-2022 The Apache Software Foundation. All rights reserved.