Class AbstractLocalTransform
- java.lang.Object
-
- org.alfresco.repo.content.transform.AbstractLocalTransform
-
- All Implemented Interfaces:
LocalTransform
- Direct Known Subclasses:
LocalFailoverTransform,LocalPassThroughTransform,LocalPipelineTransform,LocalTransformImpl
public abstract class AbstractLocalTransform extends Object implements LocalTransform
Abstract supper class for local transformer using flat transform options.
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.apache.commons.logging.Loglogprotected MimetypeServicemimetypeServiceprotected Stringnameprotected TransformerDebugtransformerDebugprotected Set<String>transformsTransformOptionNames
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description StringgetName()Map<String,String>getStrippedTransformOptions(Map<String,String> transformOptions)Returns a subset of the supplied actual transform options from the rendition definition that are known to this transformer.Set<String>getTransformsTransformOptionNames()abstract booleanisAvailable()voidtransform(ContentReader reader, ContentWriter writer, Map<String,String> transformOptions, String renditionName, NodeRef sourceNodeRef)Requests a synchronous transform.protected abstract voidtransformImpl(ContentReader reader, ContentWriter writer, Map<String,String> transformOptions, String sourceMimetype, String targetMimetype, String sourceExtension, String targetExtension, String renditionName, NodeRef sourceNodeRef)
-
-
-
Field Detail
-
log
protected static final org.apache.commons.logging.Log log
-
name
protected final String name
-
mimetypeService
protected final MimetypeService mimetypeService
-
transformerDebug
protected final TransformerDebug transformerDebug
-
-
Method Detail
-
isAvailable
public abstract boolean isAvailable()
-
transformImpl
protected abstract void transformImpl(ContentReader reader, ContentWriter writer, Map<String,String> transformOptions, String sourceMimetype, String targetMimetype, String sourceExtension, String targetExtension, String renditionName, NodeRef sourceNodeRef) throws UnsupportedTransformationException, ContentIOException
-
getName
public String getName()
-
transform
public void transform(ContentReader reader, ContentWriter writer, Map<String,String> transformOptions, String renditionName, NodeRef sourceNodeRef)
Description copied from interface:LocalTransformRequests a synchronous transform.- Specified by:
transformin interfaceLocalTransform- Parameters:
reader- of the source contentwriter- to the target node's contenttransformOptions- the actual name value pairs available that could be passed to the Transform Service.renditionName- (optional) name for the set of options and target mimetype. If supplied is used to cache results to avoid having to work out if a given transformation is supported a second time. The sourceMimetype and sourceSizeInBytes may still change. In the case of ACS this is the rendition name.sourceNodeRef- the source node
-
getStrippedTransformOptions
public Map<String,String> getStrippedTransformOptions(Map<String,String> transformOptions)
Returns a subset of the supplied actual transform options from the rendition definition that are known to this transformer. The ones that will be passed to the T-Engine. It strips out extra ones.- Parameters:
transformOptions- the complete set of actual transform options. This will be returned if all options are known to this transformer. Otherwise a new Map is returned.- Returns:
- the transformOptions to be past to the T-Engine.
-
-