@Deprecated public class ImagePlugin extends XWikiDefaultPlugin
Constructor and Description |
---|
ImagePlugin(String name,
String className,
XWikiContext context)
Deprecated.
Creates a new instance of this plugin.
|
Modifier and Type | Method and Description |
---|---|
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.
|
void |
flushCache()
Deprecated.
Older equivalent of the
XWikiDefaultPlugin.flushCache(XWikiContext) method without a context provided. |
int |
getHeight(XWikiAttachment attachment,
XWikiContext context)
Deprecated.
|
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.
|
int |
getWidth(XWikiAttachment attachment,
XWikiContext context)
Deprecated.
|
void |
init(XWikiContext context)
Deprecated.
Global initialization, called when the platform is started and the plugin list is initialized.
|
beginParsing, beginRendering, commonTagsHandler, endParsing, endRendering, endRenderingHandler, flushCache, getClassName, getLocalization, insidePREHandler, localizePlainOrKey, outsidePREHandler, setClassName, setName, startRenderingHandler, virtualInit
public ImagePlugin(String name, String className, XWikiContext context)
name
- the name of the pluginclassName
- the class namecontext
- the XWiki contextXWikiDefaultPlugin.XWikiDefaultPlugin(String,String,com.xpn.xwiki.XWikiContext)
public Api getPluginApi(XWikiPluginInterface plugin, XWikiContext context)
XWikiPluginInterface
getPluginApi
in interface XWikiPluginInterface
getPluginApi
in class XWikiDefaultPlugin
plugin
- the plugin instance to wrapcontext
- the current request contextnull
if the plugin doesn't want to expose a public APIpublic String getName()
XWikiPluginInterface
XWiki.getPlugin(String, XWikiContext)
.getName
in interface XWikiPluginInterface
getName
in class XWikiDefaultPlugin
public void init(XWikiContext context)
XWikiPluginInterface
init
in interface XWikiPluginInterface
init
in class XWikiDefaultPlugin
context
- the current context, should not be stored since it will become mostly unreliable once the initial
request is terminatedpublic void flushCache()
XWikiDefaultPlugin
XWikiDefaultPlugin.flushCache(XWikiContext)
method without a context provided.flushCache
in class XWikiDefaultPlugin
public XWikiAttachment downloadAttachment(XWikiAttachment attachment, XWikiContext context)
Allows to scale images server-side, in order to have real thumbnails for reduced traffic. The new image
dimensions are passed in the request as the width
and height
parameters. If only one of the
dimensions is specified, then the other one is computed to preserve the original aspect ratio of the image.
downloadAttachment
in interface XWikiPluginInterface
downloadAttachment
in class XWikiDefaultPlugin
attachment
- the original attachmentcontext
- the current request contextXWikiDefaultPlugin.downloadAttachment(XWikiAttachment, XWikiContext)
public int getWidth(XWikiAttachment attachment, XWikiContext context) throws IOException, XWikiException
attachment
- an image attachmentcontext
- the XWiki contextIOException
- if reading the image from the attachment content failsXWikiException
- if reading the attachment content failspublic int getHeight(XWikiAttachment attachment, XWikiContext context) throws IOException, XWikiException
attachment
- an image attachmentcontext
- the XWiki contextIOException
- if reading the image from the attachment content failsXWikiException
- if reading the attachment content failsCopyright © 2004–2017 XWiki. All rights reserved.