Class CommandLineBasedConverter
java.lang.Object
org.nuxeo.ecm.platform.convert.plugins.CommandLineBasedConverter
- All Implemented Interfaces:
Converter,ExternalConverter
- Direct Known Subclasses:
BaseVideoConversionConverter,CommandLineConverter,Image2PDFConverter,PDF2HtmlConverter,PDF2ImageConverter,WordPerfect2TextConverter
Base class to implement
Converter based on CommandLineExecutorService.- Author:
- tiry
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract BlobHolderbuildResult(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.CmdReturngetCmdBlobParameters(BlobHolder blobHolder, Map<String, Serializable> parameters) Extracts BlobParameters.getCmdStringParameters(BlobHolder blobHolder, Map<String, Serializable> parameters) Extracts String parameters.protected StringgetCommandName(BlobHolder blobHolder, Map<String, Serializable> parameters) getTmpDirectory(Map<String, Serializable> parameters) voidinit(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:ConverterMain method to handle the real Conversion Job.Returned
BlobHoldermust implementCachableBlobHolder, otherwise result won't be cached.- Specified by:
convertin 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:ConverterInitializes the Converter.This can be used to retrieve some configuration information from the XMap Descriptor.
-
isConverterAvailable
Description copied from interface:ExternalConverterChecks if the converter is available.- Specified by:
isConverterAvailablein interfaceExternalConverter
-