@AlfrescoPublicApi public class ContentTransformerHelper extends Object implements org.springframework.beans.factory.BeanNameAware
ContentTransformer
s and ContentTransformerWorker
s.Modifier and Type | Field and Description |
---|---|
protected TransformerConfig |
transformerConfig |
Constructor and Description |
---|
ContentTransformerHelper() |
Modifier and Type | Method and Description |
---|---|
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) |
String |
getBeanName()
Returns the Spring bean name.
|
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.
|
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(org.alfresco.service.cmr.repository.ContentAccessor content)
Convenience to fetch and check the mimetype for the given content
|
protected org.alfresco.service.cmr.repository.MimetypeService |
getMimetypeService() |
String |
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<ExplictTransformationDetails> explicitTransformations)
Deprecated.
supported transformations are now set with global properties rather than spring configuration.
|
void |
setMimetypeService(org.alfresco.service.cmr.repository.MimetypeService mimetypeService)
Helper setter of the mimetype service.
|
void |
setSupportedTransformations(List<SupportedTransformation> supportedTransformations)
Deprecated.
supported transformations are now set with global properties rather than spring configuration.
|
void |
setTransformerConfig(TransformerConfig transformerConfig) |
void |
setUnsupportedTransformations(List<SupportedTransformation> unsupportedTransformations)
Deprecated.
supported transformations are now set with global properties rather than spring configuration.
|
String |
toString() |
protected TransformerConfig transformerConfig
public void setMimetypeService(org.alfresco.service.cmr.repository.MimetypeService mimetypeService)
mimetypeService
- MimetypeServiceprotected org.alfresco.service.cmr.repository.MimetypeService getMimetypeService()
public void setExplicitTransformations(List<ExplictTransformationDetails> explicitTransformations)
public void setSupportedTransformations(List<SupportedTransformation> supportedTransformations)
public void setUnsupportedTransformations(List<SupportedTransformation> unsupportedTransformations)
public void setTransformerConfig(TransformerConfig transformerConfig)
protected String getMimetype(org.alfresco.service.cmr.repository.ContentAccessor content)
content
- the reader/writer for the contentorg.alfresco.error.AlfrescoRuntimeException
- if the content doesn't have a mimetypepublic boolean isExplicitTransformation(String sourceMimetype, String targetMimetype, TransformationOptions options)
public boolean isSupportedTransformation(String sourceMimetype, String targetMimetype, TransformationOptions options)
public void setBeanName(String beanName)
setBeanName
in interface org.springframework.beans.factory.BeanNameAware
public void register()
public String getBeanName()
public String getName()
public static String getSimpleName(ContentTransformer transformer)
protected void deprecatedSetter(String sourceMimetype, String targetMimetype, String suffixAndValue)
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.public String getComments(boolean available)
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.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.protected String getCommentsOnlySupports(List<String> sourceMimetypes, List<String> targetMimetypes, boolean available)
getComments(boolean)
to
create a line that indicates which source and target mimetypes
it supports.available
- TODOprotected String onlySupports(String sourceMimetype, String targetMimetype, boolean available)
getComments(boolean)
to
create a line that indicates which source and target mimetypes
it supports.sourceMimetype
- StringtargetMimetype
- Stringavailable
- TODOCopyright © 2005–2017 Alfresco Software. All rights reserved.