org.alfresco.repo.content.transform
Class ComplexContentTransformer

java.lang.Object
  extended by org.alfresco.repo.content.transform.ContentTransformerHelper
      extended by org.alfresco.repo.content.transform.AbstractContentTransformer2
          extended by org.alfresco.repo.content.transform.ComplexContentTransformer
All Implemented Interfaces:
ContentWorker, ContentTransformer, org.springframework.beans.factory.InitializingBean

public class ComplexContentTransformer
extends AbstractContentTransformer2
implements org.springframework.beans.factory.InitializingBean

Transformer that passes a document through several nested transformations in order to accomplish its goal.


Constructor Summary
ComplexContentTransformer()
           
 
Method Summary
 void afterPropertiesSet()
          Ensures that required properties have been set
 java.util.List getIntermediateMimetypes()
           
 boolean isTransformable(java.lang.String sourceMimetype, java.lang.String targetMimetype, TransformationOptions options)
          Check we can transform all the way along the chain of mimetypes
 void setIntermediateMimetypes(java.util.List intermediateMimetypes)
          Set the intermediate mimetypes that the transformer must take the content through.
 void setTransformationOptionOverrides(java.util.Map transformationOptionOverrides)
          Sets any properties to be set on the TransformationOption as passed in.
 void setTransformers(java.util.List 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.
 
Methods inherited from class org.alfresco.repo.content.transform.AbstractContentTransformer2
checkTransformable, getTransformationTime, recordTime, register, setRegistry, toString, transform, transform, transform
 
Methods inherited from class org.alfresco.repo.content.transform.ContentTransformerHelper
getMimetype, getMimetypeService, isExplicitTransformation, setExplicitTransformations, setMimetypeService
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.alfresco.repo.content.transform.ContentTransformer
isExplicitTransformation
 

Constructor Detail

ComplexContentTransformer

public ComplexContentTransformer()
Method Detail

setTransformers

public void setTransformers(java.util.List transformers)
The list of transformers to use.

If a single transformer is supplied, then it will still be used.

Parameters:
transformers - list of at least one transformer

setIntermediateMimetypes

public void setIntermediateMimetypes(java.util.List intermediateMimetypes)
Set the intermediate mimetypes that the transformer must take the content through. If the transformation A..B..C is performed in order to simulate A..C, then B is the intermediate mimetype. There must always be n-1 intermediate mimetypes, where n is the number of transformers taking part in the transformation.

Parameters:
intermediateMimetypes - intermediate mimetypes to transition the content through.

setTransformationOptionOverrides

public void setTransformationOptionOverrides(java.util.Map transformationOptionOverrides)
Sets any properties to be set on the TransformationOption as passed in. This allows you to force certain properties to always be set on it, to control the transformers in a different way to their default. Note that only properties that are supported by the passed-in TransformationOptions are changed, others are ignored.

Parameters:
transformationOptionOverrides -

afterPropertiesSet

public void afterPropertiesSet()
                        throws java.lang.Exception
Ensures that required properties have been set

Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
java.lang.Exception

isTransformable

public boolean isTransformable(java.lang.String sourceMimetype,
                               java.lang.String targetMimetype,
                               TransformationOptions options)
Check we can transform all the way along the chain of mimetypes

Specified by:
isTransformable in interface ContentTransformer
Parameters:
sourceMimetype - the source mimetype
options - the transformation options
Returns:
boolean true if this content transformer can satify the mimetypes and options specified, false otherwise
See Also:
ContentTransformer.isTransformable(java.lang.String, java.lang.String, org.alfresco.service.cmr.repository.TransformationOptions)

transformInternal

public void transformInternal(org.alfresco.service.cmr.repository.ContentReader reader,
                              org.alfresco.service.cmr.repository.ContentWriter writer,
                              TransformationOptions options)
                       throws java.lang.Exception
Description copied from class: AbstractContentTransformer2
Method to be implemented by subclasses wishing to make use of the common infrastructural code provided by this class.

Specified by:
transformInternal in class AbstractContentTransformer2
Parameters:
reader - the source of the content to transform
writer - the target to which to write the transformed content
options - a map of options to use when performing the transformation. The map will never be null.
Throws:
java.lang.Exception - exceptions will be handled by this class - subclasses can throw anything
See Also:
AbstractContentTransformer2.transformInternal(org.alfresco.service.cmr.repository.ContentReader, org.alfresco.service.cmr.repository.ContentWriter, org.alfresco.service.cmr.repository.TransformationOptions)

getIntermediateMimetypes

public java.util.List getIntermediateMimetypes()


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.