Interface ContentTransformer

    • Method Summary

      All Methods Instance Methods Abstract Methods Deprecated Methods 
      Modifier and Type Method Description
      java.lang.String getComments​(boolean available)
      Deprecated.
      Overridden to supply a comment or String of commented out transformation properties that specify any (hard coded or implied) supported transformations.
      long getMaxSourceSizeKBytes​(java.lang.String sourceMimetype, java.lang.String targetMimetype, TransformationOptions options)
      Deprecated.
      Returns the maximum source size (in KBytes) allowed given the supplied values.
      java.lang.String getName()
      Deprecated.
      Returns transformer's name used in configuration.
      long getTransformationTime()
      Deprecated.
      use mimetype specific version.
      long getTransformationTime​(java.lang.String sourceMimetype, java.lang.String targetMimetype)
      Deprecated.
      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)
      Deprecated.
      Use transformer priority and unsupported transformer properties.
      boolean isTransformable​(java.lang.String sourceMimetype, long sourceSize, java.lang.String targetMimetype, TransformationOptions options)
      Deprecated.
      Indicates whether the provided source mimetype can be transformed into the target mimetype with the options specified by this content transformer.
      boolean isTransformable​(java.lang.String sourceMimetype, java.lang.String targetMimetype, TransformationOptions options)
      Deprecated.
      use version with extra sourceSize parameter.
      boolean isTransformableMimetype​(java.lang.String sourceMimetype, java.lang.String targetMimetype, TransformationOptions options)
      Deprecated.
      Sub component of isTransformable(String, long, String, TransformationOptions) that checks just the mimetypes.
      boolean isTransformableSize​(java.lang.String sourceMimetype, long sourceSize, java.lang.String targetMimetype, TransformationOptions options)
      Deprecated.
      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)
      void transform​(org.alfresco.service.cmr.repository.ContentReader reader, org.alfresco.service.cmr.repository.ContentWriter writer, java.util.Map<java.lang.String,​java.lang.Object> options)
      Deprecated.
      Deprecated since 3.0.
      void transform​(org.alfresco.service.cmr.repository.ContentReader reader, org.alfresco.service.cmr.repository.ContentWriter contentWriter, TransformationOptions options)
      Deprecated.
      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)
        Deprecated.
        use version with extra sourceSize parameter.
      • isTransformable

        boolean isTransformable​(java.lang.String sourceMimetype,
                                long sourceSize,
                                java.lang.String targetMimetype,
                                TransformationOptions options)
        Deprecated.
        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​(java.lang.String sourceMimetype,
                                        java.lang.String targetMimetype,
                                        TransformationOptions options)
        Deprecated.
        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​(java.lang.String sourceMimetype,
                                    long sourceSize,
                                    java.lang.String targetMimetype,
                                    TransformationOptions options)
        Deprecated.
        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

        java.lang.String getComments​(boolean available)
        Deprecated.
        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​(java.lang.String sourceMimetype,
                                    java.lang.String targetMimetype,
                                    TransformationOptions options)
        Deprecated.
        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​(java.lang.String sourceMimetype,
                                         java.lang.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​(java.lang.String sourceMimetype,
                                   java.lang.String targetMimetype)
        Deprecated.
        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

        @Deprecated
        void transform​(org.alfresco.service.cmr.repository.ContentReader reader,
                       org.alfresco.service.cmr.repository.ContentWriter writer,
                       java.util.Map<java.lang.String,​java.lang.Object> 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 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
        Deprecated.
        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:
        org.alfresco.service.cmr.repository.ContentIOException - if an IO exception occurs
      • getName

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