Class AbstractImageMagickContentTransformerWorker
- java.lang.Object
-
- org.alfresco.repo.content.transform.ContentTransformerHelper
-
- org.alfresco.repo.content.transform.magick.AbstractImageMagickContentTransformerWorker
-
- All Implemented Interfaces:
ContentTransformerWorker,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.InitializingBean
- Direct Known Subclasses:
ImageMagickContentTransformerWorker
@Deprecated public abstract class AbstractImageMagickContentTransformerWorker extends ContentTransformerHelper implements ContentTransformerWorker, org.springframework.beans.factory.InitializingBean
Deprecated.The transformations code is being moved out of the codebase and replaced by the new async RenditionService2 or other external libraries.Abstract helper for transformations based on ImageMagick- Author:
- Derek Hulley
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringMIMETYPE_IMAGE_PREFIXDeprecated.the prefix for mimetypes supported by the transformerprotected RemoteTransformerClientremoteTransformerClientDeprecated.-
Fields inherited from class org.alfresco.repo.content.transform.ContentTransformerHelper
transformerConfig
-
-
Constructor Summary
Constructors Constructor Description AbstractImageMagickContentTransformerWorker()Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidafterPropertiesSet()Deprecated.Checks for the JMagick and ImageMagick dependencies, using the commontransformation methodto check that the sample image can be converted.java.lang.StringgetComments(boolean available)Deprecated.Overridden to supply a comment or String of commented out transformation properties that specify any (hard coded or implied) supported transformations.booleanisAvailable()Deprecated.Checks if this worker is available.static booleanisSupported(java.lang.String mimetype)Deprecated.Some image formats are not supported by ImageMagick, or at least appear not to work.booleanisTransformable(java.lang.String sourceMimetype, java.lang.String targetMimetype, TransformationOptions options)Deprecated.Supports image to image conversion, but only if the JMagick library and required libraries are available.booleanremoteTransformerClientConfigured()Deprecated.protected voidsetAvailable(boolean available)Deprecated.Make the transformer availablevoidsetRemoteTransformerClient(RemoteTransformerClient remoteTransformerClient)Deprecated.Sets the optional remote transformer client which will be used in preference to a local command if available.voidtransform(org.alfresco.service.cmr.repository.ContentReader reader, org.alfresco.service.cmr.repository.ContentWriter writer, TransformationOptions options)Deprecated.protected abstract voidtransformInternal(java.io.File sourceFile, java.lang.String sourceMimetype, java.io.File targetFile, java.lang.String targetMimetype, TransformationOptions options)Deprecated.Transform the image content from the source file to the target fileprotected abstract voidtransformRemote(org.alfresco.service.cmr.repository.ContentReader reader, org.alfresco.service.cmr.repository.ContentWriter writer, TransformationOptions options, java.lang.String sourceMimetype, java.lang.String targetMimetype, java.lang.String sourceExtension, java.lang.String targetExtension)Deprecated.-
Methods inherited from class org.alfresco.repo.content.transform.ContentTransformerHelper
deprecatedSetter, equals, getBeanName, getCommentsOnlySupports, getExtensionOrAny, getMimetype, getMimetypeService, getName, getSimpleName, hashCode, isExplicitTransformation, isSupportedTransformation, onlySupports, register, setBeanName, setExplicitTransformations, setMimetypeService, setSupportedTransformations, setTransformerConfig, setUnsupportedTransformations, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.alfresco.repo.content.transform.ContentTransformerWorker
getVersionString
-
-
-
-
Field Detail
-
MIMETYPE_IMAGE_PREFIX
public static final java.lang.String MIMETYPE_IMAGE_PREFIX
Deprecated.the prefix for mimetypes supported by the transformer- See Also:
- Constant Field Values
-
remoteTransformerClient
protected RemoteTransformerClient remoteTransformerClient
Deprecated.
-
-
Method Detail
-
isAvailable
public boolean isAvailable()
Deprecated.Description copied from interface:ContentTransformerWorkerChecks if this worker is available.- Specified by:
isAvailablein interfaceContentTransformerWorker- Returns:
- Returns true if the transformer is functioning otherwise false
-
setAvailable
protected void setAvailable(boolean available)
Deprecated.Make the transformer available- Parameters:
available- boolean
-
setRemoteTransformerClient
public void setRemoteTransformerClient(RemoteTransformerClient remoteTransformerClient)
Deprecated.Sets the optional remote transformer client which will be used in preference to a local command if available.- Parameters:
remoteTransformerClient- may be null;
-
remoteTransformerClientConfigured
public boolean remoteTransformerClientConfigured()
Deprecated.- Specified by:
remoteTransformerClientConfiguredin interfaceContentTransformerWorker- Returns:
- true if ther worker is using a remote server.
-
afterPropertiesSet
public void afterPropertiesSet()
Deprecated.Checks for the JMagick and ImageMagick dependencies, using the commontransformation methodto check that the sample image can be converted.If initialization is successful, then autoregistration takes place.
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean
-
isSupported
public static boolean isSupported(java.lang.String mimetype)
Deprecated.Some image formats are not supported by ImageMagick, or at least appear not to work.- Parameters:
mimetype- the mimetype to check- Returns:
- Returns true if ImageMagic can handle the given image format
-
isTransformable
public boolean isTransformable(java.lang.String sourceMimetype, java.lang.String targetMimetype, TransformationOptions options)Deprecated.Supports image to image conversion, but only if the JMagick library and required libraries are available.- Specified by:
isTransformablein interfaceContentTransformerWorker
-
getComments
public java.lang.String getComments(boolean available)
Deprecated.Description copied from class:ContentTransformerHelperOverridden to supply a comment or String of commented out transformation properties that specify any (hard coded or implied) supported transformations. Used when providing a list of properties to an administrators who may be setting other transformation properties, via JMX. Consider overriding if {linkAbstractContentTransformerLimits.isTransformableMimetype(String, String, TransformationOptions)orContentTransformerWorker.isTransformable(String, String, TransformationOptions)have been overridden. SeeContentTransformerHelper.getCommentsOnlySupports(List, List, boolean)which may be used to help construct a comment.- Specified by:
getCommentsin interfaceContentTransformerWorker- Overrides:
getCommentsin classContentTransformerHelper- Parameters:
available- indicates if the transformer has been registered and is available to be selected.falseindicates that the transformer is only available as a component of a complex transformer.- Returns:
- one line per property. The simple transformer name is returned by default as a comment.
- See Also:
ContentTransformer.getComments(boolean)
-
transform
public final void transform(org.alfresco.service.cmr.repository.ContentReader reader, org.alfresco.service.cmr.repository.ContentWriter writer, TransformationOptions options) throws java.lang.ExceptionDeprecated.- Specified by:
transformin interfaceContentTransformerWorker- Throws:
java.lang.Exception- See Also:
transformInternal(File, String, File, String, TransformationOptions)
-
transformRemote
protected abstract void transformRemote(org.alfresco.service.cmr.repository.ContentReader reader, org.alfresco.service.cmr.repository.ContentWriter writer, TransformationOptions options, java.lang.String sourceMimetype, java.lang.String targetMimetype, java.lang.String sourceExtension, java.lang.String targetExtension) throws java.lang.IllegalAccessExceptionDeprecated.- Throws:
java.lang.IllegalAccessException
-
transformInternal
protected abstract void transformInternal(java.io.File sourceFile, java.lang.String sourceMimetype, java.io.File targetFile, java.lang.String targetMimetype, TransformationOptions options) throws java.lang.ExceptionDeprecated.Transform the image content from the source file to the target file- Parameters:
sourceFile- the source of the transformationsourceMimetype- the mimetype of the source of the transformationtargetFile- the target of the transformationtargetMimetype- the mimetype of the target of the transformationoptions- the transformation options supported by ImageMagick- Throws:
java.lang.Exception
-
-