Class CommandLineProcess

  • All Implemented Interfaces:
    WorkflowProcess

    @Service
    @Property(name="process.label",
              value="Command Line")
    public class CommandLineProcess
    extends AbstractAssetWorkflowProcess
    Workflow process that calls a command-line program and uses each output file that it produces as an additional rendition. Optionally creates thumbnails based on those renditions.
    The dimensions given in the thumbnail specifications are the maximal size the result must have. Aspect ratio is maintained for image resizing. As a precondition, the payload of this Workflow process has to be an Asset or part of an Asset.

    Example with the following workflow step arguments:

        mime:application/postscript,
        tn:140:100,tn:48:48,
        cmd:/bin/convert ${directory}/${filename} ${directory}/${basename}.jpg
     

    The process will call /bin/convert, pass it the full path of the asset being processed (temporarily dumped to disk), and create thumbnails of size 140x100 and 48x48 based on the output created by /bin/convert.
    This will only happen for assets having the application/postscript mime-type, others are ignored.

    Arguments:

    Name Prefix Description Required Multiple Example
    Command cmd: Command as executed on the consle.
    The command can contain varibales which are replaced before execution. The following variables are available:
    filename: name of the file as exported to disk.
    file: absolute path of the file exported.
    directory: absolute path of the directory the command is run and the asset is exported to.
    basename: the assets name on the disk without possible file-extension
    extension: the assets file extension.
    required multiple cmd:/bin/convert ${directory}/${filename} ${directory}/${basename}.jpg
    Mimetype Filter mime: Mimetype the Asset must have. If the Asset is of a diffrent type, this process will not be executed. required multiple mime:application/postscript
    Thumbnail Specification tn: Dimensions of the Thumbnails to be generated from the Asset.
    width:height[:false]
    width:Number the maximal width in Pixel the Thumbnail must not exceed height:Number the maximal height in Pixel the Thumbnail must not exceed. center:Boolean, optional flag to indicate that the resulting Thumbnail must not be centered, true is default.
    multiple tn:140:100
    See Also:
    AbstractAssetWorkflowProcess