Package com.jalios.jcms.policy
Interface ThumbnailPolicyFilter
-
- All Superinterfaces:
java.lang.Comparable
,GenericProvider
,PluginComponent
,PolicyFilter
- All Known Implementing Classes:
AbstractThumbnailPolicyFilterImpl
,BasicThumbnailPolicyFilter
,DefaultImageThumbnailPolicyFilter
,DefaultOpenOfficeThumbnailPolicyFilter
,DefaultOpenXmlThumbnailPolicyFilter
,DefaultThumbnailPolicyFilter
public interface ThumbnailPolicyFilter extends PolicyFilter, GenericProvider
This class allow users to customize behaviour of widgets by re-writing call-back methods.- Since:
- jcms-5.5.0
- Version:
- $Revision: 129865 $
- Author:
- Jean-Philippe Encausse
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
REVISION
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description 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, 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, 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
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 thumbnailsboolean
supportsThumbnail(FileDocument doc, boolean jcms)
Returns true if a thumbnail can be generated for the given document.-
Methods inherited from interface com.jalios.jcms.GenericProvider
getLabel, getName, init, isInitialized
-
Methods inherited from interface com.jalios.jcms.plugin.PluginComponent
init
-
-
-
-
Field Detail
-
REVISION
static final java.lang.String REVISION
- See Also:
- Constant Field Values
-
-
Method Detail
-
createThumbnail
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.- Parameters:
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 generatedone
- the global plugin createThumbnail() statusbackground
- 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.- Returns:
- true on success, or false if the thumbnail could not be created
- See Also:
ThumbnailTag.createImageThumbnail(File, File, ImageFormat, int, int)
,ImageUtil.createThumbnail(File, ImageFormat, int, int)
-
isValidImageSize
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- Parameters:
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 yet- Returns:
- true if the given dimension are valid, false otherwise
-
supportsThumbnail
boolean supportsThumbnail(FileDocument doc, boolean jcms)
Returns true if a thumbnail can be generated for the given document. This method is called as an extension of FileDocument.supportsThumbnail().- Parameters:
doc
- the FileDocument to be checkedjcms
- the value computed by previous policy filter or the default jcms value if no filter has been invoked yet- Returns:
- true if a thumbnail can be generated for the given document.
- Since:
- jcms-5.7.0
-
createThumbnail
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.- Parameters:
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 generatedone
- the global plugin createThumbnail() statusbackground
- 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.- Returns:
- true on success, or false if the thumbnail could not be created
- See Also:
ThumbnailTag.createImageThumbnail(File, File, ImageFormat, int, int)
,ImageUtil.createThumbnail(File, ImageFormat, int, int)
-
createThumbnail
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.- Parameters:
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 generatedone
- the global plugin createThumbnail() statusbackground
- 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.- Returns:
- true on success, or false if the thumbnail could not be created
- See Also:
ThumbnailTag.createImageThumbnail(File, File, ImageFormat, int, int)
,ImageUtil.createThumbnail(File, ImageFormat, int, int)
-
-