public class Ice2Transformer extends Object implements Transformer
This plugin uses Integrated Content Environment (ICE) conversion services to get the rendition version of a file.
Standard configuration table:
| Option | Description | Required | Default |
|---|---|---|---|
| id | Transformer Id | Yes | ice2 |
| url | Address of where the ICE service located | Yes | http://ice-service.usq.edu.au/api/convert/ |
| outputPath | Path where the aperture will store the temporary files | Yes | ${java.io.tmpdir}/${user.name}/ice2-output |
| excludeRenditionExt | The list of renditions to be excluded | No | txt,mp3,m4a,mov,mp4,wav,wma,wmv,mpg,flv |
| priority | TPriority of ICE transformer | No | true |
Customise configuration for resizing the image for both thumbnail and preview
| Option | Description | Required | Default |
|---|---|---|---|
| resize/thumbnail/option | Resizing option, possible mode: fixedWidth and ratio | Yes | fixedWidth |
| resize/thumbnail/ratio | Image will be resized based on provided ratio if ratio mode is selected | Yes | -90 |
| resize/thumbnail/fixedWidth | Image will be resized based on the width if fixedWidth mode is selected | Yes | 160 |
| resize/thumbnail/enlarge | keep image size if image width is less than the fixedWidth value | Yes | false |
| resize/preview/option | Resizing option, possible mode: fixedWidth and ratio | Yes | fixedWidth |
| resize/preview/ratio | Image will be resized based on provided ratio if ratio mode is selected | Yes | -90 |
| resize/preview/fixedWidth | Image will be resized based on the width if fixedWidth mode is selected | 600 | 160 |
| resize/preview/enlarge | keep image size if image width is less than the fixedWidth value | Yes | false |
For further information about Image resizing service provided by ICE, please refer to https ://ice.usq.edu.au/trac/wiki/ICEService/ResizeImage
"ice2": {
"id": "ice2",
"url": "http://ice-service.usq.edu.au/api/convert/",
"outputPath": "${java.io.tmpdir}/${user.name}/ice2-output",
"excludeRenditionExt": "txt,mp3,m4a,mov,mp4,wav,wma,wmv,mpg,flv",
"priority": "true",
"resize": {
"thumbnail": {
"option": "fixedWidth",
"ratio": "-90",
"fixedWidth": "160",
"enlarge": "false"
},
"preview": {
"option": "fixedWidth",
"ratio": "-90",
"fixedWidth": "600",
"enlarge": "false"
}
}
}
https://fascinator.usq.edu.au/trac/wiki/Fascinator/Documents/Plugins/ Transformer/ICE2
| Constructor and Description |
|---|
Ice2Transformer()
ICE transformer constructor
|
| Modifier and Type | Method and Description |
|---|---|
DigitalObject |
createErrorPayload(DigitalObject object,
String file,
Exception ex)
Create Payload method for ICE Error
|
DigitalObject |
createIcePayload(DigitalObject object,
File file)
Create Payload method for ICE rendition files
|
String |
getId()
Get Transformer ID
|
String |
getName()
Get Transformer Name
|
PluginDescription |
getPluginDetails()
Gets a PluginDescription object relating to this plugin.
|
void |
init(File jsonFile)
Init method to initialise ICE transformer
|
void |
init(String jsonString)
Init method to initialise ICE transformer
|
void |
shutdown()
Shut down the transformer plugin
|
DigitalObject |
transform(DigitalObject object,
String jsonConfig)
Transform method
|
public void init(File jsonFile) throws PluginException
init in interface PluginjsonFile - IOExceptionPluginExceptionpublic void init(String jsonString) throws PluginException
init in interface PluginjsonString - IOExceptionPluginExceptionpublic DigitalObject transform(DigitalObject object, String jsonConfig) throws TransformerException
transform in interface Transformerobject - : DigitalObject to be transformedTransformerExceptionStorageExceptionUnsupportedEncodingExceptionIOExceptionpublic DigitalObject createErrorPayload(DigitalObject object, String file, Exception ex) throws StorageException, UnsupportedEncodingException
object - : DigitalObject that store the payloadfile - : File to be stored as payloadmessage - : Error messageStorageExceptionUnsupportedEncodingExceptionpublic DigitalObject createIcePayload(DigitalObject object, File file) throws StorageException, IOException, Exception
object - : DigitalObject that store the payloadfile - : File to be stored as payloadStorageExceptionIOExceptionExceptionpublic String getName()
public PluginDescription getPluginDetails()
getPluginDetails in interface Pluginpublic void shutdown()
throws PluginException
shutdown in interface PluginPluginExceptionCopyright © 2009-2013. All Rights Reserved.