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 implementConverter
based onCommandLineExecutorService
.- Author:
- tiry
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
CommandLineBasedConverter.CmdReturn
-
Field Summary
Fields Modifier and Type Field Description protected static String
CMD_NAME_PARAMETER
protected Map<String,String>
initParameters
protected static String
TMP_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 BlobHolder
buildResult(List<String> cmdOutput, CmdParameters cmdParams)
Builds result from commandLine output buffer.BlobHolder
convert(BlobHolder blobHolder, Map<String,Serializable> parameters)
Main method to handle the real Conversion Job.protected CommandLineBasedConverter.CmdReturn
execOnBlob(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 CommandLineExecutorService
getCommandLineService()
Deprecated.Since 7.4.protected String
getCommandName(BlobHolder blobHolder, Map<String,Serializable> parameters)
String
getTmpDirectory(Map<String,Serializable> parameters)
void
init(ConverterDescriptor descriptor)
Initializes the Converter.ConverterCheckResult
isConverterAvailable()
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: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
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:Converter
Initializes the Converter.This can be used to retrieve some configuration information from the XMap Descriptor.
-
isConverterAvailable
public ConverterCheckResult isConverterAvailable()
Description copied from interface:ExternalConverter
Checks if the converter is available.- Specified by:
isConverterAvailable
in interfaceExternalConverter
-
-