Class StringExtractingContentTransformer

  • All Implemented Interfaces:
    ContentWorker, ContentTransformer, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware

    @Deprecated
    public class StringExtractingContentTransformer
    extends AbstractContentTransformer2
    Deprecated.
    The transformations code is being moved out of the codebase and replaced by the new async RenditionService2 or other external libraries.
    Converts any textual format to plain text.

    The transformation is sensitive to the source and target string encodings.

    Author:
    Derek Hulley
    • Constructor Detail

      • StringExtractingContentTransformer

        public StringExtractingContentTransformer()
        Deprecated.
    • Method Detail

      • isTransformableMimetype

        public boolean isTransformableMimetype​(String sourceMimetype,
                                               String targetMimetype,
                                               TransformationOptions options)
        Deprecated.
        Gives a high reliability for all translations from text/sometype to text/plain. As the text formats are already text, the characters are preserved and no actual conversion takes place.

        Extraction of text from binary data is wholly unreliable.

        Specified by:
        isTransformableMimetype in interface ContentTransformer
        Overrides:
        isTransformableMimetype in class AbstractContentTransformerLimits
        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
      • transformInternal

        public void transformInternal​(org.alfresco.service.cmr.repository.ContentReader reader,
                                      org.alfresco.service.cmr.repository.ContentWriter writer,
                                      TransformationOptions options)
                               throws Exception
        Deprecated.
        Text to text conversions are done directly using the content reader and writer string manipulation methods.

        Extraction of text from binary content attempts to take the possible character encoding into account. The text produced from this will, if the encoding was correct, be unformatted but valid.

        Specified by:
        transformInternal in class AbstractContentTransformer2
        Parameters:
        reader - the source of the content to transform
        writer - the target to which to write the transformed content
        options - a map of options to use when performing the transformation. The map will never be null.
        Throws:
        Exception - exceptions will be handled by this class - subclasses can throw anything