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 java.lang.Object implements org.springframework.beans.factory.BeanNameAwareDeprecated.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(java.lang.String sourceMimetype, java.lang.String targetMimetype, java.lang.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(java.lang.Object obj)Deprecated.java.lang.StringgetBeanName()Deprecated.Returns the Spring bean name.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.protected java.lang.StringgetCommentsOnlySupports(java.util.List<java.lang.String> sourceMimetypes, java.util.List<java.lang.String> targetMimetypes, boolean available)Deprecated.Helper method forgetComments(boolean)to create a line that indicates which source and target mimetypes it supports.protected java.lang.StringgetExtensionOrAny(java.lang.String mimetype)Deprecated.protected java.lang.StringgetMimetype(org.alfresco.service.cmr.repository.ContentAccessor content)Deprecated.Convenience to fetch and check the mimetype for the given contentprotected org.alfresco.service.cmr.repository.MimetypeServicegetMimetypeService()Deprecated.java.lang.StringgetName()Deprecated.Returns transformer name.static java.lang.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(java.lang.String sourceMimetype, java.lang.String targetMimetype, TransformationOptions options)Deprecated.Should now use priority and unsupported transformer properties.booleanisSupportedTransformation(java.lang.String sourceMimetype, java.lang.String targetMimetype, TransformationOptions options)Deprecated.protected java.lang.StringonlySupports(java.lang.String sourceMimetype, java.lang.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(java.lang.String beanName)Deprecated.Sets the Spring bean name.voidsetExplicitTransformations(java.util.List<ExplictTransformationDetails> explicitTransformations)Deprecated.supported transformations are now set with global properties rather than spring configuration.voidsetMimetypeService(org.alfresco.service.cmr.repository.MimetypeService mimetypeService)Deprecated.Helper setter of the mimetype service.voidsetSupportedTransformations(java.util.List<SupportedTransformation> supportedTransformations)Deprecated.supported transformations are now set with global properties rather than spring configuration.voidsetTransformerConfig(TransformerConfig transformerConfig)Deprecated.voidsetUnsupportedTransformations(java.util.List<SupportedTransformation> unsupportedTransformations)Deprecated.supported transformations are now set with global properties rather than spring configuration.java.lang.StringtoString()Deprecated.
-
-
-
Field Detail
-
transformerConfig
protected TransformerConfig transformerConfig
Deprecated.
-
-
Method Detail
-
setMimetypeService
public void setMimetypeService(org.alfresco.service.cmr.repository.MimetypeService mimetypeService)
Deprecated.Helper setter of the mimetype service. This is not always required.- Parameters:
mimetypeService- MimetypeService
-
getMimetypeService
protected org.alfresco.service.cmr.repository.MimetypeService getMimetypeService()
Deprecated.- Returns:
- Returns the mimetype helper
-
setExplicitTransformations
public void setExplicitTransformations(java.util.List<ExplictTransformationDetails> explicitTransformations)
Deprecated.supported transformations are now set with global properties rather than spring configuration.
-
setSupportedTransformations
public void setSupportedTransformations(java.util.List<SupportedTransformation> supportedTransformations)
Deprecated.supported transformations are now set with global properties rather than spring configuration.
-
setUnsupportedTransformations
public void setUnsupportedTransformations(java.util.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 java.lang.String getMimetype(org.alfresco.service.cmr.repository.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:
org.alfresco.error.AlfrescoRuntimeException- if the content doesn't have a mimetype
-
isExplicitTransformation
public boolean isExplicitTransformation(java.lang.String sourceMimetype, java.lang.String targetMimetype, TransformationOptions options)Deprecated.Should now use priority and unsupported transformer properties.
-
isSupportedTransformation
public boolean isSupportedTransformation(java.lang.String sourceMimetype, java.lang.String targetMimetype, TransformationOptions options)Deprecated.
-
setBeanName
public void setBeanName(java.lang.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 java.lang.String getBeanName()
Deprecated.Returns the Spring bean name.
-
getName
public java.lang.String getName()
Deprecated.Returns transformer name. Uses the Spring bean name, but if null uses the class name.
-
getSimpleName
public static java.lang.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(java.lang.String sourceMimetype, java.lang.String targetMimetype, java.lang.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.
-
getExtensionOrAny
protected java.lang.String getExtensionOrAny(java.lang.String mimetype)
Deprecated.
-
toString
public java.lang.String toString()
Deprecated.- Overrides:
toStringin classjava.lang.Object
-
getComments
public java.lang.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 java.lang.String getCommentsOnlySupports(java.util.List<java.lang.String> sourceMimetypes, java.util.List<java.lang.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 java.lang.String onlySupports(java.lang.String sourceMimetype, java.lang.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".
-
hashCode
public int hashCode()
Deprecated.- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
Deprecated.- Overrides:
equalsin classjava.lang.Object
-
-