Package org.apache.wiki.api.core
Interface Engine
- 
- All Known Implementing Classes:
- WikiEngine
 
 public interface Engine Provides Wiki services to the JSP page.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 throughWiki.engine().find(..)DSL methods.
- 
- 
Field SummaryFields Modifier and Type Field Description static java.lang.StringDEFAULT_INLINEPATTERNThe default inlining pattern.static java.lang.StringDEFAULT_TEMPLATE_NAMEThe name used for the default template.static java.lang.StringPREFS_COOKIE_NAMEThe name of the cookie that gets stored to the user browser.static java.lang.StringPROP_ACL_MANAGER_IMPLThe name of the property containing the ACLManager implementing class.static java.lang.StringPROP_ALLOW_CREATION_OF_EMPTY_PAGESIf this property is set to false, we don't allow the creation of empty pagesstatic java.lang.StringPROP_APPNAMEProperty for application namestatic java.lang.StringPROP_ENCODINGDefine the used encoding.static java.lang.StringPROP_FRONTPAGEProperty name for the default front page.static java.lang.StringPROP_INLINEIMAGEPTRNThis property defines the inline image pattern.static java.lang.StringPROP_INTERWIKIREFProperty start for any interwiki reference.static java.lang.StringPROP_MATCHPLURALSProperty name for the "match english plurals" -hack.static java.lang.StringPROP_NO_FILTER_ENCODINGDo not use encoding in WikiJSPFilter, default is false for most servers.static java.lang.StringPROP_REF_MANAGER_IMPLThe name of the property containing the ReferenceManager implementing class.static java.lang.StringPROP_SEARCHPATHThe property name defining which packages will be searched for plugin classes.static java.lang.StringPROP_STOREUSERNAMEIf true, then the user name will be stored with the page data.static java.lang.StringPROP_TEMPLATEDIRProperty name for the template that is used.static java.lang.StringPROP_URLCONSTRUCTORProperty name for setting the url generator instancestatic java.lang.StringPROP_WORKDIRProperty name for where the jspwiki work directory should be.
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default <E extends Engine>
 Eadapt(java.lang.Class<E> cls)Adapt Engine to a concrete type.voidaddWikiEventListener(WikiEventListener listener)Registers a WikiEventListener with this instance.java.lang.StringdecodeName(java.lang.String pagerequest)Decodes a URL-encoded request back to regular life.java.lang.StringencodeName(java.lang.String pagename)Turns a WikiName into something that can be called through using an URL.default java.net.URLfindConfigFile(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.StringgetApplicationName()Returns the name of the application.<T> TgetAttribute(java.lang.String key)Gets an attribute from the engine.java.lang.StringgetBaseURL()Returns the base URL, telling where this Wiki actually lives.java.nio.charset.CharsetgetContentEncoding()Returns the IANA name of the character set encoding we're supposed to be using right now.java.lang.StringgetFinalPageName(java.lang.String page)Returns the correct page name, or null, if no such page can be found.java.lang.StringgetFrontPage()Returns the default front page, if no page is used.java.lang.StringgetGlobalRSSURL()Returns the URL of the global RSS file.java.lang.StringgetInterWikiURL(java.lang.String wikiName)Returns an URL to some other Wiki that we know.<T> TgetManager(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.StringgetPluginSearchPath()Returns plugins' search path.java.lang.StringgetRootPath()Returns the root path.javax.servlet.ServletContextgetServletContext()Returns the ServletContext that this particular Engine was initialized with.java.lang.StringgetSpecialPageReference(java.lang.String original)If the page is a special page, then returns a direct URL to that page.java.util.DategetStartTime()Returns the moment when this engine was started.java.lang.StringgetTemplateDir()Returns the current template directory.java.lang.StringgetURL(java.lang.String context, java.lang.String pageName, java.lang.String params)Returns an URL if a WikiContext is not available.java.util.PropertiesgetWikiProperties()Returns the set of properties that the Engine was initialized with.java.lang.StringgetWorkDir()Returns the JSPWiki working directory set with "jspwiki.workDir".voidinitialize(java.util.Properties properties)Sets up the application's runningEngine.booleanisConfigured()check if the Engine has been configured.<T> TremoveAttribute(java.lang.String key)Removes an attribute.voidremoveWikiEventListener(WikiEventListener listener)Un-registers a WikiEventListener with this instance.voidsetAttribute(java.lang.String key, java.lang.Object value)Adds an attribute to the engine for the duration of this engine.voidshutdown()Signals that theEnginewill be shut down by the servlet container.default voidstart(java.util.Properties properties)Initializes theEngine, notifying all theEngineLifecycleExtensions.default voidstop()Shuts down theEngine, notifying all theEngineLifecycleExtensions.
 
- 
- 
- 
Field Detail- 
DEFAULT_INLINEPATTERNstatic final java.lang.String DEFAULT_INLINEPATTERN The default inlining pattern. Currently "*.png"- See Also:
- Constant Field Values
 
 - 
DEFAULT_TEMPLATE_NAMEstatic final java.lang.String DEFAULT_TEMPLATE_NAME The name used for the default template. The value is "default".- See Also:
- Constant Field Values
 
 - 
PROP_APPNAMEstatic final java.lang.String PROP_APPNAME Property for application name- See Also:
- Constant Field Values
 
 - 
PROP_INLINEIMAGEPTRNstatic final java.lang.String PROP_INLINEIMAGEPTRN This property defines the inline image pattern. It's current value is "jspwiki.translatorReader.inlinePattern"- See Also:
- Constant Field Values
 
 - 
PROP_INTERWIKIREFstatic final java.lang.String PROP_INTERWIKIREF Property start for any interwiki reference.- See Also:
- Constant Field Values
 
 - 
PROP_SEARCHPATHstatic final java.lang.String PROP_SEARCHPATH The property name defining which packages will be searched for plugin classes.- See Also:
- Constant Field Values
 
 - 
PROP_STOREUSERNAMEstatic final java.lang.String PROP_STOREUSERNAME If true, then the user name will be stored with the page data.- See Also:
- Constant Field Values
 
 - 
PROP_ENCODINGstatic final java.lang.String PROP_ENCODING Define the used encoding. Currently supported are ISO-8859-1 and UTF-8- See Also:
- Constant Field Values
 
 - 
PROP_NO_FILTER_ENCODINGstatic final java.lang.String PROP_NO_FILTER_ENCODING Do not use encoding in WikiJSPFilter, default is false for most servers. Double negative, cause for most servers you don't need the property- See Also:
- Constant Field Values
 
 - 
PROP_WORKDIRstatic final java.lang.String PROP_WORKDIR Property name for where the jspwiki work directory should be. If not specified, reverts to ${java.tmpdir}.- See Also:
- Constant Field Values
 
 - 
PREFS_COOKIE_NAMEstatic final java.lang.String PREFS_COOKIE_NAME The name of the cookie that gets stored to the user browser.- See Also:
- Constant Field Values
 
 - 
PROP_MATCHPLURALSstatic final java.lang.String PROP_MATCHPLURALS Property name for the "match english plurals" -hack.- See Also:
- Constant Field Values
 
 - 
PROP_TEMPLATEDIRstatic final java.lang.String PROP_TEMPLATEDIR Property name for the template that is used.- See Also:
- Constant Field Values
 
 - 
PROP_FRONTPAGEstatic final java.lang.String PROP_FRONTPAGE Property name for the default front page.- See Also:
- Constant Field Values
 
 - 
PROP_URLCONSTRUCTORstatic final java.lang.String PROP_URLCONSTRUCTOR Property name for setting the url generator instance- See Also:
- Constant Field Values
 
 - 
PROP_ACL_MANAGER_IMPLstatic final java.lang.String PROP_ACL_MANAGER_IMPL The name of the property containing the ACLManager implementing class. The value is "jspwiki.aclManager".- See Also:
- Constant Field Values
 
 - 
PROP_REF_MANAGER_IMPLstatic final java.lang.String PROP_REF_MANAGER_IMPL The name of the property containing the ReferenceManager implementing class. The value is "jspwiki.refManager".- See Also:
- Constant Field Values
 
 - 
PROP_ALLOW_CREATION_OF_EMPTY_PAGESstatic final 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- See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
adaptdefault <E extends Engine> E adapt(java.lang.Class<E> cls) Adapt Engine to a concrete type.- Type Parameters:
- E- type to adapt to.
- Parameters:
- cls- class denoting the type to adapt to.
- Returns:
- engine instance adapted to the requested type. Might throw an unchecked exception if the instance cannot be adapted to requested type!
 
 - 
getManager<T> T getManager(java.lang.Class<T> manager) Retrieves the object instantiated by the Engine matching the requested type.- Type Parameters:
- T- type of the requested object.
- Parameters:
- manager- requested object instantiated by the Engine.
- Returns:
- requested object instantiated by the Engine, nullif not available.
 
 - 
getManagers<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.- Type Parameters:
- T- type of the requested object.
- Parameters:
- manager- requested objectx instantiated by the Engine.
- Returns:
- collection of requested objects instantiated by the Engine, emptylist if none available.
 
 - 
isConfiguredboolean isConfigured() check if the Engine has been configured.- Returns:
- trueif it has,- falseotherwise.
 
 - 
getWikiPropertiesjava.util.Properties getWikiProperties() Returns the set of properties that the Engine was initialized with. Note that this method returns a direct reference, so it's possible to manipulate the properties. However, this is not advised unless you really know what you're doing.- Returns:
- The wiki properties
 
 - 
getWorkDirjava.lang.String getWorkDir() Returns the JSPWiki working directory set with "jspwiki.workDir".- Returns:
- The working directory.
- Since:
- 2.1.100
 
 - 
getTemplateDirjava.lang.String getTemplateDir() Returns the current template directory.- Returns:
- The template directory as initialized by the engine.
- Since:
- 1.9.20
 
 - 
getPluginSearchPathdefault java.lang.String getPluginSearchPath() Returns plugins' search path.- Returns:
- plugins' search path.
 
 - 
getStartTimejava.util.Date getStartTime() Returns the moment when this engine was started.- Returns:
- The start time of this wiki.
- Since:
- 2.0.15.
 
 - 
getBaseURLjava.lang.String getBaseURL() Returns the base URL, telling where this Wiki actually lives.- Returns:
- The Base URL.
- Since:
- 1.6.1
 
 - 
getGlobalRSSURLjava.lang.String getGlobalRSSURL() Returns the URL of the global RSS file. May be null, if the RSS file generation is not operational.- Returns:
- The global RSS url
- Since:
- 1.7.10
 
 - 
getInterWikiURLjava.lang.String getInterWikiURL(java.lang.String wikiName) Returns an URL to some other Wiki that we know.- Parameters:
- wikiName- The name of the other wiki.
- Returns:
- null, if no such reference was found.
 
 - 
getURLjava.lang.String getURL(java.lang.String context, java.lang.String pageName, java.lang.String params) Returns an URL if a WikiContext is not available.- Parameters:
- context- The WikiContext (VIEW, EDIT, etc...)
- pageName- Name of the page, as usual
- params- List of parameters. May be null, if no parameters.
- Returns:
- An URL (absolute or relative).
 
 - 
getFrontPagejava.lang.String getFrontPage() Returns the default front page, if no page is used.- Returns:
- The front page name.
 
 - 
getServletContextjavax.servlet.ServletContext getServletContext() Returns the ServletContext that this particular Engine was initialized with. It may returnnull, if the Engine is not running inside a servlet container!- Returns:
- ServletContext of the Engine, or null.
- Since:
- 1.7.10
 
 - 
findConfigFiledefault java.net.URL findConfigFile(java.lang.String name) Looks up and obtains a configuration file inside the WEB-INF folder of a wiki webapp.- Parameters:
- name- the file to obtain, e.g.,- jspwiki.policy
- Returns:
- the URL to the file
 
 - 
getAllInterWikiLinksjava.util.Collection<java.lang.String> getAllInterWikiLinks() Returns a collection of all supported InterWiki links.- Returns:
- A Collection of Strings.
 
 - 
getAllInlinedImagePatternsjava.util.Collection<java.lang.String> getAllInlinedImagePatterns() Returns a collection of all image types that get inlined.- Returns:
- A Collection of Strings with a regexp pattern.
 
 - 
getSpecialPageReferencejava.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 toCommandResolver.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. - Parameters:
- original- The page to check
- Returns:
- A reference to the page, or null, if there's no special page.
 
 - 
getApplicationNamejava.lang.String getApplicationName() Returns the name of the application.- Returns:
- A string describing the name of this application.
 
 - 
getRootPathjava.lang.String getRootPath() Returns the root path. The root path is where the Engine is located in the file system.- Returns:
- A path to where the Wiki is installed in the local filesystem.
- Since:
- 2.2
 
 - 
getFinalPageNamejava.lang.String getFinalPageName(java.lang.String page) throws ProviderException Returns the correct page name, or null, if no such page can be found. Aliases are considered. This method simply delegates toCommandResolver.getFinalPageName(String).- Parameters:
- page- Page name.
- Returns:
- The rewritten page name, or null, if the page does not exist.
- Throws:
- ProviderException- If something goes wrong in the backend.
- Since:
- 2.0
 
 - 
encodeNamejava.lang.String encodeName(java.lang.String pagename) Turns a WikiName into something that can be called through using an URL.- Parameters:
- pagename- A name. Can be actually any string.
- Returns:
- A properly encoded name.
- Since:
- 1.4.1
- See Also:
- decodeName(String)
 
 - 
decodeNamejava.lang.String decodeName(java.lang.String pagerequest) Decodes a URL-encoded request back to regular life. This properly heeds the encoding as defined in the settings file.- Parameters:
- pagerequest- The URL-encoded string to decode
- Returns:
- A decoded string.
- See Also:
- encodeName(String)
 
 - 
getContentEncodingjava.nio.charset.Charset getContentEncoding() Returns the IANA name of the character set encoding we're supposed to be using right now.- Returns:
- The content encoding (either UTF-8 or ISO-8859-1).
- Since:
- 1.5.3
 
 - 
addWikiEventListenervoid addWikiEventListener(WikiEventListener listener) Registers a WikiEventListener with this instance.- Parameters:
- listener- the event listener
 
 - 
removeWikiEventListenervoid removeWikiEventListener(WikiEventListener listener) Un-registers a WikiEventListener with this instance.- Parameters:
- listener- the event listener
 
 - 
setAttributevoid setAttribute(java.lang.String key, java.lang.Object value) Adds an attribute to the engine for the duration of this engine. The value is not persisted.- Parameters:
- key- the attribute name
- value- the value
- Since:
- 2.4.91
 
 - 
getAttribute<T> T getAttribute(java.lang.String key) Gets an attribute from the engine.- Parameters:
- key- the attribute name
- Returns:
- the value
 
 - 
removeAttribute<T> T removeAttribute(java.lang.String key) Removes an attribute.- Parameters:
- key- The key of the attribute to remove.
- Returns:
- The previous attribute, if it existed.
 
 - 
startdefault void start(java.util.Properties properties) throws WikiException Initializes theEngine, notifying all theEngineLifecycleExtensions.- Parameters:
- properties- Wiki configuration properties.
- Throws:
- WikiException- if something happens while setting up the- Engine.
 
 - 
stopdefault void stop() Shuts down theEngine, notifying all theEngineLifecycleExtensions.
 - 
initializevoid initialize(java.util.Properties properties) throws WikiException Sets up the application's runningEngine.- Parameters:
- properties- Wiki configuration properties.
- Throws:
- WikiException- if something happens while setting up the- Engine.
 
 - 
shutdownvoid shutdown() Signals that theEnginewill be shut down by the servlet container.
 
- 
 
-