Class ThumbnailManager
- java.lang.Object
-
- com.logicaldoc.core.document.thumbnail.ThumbnailManager
-
public class ThumbnailManager extends Object
Manager class used to handle document thumbnails- Since:
- 4.5
- Author:
- Marco Meschieri - LogicalDOC
-
-
Field Summary
Fields Modifier and Type Field Description static String
SUFFIX_MOBILE
static String
SUFFIX_PREVIEW
static String
SUFFIX_THUMB
static String
SUFFIX_TILE
static String
THUMB
-
Constructor Summary
Constructors Constructor Description ThumbnailManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
createMobile(Document document, String fileVersion, String sid)
Creates the mobile image for the specified document and file version.void
createTile(Document document, String fileVersion, String sid)
Creates the tile for the specified document and file version.void
createTumbnail(Document document, String sid)
Creates the thumbnail for the specified documentvoid
createTumbnail(Document document, String fileVersion, int size, Integer quality, String sid)
Creates the thumbnail for the specified document and file version using given size and quality.void
createTumbnail(Document document, String fileVersion, String sid)
Creates the thumbnail for the specified document and file version.ThumbnailBuilder
getBuilder(String filename)
Loads the proper builder for the passed file nameMap<String,ThumbnailBuilder>
getBuilders()
void
setStorer(Storer storer)
-
-
-
Field Detail
-
SUFFIX_PREVIEW
public static final String SUFFIX_PREVIEW
- See Also:
- Constant Field Values
-
SUFFIX_TILE
public static final String SUFFIX_TILE
- See Also:
- Constant Field Values
-
THUMB
public static final String THUMB
- See Also:
- Constant Field Values
-
SUFFIX_THUMB
public static final String SUFFIX_THUMB
- See Also:
- Constant Field Values
-
SUFFIX_MOBILE
public static final String SUFFIX_MOBILE
- See Also:
- Constant Field Values
-
-
Method Detail
-
createTumbnail
public void createTumbnail(Document document, String fileVersion, String sid) throws IOException
Creates the thumbnail for the specified document and file version. The thumbnail is an image rendering of the first page only.- Parameters:
document
- The document to be treatedfileVersion
- The file version(optional)sid
- The session identifier(optional)- Throws:
IOException
- in case an error happens during image creation
-
createTumbnail
public void createTumbnail(Document document, String sid) throws IOException
Creates the thumbnail for the specified document- Parameters:
document
- The document to be treatedsid
- The session identifier (optional)- Throws:
IOException
- raised in case the thumbnail file cannot be created
-
createTumbnail
public void createTumbnail(Document document, String fileVersion, int size, Integer quality, String sid) throws IOException
Creates the thumbnail for the specified document and file version using given size and quality. The thumbnail is an image rendering of the first page only.- Parameters:
document
- The document to be treatedfileVersion
- The file version(optional)size
- The thumbnail sizequality
- Compression quality(0..100, 100 is maximum quality). If not specified the standard thumbnail quality will be used.sid
- The session identifier(optional)- Throws:
IOException
- in case an error happens during image creation
-
createTile
public void createTile(Document document, String fileVersion, String sid) throws IOException
Creates the tile for the specified document and file version. The tile is an image rendering of the first page only.- Parameters:
document
- The document to be treatedfileVersion
- The file version(optional)sid
- The session identifier(optional)- Throws:
IOException
- in case an error happens during image creation
-
createMobile
public void createMobile(Document document, String fileVersion, String sid) throws IOException
Creates the mobile image for the specified document and file version. The mobile is an image rendering of the first page only.- Parameters:
document
- The document to be treatedfileVersion
- The file version(optional)sid
- The session identifier(optional)- Throws:
IOException
- in case an error happens during image creation
-
getBuilder
public ThumbnailBuilder getBuilder(String filename)
Loads the proper builder for the passed file name- Parameters:
filename
- the filename to be rendered- Returns:
- the right thumbnail builder for the given file name
-
getBuilders
public Map<String,ThumbnailBuilder> getBuilders()
-
setStorer
public void setStorer(Storer storer)
-
-