public class WikiEngine extends java.lang.Object implements Engine
Engine.
Using this class: Always get yourself an instance from JSP page by using the WikiEngine.getInstance(..) method. Never create
a new WikiEngine() from scratch, unless you're writing tests.
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Map<java.lang.Class<?>,java.lang.Object> |
managers
Stores WikiEngine's associated managers.
|
DEFAULT_INLINEPATTERN, DEFAULT_TEMPLATE_NAME, PREFS_COOKIE_NAME, PROP_ACL_MANAGER_IMPL, PROP_ALLOW_CREATION_OF_EMPTY_PAGES, PROP_APPNAME, PROP_ENCODING, PROP_FRONTPAGE, PROP_INLINEIMAGEPTRN, PROP_INTERWIKIREF, PROP_MATCHPLURALS, PROP_NO_FILTER_ENCODING, PROP_SEARCHPATH, PROP_STOREUSERNAME, PROP_TEMPLATEDIR, PROP_URLCONSTRUCTOR, PROP_WORKDIR| Modifier | Constructor and Description |
|---|---|
|
WikiEngine(java.util.Properties properties)
Instantiate the WikiEngine using a given set of properties.
|
protected |
WikiEngine(javax.servlet.ServletContext context,
java.lang.String appid)
Instantiate using this method when you're running as a servlet and WikiEngine will figure out where to look for the property file.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addWikiEventListener(WikiEventListener listener) |
java.lang.String |
decodeName(java.lang.String pagerequest) |
java.lang.String |
encodeName(java.lang.String pagename) |
protected void |
fireEvent(int type)
Fires a WikiEngineEvent to all registered listeners.
|
protected void |
firePageEvent(int type,
java.lang.String pageName)
Fires a WikiPageEvent to all registered listeners.
|
AclManager |
getAclManager()
Deprecated.
use
getManager( AclManager.class ) instead. |
AdminBeanManager |
getAdminBeanManager()
Deprecated.
use
getManager( AdminBeanManager.class ) instead. |
java.util.Collection<java.lang.String> |
getAllInlinedImagePatterns() |
java.util.Collection<java.lang.String> |
getAllInterWikiLinks() |
java.lang.String |
getApplicationName() |
AttachmentManager |
getAttachmentManager()
Deprecated.
use
getManager( AttachmentManager.class ) instead. |
<T> T |
getAttribute(java.lang.String key) |
AuthenticationManager |
getAuthenticationManager()
Deprecated.
use
getManager( AuthenticationManager.class ) instead. |
AuthorizationManager |
getAuthorizationManager()
Deprecated.
use
getManager( AuthorizationManager.class ) instead. |
java.lang.String |
getBaseURL() |
CommandResolver |
getCommandResolver()
Deprecated.
use
getManager( CommandResolver.class ) instead. |
java.nio.charset.Charset |
getContentEncoding() |
DifferenceManager |
getDifferenceManager()
Deprecated.
use
getManager( DifferenceManager.class ) instead. |
EditorManager |
getEditorManager()
Deprecated.
use
getManager( EditorManager.class ) instead. |
FilterManager |
getFilterManager()
Deprecated.
use
getManager( FilterManager.class ) instead. |
java.lang.String |
getFinalPageName(java.lang.String page) |
java.lang.String |
getFrontPage() |
java.lang.String |
getGlobalRSSURL() |
GroupManager |
getGroupManager()
Deprecated.
use
getManager( GroupManager.class ) instead. |
static WikiEngine |
getInstance(javax.servlet.ServletConfig config)
Gets a WikiEngine related to this servlet.
|
static WikiEngine |
getInstance(javax.servlet.ServletConfig config,
java.util.Properties props)
Gets a WikiEngine related to the servlet.
|
static WikiEngine |
getInstance(javax.servlet.ServletContext context,
java.util.Properties props)
Gets a WikiEngine related to the servlet.
|
InternationalizationManager |
getInternationalizationManager()
Deprecated.
use
getManager( InternationalizationManager.class ) instead. |
java.lang.String |
getInterWikiURL(java.lang.String wikiName) |
<T> T |
getManager(java.lang.Class<T> manager) |
<T> java.util.List<T> |
getManagers(java.lang.Class<T> manager) |
PageManager |
getPageManager()
Deprecated.
use
getManager( PageManager.class ) instead. |
PageRenamer |
getPageRenamer()
Deprecated.
use
getManager( PageRenamer.class ) instead. |
PluginManager |
getPluginManager()
Deprecated.
use
getManager( PluginManager.class ) instead. |
ProgressManager |
getProgressManager()
Deprecated.
use
getManager( ProgressManager.class ) instead. |
ReferenceManager |
getReferenceManager()
Deprecated.
use
getManager( ReferenceManager.class ) instead. |
RenderingManager |
getRenderingManager()
Deprecated.
use
getManager( RenderingManager.class ) instead. |
java.lang.String |
getRootPath() |
RSSGenerator |
getRSSGenerator()
Deprecated.
use
getManager( RSSGenerator.class ) instead. |
SearchManager |
getSearchManager()
Deprecated.
use
getManager( SearchManager.class ) instead. |
javax.servlet.ServletContext |
getServletContext() |
java.lang.String |
getSpecialPageReference(java.lang.String original) |
java.util.Date |
getStartTime() |
TasksManager |
getTasksManager()
Deprecated.
use
getManager( TaskManager.class ) instead. |
java.lang.String |
getTemplateDir() |
TemplateManager |
getTemplateManager()
Deprecated.
use
getManager( TemplateManager.class ) instead. |
java.lang.String |
getURL(java.lang.String context,
java.lang.String pageName,
java.lang.String params) |
URLConstructor |
getURLConstructor()
Deprecated.
use
getManager( URLConstructor.class ) instead. |
UserManager |
getUserManager()
Deprecated.
use
getManager( UserManager.class ) instead. |
VariableManager |
getVariableManager()
Deprecated.
use
getManager( VariableManager.class ) instead. |
java.util.Properties |
getWikiProperties() |
java.lang.String |
getWorkDir() |
WorkflowManager |
getWorkflowManager()
Deprecated.
use
getManager( WorkflowManager.class ) instead. |
void |
initialize(java.util.Properties props)
Does all the real initialization.
|
void |
initReferenceManager()
Initializes the reference manager.
|
boolean |
isConfigured() |
<T> T |
removeAttribute(java.lang.String key) |
void |
removeWikiEventListener(WikiEventListener listener) |
void |
setAttribute(java.lang.String key,
java.lang.Object value) |
void |
shutdown()
It is called by
WikiServlet.destroy(). |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitadapt, findConfigFile, getPluginSearchPath, start, stopprotected final java.util.Map<java.lang.Class<?>,java.lang.Object> managers
public WikiEngine(java.util.Properties properties) throws WikiException
properties - A set of properties to use to initialize this WikiEngine.WikiException - If the initialization fails.protected WikiEngine(javax.servlet.ServletContext context, java.lang.String appid) throws WikiException
context - A ServletContext.appid - An Application ID. This application is a unique random string which is used to recognize this WikiEngine.WikiException - If the WikiEngine construction fails.public static WikiEngine getInstance(javax.servlet.ServletConfig config) throws InternalWikiException
config - The ServletConfig object for this servlet.InternalWikiException - in case something fails. This is a RuntimeException, so be prepared for it.public static WikiEngine getInstance(javax.servlet.ServletConfig config, java.util.Properties props)
config - The ServletConfig of the webapp servlet/JSP calling this method.props - A set of properties, or null, if we are to load JSPWiki's default jspwiki.properties (this is the usual case).public static WikiEngine getInstance(javax.servlet.ServletContext context, java.util.Properties props) throws InternalWikiException
context - The ServletContext of the webapp servlet/JSP calling this method.props - A set of properties, or null, if we are to load JSPWiki's default jspwiki.properties (this is the usual case).InternalWikiException - If the WikiEngine instantiation fails.public void initialize(java.util.Properties props) throws WikiException
initialize in interface EngineWikiExceptionpublic <T> T getManager(java.lang.Class<T> manager)
getManager in interface Enginepublic <T> java.util.List<T> getManagers(java.lang.Class<T> manager)
getManagers in interface Enginepublic boolean isConfigured()
isConfigured in interface Enginepublic void initReferenceManager() throws WikiException
WikiException - If the reference manager initialization fails.public java.util.Properties getWikiProperties()
getWikiProperties in interface Enginepublic java.lang.String getWorkDir()
getWorkDir in interface Enginepublic java.lang.String getTemplateDir()
getTemplateDir in interface Enginepublic java.util.Date getStartTime()
getStartTime in interface Enginepublic java.lang.String getBaseURL()
getBaseURL in interface Enginepublic java.lang.String getGlobalRSSURL()
getGlobalRSSURL in interface Enginepublic java.lang.String getInterWikiURL(java.lang.String wikiName)
getInterWikiURL in interface Enginepublic java.lang.String getURL(java.lang.String context, java.lang.String pageName, java.lang.String params)
public java.lang.String getFrontPage()
getFrontPage in interface Enginepublic javax.servlet.ServletContext getServletContext()
getServletContext in interface Enginepublic java.util.Collection<java.lang.String> getAllInterWikiLinks()
getAllInterWikiLinks in interface Enginepublic java.util.Collection<java.lang.String> getAllInlinedImagePatterns()
getAllInlinedImagePatterns in interface Enginepublic java.lang.String getSpecialPageReference(java.lang.String original)
getSpecialPageReference in interface Enginepublic java.lang.String getApplicationName()
getApplicationName in interface Enginepublic java.lang.String getFinalPageName(java.lang.String page) throws ProviderException
getFinalPageName in interface EngineProviderExceptionpublic java.lang.String encodeName(java.lang.String pagename)
encodeName in interface Enginepublic java.lang.String decodeName(java.lang.String pagerequest)
decodeName in interface Enginepublic java.nio.charset.Charset getContentEncoding()
getContentEncoding in interface Enginepublic void shutdown()
It is called by WikiServlet.destroy(). When this method is called, it fires a "shutdown" WikiEngineEvent to
all registered listeners.
@Deprecated public TemplateManager getTemplateManager()
getManager( TemplateManager.class ) instead.@Deprecated public WorkflowManager getWorkflowManager()
getManager( WorkflowManager.class ) instead.WorkflowManager associated with this WikiEngine. If the WikiEngine has not been
initialized, this method will return null.@Deprecated public ReferenceManager getReferenceManager()
getManager( ReferenceManager.class ) instead.@Deprecated public RenderingManager getRenderingManager()
getManager( RenderingManager.class ) instead.@Deprecated public PluginManager getPluginManager()
getManager( PluginManager.class ) instead.@Deprecated public VariableManager getVariableManager()
getManager( VariableManager.class ) instead.@Deprecated public PageManager getPageManager()
getManager( PageManager.class ) instead.@Deprecated public CommandResolver getCommandResolver()
getManager( CommandResolver.class ) instead.@Deprecated public AttachmentManager getAttachmentManager()
getManager( AttachmentManager.class ) instead.@Deprecated public AuthorizationManager getAuthorizationManager()
getManager( AuthorizationManager.class ) instead.@Deprecated public AuthenticationManager getAuthenticationManager()
getManager( AuthenticationManager.class ) instead.@Deprecated public FilterManager getFilterManager()
getManager( FilterManager.class ) instead.@Deprecated public SearchManager getSearchManager()
getManager( SearchManager.class ) instead.@Deprecated public ProgressManager getProgressManager()
getManager( ProgressManager.class ) instead.public java.lang.String getRootPath()
getRootPath in interface Engine@Deprecated public URLConstructor getURLConstructor()
getManager( URLConstructor.class ) instead.@Deprecated public RSSGenerator getRSSGenerator()
getManager( RSSGenerator.class ) instead.jspwiki.rss.generate has not been set to true, this method
will return null, and callers should check for this value.@Deprecated public PageRenamer getPageRenamer()
getManager( PageRenamer.class ) instead.@Deprecated public UserManager getUserManager()
getManager( UserManager.class ) instead.@Deprecated public TasksManager getTasksManager()
getManager( TaskManager.class ) instead.@Deprecated public GroupManager getGroupManager()
getManager( GroupManager.class ) instead.@Deprecated public AdminBeanManager getAdminBeanManager()
getManager( AdminBeanManager.class ) instead.AdminBeanManager.AdminBeanManager.@Deprecated public AclManager getAclManager()
getManager( AclManager.class ) instead.
The AclManager implementing class may be set by the System property Engine.PROP_ACL_MANAGER_IMPL.
@Deprecated public DifferenceManager getDifferenceManager()
getManager( DifferenceManager.class ) instead.@Deprecated public EditorManager getEditorManager()
getManager( EditorManager.class ) instead.@Deprecated public InternationalizationManager getInternationalizationManager()
getManager( InternationalizationManager.class ) instead.public final void addWikiEventListener(WikiEventListener listener)
addWikiEventListener in interface Enginepublic final void removeWikiEventListener(WikiEventListener listener)
removeWikiEventListener in interface Engineprotected final void fireEvent(int type)
type - the event typeprotected final void firePageEvent(int type, java.lang.String pageName)
type - the event typepublic void setAttribute(java.lang.String key, java.lang.Object value)
setAttribute in interface Enginepublic <T> T getAttribute(java.lang.String key)
getAttribute in interface Enginepublic <T> T removeAttribute(java.lang.String key)
removeAttribute in interface EngineCopyright (c) 2001-2022 The Apache Software Foundation. All rights reserved.