Class ContentTransformerHelper
- java.lang.Object
-
- org.alfresco.repo.content.transform.ContentTransformerHelper
-
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware
- Direct Known Subclasses:
AbstractContentTransformerLimits,AbstractImageMagickContentTransformerWorker,AlfrescoPdfRendererContentTransformerWorker,OOoContentTransformerHelper,RuntimeExecutableContentTransformerWorker
@Deprecated @AlfrescoPublicApi public class ContentTransformerHelper extends Object implements org.springframework.beans.factory.BeanNameAware
Deprecated.The transformations code is being moved out of the codebase and replaced by the new async RenditionService2 or other external libraries.A class providing basic functionality shared by bothContentTransformers andContentTransformerWorkers.- Author:
- dward
-
-
Field Summary
Fields Modifier and Type Field Description protected TransformerConfigtransformerConfigDeprecated.
-
Constructor Summary
Constructors Constructor Description ContentTransformerHelper()Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voiddeprecatedSetter(String sourceMimetype, String targetMimetype, String suffixAndValue)Deprecated.Called by deprecated property setter methods that should no longer be called by Spring configuration as the values are now set using global properties.booleanequals(Object obj)Deprecated.StringgetBeanName()Deprecated.Returns the Spring bean name.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.protected StringgetCommentsOnlySupports(List<String> sourceMimetypes, List<String> targetMimetypes, boolean available)Deprecated.Helper method forgetComments(boolean)to create a line that indicates which source and target mimetypes it supports.protected StringgetExtensionOrAny(String mimetype)Deprecated.protected StringgetMimetype(ContentAccessor content)Deprecated.Convenience to fetch and check the mimetype for the given contentprotected MimetypeServicegetMimetypeService()Deprecated.StringgetName()Deprecated.Returns transformer name.static StringgetSimpleName(ContentTransformer transformer)Deprecated.Returns the simple form of the transformer name, which has had the normal "transformer." prefix to the Spring bean name removed.inthashCode()Deprecated.booleanisExplicitTransformation(String sourceMimetype, String targetMimetype, TransformationOptions options)Deprecated.Should now use priority and unsupported transformer properties.booleanisSupportedTransformation(String sourceMimetype, String targetMimetype, TransformationOptions options)Deprecated.protected StringonlySupports(String sourceMimetype, String targetMimetype, boolean available)Deprecated.Helper method forgetComments(boolean)to create a line that indicates which source and target mimetypes it supports.voidregister()Deprecated.THIS IS A CUSTOM SPRING INIT METHODvoidsetBeanName(String beanName)Deprecated.Sets the Spring bean name.voidsetExplicitTransformations(List<ExplictTransformationDetails> explicitTransformations)Deprecated.supported transformations are now set with global properties rather than spring configuration.voidsetMimetypeService(MimetypeService mimetypeService)Deprecated.Helper setter of the mimetype service.voidsetSupportedTransformations(List<SupportedTransformation> supportedTransformations)Deprecated.supported transformations are now set with global properties rather than spring configuration.voidsetTransformerConfig(TransformerConfig transformerConfig)Deprecated.voidsetUnsupportedTransformations(List<SupportedTransformation> unsupportedTransformations)Deprecated.supported transformations are now set with global properties rather than spring configuration.StringtoString()Deprecated.
-
-
-
Field Detail
-
transformerConfig
protected TransformerConfig transformerConfig
Deprecated.
-
-
Method Detail
-
setMimetypeService
public void setMimetypeService(MimetypeService mimetypeService)
Deprecated.Helper setter of the mimetype service. This is not always required.- Parameters:
mimetypeService- MimetypeService
-
getMimetypeService
protected MimetypeService getMimetypeService()
Deprecated.- Returns:
- Returns the mimetype helper
-
setExplicitTransformations
public void setExplicitTransformations(List<ExplictTransformationDetails> explicitTransformations)
Deprecated.supported transformations are now set with global properties rather than spring configuration.
-
setSupportedTransformations
public void setSupportedTransformations(List<SupportedTransformation> supportedTransformations)
Deprecated.supported transformations are now set with global properties rather than spring configuration.
-
setUnsupportedTransformations
public void setUnsupportedTransformations(List<SupportedTransformation> unsupportedTransformations)
Deprecated.supported transformations are now set with global properties rather than spring configuration.
-
setTransformerConfig
public void setTransformerConfig(TransformerConfig transformerConfig)
Deprecated.
-
getMimetype
protected String getMimetype(ContentAccessor content)
Deprecated.Convenience to fetch and check the mimetype for the given content- Parameters:
content- the reader/writer for the content- Returns:
- Returns the mimetype for the content
- Throws:
AlfrescoRuntimeException- if the content doesn't have a mimetype
-
isExplicitTransformation
public boolean isExplicitTransformation(String sourceMimetype, String targetMimetype, TransformationOptions options)
Deprecated.Should now use priority and unsupported transformer properties.
-
isSupportedTransformation
public boolean isSupportedTransformation(String sourceMimetype, String targetMimetype, TransformationOptions options)
Deprecated.
-
setBeanName
public void setBeanName(String beanName)
Deprecated.Sets the Spring bean name.- Specified by:
setBeanNamein interfaceorg.springframework.beans.factory.BeanNameAware
-
register
public void register()
Deprecated.THIS IS A CUSTOM SPRING INIT METHOD
-
getBeanName
public String getBeanName()
Deprecated.Returns the Spring bean name.
-
getName
public String getName()
Deprecated.Returns transformer name. Uses the Spring bean name, but if null uses the class name.
-
getSimpleName
public static String getSimpleName(ContentTransformer transformer)
Deprecated.Returns the simple form of the transformer name, which has had the normal "transformer." prefix to the Spring bean name removed.
-
deprecatedSetter
protected void deprecatedSetter(String sourceMimetype, String targetMimetype, String suffixAndValue)
Deprecated.Called by deprecated property setter methods that should no longer be called by Spring configuration as the values are now set using global properties.- Parameters:
sourceMimetype- so that the source extension can be worked out once the mimetypeService has been set.targetMimetype- so that the target extension can be worked out once the mimetypeService has been set.suffixAndValue- that should be used.
-
getComments
public String getComments(boolean available)
Deprecated.Overridden 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. SeegetCommentsOnlySupports(List, List, boolean)which may be used to help construct a comment.- 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.
-
getCommentsOnlySupports
protected String getCommentsOnlySupports(List<String> sourceMimetypes, List<String> targetMimetypes, boolean available)
Deprecated.Helper method forgetComments(boolean)to create a line that indicates which source and target mimetypes it supports.- Parameters:
available- TODO- Returns:
- a String of the form "# only supports xxx, yyy or zzz to aaa or bb\n".
-
onlySupports
protected String onlySupports(String sourceMimetype, String targetMimetype, boolean available)
Deprecated.Helper method forgetComments(boolean)to create a line that indicates which source and target mimetypes it supports.- Parameters:
sourceMimetype- StringtargetMimetype- Stringavailable- TODO- Returns:
- a String of the form "# only supports xxx to aaa\n".
-
-