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
public abstract class CommandLineBasedConverter extends Object implements ExternalConverter
Base class to implementConverterbased onCommandLineExecutorService.- Author:
- tiry
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classCommandLineBasedConverter.CmdReturn
-
Field Summary
Fields Modifier and Type Field Description protected static StringCMD_NAME_PARAMETERprotected Map<String,String>initParametersprotected static StringTMP_PATH_PARAMETER
-
Constructor Summary
Constructors Constructor Description CommandLineBasedConverter()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected abstract BlobHolderbuildResult(List<String> cmdOutput, CmdParameters cmdParams)Builds result from commandLine output buffer.BlobHolderconvert(BlobHolder blobHolder, Map<String,Serializable> parameters)Main method to handle the real Conversion Job.protected CommandLineBasedConverter.CmdReturnexecOnBlob(String commandName, Map<String,Blob> blobParameters, Map<String,String> parameters)protected abstract Map<String,Blob>getCmdBlobParameters(BlobHolder blobHolder, Map<String,Serializable> parameters)Extracts BlobParameters.protected abstract Map<String,String>getCmdStringParameters(BlobHolder blobHolder, Map<String,Serializable> parameters)Extracts String parameters.protected CommandLineExecutorServicegetCommandLineService()Deprecated.Since 7.4.protected StringgetCommandName(BlobHolder blobHolder, Map<String,Serializable> parameters)StringgetTmpDirectory(Map<String,Serializable> parameters)voidinit(ConverterDescriptor descriptor)Initializes the Converter.ConverterCheckResultisConverterAvailable()Checks if the converter is available.
-
-
-
Field Detail
-
CMD_NAME_PARAMETER
protected static final String CMD_NAME_PARAMETER
- See Also:
- Constant Field Values
-
TMP_PATH_PARAMETER
protected static final String TMP_PATH_PARAMETER
- See Also:
- Constant Field Values
-
-
Method Detail
-
getCommandLineService
@Deprecated protected CommandLineExecutorService getCommandLineService()
Deprecated.Since 7.4. Useless.
-
getTmpDirectory
public String getTmpDirectory(Map<String,Serializable> parameters)
-
convert
public BlobHolder convert(BlobHolder blobHolder, Map<String,Serializable> parameters) throws ConversionException
Description 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
protected String getCommandName(BlobHolder blobHolder, Map<String,Serializable> parameters)
-
getCmdBlobParameters
protected abstract Map<String,Blob> getCmdBlobParameters(BlobHolder blobHolder, Map<String,Serializable> parameters) throws ConversionException
Extracts BlobParameters.- Throws:
ConversionException
-
getCmdStringParameters
protected abstract Map<String,String> getCmdStringParameters(BlobHolder blobHolder, Map<String,Serializable> parameters) throws ConversionException
Extracts 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,String> parameters) throws ConversionException
- Throws:
ConversionException
-
init
public void init(ConverterDescriptor descriptor)
Description copied from interface:ConverterInitializes the Converter.This can be used to retrieve some configuration information from the XMap Descriptor.
-
isConverterAvailable
public ConverterCheckResult isConverterAvailable()
Description copied from interface:ExternalConverterChecks if the converter is available.- Specified by:
isConverterAvailablein interfaceExternalConverter
-
-