org.alfresco.repo.content.transform
Interface ContentTransformer

All Superinterfaces:
ContentWorker
All Known Implementing Classes:
AbstractContentTransformer, AbstractContentTransformer2, AppleIWorksContentTransformer, ArchiveContentTransformer, BinaryPassThroughContentTransformer, ComplexContentTransformer, EMLTransformer, FailoverContentTransformer, HtmlParserContentTransformer, MailContentTransformer, MediaWikiContentTransformer, PdfBoxContentTransformer, PdfBoxPdfToImageContentTransformer, PdfToImageContentTransformer, PoiContentTransformer, PoiHssfContentTransformer, PoiOOXMLContentTransformer, ProxyContentTransformer, RemoteOpenOfficeContentTransformer, StringExtractingContentTransformer, TextMiningContentTransformer, TextToPdfContentTransformer, TikaAutoContentTransformer, TikaPoweredContentTransformer, TikaSpringConfiguredContentTransformer

public interface ContentTransformer
extends ContentWorker

Interface for class that allow content transformation from one mimetype to another.


Method Summary
 long getTransformationTime()
          Provides an estimate, usually a worst case guess, of how long a transformation will take.
 boolean isExplicitTransformation(java.lang.String sourceMimetype, java.lang.String targetMimetype, TransformationOptions options)
          Indicates whether given the provided transformation parmaters this transformer can prvide an explict transformation.
 boolean isTransformable(java.lang.String sourceMimetype, java.lang.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.
 void transform(org.alfresco.service.cmr.repository.ContentReader reader, org.alfresco.service.cmr.repository.ContentWriter writer)
           
 void transform(org.alfresco.service.cmr.repository.ContentReader reader, org.alfresco.service.cmr.repository.ContentWriter writer, java.util.Map options)
          Deprecated. Deprecated since 3.0. Options should now be provided as a TransformationOptions object.
 void transform(org.alfresco.service.cmr.repository.ContentReader reader, org.alfresco.service.cmr.repository.ContentWriter contentWriter, TransformationOptions options)
          Transforms the content provided by the reader and source mimetype to the writer and target mimetype with the provided transformation options.
 

Method Detail

isTransformable

boolean isTransformable(java.lang.String sourceMimetype,
                        java.lang.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.

Parameters:
sourceMimetype - the source mimetype
destinationMimetype - the destination mimetype
options - the transformation options
Returns:
boolean true if this content transformer can satify the mimetypes and options specified, false otherwise

isExplicitTransformation

boolean isExplicitTransformation(java.lang.String sourceMimetype,
                                 java.lang.String targetMimetype,
                                 TransformationOptions options)
Indicates whether given the provided transformation parmaters this transformer can prvide an explict transformation. An explict transformation indicates that the transformation happens directly and not as a result of another transformation process. Explict transformation always take presidence over normal transformations.

Parameters:
sourceMimetype - the source mimetype
targetMimetype - the target mimetype
options - the transformation options
Returns:
boolean true if it is an explicit transformation, flase otherwise

getTransformationTime

long getTransformationTime()
Provides an estimate, usually a worst case guess, of how long a transformation will take.

This method is used to determine, up front, which of a set of equally reliant transformers will be used for a specific transformation.

Returns:
Returns the approximate number of milliseconds per transformation

transform

void transform(org.alfresco.service.cmr.repository.ContentReader reader,
               org.alfresco.service.cmr.repository.ContentWriter writer)
               throws org.alfresco.service.cmr.repository.ContentIOException
Throws:
org.alfresco.service.cmr.repository.ContentIOException
See Also:
ContentTransformer.transform(ContentReader, ContentWriter, TransformationOptions)

transform

@Deprecated
void transform(org.alfresco.service.cmr.repository.ContentReader reader,
                          org.alfresco.service.cmr.repository.ContentWriter writer,
                          java.util.Map options)
               throws org.alfresco.service.cmr.repository.ContentIOException
Deprecated. Deprecated since 3.0. Options should now be provided as a TransformationOptions object.

Transforms the content provided by the reader and source mimetype to the writer and target mimetype.

The transformation viability can be determined by an up front call to #getReliability(String, String).

The source and target mimetypes must be available on the ContentAccessor.getMimetype() methods of both the reader and the writer.

Both reader and writer will be closed after the transformation completes.

Parameters:
reader - the source of the content
writer - the destination of the transformed content
options - options to pass to the transformer. These are transformer dependent and may be null.
Throws:
org.alfresco.service.cmr.repository.ContentIOException - if an IO exception occurs

transform

void transform(org.alfresco.service.cmr.repository.ContentReader reader,
               org.alfresco.service.cmr.repository.ContentWriter contentWriter,
               TransformationOptions options)
               throws org.alfresco.service.cmr.repository.ContentIOException
Transforms the content provided by the reader and source mimetype to the writer and target mimetype with the provided transformation options.

The transformation viability can be determined by an up front call to ContentTransformer.isTransformable(String, String, TransformationOptions).

The source and target mimetypes must be available on the ContentAccessor.getMimetype() methods of both the reader and the writer.

Both reader and writer will be closed after the transformation completes.

The provided options can be null.

Parameters:
reader - the source of the content
contentWriter - the destination of the transformed content
options - transformation options, these can be null
Throws:
org.alfresco.service.cmr.repository.ContentIOException - if an IO exception occurs


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