Package com.xpn.xwiki.plugin.svg
Class SVGPlugin
- java.lang.Object
-
- com.xpn.xwiki.plugin.XWikiDefaultPlugin
-
- com.xpn.xwiki.plugin.svg.SVGPlugin
-
- All Implemented Interfaces:
XWikiPluginInterface
public class SVGPlugin extends XWikiDefaultPlugin implements XWikiPluginInterface
-
-
Constructor Summary
Constructors Constructor Description SVGPlugin(String name, String className, XWikiContext context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String[]
expandSources(Vector sources)
void
flushCache()
Older equivalent of theXWikiDefaultPlugin.flushCache(XWikiContext)
method without a context provided.String
getName()
The name which can be used for accessing this plugin fromXWiki.getPlugin(String, XWikiContext)
.Api
getPluginApi(XWikiPluginInterface plugin, XWikiContext context)
Get a public scriptable API that can be used to call methods of the (privileged) plugin.byte[]
getSVGImage(int hashCode, String content, String extension, int height, int width)
byte[]
getSVGImage(String content, int height, int width)
byte[]
getSVGImage(String content, String extension, int height, int width)
String
getSVGImageURL(String content, int height, int width, XWikiContext context)
File
getTempFile(int hashcode, String extension)
File
getTempFile(String filename)
void
init(XWikiContext context)
Global initialization, called when the platform is started and the plugin list is initialized.void
outputSVGImage(String content, int height, int width, XWikiContext context)
void
outputSVGImage(String content, String extension, int height, int width, XWikiContext context)
void
outputSVGImageFromFile(String filename, XWikiContext context)
byte[]
readSVGImage(File ofile)
String
writeSVGImage(String content, int height, int width)
String
writeSVGImage(String content, String extension, int height, int width)
-
Methods inherited from class com.xpn.xwiki.plugin.XWikiDefaultPlugin
beginParsing, beginRendering, commonTagsHandler, downloadAttachment, endParsing, endRendering, endRenderingHandler, flushCache, getClassName, getLocalization, insidePREHandler, localizePlainOrKey, outsidePREHandler, setClassName, setName, startRenderingHandler, virtualInit
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.xpn.xwiki.plugin.XWikiPluginInterface
beginParsing, beginRendering, commonTagsHandler, downloadAttachment, endParsing, endRendering, endRenderingHandler, flushCache, insidePREHandler, outsidePREHandler, startRenderingHandler, virtualInit
-
-
-
-
Constructor Detail
-
SVGPlugin
public SVGPlugin(String name, String className, XWikiContext context)
-
-
Method Detail
-
getName
public String getName()
Description copied from interface:XWikiPluginInterface
The name which can be used for accessing this plugin fromXWiki.getPlugin(String, XWikiContext)
.- Specified by:
getName
in interfaceXWikiPluginInterface
- Overrides:
getName
in classXWikiDefaultPlugin
- Returns:
- the plugin name, usually a lowercase identifier
-
getPluginApi
public Api getPluginApi(XWikiPluginInterface plugin, XWikiContext context)
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 interfaceXWikiPluginInterface
- Overrides:
getPluginApi
in classXWikiDefaultPlugin
- Parameters:
plugin
- the plugin instance to wrapcontext
- the current request context- Returns:
- an instance of the corresponding API, or
null
if the plugin doesn't want to expose a public API
-
flushCache
public void flushCache()
Description copied from class:XWikiDefaultPlugin
Older equivalent of theXWikiDefaultPlugin.flushCache(XWikiContext)
method without a context provided.- Overrides:
flushCache
in classXWikiDefaultPlugin
-
init
public void init(XWikiContext context)
Description copied from interface:XWikiPluginInterface
Global initialization, called when the platform is started and the plugin list is initialized.- Specified by:
init
in interfaceXWikiPluginInterface
- Overrides:
init
in classXWikiDefaultPlugin
- Parameters:
context
- the current context, should not be stored since it will become mostly unreliable once the initial request is terminated
-
getSVGImage
public byte[] getSVGImage(String content, int height, int width) throws IOException, org.apache.batik.apps.rasterizer.SVGConverterException
- Throws:
IOException
org.apache.batik.apps.rasterizer.SVGConverterException
-
getSVGImage
public byte[] getSVGImage(String content, String extension, int height, int width) throws IOException, org.apache.batik.apps.rasterizer.SVGConverterException
- Throws:
IOException
org.apache.batik.apps.rasterizer.SVGConverterException
-
getSVGImage
public byte[] getSVGImage(int hashCode, String content, String extension, int height, int width) throws IOException, org.apache.batik.apps.rasterizer.SVGConverterException
- Throws:
IOException
org.apache.batik.apps.rasterizer.SVGConverterException
-
readSVGImage
public byte[] readSVGImage(File ofile) throws IOException
- Throws:
IOException
-
writeSVGImage
public String writeSVGImage(String content, int height, int width) throws IOException, org.apache.batik.apps.rasterizer.SVGConverterException
- Throws:
IOException
org.apache.batik.apps.rasterizer.SVGConverterException
-
writeSVGImage
public String writeSVGImage(String content, String extension, int height, int width) throws IOException, org.apache.batik.apps.rasterizer.SVGConverterException
- Throws:
IOException
org.apache.batik.apps.rasterizer.SVGConverterException
-
outputSVGImage
public void outputSVGImage(String content, int height, int width, XWikiContext context) throws IOException, org.apache.batik.apps.rasterizer.SVGConverterException
- Throws:
IOException
org.apache.batik.apps.rasterizer.SVGConverterException
-
outputSVGImage
public void outputSVGImage(String content, String extension, int height, int width, XWikiContext context) throws IOException, org.apache.batik.apps.rasterizer.SVGConverterException
- Throws:
IOException
org.apache.batik.apps.rasterizer.SVGConverterException
-
outputSVGImageFromFile
public void outputSVGImageFromFile(String filename, XWikiContext context) throws IOException
- Throws:
IOException
-
getSVGImageURL
public String getSVGImageURL(String content, int height, int width, XWikiContext context) throws IOException, org.apache.batik.apps.rasterizer.SVGConverterException
- Throws:
IOException
org.apache.batik.apps.rasterizer.SVGConverterException
-
-