Class CommandLineConverter
- java.lang.Object
-
- org.nuxeo.ecm.platform.convert.plugins.CommandLineBasedConverter
-
- org.nuxeo.ecm.platform.convert.plugins.CommandLineConverter
-
- All Implemented Interfaces:
Converter,ExternalConverter
- Direct Known Subclasses:
LibreOfficeConverter
public class CommandLineConverter extends CommandLineBasedConverter
Generic converter executing a contributed command line.The command line to call is stored in the
CommandLineNameparameter.The target file name is in the
targetFileNameparameter. If it's null, a temporary one will be created.All the converter parameters are passed to the command line.
A sample contribution using this converter:
<converter name="pdf2image" class="org.nuxeo.ecm.platform.convert.plugins.CommandLineConverter"> <sourceMimeType>application/pdf</sourceMimeType> <destinationMimeType>image/jpeg</destinationMimeType> <destinationMimeType>image/png</destinationMimeType> <destinationMimeType>image/gif</destinationMimeType> <parameters> <parameter name="CommandLineName">pdftoimage</parameter> </parameters> </converter>- Since:
- 7.1
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.nuxeo.ecm.platform.convert.plugins.CommandLineBasedConverter
CommandLineBasedConverter.CmdReturn
-
-
Field Summary
Fields Modifier and Type Field Description static StringOUT_DIR_PATH_KEYstatic List<String>RESERVED_PARAMETERSstatic StringSOURCE_FILE_PATH_KEYstatic StringTARGET_FILE_NAME_KEYstatic StringTARGET_FILE_PATH_KEY-
Fields inherited from class org.nuxeo.ecm.platform.convert.plugins.CommandLineBasedConverter
CMD_NAME_PARAMETER, initParameters, TMP_PATH_PARAMETER
-
-
Constructor Summary
Constructors Constructor Description CommandLineConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected BlobHolderbuildResult(List<String> cmdOutput, CmdParameters cmdParams)Builds result from commandLine output buffer.protected Map<String,Blob>getCmdBlobParameters(BlobHolder blobHolder, Map<String,Serializable> parameters)Extracts BlobParameters.protected Map<String,String>getCmdStringParameters(BlobHolder blobHolder, Map<String,Serializable> parameters)Extracts String parameters.-
Methods inherited from class org.nuxeo.ecm.platform.convert.plugins.CommandLineBasedConverter
convert, execOnBlob, getCommandLineService, getCommandName, getTmpDirectory, init, isConverterAvailable
-
-
-
-
Field Detail
-
SOURCE_FILE_PATH_KEY
public static final String SOURCE_FILE_PATH_KEY
- See Also:
- Constant Field Values
-
OUT_DIR_PATH_KEY
public static final String OUT_DIR_PATH_KEY
- See Also:
- Constant Field Values
-
TARGET_FILE_NAME_KEY
public static final String TARGET_FILE_NAME_KEY
- See Also:
- Constant Field Values
-
TARGET_FILE_PATH_KEY
public static final String TARGET_FILE_PATH_KEY
- See Also:
- Constant Field Values
-
-
Method Detail
-
getCmdBlobParameters
protected Map<String,Blob> getCmdBlobParameters(BlobHolder blobHolder, Map<String,Serializable> parameters) throws ConversionException
Description copied from class:CommandLineBasedConverterExtracts BlobParameters.- Specified by:
getCmdBlobParametersin classCommandLineBasedConverter- Throws:
ConversionException
-
getCmdStringParameters
protected Map<String,String> getCmdStringParameters(BlobHolder blobHolder, Map<String,Serializable> parameters) throws ConversionException
Description copied from class:CommandLineBasedConverterExtracts String parameters.- Specified by:
getCmdStringParametersin classCommandLineBasedConverter- Throws:
ConversionException
-
buildResult
protected BlobHolder buildResult(List<String> cmdOutput, CmdParameters cmdParams) throws ConversionException
Description copied from class:CommandLineBasedConverterBuilds result from commandLine output buffer.- Specified by:
buildResultin classCommandLineBasedConverter- Throws:
ConversionException
-
-