com.xpn.xwiki.plugin.image
Class ImagePlugin

java.lang.Object
  extended by com.xpn.xwiki.plugin.XWikiDefaultPlugin
      extended by com.xpn.xwiki.plugin.image.ImagePlugin
All Implemented Interfaces:
XWikiPluginInterface

Deprecated. the plugin technology is deprecated, consider rewriting as components

@Deprecated
public class ImagePlugin
extends XWikiDefaultPlugin

Version:
$Id: 69f723313e6d32bcde6ff7b5bb4236accb19065d $

Constructor Summary
ImagePlugin(String name, String className, XWikiContext context)
          Deprecated. Creates a new instance of this plugin.
 
Method Summary
 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.
 
Methods inherited from class com.xpn.xwiki.plugin.XWikiDefaultPlugin
beginParsing, beginRendering, commonTagsHandler, endParsing, endRendering, endRenderingHandler, flushCache, getClassName, insidePREHandler, outsidePREHandler, setClassName, setName, startRenderingHandler, virtualInit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImagePlugin

public ImagePlugin(String name,
                   String className,
                   XWikiContext context)
Deprecated. 
Creates a new instance of this plugin.

Parameters:
name - the name of the plugin
className - the class name
context - the XWiki context
See Also:
XWikiDefaultPlugin.XWikiDefaultPlugin(String,String,com.xpn.xwiki.XWikiContext)
Method Detail

getPluginApi

public Api getPluginApi(XWikiPluginInterface plugin,
                        XWikiContext context)
Deprecated. 
Description copied from interface: XWikiPluginInterface
Get a public scriptable API that can be used to call methods of the (privileged) plugin.

Specified by:
getPluginApi in interface XWikiPluginInterface
Overrides:
getPluginApi in class XWikiDefaultPlugin
Parameters:
plugin - the plugin instance to wrap
context - the current request context
Returns:
an instance of the corresponding API, or null if the plugin doesn't want to expose a public API

getName

public String getName()
Deprecated. 
Description copied from interface: XWikiPluginInterface
The name which can be used for accessing this plugin from XWiki.getPlugin(String, XWikiContext).

Specified by:
getName in interface XWikiPluginInterface
Overrides:
getName in class XWikiDefaultPlugin
Returns:
the plugin name, usually a lowercase identifier

init

public void init(XWikiContext context)
Deprecated. 
Description copied from interface: XWikiPluginInterface
Global initialization, called when the platform is started and the plugin list is initialized.

Specified by:
init in interface XWikiPluginInterface
Overrides:
init in class XWikiDefaultPlugin
Parameters:
context - the current context, should not be stored since it will become mostly unreliable once the initial request is terminated

flushCache

public void flushCache()
Deprecated. 
Description copied from class: XWikiDefaultPlugin
Older equivalent of the XWikiDefaultPlugin.flushCache(XWikiContext) method without a context provided.

Overrides:
flushCache in class XWikiDefaultPlugin

downloadAttachment

public 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. The plugin is passed the original attachment and it has to return the new modified attachment.

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.

Specified by:
downloadAttachment in interface XWikiPluginInterface
Overrides:
downloadAttachment in class XWikiDefaultPlugin
Parameters:
attachment - the original attachment
context - the current request context
Returns:
the modified attachment
See Also:
XWikiDefaultPlugin.downloadAttachment(XWikiAttachment, XWikiContext)

getWidth

public int getWidth(XWikiAttachment attachment,
                    XWikiContext context)
             throws IOException,
                    XWikiException
Deprecated. 
Parameters:
attachment - an image attachment
context - the XWiki context
Returns:
the width of the specified image
Throws:
IOException - if reading the image from the attachment content fails
XWikiException - if reading the attachment content fails

getHeight

public int getHeight(XWikiAttachment attachment,
                     XWikiContext context)
              throws IOException,
                     XWikiException
Deprecated. 
Parameters:
attachment - an image attachment
context - the XWiki context
Returns:
the height of the specified image
Throws:
IOException - if reading the image from the attachment content fails
XWikiException - if reading the attachment content fails


Copyright © 2004-2013 XWiki. All Rights Reserved.