Overview  Package   Class  Use  Tree  Deprecated  Index  Help 
PREV CLASS   NEXT CLASS FRAMES    NO FRAMES    All Classes
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

org.alfresco.repo.content.transform
Class ContentTransformerHelper
java.lang.Object
  org.alfresco.repo.content.transform.ContentTransformerHelper
All Implemented Interfaces:
org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.Aware
Direct Known Subclasses:
AbstractContentTransformerLimits, RuntimeExecutableContentTransformerWorker

@org.alfresco.api.AlfrescoPublicApi
public class ContentTransformerHelper
extends Object
implements org.springframework.beans.factory.BeanNameAware
A class providing basic functionality shared by both ContentTransformers and ContentTransformerWorkers.
Author:
dward

Field Summary
transformerConfig
Constructor Summary
ContentTransformerHelper()
Method Summary
protected void
deprecatedSetter(String sourceMimetype, String targetMimetype, String suffixAndValue)
          Called by deprecated property setter methods that should no longer be called by Spring configuration as the values are now set using global properties.
boolean
equals(Object obj)
getBeanName()
          Returns the Spring bean name.
getComments(boolean available)
          Overridden to supply a comment or String of commented out transformation properties that specify any (hard coded or implied) supported transformations.
protected String
getCommentsOnlySupports(List<String> sourceMimetypes, List<String> targetMimetypes, boolean available)
          Helper method for getComments(boolean) to create a line that indicates which source and target mimetypes it supports.
protected String
getExtensionOrAny(String mimetype)
protected String
getMimetype(ContentAccessor content)
          Convenience to fetch and check the mimetype for the given content
protected MimetypeService
getMimetypeService()
getName()
          Returns transformer name.
static String
getSimpleName(ContentTransformer transformer)
          Returns the simple form of the transformer name, which has had the normal "transformer." prefix to the Spring bean name removed.
int
hashCode()
boolean
isExplicitTransformation(String sourceMimetype, String targetMimetype, TransformationOptions options)
          Deprecated. Should now use priority and unsupported transformer properties.
boolean
isSupportedTransformation(String sourceMimetype, String targetMimetype, TransformationOptions options)
protected String
onlySupports(String sourceMimetype, String targetMimetype, boolean available)
          Helper method for getComments(boolean) to create a line that indicates which source and target mimetypes it supports.
void
register()
          THIS IS A CUSTOM SPRING INIT METHOD
void
setBeanName(String beanName)
          Sets the Spring bean name.
void
setExplicitTransformations(List<org.alfresco.repo.content.transform.ExplictTransformationDetails> explicitTransformations)
          Deprecated. supported transformations are now set with global properties rather than spring configuration.
void
setMimetypeService(MimetypeService mimetypeService)
          Helper setter of the mimetype service.
void
setSupportedTransformations(List<org.alfresco.repo.content.transform.SupportedTransformation> supportedTransformations)
          Deprecated. supported transformations are now set with global properties rather than spring configuration.
void
setTransformerConfig(TransformerConfig transformerConfig)
void
setUnsupportedTransformations(List<org.alfresco.repo.content.transform.SupportedTransformation> unsupportedTransformations)
          Deprecated. supported transformations are now set with global properties rather than spring configuration.
toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Field Detail
transformerConfig
protected TransformerConfig transformerConfig
Constructor Detail
ContentTransformerHelper
public ContentTransformerHelper()
Method Detail
setMimetypeService
public void setMimetypeService(MimetypeService mimetypeService)
Helper setter of the mimetype service. This is not always required.
Parameters:
mimetypeService - MimetypeService

getMimetypeService
protected MimetypeService getMimetypeService()
Returns:
Returns the mimetype helper

setExplicitTransformations
public void setExplicitTransformations(List<org.alfresco.repo.content.transform.ExplictTransformationDetails> explicitTransformations)
Deprecated. supported transformations are now set with global properties rather than spring configuration.

setSupportedTransformations
public void setSupportedTransformations(List<org.alfresco.repo.content.transform.SupportedTransformation> supportedTransformations)
Deprecated. supported transformations are now set with global properties rather than spring configuration.

setUnsupportedTransformations
public void setUnsupportedTransformations(List<org.alfresco.repo.content.transform.SupportedTransformation> unsupportedTransformations)
Deprecated. supported transformations are now set with global properties rather than spring configuration.

setTransformerConfig
public void setTransformerConfig(TransformerConfig transformerConfig)

getMimetype
protected String getMimetype(ContentAccessor content)
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.
See Also:
ContentTransformer.isExplicitTransformation(java.lang.String, java.lang.String, org.alfresco.service.cmr.repository.TransformationOptions)

isSupportedTransformation
public boolean isSupportedTransformation(String sourceMimetype,
                                         String targetMimetype,
                                         TransformationOptions options)

setBeanName
public void setBeanName(String beanName)
Sets the Spring bean name.
Specified by:
setBeanName in interface org.springframework.beans.factory.BeanNameAware

register
public void register()
THIS IS A CUSTOM SPRING INIT METHOD

getBeanName
public String getBeanName()
Returns the Spring bean name.

getName
public String getName()
Returns transformer name. Uses the Spring bean name, but if null uses the class name.

getSimpleName
public static String getSimpleName(ContentTransformer transformer)
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)
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 String getExtensionOrAny(String mimetype)

toString
public String toString()
Overrides:
toString in class Object

getComments
public String getComments(boolean available)
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 {link AbstractContentTransformerLimits.isTransformableMimetype(String, String, TransformationOptions) or ContentTransformerWorker.isTransformable(String, String, TransformationOptions) have been overridden. See getCommentsOnlySupports(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. false indicates 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)
Helper method for getComments(boolean) to create a line that indicates which source and target mimetypes it supports.
Parameters:
sourceMimetypes - List
targetMimetypes - List
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)
Helper method for getComments(boolean) to create a line that indicates which source and target mimetypes it supports.
Parameters:
sourceMimetype - String
targetMimetype - String
available - TODO
Returns:
a String of the form "# only supports xxx to aaa\n".

hashCode
public int hashCode()
Overrides:
hashCode in class Object

equals
public boolean equals(Object obj)
Overrides:
equals in class Object

Overview  Package   Class  Use  Tree  Deprecated  Index  Help 
PREV CLASS   NEXT CLASS FRAMES    NO FRAMES    All Classes
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

Copyright © 2005–2018 Alfresco Software. All rights reserved.

Java API documentation generated with DocFlex/Javadoc 1.6.1 using JavadocPro template set.