Platform Explorer / Nuxeo Platform LTS 2015 7.10

Extension point command

Extension point to contribute new commands.

Available options are: - name: string attribute used as the command identifier.

- enabled: boolean attribute, command is unavailable if false.

- commandLine: the command to execute.

- parameterString: the parameters to pass to the command. Parameters like #{parameter} represents a file. So you can use either a path to a file or a blob. Parameters like %parameters are literals.

- winParameterString: Same as above but used in windows environments. For instance you have to use double quotes in windows instead of simple quote.

- winCommand: command to execute specifically for windows. Use commandLine is WinCommand is null;

- tester: name of the CommandTester. The CommandTester defined in commandTester extension point. Default is SystemPathExistTester, which looks if the command is available in system Path.

- readOutput: Boolean, default is true. If false, command output is never read.

- installationDirective: a String that is returned instead of the usual output when the command isn't available.

CommandLine contribution example:

    <command enabled="true" name="myCommand">
        <commandLine>commandName</commandLine>
        <parameterString> -any -parameters '%specific' %parameters #{blobOrPath}</parameterString>
        <winParameterString> -any -parameters "%specific" %parameters " #{blobOrPath}</winParameterString>
        <installationDirective>You need to install commandName.</installationDirective>
    </command>

  • 5.3.1-SNAPSHOT

This extension point can be used to contribute a new Command line that will be available via the CommandLineExecutor Service.

Contribution Descriptor

Existing Contributions

  • nuxeo-platform-convert-7.10-HF07.jar /OSGI-INF/commandline-wpd2text-contrib.xml
    <extension point="command" target="org.nuxeo.ecm.platform.commandline.executor.service.CommandLineExecutorComponent">
        <command enabled="true" name="wpd2text">
          <commandLine>wpd2text</commandLine>
          <parameterString> #{inFilePath}</parameterString>
          <installationDirective>You need to install wpd2text (deb: libwpd-tools)  http://libwpd.sourceforge.net/download.html</installationDirective>
        </command>
    
      </extension>
  • nuxeo-platform-convert-7.10-HF07.jar /OSGI-INF/commandline-pdf2html-contrib.xml
    <extension point="command" target="org.nuxeo.ecm.platform.commandline.executor.service.CommandLineExecutorComponent">
    
        <command enabled="true" name="pdftohtml">
          <commandLine>pdftohtml</commandLine>
          <parameterString> -c -nodrm -enc UTF-8 -noframes #{inFilePath} #{outDirPath}/index.html</parameterString>
          <winParameterString> -c -nodrm -enc UTF-8 -noframes #{inFilePath} #{outDirPath}\index.html</winParameterString>
          <installationDirective>You need to install pdftohtml</installationDirective>
        </command>
    
      </extension>
  • nuxeo-platform-convert-7.10-HF07.jar /OSGI-INF/commandline-pdf2image-contrib.xml
    <extension point="command" target="org.nuxeo.ecm.platform.commandline.executor.service.CommandLineExecutorComponent">
    
        <command enabled="true" name="pdftoimage">
          <commandLine>convert</commandLine>
          <parameterString>-define registry:temporary-path=#{java.io.tmpdir} -quiet #{sourceFilePath} #{targetFilePath}</parameterString>
          <installationDirective>You need to install ImageMagick.</installationDirective>
        </command>
    
      </extension>
  • nuxeo-thumbnail-7.10.jar /OSGI-INF/thumbnail-commandline-imagemagick-contrib.xml
    <extension point="command" target="org.nuxeo.ecm.platform.commandline.executor.service.CommandLineExecutorComponent">
    
        <command enabled="true" name="toThumbnail">
          <commandLine>convert</commandLine>
          <parameterString>-define registry:temporary-path=#{java.io.tmpdir} -quiet -strip -thumbnail #{size} -background transparent -gravity center -format png -quality 75 #{inputFilePath}[0] #{outputFilePath}</parameterString>
          <winParameterString>-define registry:temporary-path=#{java.io.tmpdir} -quiet -strip -thumbnail #{size} -background transparent -gravity center -format png -quality 75 #{inputFilePath}[0] #{outputFilePath}</winParameterString>
          <installationDirective>You need to install ImageMagick.</installationDirective>
        </command>
    
      </extension>
  • nuxeo-binary-metadata-7.10-HF03.jar /OSGI-INF/binary-metadata-default-contrib.xml
    <extension point="command" target="org.nuxeo.ecm.platform.commandline.executor.service.CommandLineExecutorComponent">
    
        <command enabled="true" name="exiftool-read-taglist">
          <commandLine>exiftool</commandLine>
          <parameterString>-m -G -json #{tagList} #{inFilePath}</parameterString>
          <installationDirective>You need to install exiftool</installationDirective>
        </command>
    
        <command enabled="true" name="exiftool-read">
          <commandLine>exiftool</commandLine>
          <parameterString>-m -G -json #{inFilePath}</parameterString>
          <installationDirective>You need to install exiftool</installationDirective>
        </command>
    
        <command enabled="true" name="exiftool-write">
          <commandLine>exiftool</commandLine>
          <parameterString>-m -G #{tagList} #{inFilePath}</parameterString>
          <installationDirective>You need to install exiftool</installationDirective>
        </command>
    
        <!-- Since 7.3 -->
        <command enabled="true" name="exiftool-read-taglist-noprefix">
          <commandLine>exiftool</commandLine>
          <parameterString>-m -json #{tagList} #{inFilePath}</parameterString>
          <installationDirective>You need to install exiftool</installationDirective>
        </command>
    
        <!-- Since 7.3 -->
        <command enabled="true" name="exiftool-read-noprefix">
          <commandLine>exiftool</commandLine>
          <parameterString>-m -json #{inFilePath}</parameterString>
          <installationDirective>You need to install exiftool</installationDirective>
        </command>
    
        <!-- Since 7.3 -->
        <command enabled="true" name="exiftool-write-noprefix">
          <commandLine>exiftool</commandLine>
          <parameterString>-m #{tagList} #{inFilePath}</parameterString>
          <installationDirective>You need to install exiftool</installationDirective>
        </command>
    
      </extension>
  • nuxeo-platform-video-convert-7.10.jar /OSGI-INF/commandline-contrib.xml
    <extension point="command" target="org.nuxeo.ecm.platform.commandline.executor.service.CommandLineExecutorComponent">
    
        <command enabled="true" name="ffmpeg-info">
          <commandLine>ffprobe</commandLine>
          <parameterString> #{inFilePath}</parameterString>
          <installationDirective>You need to install ffmpeg from http://ffmpeg.org (apt-get install ffmpeg)
          </installationDirective>
        </command>
    
        <command enabled="true" name="ffmpeg-screenshot">
          <commandLine>ffmpeg</commandLine>
          <!-- It's important to put the -ss option before the -i option for
            faster (though less accurate) seek / skip to position in the input file -->
          <parameterString> -y -ss #{position} -i #{inFilePath} -vframes 1 -f image2 #{outFilePath}</parameterString>
          <installationDirective>You need to install ffmpeg from http://ffmpeg.org (apt-get install ffmpeg)
          </installationDirective>
        </command>
    
        <command enabled="true" name="ffmpeg-screenshot-resize">
          <commandLine>ffmpeg</commandLine>
          <!-- It's important to put the -ss option before the -i option for faster
            (though less accurate) seek / skip to position in the input file.
    
            The -vframes 1 option tell to take only one screenshot. This is
            necessary as apparent the use of the "-s" option forces ffmpeg to
            switch in "many output files" mode.
          -->
          <parameterString> -y -ss #{position} -i #{inFilePath} -vframes 1 -f image2 -s #{width}x#{height} #{outFilePath}</parameterString>
          <installationDirective>You need to install ffmpeg from http://ffmpeg.org (apt-get install ffmpeg)
          </installationDirective>
        </command>
    
        <command enabled="true" name="ffmpeg-towebm">
          <commandLine>ffmpeg</commandLine>
          <parameterString> -i #{inFilePath} -s #{width}x#{height} -acodec libvorbis -v 0 #{outFilePath}</parameterString>
          <installationDirective>You need to install ffmpeg from http://ffmpeg.org (apt-get install ffmpeg)
          </installationDirective>
        </command>
    
        <command enabled="true" name="ffmpeg-tomp4">
          <commandLine>ffmpeg</commandLine>
          <parameterString> -i #{inFilePath} -s #{width}x#{height} -acodec libfaac -vcodec libx264 -v 0 #{outFilePath}</parameterString>
          <winParameterString> -i #{inFilePath} -s #{width}x#{height} -vcodec libx264 -v 0 #{outFilePath}</winParameterString>
          <installationDirective>You need to install ffmpeg from http://ffmpeg.org (apt-get install ffmpeg)
          </installationDirective>
        </command>
    
        <command enabled="true" name="ffmpeg-toogg">
          <commandLine>ffmpeg</commandLine>
          <parameterString> -i #{inFilePath} -s #{width}x#{height} -acodec libvorbis -v 0 #{outFilePath}</parameterString>
          <installationDirective>You need to install ffmpeg from http://ffmpeg.org (apt-get install ffmpeg)
          </installationDirective>
        </command>
    
      </extension>
  • nuxeo-platform-imaging-core-7.10-HF06.jar /OSGI-INF/commandline-imagemagick-contrib.xml
    <extension point="command" target="org.nuxeo.ecm.platform.commandline.executor.service.CommandLineExecutorComponent">
    
        <command enabled="true" name="identify">
          <commandLine>identify</commandLine>
          <parameterString>-define registry:temporary-path=#{java.io.tmpdir} -quiet -ping -format '%m %w %h %z %[colorspace]' #{inputFilePath}[0]</parameterString>
          <winParameterString>-define registry:temporary-path=#{java.io.tmpdir} -quiet -ping -format "%m %w %h %z %[colorspace]" #{inputFilePath}[0]</winParameterString>
          <installationDirective>You need to install ImageMagick.</installationDirective>
        </command>
    
        <command enabled="true" name="crop">
          <commandLine>stream</commandLine>
          <parameterString>-define registry:temporary-path=#{java.io.tmpdir} -quiet -map rgb -storage-type char -extract #{tileWidth}x#{tileHeight}+#{offsetX}+#{offsetY} #{inputFilePath}[0] - | convert -depth 8 -size #{tileWidth}x#{tileHeight} rgb:- #{outputFilePath}</parameterString>
          <winParameterString>-define registry:temporary-path=#{java.io.tmpdir} -quiet -map rgb -storage-type char -extract #{tileWidth}x#{tileHeight}+#{offsetX}+#{offsetY} #{inputFilePath}[0] - | convert -depth 8 -size #{tileWidth}x#{tileHeight} rgb:- #{outputFilePath}</winParameterString>
          <installationDirective>You need to install ImageMagick.</installationDirective>
        </command>
    
        <command enabled="true" name="resizer">
          <commandLine>convert</commandLine>
          <parameterString>-define registry:temporary-path=#{java.io.tmpdir} -quiet -depth #{targetDepth} #{inputFilePath}[0] jpg:- | convert - -resize #{targetWidth}x#{targetHeight} #{outputFilePath}</parameterString>
          <winParameterString>-define registry:temporary-path=#{java.io.tmpdir} -quiet -depth #{targetDepth} #{inputFilePath}[0] -resize #{targetWidth}x#{targetHeight} #{outputFilePath}</winParameterString>
          <installationDirective>You need to install ImageMagick.</installationDirective>
        </command>
    
        <command enabled="true" name="gifResizer">
          <commandLine>convert</commandLine>
          <parameterString>-define registry:temporary-path=#{java.io.tmpdir} -quiet -depth #{targetDept h} #{inputFilePath}[0] -coalesce -resize #{targetWidth}x#{targetHeight} -deconstruct #{outputFilePath}</parameterString>
          <installationDirective>You need to install ImageMagick.</installationDirective>
        </command>
    
        <command enabled="true" name="jpegResizer">
          <commandLine>convert</commandLine>
          <parameterString>-define registry:temporary-path=#{java.io.tmpdir} -quiet -background white -flatten -depth #{targetDepth} #{inputFilePath}[0] jpg:- | convert - -resize #{targetWidth}x#{targetHeight} #{outputFilePath}</parameterString>
          <winParameterString>-define registry:temporary-path=#{java.io.tmpdir} -quiet -background white -flatten -depth #{targetDepth} #{inputFilePath}[0] -resize #{targetWidth}x#{targetHeight} #{outputFilePath}</winParameterString>
          <installationDirective>You need to install ImageMagick.</installationDirective>
        </command>
    
        <command enabled="true" name="rotate">
          <commandLine>convert</commandLine>
          <parameterString>-define registry:temporary-path=#{java.io.tmpdir} -quiet #{inputFilePath}[0] -rotate #{angle} #{outputFilePath}</parameterString>
          <winParameterString>-define registry:temporary-path=#{java.io.tmpdir} -quiet #{inputFilePath}[0] -rotate #{angle} #{outputFilePath}</winParameterString>
          <installationDirective>You need to install ImageMagick.</installationDirective>
        </command>
    
        <command enabled="true" name="cropAndResize">
          <commandLine>stream</commandLine>
          <parameterString>-define registry:temporary-path=#{java.io.tmpdir} -quiet -map #{mapComponents} -storage-type char -extract #{tileWidth}x#{tileHeight}+#{offsetX}+#{offsetY} #{inputFilePath}[0] - | convert -depth 8 -size #{tileWidth}x#{tileHeight} -resize #{targetWidth}x#{targetHeight}! #{mapComponents}:- #{outputFilePath}</parameterString>
          <installationDirective>You need to install ImageMagick.</installationDirective>
        </command>
    
        <command enabled="true" name="converter">
          <commandLine>convert</commandLine>
          <parameterString>-define registry:temporary-path=#{java.io.tmpdir} -quiet #{inputFilePath}[0] #{outputFilePath}</parameterString>
          <winParameterString>-define registry:temporary-path=#{java.io.tmpdir} -quiet #{inputFilePath}[0] #{outputFilePath}</winParameterString>
          <installationDirective>You need to install ImageMagick.</installationDirective>
        </command>
    
        <command enabled="true" name="multiTiler">
          <commandLine>convert</commandLine>
          <parameterString>-define registry:temporary-path=#{java.io.tmpdir} -quiet #{inputFilePath}[0] -crop #{tileWidth}x#{tileHeight} +repage #{outputFilePath}</parameterString>
          <installationDirective>You need to install ImageMagick.</installationDirective>
        </command>
    
      </extension>