Class CommandLineBasedConverter
java.lang.Object
org.nuxeo.ecm.platform.convert.plugins.CommandLineBasedConverter
- All Implemented Interfaces:
Converter
,ExternalConverter
- Direct Known Subclasses:
BaseBlenderConverter
,BaseVideoConversionConverter
,Collada2glTFConverter
,CommandLineConverter
,Image2PDFConverter
,PDF2HtmlConverter
,PDF2ImageConverter
,WordPerfect2TextConverter
Base class to implement
Converter
based on CommandLineExecutorService
.- Author:
- tiry
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract BlobHolder
buildResult
(List<String> cmdOutput, CmdParameters cmdParams) Builds result from commandLine output buffer.convert
(BlobHolder blobHolder, Map<String, Serializable> parameters) Main method to handle the real Conversion Job.protected CommandLineBasedConverter.CmdReturn
getCmdBlobParameters
(BlobHolder blobHolder, Map<String, Serializable> parameters) Extracts BlobParameters.getCmdStringParameters
(BlobHolder blobHolder, Map<String, Serializable> parameters) Extracts String parameters.protected String
getCommandName
(BlobHolder blobHolder, Map<String, Serializable> parameters) getTmpDirectory
(Map<String, Serializable> parameters) void
init
(ConverterDescriptor descriptor) Initializes the Converter.Checks if the converter is available.
-
Field Details
-
CMD_NAME_PARAMETER
- See Also:
-
TMP_PATH_PARAMETER
- See Also:
-
initParameters
-
-
Constructor Details
-
CommandLineBasedConverter
public CommandLineBasedConverter()
-
-
Method Details
-
getTmpDirectory
-
convert
public BlobHolder convert(BlobHolder blobHolder, Map<String, Serializable> parameters) throws ConversionExceptionDescription copied from interface:Converter
Main method to handle the real Conversion Job.Returned
BlobHolder
must implementCachableBlobHolder
, otherwise result won't be cached.- Specified by:
convert
in interfaceConverter
- Throws:
ConversionException
-
getCommandName
-
getCmdBlobParameters
protected abstract Map<String,Blob> getCmdBlobParameters(BlobHolder blobHolder, Map<String, Serializable> parameters) throws ConversionExceptionExtracts BlobParameters.- Throws:
ConversionException
-
getCmdStringParameters
protected abstract Map<String,String> getCmdStringParameters(BlobHolder blobHolder, Map<String, Serializable> parameters) throws ConversionExceptionExtracts String parameters.- Throws:
ConversionException
-
buildResult
protected abstract BlobHolder buildResult(List<String> cmdOutput, CmdParameters cmdParams) throws ConversionException Builds result from commandLine output buffer.- Throws:
ConversionException
-
execOnBlob
protected CommandLineBasedConverter.CmdReturn execOnBlob(String commandName, Map<String, Blob> blobParameters, Map<String, throws ConversionExceptionString> parameters) - Throws:
ConversionException
-
init
Description copied from interface:Converter
Initializes the Converter.This can be used to retrieve some configuration information from the XMap Descriptor.
-
isConverterAvailable
Description copied from interface:ExternalConverter
Checks if the converter is available.- Specified by:
isConverterAvailable
in interfaceExternalConverter
-