Package org.nuxeo.ecm.core.convert.api
Interface ConversionService
- All Known Subinterfaces:
ConversionServiceManager
- All Known Implementing Classes:
ConversionServiceImpl
public interface ConversionService
Interface for the Conversion Service.
- Author:
- tiry
-
Method Summary
Modifier and TypeMethodDescriptionconvert
(String converterName, BlobHolder blobHolder, Map<String, Serializable> parameters) Converts a Blob given a converter name.convertToMimeType
(String destinationMimeType, BlobHolder blobHolder, Map<String, Serializable> parameters) Converts a Blob given a target destination MimeType.getConversionResult
(String id, boolean cleanTransientStoreEntry) Returns the conversion result for the givenid
if any,null
otherwise.Returns the status of a scheduled conversion given itsid
, ornull
if no conversion scheduled.default String
getConverterName
(String sourceMimeType, String destinationMimeType) Returns the converter name for the givensourceMimeType
anddestinationMimeType
.getConverterName
(String sourceMimeType, String destinationMimeType, boolean allowWildcard) Returns the converter name for the givensourceMimeType
anddestinationMimeType
.getConverterNames
(String sourceMimeType, String destinationMimeType) Returns the list of converter names handling the givensourceMimeType
anddestinationMimeType
.getConverterNames
(String sourceMimeType, String destinationMimeType, boolean allowWildcard) Returns the list of converter names handling the givensourceMimeType
anddestinationMimeType
.Returns the names of the registered converters.isConverterAvailable
(String converterName) Checks for converter availability.isConverterAvailable
(String converterName, boolean refresh) Checks for converter availability.boolean
isSourceMimeTypeSupported
(String converterName, String sourceMimeType) Returns true if the converter supports the givensourceMimeType
, false otherwise.scheduleConversion
(String converterName, BlobHolder blobHolder, Map<String, Serializable> parameters) Schedules a conversion given a converter name.scheduleConversionToMimeType
(String destinationMimeType, BlobHolder blobHolder, Map<String, Serializable> parameters) Schedules a conversion given a target mime type.
-
Method Details
-
getConverterName
Returns the converter name for the givensourceMimeType
anddestinationMimeType
.Follows the algorithm of
getConverterNames(String, String)
. -
getConverterName
Returns the converter name for the givensourceMimeType
anddestinationMimeType
.Follows the algorithm of
getConverterNames(String, String, boolean)
.- Since:
- 11.1
- See Also:
-
getConverterNames
Returns the list of converter names handling the givensourceMimeType
anddestinationMimeType
. -
getConverterNames
List<String> getConverterNames(String sourceMimeType, String destinationMimeType, boolean allowWildcard) Returns the list of converter names handling the givensourceMimeType
anddestinationMimeType
.Finds the converter names based on the following algorithm:
- Find the converters exactly matching the given
sourceMimeType
- If no converter found, find the converters matching a wildcard subtype based on the
sourceMimeType
, such has "image/*" - If no converter found and
allowWildcard
istrue
, find the converters matching a wildcard source mime type "*" - Then, filter only the converters matching the given
destinationMimeType
- Parameters:
allowWildcard
-true
to allow returning converters with '*' as source mime type.- Since:
- 11.1
- Find the converters exactly matching the given
-
convert
BlobHolder convert(String converterName, BlobHolder blobHolder, Map<String, Serializable> parameters) throws ConversionExceptionConverts a Blob given a converter name.- Throws:
ConversionException
-
convertToMimeType
BlobHolder convertToMimeType(String destinationMimeType, BlobHolder blobHolder, Map<String, Serializable> parameters) throws ConversionExceptionConverts a Blob given a target destination MimeType.- Throws:
ConversionException
-
getRegistredConverters
Returns the names of the registered converters. -
isConverterAvailable
ConverterCheckResult isConverterAvailable(String converterName, boolean refresh) throws ConverterNotRegistered Checks for converter availability.Result can be:
ConverterNotRegistered
if converter is not registered.- Error Message / Installation message if converter dependencies are not available an successful check.
- Throws:
ConverterNotRegistered
-
isConverterAvailable
Checks for converter availability.Result can be:
ConverterNotRegistered
if converter is not registered.- Error Message / Installation message if converter dependencies are not available an successful check.
Result can be taken from an internal cache.
- Throws:
ConversionException
-
isSourceMimeTypeSupported
Returns true if the converter supports the givensourceMimeType
, false otherwise.- Since:
- 5.8
-
scheduleConversion
String scheduleConversion(String converterName, BlobHolder blobHolder, Map<String, Serializable> parameters) Schedules a conversion given a converter name.Returns a conversion id to be used by
getConversionResult(String, boolean)
.- Since:
- 7.4
-
scheduleConversionToMimeType
String scheduleConversionToMimeType(String destinationMimeType, BlobHolder blobHolder, Map<String, Serializable> parameters) Schedules a conversion given a target mime type.Returns a conversion id to be used by
getConversionResult(String, boolean)
.- Since:
- 7.10
-
getConversionStatus
Returns the status of a scheduled conversion given itsid
, ornull
if no conversion scheduled.- Since:
- 7.4
-
getConversionResult
Returns the conversion result for the givenid
if any,null
otherwise.- Since:
- 7.4
-