@AlfrescoPublicApi public interface ContentTransformer extends ContentWorker
Modifier and Type | Method and Description |
---|---|
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.
|
long |
getMaxSourceSizeKBytes(String sourceMimetype,
String targetMimetype,
TransformationOptions options)
Returns the maximum source size (in KBytes) allowed given the supplied values.
|
String |
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(org.alfresco.service.cmr.repository.ContentReader reader,
org.alfresco.service.cmr.repository.ContentWriter writer)
Deprecated.
Deprecated use {link
transform(ContentReader, ContentWriter, TransformationOptions) . |
void |
transform(org.alfresco.service.cmr.repository.ContentReader reader,
org.alfresco.service.cmr.repository.ContentWriter writer,
Map<String,Object> 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.
|
boolean isTransformable(String sourceMimetype, String targetMimetype, TransformationOptions options)
boolean isTransformable(String sourceMimetype, long sourceSize, String targetMimetype, TransformationOptions options)
sourceMimetype
- the source mimetypesourceSize
- the size (bytes) of the source. If negative it is unknown.targetMimetype
- the target mimetypeoptions
- the transformation optionsboolean isTransformableMimetype(String sourceMimetype, String targetMimetype, TransformationOptions options)
isTransformable(String, long, String, TransformationOptions)
that checks just the mimetypes.sourceMimetype
- the source mimetypetargetMimetype
- the target mimetypeoptions
- the transformation optionsboolean isTransformableSize(String sourceMimetype, long sourceSize, String targetMimetype, TransformationOptions options)
isTransformable(String, long, String, TransformationOptions)
that checks just the size limits.sourceMimetype
- the source mimetypesourceSize
- the size (bytes) of the source. If negative it is unknown.targetMimetype
- the target mimetypeoptions
- the transformation optionsString getComments(boolean available)
AbstractContentTransformerLimits.isTransformableMimetype(String, String, TransformationOptions)
or ContentTransformerWorker.isTransformable(String, String, TransformationOptions)
have been overridden.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.long getMaxSourceSizeKBytes(String sourceMimetype, String targetMimetype, TransformationOptions options)
boolean isExplicitTransformation(String sourceMimetype, String targetMimetype, TransformationOptions options)
sourceMimetype
- the source mimetypetargetMimetype
- the target mimetypeoptions
- the transformation optionslong getTransformationTime()
long getTransformationTime(String sourceMimetype, String targetMimetype)
This method is used to determine, up front, which of a set of equally reliant transformers will be used for a specific transformation.
sourceMimetype
- the source mimetypetargetMimetype
- the target mimetypevoid transform(org.alfresco.service.cmr.repository.ContentReader reader, org.alfresco.service.cmr.repository.ContentWriter writer) throws org.alfresco.service.cmr.repository.ContentIOException
transform(ContentReader, ContentWriter, TransformationOptions)
.org.alfresco.service.cmr.repository.ContentIOException
transform(ContentReader, ContentWriter, TransformationOptions)
@Deprecated void transform(org.alfresco.service.cmr.repository.ContentReader reader, org.alfresco.service.cmr.repository.ContentWriter writer, Map<String,Object> options) throws org.alfresco.service.cmr.repository.ContentIOException
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.
reader
- the source of the contentwriter
- the destination of the transformed contentoptions
- options to pass to the transformer. These are transformer dependent
and may be null.org.alfresco.service.cmr.repository.ContentIOException
- if an IO exception occursvoid transform(org.alfresco.service.cmr.repository.ContentReader reader, org.alfresco.service.cmr.repository.ContentWriter contentWriter, TransformationOptions options) throws org.alfresco.service.cmr.repository.ContentIOException
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.
reader
- the source of the contentcontentWriter
- the destination of the transformed contentoptions
- transformation options, these can be nullorg.alfresco.service.cmr.repository.ContentIOException
- if an IO exception occursString getName()
Copyright © 2005–2017 Alfresco Software. All rights reserved.