@AlfrescoPublicApi public class ComplexContentTransformer extends AbstractContentTransformer2 implements org.springframework.beans.factory.InitializingBean
transformerDebug
transformerConfig
Constructor and Description |
---|
ComplexContentTransformer() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet()
Ensures that required properties have been set
|
String |
getComments(boolean available)
Returns the transformer properties predefined (hard coded or implied) by this transformer.
|
List<String> |
getIntermediateMimetypes() |
List<ContentTransformer> |
getIntermediateTransformers() |
protected TransformationOptionLimits |
getLimits(String sourceMimetype,
String targetMimetype,
TransformationOptions options)
Returns the limits from this transformer combined with those of the first transformer in the chain.
|
protected boolean |
isPageLimitSupported(String sourceMimetype,
String targetMimetype,
TransformationOptions options)
Indicates if 'page' limits are supported by the first transformer in the chain.
|
boolean |
isTransformable(String sourceMimetype,
long sourceSize,
String targetMimetype,
TransformationOptions options)
Indicates whether the provided source mimetype can be transformed into the target mimetype with
the options specified by this content transformer.
|
boolean |
isTransformableMimetype(String sourceMimetype,
String targetMimetype,
TransformationOptions options)
Indicates if this transformer is able to transform the given source mimetype
to the target mimetype.
|
void |
setContentService(ContentService contentService)
Sets the ContentService.
|
void |
setIntermediateMimetypes(List<String> intermediateMimetypes)
Set the intermediate mimetypes that the transformer must take the content
through.
|
void |
setTransformationOptionOverrides(Map<String,Serializable> transformationOptionOverrides)
Sets any properties to be set on the TransformationOption as passed in.
|
void |
setTransformers(List<ContentTransformer> transformers)
The list of transformers to use.
|
void |
transformInternal(org.alfresco.service.cmr.repository.ContentReader reader,
org.alfresco.service.cmr.repository.ContentWriter writer,
TransformationOptions options)
Method to be implemented by subclasses wishing to make use of the common infrastructural code
provided by this class.
|
checkTransformable, getExecutorService, getRetryTransformOnDifferentMimeType, getStrictMimeTypeCheck, getTransformationTime, getTransformationTime, isTransformationLimitedInternally, recordError, recordTime, recordTime, register, setAdditionalThreadTimout, setExecutorService, setMetadataExtracterConfig, setRegisterTransformer, setRegistry, setRetryTransformOnDifferentMimeType, setStrictMimeTypeCheck, setUseTimeoutThread, toString, transform, transform, transform
getLimits, getLimits, getMaxPages, getMaxSourceSizeKBytes, getMaxSourceSizeKBytes, getPageLimit, getReadLimitKBytes, getReadLimitTimeMs, getTimeoutMs, isTransformable, isTransformableSize, setLimits, setMaxPages, setMaxSourceSizeKBytes, setMimetypeLimits, setPageLimit, setPageLimitsSupported, setReaderLimits, setReadLimitKBytes, setReadLimitTimeMs, setTimeoutMs, setTransformerDebug
deprecatedSetter, equals, getBeanName, getCommentsOnlySupports, getExtensionOrAny, getMimetype, getMimetypeService, getName, getSimpleName, hashCode, isExplicitTransformation, isSupportedTransformation, onlySupports, setBeanName, setExplicitTransformations, setMimetypeService, setSupportedTransformations, setTransformerConfig, setUnsupportedTransformations
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getName, isExplicitTransformation
public void setTransformers(List<ContentTransformer> transformers)
If a single transformer is supplied, then it will still be used.
transformers
- list of at least one transformersetContentService(ContentService)
public void setIntermediateMimetypes(List<String> intermediateMimetypes)
transformers
taking part in the
transformation.intermediateMimetypes
- intermediate mimetypes to transition the content
through.public void setTransformationOptionOverrides(Map<String,Serializable> transformationOptionOverrides)
TransformationOptions
are changed, others are ignored.public void setContentService(ContentService contentService)
null
transformers
are provided to setTransformers(List)
.contentService
- public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
Exception
public boolean isTransformable(String sourceMimetype, long sourceSize, String targetMimetype, TransformationOptions options)
AbstractContentTransformerLimits
Implementation calls the deprecated overloaded method without the sourceSize parameter
and then AbstractContentTransformerLimits.isTransformableSize(String, long, String, TransformationOptions)
.
isTransformable
in interface ContentTransformer
isTransformable
in class AbstractContentTransformerLimits
sourceMimetype
- the source mimetypesourceSize
- the size (bytes) of the source. If negative it is unknown.targetMimetype
- the target mimetypeoptions
- the transformation optionspublic boolean isTransformableMimetype(String sourceMimetype, String targetMimetype, TransformationOptions options)
AbstractContentTransformerLimits
ContentTransformerHelper.getComments(boolean)
.isTransformableMimetype
in interface ContentTransformer
isTransformableMimetype
in class AbstractContentTransformerLimits
sourceMimetype
- the source mimetypetargetMimetype
- the target mimetypeoptions
- the transformation optionsprotected boolean isPageLimitSupported(String sourceMimetype, String targetMimetype, TransformationOptions options)
isPageLimitSupported
in class AbstractContentTransformerLimits
protected TransformationOptionLimits getLimits(String sourceMimetype, String targetMimetype, TransformationOptions options)
getLimits
in class AbstractContentTransformerLimits
public void transformInternal(org.alfresco.service.cmr.repository.ContentReader reader, org.alfresco.service.cmr.repository.ContentWriter writer, TransformationOptions options) throws Exception
AbstractContentTransformer2
transformInternal
in class AbstractContentTransformer2
reader
- the source of the content to transformwriter
- the target to which to write the transformed contentoptions
- a map of options to use when performing the transformation. The map
will never be null.Exception
- exceptions will be handled by this class - subclasses can throw anythingAbstractContentTransformer2.transformInternal(org.alfresco.service.cmr.repository.ContentReader, org.alfresco.service.cmr.repository.ContentWriter, org.alfresco.service.cmr.repository.TransformationOptions)
public List<ContentTransformer> getIntermediateTransformers()
public String getComments(boolean available)
getComments
in interface ContentTransformer
getComments
in class ContentTransformerHelper
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.Copyright © 2005–2017 Alfresco Software. All rights reserved.