com.googlecode.fascinator.transformer.ice2
Class Ice2Transformer

java.lang.Object
  extended by com.googlecode.fascinator.transformer.ice2.Ice2Transformer
All Implemented Interfaces:
Plugin, Transformer

public class Ice2Transformer
extends Object
implements Transformer

This plugin uses Integrated Content Environment (ICE) conversion services to get the rendition version of a file.

Configuration

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

Examples

  1. ICE2 transformer connected to ice service for rendition with the specified image resize options
     "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"
                     }
                 }
             }
     

Wiki Link

https://fascinator.usq.edu.au/trac/wiki/Fascinator/Documents/Plugins/ Transformer/ICE2

Author:
Linda Octalina, Oliver Lucido

Constructor Summary
Ice2Transformer()
          ICE transformer constructor
 
Method Summary
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Ice2Transformer

public Ice2Transformer()
ICE transformer constructor

Method Detail

init

public void init(File jsonFile)
          throws PluginException
Init method to initialise ICE transformer

Specified by:
init in interface Plugin
Parameters:
jsonFile -
Throws:
IOException
PluginException

init

public void init(String jsonString)
          throws PluginException
Init method to initialise ICE transformer

Specified by:
init in interface Plugin
Parameters:
jsonString -
Throws:
IOException
PluginException

transform

public DigitalObject transform(DigitalObject object,
                               String jsonConfig)
                        throws TransformerException
Transform method

Specified by:
transform in interface Transformer
Parameters:
object - : DigitalObject to be transformed
Returns:
transformed DigitalObject
Throws:
TransformerException
StorageException
UnsupportedEncodingException
IOException

createErrorPayload

public DigitalObject createErrorPayload(DigitalObject object,
                                        String file,
                                        Exception ex)
                                 throws StorageException,
                                        UnsupportedEncodingException
Create Payload method for ICE Error

Parameters:
object - : DigitalObject that store the payload
file - : File to be stored as payload
message - : Error message
Returns:
transformed DigitalObject
Throws:
StorageException
UnsupportedEncodingException

createIcePayload

public DigitalObject createIcePayload(DigitalObject object,
                                      File file)
                               throws StorageException,
                                      IOException,
                                      Exception
Create Payload method for ICE rendition files

Parameters:
object - : DigitalObject that store the payload
file - : File to be stored as payload
Returns:
transformed DigitalObject
Throws:
StorageException
IOException
Exception

getId

public String getId()
Get Transformer ID

Specified by:
getId in interface Plugin
Returns:
id

getName

public String getName()
Get Transformer Name

Specified by:
getName in interface Plugin
Returns:
name;

getPluginDetails

public PluginDescription getPluginDetails()
Gets a PluginDescription object relating to this plugin.

Specified by:
getPluginDetails in interface Plugin
Returns:
a PluginDescription

shutdown

public void shutdown()
              throws PluginException
Shut down the transformer plugin

Specified by:
shutdown in interface Plugin
Throws:
PluginException


Copyright © 2009-2013. All Rights Reserved.