Package com.jalios.jcms.policy
Class BasicThumbnailPolicyFilter
- java.lang.Object
 - 
- com.jalios.jcms.policy.AbstractPolicyFilter
 - 
- com.jalios.jcms.policy.BasicThumbnailPolicyFilter
 
 
 
- 
- All Implemented Interfaces:
 GenericProvider,PluginComponent,PolicyFilter,ThumbnailPolicyFilter,java.lang.Comparable
- Direct Known Subclasses:
 AbstractThumbnailPolicyFilterImpl,DefaultThumbnailPolicyFilter
public class BasicThumbnailPolicyFilter extends AbstractPolicyFilter implements ThumbnailPolicyFilter, PluginComponent
This class allow users to customize behaviour of widgets by re-writing call-back methods.- Since:
 - jcms-5.5.0
 - Version:
 - $Revision: 132283 $
 - Author:
 - Jean-Philippe Encausse
 - See Also:
 ThumbnailPolicyFilter
 
- 
- 
Field Summary
Fields Modifier and Type Field Description static java.lang.StringREVISION- 
Fields inherited from class com.jalios.jcms.policy.AbstractPolicyFilter
order 
 - 
 
- 
Constructor Summary
Constructors Constructor Description BasicThumbnailPolicyFilter() 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancreateThumbnail(FileDocument doc, java.io.File dest, ImageFormat format, int maxWidth, int maxHeight, boolean done)booleancreateThumbnail(FileDocument doc, java.io.File dest, ImageFormat format, int maxWidth, int maxHeight, java.lang.String background, boolean done)booleancreateThumbnail(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.booleancreateThumbnail(java.io.File src, java.io.File dest, ImageFormat format, int maxWidth, int maxHeight, boolean done)booleancreateThumbnail(java.io.File src, java.io.File dest, ImageFormat format, int maxWidth, int maxHeight, java.lang.String background, boolean done)booleancreateThumbnail(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.booleancreateThumbnail(java.net.URL url, java.io.File dest, ImageFormat format, int maxWidth, int maxHeight, boolean done)booleancreateThumbnail(java.net.URL url, java.io.File dest, ImageFormat format, int maxWidth, int maxHeight, java.lang.String background, boolean done)booleancreateThumbnail(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.booleaninit(Plugin plugin)Initialize the component with the given plugin configurationvoidinit(java.lang.String providerName, JProperties subProperties)this method is called on provider's initializationbooleanisValidImageSize(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 thumbnailsbooleansupportsThumbnail(FileDocument doc, boolean jcms)Returns true if a thumbnail can be generated for the given document.- 
Methods inherited from class com.jalios.jcms.policy.AbstractPolicyFilter
compareTo, equals, getOrder, setOrder 
- 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
- 
Methods inherited from interface com.jalios.jcms.GenericProvider
getLabel, getName, isInitialized 
 - 
 
 - 
 
- 
- 
Field Detail
- 
REVISION
public static final java.lang.String REVISION
- See Also:
 - Constant Field Values
 
 
 - 
 
- 
Method Detail
- 
init
public boolean init(Plugin plugin)
Description copied from interface:PluginComponentInitialize the component with the given plugin configuration- Specified by:
 initin interfacePluginComponent- Parameters:
 plugin- the calling plugin- Returns:
 - true if the component has been correctly initialized.
 - Since:
 - jcms-5.7.1
 - See Also:
 PluginComponent.init(Plugin)
 
- 
init
public void init(java.lang.String providerName, JProperties subProperties)Description copied from interface:GenericProviderthis method is called on provider's initialization- Specified by:
 initin interfaceGenericProvider- Parameters:
 providerName- the name of the provider, from class configuration propertysubProperties- the properties with the same prefix than the property describing the provider class
 
- 
createThumbnail
public boolean createThumbnail(java.io.File src, java.io.File dest, ImageFormat format, int maxWidth, int maxHeight, boolean done) 
- 
createThumbnail
public boolean createThumbnail(FileDocument doc, java.io.File dest, ImageFormat format, int maxWidth, int maxHeight, boolean done)
 
- 
createThumbnail
public boolean createThumbnail(java.net.URL url, java.io.File dest, ImageFormat format, int maxWidth, int maxHeight, boolean done) 
- 
createThumbnail
public boolean createThumbnail(java.io.File src, java.io.File dest, ImageFormat format, int maxWidth, int maxHeight, java.lang.String background, boolean done) 
- 
createThumbnail
public boolean createThumbnail(FileDocument doc, java.io.File dest, ImageFormat format, int maxWidth, int maxHeight, java.lang.String background, boolean done)
 
- 
createThumbnail
public boolean createThumbnail(java.net.URL url, java.io.File dest, ImageFormat format, int maxWidth, int maxHeight, java.lang.String background, boolean done) 
- 
createThumbnail
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)Description copied from interface:ThumbnailPolicyFilterThis method is a hook called by Thumbnail tag to generate a thumbnail of the given source file.- Specified by:
 createThumbnailin interfaceThumbnailPolicyFilter- 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 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() status- Returns:
 - true on success, or false if the thumbnail could not be created
 - See Also:
 ThumbnailPolicyFilter.createThumbnail(File, File, ImageFormat, int, int, String, boolean, boolean)
 
- 
isValidImageSize
public boolean isValidImageSize(java.io.File imgFile, long width, long height, boolean jcms)Description copied from interface:ThumbnailPolicyFilterChecks if the given dimension are below the limit above which we do not generate thumbnails- Specified by:
 isValidImageSizein interfaceThumbnailPolicyFilter- 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
 - See Also:
 ThumbnailPolicyFilter.isValidImageSize(File, long, long, boolean)
 
- 
supportsThumbnail
public boolean supportsThumbnail(FileDocument doc, boolean jcms)
Description copied from interface:ThumbnailPolicyFilterReturns true if a thumbnail can be generated for the given document. This method is called as an extension of FileDocument.supportsThumbnail().- Specified by:
 supportsThumbnailin interfaceThumbnailPolicyFilter- 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.
 - See Also:
 ThumbnailPolicyFilter.supportsThumbnail(FileDocument, boolean)
 
- 
createThumbnail
public boolean createThumbnail(FileDocument doc, java.io.File dest, ImageFormat format, int maxWidth, int maxHeight, java.lang.String background, boolean square, boolean done)
Description copied from interface:ThumbnailPolicyFilterThis method is a hook called by Thumbnail tag to generate a thumbnail of the given FileDocument.- Specified by:
 createThumbnailin interfaceThumbnailPolicyFilter- 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 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() status- Returns:
 - true on success, or false if the thumbnail could not be created
 - See Also:
 ThumbnailPolicyFilter.createThumbnail(FileDocument, File, ImageFormat, int, int, String, boolean, boolean)
 
- 
createThumbnail
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)Description copied from interface:ThumbnailPolicyFilterThis method is a hook called by Thumbnail tag to generate a thumbnail of the given URL.- Specified by:
 createThumbnailin interfaceThumbnailPolicyFilter- 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 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() status- Returns:
 - true on success, or false if the thumbnail could not be created
 - See Also:
 ThumbnailPolicyFilter.createThumbnail(URL, File, ImageFormat, int, int, String, boolean, boolean)
 
 - 
 
 -