Class AdminUiTransformerDebug

  • All Implemented Interfaces:
    org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware
    Direct Known Subclasses:
    LegacyTransformerDebug

    public class AdminUiTransformerDebug
    extends TransformerDebug
    implements org.springframework.context.ApplicationContextAware
    Provides methods to support the Admin UI Test Transform actions.
    Author:
    adavis
    • Field Detail

      • remoteTransformServiceRegistry

        protected org.alfresco.transform.client.registry.TransformServiceRegistry remoteTransformServiceRegistry
    • Constructor Detail

      • AdminUiTransformerDebug

        public AdminUiTransformerDebug()
    • Method Detail

      • setLocalTransformServiceRegistryImpl

        public void setLocalTransformServiceRegistryImpl​(LocalTransformServiceRegistry localTransformServiceRegistryImpl)
      • setRemoteTransformServiceRegistry

        public void setRemoteTransformServiceRegistry​(org.alfresco.transform.client.registry.TransformServiceRegistry remoteTransformServiceRegistry)
      • setApplicationContext

        public void setApplicationContext​(org.springframework.context.ApplicationContext applicationContext)
                                   throws org.springframework.beans.BeansException
        Specified by:
        setApplicationContext in interface org.springframework.context.ApplicationContextAware
        Throws:
        org.springframework.beans.BeansException
      • setContentService

        public void setContentService​(ContentService contentService)
      • getRepositoryHelper

        public Repository getRepositoryHelper()
      • setRepositoryHelper

        public void setRepositoryHelper​(Repository repositoryHelper)
      • setTransactionService

        public void setTransactionService​(TransactionService transactionService)
      • transformationsByExtension

        public String transformationsByExtension​(String sourceExtension,
                                                 String targetExtension,
                                                 boolean toString,
                                                 boolean format42,
                                                 boolean onlyNonDeterministic,
                                                 String renditionName)
        Returns a String and /or debug that provides a list of supported transformations sorted by source and target mimetype extension. Used in the Test Transforms Admin UI.
        Parameters:
        sourceExtension - restricts the list to one source extension. Unrestricted if null.
        targetExtension - restricts the list to one target extension. Unrestricted if null.
        toString - indicates that a String value should be returned in addition to any debug.
        format42 - ignored
        onlyNonDeterministic - ignored
        renditionName - ignored
      • activeTransformer

        protected void activeTransformer​(String sourceMimetype,
                                         String targetMimetype,
                                         int transformerCount,
                                         String priority,
                                         String transformName,
                                         long maxSourceSizeKBytes,
                                         boolean firstTransformer)
      • getSourceMimetypes

        public Collection<String> getSourceMimetypes​(String sourceExtension)
        Returns a collection of mimetypes ordered by extension, but unlike the version in MimetypeService throws an exception if the sourceExtension is supplied but does not match a mimetype.
        Parameters:
        sourceExtension - to restrict the collection to one entry
        Throws:
        IllegalArgumentException - if there is no match. The message indicates this.
      • getTargetMimetypes

        public Collection<String> getTargetMimetypes​(String sourceExtension,
                                                     String targetExtension,
                                                     Collection<String> sourceMimetypes)
        Identical to getSourceMimetypes for the target, but avoids doing the look up if the sourceExtension is the same as the tragetExtension, so will have the same result.
        Parameters:
        sourceExtension - used to restrict the sourceMimetypes
        targetExtension - to restrict the collection to one entry
        sourceMimetypes - that match the sourceExtension
        Throws:
        IllegalArgumentException - if there is no match. The message indicates this.
      • testTransform

        public String testTransform​(String sourceExtension,
                                    String targetExtension,
                                    String renditionName)
      • getTestFileExtensionsAndMimetypes

        public String[] getTestFileExtensionsAndMimetypes()