Overview  Package   Class  Use  Tree  Deprecated  Index  Help 
PREV CLASS   NEXT CLASS FRAMES    NO FRAMES    All Classes
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

org.alfresco.repo.content.transform
Interface ContentTransformer
All Superinterfaces:
ContentWorker
All Known Implementing Classes:
AbstractContentTransformer2, AbstractContentTransformerLimits, ComplexContentTransformer, FailoverContentTransformer, ProxyContentTransformer

@org.alfresco.api.AlfrescoPublicApi
public interface ContentTransformer
extends ContentWorker
Interface for class that allow content transformation from one mimetype to another.
Author:
Derek Hulley

Method Summary
getComments(boolean available)
          Overridden to supply a comment or String of commented out transformation properties that specify any (hard coded or implied) supported transformations.
long
getMaxSourceSizeKBytes(String sourceMimetype, String targetMimetype, TransformationOptions options)
          Returns the maximum source size (in KBytes) allowed given the supplied values.
getName()
          Returns transformer's name used in configuration.
long
getTransformationTime()
          Deprecated. use mimetype specific version.
long
getTransformationTime(String sourceMimetype, String targetMimetype)
          Provides an estimate, usually a worst case guess, of how long a transformation will take.
boolean
isExplicitTransformation(String sourceMimetype, String targetMimetype, TransformationOptions options)
          Deprecated. Use transformer priority and unsupported transformer properties. Indicates whether given the provided transformation parameters this transformer can provide an explicit transformation. An explicit transformation indicates that the transformation happens directly and not as a result of another transformation process. Explicit transformation always take presidency over normal transformations.
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
isTransformable(String sourceMimetype, String targetMimetype, TransformationOptions options)
          Deprecated. use version with extra sourceSize parameter.
boolean
isTransformableMimetype(String sourceMimetype, String targetMimetype, TransformationOptions options)
          Sub component of isTransformable(String, long, String, TransformationOptions) that checks just the mimetypes.
boolean
isTransformableSize(String sourceMimetype, long sourceSize, String targetMimetype, TransformationOptions options)
          Sub component of isTransformable(String, long, String, TransformationOptions) that checks just the size limits.
void
transform(ContentReader reader, ContentWriter writer)
void
transform(ContentReader reader, ContentWriter writer, Map<String,Object> options)
          Deprecated. Deprecated since 3.0. Options should now be provided as a TransformationOptions object.
void
transform(ContentReader reader, 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(String sourceMimetype,
                        String targetMimetype,
                        TransformationOptions options)
Deprecated. use version with extra sourceSize parameter.

isTransformable
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.
Parameters:
sourceMimetype - the source mimetype
sourceSize - the size (bytes) of the source. If negative it is unknown.
targetMimetype - the target mimetype
options - the transformation options
Returns:
boolean true if this content transformer can satify the mimetypes and options specified, false otherwise

isTransformableMimetype
boolean isTransformableMimetype(String sourceMimetype,
                                String targetMimetype,
                                TransformationOptions options)
Sub component of isTransformable(String, long, String, TransformationOptions) that checks just the mimetypes.
Parameters:
sourceMimetype - the source mimetype
targetMimetype - the target mimetype
options - the transformation options
Returns:
boolean true if this content transformer can satify the mimetypes, false otherwise

isTransformableSize
boolean isTransformableSize(String sourceMimetype,
                            long sourceSize,
                            String targetMimetype,
                            TransformationOptions options)
Sub component of isTransformable(String, long, String, TransformationOptions) that checks just the size limits.
Parameters:
sourceMimetype - the source mimetype
sourceSize - the size (bytes) of the source. If negative it is unknown.
targetMimetype - the target mimetype
options - the transformation options
Returns:
boolean true if this content transformer can satify the mimetypes, false otherwise

getComments
String getComments(boolean available)
Overridden to supply a comment or String of commented out transformation properties that specify any (hard coded or implied) supported transformations. Used when providing a list of properties to an administrators who may be setting other transformation properties, via JMX. Consider overriding if {link AbstractContentTransformerLimits.isTransformableMimetype(String, String, TransformationOptions) or ContentTransformerWorker.isTransformable(String, String, TransformationOptions) have been overridden.
Parameters:
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.
Returns:
one line per property. The simple transformer name is returned by default as a comment.

getMaxSourceSizeKBytes
long getMaxSourceSizeKBytes(String sourceMimetype,
                            String targetMimetype,
                            TransformationOptions options)
Returns the maximum source size (in KBytes) allowed given the supplied values.
Returns:
0 if the the transformation is disabled, -1 if there is no limit, otherwise the size in KBytes.

isExplicitTransformation
boolean isExplicitTransformation(String sourceMimetype,
                                 String targetMimetype,
                                 TransformationOptions options)
Deprecated. Use transformer priority and unsupported transformer properties. Indicates whether given the provided transformation parameters this transformer can provide an explicit transformation. An explicit transformation indicates that the transformation happens directly and not as a result of another transformation process. Explicit transformation always take presidency 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, false otherwise

getTransformationTime
long getTransformationTime()
Deprecated. use mimetype specific version.

getTransformationTime
long getTransformationTime(String sourceMimetype,
                           String targetMimetype)
Provides an estimate, usually a worst case guess, of how long a transformation will take. Null mimetype values provide the overall value for the transformer.

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

Parameters:
sourceMimetype - the source mimetype
targetMimetype - the target mimetype
Returns:
Returns the approximate number of milliseconds per transformation

transform
void transform(ContentReader reader,
               ContentWriter writer)
        throws ContentIOException
Throws:
ContentIOException
See Also:
transform(ContentReader, ContentWriter, TransformationOptions)

transform
@Deprecated
void transform(ContentReader reader,
               ContentWriter writer,
               Map<String,Object> options)
        throws 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 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:
ContentIOException - if an IO exception occurs

transform
void transform(ContentReader reader,
               ContentWriter contentWriter,
               TransformationOptions options)
        throws 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 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:
ContentIOException - if an IO exception occurs

getName
String getName()
Returns transformer's name used in configuration.

Overview  Package   Class  Use  Tree  Deprecated  Index  Help 
PREV CLASS   NEXT CLASS FRAMES    NO FRAMES    All Classes
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

Copyright © 2005–2018 Alfresco Software. All rights reserved.

Java API documentation generated with DocFlex/Javadoc 1.6.1 using JavadocPro template set.