Package com.xpn.xwiki.plugin
Class XWikiDefaultPlugin
- java.lang.Object
-
- com.xpn.xwiki.plugin.XWikiDefaultPlugin
-
- All Implemented Interfaces:
XWikiPluginInterface
- Direct Known Subclasses:
FileUploadPlugin,MailPlugin,MonitorPlugin,PackagePlugin,RightsManagerPlugin,SVGPlugin
@Deprecated public class XWikiDefaultPlugin extends Object implements XWikiPluginInterface
Deprecated.the plugin technology is deprecated, consider rewriting as componentsAbstract base plugin implementation.- Version:
- $Id: 7888c502291313347588bc0f32380b8ab9c90ba7 $
-
-
Constructor Summary
Constructors Constructor Description XWikiDefaultPlugin(String name, String className, XWikiContext context)Deprecated.The mandatory plugin constructor, this is the method called (through reflection) by the plugin manager.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidbeginParsing(XWikiContext context)Deprecated.Hook method called at the start of the response generation process, before the parsing of the root template begins.voidbeginRendering(XWikiContext context)Deprecated.Hook method, called before the 1.0 rendering engine starts processing a wiki document, afterXWikiPluginInterface.beginParsing(XWikiContext)and beforeXWikiPluginInterface.commonTagsHandler(String, XWikiContext).StringcommonTagsHandler(String content, XWikiContext context)Deprecated.Hook method called during the 1.0 rendering process, afterXWikiPluginInterface.beginRendering(XWikiContext)and right beforeXWikiPluginInterface.startRenderingHandler(String, XWikiContext).XWikiAttachmentdownloadAttachment(XWikiAttachment attachment, XWikiContext context)Deprecated.Plugin extension point allowing the plugin to perform modifications to an attachment when the user opens a document attachment.StringendParsing(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.voidendRendering(XWikiContext context)Deprecated.Hook method, called after the 1.0 rendering engine finished processing a wiki document.StringendRenderingHandler(String content, XWikiContext context)Deprecated.Hook method called during the 1.0 rendering process, afterXWikiPluginInterface.outsidePREHandler(String, XWikiContext)and right beforeXWikiPluginInterface.endRendering(XWikiContext).voidflushCache()Deprecated.useflushCache(XWikiContext)insteadvoidflushCache(XWikiContext context)Deprecated.A "flush cache" method usually called by the globalXWiki.flushCache(XWikiContext), requesting plugins to clear their cached data.StringgetClassName()Deprecated.usegetName()insteadprotected ContextualLocalizationManagergetLocalization()Deprecated.StringgetName()Deprecated.The name which can be used for accessing this plugin fromXWiki.getPlugin(String, XWikiContext).ApigetPluginApi(XWikiPluginInterface plugin, XWikiContext context)Deprecated.Get a public scriptable API that can be used to call methods of the (privileged) plugin.voidinit(XWikiContext context)Deprecated.Global initialization, called when the platform is started and the plugin list is initialized.StringinsidePREHandler(String line, XWikiContext context)Deprecated.Hook method called during the 1.0 rendering process, once for each line of content insidepreblocks, afterXWikiPluginInterface.startRenderingHandler(String, XWikiContext)and beforeXWikiPluginInterface.endRenderingHandler(String, XWikiContext).protected StringlocalizePlainOrKey(String key, Object... parameters)Deprecated.StringoutsidePREHandler(String line, XWikiContext context)Deprecated.Hook method called during the 1.0 rendering process, once for each line of content outsidepreblocks, afterXWikiPluginInterface.startRenderingHandler(String, XWikiContext)and beforeXWikiPluginInterface.endRenderingHandler(String, XWikiContext).voidsetClassName(String name)Deprecated.most plugins hard code their names, so this doesn't really work, and changing the classname isn't really possiblevoidsetName(String name)Deprecated.most plugins hard code their names, so this doesn't really workStringstartRenderingHandler(String content, XWikiContext context)Deprecated.Hook method called during the 1.0 rendering process, afterXWikiPluginInterface.commonTagsHandler(String, XWikiContext)and beforeXWikiPluginInterface.outsidePREHandler(String, XWikiContext).voidvirtualInit(XWikiContext context)Deprecated.Initialization method called each time a virtual wiki is started, allowing plugins to perform initialization tasks needed in each wiki.
-
-
-
Constructor Detail
-
XWikiDefaultPlugin
public XWikiDefaultPlugin(String name, String className, XWikiContext context)
Deprecated.The mandatory plugin constructor, this is the method called (through reflection) by the plugin manager.- Parameters:
name- the plugin name, usually ignored, since plugins have a fixed nameclassName- the name of this class, ignoredcontext- the current request context
-
-
Method Detail
-
getName
public String getName()
Deprecated.Description copied from interface:XWikiPluginInterfaceThe name which can be used for accessing this plugin fromXWiki.getPlugin(String, XWikiContext).- Specified by:
getNamein interfaceXWikiPluginInterface- Returns:
- the plugin name, usually a lowercase identifier
-
getPluginApi
public Api getPluginApi(XWikiPluginInterface plugin, XWikiContext context)
Deprecated.Description copied from interface:XWikiPluginInterfaceGet a public scriptable API that can be used to call methods of the (privileged) plugin.- Specified by:
getPluginApiin interfaceXWikiPluginInterface- Parameters:
plugin- the plugin instance to wrapcontext- the current request context- Returns:
- an instance of the corresponding API, or
nullif the plugin doesn't want to expose a public API
-
init
public void init(XWikiContext context)
Deprecated.Description copied from interface:XWikiPluginInterfaceGlobal initialization, called when the platform is started and the plugin list is initialized.- Specified by:
initin interfaceXWikiPluginInterface- Parameters:
context- the current context, should not be stored since it will become mostly unreliable once the initial request is terminated
-
virtualInit
public void virtualInit(XWikiContext context)
Deprecated.Description copied from interface:XWikiPluginInterfaceInitialization method called each time a virtual wiki is started, allowing plugins to perform initialization tasks needed in each wiki.- Specified by:
virtualInitin interfaceXWikiPluginInterface- Parameters:
context- the current request context
-
flushCache
public void flushCache(XWikiContext context)
Deprecated.Description copied from interface:XWikiPluginInterfaceA "flush cache" method usually called by the globalXWiki.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.- Specified by:
flushCachein interfaceXWikiPluginInterface- Parameters:
context- the current request context
-
flushCache
@Deprecated public void flushCache()
Deprecated.useflushCache(XWikiContext)insteadOlder equivalent of theflushCache(XWikiContext)method without a context provided.
-
beginParsing
public void beginParsing(XWikiContext context)
Deprecated.Description copied from interface:XWikiPluginInterfaceHook method called at the start of the response generation process, before the parsing of the root template begins. This allows a plugin to initialize its per-request variables, or to modify the (velocity) context. This method is called at most once per request. It is not called at all if the response is not rendered using a velocity template, for example during the PDF export or for AJAX requests that don't send back a rendered response.- Specified by:
beginParsingin interfaceXWikiPluginInterface- Parameters:
context- the current request context- See Also:
the pair method called at the end of the response generation process
-
beginRendering
public void beginRendering(XWikiContext context)
Deprecated.Description copied from interface:XWikiPluginInterfaceHook method, called before the 1.0 rendering engine starts processing a wiki document, afterXWikiPluginInterface.beginParsing(XWikiContext)and beforeXWikiPluginInterface.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.- Specified by:
beginRenderingin interfaceXWikiPluginInterface- Parameters:
context- the current request context- See Also:
the pair method called at the end of the content processing
-
commonTagsHandler
public String commonTagsHandler(String content, XWikiContext context)
Deprecated.Description copied from interface:XWikiPluginInterfaceHook method called during the 1.0 rendering process, afterXWikiPluginInterface.beginRendering(XWikiContext)and right beforeXWikiPluginInterface.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.- Specified by:
commonTagsHandlerin interfaceXWikiPluginInterface- Parameters:
content- the current content being rendered; already processed by Radeox, Velocity and Groovycontext- the current request context- Returns:
- the processed content, must be the same as the input content if no processing is needed
-
startRenderingHandler
public String startRenderingHandler(String content, XWikiContext context)
Deprecated.Description copied from interface:XWikiPluginInterfaceHook method called during the 1.0 rendering process, afterXWikiPluginInterface.commonTagsHandler(String, XWikiContext)and beforeXWikiPluginInterface.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.- Specified by:
startRenderingHandlerin interfaceXWikiPluginInterface- Parameters:
content- the current content being rendered; already processed by Radeox, Velocity and Groovycontext- the current request context- Returns:
- the processed content, must be the same as the input content if no processing is needed
- See Also:
the pair method called after the content is processed,the method called before the content has been processed by the rendering engine
-
outsidePREHandler
public String outsidePREHandler(String line, XWikiContext context)
Deprecated.Description copied from interface:XWikiPluginInterfaceHook method called during the 1.0 rendering process, once for each line of content outsidepreblocks, afterXWikiPluginInterface.startRenderingHandler(String, XWikiContext)and beforeXWikiPluginInterface.endRenderingHandler(String, XWikiContext). The content can be altered before returning.- Specified by:
outsidePREHandlerin interfaceXWikiPluginInterface- Parameters:
line- the current line being rendered; already processed by Radeox, Velocity and Groovycontext- the current request context- Returns:
- the processed line, must be the same as the input content if no processing is needed
- See Also:
the pair method called for content inside blocks
-
insidePREHandler
public String insidePREHandler(String line, XWikiContext context)
Deprecated.Description copied from interface:XWikiPluginInterfaceHook method called during the 1.0 rendering process, once for each line of content insidepreblocks, afterXWikiPluginInterface.startRenderingHandler(String, XWikiContext)and beforeXWikiPluginInterface.endRenderingHandler(String, XWikiContext). The content can be altered before returning.- Specified by:
insidePREHandlerin interfaceXWikiPluginInterface- Parameters:
line- the current line being rendered; already processed by Radeox, Velocity and Groovycontext- the current request context- Returns:
- the processed line, must be the same as the input content if no processing is needed
- See Also:
the pair method called for content outside blocks
-
endRenderingHandler
public String endRenderingHandler(String content, XWikiContext context)
Deprecated.Description copied from interface:XWikiPluginInterfaceHook method called during the 1.0 rendering process, afterXWikiPluginInterface.outsidePREHandler(String, XWikiContext)and right beforeXWikiPluginInterface.endRendering(XWikiContext). The content can be altered before returning, and the returned value is the one coming out of the rendering process.- Specified by:
endRenderingHandlerin interfaceXWikiPluginInterface- Parameters:
content- the current content being rendered; already processed by Radeox, Velocity and Groovycontext- the current request context- Returns:
- the processed content, must be the same as the input content if no processing is needed
- See Also:
the pair method called before the content is processed,the method called after the full rendering process is finished
-
endRendering
public void endRendering(XWikiContext context)
Deprecated.Description copied from interface:XWikiPluginInterfaceHook method, called after the 1.0 rendering engine finished processing a wiki document. This allows a plugin to clean up 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 processed by all of the rendering components and is ready to be included in the response.- Specified by:
endRenderingin interfaceXWikiPluginInterface- Parameters:
context- the current request context- See Also:
allows to also alter the rendering result
-
endParsing
public String endParsing(String content, XWikiContext context)
Deprecated.Description copied from interface:XWikiPluginInterfaceHook method called at the end of the response generation process, after the parsing of the root template is finished. This allows a plugin to clean up its per-request variables, to modify the (velocity) context, or to post-process the response. This method is called at most once per request. It is not called at all if the response is not rendered using a velocity template, for example during the PDF export or for AJAX requests that don't send back a rendered response.- Specified by:
endParsingin interfaceXWikiPluginInterface- Parameters:
content- the full response to send to the clientcontext- the current request context- Returns:
- the post-processed content, must be the same as the input content if no processing is needed
- See Also:
the pair method called at the start of the response generation process
-
downloadAttachment
public XWikiAttachment downloadAttachment(XWikiAttachment attachment, XWikiContext context)
Deprecated.Description copied from interface:XWikiPluginInterfacePlugin extension point allowing the plugin to perform modifications to an attachment when the user opens a document attachment. The plugin is passed the original attachment and it has to return the new modified attachment.- Specified by:
downloadAttachmentin interfaceXWikiPluginInterface- Parameters:
attachment- the original attachmentcontext- the current request context- Returns:
- the modified attachment
-
getLocalization
protected ContextualLocalizationManager getLocalization()
Deprecated.
-
localizePlainOrKey
protected String localizePlainOrKey(String key, Object... parameters)
Deprecated.
-
setName
@Deprecated public void setName(String name)
Deprecated.most plugins hard code their names, so this doesn't really workSet the plugin name. Don't use outside the constructor.- Parameters:
name- the new name of the plugin
-
getClassName
@Deprecated public String getClassName()
Deprecated.usegetName()insteadOld method that doesn't really work. Don't use.- Returns:
- the name of the plugin
-
setClassName
@Deprecated public void setClassName(String name)
Deprecated.most plugins hard code their names, so this doesn't really work, and changing the classname isn't really possibleOld method that doesn't really work. Don't use.- Parameters:
name- the new name of the plugin
-
-