public class BasicThumbnailPolicyFilter extends AbstractPolicyFilter implements ThumbnailPolicyFilter, PluginComponent
ThumbnailPolicyFilter
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
REVISION |
order
Constructor and Description |
---|
BasicThumbnailPolicyFilter() |
Modifier and Type | Method and Description |
---|---|
boolean |
createThumbnail(FileDocument doc,
java.io.File dest,
ImageFormat format,
int maxWidth,
int maxHeight,
boolean done) |
boolean |
createThumbnail(FileDocument doc,
java.io.File dest,
ImageFormat format,
int maxWidth,
int maxHeight,
java.lang.String background,
boolean done) |
boolean |
createThumbnail(FileDocument doc,
java.io.File dest,
ImageFormat format,
int maxWidth,
int maxHeight,
java.lang.String background,
boolean square,
boolean done)
This method is a hook called by Thumbnail tag to generate a
thumbnail of the given FileDocument.
|
boolean |
createThumbnail(java.io.File src,
java.io.File dest,
ImageFormat format,
int maxWidth,
int maxHeight,
boolean done) |
boolean |
createThumbnail(java.io.File src,
java.io.File dest,
ImageFormat format,
int maxWidth,
int maxHeight,
java.lang.String background,
boolean done) |
boolean |
createThumbnail(java.io.File src,
java.io.File dest,
ImageFormat format,
int maxWidth,
int maxHeight,
java.lang.String background,
boolean square,
boolean done)
This method is a hook called by Thumbnail tag to generate a
thumbnail of the given source file.
|
boolean |
createThumbnail(java.net.URL url,
java.io.File dest,
ImageFormat format,
int maxWidth,
int maxHeight,
boolean done) |
boolean |
createThumbnail(java.net.URL url,
java.io.File dest,
ImageFormat format,
int maxWidth,
int maxHeight,
java.lang.String background,
boolean done) |
boolean |
createThumbnail(java.net.URL url,
java.io.File dest,
ImageFormat format,
int maxWidth,
int maxHeight,
java.lang.String background,
boolean square,
boolean done)
This method is a hook called by Thumbnail tag to generate a
thumbnail of the given URL.
|
boolean |
init(Plugin plugin)
Initialize the component with the given plugin configuration
|
boolean |
isValidImageSize(java.io.File imgFile,
long width,
long height,
boolean jcms)
Checks if the given dimension are below the limit above which we
do not generate thumbnails
|
boolean |
supportsThumbnail(FileDocument doc,
boolean jcms)
Returns true if a thumbnail can be generated for the given document.
|
compareTo, equals, getOrder, setOrder
public static final java.lang.String REVISION
public boolean init(Plugin plugin)
PluginComponent
init
in interface PluginComponent
plugin
- the calling pluginPluginComponent.init(Plugin)
public boolean createThumbnail(java.io.File src, java.io.File dest, ImageFormat format, int maxWidth, int maxHeight, boolean done)
public boolean createThumbnail(FileDocument doc, java.io.File dest, ImageFormat format, int maxWidth, int maxHeight, boolean done)
public boolean createThumbnail(java.net.URL url, java.io.File dest, ImageFormat format, int maxWidth, int maxHeight, boolean done)
public boolean createThumbnail(java.io.File src, java.io.File dest, ImageFormat format, int maxWidth, int maxHeight, java.lang.String background, boolean done)
public boolean createThumbnail(FileDocument doc, java.io.File dest, ImageFormat format, int maxWidth, int maxHeight, java.lang.String background, boolean done)
public boolean createThumbnail(java.net.URL url, java.io.File dest, ImageFormat format, int maxWidth, int maxHeight, java.lang.String background, boolean done)
public boolean createThumbnail(java.io.File src, java.io.File dest, ImageFormat format, int maxWidth, int maxHeight, java.lang.String background, boolean square, boolean done)
ThumbnailPolicyFilter
createThumbnail
in interface ThumbnailPolicyFilter
src
- source file of which to create a thumbnaildest
- destination file (the thumbnail to generate)format
- the format of the file to generate as requested by the ThumbnailTagmaxWidth
- the maximum width of the thumbnail to generatemaxHeight
- the maximum height of the thumbnail to generatebackground
- the background color (eg "FFFFFF") if sets the image dimension will be set maxWidth and maxHeightsquare
- set to true to crop image into a square using the specified width during thumbnail creation.done
- the global plugin createThumbnail() statusThumbnailPolicyFilter.createThumbnail(File, File, ImageFormat, int, int, String, boolean, boolean)
public boolean isValidImageSize(java.io.File imgFile, long width, long height, boolean jcms)
ThumbnailPolicyFilter
isValidImageSize
in interface ThumbnailPolicyFilter
imgFile
- the image File being checked (only used for logging)width
- the widht of the image (in pixel)height
- the heigth of the image (in pixel)jcms
- the value computed by previous policy filter or the default
jcms value if no filter has been invoked yetThumbnailPolicyFilter.isValidImageSize(File, long, long, boolean)
public boolean supportsThumbnail(FileDocument doc, boolean jcms)
ThumbnailPolicyFilter
supportsThumbnail
in interface ThumbnailPolicyFilter
doc
- the FileDocument to be checkedjcms
- the value computed by previous policy filter or the default
jcms value if no filter has been invoked yetThumbnailPolicyFilter.supportsThumbnail(FileDocument, boolean)
public boolean createThumbnail(FileDocument doc, java.io.File dest, ImageFormat format, int maxWidth, int maxHeight, java.lang.String background, boolean square, boolean done)
ThumbnailPolicyFilter
createThumbnail
in interface ThumbnailPolicyFilter
doc
- FileDocument of which to create a thumbnaildest
- destination file (the thumbnail to generate)format
- the format of the file to generate as requested by the ThumbnailTagmaxWidth
- the maximum width of the thumbnail to generatemaxHeight
- the maximum height of the thumbnail to generatebackground
- the background color (eg "FFFFFF") if sets the image dimension will be set maxWidth and maxHeightsquare
- set to true to crop image into a square using the specified width during thumbnail creation.done
- the global plugin createThumbnail() statusThumbnailPolicyFilter.createThumbnail(FileDocument, File, ImageFormat, int, int, String, boolean, boolean)
public boolean createThumbnail(java.net.URL url, java.io.File dest, ImageFormat format, int maxWidth, int maxHeight, java.lang.String background, boolean square, boolean done)
ThumbnailPolicyFilter
createThumbnail
in interface ThumbnailPolicyFilter
url
- the URL of which to create a thumbnaildest
- destination file (the thumbnail to generate)format
- the format of the file to generate as requested by the ThumbnailTagmaxWidth
- the maximum width of the thumbnail to generatemaxHeight
- the maximum height of the thumbnail to generatebackground
- the background color (eg "FFFFFF") if sets the image dimension will be set maxWidth and maxHeightsquare
- set to true to crop image into a square using the specified width during thumbnail creation.done
- the global plugin createThumbnail() statusThumbnailPolicyFilter.createThumbnail(URL, File, ImageFormat, int, int, String, boolean, boolean)
Copyright © 2001-2017 Jalios SA. All Rights Reserved.