Package com.logicaldoc.core.document.thumbnail

# Class ThumbnailManager

java.lang.Object
com.logicaldoc.core.document.thumbnail.ThumbnailManager

@Component("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 final String`
`THUMB`

## Constructor Summary

Constructors
Constructor
Description
`ThumbnailManager()`

## Method Summary

Modifier and Type
Method
Description
`void`
`createMobile(Document document, String sid)`
Creates the mobile image for the specified document.
`void`
`createMobile(Document document, String fileVersion, String sid)`
Creates the mobile image for the specified document and file version.
`void`
`createTile(Document document, String sid)`
Creates the tile for the specified document
`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 document
`void`
`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.
`static ThumbnailManager`
`get()`
Gets the object available in the application context
`ThumbnailBuilder`
`getBuilder(String filename)`
Loads the proper builder for the passed file name
`Map<String,ThumbnailBuilder>`
`getBuilders()`
`void`
`init()`
Initializes the builders map
`void`
`setStore(Store store)`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### THUMB

public static final String THUMB

See Also:
  - Constant Field Values

## Constructor Details

### ThumbnailManager

public ThumbnailManager()

## Method Details

### get

public static ThumbnailManager get()
Gets the object available in the application context

Returns:
  the instance of this object in the application context

### 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 treated
  `fileVersion` - 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 treated
  `sid` - 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 treated
  `fileVersion` - The file version(optional)
  `size` - The thumbnail size
  `quality` - 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 treated
  `fileVersion` - The file version(optional)
  `sid` - The session identifier(optional)
Throws:
  `IOException` - in case an error happens during image creation

### createTile

public void createTile(Document document, String sid) throws IOException
Creates the tile for the specified document

Parameters:
  `document` - The document to be treated
  `sid` - The session identifier (optional)
Throws:
  `IOException` - raised in case the tile file cannot be created

### 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 treated
  `fileVersion` - 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 sid) throws IOException
Creates the mobile image for the specified document. The mobile is an image rendering of the first page only.

Parameters:
  `document` - The document to be treated
  `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

### init

@PostConstruct public void init()
Initializes the builders map

### getBuilders

public Map<String,ThumbnailBuilder> getBuilders()

### setStore

public void setStore(Store store)