Platform Explorer / Nuxeo Platform 5.6

Extension point command

Documentation

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 look 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>

Contribution Descriptors

Existing Contributions

Contributions are presented in the same order as the registration order on this extension point. This order is displayed before the contribution name, in brackets.

  • nuxeo-platform-imaging-core-5.6.jar
    <extension point="command" target="org.nuxeo.ecm.platform.commandline.executor.service.CommandLineExecutorComponent">
    
        <command enabled="true" name="identify">
          <commandLine>identify</commandLine>
          <parameterString> -ping -format '%m %w %h %z' #{inputFilePath}</parameterString>
          <winParameterString> -ping -format "%m %w %h %z" #{inputFilePath}</winParameterString>
          <installationDirective>You need to install ImageMagic.</installationDirective>
        </command>
    
        <command enabled="true" name="crop">
          <commandLine>stream</commandLine>
          <parameterString> -map rgb -storage-type char -extract  #{tileWidth}x#{tileHeight}+#{offsetX}+#{offsetY} #{inputFilePath}[0]  - | convert -depth 8 -size #{tileWidth}x#{tileHeight}  rgb:-  #{outputFilePath} </parameterString>
          <winParameterString> -map rgb -storage-type char -extract  #{tileWidth}x#{tileHeight}+#{offsetX}+#{offsetY} #{inputFilePath}  - | convert -depth 8 -size #{tileWidth}x#{tileHeight}  rgb:-  #{outputFilePath} </winParameterString>
          <installationDirective>You need to install ImageMagic.</installationDirective>
        </command>
    
        <command enabled="true" name="resizer">
          <commandLine>convert</commandLine>
          <parameterString>-flatten -resize #{targetWidth}x#{targetHeight} -depth #{targetDepth} #{inputFilePath}[0] #{outputFilePath}</parameterString>
          <winParameterString>-flatten -resize #{targetWidth}x#{targetHeight} -depth #{targetDepth} #{inputFilePath} #{outputFilePath}</winParameterString>
          <installationDirective>You need to install ImageMagic.</installationDirective>
        </command>
    
        <command enabled="true" name="gifResizer">
          <commandLine>convert</commandLine>
          <parameterString>#{inputFilePath} -coalesce -resize #{targetWidth}x#{targetHeight} -depth #{targetDepth} -deconstruct #{outputFilePath}</parameterString>
          <installationDirective>You need to install ImageMagic.</installationDirective>
        </command>
    
        <command enabled="true" name="rotate">
          <commandLine>convert</commandLine>
          <parameterString>-rotate #{angle} #{inputFilePath}[0] #{outputFilePath}</parameterString>
          <winParameterString>-rotate #{angle} #{inputFilePath} #{outputFilePath}</winParameterString>
          <installationDirective>You need to install ImageMagic.</installationDirective>
        </command>
    
        <command enabled="true" name="cropAndResize">
          <commandLine>stream</commandLine>
          <parameterString> -map rgb -storage-type char -extract  #{tileWidth}x#{tileHeight}+#{offsetX}+#{offsetY} #{inputFilePath} - | convert -depth 8 -size #{tileWidth}x#{tileHeight} -resize #{targetWidth}x#{targetHeight}!  rgb:-  #{outputFilePath} </parameterString>
          <installationDirective>You need to install ImageMagic.</installationDirective>
        </command>
    
        <command enabled="true" name="converter">
          <commandLine>convert</commandLine>
          <parameterString>-colorspace rgb #{inputFilePath}[0] #{outputFilePath}</parameterString>
          <winParameterString>-colorspace rgb #{inputFilePath} #{outputFilePath}</winParameterString>
          <installationDirective>You need to install ImageMagic.</installationDirective>
        </command>
    
        <command enabled="true" name="multiTiler">
          <commandLine>convert</commandLine>
          <parameterString>#{inputFilePath}  -crop #{tileWidth}x#{tileHeight} + repage   #{outputFilePath}</parameterString>
          <installationDirective>You need to install ImageMagic.</installationDirective>
        </command>
    
      </extension>
  • nuxeo-platform-convert-5.6.jar
    <extension point="command" target="org.nuxeo.ecm.platform.commandline.executor.service.CommandLineExecutorComponent">
    
        <command enabled="true" name="pdftohtml">
          <commandLine>pdftohtml</commandLine>
          <parameterString> -c -enc UTF-8 -noframes #{inFilePath} #{outDirPath}/index.html</parameterString>
          <winParameterString> -c -enc UTF-8 -noframes #{inFilePath} #{outDirPath}\index.html</winParameterString>
          <installationDirective>You need to install pdftohtml</installationDirective>
        </command>
    
      </extension>
  • nuxeo-platform-convert-5.6.jar
    <extension point="command" target="org.nuxeo.ecm.platform.commandline.executor.service.CommandLineExecutorComponent">
    
        <command enabled="true" name="pdftoimage">
          <commandLine>convert</commandLine>
          <parameterString>#{sourceFilePath} #{targetFilePath}</parameterString>
          <installationDirective>You need to install ImageMagick.</installationDirective>
        </command>
    
      </extension>
  • nuxeo-platform-convert-5.6.jar
    <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-video-convert-5.6-RC3.jar
    <extension point="command" target="org.nuxeo.ecm.platform.commandline.executor.service.CommandLineExecutorComponent">
    
        <command enabled="true" name="ffmpeg-info">
          <commandLine>ffmpeg</commandLine>
          <parameterString> -i #{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} -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>
          <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>