com.jalios.jcms.policy
Class DefaultThumbnailPolicyFilter

java.lang.Object
  extended by com.jalios.jcms.policy.AbstractPolicyFilter
      extended by com.jalios.jcms.policy.BasicThumbnailPolicyFilter
          extended by com.jalios.jcms.policy.DefaultThumbnailPolicyFilter
All Implemented Interfaces:
PluginComponent, PolicyFilter, ThumbnailPolicyFilter, Comparable

public class DefaultThumbnailPolicyFilter
extends BasicThumbnailPolicyFilter

This class allow users to customize behaviour of widgets by re-writing call-back methods.

Since:
jcms-5.5.0
Version:
$Revision: 29143 $
Author:
Jean-Philippe Encausse

Field Summary
static String REVISION
           
 
Fields inherited from class com.jalios.jcms.policy.AbstractPolicyFilter
order
 
Constructor Summary
DefaultThumbnailPolicyFilter()
           
 
Method Summary
 boolean createThumbnail(FileDocument doc, File dest, ImageFormat format, int maxWidth, int maxHeight, String background, boolean done)
          This method is a hook called by Thumbnail tag to generate a thumbnail of the given FileDocument.
 boolean createThumbnail(File src, File dest, ImageFormat format, int maxWidth, int maxHeight, String background, boolean done)
          This method is a hook called by Thumbnail tag to generate a thumbnail of the given source file.
 boolean createThumbnail(URL url, File dest, ImageFormat format, int maxWidth, int maxHeight, String background, boolean done)
          This method is a hook called by Thumbnail tag to generate a thumbnail of the given URL.
 boolean isValidImageSize(File imgFile, long width, long height)
           
 boolean supportsThumbnail(FileDocument doc)
           
 
Methods inherited from class com.jalios.jcms.policy.BasicThumbnailPolicyFilter
createThumbnail, createThumbnail, createThumbnail, init, isValidImageSize, supportsThumbnail
 
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 java.lang.Comparable
compareTo
 

Field Detail

REVISION

public static final String REVISION
See Also:
Constant Field Values
Constructor Detail

DefaultThumbnailPolicyFilter

public DefaultThumbnailPolicyFilter()
Method Detail

createThumbnail

public boolean createThumbnail(File src,
                               File dest,
                               ImageFormat format,
                               int maxWidth,
                               int maxHeight,
                               String background,
                               boolean done)
Description copied from interface: ThumbnailPolicyFilter
This method is a hook called by Thumbnail tag to generate a thumbnail of the given source file.

Specified by:
createThumbnail in interface ThumbnailPolicyFilter
Overrides:
createThumbnail in class BasicThumbnailPolicyFilter
Parameters:
src - source file of which to create a thumbnail
dest - destination file (the thumbnail to generate)
format - the format of the file to generate as requested by the ThumbnailTag
maxWidth - the maximum width of the thumbnail to generate
maxHeight - the maximum height of the thumbnail to generate
background - the background color (eg "FFFFFF") if sets the image dimension will be set maxWidth and maxHeight
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)

isValidImageSize

public boolean isValidImageSize(File imgFile,
                                long width,
                                long height)
See Also:
ThumbnailPolicyFilter.isValidImageSize(File, long, long, boolean)

supportsThumbnail

public boolean supportsThumbnail(FileDocument doc)
See Also:
ThumbnailPolicyFilter.supportsThumbnail(FileDocument, boolean)

createThumbnail

public boolean createThumbnail(FileDocument doc,
                               File dest,
                               ImageFormat format,
                               int maxWidth,
                               int maxHeight,
                               String background,
                               boolean done)
Description copied from interface: ThumbnailPolicyFilter
This method is a hook called by Thumbnail tag to generate a thumbnail of the given FileDocument.

Specified by:
createThumbnail in interface ThumbnailPolicyFilter
Overrides:
createThumbnail in class BasicThumbnailPolicyFilter
Parameters:
doc - FileDocument of which to create a thumbnail
dest - destination file (the thumbnail to generate)
format - the format of the file to generate as requested by the ThumbnailTag
maxWidth - the maximum width of the thumbnail to generate
maxHeight - the maximum height of the thumbnail to generate
background - the background color (eg "FFFFFF") if sets the image dimension will be set maxWidth and maxHeight
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)

createThumbnail

public boolean createThumbnail(URL url,
                               File dest,
                               ImageFormat format,
                               int maxWidth,
                               int maxHeight,
                               String background,
                               boolean done)
Description copied from interface: ThumbnailPolicyFilter
This method is a hook called by Thumbnail tag to generate a thumbnail of the given URL.

Specified by:
createThumbnail in interface ThumbnailPolicyFilter
Overrides:
createThumbnail in class BasicThumbnailPolicyFilter
Parameters:
url - the URL of which to create a thumbnail
dest - destination file (the thumbnail to generate)
format - the format of the file to generate as requested by the ThumbnailTag
maxWidth - the maximum width of the thumbnail to generate
maxHeight - the maximum height of the thumbnail to generate
background - the background color (eg "FFFFFF") if sets the image dimension will be set maxWidth and maxHeight
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)


Copyright © 2001-2010 Jalios SA. All Rights Reserved.