Class StringExtractingContentTransformer

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

    @Deprecated
    public class StringExtractingContentTransformer
    extends AbstractRemoteContentTransformer
    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
    • Field Detail

      • PREFIX_TEXT

        public static final java.lang.String PREFIX_TEXT
        Deprecated.
        See Also:
        Constant Field Values
    • Constructor Detail

      • StringExtractingContentTransformer

        public StringExtractingContentTransformer()
        Deprecated.
    • Method Detail

      • isTransformableMimetype

        public boolean isTransformableMimetype​(java.lang.String sourceMimetype,
                                               java.lang.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
      • transformLocal

        public void transformLocal​(org.alfresco.service.cmr.repository.ContentReader reader,
                                   org.alfresco.service.cmr.repository.ContentWriter writer,
                                   TransformationOptions options)
                            throws java.lang.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:
        transformLocal in class AbstractRemoteContentTransformer
        Throws:
        java.lang.Exception
      • transformRemote

        protected void transformRemote​(RemoteTransformerClient remoteTransformerClient,
                                       org.alfresco.service.cmr.repository.ContentReader reader,
                                       org.alfresco.service.cmr.repository.ContentWriter writer,
                                       TransformationOptions options,
                                       java.lang.String sourceMimetype,
                                       java.lang.String targetMimetype,
                                       java.lang.String sourceExtension,
                                       java.lang.String targetExtension,
                                       java.lang.String targetEncoding)
                                throws java.lang.Exception
        Deprecated.
        Specified by:
        transformRemote in class AbstractRemoteContentTransformer
        Throws:
        java.lang.Exception