@Deprecated public interface XWikiPluginInterface
PluginApi
wrapper; this can now be achieved using components for use inside Java, or using
ScriptService
components for public scriptable APIsendParsing(String, XWikiContext)
or downloadAttachment(XWikiAttachment, XWikiContext)
; this
can now be achieved using rendering transformations
for
changing the rendering result, or event listeners
for doing custom
actions when different events occurevent listeners
that wait for
application events
or
wiki events
In order for a plugin to be active, it must be registered in xwiki.cfg
.
Public scriptable APIs are implemented in a custom PluginApi
wrapper, which is instantiated by calling the
getPluginApi(XWikiPluginInterface, XWikiContext)
method. If a plugin doesn't need a scriptable API, it
should return null
instead.
The methods of a specific plugin are called only if the actual class implements that method, so inherited methods are never called. If a plugin wants to provide an implementation for one of the hook methods, it must provide an implementation for it, even if that implementation only calls a parent method.
Modifier and Type | Method and Description |
---|---|
void |
beginParsing(XWikiContext context)
Deprecated.
Hook method called at the start of the response generation process, before the parsing of the root template
begins.
|
void |
beginRendering(XWikiContext context)
Deprecated.
Hook method, called before the 1.0 rendering engine starts processing a wiki document, after
beginParsing(XWikiContext) and before commonTagsHandler(String, XWikiContext) . |
String |
commonTagsHandler(String content,
XWikiContext context)
Deprecated.
Hook method called during the 1.0 rendering process, after
beginRendering(XWikiContext) and right before
startRenderingHandler(String, XWikiContext) . |
XWikiAttachment |
downloadAttachment(XWikiAttachment attachment,
XWikiContext context)
Deprecated.
Plugin extension point allowing the plugin to perform modifications to an attachment when the user opens a
document attachment.
|
String |
endParsing(String content,
XWikiContext context)
Deprecated.
Hook method called at the end of the response generation process, after the parsing of the root template is
finished.
|
void |
endRendering(XWikiContext context)
Deprecated.
Hook method, called after the 1.0 rendering engine finished processing a wiki document.
|
String |
endRenderingHandler(String content,
XWikiContext context)
Deprecated.
Hook method called during the 1.0 rendering process, after
outsidePREHandler(String, XWikiContext) and
right before endRendering(XWikiContext) . |
void |
flushCache(XWikiContext context)
Deprecated.
A "flush cache" method usually called by the global
XWiki.flushCache(XWikiContext) ,
requesting plugins to clear their cached data. |
String |
getName()
Deprecated.
The name which can be used for accessing this plugin from
XWiki.getPlugin(String, XWikiContext) . |
Api |
getPluginApi(XWikiPluginInterface plugin,
XWikiContext context)
Deprecated.
Get a public scriptable API that can be used to call methods of the (privileged) plugin.
|
void |
init(XWikiContext context)
Deprecated.
Global initialization, called when the platform is started and the plugin list is initialized.
|
String |
insidePREHandler(String line,
XWikiContext context)
Deprecated.
Hook method called during the 1.0 rendering process, once for each line of content inside
pre blocks,
after startRenderingHandler(String, XWikiContext) and before
endRenderingHandler(String, XWikiContext) . |
String |
outsidePREHandler(String line,
XWikiContext context)
Deprecated.
Hook method called during the 1.0 rendering process, once for each line of content outside
pre blocks,
after startRenderingHandler(String, XWikiContext) and before
endRenderingHandler(String, XWikiContext) . |
String |
startRenderingHandler(String content,
XWikiContext context)
Deprecated.
Hook method called during the 1.0 rendering process, after
commonTagsHandler(String, XWikiContext) and
before outsidePREHandler(String, XWikiContext) . |
void |
virtualInit(XWikiContext context)
Deprecated.
Initialization method called each time a virtual wiki is started, allowing plugins to perform initialization
tasks needed in each wiki.
|
String getName()
XWiki.getPlugin(String, XWikiContext)
.Api getPluginApi(XWikiPluginInterface plugin, XWikiContext context)
plugin
- the plugin instance to wrapcontext
- the current request contextnull
if the plugin doesn't want to expose a public APIvoid init(XWikiContext context) throws XWikiException
context
- the current context, should not be stored since it will become mostly unreliable once the initial
request is terminatedXWikiException
- if the plugin fails to initializevoid virtualInit(XWikiContext context)
context
- the current request contextvoid flushCache(XWikiContext context)
XWiki.flushCache(XWikiContext)
,
requesting plugins to clear their cached data. When this method is called, plugins should discard all the
information they hold from the wiki and re-read it if needed.context
- the current request contextvoid beginParsing(XWikiContext context)
context
- the current request contextthe pair method called at the end of the response generation process
void beginRendering(XWikiContext context)
beginParsing(XWikiContext)
and before commonTagsHandler(String, XWikiContext)
. This allows a
plugin to initialize its per-rendering variables, or to modify the (velocity) context. This method can be called
multiple times per request, once for each time the 1.0 rendering engine is invoked. At this point the content is
not yet processed by any of the rendering components.context
- the current request contextthe pair method called at the end of the content processing
String commonTagsHandler(String content, XWikiContext context)
beginRendering(XWikiContext)
and right before
startRenderingHandler(String, XWikiContext)
. At this point the content has already been processed by all
of the important rendering components (Velocity, Radeox, Groovy). The content can be altered before returning,
and the rendering process will continue on the returned value.content
- the current content being rendered; already processed by Radeox, Velocity and Groovycontext
- the current request contextString startRenderingHandler(String content, XWikiContext context)
commonTagsHandler(String, XWikiContext)
and
before outsidePREHandler(String, XWikiContext)
. The content can be altered before returning. This method
should be avoided, since the place where the hook is used isn't actually reliable, since at this point the
rendering process is almost done.content
- the current content being rendered; already processed by Radeox, Velocity and Groovycontext
- the current request contextthe pair method called after the content is processed
,
the method called before the content has been processed by the rendering
engine
String outsidePREHandler(String line, XWikiContext context)
pre
blocks,
after startRenderingHandler(String, XWikiContext)
and before
endRenderingHandler(String, XWikiContext)
. The content can be altered before returning.line
- the current line being rendered; already processed by Radeox, Velocity and Groovycontext
- the current request contextthe pair method called for content inside {@code pre} blocks
String insidePREHandler(String line, XWikiContext context)
pre
blocks,
after startRenderingHandler(String, XWikiContext)
and before
endRenderingHandler(String, XWikiContext)
. The content can be altered before returning.line
- the current line being rendered; already processed by Radeox, Velocity and Groovycontext
- the current request contextthe pair method called for content outside {@code pre} blocks
String endRenderingHandler(String content, XWikiContext context)
outsidePREHandler(String, XWikiContext)
and
right before endRendering(XWikiContext)
. The content can be altered before returning, and the returned
value is the one coming out of the rendering process.content
- the current content being rendered; already processed by Radeox, Velocity and Groovycontext
- the current request contextthe pair method called before the content is processed
,
the method called after the full rendering process is finished
void endRendering(XWikiContext context)
context
- the current request contextallows to also alter the rendering result
String endParsing(String content, XWikiContext context)
content
- the full response to send to the clientcontext
- the current request contextthe pair method called at the start of the response generation process
XWikiAttachment downloadAttachment(XWikiAttachment attachment, XWikiContext context)
attachment
- the original attachmentcontext
- the current request contextCopyright © 2004–2022 XWiki. All rights reserved.