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 Details

    • 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
    • transformsTransformOptionNames

      protected final Set<String> transformsTransformOptionNames
  • Method Details

    • 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
      Throws:
      UnsupportedTransformationException
      ContentIOException
    • getName

      public String getName()
      Specified by:
      getName in interface LocalTransform
      Returns:
      the name of the transform.
    • getTransformsTransformOptionNames

      public Set<String> getTransformsTransformOptionNames()
    • transform

      public void transform(ContentReader reader, ContentWriter writer, Map<String,String> transformOptions, String renditionName, NodeRef sourceNodeRef)
      Description copied from interface: LocalTransform
      Requests a synchronous transform.
      Specified by:
      transform in interface LocalTransform
      Parameters:
      reader - of the source content
      writer - to the target node's content
      transformOptions - 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.