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
Generic converter executing a contributed command line.
The command line to call is stored in the CommandLineName
parameter.
The target file name is in the targetFileName
parameter. 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
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
Fields inherited from class org.nuxeo.ecm.platform.convert.plugins.CommandLineBasedConverter
CMD_NAME_PARAMETER, initParameters, TMP_PATH_PARAMETER
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected BlobHolder
buildResult
(List<String> cmdOutput, CmdParameters cmdParams) Builds result from commandLine output buffer.getCmdBlobParameters
(BlobHolder blobHolder, Map<String, Serializable> parameters) Extracts BlobParameters.getCmdStringParameters
(BlobHolder blobHolder, Map<String, Serializable> parameters) Extracts String parameters.Methods inherited from class org.nuxeo.ecm.platform.convert.plugins.CommandLineBasedConverter
convert, execOnBlob, getCommandName, getTmpDirectory, init, isConverterAvailable
-
Field Details
-
SOURCE_FILE_PATH_KEY
- See Also:
-
OUT_DIR_PATH_KEY
- See Also:
-
TARGET_FILE_NAME_KEY
- See Also:
-
TARGET_FILE_PATH_KEY
- See Also:
-
RESERVED_PARAMETERS
-
-
Constructor Details
-
CommandLineConverter
public CommandLineConverter()
-
-
Method Details
-
getCmdBlobParameters
protected Map<String,Blob> getCmdBlobParameters(BlobHolder blobHolder, Map<String, Serializable> parameters) throws ConversionExceptionDescription copied from class:CommandLineBasedConverter
Extracts BlobParameters.- Specified by:
getCmdBlobParameters
in classCommandLineBasedConverter
- Throws:
ConversionException
-
getCmdStringParameters
protected Map<String,String> getCmdStringParameters(BlobHolder blobHolder, Map<String, Serializable> parameters) throws ConversionExceptionDescription copied from class:CommandLineBasedConverter
Extracts String parameters.- Specified by:
getCmdStringParameters
in classCommandLineBasedConverter
- Throws:
ConversionException
-
buildResult
protected BlobHolder buildResult(List<String> cmdOutput, CmdParameters cmdParams) throws ConversionException Description copied from class:CommandLineBasedConverter
Builds result from commandLine output buffer.- Specified by:
buildResult
in classCommandLineBasedConverter
- Throws:
ConversionException
-