com.day.cq.dam.core.process
Class CreateThumbnailProcess

java.lang.Object
  extended by com.day.cq.dam.commons.process.AbstractAssetWorkflowProcess
      extended by com.day.cq.dam.core.process.CreateThumbnailProcess
All Implemented Interfaces:
WorkflowProcess

public class CreateThumbnailProcess
extends AbstractAssetWorkflowProcess

The CreateThumbnailProcess is called in a Workflow process step. This process will create one or more Thumbnails for the Asset to be procesed. The Thumbnail generation is delegated to the appropriate AssetHandler. The thumbails Dimensions are given as the Workflow Process arguments
Each argument is considered as one thumbnail configuration. The configuration has to be enclosed in squared brackets ([]) The configuration consists of a number for the width, the height in pixel and an optional flag that indicates if the image should be centered.
These values are seperated by a colon character (:).
Dimension:
The thumbnail from an image will be created by resizeing according the thumbnail configuration. The ascpect ratio is respected and the image will have at most the dimension given by the configuration.
Centering:
If the center flag is set to true, the thumbnail image will have exactly the size given by the configuraiton. If the resized image is smaller it will be centered within the thumbnail.

Example with the following Workflow step arguments:

    [70:70],
    [80:100:true]
 

The Process creates two PNG images one of the size of 70x70 pixel and one 80x100 where the result is centred

See Also:
AbstractAssetWorkflowProcess, AssetHandler.createThumbnails(com.day.cq.dam.api.Asset, com.day.cq.dam.api.Rendition, java.util.Collection), AssetHandler.createThumbnails(com.day.cq.dam.api.Asset, java.util.Collection), AssetHandler.createThumbnails(com.day.cq.dam.api.Asset), ThumbnailGenerator, ThumbnailConfig

Nested Class Summary
static class CreateThumbnailProcess.Arguments
          The available arguments to this process implementation.
 
Field Summary
 
Fields inherited from class com.day.cq.dam.commons.process.AbstractAssetWorkflowProcess
APPLICATION_OCTET_STREAM_MIMETYPE, mimeTypeService, TYPE_JCR_PATH
 
Constructor Summary
CreateThumbnailProcess()
           
 
Method Summary
 String[] buildArguments(MetaDataMap metaData)
           
 void execute(WorkItem workItem, WorkflowSession workflowSession, MetaDataMap metaData)
          Executes a new Java process with the given WorkItem and WorkflowSession.
 
Methods inherited from class com.day.cq.dam.commons.process.AbstractAssetWorkflowProcess
getAssetFromPayload, getAssetHandler, getAssetManager, getMimetype, getNodeFromPayload, getResourceResolver, getValuesFromArgs, isNotReadyForProcessing, recheck, safeGetPath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CreateThumbnailProcess

public CreateThumbnailProcess()
Method Detail

execute

public void execute(WorkItem workItem,
                    WorkflowSession workflowSession,
                    MetaDataMap metaData)
             throws WorkflowException
Description copied from interface: WorkflowProcess
Executes a new Java process with the given WorkItem and WorkflowSession.

Parameters:
workItem - The WorkItem that defines the newly started JavaProcessNew.
workflowSession - The WorkflowSession that is used for starting the JavaProcess.
metaData - Process specific arguments can be passed here
Throws:
WorkflowException - Thrown in case something goes wrong during execution.

buildArguments

public String[] buildArguments(MetaDataMap metaData)


Copyright © 1993-2011 Day Management AG. All Rights Reserved.