diff --git a/_ci/static_analysis.sh b/_ci/static_analysis.sh index 606ba702..4badf5aa 100644 --- a/_ci/static_analysis.sh +++ b/_ci/static_analysis.sh @@ -23,8 +23,10 @@ java -jar vosp-api-wrappers-java-$VERACODE_WRAPPER_VERSION.jar -vid $VERACODE_AP alfresco-transform-tika/alfresco-transform-tika-boot/target/alfresco-transform-tika-boot-*.jar \ alfresco-transform-misc/alfresco-transform-misc/target/alfresco-transform-misc-*.jar \ alfresco-transform-misc/alfresco-transform-misc-boot/target/alfresco-transform-misc-boot*.jar \ + alfresco-transform-core-aio/alfresco-transform-core-aio/target/alfresco-transform-core-aio-*.jar \ + alfresco-transform-core-aio/alfresco-transform-core-aio-boot/target/alfresco-transform-core-aio-boot*.jar \ -version "$TRAVIS_JOB_ID - $TRAVIS_JOB_NUMBER" -scantimeout 3600 popd set +vex -echo "=========================== Finishing Static Analysis Script ==========================" \ No newline at end of file +echo "=========================== Finishing Static Analysis Script ==========================" diff --git a/alfresco-transform-core-aio/alfresco-transform-core-aio-boot/Dockerfile b/alfresco-transform-core-aio/alfresco-transform-core-aio-boot/Dockerfile new file mode 100644 index 00000000..01d63651 --- /dev/null +++ b/alfresco-transform-core-aio/alfresco-transform-core-aio-boot/Dockerfile @@ -0,0 +1,70 @@ +# Image provides an all-in-one (AIO) container in which to run core transformations for Alfresco Content Services. + +# Tika is from Apache. See the license at http://www.apache.org/licenses/LICENSE-2.0. +# LibreOffice is from The Document Foundation. See the license at https://www.libreoffice.org/download/license/ or in /libreoffice.txt. +# ImageMagick is from ImageMagick Studio LLC. See the license at http://www.imagemagick.org/script/license.php or in /ImageMagick-license.txt. +# alfresco-pdf-renderer uses the PDFium library from Google Inc. See the license at https://pdfium.googlesource.com/pdfium/+/master/LICENSE or in /pdfium.txt. + +FROM alfresco/alfresco-base-java:11.0.1-openjdk-centos-7-6784d76a7b81 + +ENV APACHE_LICENSE_FILE=https://github.com/Alfresco/acs-community-packaging/blob/master/distribution/src/main/resources/licenses/3rd-party/Apache%202.0.txt + +ARG IMAGEMAGICK_VERSION=7.0.7-27 +ENV IMAGEMAGICK_RPM_URL=https://nexus.alfresco.com/nexus/service/local/repositories/thirdparty/content/org/imagemagick/imagemagick-distribution/${IMAGEMAGICK_VERSION}/imagemagick-distribution-${IMAGEMAGICK_VERSION}-linux.rpm +ENV IMAGEMAGICK_LIB_RPM_URL=https://nexus.alfresco.com/nexus/service/local/repositories/thirdparty/content/org/imagemagick/imagemagick-distribution/${IMAGEMAGICK_VERSION}/imagemagick-distribution-${IMAGEMAGICK_VERSION}-libs-linux.rpm +ENV IMAGEMAGICK_LICENSE_FILE=https://github.com/Alfresco/acs-community-packaging/blob/master/distribution/src/main/resources/licenses/3rd-party/ImageMagick-license.txt + +ARG LIBREOFFICE_VERSION=6.1.6 +ENV LIBREOFFICE_RPM_URL=https://nexus.alfresco.com/nexus/service/local/repositories/thirdparty/content/org/libreoffice/libreoffice-dist/${LIBREOFFICE_VERSION}/libreoffice-dist-${LIBREOFFICE_VERSION}-linux.gz +ENV LIBREOFFICE_LICENSE_FILE=https://github.com/Alfresco/acs-community-packaging/blob/master/distribution/src/main/resources/licenses/3rd-party/libreoffice.txt + +ENV ALFRESCO_PDF_RENDERER_LIB_RPM_URL=https://nexus.alfresco.com/nexus/service/local/repositories/releases/content/org/alfresco/alfresco-pdf-renderer/1.1/alfresco-pdf-renderer-1.1-linux.tgz +ENV PDFIUM_LICENSE_FILE=https://github.com/Alfresco/acs-community-packaging/blob/master/distribution/src/main/resources/licenses/3rd-party/pdfium.txt + +ENV JAVA_OPTS="" + +# Set default user information +ARG GROUPNAME=Alfresco +ARG GROUPID=1000 +ARG AIOUSERNAME=transform-all-in-one +ARG USERID=33017 + +COPY target/alfresco-transform-core-aio-boot-${env.project_version}.jar /usr/bin + +RUN ln /usr/bin/alfresco-transform-core-aio-boot-${env.project_version}.jar /usr/bin/alfresco-transform-core-aio-boot.jar && \ + curl -s -S $IMAGEMAGICK_RPM_URL -o imagemagick-distribution-linux.rpm && \ + curl -s -S $IMAGEMAGICK_LIB_RPM_URL -o imagemagick-distribution-libs-linux.rpm && \ + curl -s -S $IMAGEMAGICK_LICENSE_FILE -o ImageMagick-license.txt && \ + yum localinstall -y imagemagick-distribution-*linux.rpm && \ + rm -f imagemagick-distribution-*.rpm && \ + yum clean all && \ + yum install -y cairo cups-libs libSM && \ + test -f libreoffice-dist-${LIBREOFFICE_VERSION}-linux.gz && \ + ln -s libreoffice-dist-${LIBREOFFICE_VERSION}-linux.gz libreoffice-dist-linux.gz || \ + curl -s -S $LIBREOFFICE_RPM_URL -o libreoffice-dist-linux.gz && \ + curl -s -S $LIBREOFFICE_LICENSE_FILE -o libreoffice.txt && \ + tar xzf libreoffice-dist-linux.gz && \ + yum localinstall -y LibreOffice*/RPMS/*.rpm && \ + rm -rf libreoffice-dist-*linux.gz LibreOffice_*_Linux_x86-64_rpm && \ + yum clean all && \ + curl -s -S $ALFRESCO_PDF_RENDERER_LIB_RPM_URL -o alfresco-pdf-renderer-linux.tgz && \ + curl -s -S $PDFIUM_LICENSE_FILE -o pdfium.txt && \ + tar xf alfresco-pdf-renderer-linux.tgz -C /usr/bin && \ + rm -f alfresco-pdf-renderer-linux.tgz && \ + yum clean all && \ + curl -s -S $APACHE_LICENSE_FILE -o Apache\ 2.0.txt && \ + yum clean all + +ADD target/generated-resources/licenses /licenses +ADD target/generated-resources/licenses.xml /licenses/ +ADD target/generated-sources/license/THIRD-PARTY.txt /licenses/ + +RUN groupadd -g ${GROUPID} ${GROUPNAME} && \ + useradd -u ${USERID} -G ${GROUPNAME} ${AIOUSERNAME} && \ + chgrp -R ${GROUPNAME} /usr/bin/alfresco-transform-core-aio-boot.jar + +EXPOSE 8090 + +USER ${AIOUSERNAME} + +ENTRYPOINT java $JAVA_OPTS -jar /usr/bin/alfresco-transform-core-aio-boot.jar \ No newline at end of file diff --git a/alfresco-transform-core-aio/alfresco-transform-core-aio-boot/pom.xml b/alfresco-transform-core-aio/alfresco-transform-core-aio-boot/pom.xml new file mode 100644 index 00000000..f58f191d --- /dev/null +++ b/alfresco-transform-core-aio/alfresco-transform-core-aio-boot/pom.xml @@ -0,0 +1,291 @@ + + + + 4.0.0 + alfresco-transform-core-aio-boot + Alfresco Core All-In-One Transformer Spring Boot + jar + + + org.alfresco + alfresco-transform-core + 2.2.0-SNAPSHOT + ../../pom.xml + + + + alfresco/alfresco-transform-core-aio + quay.io + ${project.artifactId} + + + + + org.alfresco + alfresco-transformer-base + ${project.version} + + + org.alfresco + alfresco-transform-core-aio + ${project.version} + + + org.alfresco + alfresco-transformer-base + ${project.version} + tests + test-jar + test + + + + org.springframework.boot + spring-boot-starter-thymeleaf + + + org.springframework.boot + spring-boot-starter-test + test + + + com.vaadin.external.google + android-json + + + + + + org.dom4j + dom4j + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + repackage + + + + + + org.codehaus.mojo + license-maven-plugin + + + org.apache.maven.plugins + maven-surefire-plugin + + + org.apache.maven.plugins + maven-failsafe-plugin + + + + + + + + docker-it-setup + + + + + io.fabric8 + docker-maven-plugin + + + + activemq + alfresco/alfresco-activemq:5.15.8 + + activemq + + 8161:8161 + 5672:5672 + 61616:61616 + + + Apache ActiveMQ 5.15.8 .* started + + 500 + 100 + + kill 1 + kill -9 1 + + + + + + + aio + ${image.name}:${image.tag} + + + 8090:8090 + + + + http://localhost:8090/transform/config + GET + 200...299 + + + 500 + 100 + + kill 1 + kill -9 1 + + + + + + + + + + + + + local + + + + io.fabric8 + fabric8-maven-plugin + + + + ${image.name}:${image.tag} + + ${project.basedir}/ + + true + + + + + + + + build-image + package + + build + + + + + + + + + + internal + + + + io.fabric8 + fabric8-maven-plugin + + + + + ${image.name}:${image.tag} + ${image.registry} + + ${project.basedir}/ + + true + + + + + + ${image.name}:${image.tag} + + ${project.basedir}/ + + true + + + + + + + + build-image + package + + build + + + + push-image + install + + push + + + + + + + + + + release + + + + io.fabric8 + fabric8-maven-plugin + + + + + ${image.name}:${project.version} + ${image.registry} + + ${project.basedir}/ + + true + + + + + + ${image.name}:${project.version} + + ${project.basedir}/ + + true + + + + + + + + build-push-image + deploy + + build + push + + + + + + + + + \ No newline at end of file diff --git a/alfresco-transform-core-aio/alfresco-transform-core-aio-boot/src/main/java/org/alfresco/transformer/AIOController.java b/alfresco-transform-core-aio/alfresco-transform-core-aio-boot/src/main/java/org/alfresco/transformer/AIOController.java new file mode 100644 index 00000000..24810cb2 --- /dev/null +++ b/alfresco-transform-core-aio/alfresco-transform-core-aio-boot/src/main/java/org/alfresco/transformer/AIOController.java @@ -0,0 +1,232 @@ +/* + * #%L + * Alfresco Transform Core + * %% + * Copyright (C) 2005 - 2020 Alfresco Software Limited + * %% + * This file is part of the Alfresco software. + * - + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * - + * Alfresco is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * - + * Alfresco is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * - + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + * #L% + */ +package org.alfresco.transformer; + +import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_HTML; +import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_TEXT_PLAIN; +import static org.alfresco.transformer.fs.FileManager.createAttachment; +import static org.alfresco.transformer.fs.FileManager.createSourceFile; +import static org.alfresco.transformer.fs.FileManager.createTargetFile; +import static org.alfresco.transformer.fs.FileManager.createTargetFileName; +import static org.alfresco.transformer.util.RequestParamMap.SOURCE_ENCODING; +import static org.alfresco.transformer.util.RequestParamMap.SOURCE_EXTENSION; +import static org.alfresco.transformer.util.RequestParamMap.SOURCE_MIMETYPE; +import static org.alfresco.transformer.util.RequestParamMap.TARGET_EXTENSION; +import static org.alfresco.transformer.util.RequestParamMap.TARGET_MIMETYPE; +import static org.alfresco.transformer.util.RequestParamMap.TEST_DELAY; +import static org.springframework.http.HttpStatus.BAD_REQUEST; +import static org.springframework.http.HttpStatus.INTERNAL_SERVER_ERROR; +import static org.springframework.http.HttpStatus.OK; +import static org.springframework.http.MediaType.MULTIPART_FORM_DATA_VALUE; + +import java.io.File; +import java.util.List; +import java.util.Map; +import java.util.Arrays; +import java.util.HashMap; + +import javax.servlet.http.HttpServletRequest; + +import org.alfresco.transform.client.model.config.TransformConfig; +import org.alfresco.transform.exceptions.TransformException; +import org.alfresco.transformer.logging.LogEntry; +import org.alfresco.transformer.probes.ProbeTestTransform; +import org.alfresco.transformer.transformers.Transformer; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.io.Resource; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.multipart.MultipartFile; + +@Controller +public class AIOController extends AbstractTransformerController +{ + private static final Logger logger = LoggerFactory.getLogger(AIOController.class); + + @Autowired + private AIOTransformRegistry transformRegistry; + + @Override + public String getTransformerName() + { + return "All in One Transformer"; + } + + @Override + public String version() + { + return getTransformerName() + " available"; + } + + @Override + public void processTransform(File sourceFile, File targetFile, String sourceMimetype, String targetMimetype, + Map transformOptions, Long timeout) + { + + final String transform = getTransformerName(sourceFile, sourceMimetype, targetMimetype, transformOptions); + transformInternal( transform, sourceFile, targetFile, MIMETYPE_HTML, MIMETYPE_TEXT_PLAIN, transformOptions); + + } + + // TODO ATS-713 Currently uses the Misc probeTest. The implementation will need to be changed such that the test can be selected based on the required transform + @Override + public ProbeTestTransform getProbeTestTransform() + { + // HtmlParserContentTransformer html -> text + // See the Javadoc on this method and Probes.md for the choice of these values. + return new ProbeTestTransform(this, "quick.html", "quick.txt", + 119, 30, 150, 1024, + 60 * 2 + 1, 60 * 2) + { + @Override + protected void executeTransformCommand(File sourceFile, File targetFile) + { + Map parameters = new HashMap<>(); + parameters.put(SOURCE_ENCODING, "UTF-8"); + transformInternal( "misc", sourceFile, targetFile, MIMETYPE_HTML, + MIMETYPE_TEXT_PLAIN, parameters); + + + } + }; + } + + @PostMapping(value = "/transform", consumes = MULTIPART_FORM_DATA_VALUE) + public ResponseEntity transform(HttpServletRequest request, + @RequestParam("file") MultipartFile sourceMultipartFile, + @RequestParam(SOURCE_MIMETYPE) String sourceMimetype, + @RequestParam(TARGET_MIMETYPE) String targetMimetype, + @RequestParam(TARGET_EXTENSION) String targetExtension, + @RequestParam Map requestParameters, + @RequestParam (value = TEST_DELAY, required = false) Long testDelay) + { + + debugLogTransform("Request parameters: ", sourceMimetype, targetMimetype, targetExtension, requestParameters); + + //Remove all required parameters from request parameters to get the list of options + List optionsToFilter = Arrays.asList(SOURCE_EXTENSION, TARGET_EXTENSION, TARGET_MIMETYPE, + SOURCE_MIMETYPE, TEST_DELAY); + Map transformOptions = new HashMap<>(requestParameters); + transformOptions.keySet().removeAll(optionsToFilter); + transformOptions.values().removeIf(v -> v.isEmpty()); + + + final String targetFilename = createTargetFileName( + sourceMultipartFile.getOriginalFilename(), targetExtension); + getProbeTestTransform().incrementTransformerCount(); + final File sourceFile = createSourceFile(request, sourceMultipartFile); + final File targetFile = createTargetFile(request, targetFilename); + + final String transform = getTransformerName(sourceFile, sourceMimetype, targetMimetype, transformOptions); + debugLogTransform("Performing transform with parameters: ", sourceMimetype, targetMimetype, + targetExtension, transformOptions); + transformInternal(transform, sourceFile, targetFile, sourceMimetype, targetMimetype, transformOptions); + + + + final ResponseEntity body = createAttachment(targetFilename, targetFile); + LogEntry.setTargetSize(targetFile.length()); + long time = LogEntry.setStatusCodeAndMessage(OK.value(), "Success"); + time += LogEntry.addDelay(testDelay); + getProbeTestTransform().recordTransformTime(time); + return body; + } + + private void debugLogTransform(String message, String sourceMimetype, String targetMimetype, String targetExtension, + Map transformOptions) { + if (logger.isDebugEnabled()) + { + logger.debug( + "{} : sourceMimetype: '{}', targetMimetype: '{}', targetExtension: '{}', transformOptions: '{}'", + message, sourceMimetype, targetMimetype, targetExtension, transformOptions); + } + } + + @Override + public ResponseEntity info() + { + TransformConfig transformConfig = new TransformConfig(); + logger.info("GET Transform Config."); + try + { + transformConfig = transformRegistry.getTransformConfig(); + } + catch (Exception e) + { + throw new TransformException(INTERNAL_SERVER_ERROR.value(), e.getMessage(), e); + } + + return new ResponseEntity<>(transformConfig, OK); + } + + protected void transformInternal(String transformName, File sourceFile, File targetFile, String sourceMimetype, String targetMimetype, + Map transformOptions) + { + logger.debug("Processing request with: sourceFile '{}', targetFile '{}', transformOptions" + + " '{}', timeout {} ms", sourceFile, targetFile, transformOptions); + + Transformer transformer = transformRegistry.getByTransformName(transformName); + + + if (transformer == null) + { + new TransformException(INTERNAL_SERVER_ERROR.value(), "No transformer mapping for - transform:" + + transformName + " sourceMimetype:" + sourceMimetype + " targetMimetype:" + targetMimetype); + } + + if (logger.isDebugEnabled()) + { + logger.debug("Performing transform '{}' using {}", transformName, transformer.getClass().getSimpleName()); + } + + try + { + Map optionsWithTransformName = new HashMap<>(transformOptions); + optionsWithTransformName.put(Transformer.TRANSFORM_NAME_PARAMETER, transformName); + transformer.transform(sourceFile, targetFile, sourceMimetype, targetMimetype, optionsWithTransformName); + + } + catch (TransformException e) + { + throw e; + } + catch (IllegalArgumentException e) + { + throw new TransformException(BAD_REQUEST.value(), e.getMessage(), e); + } + catch (Exception e) + { + throw new TransformException(INTERNAL_SERVER_ERROR.value(), "Failed transform - transform:" + + transformName + " sourceMimetype:" + sourceMimetype + " targetMimetype:" + targetMimetype); + } + + } +} diff --git a/alfresco-transform-core-aio/alfresco-transform-core-aio-boot/src/main/java/org/alfresco/transformer/AIOCustomConfig.java b/alfresco-transform-core-aio/alfresco-transform-core-aio-boot/src/main/java/org/alfresco/transformer/AIOCustomConfig.java new file mode 100644 index 00000000..db89c6ec --- /dev/null +++ b/alfresco-transform-core-aio/alfresco-transform-core-aio-boot/src/main/java/org/alfresco/transformer/AIOCustomConfig.java @@ -0,0 +1,59 @@ +/* + * #%L + * Alfresco Transform Core + * %% + * Copyright (C) 2005 - 2020 Alfresco Software Limited + * %% + * This file is part of the Alfresco software. + * - + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * - + * Alfresco is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * - + * Alfresco is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * - + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + * #L% + */ +package org.alfresco.transformer; + +import org.alfresco.transform.client.registry.TransformServiceRegistry; +import org.alfresco.transformer.transformers.ImageMagickAdapter; +import org.alfresco.transformer.transformers.LibreOfficeAdapter; +import org.alfresco.transformer.transformers.MiscAdapter; +import org.alfresco.transformer.transformers.PdfRendererAdapter; +import org.alfresco.transformer.transformers.TikaAdapter; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Primary; + +@Configuration +public class AIOCustomConfig +{ + /** + * + * @return Override the TransformRegistryImpl used in {@link AbstractTransformerController} + */ + @Bean + @Primary + public TransformServiceRegistry aioTransformRegistry() throws Exception + { + AIOTransformRegistry aioTransformRegistry = new AIOTransformRegistry(); + aioTransformRegistry.registerTransformer(new MiscAdapter()); + aioTransformRegistry.registerTransformer(new TikaAdapter()); + aioTransformRegistry.registerTransformer(new ImageMagickAdapter()); + aioTransformRegistry.registerTransformer(new LibreOfficeAdapter()); + aioTransformRegistry.registerTransformer(new PdfRendererAdapter()); + return aioTransformRegistry; + } + +} diff --git a/alfresco-transform-core-aio/alfresco-transform-core-aio-boot/src/main/java/org/alfresco/transformer/Application.java b/alfresco-transform-core-aio/alfresco-transform-core-aio-boot/src/main/java/org/alfresco/transformer/Application.java new file mode 100644 index 00000000..3a77f21f --- /dev/null +++ b/alfresco-transform-core-aio/alfresco-transform-core-aio-boot/src/main/java/org/alfresco/transformer/Application.java @@ -0,0 +1,79 @@ +/* + * #%L + * Alfresco Transform Core + * %% + * Copyright (C) 2005 - 2020 Alfresco Software Limited + * %% + * This file is part of the Alfresco software. + * - + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * - + * Alfresco is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * - + * Alfresco is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * - + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + * #L% + */ +package org.alfresco.transformer; + +import static org.alfresco.transformer.logging.StandardMessages.LICENCE; + +import java.util.Arrays; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.actuate.autoconfigure.metrics.MeterRegistryCustomizer; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; +import org.springframework.boot.context.event.ApplicationReadyEvent; +import org.springframework.context.annotation.Bean; +import org.springframework.context.event.EventListener; + +import io.micrometer.core.instrument.MeterRegistry; + +@SpringBootApplication +@EnableAutoConfiguration(exclude = {DataSourceAutoConfiguration.class}) +public class Application +{ + private static final Logger logger = LoggerFactory.getLogger(Application.class); + + @Value("${container.name}") + private String containerName; + + @Bean + MeterRegistryCustomizer metricsCommonTags() + { + return registry -> registry.config().commonTags("containerName", containerName); + } + + public static void main(String[] args) + { + SpringApplication.run(Application.class, args); + } + + @EventListener(ApplicationReadyEvent.class) + public void startup() + { + logger.info("--------------------------------------------------------------------------------------------------------------------------------------------------------------"); + Arrays.stream(LICENCE.split("\\n")).forEach(logger::info); + logger.info("The transformers in this project use libraries from Apache. See the license at http://www.apache.org/licenses/LICENSE-2.0. or in /Apache\\\\ 2.0.txt"); + logger.info("Additional libraries used:"); + logger.info("* htmlparser http://htmlparser.sourceforge.net/license.html"); + logger.info("--------------------------------------------------------------------------------------------------------------------------------------------------------------"); + + logger.info("Starting application components... Done"); + } +} diff --git a/alfresco-transform-core-aio/alfresco-transform-core-aio-boot/src/main/resources/application-default.yaml b/alfresco-transform-core-aio/alfresco-transform-core-aio-boot/src/main/resources/application-default.yaml new file mode 100644 index 00000000..f1c633dc --- /dev/null +++ b/alfresco-transform-core-aio/alfresco-transform-core-aio-boot/src/main/resources/application-default.yaml @@ -0,0 +1,2 @@ +queue: + engineRequestQueue: ${TRANSFORM_ENGINE_REQUEST_QUEUE:org.alfresco.transform.engine.aio.acs} \ No newline at end of file diff --git a/alfresco-transform-core-aio/alfresco-transform-core-aio-boot/src/main/resources/quick.html b/alfresco-transform-core-aio/alfresco-transform-core-aio-boot/src/main/resources/quick.html new file mode 100644 index 00000000..76c633d7 --- /dev/null +++ b/alfresco-transform-core-aio/alfresco-transform-core-aio-boot/src/main/resources/quick.html @@ -0,0 +1,17 @@ + + + + + The quick brown fox jumps over the lazy dog + + + + + + + +The quick brown fox jumps over the lazy dog + + + + diff --git a/alfresco-transform-core-aio/alfresco-transform-core-aio-boot/src/main/resources/templates/transformForm.html b/alfresco-transform-core-aio/alfresco-transform-core-aio-boot/src/main/resources/templates/transformForm.html new file mode 100644 index 00000000..b52e9de6 --- /dev/null +++ b/alfresco-transform-core-aio/alfresco-transform-core-aio-boot/src/main/resources/templates/transformForm.html @@ -0,0 +1,162 @@ + + + +
+

All in One Transformer Test Transformation

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
file *
targetExtension *
timeout
testDelay
sourceExtension
targetMimetype
sourceMimetype
targetEncoding
sourceEncoding
includeContents (archive)
notExtractBookmarksText
page
width
height
allowPdfEnlargement
maintainPdfAspectRatio
startPage
endPage
alphaRemove
autoOrient
cropGravity
North, NorthEast...Center
cropWidth
cropHeight
cropPercentage
cropXOffset
cropYOffset
thumbnail
resizeWidth
resizeHeight
resizePercentage
allowEnlargement
maintainAspectRatio
+
+
+ +
+

Tika Test Transformations

+
+ + + + + + + + + + + +
file *
sourceMimetype *
targetExtension *
targetMimetype *
targetEncoding *
includeContents (archive) *
timeout
testDelay
notExtractBookmarksText
+
+
+
+

LibreOffice Test Transformation

+
+ + + + + + + +
file *
targetExtension *
timeout
testDelay
+
+
+
+

Alfresco PDF Renderer Test Transformation

+
+ + + + + + + + + + + + + + +
file *
targetExtension *
timeout
testDelay
page
width
height
allowPdfEnlargement
maintainPdfAspectRatio
+
+
+
+

Miscellaneous Transformers Test Transformation

+
+ + + + + + + + + + + + + +
file *
sourceExtension *
targetExtension *
sourceMimetype *
targetMimetype *
sourceEncoding *
targetEncoding *
timeout
testDelay
+
+
+ +
+

ImageMagick Test Transformation

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
file *
targetExtension *
timeout
testDelay
startPage
endPage
alphaRemove
autoOrient
cropGravity
North, NorthEast...Center
cropWidth
cropHeight
cropPercentage
cropXOffset
cropYOffset
thumbnail
resizeWidth
resizeHeight
resizePercentage
allowEnlargement
maintainAspectRatio
+
+
+ + + + + diff --git a/alfresco-transform-core-aio/alfresco-transform-core-aio-boot/src/test/java/org/alfresco/transformer/AIOControllerTest.java b/alfresco-transform-core-aio/alfresco-transform-core-aio-boot/src/test/java/org/alfresco/transformer/AIOControllerTest.java new file mode 100644 index 00000000..30b877c6 --- /dev/null +++ b/alfresco-transform-core-aio/alfresco-transform-core-aio-boot/src/test/java/org/alfresco/transformer/AIOControllerTest.java @@ -0,0 +1,73 @@ +/* + * #%L + * Alfresco Transform Core + * %% + * Copyright (C) 2005 - 2020 Alfresco Software Limited + * %% + * This file is part of the Alfresco software. + * - + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * - + * Alfresco is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * - + * Alfresco is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * - + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + * #L% + */ +package org.alfresco.transformer; + + +import java.io.IOException; + +import org.alfresco.transform.client.model.TransformRequest; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; +import org.springframework.context.annotation.Import; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@WebMvcTest(AIOController.class) +@Import(AIOCustomConfig.class) +public class AIOControllerTest //extends AbstractTransformerControllerTest +{ + + @Autowired + AIOController aioController; + + //@Override + protected void mockTransformCommand(String sourceExtension, String targetExtension, String sourceMimetype, + boolean readTargetFileBytes) throws IOException { + // TODO Auto-generated method stub + + } + + //@Override + protected AbstractTransformerController getController() { + // TODO Auto-generated method stub + return null; + } + + //@Override + protected void updateTransformRequestWithSpecificOptions(TransformRequest transformRequest) { + // TODO Auto-generated method stub + + } + + @Test + public void emptyTest() + { + aioController.info(); + } +} \ No newline at end of file diff --git a/alfresco-transform-core-aio/alfresco-transform-core-aio/pom.xml b/alfresco-transform-core-aio/alfresco-transform-core-aio/pom.xml new file mode 100644 index 00000000..33c1f0ba --- /dev/null +++ b/alfresco-transform-core-aio/alfresco-transform-core-aio/pom.xml @@ -0,0 +1,74 @@ + + + 4.0.0 + alfresco-transform-core-aio + Alfresco Core All-In-One Transformer + jar + + + alfresco-transform-core + org.alfresco + 2.2.0-SNAPSHOT + ../../pom.xml + + + + + org.alfresco + alfresco-transformer-base + ${project.version} + + + org.alfresco + alfresco-transform-misc + ${project.version} + + + org.alfresco + alfresco-transform-tika + ${project.version} + + + org.alfresco + alfresco-transform-pdf-renderer + ${project.version} + + + org.alfresco + alfresco-transform-libreoffice + ${project.version} + + + org.alfresco + alfresco-transform-imagemagick + ${project.version} + + + + junit + junit + 4.13 + test + + + + + + + + org.codehaus.mojo + license-maven-plugin + + + org.apache.maven.plugins + maven-surefire-plugin + + + org.apache.maven.plugins + maven-failsafe-plugin + + + + \ No newline at end of file diff --git a/alfresco-transform-core-aio/alfresco-transform-core-aio/src/main/java/org/alfresco/transformer/AIOTransformRegistry.java b/alfresco-transform-core-aio/alfresco-transform-core-aio/src/main/java/org/alfresco/transformer/AIOTransformRegistry.java new file mode 100644 index 00000000..80cea5b3 --- /dev/null +++ b/alfresco-transform-core-aio/alfresco-transform-core-aio/src/main/java/org/alfresco/transformer/AIOTransformRegistry.java @@ -0,0 +1,171 @@ +/* + * #%L + * Alfresco Transform Core + * %% + * Copyright (C) 2005 - 2020 Alfresco Software Limited + * %% + * This file is part of the Alfresco software. + * - + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * - + * Alfresco is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * - + * Alfresco is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * - + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + * #L% + */ +package org.alfresco.transformer; + +import com.fasterxml.jackson.databind.ObjectMapper; +import org.alfresco.transform.client.model.config.TransformConfig; +import org.alfresco.transform.client.model.config.TransformOption; +import org.alfresco.transform.client.registry.AbstractTransformRegistry; +import org.alfresco.transform.client.registry.TransformCache; +import org.alfresco.transform.exceptions.TransformException; +import org.alfresco.transformer.transformers.Transformer; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Reader; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import static java.nio.charset.StandardCharsets.UTF_8; +import static org.springframework.http.HttpStatus.BAD_REQUEST; + +/*** + * + * @author eknizat + */ +public class AIOTransformRegistry extends AbstractTransformRegistry +{ + private static final Logger log = LoggerFactory.getLogger(AIOTransformRegistry.class); + + + private static final String ENGINE_CONFIG_LOCATION_POSTFIX = "_engine_config.json"; + + private TransformConfig aggregatedConfig = new TransformConfig(); + + // Holds the structures used by AbstractTransformRegistry to look up what is supported. + // Unlike other sub classes this class does not extend Data or replace it at run time. + private TransformCache data = new TransformCache(); + + private ObjectMapper jsonObjectMapper = new ObjectMapper(); + + + /** + * Represents the mapping between a transform and a transformer, multiple mappings can point to the same transformer. + */ + private Map transformerTransformMapping = new HashMap(); + + + /** + * The registration will go through all supported sub transformers and map them to the transformer implementation. + * + * @param transformer The transformer implementation, + * this could be a transformer managing multiple sub transformers. + * @throws Exception Exception is thrown if a mapping for a transformer name already exists. + */ + public void registerTransformer(Transformer transformer) throws Exception + { + String location = getTransformConfigLocation(transformer); + TransformConfig transformConfig = loadTransformConfig(location); + + for (org.alfresco.transform.client.model.config.Transformer transformerConfig + : transformConfig.getTransformers()) + { + String transformerName = transformerConfig.getTransformerName(); + if (transformerTransformMapping.containsKey(transformerName)) + { + throw new Exception("Transformer name " + transformerName + " is already registered."); + } + + transformerTransformMapping.put(transformerName, transformer); + log.debug("Registered transformer with name: '{}'.", transformerName); + } + + // add to data + aggregatedConfig.getTransformers().addAll(transformConfig.getTransformers()); + aggregatedConfig.getTransformOptions().putAll(transformConfig.getTransformOptions()); + registerAll(transformConfig, location, location); + } + + /** + * + * @param transformName - the transform name used in mapping... + * @return + */ + public Transformer getByTransformName(String transformName) + { + return getTransformerTransformMapping().get(transformName); + } + + public TransformConfig getTransformConfig() throws Exception + { + return aggregatedConfig; + } + + protected String getTransformConfigLocation(Transformer transformer) + { + String location = transformer.getTransformerId() + ENGINE_CONFIG_LOCATION_POSTFIX; + return location; + } + + protected TransformConfig loadTransformConfig(String name) throws Exception + { + + if (getClass().getClassLoader().getResource(name) == null) + { + throw new Exception("Configuration '" + name + "' does not exist on the classpath."); + } + + try (InputStream is = getClass().getClassLoader().getResourceAsStream(name); + Reader reader = new InputStreamReader(is, UTF_8)) + { + return jsonObjectMapper.readValue(reader, TransformConfig.class); + } + catch (IOException e) + { + throw new Exception("Could not read '" + name + "' from the classpath.", e); + } + } + + Map getTransformerTransformMapping() + { + return transformerTransformMapping; + } + + void setTransformerTransformMapping(Map transformerTransformMapping) + { + this.transformerTransformMapping = transformerTransformMapping; + } + + @Override + public TransformCache getData() + { + return data; + } + + @Override + protected void logError(String msg) + { + log.error(msg); + } +} diff --git a/alfresco-transform-core-aio/alfresco-transform-core-aio/src/main/java/org/alfresco/transformer/transformers/AllInOneTransformer.java b/alfresco-transform-core-aio/alfresco-transform-core-aio/src/main/java/org/alfresco/transformer/transformers/AllInOneTransformer.java new file mode 100644 index 00000000..82b7817c --- /dev/null +++ b/alfresco-transform-core-aio/alfresco-transform-core-aio/src/main/java/org/alfresco/transformer/transformers/AllInOneTransformer.java @@ -0,0 +1,97 @@ +/* + * #%L + * Alfresco Transform Core + * %% + * Copyright (C) 2005 - 2020 Alfresco Software Limited + * %% + * This file is part of the Alfresco software. + * - + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * - + * Alfresco is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * - + * Alfresco is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * - + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + * #L% + */ +package org.alfresco.transformer.transformers; + +import org.alfresco.transformer.AIOTransformRegistry; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.util.Map; + +/** + * Top level transformer managing multiple sub transformers. + * + * @author eknizat + */ +public class AllInOneTransformer implements Transformer +{ + + private static final Logger logger = LoggerFactory.getLogger(AllInOneTransformer.class); + + /** + * Represents the mapping between a transform and a transformer, multiple mappings can point to the same transformer. + */ + AIOTransformRegistry transformRegistry = new AIOTransformRegistry(); + + public AllInOneTransformer() + { + + } + + public void addTransformer(Transformer transformer) throws Exception + { + transformRegistry.registerTransformer(transformer); + } + + @Override + public void transform(File sourceFile, File targetFile, String sourceMimetype, String targetMimetype, + Map transformOptions) throws Exception + { + String transformName = transformOptions.get(TRANSFORM_NAME_PARAMETER); + Transformer transformer = transformRegistry.getByTransformName(transformName); + + if (transformer == null) + { + throw new Exception("No transformer mapping for : transform:" + transformName + " sourceMimetype:" + + sourceMimetype + " targetMimetype:" + targetMimetype); + } + + if (logger.isDebugEnabled()) + { + logger.debug("Performing transform '{}' using {}", transformName, transformer.getClass().getSimpleName()); + } + transformer.transform(sourceFile, targetFile, sourceMimetype, targetMimetype, transformOptions); + } + + @Override + public String getTransformerId() + { + return "all-in-one"; + } + + + public AIOTransformRegistry getTransformRegistry() + { + return transformRegistry; + } + + public void setTransformRegistry(AIOTransformRegistry transformRegistry) + { + this.transformRegistry = transformRegistry; + } +} diff --git a/alfresco-transform-core-aio/alfresco-transform-core-aio/src/main/java/org/alfresco/transformer/transformers/ImageMagickAdapter.java b/alfresco-transform-core-aio/alfresco-transform-core-aio/src/main/java/org/alfresco/transformer/transformers/ImageMagickAdapter.java new file mode 100644 index 00000000..c586877f --- /dev/null +++ b/alfresco-transform-core-aio/alfresco-transform-core-aio/src/main/java/org/alfresco/transformer/transformers/ImageMagickAdapter.java @@ -0,0 +1,121 @@ +/* + * #%L + * Alfresco Transform Core + * %% + * Copyright (C) 2005 - 2020 Alfresco Software Limited + * %% + * This file is part of the Alfresco software. + * - + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * - + * Alfresco is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * - + * Alfresco is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * - + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + * #L% + */ +package org.alfresco.transformer.transformers; + +import static org.alfresco.transformer.util.RequestParamMap.ALLOW_ENLARGEMENT; +import static org.alfresco.transformer.util.RequestParamMap.ALPHA_REMOVE; +import static org.alfresco.transformer.util.RequestParamMap.AUTO_ORIENT; +import static org.alfresco.transformer.util.RequestParamMap.COMMAND_OPTIONS; +import static org.alfresco.transformer.util.RequestParamMap.CROP_GRAVITY; +import static org.alfresco.transformer.util.RequestParamMap.CROP_HEIGHT; +import static org.alfresco.transformer.util.RequestParamMap.CROP_PERCENTAGE; +import static org.alfresco.transformer.util.RequestParamMap.CROP_WIDTH; +import static org.alfresco.transformer.util.RequestParamMap.CROP_X_OFFSET; +import static org.alfresco.transformer.util.RequestParamMap.CROP_Y_OFFSET; +import static org.alfresco.transformer.util.RequestParamMap.END_PAGE; +import static org.alfresco.transformer.util.RequestParamMap.MAINTAIN_ASPECT_RATIO; +import static org.alfresco.transformer.util.RequestParamMap.RESIZE_HEIGHT; +import static org.alfresco.transformer.util.RequestParamMap.RESIZE_PERCENTAGE; +import static org.alfresco.transformer.util.RequestParamMap.RESIZE_WIDTH; +import static org.alfresco.transformer.util.RequestParamMap.START_PAGE; +import static org.alfresco.transformer.util.RequestParamMap.THUMBNAIL; +import static org.alfresco.transformer.util.RequestParamMap.TIMEOUT; +import static org.alfresco.transformer.util.Util.stringToInteger; +import static org.alfresco.transformer.util.Util.stringToLong; + +import java.io.File; +import java.util.Map; + +import org.alfresco.transformer.ImageMagickOptionsBuilder; +import org.alfresco.transformer.executors.ImageMagickCommandExecutor; + +public class ImageMagickAdapter implements Transformer +{ + + private static String ID = "imagemagick"; + private ImageMagickCommandExecutor commandExecutor; + + public ImageMagickAdapter() throws Exception + { + super(); + commandExecutor = new ImageMagickCommandExecutor(); + } + + @Override + public void transform(File sourceFile, File targetFile, String sourceMimetype, String targetMimetype, + Map transformOptions) throws Exception + { + + final String options = ImageMagickOptionsBuilder + .builder() + .withStartPage(transformOptions.get(START_PAGE)) + .withEndPage(transformOptions.get(END_PAGE)) + .withAlphaRemove(transformOptions.get(ALPHA_REMOVE)) + .withAutoOrient(transformOptions.get(AUTO_ORIENT)) + .withCropGravity(transformOptions.get(CROP_GRAVITY)) + .withCropWidth(transformOptions.get(CROP_WIDTH)) + .withCropHeight(transformOptions.get(CROP_HEIGHT)) + .withCropPercentage(transformOptions.get(CROP_PERCENTAGE)) + .withCropXOffset(transformOptions.get(CROP_X_OFFSET)) + .withCropYOffset(transformOptions.get(CROP_Y_OFFSET)) + .withThumbnail(transformOptions.get(THUMBNAIL)) + .withResizeWidth(transformOptions.get(RESIZE_WIDTH)) + .withResizeHeight(transformOptions.get(RESIZE_HEIGHT)) + .withResizePercentage(transformOptions.get(RESIZE_PERCENTAGE)) + .withAllowEnlargement(transformOptions.get(ALLOW_ENLARGEMENT)) + .withMaintainAspectRatio(transformOptions.get(MAINTAIN_ASPECT_RATIO)) + .withCommandOptions(transformOptions.get(COMMAND_OPTIONS)) + .build(); + + String pageRange = calculatePageRange( + stringToInteger(transformOptions.get(START_PAGE)), + stringToInteger(transformOptions.get(END_PAGE)) + ); + + Long timeout = stringToLong(transformOptions.get(TIMEOUT)); + + commandExecutor.run(options, sourceFile, pageRange, targetFile, timeout); + } + + @Override + public String getTransformerId() + { + return ID; + } + + // COPIED From ImageMagickController + private static String calculatePageRange(Integer startPage, Integer endPage) + { + return startPage == null + ? endPage == null + ? "" + : "[" + endPage + ']' + : endPage == null || startPage.equals(endPage) + ? "[" + startPage + ']' + : "[" + startPage + '-' + endPage + ']'; + } +} diff --git a/alfresco-transform-core-aio/alfresco-transform-core-aio/src/main/java/org/alfresco/transformer/transformers/LibreOfficeAdapter.java b/alfresco-transform-core-aio/alfresco-transform-core-aio/src/main/java/org/alfresco/transformer/transformers/LibreOfficeAdapter.java new file mode 100644 index 00000000..aad346be --- /dev/null +++ b/alfresco-transform-core-aio/alfresco-transform-core-aio/src/main/java/org/alfresco/transformer/transformers/LibreOfficeAdapter.java @@ -0,0 +1,57 @@ +/* + * #%L + * Alfresco Transform Core + * %% + * Copyright (C) 2005 - 2020 Alfresco Software Limited + * %% + * This file is part of the Alfresco software. + * - + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * - + * Alfresco is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * - + * Alfresco is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * - + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + * #L% + */ +package org.alfresco.transformer.transformers; + +import java.io.File; +import java.util.Map; + +import org.alfresco.transformer.executors.LibreOfficeJavaExecutor; + +public class LibreOfficeAdapter implements Transformer +{ + private static String ID = "libreoffice"; + private LibreOfficeJavaExecutor javaExecutor; + + public LibreOfficeAdapter() throws Exception + { + super(); + javaExecutor = new LibreOfficeJavaExecutor(); + } + + @Override + public void transform(File sourceFile, File targetFile, String sourceMimetype, String targetMimetype, + Map transformOptions) throws Exception + { + javaExecutor.call(sourceFile, targetFile); + } + + @Override + public String getTransformerId() + { + return ID; + } +} \ No newline at end of file diff --git a/alfresco-transform-core-aio/alfresco-transform-core-aio/src/main/java/org/alfresco/transformer/transformers/MiscAdapter.java b/alfresco-transform-core-aio/alfresco-transform-core-aio/src/main/java/org/alfresco/transformer/transformers/MiscAdapter.java new file mode 100644 index 00000000..efbdae11 --- /dev/null +++ b/alfresco-transform-core-aio/alfresco-transform-core-aio/src/main/java/org/alfresco/transformer/transformers/MiscAdapter.java @@ -0,0 +1,60 @@ +/* + * #%L + * Alfresco Transform Core + * %% + * Copyright (C) 2005 - 2020 Alfresco Software Limited + * %% + * This file is part of the Alfresco software. + * - + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * - + * Alfresco is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * - + * Alfresco is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * - + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + * #L% + */ +package org.alfresco.transformer.transformers; + +import java.io.File; +import java.util.Map; + +public class MiscAdapter implements Transformer +{ + private static final String ID = "misc"; + private SelectingTransformer miscSelectingTransformer; + + + public MiscAdapter() throws Exception + { + super(); + miscSelectingTransformer = new SelectingTransformer(); + } + + @Override + public void transform(File sourceFile, File targetFile, String sourceMimetype, String targetMimetype, Map transformOptions) throws Exception + { + String transformerName = transformOptions.get(TRANSFORM_NAME_PARAMETER); + miscSelectingTransformer.transform(transformerName, sourceFile, targetFile, + sourceMimetype, targetMimetype, transformOptions); + + } + + @Override + public String getTransformerId() + { + return ID; + } +} + diff --git a/alfresco-transform-core-aio/alfresco-transform-core-aio/src/main/java/org/alfresco/transformer/transformers/PdfRendererAdapter.java b/alfresco-transform-core-aio/alfresco-transform-core-aio/src/main/java/org/alfresco/transformer/transformers/PdfRendererAdapter.java new file mode 100644 index 00000000..dfc440ea --- /dev/null +++ b/alfresco-transform-core-aio/alfresco-transform-core-aio/src/main/java/org/alfresco/transformer/transformers/PdfRendererAdapter.java @@ -0,0 +1,80 @@ +/* + * #%L + * Alfresco Transform Core + * %% + * Copyright (C) 2005 - 2020 Alfresco Software Limited + * %% + * This file is part of the Alfresco software. + * - + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * - + * Alfresco is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * - + * Alfresco is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * - + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + * #L% + */ +package org.alfresco.transformer.transformers; + +import static org.alfresco.transformer.util.RequestParamMap.ALLOW_PDF_ENLARGEMENT; +import static org.alfresco.transformer.util.RequestParamMap.HEIGHT_REQUEST_PARAM; +import static org.alfresco.transformer.util.RequestParamMap.MAINTAIN_PDF_ASPECT_RATIO; +import static org.alfresco.transformer.util.RequestParamMap.PAGE_REQUEST_PARAM; +import static org.alfresco.transformer.util.RequestParamMap.TIMEOUT; +import static org.alfresco.transformer.util.RequestParamMap.WIDTH_REQUEST_PARAM; +import static org.alfresco.transformer.util.Util.stringToLong; + +import java.io.File; +import java.util.Map; + +import org.alfresco.transformer.executors.PdfRendererCommandExecutor; +import org.alfresco.transformer.PdfRendererOptionsBuilder; + + +public class PdfRendererAdapter implements Transformer +{ + private static String ID = "pdfrenderer"; + private PdfRendererCommandExecutor pdfExecutor; + + public PdfRendererAdapter() throws Exception + { + super(); + pdfExecutor = new PdfRendererCommandExecutor(); + } + + @Override + public void transform(File sourceFile, File targetFile, String sourceMimetype, String targetMimetype, + Map transformOptions) throws Exception + { + + final String options = PdfRendererOptionsBuilder + .builder() + .withPage(transformOptions.get(PAGE_REQUEST_PARAM)) + .withWidth(transformOptions.get(WIDTH_REQUEST_PARAM)) + .withHeight(transformOptions.get(HEIGHT_REQUEST_PARAM)) + .withAllowPdfEnlargement(transformOptions.get(ALLOW_PDF_ENLARGEMENT)) + .withMaintainPdfAspectRatio(transformOptions.get(MAINTAIN_PDF_ASPECT_RATIO)) + .build(); + + Long timeout = stringToLong(transformOptions.get(TIMEOUT)); + + pdfExecutor.run(options, sourceFile, targetFile, timeout); + } + + @Override + public String getTransformerId() + { + return ID; + } + +} \ No newline at end of file diff --git a/alfresco-transform-core-aio/alfresco-transform-core-aio/src/main/java/org/alfresco/transformer/transformers/TikaAdapter.java b/alfresco-transform-core-aio/alfresco-transform-core-aio/src/main/java/org/alfresco/transformer/transformers/TikaAdapter.java new file mode 100644 index 00000000..c80dce65 --- /dev/null +++ b/alfresco-transform-core-aio/alfresco-transform-core-aio/src/main/java/org/alfresco/transformer/transformers/TikaAdapter.java @@ -0,0 +1,73 @@ +/* + * #%L + * Alfresco Transform Core + * %% + * Copyright (C) 2005 - 2020 Alfresco Software Limited + * %% + * This file is part of the Alfresco software. + * - + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * - + * Alfresco is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * - + * Alfresco is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * - + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + * #L% + */ +package org.alfresco.transformer.transformers; + +import org.alfresco.transformer.executors.TikaJavaExecutor; + +import java.io.File; +import java.util.Map; + +import static java.lang.Boolean.parseBoolean; +import static org.alfresco.transformer.executors.Tika.INCLUDE_CONTENTS; +import static org.alfresco.transformer.executors.Tika.NOT_EXTRACT_BOOKMARKS_TEXT; +import static org.alfresco.transformer.executors.Tika.TARGET_ENCODING; +import static org.alfresco.transformer.executors.Tika.TARGET_MIMETYPE; + +public class TikaAdapter implements Transformer +{ + private static final String ID = "tika"; + private TikaJavaExecutor tikaJavaExecutor; + + public TikaAdapter() throws Exception + { + super(); + tikaJavaExecutor = new TikaJavaExecutor(); + } + + @Override + public void transform(File sourceFile, File targetFile, String sourceMimetype, String targetMimetype, Map transformOptions) throws Exception + { + final String transform = transformOptions.get(TRANSFORM_NAME_PARAMETER); + + final boolean includeContents = parseBoolean( + transformOptions.getOrDefault("includeContents", "false")); + final boolean notExtractBookmarksText = parseBoolean( + transformOptions.getOrDefault("notExtractBookmarksText", "false")); + final String targetEncoding = transformOptions.getOrDefault("targetEncoding", "UTF-8"); + + tikaJavaExecutor.call(sourceFile, targetFile, transform, + includeContents ? INCLUDE_CONTENTS : null, + notExtractBookmarksText ? NOT_EXTRACT_BOOKMARKS_TEXT : null, + TARGET_MIMETYPE + targetMimetype, TARGET_ENCODING + targetEncoding); + } + + @Override + public String getTransformerId() + { + return ID; + } +} diff --git a/alfresco-transform-core-aio/alfresco-transform-core-aio/src/main/java/org/alfresco/transformer/transformers/Transformer.java b/alfresco-transform-core-aio/alfresco-transform-core-aio/src/main/java/org/alfresco/transformer/transformers/Transformer.java new file mode 100644 index 00000000..1163b024 --- /dev/null +++ b/alfresco-transform-core-aio/alfresco-transform-core-aio/src/main/java/org/alfresco/transformer/transformers/Transformer.java @@ -0,0 +1,66 @@ +/* + * #%L + * Alfresco Transform Core + * %% + * Copyright (C) 2005 - 2020 Alfresco Software Limited + * %% + * This file is part of the Alfresco software. + * - + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * - + * Alfresco is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * - + * Alfresco is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * - + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + * #L% + */ +package org.alfresco.transformer.transformers; + + +import org.alfresco.transform.client.model.config.TransformConfig; + +import java.io.File; +import java.util.Map; + + +/** + * Interface for transformers which can perform transformations and specify their own supported configuration. + */ +public interface Transformer +{ + /** + * Controllers pass this as an additional parameter.. + */ + String TRANSFORM_NAME_PARAMETER = "alfresco.transform-name-parameter"; + + /** + * Implementation of the actual transformation. + * + * @param sourceFile + * @param targetFile + * @param transformOptions + * @throws Exception + */ + void transform(File sourceFile, File targetFile, String sourceMimetype, + String targetMimetype, Map transformOptions) throws Exception; + + + /** + * @return Supported config for the transformer implementation. + * + */ + String getTransformerId(); + +} + + diff --git a/alfresco-transform-core-aio/alfresco-transform-core-aio/src/test/java/org/alfresco/transformer/transformers/AIOTransformRegistryTest.java b/alfresco-transform-core-aio/alfresco-transform-core-aio/src/test/java/org/alfresco/transformer/transformers/AIOTransformRegistryTest.java new file mode 100644 index 00000000..3752e526 --- /dev/null +++ b/alfresco-transform-core-aio/alfresco-transform-core-aio/src/test/java/org/alfresco/transformer/transformers/AIOTransformRegistryTest.java @@ -0,0 +1,301 @@ +/* + * #%L + * Alfresco Transform Core + * %% + * Copyright (C) 2005 - 2020 Alfresco Software Limited + * %% + * This file is part of the Alfresco software. + * - + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * - + * Alfresco is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * - + * Alfresco is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * - + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + * #L% + */ +package org.alfresco.transformer.transformers; + +import com.fasterxml.jackson.databind.ObjectMapper; +import org.alfresco.transform.client.model.config.TransformConfig; +import org.alfresco.transformer.AIOTransformRegistry; +import org.apache.pdfbox.pdmodel.PDDocument; +import org.apache.pdfbox.text.PDFTextStripper; +import org.junit.Before; +import org.junit.Test; +import org.springframework.core.io.ClassPathResource; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.OutputStreamWriter; +import java.io.StringWriter; +import java.nio.file.Files; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; + +import static org.alfresco.transformer.transformers.TextToPdfContentTransformer.PAGE_LIMIT; +import static org.alfresco.transformer.transformers.Transformer.TRANSFORM_NAME_PARAMETER; +import static org.junit.Assert.*; + +public class AIOTransformRegistryTest +{ + private static final String SOURCE_MIMETYPE = "text/html"; + private static final String TARGET_MIMETYPE = "text/plain"; + String SOURCE_ENCODING = "sourceEncoding"; + String TARGET_ENCODING = "targetEncoding"; + + AIOTransformRegistry aioTransformer = new AIOTransformRegistry(); + ObjectMapper objectMapper = new ObjectMapper(); + + + @Before + public void before() throws Exception + { + aioTransformer.registerTransformer(new MiscAdapter()); + aioTransformer.registerTransformer(new TikaAdapter()); + + } + + private void writeToFile(File file, String content, String encoding) throws Exception + { + try (OutputStreamWriter ow = new OutputStreamWriter(new FileOutputStream(file), encoding)) + { + ow.append(content); + } + } + + private String readFromFile(File file, final String encoding) throws Exception + { + return new String(Files.readAllBytes(file.toPath()), encoding); + } + + private TransformConfig loadConfig(String s) throws Exception + { + return objectMapper.readValue(new ClassPathResource(s).getFile(), TransformConfig.class); + } + + @Test + public void testConfigAggregation() throws Exception + { + List expectedTransformNames = Arrays.asList("html", "string", "appleIWorks", "textToPdf", "rfc822", + "Archive", "OutlookMsg", "PdfBox", "Office", "Poi", "OOXML", "TikaAuto", "TextMining"); + + List expectedTransformOptionNames = Arrays.asList("tikaOptions", "archiveOptions", "pdfboxOptions", + "textToPdfOptions", "stringOptions", "htmlOptions"); + + TransformConfig miscConfig = loadConfig("misc_engine_config.json"); + TransformConfig tikaConfig = loadConfig("tika_engine_config.json"); + + // check correct number of transformers + assertEquals("Number of expected transformers", + miscConfig.getTransformers().size() + tikaConfig.getTransformers().size(), + aioTransformer.getTransformConfig().getTransformers().size()); + + List actualTransformerNames = aioTransformer.getTransformConfig().getTransformers() + .stream().map(t -> t.getTransformerName()).collect(Collectors.toList()); + // check all transformers are there + for(String transformNames : expectedTransformNames) + { + assertTrue("Expected transformer missing.", actualTransformerNames.contains(transformNames)); + } + + // check correct number of options + assertEquals("Number of expected transformers", + miscConfig.getTransformOptions().size() + tikaConfig.getTransformOptions().size(), + aioTransformer.getTransformConfig().getTransformOptions().size()); + + Set actualOptionNames = aioTransformer.getTransformConfig().getTransformOptions().keySet(); + + // check all options are there + for (String optionName : expectedTransformOptionNames) + { + assertTrue("Expected transform option missing.", actualOptionNames.contains(optionName)); + } + } + + // Test copied from Misc (HtmlParserContentTransformerTest) See ATS-712 aioTransformer - html + @Test + public void testMiscHtml() throws Exception + { + final String NEWLINE = System.getProperty("line.separator"); + final String TITLE = "Testing!"; + final String TEXT_P1 = "This is some text in English"; + final String TEXT_P2 = "This is more text in English"; + final String TEXT_P3 = "C'est en Fran\u00e7ais et Espa\u00f1ol"; + String partA = "" + TITLE + "" + NEWLINE; + String partB = "

" + TEXT_P1 + "

" + NEWLINE + + "

" + TEXT_P2 + "

" + NEWLINE + + "

" + TEXT_P3 + "

" + NEWLINE; + String partC = ""; + final String expected = TITLE + NEWLINE + TEXT_P1 + NEWLINE + TEXT_P2 + NEWLINE + TEXT_P3 + NEWLINE; + + File tmpS = null; + File tmpD = null; + + try + { + // Content set to ISO 8859-1 + tmpS = File.createTempFile("AlfrescoTestSource_", ".html"); + writeToFile(tmpS, partA + partB + partC, "ISO-8859-1"); + + tmpD = File.createTempFile("AlfrescoTestTarget_", ".txt"); + + Map parameters = new HashMap<>(); + parameters.put(SOURCE_ENCODING, "ISO-8859-1"); + parameters.put(TRANSFORM_NAME_PARAMETER, "html"); + Transformer transformer = aioTransformer.getByTransformName("html"); + transformer.transform(tmpS, tmpD, SOURCE_MIMETYPE, TARGET_MIMETYPE, parameters); + + assertEquals(expected, readFromFile(tmpD, "UTF-8")); + tmpS.delete(); + tmpD.delete(); + + // Content set to UTF-8 + tmpS = File.createTempFile("AlfrescoTestSource_", ".html"); + writeToFile(tmpS, partA + partB + partC, "UTF-8"); + + tmpD = File.createTempFile("AlfrescoTestTarget_", ".txt"); + parameters = new HashMap<>(); + parameters.put(TRANSFORM_NAME_PARAMETER, "html"); + parameters.put(SOURCE_ENCODING, "UTF-8"); + transformer.transform(tmpS, tmpD, SOURCE_MIMETYPE, TARGET_MIMETYPE, parameters); + assertEquals(expected, readFromFile(tmpD, "UTF-8")); + tmpS.delete(); + tmpD.delete(); + + // Content set to UTF-16 + tmpS = File.createTempFile("AlfrescoTestSource_", ".html"); + writeToFile(tmpS, partA + partB + partC, "UTF-16"); + + tmpD = File.createTempFile("AlfrescoTestTarget_", ".txt"); + parameters = new HashMap<>(); + parameters.put(TRANSFORM_NAME_PARAMETER, "html"); + parameters.put(SOURCE_ENCODING, "UTF-16"); + transformer.transform(tmpS, tmpD, SOURCE_MIMETYPE, TARGET_MIMETYPE, parameters); + assertEquals(expected, readFromFile(tmpD, "UTF-8")); + tmpS.delete(); + tmpD.delete(); + + // Note - since HTML Parser 2.0 META tags specifying the + // document encoding will ONLY be respected if the original + // content type was set to ISO-8859-1. + // + // This means there is now only one test which we can perform + // to ensure that this now-limited overriding of the encoding + // takes effect. + + // Content set to ISO 8859-1, meta set to UTF-8 + tmpS = File.createTempFile("AlfrescoTestSource_", ".html"); + String str = partA + + "" + + partB + partC; + + writeToFile(tmpS, str, "UTF-8"); + + tmpD = File.createTempFile("AlfrescoTestTarget_", ".txt"); + + parameters = new HashMap<>(); + parameters.put(TRANSFORM_NAME_PARAMETER, "html"); + parameters.put(SOURCE_ENCODING, "ISO-8859-1"); + transformer.transform(tmpS, tmpD, SOURCE_MIMETYPE, TARGET_MIMETYPE, parameters); + assertEquals(expected, readFromFile(tmpD, "UTF-8")); + tmpS.delete(); + tmpD.delete(); + + // Note - we can't test UTF-16 with only a meta encoding, + // because without that the parser won't know about the + // 2 byte format so won't be able to identify the meta tag + } + finally + { + if (tmpS != null && tmpS.exists()) tmpS.delete(); + if (tmpD != null && tmpD.exists()) tmpD.delete(); + } + } + + // Test copied from Misc (TextToPdfContentTransformerTest) See ATS-712 aioTransformer - pdf + @Test + public void testMiscPdf() throws Exception + { + transformTextAndCheckPageLength(-1); + } + + private void transformTextAndCheckPageLength(int pageLimit) throws Exception + { + int pageLength = 32; + int lines = (pageLength + 10) * ((pageLimit > 0) ? pageLimit : 1); + StringBuilder sb = new StringBuilder(); + String checkText = null; + int cutoff = pageLimit * pageLength; + for (int i = 1; i <= lines; i++) + { + sb.append(i); + sb.append(" I must not talk in class or feed my homework to my cat.\n"); + if (i == cutoff) + checkText = sb.toString(); + } + sb.append("\nBart\n"); + String text = sb.toString(); + checkText = (checkText == null) ? clean(text) : clean(checkText); + transformTextAndCheck(text, "UTF-8", checkText, String.valueOf(pageLimit)); + } + + private void transformTextAndCheck(String text, String encoding, String checkText, + String pageLimit) throws Exception + { + // Get a reader for the text + File sourceFile = File.createTempFile("AlfrescoTestSource_", ".txt"); + writeToFile(sourceFile, text, encoding); + + // And a temp writer + File targetFile = File.createTempFile("AlfrescoTestTarget_", ".pdf"); + + // Transform to PDF + Map parameters = new HashMap<>(); + parameters.put(PAGE_LIMIT, pageLimit); + parameters.put(TRANSFORM_NAME_PARAMETER, "textToPdf"); + Transformer transformer = aioTransformer.getByTransformName("textToPdf"); + transformer.transform(sourceFile, targetFile, "text/plain", "application/pdf", parameters); + + // Read back in the PDF and check it + PDDocument doc = PDDocument.load(targetFile); + PDFTextStripper textStripper = new PDFTextStripper(); + StringWriter textWriter = new StringWriter(); + textStripper.writeText(doc, textWriter); + doc.close(); + + String roundTrip = clean(textWriter.toString()); + + assertEquals( + "Incorrect text in PDF when starting from text in " + encoding, + checkText, roundTrip + ); + + sourceFile.delete(); + targetFile.delete(); + } + + private String clean(String text) + { + text = text.replaceAll("\\s+\\r", ""); + text = text.replaceAll("\\s+\\n", ""); + text = text.replaceAll("\\r", ""); + text = text.replaceAll("\\n", ""); + return text; + } + +} \ No newline at end of file diff --git a/alfresco-transform-misc/alfresco-transform-misc-boot/src/main/resources/engine_config.json b/alfresco-transform-core-aio/alfresco-transform-core-aio/src/test/resources/misc_engine_config.json similarity index 100% rename from alfresco-transform-misc/alfresco-transform-misc-boot/src/main/resources/engine_config.json rename to alfresco-transform-core-aio/alfresco-transform-core-aio/src/test/resources/misc_engine_config.json diff --git a/alfresco-transform-tika/alfresco-transform-tika-boot/src/main/resources/engine_config.json b/alfresco-transform-core-aio/alfresco-transform-core-aio/src/test/resources/tika_engine_config.json similarity index 100% rename from alfresco-transform-tika/alfresco-transform-tika-boot/src/main/resources/engine_config.json rename to alfresco-transform-core-aio/alfresco-transform-core-aio/src/test/resources/tika_engine_config.json diff --git a/alfresco-transform-imagemagick/alfresco-transform-imagemagick-boot/pom.xml b/alfresco-transform-imagemagick/alfresco-transform-imagemagick-boot/pom.xml index f37250d5..bc4beab9 100644 --- a/alfresco-transform-imagemagick/alfresco-transform-imagemagick-boot/pom.xml +++ b/alfresco-transform-imagemagick/alfresco-transform-imagemagick-boot/pom.xml @@ -1,7 +1,7 @@ 4.0.0 alfresco-transform-imagemagick-boot - Alfresco ImageMagick Transformer SpringBoot + Alfresco ImageMagick Transformer Spring Boot jar diff --git a/alfresco-transform-imagemagick/alfresco-transform-imagemagick-boot/src/main/java/org/alfresco/transformer/ImageMagickController.java b/alfresco-transform-imagemagick/alfresco-transform-imagemagick-boot/src/main/java/org/alfresco/transformer/ImageMagickController.java index f97c6b51..95cfb7b4 100644 --- a/alfresco-transform-imagemagick/alfresco-transform-imagemagick-boot/src/main/java/org/alfresco/transformer/ImageMagickController.java +++ b/alfresco-transform-imagemagick/alfresco-transform-imagemagick-boot/src/main/java/org/alfresco/transformer/ImageMagickController.java @@ -154,7 +154,7 @@ public class ImageMagickController extends AbstractTransformerController File targetFile = createTargetFile(request, targetFilename); // Both files are deleted by TransformInterceptor.afterCompletion - final String options = OptionsBuilder + final String options = ImageMagickOptionsBuilder .builder() .withStartPage(startPage) .withEndPage(endPage) @@ -196,7 +196,7 @@ public class ImageMagickController extends AbstractTransformerController logger.debug("Processing request with: sourceFile '{}', targetFile '{}', transformOptions" + " '{}', timeout {} ms", sourceFile, targetFile, transformOptions, timeout); - final String options = OptionsBuilder + final String options = ImageMagickOptionsBuilder .builder() .withStartPage(transformOptions.get("startPage")) .withEndPage(transformOptions.get("endPage")) diff --git a/alfresco-transform-imagemagick/alfresco-transform-imagemagick-boot/src/main/resources/application-default.yaml b/alfresco-transform-imagemagick/alfresco-transform-imagemagick-boot/src/main/resources/application-default.yaml index ef95de69..ace915aa 100644 --- a/alfresco-transform-imagemagick/alfresco-transform-imagemagick-boot/src/main/resources/application-default.yaml +++ b/alfresco-transform-imagemagick/alfresco-transform-imagemagick-boot/src/main/resources/application-default.yaml @@ -1,2 +1,5 @@ queue: - engineRequestQueue: ${TRANSFORM_ENGINE_REQUEST_QUEUE:org.alfresco.transform.engine.imagemagick.acs} \ No newline at end of file + engineRequestQueue: ${TRANSFORM_ENGINE_REQUEST_QUEUE:org.alfresco.transform.engine.imagemagick.acs} +transform: + config: + location: classpath:imagemagick_engine_config.json \ No newline at end of file diff --git a/alfresco-transform-imagemagick/alfresco-transform-imagemagick-boot/src/test/java/org/alfresco/transformer/ImageMagickControllerTest.java b/alfresco-transform-imagemagick/alfresco-transform-imagemagick-boot/src/test/java/org/alfresco/transformer/ImageMagickControllerTest.java index 5979467e..978980e2 100644 --- a/alfresco-transform-imagemagick/alfresco-transform-imagemagick-boot/src/test/java/org/alfresco/transformer/ImageMagickControllerTest.java +++ b/alfresco-transform-imagemagick/alfresco-transform-imagemagick-boot/src/test/java/org/alfresco/transformer/ImageMagickControllerTest.java @@ -85,6 +85,8 @@ import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; @WebMvcTest(ImageMagickController.class) public class ImageMagickControllerTest extends AbstractTransformerControllerTest { + private static final String ENGINE_CONFIG_NAME = "imagemagick_engine_config.json"; + @Mock private ExecutionResult mockExecutionResult; @@ -109,6 +111,12 @@ public class ImageMagickControllerTest extends AbstractTransformerControllerTest mockTransformCommand("jpg", "png", "image/jpg", true); } + @Override + public String getEngineConfigName() + { + return ENGINE_CONFIG_NAME; + } + @Override protected void mockTransformCommand(String sourceExtension, String targetExtension, String sourceMimetype, diff --git a/alfresco-transform-imagemagick/alfresco-transform-imagemagick-boot/src/main/resources/engine_config.json b/alfresco-transform-imagemagick/alfresco-transform-imagemagick-boot/src/test/resources/imagemagick_engine_config.json similarity index 100% rename from alfresco-transform-imagemagick/alfresco-transform-imagemagick-boot/src/main/resources/engine_config.json rename to alfresco-transform-imagemagick/alfresco-transform-imagemagick-boot/src/test/resources/imagemagick_engine_config.json diff --git a/alfresco-transform-imagemagick/alfresco-transform-imagemagick-boot/src/main/java/org/alfresco/transformer/OptionsBuilder.java b/alfresco-transform-imagemagick/alfresco-transform-imagemagick/src/main/java/org/alfresco/transformer/ImageMagickOptionsBuilder.java similarity index 74% rename from alfresco-transform-imagemagick/alfresco-transform-imagemagick-boot/src/main/java/org/alfresco/transformer/OptionsBuilder.java rename to alfresco-transform-imagemagick/alfresco-transform-imagemagick/src/main/java/org/alfresco/transformer/ImageMagickOptionsBuilder.java index 9c0e7b99..af33ad73 100644 --- a/alfresco-transform-imagemagick/alfresco-transform-imagemagick-boot/src/main/java/org/alfresco/transformer/OptionsBuilder.java +++ b/alfresco-transform-imagemagick/alfresco-transform-imagemagick/src/main/java/org/alfresco/transformer/ImageMagickOptionsBuilder.java @@ -42,7 +42,7 @@ import com.google.common.collect.ImmutableList; * * @author Cezar Leahu */ -final class OptionsBuilder +public final class ImageMagickOptionsBuilder { private static final List GRAVITY_VALUES = ImmutableList.of("North", "NorthEast", "East", "SouthEast", "South", "SouthWest", "West", "NorthWest", "Center"); @@ -65,180 +65,180 @@ final class OptionsBuilder private Boolean maintainAspectRatio; private String commandOptions; - private OptionsBuilder() {} + private ImageMagickOptionsBuilder() {} - public OptionsBuilder withStartPage(final String startPage) + public ImageMagickOptionsBuilder withStartPage(final String startPage) { return withStartPage(stringToInteger(startPage)); } - public OptionsBuilder withStartPage(final Integer startPage) + public ImageMagickOptionsBuilder withStartPage(final Integer startPage) { this.startPage = startPage; return this; } - public OptionsBuilder withEndPage(final String endPage) + public ImageMagickOptionsBuilder withEndPage(final String endPage) { return withEndPage(stringToInteger(endPage)); } - public OptionsBuilder withEndPage(final Integer endPage) + public ImageMagickOptionsBuilder withEndPage(final Integer endPage) { this.endPage = endPage; return this; } - public OptionsBuilder withAlphaRemove(final String alphaRemove) + public ImageMagickOptionsBuilder withAlphaRemove(final String alphaRemove) { return withAlphaRemove(stringToBoolean(alphaRemove)); } - public OptionsBuilder withAlphaRemove(final Boolean alphaRemove) + public ImageMagickOptionsBuilder withAlphaRemove(final Boolean alphaRemove) { this.alphaRemove = alphaRemove; return this; } - public OptionsBuilder withAutoOrient(final String autoOrient) + public ImageMagickOptionsBuilder withAutoOrient(final String autoOrient) { return withAutoOrient(stringToBoolean(autoOrient)); } - public OptionsBuilder withAutoOrient(final Boolean autoOrient) + public ImageMagickOptionsBuilder withAutoOrient(final Boolean autoOrient) { this.autoOrient = autoOrient; return this; } - public OptionsBuilder withCropGravity(final String cropGravity) + public ImageMagickOptionsBuilder withCropGravity(final String cropGravity) { this.cropGravity = cropGravity; return this; } - public OptionsBuilder withCropWidth(final String cropWidth) + public ImageMagickOptionsBuilder withCropWidth(final String cropWidth) { return withCropWidth(stringToInteger(cropWidth)); } - public OptionsBuilder withCropWidth(final Integer cropWidth) + public ImageMagickOptionsBuilder withCropWidth(final Integer cropWidth) { this.cropWidth = cropWidth; return this; } - public OptionsBuilder withCropHeight(final String cropHeight) + public ImageMagickOptionsBuilder withCropHeight(final String cropHeight) { return withCropHeight(stringToInteger(cropHeight)); } - public OptionsBuilder withCropHeight(final Integer cropHeight) + public ImageMagickOptionsBuilder withCropHeight(final Integer cropHeight) { this.cropHeight = cropHeight; return this; } - public OptionsBuilder withCropPercentage(final String cropPercentage) + public ImageMagickOptionsBuilder withCropPercentage(final String cropPercentage) { return withCropPercentage(stringToBoolean(cropPercentage)); } - public OptionsBuilder withCropPercentage(final Boolean cropPercentage) + public ImageMagickOptionsBuilder withCropPercentage(final Boolean cropPercentage) { this.cropPercentage = cropPercentage; return this; } - public OptionsBuilder withCropXOffset(final String cropXOffset) + public ImageMagickOptionsBuilder withCropXOffset(final String cropXOffset) { return withCropXOffset(stringToInteger(cropXOffset)); } - public OptionsBuilder withCropXOffset(final Integer cropXOffset) + public ImageMagickOptionsBuilder withCropXOffset(final Integer cropXOffset) { this.cropXOffset = cropXOffset; return this; } - public OptionsBuilder withCropYOffset(final String cropYOffset) + public ImageMagickOptionsBuilder withCropYOffset(final String cropYOffset) { return withCropYOffset(stringToInteger(cropYOffset)); } - public OptionsBuilder withCropYOffset(final Integer cropYOffset) + public ImageMagickOptionsBuilder withCropYOffset(final Integer cropYOffset) { this.cropYOffset = cropYOffset; return this; } - public OptionsBuilder withThumbnail(final String thumbnail) + public ImageMagickOptionsBuilder withThumbnail(final String thumbnail) { return withThumbnail(stringToBoolean(thumbnail)); } - public OptionsBuilder withThumbnail(final Boolean thumbnail) + public ImageMagickOptionsBuilder withThumbnail(final Boolean thumbnail) { this.thumbnail = thumbnail; return this; } - public OptionsBuilder withResizeWidth(final String resizeWidth) + public ImageMagickOptionsBuilder withResizeWidth(final String resizeWidth) { return withResizeWidth(stringToInteger(resizeWidth)); } - public OptionsBuilder withResizeWidth(final Integer resizeWidth) + public ImageMagickOptionsBuilder withResizeWidth(final Integer resizeWidth) { this.resizeWidth = resizeWidth; return this; } - public OptionsBuilder withResizeHeight(final String resizeHeight) + public ImageMagickOptionsBuilder withResizeHeight(final String resizeHeight) { return withResizeHeight(stringToInteger(resizeHeight)); } - public OptionsBuilder withResizeHeight(final Integer resizeHeight) + public ImageMagickOptionsBuilder withResizeHeight(final Integer resizeHeight) { this.resizeHeight = resizeHeight; return this; } - public OptionsBuilder withResizePercentage(final String resizePercentage) + public ImageMagickOptionsBuilder withResizePercentage(final String resizePercentage) { return withResizePercentage(stringToBoolean(resizePercentage)); } - public OptionsBuilder withResizePercentage(final Boolean resizePercentage) + public ImageMagickOptionsBuilder withResizePercentage(final Boolean resizePercentage) { this.resizePercentage = resizePercentage; return this; } - public OptionsBuilder withAllowEnlargement(final String allowEnlargement) + public ImageMagickOptionsBuilder withAllowEnlargement(final String allowEnlargement) { return withAllowEnlargement(stringToBoolean(allowEnlargement)); } - public OptionsBuilder withAllowEnlargement(final Boolean allowEnlargement) + public ImageMagickOptionsBuilder withAllowEnlargement(final Boolean allowEnlargement) { this.allowEnlargement = allowEnlargement; return this; } - public OptionsBuilder withMaintainAspectRatio(final String maintainAspectRatio) + public ImageMagickOptionsBuilder withMaintainAspectRatio(final String maintainAspectRatio) { return withMaintainAspectRatio(stringToBoolean(maintainAspectRatio)); } - public OptionsBuilder withMaintainAspectRatio(final Boolean maintainAspectRatio) + public ImageMagickOptionsBuilder withMaintainAspectRatio(final Boolean maintainAspectRatio) { this.maintainAspectRatio = maintainAspectRatio; return this; } - public OptionsBuilder withCommandOptions(final String commandOptions) + public ImageMagickOptionsBuilder withCommandOptions(final String commandOptions) { this.commandOptions = commandOptions; return this; @@ -354,8 +354,8 @@ final class OptionsBuilder args.toString(); } - public static OptionsBuilder builder() + public static ImageMagickOptionsBuilder builder() { - return new OptionsBuilder(); + return new ImageMagickOptionsBuilder(); } } diff --git a/alfresco-transform-imagemagick/alfresco-transform-imagemagick/src/main/resources/imagemagick_engine_config.json b/alfresco-transform-imagemagick/alfresco-transform-imagemagick/src/main/resources/imagemagick_engine_config.json new file mode 100644 index 00000000..465d2677 --- /dev/null +++ b/alfresco-transform-imagemagick/alfresco-transform-imagemagick/src/main/resources/imagemagick_engine_config.json @@ -0,0 +1,1158 @@ +{ + "transformOptions": { + "imageMagickOptions": [ + {"value": {"name": "alphaRemove"}}, + {"value": {"name": "autoOrient"}}, + {"value": {"name": "startPage"}}, + {"value": {"name": "endPage"}}, + {"group": {"transformOptions": [ + {"value": {"name": "cropGravity"}}, + {"value": {"name": "cropWidth"}}, + {"value": {"name": "cropHeight"}}, + {"value": {"name": "cropPercentage"}}, + {"value": {"name": "cropXOffset"}}, + {"value": {"name": "cropYOffset"}} + ]}}, + {"group": {"transformOptions": [ + {"value": {"name": "thumbnail"}}, + {"value": {"name": "resizeHeight"}}, + {"value": {"name": "resizeWidth"}}, + {"value": {"name": "resizePercentage"}}, + {"value": {"name": "allowEnlargement"}}, + {"value": {"name": "maintainAspectRatio"}} + ]}} + ] + }, + "transformers": [ + { + "transformerName": "imagemagick", + "supportedSourceAndTargetList": [ + {"sourceMediaType": "image/x-raw-hasselblad", "priority": 55, "targetMediaType": "image/x-raw-hasselblad" }, + {"sourceMediaType": "image/x-raw-hasselblad", "targetMediaType": "image/x-raw-sony" }, + {"sourceMediaType": "image/x-raw-hasselblad", "targetMediaType": "image/bmp" }, + {"sourceMediaType": "image/x-raw-hasselblad", "targetMediaType": "image/cgm" }, + {"sourceMediaType": "image/x-raw-hasselblad", "targetMediaType": "image/x-raw-canon" }, + {"sourceMediaType": "image/x-raw-hasselblad", "targetMediaType": "image/x-raw-adobe" }, + {"sourceMediaType": "image/x-raw-hasselblad", "targetMediaType": "application/eps" }, + {"sourceMediaType": "image/x-raw-hasselblad", "targetMediaType": "image/gif" }, + {"sourceMediaType": "image/x-raw-hasselblad", "targetMediaType": "image/ief" }, + {"sourceMediaType": "image/x-raw-hasselblad", "targetMediaType": "image/jp2" }, + {"sourceMediaType": "image/x-raw-hasselblad", "targetMediaType": "image/jpeg" }, + {"sourceMediaType": "image/x-raw-hasselblad", "targetMediaType": "image/x-raw-kodak" }, + {"sourceMediaType": "image/x-raw-hasselblad", "targetMediaType": "image/x-raw-minolta" }, + {"sourceMediaType": "image/x-raw-hasselblad", "targetMediaType": "image/x-raw-nikon" }, + {"sourceMediaType": "image/x-raw-hasselblad", "targetMediaType": "image/x-raw-olympus" }, + {"sourceMediaType": "image/x-raw-hasselblad", "targetMediaType": "image/x-portable-bitmap" }, + {"sourceMediaType": "image/x-raw-hasselblad", "targetMediaType": "image/x-raw-pentax" }, + {"sourceMediaType": "image/x-raw-hasselblad", "targetMediaType": "image/x-portable-graymap" }, + {"sourceMediaType": "image/x-raw-hasselblad", "targetMediaType": "image/x-portable-anymap" }, + {"sourceMediaType": "image/x-raw-hasselblad", "targetMediaType": "image/vnd.adobe.premiere" }, + {"sourceMediaType": "image/x-raw-hasselblad", "targetMediaType": "image/x-portable-pixmap" }, + {"sourceMediaType": "image/x-raw-hasselblad", "targetMediaType": "image/vnd.adobe.photoshop" }, + {"sourceMediaType": "image/x-raw-hasselblad", "targetMediaType": "image/x-raw-red" }, + {"sourceMediaType": "image/x-raw-hasselblad", "targetMediaType": "image/x-raw-fuji" }, + {"sourceMediaType": "image/x-raw-hasselblad", "targetMediaType": "image/png" }, + {"sourceMediaType": "image/x-raw-hasselblad", "targetMediaType": "image/x-raw-panasonic" }, + {"sourceMediaType": "image/x-raw-hasselblad", "targetMediaType": "image/x-raw-leica" }, + {"sourceMediaType": "image/x-raw-hasselblad", "targetMediaType": "image/x-cmu-raster" }, + {"sourceMediaType": "image/x-raw-hasselblad", "targetMediaType": "image/tiff" }, + {"sourceMediaType": "image/x-raw-hasselblad", "targetMediaType": "image/x-raw-sigma" }, + {"sourceMediaType": "image/x-raw-hasselblad", "targetMediaType": "image/x-xbitmap" }, + {"sourceMediaType": "image/x-raw-hasselblad", "targetMediaType": "image/x-xpixmap" }, + {"sourceMediaType": "image/x-raw-hasselblad", "targetMediaType": "image/x-xwindowdump" }, + + {"sourceMediaType": "image/x-raw-sony", "targetMediaType": "image/x-raw-hasselblad" }, + {"sourceMediaType": "image/x-raw-sony", "priority": 55, "targetMediaType": "image/x-raw-sony" }, + {"sourceMediaType": "image/x-raw-sony", "targetMediaType": "image/bmp" }, + {"sourceMediaType": "image/x-raw-sony", "targetMediaType": "image/cgm" }, + {"sourceMediaType": "image/x-raw-sony", "targetMediaType": "image/x-raw-canon" }, + {"sourceMediaType": "image/x-raw-sony", "targetMediaType": "image/x-raw-adobe" }, + {"sourceMediaType": "image/x-raw-sony", "targetMediaType": "application/eps" }, + {"sourceMediaType": "image/x-raw-sony", "targetMediaType": "image/gif" }, + {"sourceMediaType": "image/x-raw-sony", "targetMediaType": "image/ief" }, + {"sourceMediaType": "image/x-raw-sony", "targetMediaType": "image/jp2" }, + {"sourceMediaType": "image/x-raw-sony", "targetMediaType": "image/jpeg" }, + {"sourceMediaType": "image/x-raw-sony", "targetMediaType": "image/x-raw-kodak" }, + {"sourceMediaType": "image/x-raw-sony", "targetMediaType": "image/x-raw-minolta" }, + {"sourceMediaType": "image/x-raw-sony", "targetMediaType": "image/x-raw-nikon" }, + {"sourceMediaType": "image/x-raw-sony", "targetMediaType": "image/x-raw-olympus" }, + {"sourceMediaType": "image/x-raw-sony", "targetMediaType": "image/x-portable-bitmap" }, + {"sourceMediaType": "image/x-raw-sony", "targetMediaType": "image/x-raw-pentax" }, + {"sourceMediaType": "image/x-raw-sony", "targetMediaType": "image/x-portable-graymap" }, + {"sourceMediaType": "image/x-raw-sony", "targetMediaType": "image/x-portable-anymap" }, + {"sourceMediaType": "image/x-raw-sony", "targetMediaType": "image/vnd.adobe.premiere" }, + {"sourceMediaType": "image/x-raw-sony", "targetMediaType": "image/x-portable-pixmap" }, + {"sourceMediaType": "image/x-raw-sony", "targetMediaType": "image/vnd.adobe.photoshop" }, + {"sourceMediaType": "image/x-raw-sony", "targetMediaType": "image/x-raw-red" }, + {"sourceMediaType": "image/x-raw-sony", "targetMediaType": "image/x-raw-fuji" }, + {"sourceMediaType": "image/x-raw-sony", "targetMediaType": "image/png" }, + {"sourceMediaType": "image/x-raw-sony", "targetMediaType": "image/x-raw-panasonic" }, + {"sourceMediaType": "image/x-raw-sony", "targetMediaType": "image/x-raw-leica" }, + {"sourceMediaType": "image/x-raw-sony", "targetMediaType": "image/x-cmu-raster" }, + {"sourceMediaType": "image/x-raw-sony", "targetMediaType": "image/tiff" }, + {"sourceMediaType": "image/x-raw-sony", "targetMediaType": "image/x-raw-sigma" }, + {"sourceMediaType": "image/x-raw-sony", "targetMediaType": "image/x-xbitmap" }, + {"sourceMediaType": "image/x-raw-sony", "targetMediaType": "image/x-xpixmap" }, + {"sourceMediaType": "image/x-raw-sony", "targetMediaType": "image/x-xwindowdump" }, + + {"sourceMediaType": "image/bmp", "targetMediaType": "image/x-raw-hasselblad" }, + {"sourceMediaType": "image/bmp", "targetMediaType": "image/x-raw-sony" }, + {"sourceMediaType": "image/bmp", "priority": 55, "targetMediaType": "image/bmp" }, + {"sourceMediaType": "image/bmp", "targetMediaType": "image/cgm" }, + {"sourceMediaType": "image/bmp", "targetMediaType": "image/x-raw-canon" }, + {"sourceMediaType": "image/bmp", "targetMediaType": "image/x-raw-adobe" }, + {"sourceMediaType": "image/bmp", "targetMediaType": "application/eps" }, + {"sourceMediaType": "image/bmp", "targetMediaType": "image/gif" }, + {"sourceMediaType": "image/bmp", "targetMediaType": "image/ief" }, + {"sourceMediaType": "image/bmp", "targetMediaType": "image/jp2" }, + {"sourceMediaType": "image/bmp", "targetMediaType": "image/jpeg" }, + {"sourceMediaType": "image/bmp", "targetMediaType": "image/x-raw-kodak" }, + {"sourceMediaType": "image/bmp", "targetMediaType": "image/x-raw-minolta" }, + {"sourceMediaType": "image/bmp", "targetMediaType": "image/x-raw-nikon" }, + {"sourceMediaType": "image/bmp", "targetMediaType": "image/x-raw-olympus" }, + {"sourceMediaType": "image/bmp", "targetMediaType": "image/x-portable-bitmap" }, + {"sourceMediaType": "image/bmp", "targetMediaType": "image/x-raw-pentax" }, + {"sourceMediaType": "image/bmp", "targetMediaType": "image/x-portable-graymap" }, + {"sourceMediaType": "image/bmp", "targetMediaType": "image/x-portable-anymap" }, + {"sourceMediaType": "image/bmp", "targetMediaType": "image/vnd.adobe.premiere" }, + {"sourceMediaType": "image/bmp", "targetMediaType": "image/x-portable-pixmap" }, + {"sourceMediaType": "image/bmp", "targetMediaType": "image/vnd.adobe.photoshop" }, + {"sourceMediaType": "image/bmp", "targetMediaType": "image/x-raw-red" }, + {"sourceMediaType": "image/bmp", "targetMediaType": "image/x-raw-fuji" }, + {"sourceMediaType": "image/bmp", "targetMediaType": "image/png" }, + {"sourceMediaType": "image/bmp", "targetMediaType": "image/x-raw-panasonic" }, + {"sourceMediaType": "image/bmp", "targetMediaType": "image/x-raw-leica" }, + {"sourceMediaType": "image/bmp", "targetMediaType": "image/x-cmu-raster" }, + {"sourceMediaType": "image/bmp", "targetMediaType": "image/tiff" }, + {"sourceMediaType": "image/bmp", "targetMediaType": "image/x-raw-sigma" }, + {"sourceMediaType": "image/bmp", "targetMediaType": "image/x-xbitmap" }, + {"sourceMediaType": "image/bmp", "targetMediaType": "image/x-xpixmap" }, + {"sourceMediaType": "image/bmp", "targetMediaType": "image/x-xwindowdump" }, + + {"sourceMediaType": "image/cgm", "targetMediaType": "image/x-raw-hasselblad" }, + {"sourceMediaType": "image/cgm", "targetMediaType": "image/x-raw-sony" }, + {"sourceMediaType": "image/cgm", "targetMediaType": "image/bmp" }, + {"sourceMediaType": "image/cgm", "priority": 55, "targetMediaType": "image/cgm" }, + {"sourceMediaType": "image/cgm", "targetMediaType": "image/x-raw-canon" }, + {"sourceMediaType": "image/cgm", "targetMediaType": "image/x-raw-adobe" }, + {"sourceMediaType": "image/cgm", "targetMediaType": "application/eps" }, + {"sourceMediaType": "image/cgm", "targetMediaType": "image/gif" }, + {"sourceMediaType": "image/cgm", "targetMediaType": "image/ief" }, + {"sourceMediaType": "image/cgm", "targetMediaType": "image/jp2" }, + {"sourceMediaType": "image/cgm", "targetMediaType": "image/jpeg" }, + {"sourceMediaType": "image/cgm", "targetMediaType": "image/x-raw-kodak" }, + {"sourceMediaType": "image/cgm", "targetMediaType": "image/x-raw-minolta" }, + {"sourceMediaType": "image/cgm", "targetMediaType": "image/x-raw-nikon" }, + {"sourceMediaType": "image/cgm", "targetMediaType": "image/x-raw-olympus" }, + {"sourceMediaType": "image/cgm", "targetMediaType": "image/x-portable-bitmap" }, + {"sourceMediaType": "image/cgm", "targetMediaType": "image/x-raw-pentax" }, + {"sourceMediaType": "image/cgm", "targetMediaType": "image/x-portable-graymap" }, + {"sourceMediaType": "image/cgm", "targetMediaType": "image/x-portable-anymap" }, + {"sourceMediaType": "image/cgm", "targetMediaType": "image/vnd.adobe.premiere" }, + {"sourceMediaType": "image/cgm", "targetMediaType": "image/x-portable-pixmap" }, + {"sourceMediaType": "image/cgm", "targetMediaType": "image/vnd.adobe.photoshop" }, + {"sourceMediaType": "image/cgm", "targetMediaType": "image/x-raw-red" }, + {"sourceMediaType": "image/cgm", "targetMediaType": "image/x-raw-fuji" }, + {"sourceMediaType": "image/cgm", "targetMediaType": "image/png" }, + {"sourceMediaType": "image/cgm", "targetMediaType": "image/x-raw-panasonic" }, + {"sourceMediaType": "image/cgm", "targetMediaType": "image/x-raw-leica" }, + {"sourceMediaType": "image/cgm", "targetMediaType": "image/x-cmu-raster" }, + {"sourceMediaType": "image/cgm", "targetMediaType": "image/tiff" }, + {"sourceMediaType": "image/cgm", "targetMediaType": "image/x-raw-sigma" }, + {"sourceMediaType": "image/cgm", "targetMediaType": "image/x-xbitmap" }, + {"sourceMediaType": "image/cgm", "targetMediaType": "image/x-xpixmap" }, + {"sourceMediaType": "image/cgm", "targetMediaType": "image/x-xwindowdump" }, + + {"sourceMediaType": "image/x-raw-canon", "targetMediaType": "image/x-raw-hasselblad" }, + {"sourceMediaType": "image/x-raw-canon", "targetMediaType": "image/x-raw-sony" }, + {"sourceMediaType": "image/x-raw-canon", "targetMediaType": "image/bmp" }, + {"sourceMediaType": "image/x-raw-canon", "targetMediaType": "image/cgm" }, + {"sourceMediaType": "image/x-raw-canon", "priority": 55, "targetMediaType": "image/x-raw-canon" }, + {"sourceMediaType": "image/x-raw-canon", "targetMediaType": "image/x-raw-adobe" }, + {"sourceMediaType": "image/x-raw-canon", "targetMediaType": "application/eps" }, + {"sourceMediaType": "image/x-raw-canon", "targetMediaType": "image/gif" }, + {"sourceMediaType": "image/x-raw-canon", "targetMediaType": "image/ief" }, + {"sourceMediaType": "image/x-raw-canon", "targetMediaType": "image/jp2" }, + {"sourceMediaType": "image/x-raw-canon", "targetMediaType": "image/jpeg" }, + {"sourceMediaType": "image/x-raw-canon", "targetMediaType": "image/x-raw-kodak" }, + {"sourceMediaType": "image/x-raw-canon", "targetMediaType": "image/x-raw-minolta" }, + {"sourceMediaType": "image/x-raw-canon", "targetMediaType": "image/x-raw-nikon" }, + {"sourceMediaType": "image/x-raw-canon", "targetMediaType": "image/x-raw-olympus" }, + {"sourceMediaType": "image/x-raw-canon", "targetMediaType": "image/x-portable-bitmap" }, + {"sourceMediaType": "image/x-raw-canon", "targetMediaType": "image/x-raw-pentax" }, + {"sourceMediaType": "image/x-raw-canon", "targetMediaType": "image/x-portable-graymap" }, + {"sourceMediaType": "image/x-raw-canon", "targetMediaType": "image/x-portable-anymap" }, + {"sourceMediaType": "image/x-raw-canon", "targetMediaType": "image/vnd.adobe.premiere" }, + {"sourceMediaType": "image/x-raw-canon", "targetMediaType": "image/x-portable-pixmap" }, + {"sourceMediaType": "image/x-raw-canon", "targetMediaType": "image/vnd.adobe.photoshop" }, + {"sourceMediaType": "image/x-raw-canon", "targetMediaType": "image/x-raw-red" }, + {"sourceMediaType": "image/x-raw-canon", "targetMediaType": "image/x-raw-fuji" }, + {"sourceMediaType": "image/x-raw-canon", "targetMediaType": "image/png" }, + {"sourceMediaType": "image/x-raw-canon", "targetMediaType": "image/x-raw-panasonic" }, + {"sourceMediaType": "image/x-raw-canon", "targetMediaType": "image/x-raw-leica" }, + {"sourceMediaType": "image/x-raw-canon", "targetMediaType": "image/x-cmu-raster" }, + {"sourceMediaType": "image/x-raw-canon", "targetMediaType": "image/tiff" }, + {"sourceMediaType": "image/x-raw-canon", "targetMediaType": "image/x-raw-sigma" }, + {"sourceMediaType": "image/x-raw-canon", "targetMediaType": "image/x-xbitmap" }, + {"sourceMediaType": "image/x-raw-canon", "targetMediaType": "image/x-xpixmap" }, + {"sourceMediaType": "image/x-raw-canon", "targetMediaType": "image/x-xwindowdump" }, + + {"sourceMediaType": "image/x-raw-adobe", "targetMediaType": "image/x-raw-hasselblad" }, + {"sourceMediaType": "image/x-raw-adobe", "targetMediaType": "image/x-raw-sony" }, + {"sourceMediaType": "image/x-raw-adobe", "targetMediaType": "image/bmp" }, + {"sourceMediaType": "image/x-raw-adobe", "targetMediaType": "image/cgm" }, + {"sourceMediaType": "image/x-raw-adobe", "targetMediaType": "image/x-raw-canon" }, + {"sourceMediaType": "image/x-raw-adobe", "priority": 55, "targetMediaType": "image/x-raw-adobe" }, + {"sourceMediaType": "image/x-raw-adobe", "targetMediaType": "application/eps" }, + {"sourceMediaType": "image/x-raw-adobe", "targetMediaType": "image/gif" }, + {"sourceMediaType": "image/x-raw-adobe", "targetMediaType": "image/ief" }, + {"sourceMediaType": "image/x-raw-adobe", "targetMediaType": "image/jp2" }, + {"sourceMediaType": "image/x-raw-adobe", "targetMediaType": "image/jpeg" }, + {"sourceMediaType": "image/x-raw-adobe", "targetMediaType": "image/x-raw-kodak" }, + {"sourceMediaType": "image/x-raw-adobe", "targetMediaType": "image/x-raw-minolta" }, + {"sourceMediaType": "image/x-raw-adobe", "targetMediaType": "image/x-raw-nikon" }, + {"sourceMediaType": "image/x-raw-adobe", "targetMediaType": "image/x-raw-olympus" }, + {"sourceMediaType": "image/x-raw-adobe", "targetMediaType": "image/x-portable-bitmap" }, + {"sourceMediaType": "image/x-raw-adobe", "targetMediaType": "image/x-raw-pentax" }, + {"sourceMediaType": "image/x-raw-adobe", "targetMediaType": "image/x-portable-graymap" }, + {"sourceMediaType": "image/x-raw-adobe", "targetMediaType": "image/x-portable-anymap" }, + {"sourceMediaType": "image/x-raw-adobe", "targetMediaType": "image/vnd.adobe.premiere" }, + {"sourceMediaType": "image/x-raw-adobe", "targetMediaType": "image/x-portable-pixmap" }, + {"sourceMediaType": "image/x-raw-adobe", "targetMediaType": "image/vnd.adobe.photoshop" }, + {"sourceMediaType": "image/x-raw-adobe", "targetMediaType": "image/x-raw-red" }, + {"sourceMediaType": "image/x-raw-adobe", "targetMediaType": "image/x-raw-fuji" }, + {"sourceMediaType": "image/x-raw-adobe", "targetMediaType": "image/png" }, + {"sourceMediaType": "image/x-raw-adobe", "targetMediaType": "image/x-raw-panasonic" }, + {"sourceMediaType": "image/x-raw-adobe", "targetMediaType": "image/x-raw-leica" }, + {"sourceMediaType": "image/x-raw-adobe", "targetMediaType": "image/x-cmu-raster" }, + {"sourceMediaType": "image/x-raw-adobe", "targetMediaType": "image/tiff" }, + {"sourceMediaType": "image/x-raw-adobe", "targetMediaType": "image/x-raw-sigma" }, + {"sourceMediaType": "image/x-raw-adobe", "targetMediaType": "image/x-xbitmap" }, + {"sourceMediaType": "image/x-raw-adobe", "targetMediaType": "image/x-xpixmap" }, + {"sourceMediaType": "image/x-raw-adobe", "targetMediaType": "image/x-xwindowdump" }, + + {"sourceMediaType": "application/eps", "targetMediaType": "image/x-raw-hasselblad" }, + {"sourceMediaType": "application/eps", "targetMediaType": "image/x-raw-sony" }, + {"sourceMediaType": "application/eps", "targetMediaType": "image/bmp" }, + {"sourceMediaType": "application/eps", "targetMediaType": "image/cgm" }, + {"sourceMediaType": "application/eps", "targetMediaType": "image/x-raw-canon" }, + {"sourceMediaType": "application/eps", "targetMediaType": "image/x-raw-adobe" }, + {"sourceMediaType": "application/eps", "priority": 55, "targetMediaType": "application/eps" }, + {"sourceMediaType": "application/eps", "targetMediaType": "image/gif" }, + {"sourceMediaType": "application/eps", "targetMediaType": "image/ief" }, + {"sourceMediaType": "application/eps", "targetMediaType": "image/jp2" }, + {"sourceMediaType": "application/eps", "targetMediaType": "image/jpeg" }, + {"sourceMediaType": "application/eps", "targetMediaType": "image/x-raw-kodak" }, + {"sourceMediaType": "application/eps", "targetMediaType": "image/x-raw-minolta" }, + {"sourceMediaType": "application/eps", "targetMediaType": "image/x-raw-nikon" }, + {"sourceMediaType": "application/eps", "targetMediaType": "image/x-raw-olympus" }, + {"sourceMediaType": "application/eps", "targetMediaType": "image/x-portable-bitmap" }, + {"sourceMediaType": "application/eps", "targetMediaType": "image/x-raw-pentax" }, + {"sourceMediaType": "application/eps", "targetMediaType": "image/x-portable-graymap" }, + {"sourceMediaType": "application/eps", "targetMediaType": "image/x-portable-anymap" }, + {"sourceMediaType": "application/eps", "targetMediaType": "image/vnd.adobe.premiere" }, + {"sourceMediaType": "application/eps", "targetMediaType": "image/x-portable-pixmap" }, + {"sourceMediaType": "application/eps", "targetMediaType": "image/vnd.adobe.photoshop" }, + {"sourceMediaType": "application/eps", "targetMediaType": "image/x-raw-red" }, + {"sourceMediaType": "application/eps", "targetMediaType": "image/x-raw-fuji" }, + {"sourceMediaType": "application/eps", "targetMediaType": "image/png" }, + {"sourceMediaType": "application/eps", "targetMediaType": "image/x-raw-panasonic" }, + {"sourceMediaType": "application/eps", "targetMediaType": "image/x-raw-leica" }, + {"sourceMediaType": "application/eps", "targetMediaType": "image/x-cmu-raster" }, + {"sourceMediaType": "application/eps", "targetMediaType": "image/tiff" }, + {"sourceMediaType": "application/eps", "targetMediaType": "image/x-raw-sigma" }, + {"sourceMediaType": "application/eps", "targetMediaType": "image/x-xbitmap" }, + {"sourceMediaType": "application/eps", "targetMediaType": "image/x-xpixmap" }, + {"sourceMediaType": "application/eps", "targetMediaType": "image/x-xwindowdump" }, + + {"sourceMediaType": "image/gif", "targetMediaType": "image/x-raw-hasselblad" }, + {"sourceMediaType": "image/gif", "targetMediaType": "image/x-raw-sony" }, + {"sourceMediaType": "image/gif", "targetMediaType": "image/bmp" }, + {"sourceMediaType": "image/gif", "targetMediaType": "image/cgm" }, + {"sourceMediaType": "image/gif", "targetMediaType": "image/x-raw-canon" }, + {"sourceMediaType": "image/gif", "targetMediaType": "image/x-raw-adobe" }, + {"sourceMediaType": "image/gif", "targetMediaType": "application/eps" }, + {"sourceMediaType": "image/gif", "priority": 55, "targetMediaType": "image/gif" }, + {"sourceMediaType": "image/gif", "targetMediaType": "image/ief" }, + {"sourceMediaType": "image/gif", "targetMediaType": "image/jp2" }, + {"sourceMediaType": "image/gif", "targetMediaType": "image/jpeg" }, + {"sourceMediaType": "image/gif", "targetMediaType": "image/x-raw-kodak" }, + {"sourceMediaType": "image/gif", "targetMediaType": "image/x-raw-minolta" }, + {"sourceMediaType": "image/gif", "targetMediaType": "image/x-raw-nikon" }, + {"sourceMediaType": "image/gif", "targetMediaType": "image/x-raw-olympus" }, + {"sourceMediaType": "image/gif", "targetMediaType": "image/x-portable-bitmap" }, + {"sourceMediaType": "image/gif", "targetMediaType": "image/x-raw-pentax" }, + {"sourceMediaType": "image/gif", "targetMediaType": "image/x-portable-graymap" }, + {"sourceMediaType": "image/gif", "targetMediaType": "image/x-portable-anymap" }, + {"sourceMediaType": "image/gif", "targetMediaType": "image/vnd.adobe.premiere" }, + {"sourceMediaType": "image/gif", "targetMediaType": "image/x-portable-pixmap" }, + {"sourceMediaType": "image/gif", "targetMediaType": "image/vnd.adobe.photoshop" }, + {"sourceMediaType": "image/gif", "targetMediaType": "image/x-raw-red" }, + {"sourceMediaType": "image/gif", "targetMediaType": "image/x-raw-fuji" }, + {"sourceMediaType": "image/gif", "targetMediaType": "image/png" }, + {"sourceMediaType": "image/gif", "targetMediaType": "image/x-raw-panasonic" }, + {"sourceMediaType": "image/gif", "targetMediaType": "image/x-raw-leica" }, + {"sourceMediaType": "image/gif", "targetMediaType": "image/x-cmu-raster" }, + {"sourceMediaType": "image/gif", "targetMediaType": "image/tiff" }, + {"sourceMediaType": "image/gif", "targetMediaType": "image/x-raw-sigma" }, + {"sourceMediaType": "image/gif", "targetMediaType": "image/x-xbitmap" }, + {"sourceMediaType": "image/gif", "targetMediaType": "image/x-xpixmap" }, + {"sourceMediaType": "image/gif", "targetMediaType": "image/x-xwindowdump" }, + + {"sourceMediaType": "image/ief", "targetMediaType": "image/x-raw-hasselblad" }, + {"sourceMediaType": "image/ief", "targetMediaType": "image/x-raw-sony" }, + {"sourceMediaType": "image/ief", "targetMediaType": "image/bmp" }, + {"sourceMediaType": "image/ief", "targetMediaType": "image/cgm" }, + {"sourceMediaType": "image/ief", "targetMediaType": "image/x-raw-canon" }, + {"sourceMediaType": "image/ief", "targetMediaType": "image/x-raw-adobe" }, + {"sourceMediaType": "image/ief", "targetMediaType": "application/eps" }, + {"sourceMediaType": "image/ief", "targetMediaType": "image/gif" }, + {"sourceMediaType": "image/ief", "priority": 55, "targetMediaType": "image/ief" }, + {"sourceMediaType": "image/ief", "targetMediaType": "image/jp2" }, + {"sourceMediaType": "image/ief", "targetMediaType": "image/jpeg" }, + {"sourceMediaType": "image/ief", "targetMediaType": "image/x-raw-kodak" }, + {"sourceMediaType": "image/ief", "targetMediaType": "image/x-raw-minolta" }, + {"sourceMediaType": "image/ief", "targetMediaType": "image/x-raw-nikon" }, + {"sourceMediaType": "image/ief", "targetMediaType": "image/x-raw-olympus" }, + {"sourceMediaType": "image/ief", "targetMediaType": "image/x-portable-bitmap" }, + {"sourceMediaType": "image/ief", "targetMediaType": "image/x-raw-pentax" }, + {"sourceMediaType": "image/ief", "targetMediaType": "image/x-portable-graymap" }, + {"sourceMediaType": "image/ief", "targetMediaType": "image/x-portable-anymap" }, + {"sourceMediaType": "image/ief", "targetMediaType": "image/vnd.adobe.premiere" }, + {"sourceMediaType": "image/ief", "targetMediaType": "image/x-portable-pixmap" }, + {"sourceMediaType": "image/ief", "targetMediaType": "image/vnd.adobe.photoshop" }, + {"sourceMediaType": "image/ief", "targetMediaType": "image/x-raw-red" }, + {"sourceMediaType": "image/ief", "targetMediaType": "image/x-raw-fuji" }, + {"sourceMediaType": "image/ief", "targetMediaType": "image/png" }, + {"sourceMediaType": "image/ief", "targetMediaType": "image/x-raw-panasonic" }, + {"sourceMediaType": "image/ief", "targetMediaType": "image/x-raw-leica" }, + {"sourceMediaType": "image/ief", "targetMediaType": "image/x-cmu-raster" }, + {"sourceMediaType": "image/ief", "targetMediaType": "image/tiff" }, + {"sourceMediaType": "image/ief", "targetMediaType": "image/x-raw-sigma" }, + {"sourceMediaType": "image/ief", "targetMediaType": "image/x-xbitmap" }, + {"sourceMediaType": "image/ief", "targetMediaType": "image/x-xpixmap" }, + {"sourceMediaType": "image/ief", "targetMediaType": "image/x-xwindowdump" }, + + {"sourceMediaType": "image/jp2", "targetMediaType": "image/x-raw-hasselblad" }, + {"sourceMediaType": "image/jp2", "targetMediaType": "image/x-raw-sony" }, + {"sourceMediaType": "image/jp2", "targetMediaType": "image/bmp" }, + {"sourceMediaType": "image/jp2", "targetMediaType": "image/cgm" }, + {"sourceMediaType": "image/jp2", "targetMediaType": "image/x-raw-canon" }, + {"sourceMediaType": "image/jp2", "targetMediaType": "image/x-raw-adobe" }, + {"sourceMediaType": "image/jp2", "targetMediaType": "application/eps" }, + {"sourceMediaType": "image/jp2", "targetMediaType": "image/gif" }, + {"sourceMediaType": "image/jp2", "targetMediaType": "image/ief" }, + {"sourceMediaType": "image/jp2", "priority": 55, "targetMediaType": "image/jp2" }, + {"sourceMediaType": "image/jp2", "targetMediaType": "image/jpeg" }, + {"sourceMediaType": "image/jp2", "targetMediaType": "image/x-raw-kodak" }, + {"sourceMediaType": "image/jp2", "targetMediaType": "image/x-raw-minolta" }, + {"sourceMediaType": "image/jp2", "targetMediaType": "image/x-raw-nikon" }, + {"sourceMediaType": "image/jp2", "targetMediaType": "image/x-raw-olympus" }, + {"sourceMediaType": "image/jp2", "targetMediaType": "image/x-portable-bitmap" }, + {"sourceMediaType": "image/jp2", "targetMediaType": "image/x-raw-pentax" }, + {"sourceMediaType": "image/jp2", "targetMediaType": "image/x-portable-graymap" }, + {"sourceMediaType": "image/jp2", "targetMediaType": "image/x-portable-anymap" }, + {"sourceMediaType": "image/jp2", "targetMediaType": "image/vnd.adobe.premiere" }, + {"sourceMediaType": "image/jp2", "targetMediaType": "image/x-portable-pixmap" }, + {"sourceMediaType": "image/jp2", "targetMediaType": "image/vnd.adobe.photoshop" }, + {"sourceMediaType": "image/jp2", "targetMediaType": "image/x-raw-red" }, + {"sourceMediaType": "image/jp2", "targetMediaType": "image/x-raw-fuji" }, + {"sourceMediaType": "image/jp2", "targetMediaType": "image/png" }, + {"sourceMediaType": "image/jp2", "targetMediaType": "image/x-raw-panasonic" }, + {"sourceMediaType": "image/jp2", "targetMediaType": "image/x-raw-leica" }, + {"sourceMediaType": "image/jp2", "targetMediaType": "image/x-cmu-raster" }, + {"sourceMediaType": "image/jp2", "targetMediaType": "image/tiff" }, + {"sourceMediaType": "image/jp2", "targetMediaType": "image/x-raw-sigma" }, + {"sourceMediaType": "image/jp2", "targetMediaType": "image/x-xbitmap" }, + {"sourceMediaType": "image/jp2", "targetMediaType": "image/x-xpixmap" }, + {"sourceMediaType": "image/jp2", "targetMediaType": "image/x-xwindowdump" }, + + {"sourceMediaType": "image/jpeg", "targetMediaType": "image/x-raw-hasselblad" }, + {"sourceMediaType": "image/jpeg", "targetMediaType": "image/x-raw-sony" }, + {"sourceMediaType": "image/jpeg", "targetMediaType": "image/bmp" }, + {"sourceMediaType": "image/jpeg", "targetMediaType": "image/cgm" }, + {"sourceMediaType": "image/jpeg", "targetMediaType": "image/x-raw-canon" }, + {"sourceMediaType": "image/jpeg", "targetMediaType": "image/x-raw-adobe" }, + {"sourceMediaType": "image/jpeg", "targetMediaType": "application/eps" }, + {"sourceMediaType": "image/jpeg", "targetMediaType": "image/gif" }, + {"sourceMediaType": "image/jpeg", "targetMediaType": "image/ief" }, + {"sourceMediaType": "image/jpeg", "targetMediaType": "image/jp2" }, + {"sourceMediaType": "image/jpeg", "priority": 55, "targetMediaType": "image/jpeg" }, + {"sourceMediaType": "image/jpeg", "targetMediaType": "image/x-raw-kodak" }, + {"sourceMediaType": "image/jpeg", "targetMediaType": "image/x-raw-minolta" }, + {"sourceMediaType": "image/jpeg", "targetMediaType": "image/x-raw-nikon" }, + {"sourceMediaType": "image/jpeg", "targetMediaType": "image/x-raw-olympus" }, + {"sourceMediaType": "image/jpeg", "targetMediaType": "image/x-portable-bitmap" }, + {"sourceMediaType": "image/jpeg", "targetMediaType": "image/x-raw-pentax" }, + {"sourceMediaType": "image/jpeg", "targetMediaType": "image/x-portable-graymap" }, + {"sourceMediaType": "image/jpeg", "targetMediaType": "image/x-portable-anymap" }, + {"sourceMediaType": "image/jpeg", "targetMediaType": "image/vnd.adobe.premiere" }, + {"sourceMediaType": "image/jpeg", "targetMediaType": "image/x-portable-pixmap" }, + {"sourceMediaType": "image/jpeg", "targetMediaType": "image/vnd.adobe.photoshop" }, + {"sourceMediaType": "image/jpeg", "targetMediaType": "image/x-raw-red" }, + {"sourceMediaType": "image/jpeg", "targetMediaType": "image/x-raw-fuji" }, + {"sourceMediaType": "image/jpeg", "targetMediaType": "image/png" }, + {"sourceMediaType": "image/jpeg", "targetMediaType": "image/x-raw-panasonic" }, + {"sourceMediaType": "image/jpeg", "targetMediaType": "image/x-raw-leica" }, + {"sourceMediaType": "image/jpeg", "targetMediaType": "image/x-cmu-raster" }, + {"sourceMediaType": "image/jpeg", "targetMediaType": "image/tiff" }, + {"sourceMediaType": "image/jpeg", "targetMediaType": "image/x-raw-sigma" }, + {"sourceMediaType": "image/jpeg", "targetMediaType": "image/x-xbitmap" }, + {"sourceMediaType": "image/jpeg", "targetMediaType": "image/x-xpixmap" }, + {"sourceMediaType": "image/jpeg", "targetMediaType": "image/x-xwindowdump" }, + + {"sourceMediaType": "image/x-raw-kodak", "targetMediaType": "image/x-raw-hasselblad" }, + {"sourceMediaType": "image/x-raw-kodak", "targetMediaType": "image/x-raw-sony" }, + {"sourceMediaType": "image/x-raw-kodak", "targetMediaType": "image/bmp" }, + {"sourceMediaType": "image/x-raw-kodak", "targetMediaType": "image/cgm" }, + {"sourceMediaType": "image/x-raw-kodak", "targetMediaType": "image/x-raw-canon" }, + {"sourceMediaType": "image/x-raw-kodak", "targetMediaType": "image/x-raw-adobe" }, + {"sourceMediaType": "image/x-raw-kodak", "targetMediaType": "application/eps" }, + {"sourceMediaType": "image/x-raw-kodak", "targetMediaType": "image/gif" }, + {"sourceMediaType": "image/x-raw-kodak", "targetMediaType": "image/ief" }, + {"sourceMediaType": "image/x-raw-kodak", "targetMediaType": "image/jp2" }, + {"sourceMediaType": "image/x-raw-kodak", "targetMediaType": "image/jpeg" }, + {"sourceMediaType": "image/x-raw-kodak", "priority": 55, "targetMediaType": "image/x-raw-kodak" }, + {"sourceMediaType": "image/x-raw-kodak", "targetMediaType": "image/x-raw-minolta" }, + {"sourceMediaType": "image/x-raw-kodak", "targetMediaType": "image/x-raw-nikon" }, + {"sourceMediaType": "image/x-raw-kodak", "targetMediaType": "image/x-raw-olympus" }, + {"sourceMediaType": "image/x-raw-kodak", "targetMediaType": "image/x-portable-bitmap" }, + {"sourceMediaType": "image/x-raw-kodak", "targetMediaType": "image/x-raw-pentax" }, + {"sourceMediaType": "image/x-raw-kodak", "targetMediaType": "image/x-portable-graymap" }, + {"sourceMediaType": "image/x-raw-kodak", "targetMediaType": "image/x-portable-anymap" }, + {"sourceMediaType": "image/x-raw-kodak", "targetMediaType": "image/vnd.adobe.premiere" }, + {"sourceMediaType": "image/x-raw-kodak", "targetMediaType": "image/x-portable-pixmap" }, + {"sourceMediaType": "image/x-raw-kodak", "targetMediaType": "image/vnd.adobe.photoshop" }, + {"sourceMediaType": "image/x-raw-kodak", "targetMediaType": "image/x-raw-red" }, + {"sourceMediaType": "image/x-raw-kodak", "targetMediaType": "image/x-raw-fuji" }, + {"sourceMediaType": "image/x-raw-kodak", "targetMediaType": "image/png" }, + {"sourceMediaType": "image/x-raw-kodak", "targetMediaType": "image/x-raw-panasonic" }, + {"sourceMediaType": "image/x-raw-kodak", "targetMediaType": "image/x-raw-leica" }, + {"sourceMediaType": "image/x-raw-kodak", "targetMediaType": "image/x-cmu-raster" }, + {"sourceMediaType": "image/x-raw-kodak", "targetMediaType": "image/tiff" }, + {"sourceMediaType": "image/x-raw-kodak", "targetMediaType": "image/x-raw-sigma" }, + {"sourceMediaType": "image/x-raw-kodak", "targetMediaType": "image/x-xbitmap" }, + {"sourceMediaType": "image/x-raw-kodak", "targetMediaType": "image/x-xpixmap" }, + {"sourceMediaType": "image/x-raw-kodak", "targetMediaType": "image/x-xwindowdump" }, + + {"sourceMediaType": "image/x-raw-minolta", "targetMediaType": "image/x-raw-hasselblad" }, + {"sourceMediaType": "image/x-raw-minolta", "targetMediaType": "image/x-raw-sony" }, + {"sourceMediaType": "image/x-raw-minolta", "targetMediaType": "image/bmp" }, + {"sourceMediaType": "image/x-raw-minolta", "targetMediaType": "image/cgm" }, + {"sourceMediaType": "image/x-raw-minolta", "targetMediaType": "image/x-raw-canon" }, + {"sourceMediaType": "image/x-raw-minolta", "targetMediaType": "image/x-raw-adobe" }, + {"sourceMediaType": "image/x-raw-minolta", "targetMediaType": "application/eps" }, + {"sourceMediaType": "image/x-raw-minolta", "targetMediaType": "image/gif" }, + {"sourceMediaType": "image/x-raw-minolta", "targetMediaType": "image/ief" }, + {"sourceMediaType": "image/x-raw-minolta", "targetMediaType": "image/jp2" }, + {"sourceMediaType": "image/x-raw-minolta", "targetMediaType": "image/jpeg" }, + {"sourceMediaType": "image/x-raw-minolta", "targetMediaType": "image/x-raw-kodak" }, + {"sourceMediaType": "image/x-raw-minolta", "priority": 55, "targetMediaType": "image/x-raw-minolta" }, + {"sourceMediaType": "image/x-raw-minolta", "targetMediaType": "image/x-raw-nikon" }, + {"sourceMediaType": "image/x-raw-minolta", "targetMediaType": "image/x-raw-olympus" }, + {"sourceMediaType": "image/x-raw-minolta", "targetMediaType": "image/x-portable-bitmap" }, + {"sourceMediaType": "image/x-raw-minolta", "targetMediaType": "image/x-raw-pentax" }, + {"sourceMediaType": "image/x-raw-minolta", "targetMediaType": "image/x-portable-graymap" }, + {"sourceMediaType": "image/x-raw-minolta", "targetMediaType": "image/x-portable-anymap" }, + {"sourceMediaType": "image/x-raw-minolta", "targetMediaType": "image/vnd.adobe.premiere" }, + {"sourceMediaType": "image/x-raw-minolta", "targetMediaType": "image/x-portable-pixmap" }, + {"sourceMediaType": "image/x-raw-minolta", "targetMediaType": "image/vnd.adobe.photoshop" }, + {"sourceMediaType": "image/x-raw-minolta", "targetMediaType": "image/x-raw-red" }, + {"sourceMediaType": "image/x-raw-minolta", "targetMediaType": "image/x-raw-fuji" }, + {"sourceMediaType": "image/x-raw-minolta", "targetMediaType": "image/png" }, + {"sourceMediaType": "image/x-raw-minolta", "targetMediaType": "image/x-raw-panasonic" }, + {"sourceMediaType": "image/x-raw-minolta", "targetMediaType": "image/x-raw-leica" }, + {"sourceMediaType": "image/x-raw-minolta", "targetMediaType": "image/x-cmu-raster" }, + {"sourceMediaType": "image/x-raw-minolta", "targetMediaType": "image/tiff" }, + {"sourceMediaType": "image/x-raw-minolta", "targetMediaType": "image/x-raw-sigma" }, + {"sourceMediaType": "image/x-raw-minolta", "targetMediaType": "image/x-xbitmap" }, + {"sourceMediaType": "image/x-raw-minolta", "targetMediaType": "image/x-xpixmap" }, + {"sourceMediaType": "image/x-raw-minolta", "targetMediaType": "image/x-xwindowdump" }, + + {"sourceMediaType": "image/x-raw-nikon", "targetMediaType": "image/x-raw-hasselblad" }, + {"sourceMediaType": "image/x-raw-nikon", "targetMediaType": "image/x-raw-sony" }, + {"sourceMediaType": "image/x-raw-nikon", "targetMediaType": "image/bmp" }, + {"sourceMediaType": "image/x-raw-nikon", "targetMediaType": "image/cgm" }, + {"sourceMediaType": "image/x-raw-nikon", "targetMediaType": "image/x-raw-canon" }, + {"sourceMediaType": "image/x-raw-nikon", "targetMediaType": "image/x-raw-adobe" }, + {"sourceMediaType": "image/x-raw-nikon", "targetMediaType": "application/eps" }, + {"sourceMediaType": "image/x-raw-nikon", "targetMediaType": "image/gif" }, + {"sourceMediaType": "image/x-raw-nikon", "targetMediaType": "image/ief" }, + {"sourceMediaType": "image/x-raw-nikon", "targetMediaType": "image/jp2" }, + {"sourceMediaType": "image/x-raw-nikon", "targetMediaType": "image/jpeg" }, + {"sourceMediaType": "image/x-raw-nikon", "targetMediaType": "image/x-raw-kodak" }, + {"sourceMediaType": "image/x-raw-nikon", "targetMediaType": "image/x-raw-minolta" }, + {"sourceMediaType": "image/x-raw-nikon", "priority": 55, "targetMediaType": "image/x-raw-nikon" }, + {"sourceMediaType": "image/x-raw-nikon", "targetMediaType": "image/x-raw-olympus" }, + {"sourceMediaType": "image/x-raw-nikon", "targetMediaType": "image/x-portable-bitmap" }, + {"sourceMediaType": "image/x-raw-nikon", "targetMediaType": "image/x-raw-pentax" }, + {"sourceMediaType": "image/x-raw-nikon", "targetMediaType": "image/x-portable-graymap" }, + {"sourceMediaType": "image/x-raw-nikon", "targetMediaType": "image/x-portable-anymap" }, + {"sourceMediaType": "image/x-raw-nikon", "targetMediaType": "image/vnd.adobe.premiere" }, + {"sourceMediaType": "image/x-raw-nikon", "targetMediaType": "image/x-portable-pixmap" }, + {"sourceMediaType": "image/x-raw-nikon", "targetMediaType": "image/vnd.adobe.photoshop" }, + {"sourceMediaType": "image/x-raw-nikon", "targetMediaType": "image/x-raw-red" }, + {"sourceMediaType": "image/x-raw-nikon", "targetMediaType": "image/x-raw-fuji" }, + {"sourceMediaType": "image/x-raw-nikon", "targetMediaType": "image/png" }, + {"sourceMediaType": "image/x-raw-nikon", "targetMediaType": "image/x-raw-panasonic" }, + {"sourceMediaType": "image/x-raw-nikon", "targetMediaType": "image/x-raw-leica" }, + {"sourceMediaType": "image/x-raw-nikon", "targetMediaType": "image/x-cmu-raster" }, + {"sourceMediaType": "image/x-raw-nikon", "targetMediaType": "image/tiff" }, + {"sourceMediaType": "image/x-raw-nikon", "targetMediaType": "image/x-raw-sigma" }, + {"sourceMediaType": "image/x-raw-nikon", "targetMediaType": "image/x-xbitmap" }, + {"sourceMediaType": "image/x-raw-nikon", "targetMediaType": "image/x-xpixmap" }, + {"sourceMediaType": "image/x-raw-nikon", "targetMediaType": "image/x-xwindowdump" }, + + {"sourceMediaType": "image/x-raw-olympus", "targetMediaType": "image/x-raw-hasselblad" }, + {"sourceMediaType": "image/x-raw-olympus", "targetMediaType": "image/x-raw-sony" }, + {"sourceMediaType": "image/x-raw-olympus", "targetMediaType": "image/bmp" }, + {"sourceMediaType": "image/x-raw-olympus", "targetMediaType": "image/cgm" }, + {"sourceMediaType": "image/x-raw-olympus", "targetMediaType": "image/x-raw-canon" }, + {"sourceMediaType": "image/x-raw-olympus", "targetMediaType": "image/x-raw-adobe" }, + {"sourceMediaType": "image/x-raw-olympus", "targetMediaType": "application/eps" }, + {"sourceMediaType": "image/x-raw-olympus", "targetMediaType": "image/gif" }, + {"sourceMediaType": "image/x-raw-olympus", "targetMediaType": "image/ief" }, + {"sourceMediaType": "image/x-raw-olympus", "targetMediaType": "image/jp2" }, + {"sourceMediaType": "image/x-raw-olympus", "targetMediaType": "image/jpeg" }, + {"sourceMediaType": "image/x-raw-olympus", "targetMediaType": "image/x-raw-kodak" }, + {"sourceMediaType": "image/x-raw-olympus", "targetMediaType": "image/x-raw-minolta" }, + {"sourceMediaType": "image/x-raw-olympus", "targetMediaType": "image/x-raw-nikon" }, + {"sourceMediaType": "image/x-raw-olympus", "priority": 55, "targetMediaType": "image/x-raw-olympus" }, + {"sourceMediaType": "image/x-raw-olympus", "targetMediaType": "image/x-portable-bitmap" }, + {"sourceMediaType": "image/x-raw-olympus", "targetMediaType": "image/x-raw-pentax" }, + {"sourceMediaType": "image/x-raw-olympus", "targetMediaType": "image/x-portable-graymap" }, + {"sourceMediaType": "image/x-raw-olympus", "targetMediaType": "image/x-portable-anymap" }, + {"sourceMediaType": "image/x-raw-olympus", "targetMediaType": "image/vnd.adobe.premiere" }, + {"sourceMediaType": "image/x-raw-olympus", "targetMediaType": "image/x-portable-pixmap" }, + {"sourceMediaType": "image/x-raw-olympus", "targetMediaType": "image/vnd.adobe.photoshop" }, + {"sourceMediaType": "image/x-raw-olympus", "targetMediaType": "image/x-raw-red" }, + {"sourceMediaType": "image/x-raw-olympus", "targetMediaType": "image/x-raw-fuji" }, + {"sourceMediaType": "image/x-raw-olympus", "targetMediaType": "image/png" }, + {"sourceMediaType": "image/x-raw-olympus", "targetMediaType": "image/x-raw-panasonic" }, + {"sourceMediaType": "image/x-raw-olympus", "targetMediaType": "image/x-raw-leica" }, + {"sourceMediaType": "image/x-raw-olympus", "targetMediaType": "image/x-cmu-raster" }, + {"sourceMediaType": "image/x-raw-olympus", "targetMediaType": "image/tiff" }, + {"sourceMediaType": "image/x-raw-olympus", "targetMediaType": "image/x-raw-sigma" }, + {"sourceMediaType": "image/x-raw-olympus", "targetMediaType": "image/x-xbitmap" }, + {"sourceMediaType": "image/x-raw-olympus", "targetMediaType": "image/x-xpixmap" }, + {"sourceMediaType": "image/x-raw-olympus", "targetMediaType": "image/x-xwindowdump" }, + + {"sourceMediaType": "image/x-portable-bitmap", "targetMediaType": "image/x-raw-hasselblad" }, + {"sourceMediaType": "image/x-portable-bitmap", "targetMediaType": "image/x-raw-sony" }, + {"sourceMediaType": "image/x-portable-bitmap", "targetMediaType": "image/bmp" }, + {"sourceMediaType": "image/x-portable-bitmap", "targetMediaType": "image/cgm" }, + {"sourceMediaType": "image/x-portable-bitmap", "targetMediaType": "image/x-raw-canon" }, + {"sourceMediaType": "image/x-portable-bitmap", "targetMediaType": "image/x-raw-adobe" }, + {"sourceMediaType": "image/x-portable-bitmap", "targetMediaType": "application/eps" }, + {"sourceMediaType": "image/x-portable-bitmap", "targetMediaType": "image/gif" }, + {"sourceMediaType": "image/x-portable-bitmap", "targetMediaType": "image/ief" }, + {"sourceMediaType": "image/x-portable-bitmap", "targetMediaType": "image/jp2" }, + {"sourceMediaType": "image/x-portable-bitmap", "targetMediaType": "image/jpeg" }, + {"sourceMediaType": "image/x-portable-bitmap", "targetMediaType": "image/x-raw-kodak" }, + {"sourceMediaType": "image/x-portable-bitmap", "targetMediaType": "image/x-raw-minolta" }, + {"sourceMediaType": "image/x-portable-bitmap", "targetMediaType": "image/x-raw-nikon" }, + {"sourceMediaType": "image/x-portable-bitmap", "targetMediaType": "image/x-raw-olympus" }, + {"sourceMediaType": "image/x-portable-bitmap", "priority": 55, "targetMediaType": "image/x-portable-bitmap" }, + {"sourceMediaType": "image/x-portable-bitmap", "targetMediaType": "image/x-raw-pentax" }, + {"sourceMediaType": "image/x-portable-bitmap", "targetMediaType": "image/x-portable-graymap" }, + {"sourceMediaType": "image/x-portable-bitmap", "targetMediaType": "image/x-portable-anymap" }, + {"sourceMediaType": "image/x-portable-bitmap", "targetMediaType": "image/vnd.adobe.premiere" }, + {"sourceMediaType": "image/x-portable-bitmap", "targetMediaType": "image/x-portable-pixmap" }, + {"sourceMediaType": "image/x-portable-bitmap", "targetMediaType": "image/vnd.adobe.photoshop" }, + {"sourceMediaType": "image/x-portable-bitmap", "targetMediaType": "image/x-raw-red" }, + {"sourceMediaType": "image/x-portable-bitmap", "targetMediaType": "image/x-raw-fuji" }, + {"sourceMediaType": "image/x-portable-bitmap", "targetMediaType": "image/png" }, + {"sourceMediaType": "image/x-portable-bitmap", "targetMediaType": "image/x-raw-panasonic" }, + {"sourceMediaType": "image/x-portable-bitmap", "targetMediaType": "image/x-raw-leica" }, + {"sourceMediaType": "image/x-portable-bitmap", "targetMediaType": "image/x-cmu-raster" }, + {"sourceMediaType": "image/x-portable-bitmap", "targetMediaType": "image/tiff" }, + {"sourceMediaType": "image/x-portable-bitmap", "targetMediaType": "image/x-raw-sigma" }, + {"sourceMediaType": "image/x-portable-bitmap", "targetMediaType": "image/x-xbitmap" }, + {"sourceMediaType": "image/x-portable-bitmap", "targetMediaType": "image/x-xpixmap" }, + {"sourceMediaType": "image/x-portable-bitmap", "targetMediaType": "image/x-xwindowdump" }, + + {"sourceMediaType": "image/x-raw-pentax", "targetMediaType": "image/x-raw-hasselblad" }, + {"sourceMediaType": "image/x-raw-pentax", "targetMediaType": "image/x-raw-sony" }, + {"sourceMediaType": "image/x-raw-pentax", "targetMediaType": "image/bmp" }, + {"sourceMediaType": "image/x-raw-pentax", "targetMediaType": "image/cgm" }, + {"sourceMediaType": "image/x-raw-pentax", "targetMediaType": "image/x-raw-canon" }, + {"sourceMediaType": "image/x-raw-pentax", "targetMediaType": "image/x-raw-adobe" }, + {"sourceMediaType": "image/x-raw-pentax", "targetMediaType": "application/eps" }, + {"sourceMediaType": "image/x-raw-pentax", "targetMediaType": "image/gif" }, + {"sourceMediaType": "image/x-raw-pentax", "targetMediaType": "image/ief" }, + {"sourceMediaType": "image/x-raw-pentax", "targetMediaType": "image/jp2" }, + {"sourceMediaType": "image/x-raw-pentax", "targetMediaType": "image/jpeg" }, + {"sourceMediaType": "image/x-raw-pentax", "targetMediaType": "image/x-raw-kodak" }, + {"sourceMediaType": "image/x-raw-pentax", "targetMediaType": "image/x-raw-minolta" }, + {"sourceMediaType": "image/x-raw-pentax", "targetMediaType": "image/x-raw-nikon" }, + {"sourceMediaType": "image/x-raw-pentax", "targetMediaType": "image/x-raw-olympus" }, + {"sourceMediaType": "image/x-raw-pentax", "targetMediaType": "image/x-portable-bitmap" }, + {"sourceMediaType": "image/x-raw-pentax", "priority": 55, "targetMediaType": "image/x-raw-pentax" }, + {"sourceMediaType": "image/x-raw-pentax", "targetMediaType": "image/x-portable-graymap" }, + {"sourceMediaType": "image/x-raw-pentax", "targetMediaType": "image/x-portable-anymap" }, + {"sourceMediaType": "image/x-raw-pentax", "targetMediaType": "image/vnd.adobe.premiere" }, + {"sourceMediaType": "image/x-raw-pentax", "targetMediaType": "image/x-portable-pixmap" }, + {"sourceMediaType": "image/x-raw-pentax", "targetMediaType": "image/vnd.adobe.photoshop" }, + {"sourceMediaType": "image/x-raw-pentax", "targetMediaType": "image/x-raw-red" }, + {"sourceMediaType": "image/x-raw-pentax", "targetMediaType": "image/x-raw-fuji" }, + {"sourceMediaType": "image/x-raw-pentax", "targetMediaType": "image/png" }, + {"sourceMediaType": "image/x-raw-pentax", "targetMediaType": "image/x-raw-panasonic" }, + {"sourceMediaType": "image/x-raw-pentax", "targetMediaType": "image/x-raw-leica" }, + {"sourceMediaType": "image/x-raw-pentax", "targetMediaType": "image/x-cmu-raster" }, + {"sourceMediaType": "image/x-raw-pentax", "targetMediaType": "image/tiff" }, + {"sourceMediaType": "image/x-raw-pentax", "targetMediaType": "image/x-raw-sigma" }, + {"sourceMediaType": "image/x-raw-pentax", "targetMediaType": "image/x-xbitmap" }, + {"sourceMediaType": "image/x-raw-pentax", "targetMediaType": "image/x-xpixmap" }, + {"sourceMediaType": "image/x-raw-pentax", "targetMediaType": "image/x-xwindowdump" }, + + {"sourceMediaType": "image/x-portable-graymap", "targetMediaType": "image/x-raw-hasselblad" }, + {"sourceMediaType": "image/x-portable-graymap", "targetMediaType": "image/x-raw-sony" }, + {"sourceMediaType": "image/x-portable-graymap", "targetMediaType": "image/bmp" }, + {"sourceMediaType": "image/x-portable-graymap", "targetMediaType": "image/cgm" }, + {"sourceMediaType": "image/x-portable-graymap", "targetMediaType": "image/x-raw-canon" }, + {"sourceMediaType": "image/x-portable-graymap", "targetMediaType": "image/x-raw-adobe" }, + {"sourceMediaType": "image/x-portable-graymap", "targetMediaType": "application/eps" }, + {"sourceMediaType": "image/x-portable-graymap", "targetMediaType": "image/gif" }, + {"sourceMediaType": "image/x-portable-graymap", "targetMediaType": "image/ief" }, + {"sourceMediaType": "image/x-portable-graymap", "targetMediaType": "image/jp2" }, + {"sourceMediaType": "image/x-portable-graymap", "targetMediaType": "image/jpeg" }, + {"sourceMediaType": "image/x-portable-graymap", "targetMediaType": "image/x-raw-kodak" }, + {"sourceMediaType": "image/x-portable-graymap", "targetMediaType": "image/x-raw-minolta" }, + {"sourceMediaType": "image/x-portable-graymap", "targetMediaType": "image/x-raw-nikon" }, + {"sourceMediaType": "image/x-portable-graymap", "targetMediaType": "image/x-raw-olympus" }, + {"sourceMediaType": "image/x-portable-graymap", "targetMediaType": "image/x-portable-bitmap" }, + {"sourceMediaType": "image/x-portable-graymap", "targetMediaType": "image/x-raw-pentax" }, + {"sourceMediaType": "image/x-portable-graymap", "priority": 55, "targetMediaType": "image/x-portable-graymap" }, + {"sourceMediaType": "image/x-portable-graymap", "targetMediaType": "image/x-portable-anymap" }, + {"sourceMediaType": "image/x-portable-graymap", "targetMediaType": "image/vnd.adobe.premiere" }, + {"sourceMediaType": "image/x-portable-graymap", "targetMediaType": "image/x-portable-pixmap" }, + {"sourceMediaType": "image/x-portable-graymap", "targetMediaType": "image/vnd.adobe.photoshop" }, + {"sourceMediaType": "image/x-portable-graymap", "targetMediaType": "image/x-raw-red" }, + {"sourceMediaType": "image/x-portable-graymap", "targetMediaType": "image/x-raw-fuji" }, + {"sourceMediaType": "image/x-portable-graymap", "targetMediaType": "image/png" }, + {"sourceMediaType": "image/x-portable-graymap", "targetMediaType": "image/x-raw-panasonic" }, + {"sourceMediaType": "image/x-portable-graymap", "targetMediaType": "image/x-raw-leica" }, + {"sourceMediaType": "image/x-portable-graymap", "targetMediaType": "image/x-cmu-raster" }, + {"sourceMediaType": "image/x-portable-graymap", "targetMediaType": "image/tiff" }, + {"sourceMediaType": "image/x-portable-graymap", "targetMediaType": "image/x-raw-sigma" }, + {"sourceMediaType": "image/x-portable-graymap", "targetMediaType": "image/x-xbitmap" }, + {"sourceMediaType": "image/x-portable-graymap", "targetMediaType": "image/x-xpixmap" }, + {"sourceMediaType": "image/x-portable-graymap", "targetMediaType": "image/x-xwindowdump" }, + + {"sourceMediaType": "image/png", "targetMediaType": "image/x-raw-hasselblad" }, + {"sourceMediaType": "image/png", "targetMediaType": "image/x-raw-sony" }, + {"sourceMediaType": "image/png", "targetMediaType": "image/bmp" }, + {"sourceMediaType": "image/png", "targetMediaType": "image/cgm" }, + {"sourceMediaType": "image/png", "targetMediaType": "image/x-raw-canon" }, + {"sourceMediaType": "image/png", "targetMediaType": "image/x-raw-adobe" }, + {"sourceMediaType": "image/png", "targetMediaType": "application/eps" }, + {"sourceMediaType": "image/png", "targetMediaType": "image/gif" }, + {"sourceMediaType": "image/png", "targetMediaType": "image/ief" }, + {"sourceMediaType": "image/png", "targetMediaType": "image/jp2" }, + {"sourceMediaType": "image/png", "targetMediaType": "image/jpeg" }, + {"sourceMediaType": "image/png", "targetMediaType": "image/x-raw-kodak" }, + {"sourceMediaType": "image/png", "targetMediaType": "image/x-raw-minolta" }, + {"sourceMediaType": "image/png", "targetMediaType": "image/x-raw-nikon" }, + {"sourceMediaType": "image/png", "targetMediaType": "image/x-raw-olympus" }, + {"sourceMediaType": "image/png", "targetMediaType": "image/x-portable-bitmap" }, + {"sourceMediaType": "image/png", "targetMediaType": "image/x-raw-pentax" }, + {"sourceMediaType": "image/png", "targetMediaType": "image/x-portable-graymap" }, + {"sourceMediaType": "image/png", "targetMediaType": "image/x-portable-anymap" }, + {"sourceMediaType": "image/png", "targetMediaType": "image/vnd.adobe.premiere" }, + {"sourceMediaType": "image/png", "targetMediaType": "image/x-portable-pixmap" }, + {"sourceMediaType": "image/png", "targetMediaType": "image/vnd.adobe.photoshop" }, + {"sourceMediaType": "image/png", "targetMediaType": "image/x-raw-red" }, + {"sourceMediaType": "image/png", "targetMediaType": "image/x-raw-fuji" }, + {"sourceMediaType": "image/png", "priority": 55, "targetMediaType": "image/png" }, + {"sourceMediaType": "image/png", "targetMediaType": "image/x-raw-panasonic" }, + {"sourceMediaType": "image/png", "targetMediaType": "image/x-raw-leica" }, + {"sourceMediaType": "image/png", "targetMediaType": "image/x-cmu-raster" }, + {"sourceMediaType": "image/png", "targetMediaType": "image/tiff" }, + {"sourceMediaType": "image/png", "targetMediaType": "image/x-raw-sigma" }, + {"sourceMediaType": "image/png", "targetMediaType": "image/x-xbitmap" }, + {"sourceMediaType": "image/png", "targetMediaType": "image/x-xpixmap" }, + {"sourceMediaType": "image/png", "targetMediaType": "image/x-xwindowdump" }, + + {"sourceMediaType": "image/x-portable-anymap", "targetMediaType": "image/x-raw-hasselblad" }, + {"sourceMediaType": "image/x-portable-anymap", "targetMediaType": "image/x-raw-sony" }, + {"sourceMediaType": "image/x-portable-anymap", "targetMediaType": "image/bmp" }, + {"sourceMediaType": "image/x-portable-anymap", "targetMediaType": "image/cgm" }, + {"sourceMediaType": "image/x-portable-anymap", "targetMediaType": "image/x-raw-canon" }, + {"sourceMediaType": "image/x-portable-anymap", "targetMediaType": "image/x-raw-adobe" }, + {"sourceMediaType": "image/x-portable-anymap", "targetMediaType": "application/eps" }, + {"sourceMediaType": "image/x-portable-anymap", "targetMediaType": "image/gif" }, + {"sourceMediaType": "image/x-portable-anymap", "targetMediaType": "image/ief" }, + {"sourceMediaType": "image/x-portable-anymap", "targetMediaType": "image/jp2" }, + {"sourceMediaType": "image/x-portable-anymap", "targetMediaType": "image/jpeg" }, + {"sourceMediaType": "image/x-portable-anymap", "targetMediaType": "image/x-raw-kodak" }, + {"sourceMediaType": "image/x-portable-anymap", "targetMediaType": "image/x-raw-minolta" }, + {"sourceMediaType": "image/x-portable-anymap", "targetMediaType": "image/x-raw-nikon" }, + {"sourceMediaType": "image/x-portable-anymap", "targetMediaType": "image/x-raw-olympus" }, + {"sourceMediaType": "image/x-portable-anymap", "targetMediaType": "image/x-portable-bitmap" }, + {"sourceMediaType": "image/x-portable-anymap", "targetMediaType": "image/x-raw-pentax" }, + {"sourceMediaType": "image/x-portable-anymap", "targetMediaType": "image/x-portable-graymap" }, + {"sourceMediaType": "image/x-portable-anymap", "priority": 55, "targetMediaType": "image/x-portable-anymap" }, + {"sourceMediaType": "image/x-portable-anymap", "targetMediaType": "image/vnd.adobe.premiere" }, + {"sourceMediaType": "image/x-portable-anymap", "targetMediaType": "image/x-portable-pixmap" }, + {"sourceMediaType": "image/x-portable-anymap", "targetMediaType": "image/vnd.adobe.photoshop" }, + {"sourceMediaType": "image/x-portable-anymap", "targetMediaType": "image/x-raw-red" }, + {"sourceMediaType": "image/x-portable-anymap", "targetMediaType": "image/x-raw-fuji" }, + {"sourceMediaType": "image/x-portable-anymap", "targetMediaType": "image/png" }, + {"sourceMediaType": "image/x-portable-anymap", "targetMediaType": "image/x-raw-panasonic" }, + {"sourceMediaType": "image/x-portable-anymap", "targetMediaType": "image/x-raw-leica" }, + {"sourceMediaType": "image/x-portable-anymap", "targetMediaType": "image/x-cmu-raster" }, + {"sourceMediaType": "image/x-portable-anymap", "targetMediaType": "image/tiff" }, + {"sourceMediaType": "image/x-portable-anymap", "targetMediaType": "image/x-raw-sigma" }, + {"sourceMediaType": "image/x-portable-anymap", "targetMediaType": "image/x-xbitmap" }, + {"sourceMediaType": "image/x-portable-anymap", "targetMediaType": "image/x-xpixmap" }, + {"sourceMediaType": "image/x-portable-anymap", "targetMediaType": "image/x-xwindowdump" }, + + {"sourceMediaType": "image/vnd.adobe.premiere", "targetMediaType": "image/x-raw-hasselblad" }, + {"sourceMediaType": "image/vnd.adobe.premiere", "targetMediaType": "image/x-raw-sony" }, + {"sourceMediaType": "image/vnd.adobe.premiere", "targetMediaType": "image/bmp" }, + {"sourceMediaType": "image/vnd.adobe.premiere", "targetMediaType": "image/cgm" }, + {"sourceMediaType": "image/vnd.adobe.premiere", "targetMediaType": "image/x-raw-canon" }, + {"sourceMediaType": "image/vnd.adobe.premiere", "targetMediaType": "image/x-raw-adobe" }, + {"sourceMediaType": "image/vnd.adobe.premiere", "targetMediaType": "application/eps" }, + {"sourceMediaType": "image/vnd.adobe.premiere", "targetMediaType": "image/gif" }, + {"sourceMediaType": "image/vnd.adobe.premiere", "targetMediaType": "image/ief" }, + {"sourceMediaType": "image/vnd.adobe.premiere", "targetMediaType": "image/jp2" }, + {"sourceMediaType": "image/vnd.adobe.premiere", "targetMediaType": "image/jpeg" }, + {"sourceMediaType": "image/vnd.adobe.premiere", "targetMediaType": "image/x-raw-kodak" }, + {"sourceMediaType": "image/vnd.adobe.premiere", "targetMediaType": "image/x-raw-minolta" }, + {"sourceMediaType": "image/vnd.adobe.premiere", "targetMediaType": "image/x-raw-nikon" }, + {"sourceMediaType": "image/vnd.adobe.premiere", "targetMediaType": "image/x-raw-olympus" }, + {"sourceMediaType": "image/vnd.adobe.premiere", "targetMediaType": "image/x-portable-bitmap" }, + {"sourceMediaType": "image/vnd.adobe.premiere", "targetMediaType": "image/x-raw-pentax" }, + {"sourceMediaType": "image/vnd.adobe.premiere", "targetMediaType": "image/x-portable-graymap" }, + {"sourceMediaType": "image/vnd.adobe.premiere", "targetMediaType": "image/x-portable-anymap" }, + {"sourceMediaType": "image/vnd.adobe.premiere", "priority": 55, "targetMediaType": "image/vnd.adobe.premiere" }, + {"sourceMediaType": "image/vnd.adobe.premiere", "targetMediaType": "image/x-portable-pixmap" }, + {"sourceMediaType": "image/vnd.adobe.premiere", "targetMediaType": "image/vnd.adobe.photoshop" }, + {"sourceMediaType": "image/vnd.adobe.premiere", "targetMediaType": "image/x-raw-red" }, + {"sourceMediaType": "image/vnd.adobe.premiere", "targetMediaType": "image/x-raw-fuji" }, + {"sourceMediaType": "image/vnd.adobe.premiere", "targetMediaType": "image/png" }, + {"sourceMediaType": "image/vnd.adobe.premiere", "targetMediaType": "image/x-raw-panasonic" }, + {"sourceMediaType": "image/vnd.adobe.premiere", "targetMediaType": "image/x-raw-leica" }, + {"sourceMediaType": "image/vnd.adobe.premiere", "targetMediaType": "image/x-cmu-raster" }, + {"sourceMediaType": "image/vnd.adobe.premiere", "targetMediaType": "image/tiff" }, + {"sourceMediaType": "image/vnd.adobe.premiere", "targetMediaType": "image/x-raw-sigma" }, + {"sourceMediaType": "image/vnd.adobe.premiere", "targetMediaType": "image/x-xbitmap" }, + {"sourceMediaType": "image/vnd.adobe.premiere", "targetMediaType": "image/x-xpixmap" }, + {"sourceMediaType": "image/vnd.adobe.premiere", "targetMediaType": "image/x-xwindowdump" }, + + {"sourceMediaType": "image/x-portable-pixmap", "targetMediaType": "image/x-raw-hasselblad" }, + {"sourceMediaType": "image/x-portable-pixmap", "targetMediaType": "image/x-raw-sony" }, + {"sourceMediaType": "image/x-portable-pixmap", "targetMediaType": "image/bmp" }, + {"sourceMediaType": "image/x-portable-pixmap", "targetMediaType": "image/cgm" }, + {"sourceMediaType": "image/x-portable-pixmap", "targetMediaType": "image/x-raw-canon" }, + {"sourceMediaType": "image/x-portable-pixmap", "targetMediaType": "image/x-raw-adobe" }, + {"sourceMediaType": "image/x-portable-pixmap", "targetMediaType": "application/eps" }, + {"sourceMediaType": "image/x-portable-pixmap", "targetMediaType": "image/gif" }, + {"sourceMediaType": "image/x-portable-pixmap", "targetMediaType": "image/ief" }, + {"sourceMediaType": "image/x-portable-pixmap", "targetMediaType": "image/jp2" }, + {"sourceMediaType": "image/x-portable-pixmap", "targetMediaType": "image/jpeg" }, + {"sourceMediaType": "image/x-portable-pixmap", "targetMediaType": "image/x-raw-kodak" }, + {"sourceMediaType": "image/x-portable-pixmap", "targetMediaType": "image/x-raw-minolta" }, + {"sourceMediaType": "image/x-portable-pixmap", "targetMediaType": "image/x-raw-nikon" }, + {"sourceMediaType": "image/x-portable-pixmap", "targetMediaType": "image/x-raw-olympus" }, + {"sourceMediaType": "image/x-portable-pixmap", "targetMediaType": "image/x-portable-bitmap" }, + {"sourceMediaType": "image/x-portable-pixmap", "targetMediaType": "image/x-raw-pentax" }, + {"sourceMediaType": "image/x-portable-pixmap", "targetMediaType": "image/x-portable-graymap" }, + {"sourceMediaType": "image/x-portable-pixmap", "targetMediaType": "image/x-portable-anymap" }, + {"sourceMediaType": "image/x-portable-pixmap", "targetMediaType": "image/vnd.adobe.premiere" }, + {"sourceMediaType": "image/x-portable-pixmap", "priority": 55, "targetMediaType": "image/x-portable-pixmap" }, + {"sourceMediaType": "image/x-portable-pixmap", "targetMediaType": "image/vnd.adobe.photoshop" }, + {"sourceMediaType": "image/x-portable-pixmap", "targetMediaType": "image/x-raw-red" }, + {"sourceMediaType": "image/x-portable-pixmap", "targetMediaType": "image/x-raw-fuji" }, + {"sourceMediaType": "image/x-portable-pixmap", "targetMediaType": "image/png" }, + {"sourceMediaType": "image/x-portable-pixmap", "targetMediaType": "image/x-raw-panasonic" }, + {"sourceMediaType": "image/x-portable-pixmap", "targetMediaType": "image/x-raw-leica" }, + {"sourceMediaType": "image/x-portable-pixmap", "targetMediaType": "image/x-cmu-raster" }, + {"sourceMediaType": "image/x-portable-pixmap", "targetMediaType": "image/tiff" }, + {"sourceMediaType": "image/x-portable-pixmap", "targetMediaType": "image/x-raw-sigma" }, + {"sourceMediaType": "image/x-portable-pixmap", "targetMediaType": "image/x-xbitmap" }, + {"sourceMediaType": "image/x-portable-pixmap", "targetMediaType": "image/x-xpixmap" }, + {"sourceMediaType": "image/x-portable-pixmap", "targetMediaType": "image/x-xwindowdump" }, + + {"sourceMediaType": "mage/vnd.adobe.photoshop", "targetMediaType": "image/x-raw-hasselblad" }, + {"sourceMediaType": "mage/vnd.adobe.photoshop", "targetMediaType": "image/x-raw-sony" }, + {"sourceMediaType": "mage/vnd.adobe.photoshop", "targetMediaType": "image/bmp" }, + {"sourceMediaType": "mage/vnd.adobe.photoshop", "targetMediaType": "image/cgm" }, + {"sourceMediaType": "mage/vnd.adobe.photoshop", "targetMediaType": "image/x-raw-canon" }, + {"sourceMediaType": "mage/vnd.adobe.photoshop", "targetMediaType": "image/x-raw-adobe" }, + {"sourceMediaType": "mage/vnd.adobe.photoshop", "targetMediaType": "application/eps" }, + {"sourceMediaType": "mage/vnd.adobe.photoshop", "targetMediaType": "image/gif" }, + {"sourceMediaType": "mage/vnd.adobe.photoshop", "targetMediaType": "image/ief" }, + {"sourceMediaType": "mage/vnd.adobe.photoshop", "targetMediaType": "image/jp2" }, + {"sourceMediaType": "mage/vnd.adobe.photoshop", "targetMediaType": "image/jpeg" }, + {"sourceMediaType": "mage/vnd.adobe.photoshop", "targetMediaType": "image/x-raw-kodak" }, + {"sourceMediaType": "mage/vnd.adobe.photoshop", "targetMediaType": "image/x-raw-minolta" }, + {"sourceMediaType": "mage/vnd.adobe.photoshop", "targetMediaType": "image/x-raw-nikon" }, + {"sourceMediaType": "mage/vnd.adobe.photoshop", "targetMediaType": "image/x-raw-olympus" }, + {"sourceMediaType": "mage/vnd.adobe.photoshop", "targetMediaType": "image/x-portable-bitmap" }, + {"sourceMediaType": "mage/vnd.adobe.photoshop", "targetMediaType": "image/x-raw-pentax" }, + {"sourceMediaType": "mage/vnd.adobe.photoshop", "targetMediaType": "image/x-portable-graymap" }, + {"sourceMediaType": "mage/vnd.adobe.photoshop", "targetMediaType": "image/x-portable-anymap" }, + {"sourceMediaType": "mage/vnd.adobe.photoshop", "targetMediaType": "image/vnd.adobe.premiere" }, + {"sourceMediaType": "mage/vnd.adobe.photoshop", "targetMediaType": "image/x-portable-pixmap" }, + {"sourceMediaType": "mage/vnd.adobe.photoshop", "priority": 55, "targetMediaType": "image/vnd.adobe.photoshop" }, + {"sourceMediaType": "mage/vnd.adobe.photoshop", "targetMediaType": "image/x-raw-red" }, + {"sourceMediaType": "mage/vnd.adobe.photoshop", "targetMediaType": "image/x-raw-fuji" }, + {"sourceMediaType": "mage/vnd.adobe.photoshop", "targetMediaType": "image/png" }, + {"sourceMediaType": "mage/vnd.adobe.photoshop", "targetMediaType": "image/x-raw-panasonic" }, + {"sourceMediaType": "mage/vnd.adobe.photoshop", "targetMediaType": "image/x-raw-leica" }, + {"sourceMediaType": "mage/vnd.adobe.photoshop", "targetMediaType": "image/x-cmu-raster" }, + {"sourceMediaType": "mage/vnd.adobe.photoshop", "targetMediaType": "image/tiff" }, + {"sourceMediaType": "mage/vnd.adobe.photoshop", "targetMediaType": "image/x-raw-sigma" }, + {"sourceMediaType": "mage/vnd.adobe.photoshop", "targetMediaType": "image/x-xbitmap" }, + {"sourceMediaType": "mage/vnd.adobe.photoshop", "targetMediaType": "image/x-xpixmap" }, + {"sourceMediaType": "mage/vnd.adobe.photoshop", "targetMediaType": "image/x-xwindowdump" }, + + {"sourceMediaType": "image/x-raw-red", "targetMediaType": "image/x-raw-hasselblad" }, + {"sourceMediaType": "image/x-raw-red", "targetMediaType": "image/x-raw-sony" }, + {"sourceMediaType": "image/x-raw-red", "targetMediaType": "image/bmp" }, + {"sourceMediaType": "image/x-raw-red", "targetMediaType": "image/cgm" }, + {"sourceMediaType": "image/x-raw-red", "targetMediaType": "image/x-raw-canon" }, + {"sourceMediaType": "image/x-raw-red", "targetMediaType": "image/x-raw-adobe" }, + {"sourceMediaType": "image/x-raw-red", "targetMediaType": "application/eps" }, + {"sourceMediaType": "image/x-raw-red", "targetMediaType": "image/gif" }, + {"sourceMediaType": "image/x-raw-red", "targetMediaType": "image/ief" }, + {"sourceMediaType": "image/x-raw-red", "targetMediaType": "image/jp2" }, + {"sourceMediaType": "image/x-raw-red", "targetMediaType": "image/jpeg" }, + {"sourceMediaType": "image/x-raw-red", "targetMediaType": "image/x-raw-kodak" }, + {"sourceMediaType": "image/x-raw-red", "targetMediaType": "image/x-raw-minolta" }, + {"sourceMediaType": "image/x-raw-red", "targetMediaType": "image/x-raw-nikon" }, + {"sourceMediaType": "image/x-raw-red", "targetMediaType": "image/x-raw-olympus" }, + {"sourceMediaType": "image/x-raw-red", "targetMediaType": "image/x-portable-bitmap" }, + {"sourceMediaType": "image/x-raw-red", "targetMediaType": "image/x-raw-pentax" }, + {"sourceMediaType": "image/x-raw-red", "targetMediaType": "image/x-portable-graymap" }, + {"sourceMediaType": "image/x-raw-red", "targetMediaType": "image/x-portable-anymap" }, + {"sourceMediaType": "image/x-raw-red", "targetMediaType": "image/vnd.adobe.premiere" }, + {"sourceMediaType": "image/x-raw-red", "targetMediaType": "image/x-portable-pixmap" }, + {"sourceMediaType": "image/x-raw-red", "targetMediaType": "image/vnd.adobe.photoshop" }, + {"sourceMediaType": "image/x-raw-red", "priority": 55, "targetMediaType": "image/x-raw-red" }, + {"sourceMediaType": "image/x-raw-red", "targetMediaType": "image/x-raw-fuji" }, + {"sourceMediaType": "image/x-raw-red", "targetMediaType": "image/png" }, + {"sourceMediaType": "image/x-raw-red", "targetMediaType": "image/x-raw-panasonic" }, + {"sourceMediaType": "image/x-raw-red", "targetMediaType": "image/x-raw-leica" }, + {"sourceMediaType": "image/x-raw-red", "targetMediaType": "image/x-cmu-raster" }, + {"sourceMediaType": "image/x-raw-red", "targetMediaType": "image/tiff" }, + {"sourceMediaType": "image/x-raw-red", "targetMediaType": "image/x-raw-sigma" }, + {"sourceMediaType": "image/x-raw-red", "targetMediaType": "image/x-xbitmap" }, + {"sourceMediaType": "image/x-raw-red", "targetMediaType": "image/x-xpixmap" }, + {"sourceMediaType": "image/x-raw-red", "targetMediaType": "image/x-xwindowdump" }, + + {"sourceMediaType": "image/x-raw-fuji", "targetMediaType": "image/x-raw-hasselblad" }, + {"sourceMediaType": "image/x-raw-fuji", "targetMediaType": "image/x-raw-sony" }, + {"sourceMediaType": "image/x-raw-fuji", "targetMediaType": "image/bmp" }, + {"sourceMediaType": "image/x-raw-fuji", "targetMediaType": "image/cgm" }, + {"sourceMediaType": "image/x-raw-fuji", "targetMediaType": "image/x-raw-canon" }, + {"sourceMediaType": "image/x-raw-fuji", "targetMediaType": "image/x-raw-adobe" }, + {"sourceMediaType": "image/x-raw-fuji", "targetMediaType": "application/eps" }, + {"sourceMediaType": "image/x-raw-fuji", "targetMediaType": "image/gif" }, + {"sourceMediaType": "image/x-raw-fuji", "targetMediaType": "image/ief" }, + {"sourceMediaType": "image/x-raw-fuji", "targetMediaType": "image/jp2" }, + {"sourceMediaType": "image/x-raw-fuji", "targetMediaType": "image/jpeg" }, + {"sourceMediaType": "image/x-raw-fuji", "targetMediaType": "image/x-raw-kodak" }, + {"sourceMediaType": "image/x-raw-fuji", "targetMediaType": "image/x-raw-minolta" }, + {"sourceMediaType": "image/x-raw-fuji", "targetMediaType": "image/x-raw-nikon" }, + {"sourceMediaType": "image/x-raw-fuji", "targetMediaType": "image/x-raw-olympus" }, + {"sourceMediaType": "image/x-raw-fuji", "targetMediaType": "image/x-portable-bitmap" }, + {"sourceMediaType": "image/x-raw-fuji", "targetMediaType": "image/x-raw-pentax" }, + {"sourceMediaType": "image/x-raw-fuji", "targetMediaType": "image/x-portable-graymap" }, + {"sourceMediaType": "image/x-raw-fuji", "targetMediaType": "image/x-portable-anymap" }, + {"sourceMediaType": "image/x-raw-fuji", "targetMediaType": "image/vnd.adobe.premiere" }, + {"sourceMediaType": "image/x-raw-fuji", "targetMediaType": "image/x-portable-pixmap" }, + {"sourceMediaType": "image/x-raw-fuji", "targetMediaType": "image/vnd.adobe.photoshop" }, + {"sourceMediaType": "image/x-raw-fuji", "targetMediaType": "image/x-raw-red" }, + {"sourceMediaType": "image/x-raw-fuji", "priority": 55, "targetMediaType": "image/x-raw-fuji" }, + {"sourceMediaType": "image/x-raw-fuji", "targetMediaType": "image/png" }, + {"sourceMediaType": "image/x-raw-fuji", "targetMediaType": "image/x-raw-panasonic" }, + {"sourceMediaType": "image/x-raw-fuji", "targetMediaType": "image/x-raw-leica" }, + {"sourceMediaType": "image/x-raw-fuji", "targetMediaType": "image/x-cmu-raster" }, + {"sourceMediaType": "image/x-raw-fuji", "targetMediaType": "image/tiff" }, + {"sourceMediaType": "image/x-raw-fuji", "targetMediaType": "image/x-raw-sigma" }, + {"sourceMediaType": "image/x-raw-fuji", "targetMediaType": "image/x-xbitmap" }, + {"sourceMediaType": "image/x-raw-fuji", "targetMediaType": "image/x-xpixmap" }, + {"sourceMediaType": "image/x-raw-fuji", "targetMediaType": "image/x-xwindowdump" }, + + {"sourceMediaType": "image/x-cmu-raster", "targetMediaType": "image/x-raw-hasselblad" }, + {"sourceMediaType": "image/x-cmu-raster", "targetMediaType": "image/x-raw-sony" }, + {"sourceMediaType": "image/x-cmu-raster", "targetMediaType": "image/bmp" }, + {"sourceMediaType": "image/x-cmu-raster", "targetMediaType": "image/cgm" }, + {"sourceMediaType": "image/x-cmu-raster", "targetMediaType": "image/x-raw-canon" }, + {"sourceMediaType": "image/x-cmu-raster", "targetMediaType": "image/x-raw-adobe" }, + {"sourceMediaType": "image/x-cmu-raster", "targetMediaType": "application/eps" }, + {"sourceMediaType": "image/x-cmu-raster", "targetMediaType": "image/gif" }, + {"sourceMediaType": "image/x-cmu-raster", "targetMediaType": "image/ief" }, + {"sourceMediaType": "image/x-cmu-raster", "targetMediaType": "image/jp2" }, + {"sourceMediaType": "image/x-cmu-raster", "targetMediaType": "image/jpeg" }, + {"sourceMediaType": "image/x-cmu-raster", "targetMediaType": "image/x-raw-kodak" }, + {"sourceMediaType": "image/x-cmu-raster", "targetMediaType": "image/x-raw-minolta" }, + {"sourceMediaType": "image/x-cmu-raster", "targetMediaType": "image/x-raw-nikon" }, + {"sourceMediaType": "image/x-cmu-raster", "targetMediaType": "image/x-raw-olympus" }, + {"sourceMediaType": "image/x-cmu-raster", "targetMediaType": "image/x-portable-bitmap" }, + {"sourceMediaType": "image/x-cmu-raster", "targetMediaType": "image/x-raw-pentax" }, + {"sourceMediaType": "image/x-cmu-raster", "targetMediaType": "image/x-portable-graymap" }, + {"sourceMediaType": "image/x-cmu-raster", "targetMediaType": "image/x-portable-anymap" }, + {"sourceMediaType": "image/x-cmu-raster", "targetMediaType": "image/vnd.adobe.premiere" }, + {"sourceMediaType": "image/x-cmu-raster", "targetMediaType": "image/x-portable-pixmap" }, + {"sourceMediaType": "image/x-cmu-raster", "targetMediaType": "image/vnd.adobe.photoshop" }, + {"sourceMediaType": "image/x-cmu-raster", "targetMediaType": "image/x-raw-red" }, + {"sourceMediaType": "image/x-cmu-raster", "targetMediaType": "image/x-raw-fuji" }, + {"sourceMediaType": "image/x-cmu-raster", "targetMediaType": "image/png" }, + {"sourceMediaType": "image/x-cmu-raster", "targetMediaType": "image/x-raw-panasonic" }, + {"sourceMediaType": "image/x-cmu-raster", "targetMediaType": "image/x-raw-leica" }, + {"sourceMediaType": "image/x-cmu-raster", "priority": 55, "targetMediaType": "image/x-cmu-raster" }, + {"sourceMediaType": "image/x-cmu-raster", "targetMediaType": "image/tiff" }, + {"sourceMediaType": "image/x-cmu-raster", "targetMediaType": "image/x-raw-sigma" }, + {"sourceMediaType": "image/x-cmu-raster", "targetMediaType": "image/x-xbitmap" }, + {"sourceMediaType": "image/x-cmu-raster", "targetMediaType": "image/x-xpixmap" }, + {"sourceMediaType": "image/x-cmu-raster", "targetMediaType": "image/x-xwindowdump" }, + + {"sourceMediaType": "image/x-raw-panasonic", "targetMediaType": "image/x-raw-hasselblad" }, + {"sourceMediaType": "image/x-raw-panasonic", "targetMediaType": "image/x-raw-sony" }, + {"sourceMediaType": "image/x-raw-panasonic", "targetMediaType": "image/bmp" }, + {"sourceMediaType": "image/x-raw-panasonic", "targetMediaType": "image/cgm" }, + {"sourceMediaType": "image/x-raw-panasonic", "targetMediaType": "image/x-raw-canon" }, + {"sourceMediaType": "image/x-raw-panasonic", "targetMediaType": "image/x-raw-adobe" }, + {"sourceMediaType": "image/x-raw-panasonic", "targetMediaType": "application/eps" }, + {"sourceMediaType": "image/x-raw-panasonic", "targetMediaType": "image/gif" }, + {"sourceMediaType": "image/x-raw-panasonic", "targetMediaType": "image/ief" }, + {"sourceMediaType": "image/x-raw-panasonic", "targetMediaType": "image/jp2" }, + {"sourceMediaType": "image/x-raw-panasonic", "targetMediaType": "image/jpeg" }, + {"sourceMediaType": "image/x-raw-panasonic", "targetMediaType": "image/x-raw-kodak" }, + {"sourceMediaType": "image/x-raw-panasonic", "targetMediaType": "image/x-raw-minolta" }, + {"sourceMediaType": "image/x-raw-panasonic", "targetMediaType": "image/x-raw-nikon" }, + {"sourceMediaType": "image/x-raw-panasonic", "targetMediaType": "image/x-raw-olympus" }, + {"sourceMediaType": "image/x-raw-panasonic", "targetMediaType": "image/x-portable-bitmap" }, + {"sourceMediaType": "image/x-raw-panasonic", "targetMediaType": "image/x-raw-pentax" }, + {"sourceMediaType": "image/x-raw-panasonic", "targetMediaType": "image/x-portable-graymap" }, + {"sourceMediaType": "image/x-raw-panasonic", "targetMediaType": "image/x-portable-anymap" }, + {"sourceMediaType": "image/x-raw-panasonic", "targetMediaType": "image/vnd.adobe.premiere" }, + {"sourceMediaType": "image/x-raw-panasonic", "targetMediaType": "image/x-portable-pixmap" }, + {"sourceMediaType": "image/x-raw-panasonic", "targetMediaType": "image/vnd.adobe.photoshop" }, + {"sourceMediaType": "image/x-raw-panasonic", "targetMediaType": "image/x-raw-red" }, + {"sourceMediaType": "image/x-raw-panasonic", "targetMediaType": "image/x-raw-fuji" }, + {"sourceMediaType": "image/x-raw-panasonic", "targetMediaType": "image/png" }, + {"sourceMediaType": "image/x-raw-panasonic", "priority": 55, "targetMediaType": "image/x-raw-panasonic" }, + {"sourceMediaType": "image/x-raw-panasonic", "targetMediaType": "image/x-raw-leica" }, + {"sourceMediaType": "image/x-raw-panasonic", "targetMediaType": "image/x-cmu-raster" }, + {"sourceMediaType": "image/x-raw-panasonic", "targetMediaType": "image/tiff" }, + {"sourceMediaType": "image/x-raw-panasonic", "targetMediaType": "image/x-raw-sigma" }, + {"sourceMediaType": "image/x-raw-panasonic", "targetMediaType": "image/x-xbitmap" }, + {"sourceMediaType": "image/x-raw-panasonic", "targetMediaType": "image/x-xpixmap" }, + {"sourceMediaType": "image/x-raw-panasonic", "targetMediaType": "image/x-xwindowdump" }, + + {"sourceMediaType": "image/x-raw-leica", "targetMediaType": "image/x-raw-hasselblad" }, + {"sourceMediaType": "image/x-raw-leica", "targetMediaType": "image/x-raw-sony" }, + {"sourceMediaType": "image/x-raw-leica", "targetMediaType": "image/bmp" }, + {"sourceMediaType": "image/x-raw-leica", "targetMediaType": "image/cgm" }, + {"sourceMediaType": "image/x-raw-leica", "targetMediaType": "image/x-raw-canon" }, + {"sourceMediaType": "image/x-raw-leica", "targetMediaType": "image/x-raw-adobe" }, + {"sourceMediaType": "image/x-raw-leica", "targetMediaType": "application/eps" }, + {"sourceMediaType": "image/x-raw-leica", "targetMediaType": "image/gif" }, + {"sourceMediaType": "image/x-raw-leica", "targetMediaType": "image/ief" }, + {"sourceMediaType": "image/x-raw-leica", "targetMediaType": "image/jp2" }, + {"sourceMediaType": "image/x-raw-leica", "targetMediaType": "image/jpeg" }, + {"sourceMediaType": "image/x-raw-leica", "targetMediaType": "image/x-raw-kodak" }, + {"sourceMediaType": "image/x-raw-leica", "targetMediaType": "image/x-raw-minolta" }, + {"sourceMediaType": "image/x-raw-leica", "targetMediaType": "image/x-raw-nikon" }, + {"sourceMediaType": "image/x-raw-leica", "targetMediaType": "image/x-raw-olympus" }, + {"sourceMediaType": "image/x-raw-leica", "targetMediaType": "image/x-portable-bitmap" }, + {"sourceMediaType": "image/x-raw-leica", "targetMediaType": "image/x-raw-pentax" }, + {"sourceMediaType": "image/x-raw-leica", "targetMediaType": "image/x-portable-graymap" }, + {"sourceMediaType": "image/x-raw-leica", "targetMediaType": "image/x-portable-anymap" }, + {"sourceMediaType": "image/x-raw-leica", "targetMediaType": "image/vnd.adobe.premiere" }, + {"sourceMediaType": "image/x-raw-leica", "targetMediaType": "image/x-portable-pixmap" }, + {"sourceMediaType": "image/x-raw-leica", "targetMediaType": "image/vnd.adobe.photoshop" }, + {"sourceMediaType": "image/x-raw-leica", "targetMediaType": "image/x-raw-red" }, + {"sourceMediaType": "image/x-raw-leica", "targetMediaType": "image/x-raw-fuji" }, + {"sourceMediaType": "image/x-raw-leica", "targetMediaType": "image/png" }, + {"sourceMediaType": "image/x-raw-leica", "targetMediaType": "image/x-raw-panasonic" }, + {"sourceMediaType": "image/x-raw-leica", "priority": 55, "targetMediaType": "image/x-raw-leica" }, + {"sourceMediaType": "image/x-raw-leica", "targetMediaType": "image/x-cmu-raster" }, + {"sourceMediaType": "image/x-raw-leica", "targetMediaType": "image/tiff" }, + {"sourceMediaType": "image/x-raw-leica", "targetMediaType": "image/x-raw-sigma" }, + {"sourceMediaType": "image/x-raw-leica", "targetMediaType": "image/x-xbitmap" }, + {"sourceMediaType": "image/x-raw-leica", "targetMediaType": "image/x-xpixmap" }, + {"sourceMediaType": "image/x-raw-leica", "targetMediaType": "image/x-xwindowdump" }, + + {"sourceMediaType": "image/tiff", "targetMediaType": "image/x-raw-hasselblad" }, + {"sourceMediaType": "image/tiff", "targetMediaType": "image/x-raw-sony" }, + {"sourceMediaType": "image/tiff", "targetMediaType": "image/bmp" }, + {"sourceMediaType": "image/tiff", "targetMediaType": "image/cgm" }, + {"sourceMediaType": "image/tiff", "targetMediaType": "image/x-raw-canon" }, + {"sourceMediaType": "image/tiff", "targetMediaType": "image/x-raw-adobe" }, + {"sourceMediaType": "image/tiff", "targetMediaType": "application/eps" }, + {"sourceMediaType": "image/tiff", "targetMediaType": "image/gif" }, + {"sourceMediaType": "image/tiff", "targetMediaType": "image/ief" }, + {"sourceMediaType": "image/tiff", "targetMediaType": "image/jp2" }, + {"sourceMediaType": "image/tiff", "targetMediaType": "image/jpeg" }, + {"sourceMediaType": "image/tiff", "targetMediaType": "image/x-raw-kodak" }, + {"sourceMediaType": "image/tiff", "targetMediaType": "image/x-raw-minolta" }, + {"sourceMediaType": "image/tiff", "targetMediaType": "image/x-raw-nikon" }, + {"sourceMediaType": "image/tiff", "targetMediaType": "image/x-raw-olympus" }, + {"sourceMediaType": "image/tiff", "targetMediaType": "image/x-portable-bitmap" }, + {"sourceMediaType": "image/tiff", "targetMediaType": "image/x-raw-pentax" }, + {"sourceMediaType": "image/tiff", "targetMediaType": "image/x-portable-graymap" }, + {"sourceMediaType": "image/tiff", "targetMediaType": "image/x-portable-anymap" }, + {"sourceMediaType": "image/tiff", "targetMediaType": "image/vnd.adobe.premiere" }, + {"sourceMediaType": "image/tiff", "targetMediaType": "image/x-portable-pixmap" }, + {"sourceMediaType": "image/tiff", "targetMediaType": "image/vnd.adobe.photoshop" }, + {"sourceMediaType": "image/tiff", "targetMediaType": "image/x-raw-red" }, + {"sourceMediaType": "image/tiff", "targetMediaType": "image/x-raw-fuji" }, + {"sourceMediaType": "image/tiff", "targetMediaType": "image/png" }, + {"sourceMediaType": "image/tiff", "targetMediaType": "image/x-raw-panasonic" }, + {"sourceMediaType": "image/tiff", "targetMediaType": "image/x-raw-leica" }, + {"sourceMediaType": "image/tiff", "targetMediaType": "image/x-cmu-raster" }, + {"sourceMediaType": "image/tiff", "priority": 55, "targetMediaType": "image/tiff" }, + {"sourceMediaType": "image/tiff", "targetMediaType": "image/x-raw-sigma" }, + {"sourceMediaType": "image/tiff", "targetMediaType": "image/x-xbitmap" }, + {"sourceMediaType": "image/tiff", "targetMediaType": "image/x-xpixmap" }, + {"sourceMediaType": "image/tiff", "targetMediaType": "image/x-xwindowdump" }, + {"sourceMediaType": "image/tiff", "targetMediaType": "application/pdf" }, + + {"sourceMediaType": "image/x-raw-sigma", "targetMediaType": "image/x-raw-hasselblad" }, + {"sourceMediaType": "image/x-raw-sigma", "targetMediaType": "image/x-raw-sony" }, + {"sourceMediaType": "image/x-raw-sigma", "targetMediaType": "image/bmp" }, + {"sourceMediaType": "image/x-raw-sigma", "targetMediaType": "image/cgm" }, + {"sourceMediaType": "image/x-raw-sigma", "targetMediaType": "image/x-raw-canon" }, + {"sourceMediaType": "image/x-raw-sigma", "targetMediaType": "image/x-raw-adobe" }, + {"sourceMediaType": "image/x-raw-sigma", "targetMediaType": "application/eps" }, + {"sourceMediaType": "image/x-raw-sigma", "targetMediaType": "image/gif" }, + {"sourceMediaType": "image/x-raw-sigma", "targetMediaType": "image/ief" }, + {"sourceMediaType": "image/x-raw-sigma", "targetMediaType": "image/jp2" }, + {"sourceMediaType": "image/x-raw-sigma", "targetMediaType": "image/jpeg" }, + {"sourceMediaType": "image/x-raw-sigma", "targetMediaType": "image/x-raw-kodak" }, + {"sourceMediaType": "image/x-raw-sigma", "targetMediaType": "image/x-raw-minolta" }, + {"sourceMediaType": "image/x-raw-sigma", "targetMediaType": "image/x-raw-nikon" }, + {"sourceMediaType": "image/x-raw-sigma", "targetMediaType": "image/x-raw-olympus" }, + {"sourceMediaType": "image/x-raw-sigma", "targetMediaType": "image/x-portable-bitmap" }, + {"sourceMediaType": "image/x-raw-sigma", "targetMediaType": "image/x-raw-pentax" }, + {"sourceMediaType": "image/x-raw-sigma", "targetMediaType": "image/x-portable-graymap" }, + {"sourceMediaType": "image/x-raw-sigma", "targetMediaType": "image/x-portable-anymap" }, + {"sourceMediaType": "image/x-raw-sigma", "targetMediaType": "image/vnd.adobe.premiere" }, + {"sourceMediaType": "image/x-raw-sigma", "targetMediaType": "image/x-portable-pixmap" }, + {"sourceMediaType": "image/x-raw-sigma", "targetMediaType": "image/vnd.adobe.photoshop" }, + {"sourceMediaType": "image/x-raw-sigma", "targetMediaType": "image/x-raw-red" }, + {"sourceMediaType": "image/x-raw-sigma", "targetMediaType": "image/x-raw-fuji" }, + {"sourceMediaType": "image/x-raw-sigma", "targetMediaType": "image/png" }, + {"sourceMediaType": "image/x-raw-sigma", "targetMediaType": "image/x-raw-panasonic" }, + {"sourceMediaType": "image/x-raw-sigma", "targetMediaType": "image/x-raw-leica" }, + {"sourceMediaType": "image/x-raw-sigma", "targetMediaType": "image/x-cmu-raster" }, + {"sourceMediaType": "image/x-raw-sigma", "targetMediaType": "image/tiff" }, + {"sourceMediaType": "image/x-raw-sigma", "priority": 55, "targetMediaType": "image/x-raw-sigma" }, + {"sourceMediaType": "image/x-raw-sigma", "targetMediaType": "image/x-xbitmap" }, + {"sourceMediaType": "image/x-raw-sigma", "targetMediaType": "image/x-xpixmap" }, + {"sourceMediaType": "image/x-raw-sigma", "targetMediaType": "image/x-xwindowdump" }, + + {"sourceMediaType": "image/x-xbitmap", "targetMediaType": "image/x-raw-hasselblad" }, + {"sourceMediaType": "image/x-xbitmap", "targetMediaType": "image/x-raw-sony" }, + {"sourceMediaType": "image/x-xbitmap", "targetMediaType": "image/bmp" }, + {"sourceMediaType": "image/x-xbitmap", "targetMediaType": "image/cgm" }, + {"sourceMediaType": "image/x-xbitmap", "targetMediaType": "image/x-raw-canon" }, + {"sourceMediaType": "image/x-xbitmap", "targetMediaType": "image/x-raw-adobe" }, + {"sourceMediaType": "image/x-xbitmap", "targetMediaType": "application/eps" }, + {"sourceMediaType": "image/x-xbitmap", "targetMediaType": "image/gif" }, + {"sourceMediaType": "image/x-xbitmap", "targetMediaType": "image/ief" }, + {"sourceMediaType": "image/x-xbitmap", "targetMediaType": "image/jp2" }, + {"sourceMediaType": "image/x-xbitmap", "targetMediaType": "image/jpeg" }, + {"sourceMediaType": "image/x-xbitmap", "targetMediaType": "image/x-raw-kodak" }, + {"sourceMediaType": "image/x-xbitmap", "targetMediaType": "image/x-raw-minolta" }, + {"sourceMediaType": "image/x-xbitmap", "targetMediaType": "image/x-raw-nikon" }, + {"sourceMediaType": "image/x-xbitmap", "targetMediaType": "image/x-raw-olympus" }, + {"sourceMediaType": "image/x-xbitmap", "targetMediaType": "image/x-portable-bitmap" }, + {"sourceMediaType": "image/x-xbitmap", "targetMediaType": "image/x-raw-pentax" }, + {"sourceMediaType": "image/x-xbitmap", "targetMediaType": "image/x-portable-graymap" }, + {"sourceMediaType": "image/x-xbitmap", "targetMediaType": "image/x-portable-anymap" }, + {"sourceMediaType": "image/x-xbitmap", "targetMediaType": "image/vnd.adobe.premiere" }, + {"sourceMediaType": "image/x-xbitmap", "targetMediaType": "image/x-portable-pixmap" }, + {"sourceMediaType": "image/x-xbitmap", "targetMediaType": "image/vnd.adobe.photoshop" }, + {"sourceMediaType": "image/x-xbitmap", "targetMediaType": "image/x-raw-red" }, + {"sourceMediaType": "image/x-xbitmap", "targetMediaType": "image/x-raw-fuji" }, + {"sourceMediaType": "image/x-xbitmap", "targetMediaType": "image/png" }, + {"sourceMediaType": "image/x-xbitmap", "targetMediaType": "image/x-raw-panasonic" }, + {"sourceMediaType": "image/x-xbitmap", "targetMediaType": "image/x-raw-leica" }, + {"sourceMediaType": "image/x-xbitmap", "targetMediaType": "image/x-cmu-raster" }, + {"sourceMediaType": "image/x-xbitmap", "targetMediaType": "image/tiff" }, + {"sourceMediaType": "image/x-xbitmap", "targetMediaType": "image/x-raw-sigma" }, + {"sourceMediaType": "image/x-xbitmap", "priority": 55, "targetMediaType": "image/x-xbitmap" }, + {"sourceMediaType": "image/x-xbitmap", "targetMediaType": "image/x-xpixmap" }, + {"sourceMediaType": "image/x-xbitmap", "targetMediaType": "image/x-xwindowdump" }, + + {"sourceMediaType": "image/x-xpixmap", "targetMediaType": "image/x-raw-hasselblad" }, + {"sourceMediaType": "image/x-xpixmap", "targetMediaType": "image/x-raw-sony" }, + {"sourceMediaType": "image/x-xpixmap", "targetMediaType": "image/bmp" }, + {"sourceMediaType": "image/x-xpixmap", "targetMediaType": "image/cgm" }, + {"sourceMediaType": "image/x-xpixmap", "targetMediaType": "image/x-raw-canon" }, + {"sourceMediaType": "image/x-xpixmap", "targetMediaType": "image/x-raw-adobe" }, + {"sourceMediaType": "image/x-xpixmap", "targetMediaType": "application/eps" }, + {"sourceMediaType": "image/x-xpixmap", "targetMediaType": "image/gif" }, + {"sourceMediaType": "image/x-xpixmap", "targetMediaType": "image/ief" }, + {"sourceMediaType": "image/x-xpixmap", "targetMediaType": "image/jp2" }, + {"sourceMediaType": "image/x-xpixmap", "targetMediaType": "image/jpeg" }, + {"sourceMediaType": "image/x-xpixmap", "targetMediaType": "image/x-raw-kodak" }, + {"sourceMediaType": "image/x-xpixmap", "targetMediaType": "image/x-raw-minolta" }, + {"sourceMediaType": "image/x-xpixmap", "targetMediaType": "image/x-raw-nikon" }, + {"sourceMediaType": "image/x-xpixmap", "targetMediaType": "image/x-raw-olympus" }, + {"sourceMediaType": "image/x-xpixmap", "targetMediaType": "image/x-portable-bitmap" }, + {"sourceMediaType": "image/x-xpixmap", "targetMediaType": "image/x-raw-pentax" }, + {"sourceMediaType": "image/x-xpixmap", "targetMediaType": "image/x-portable-graymap" }, + {"sourceMediaType": "image/x-xpixmap", "targetMediaType": "image/x-portable-anymap" }, + {"sourceMediaType": "image/x-xpixmap", "targetMediaType": "image/vnd.adobe.premiere" }, + {"sourceMediaType": "image/x-xpixmap", "targetMediaType": "image/x-portable-pixmap" }, + {"sourceMediaType": "image/x-xpixmap", "targetMediaType": "image/vnd.adobe.photoshop" }, + {"sourceMediaType": "image/x-xpixmap", "targetMediaType": "image/x-raw-red" }, + {"sourceMediaType": "image/x-xpixmap", "targetMediaType": "image/x-raw-fuji" }, + {"sourceMediaType": "image/x-xpixmap", "targetMediaType": "image/png" }, + {"sourceMediaType": "image/x-xpixmap", "targetMediaType": "image/x-raw-panasonic" }, + {"sourceMediaType": "image/x-xpixmap", "targetMediaType": "image/x-raw-leica" }, + {"sourceMediaType": "image/x-xpixmap", "targetMediaType": "image/x-cmu-raster" }, + {"sourceMediaType": "image/x-xpixmap", "targetMediaType": "image/tiff" }, + {"sourceMediaType": "image/x-xpixmap", "targetMediaType": "image/x-raw-sigma" }, + {"sourceMediaType": "image/x-xpixmap", "targetMediaType": "image/x-xbitmap" }, + {"sourceMediaType": "image/x-xpixmap", "priority": 55, "targetMediaType": "image/x-xpixmap" }, + {"sourceMediaType": "image/x-xpixmap", "targetMediaType": "image/x-xwindowdump" }, + + {"sourceMediaType": "image/x-xwindowdump", "targetMediaType": "image/x-raw-hasselblad" }, + {"sourceMediaType": "image/x-xwindowdump", "targetMediaType": "image/x-raw-sony" }, + {"sourceMediaType": "image/x-xwindowdump", "targetMediaType": "image/bmp" }, + {"sourceMediaType": "image/x-xwindowdump", "targetMediaType": "image/cgm" }, + {"sourceMediaType": "image/x-xwindowdump", "targetMediaType": "image/x-raw-canon" }, + {"sourceMediaType": "image/x-xwindowdump", "targetMediaType": "image/x-raw-adobe" }, + {"sourceMediaType": "image/x-xwindowdump", "targetMediaType": "application/eps" }, + {"sourceMediaType": "image/x-xwindowdump", "targetMediaType": "image/gif" }, + {"sourceMediaType": "image/x-xwindowdump", "targetMediaType": "image/ief" }, + {"sourceMediaType": "image/x-xwindowdump", "targetMediaType": "image/jp2" }, + {"sourceMediaType": "image/x-xwindowdump", "targetMediaType": "image/jpeg" }, + {"sourceMediaType": "image/x-xwindowdump", "targetMediaType": "image/x-raw-kodak" }, + {"sourceMediaType": "image/x-xwindowdump", "targetMediaType": "image/x-raw-minolta" }, + {"sourceMediaType": "image/x-xwindowdump", "targetMediaType": "image/x-raw-nikon" }, + {"sourceMediaType": "image/x-xwindowdump", "targetMediaType": "image/x-raw-olympus" }, + {"sourceMediaType": "image/x-xwindowdump", "targetMediaType": "image/x-portable-bitmap" }, + {"sourceMediaType": "image/x-xwindowdump", "targetMediaType": "image/x-raw-pentax" }, + {"sourceMediaType": "image/x-xwindowdump", "targetMediaType": "image/x-portable-graymap" }, + {"sourceMediaType": "image/x-xwindowdump", "targetMediaType": "image/x-portable-anymap" }, + {"sourceMediaType": "image/x-xwindowdump", "targetMediaType": "image/vnd.adobe.premiere" }, + {"sourceMediaType": "image/x-xwindowdump", "targetMediaType": "image/x-portable-pixmap" }, + {"sourceMediaType": "image/x-xwindowdump", "targetMediaType": "image/vnd.adobe.photoshop" }, + {"sourceMediaType": "image/x-xwindowdump", "targetMediaType": "image/x-raw-red" }, + {"sourceMediaType": "image/x-xwindowdump", "targetMediaType": "image/x-raw-fuji" }, + {"sourceMediaType": "image/x-xwindowdump", "targetMediaType": "image/png" }, + {"sourceMediaType": "image/x-xwindowdump", "targetMediaType": "image/x-raw-panasonic" }, + {"sourceMediaType": "image/x-xwindowdump", "targetMediaType": "image/x-raw-leica" }, + {"sourceMediaType": "image/x-xwindowdump", "targetMediaType": "image/x-cmu-raster" }, + {"sourceMediaType": "image/x-xwindowdump", "targetMediaType": "image/tiff" }, + {"sourceMediaType": "image/x-xwindowdump", "targetMediaType": "image/x-raw-sigma" }, + {"sourceMediaType": "image/x-xwindowdump", "targetMediaType": "image/x-xbitmap" }, + {"sourceMediaType": "image/x-xwindowdump", "targetMediaType": "image/x-xpixmap" }, + {"sourceMediaType": "image/x-xwindowdump", "priority": 55, "targetMediaType": "image/x-xwindowdump" } + ], + "transformOptions": [ + "imageMagickOptions" + ] + } + ] +} \ No newline at end of file diff --git a/alfresco-transform-libreoffice/alfresco-transform-libreoffice-boot/src/main/resources/application-default.yaml b/alfresco-transform-libreoffice/alfresco-transform-libreoffice-boot/src/main/resources/application-default.yaml index ce4ca8b6..29166682 100644 --- a/alfresco-transform-libreoffice/alfresco-transform-libreoffice-boot/src/main/resources/application-default.yaml +++ b/alfresco-transform-libreoffice/alfresco-transform-libreoffice-boot/src/main/resources/application-default.yaml @@ -1,2 +1,5 @@ queue: - engineRequestQueue: ${TRANSFORM_ENGINE_REQUEST_QUEUE:org.alfresco.transform.engine.libreoffice.acs} \ No newline at end of file + engineRequestQueue: ${TRANSFORM_ENGINE_REQUEST_QUEUE:org.alfresco.transform.engine.libreoffice.acs} +transform: + config: + location: classpath:libreoffice_engine_config.json \ No newline at end of file diff --git a/alfresco-transform-libreoffice/alfresco-transform-libreoffice-boot/src/test/java/org/alfresco/transformer/LibreOfficeControllerTest.java b/alfresco-transform-libreoffice/alfresco-transform-libreoffice-boot/src/test/java/org/alfresco/transformer/LibreOfficeControllerTest.java index 39c76afa..005b8373 100644 --- a/alfresco-transform-libreoffice/alfresco-transform-libreoffice-boot/src/test/java/org/alfresco/transformer/LibreOfficeControllerTest.java +++ b/alfresco-transform-libreoffice/alfresco-transform-libreoffice-boot/src/test/java/org/alfresco/transformer/LibreOfficeControllerTest.java @@ -81,6 +81,9 @@ import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; @WebMvcTest(LibreOfficeControllerTest.class) public class LibreOfficeControllerTest extends AbstractTransformerControllerTest { + + private static final String ENGINE_CONFIG_NAME = "libreoffice_engine_config.json"; + @Mock private ExecutionResult mockExecutionResult; @@ -137,6 +140,12 @@ public class LibreOfficeControllerTest extends AbstractTransformerControllerTest }).when(javaExecutor).convert(any(), any()); } + @Override + public String getEngineConfigName() + { + return ENGINE_CONFIG_NAME; + } + @Override protected void mockTransformCommand(String sourceExtension, String targetExtension, String sourceMimetype, boolean readTargetFileBytes) diff --git a/alfresco-transform-libreoffice/alfresco-transform-libreoffice-boot/src/main/resources/engine_config.json b/alfresco-transform-libreoffice/alfresco-transform-libreoffice-boot/src/test/resources/libreoffice_engine_config.json similarity index 100% rename from alfresco-transform-libreoffice/alfresco-transform-libreoffice-boot/src/main/resources/engine_config.json rename to alfresco-transform-libreoffice/alfresco-transform-libreoffice-boot/src/test/resources/libreoffice_engine_config.json diff --git a/alfresco-transform-libreoffice/alfresco-transform-libreoffice/src/main/resources/libreoffice_engine_config.json b/alfresco-transform-libreoffice/alfresco-transform-libreoffice/src/main/resources/libreoffice_engine_config.json new file mode 100644 index 00000000..143434ca --- /dev/null +++ b/alfresco-transform-libreoffice/alfresco-transform-libreoffice/src/main/resources/libreoffice_engine_config.json @@ -0,0 +1,235 @@ +{ + "transformers": [ + { + "transformerName": "libreoffice", + "supportedSourceAndTargetList": [ + {"sourceMediaType": "text/csv", "targetMediaType": "text/html" }, + {"sourceMediaType": "text/csv", "targetMediaType": "application/vnd.oasis.opendocument.spreadsheet" }, + {"sourceMediaType": "text/csv", "targetMediaType": "application/vnd.oasis.opendocument.spreadsheet-template" }, + {"sourceMediaType": "text/csv", "targetMediaType": "text/tab-separated-values" }, + {"sourceMediaType": "text/csv", "targetMediaType": "application/vnd.ms-excel" }, + {"sourceMediaType": "text/csv", "maxSourceSizeBytes": 10485760, "priority": 55, "targetMediaType": "application/pdf" }, + + {"sourceMediaType": "application/msword", "targetMediaType": "text/html" }, + {"sourceMediaType": "application/msword", "targetMediaType": "application/vnd.oasis.opendocument.text" }, + {"sourceMediaType": "application/msword", "targetMediaType": "application/rtf" }, + {"sourceMediaType": "application/msword", "maxSourceSizeBytes": 10485760, "targetMediaType": "application/pdf" }, + + {"sourceMediaType": "application/vnd.ms-word.document.macroenabled.12", "targetMediaType": "application/msword" }, + {"sourceMediaType": "application/vnd.ms-word.document.macroenabled.12", "targetMediaType": "text/html" }, + {"sourceMediaType": "application/vnd.ms-word.document.macroenabled.12", "targetMediaType": "application/vnd.oasis.opendocument.text" }, + {"sourceMediaType": "application/vnd.ms-word.document.macroenabled.12", "targetMediaType": "application/rtf" }, + {"sourceMediaType": "application/vnd.ms-word.document.macroenabled.12", "maxSourceSizeBytes": 786432, "targetMediaType": "application/pdf" }, + + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "targetMediaType": "application/msword" }, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "targetMediaType": "text/html" }, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "targetMediaType": "application/vnd.oasis.opendocument.text" }, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "targetMediaType": "application/rtf" }, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "maxSourceSizeBytes": 786432, "targetMediaType": "application/pdf" }, + + {"sourceMediaType": "application/vnd.ms-word.template.macroenabled.12", "targetMediaType": "application/msword" }, + {"sourceMediaType": "application/vnd.ms-word.template.macroenabled.12", "targetMediaType": "text/html" }, + {"sourceMediaType": "application/vnd.ms-word.template.macroenabled.12", "targetMediaType": "application/vnd.oasis.opendocument.text" }, + {"sourceMediaType": "application/vnd.ms-word.template.macroenabled.12", "targetMediaType": "application/rtf" }, + {"sourceMediaType": "application/vnd.ms-word.template.macroenabled.12", "maxSourceSizeBytes": 786432, "targetMediaType": "application/pdf" }, + + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.wordprocessingml.template", "targetMediaType": "application/msword" }, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.wordprocessingml.template", "targetMediaType": "text/html" }, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.wordprocessingml.template", "targetMediaType": "application/vnd.oasis.opendocument.text" }, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.wordprocessingml.template", "targetMediaType": "application/rtf" }, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.wordprocessingml.template", "maxSourceSizeBytes": 786432, "targetMediaType": "application/pdf" }, + + {"sourceMediaType": "text/html", "targetMediaType": "application/msword" }, + {"sourceMediaType": "text/html", "priority": 55, "targetMediaType": "text/html" }, + {"sourceMediaType": "text/html", "targetMediaType": "application/vnd.oasis.opendocument.text" }, + {"sourceMediaType": "text/html", "targetMediaType": "application/rtf" }, + + {"sourceMediaType": "application/vnd.oasis.opendocument.graphics", "targetMediaType": "application/pdf" }, + {"sourceMediaType": "application/vnd.oasis.opendocument.graphics", "targetMediaType": "image/svg+xml" }, + + {"sourceMediaType": "application/vnd.oasis.opendocument.presentation", "targetMediaType": "text/html" }, + {"sourceMediaType": "application/vnd.oasis.opendocument.presentation", "targetMediaType": "application/pdf" }, + {"sourceMediaType": "application/vnd.oasis.opendocument.presentation", "targetMediaType": "application/vnd.ms-powerpoint" }, + + {"sourceMediaType": "application/vnd.oasis.opendocument.spreadsheet", "targetMediaType": "text/html" }, + {"sourceMediaType": "application/vnd.oasis.opendocument.spreadsheet", "targetMediaType": "application/vnd.oasis.opendocument.spreadsheet-template" }, + {"sourceMediaType": "application/vnd.oasis.opendocument.spreadsheet", "targetMediaType": "text/tab-separated-values" }, + {"sourceMediaType": "application/vnd.oasis.opendocument.spreadsheet", "targetMediaType": "application/vnd.ms-excel" }, + {"sourceMediaType": "application/vnd.oasis.opendocument.spreadsheet", "targetMediaType": "application/pdf" }, + + {"sourceMediaType": "application/vnd.oasis.opendocument.presentation-template", "targetMediaType": "text/html" }, + {"sourceMediaType": "application/vnd.oasis.opendocument.presentation-template", "targetMediaType": "application/vnd.oasis.opendocument.presentation" }, + {"sourceMediaType": "application/vnd.oasis.opendocument.presentation-template", "targetMediaType": "application/pdf" }, + {"sourceMediaType": "application/vnd.oasis.opendocument.presentation-template", "targetMediaType": "application/vnd.ms-powerpoint" }, + + {"sourceMediaType": "application/vnd.oasis.opendocument.spreadsheet-template", "targetMediaType": "text/html" }, + {"sourceMediaType": "application/vnd.oasis.opendocument.spreadsheet-template", "targetMediaType": "application/vnd.oasis.opendocument.spreadsheet" }, + {"sourceMediaType": "application/vnd.oasis.opendocument.spreadsheet-template", "targetMediaType": "text/tab-separated-values" }, + {"sourceMediaType": "application/vnd.oasis.opendocument.spreadsheet-template", "targetMediaType": "application/vnd.ms-excel" }, + {"sourceMediaType": "application/vnd.oasis.opendocument.spreadsheet-template", "targetMediaType": "application/pdf" }, + + {"sourceMediaType": "application/vnd.oasis.opendocument.text", "targetMediaType": "text/html" }, + {"sourceMediaType": "application/vnd.oasis.opendocument.text", "targetMediaType": "application/msword" }, + {"sourceMediaType": "application/vnd.oasis.opendocument.text", "targetMediaType": "application/rtf" }, + {"sourceMediaType": "application/vnd.oasis.opendocument.text", "targetMediaType": "application/pdf" }, + + + {"sourceMediaType": "application/vnd.oasis.opendocument.text-template", "targetMediaType": "text/html" }, + {"sourceMediaType": "application/vnd.oasis.opendocument.text-template", "targetMediaType": "application/vnd.oasis.opendocument.text" }, + {"sourceMediaType": "application/vnd.oasis.opendocument.text-template", "targetMediaType": "application/msword" }, + {"sourceMediaType": "application/vnd.oasis.opendocument.text-template", "targetMediaType": "application/rtf" }, + {"sourceMediaType": "application/vnd.oasis.opendocument.text-template", "targetMediaType": "application/pdf" }, + + {"sourceMediaType": "application/vnd.ms-powerpoint.template.macroenabled.12", "targetMediaType": "text/html" }, + {"sourceMediaType": "application/vnd.ms-powerpoint.template.macroenabled.12", "targetMediaType": "application/vnd.oasis.opendocument.presentation" }, + {"sourceMediaType": "application/vnd.ms-powerpoint.template.macroenabled.12", "maxSourceSizeBytes": 4194304, "targetMediaType": "application/pdf" }, + {"sourceMediaType": "application/vnd.ms-powerpoint.template.macroenabled.12", "targetMediaType": "application/vnd.ms-powerpoint" }, + + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.template", "targetMediaType": "text/html" }, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.template", "targetMediaType": "application/vnd.oasis.opendocument.presentation" }, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.template", "maxSourceSizeBytes": 4194304, "targetMediaType": "application/pdf" }, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.template", "targetMediaType": "application/vnd.ms-powerpoint" }, + + {"sourceMediaType": "application/vnd.ms-powerpoint.addin.macroenabled.12", "targetMediaType": "text/html" }, + {"sourceMediaType": "application/vnd.ms-powerpoint.addin.macroenabled.12", "targetMediaType": "application/vnd.oasis.opendocument.presentation" }, + {"sourceMediaType": "application/vnd.ms-powerpoint.addin.macroenabled.12", "maxSourceSizeBytes": 4194304, "targetMediaType": "application/pdf" }, + {"sourceMediaType": "application/vnd.ms-powerpoint.addin.macroenabled.12", "targetMediaType": "application/vnd.ms-powerpoint" }, + + {"sourceMediaType": "application/vnd.ms-powerpoint", "targetMediaType": "text/html" }, + {"sourceMediaType": "application/vnd.ms-powerpoint", "targetMediaType": "application/vnd.oasis.opendocument.presentation" }, + {"sourceMediaType": "application/vnd.ms-powerpoint", "maxSourceSizeBytes": 6291456, "targetMediaType": "application/pdf" }, + + {"sourceMediaType": "application/vnd.ms-powerpoint.presentation.macroenabled.12", "targetMediaType": "text/html" }, + {"sourceMediaType": "application/vnd.ms-powerpoint.presentation.macroenabled.12", "targetMediaType": "application/vnd.oasis.opendocument.presentation" }, + {"sourceMediaType": "application/vnd.ms-powerpoint.presentation.macroenabled.12", "maxSourceSizeBytes": 4194304, "targetMediaType": "application/pdf" }, + {"sourceMediaType": "application/vnd.ms-powerpoint.presentation.macroenabled.12", "targetMediaType": "application/vnd.ms-powerpoint" }, + + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.presentation", "targetMediaType": "text/html" }, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.presentation", "targetMediaType": "application/vnd.oasis.opendocument.presentation" }, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.presentation", "maxSourceSizeBytes": 4194304, "targetMediaType": "application/pdf" }, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.presentation", "targetMediaType": "application/vnd.ms-powerpoint" }, + + {"sourceMediaType": "application/rtf", "targetMediaType": "application/msword" }, + {"sourceMediaType": "application/rtf", "targetMediaType": "text/html" }, + {"sourceMediaType": "application/rtf", "targetMediaType": "application/vnd.oasis.opendocument.text" }, + {"sourceMediaType": "application/rtf", "targetMediaType": "application/pdf" }, + + {"sourceMediaType": "application/vnd.ms-powerpoint.slide.macroenabled.12", "targetMediaType": "text/html" }, + {"sourceMediaType": "application/vnd.ms-powerpoint.slide.macroenabled.12", "targetMediaType": "application/vnd.oasis.opendocument.presentation" }, + {"sourceMediaType": "application/vnd.ms-powerpoint.slide.macroenabled.12", "maxSourceSizeBytes": 4194304, "targetMediaType": "application/pdf" }, + {"sourceMediaType": "application/vnd.ms-powerpoint.slide.macroenabled.12", "targetMediaType": "application/vnd.ms-powerpoint" }, + + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.slide", "targetMediaType": "text/html" }, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.slide", "targetMediaType": "application/vnd.oasis.opendocument.presentation" }, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.slide", "maxSourceSizeBytes": 4194304, "targetMediaType": "application/pdf" }, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.slide", "targetMediaType": "application/vnd.ms-powerpoint" }, + + {"sourceMediaType": "application/vnd.sun.xml.calc.template", "targetMediaType": "text/html" }, + {"sourceMediaType": "application/vnd.sun.xml.calc.template", "targetMediaType": "application/vnd.oasis.opendocument.spreadsheet" }, + {"sourceMediaType": "application/vnd.sun.xml.calc.template", "targetMediaType": "application/vnd.oasis.opendocument.spreadsheet-template" }, + {"sourceMediaType": "application/vnd.sun.xml.calc.template", "targetMediaType": "text/csv" }, + {"sourceMediaType": "application/vnd.sun.xml.calc.template", "targetMediaType": "text/tab-separated-values" }, + {"sourceMediaType": "application/vnd.sun.xml.calc.template", "targetMediaType": "application/vnd.ms-excel" }, + {"sourceMediaType": "application/vnd.sun.xml.calc.template", "targetMediaType": "application/pdf" }, + + {"sourceMediaType": "application/vnd.sun.xml.impress.template", "targetMediaType": "text/html" }, + {"sourceMediaType": "application/vnd.sun.xml.impress.template", "targetMediaType": "application/vnd.oasis.opendocument.presentation" }, + {"sourceMediaType": "application/vnd.sun.xml.impress.template", "maxSourceSizeBytes": 4194304, "targetMediaType": "application/pdf" }, + {"sourceMediaType": "application/vnd.sun.xml.impress.template", "targetMediaType": "application/vnd.ms-powerpoint" }, + + + {"sourceMediaType": "application/vnd.sun.xml.writer.template", "targetMediaType": "application/msword" }, + {"sourceMediaType": "application/vnd.sun.xml.writer.template", "targetMediaType": "text/html" }, + {"sourceMediaType": "application/vnd.sun.xml.writer.template", "targetMediaType": "application/vnd.oasis.opendocument.text" }, + {"sourceMediaType": "application/vnd.sun.xml.writer.template", "targetMediaType": "application/rtf" }, + {"sourceMediaType": "application/vnd.sun.xml.writer.template", "targetMediaType": "application/pdf" }, + + {"sourceMediaType": "application/vnd.sun.xml.calc", "targetMediaType": "text/html" }, + {"sourceMediaType": "application/vnd.sun.xml.calc", "targetMediaType": "application/vnd.oasis.opendocument.spreadsheet" }, + {"sourceMediaType": "application/vnd.sun.xml.calc", "targetMediaType": "application/vnd.oasis.opendocument.spreadsheet-template" }, + {"sourceMediaType": "application/vnd.sun.xml.calc", "targetMediaType": "text/csv" }, + {"sourceMediaType": "application/vnd.sun.xml.calc", "targetMediaType": "text/tab-separated-values" }, + {"sourceMediaType": "application/vnd.sun.xml.calc", "targetMediaType": "application/vnd.ms-excel" }, + {"sourceMediaType": "application/vnd.sun.xml.calc", "targetMediaType": "application/pdf" }, + + {"sourceMediaType": "application/vnd.sun.xml.impress", "targetMediaType": "text/html" }, + {"sourceMediaType": "application/vnd.sun.xml.impress", "targetMediaType": "application/vnd.oasis.opendocument.presentation" }, + {"sourceMediaType": "application/vnd.sun.xml.impress", "targetMediaType": "application/pdf" }, + {"sourceMediaType": "application/vnd.sun.xml.impress", "targetMediaType": "application/vnd.ms-powerpoint" }, + {"sourceMediaType": "application/vnd.sun.xml.impress", "targetMediaType": "application/vnd.openxmlformats-officedocument.presentationml.slide" }, + + {"sourceMediaType": "application/vnd.sun.xml.writer", "targetMediaType": "application/msword" }, + {"sourceMediaType": "application/vnd.sun.xml.writer", "targetMediaType": "text/html" }, + {"sourceMediaType": "application/vnd.sun.xml.writer", "targetMediaType": "application/vnd.oasis.opendocument.text" }, + {"sourceMediaType": "application/vnd.sun.xml.writer", "targetMediaType": "application/rtf" }, + {"sourceMediaType": "application/vnd.sun.xml.writer", "targetMediaType": "application/pdf" }, + + {"sourceMediaType": "text/tab-separated-values", "priority": 55, "targetMediaType": "text/html" }, + {"sourceMediaType": "text/tab-separated-values", "targetMediaType": "application/vnd.oasis.opendocument.spreadsheet" }, + {"sourceMediaType": "text/tab-separated-values", "targetMediaType": "application/vnd.oasis.opendocument.spreadsheet-template" }, + {"sourceMediaType": "text/tab-separated-values", "targetMediaType": "text/csv" }, + {"sourceMediaType": "text/tab-separated-values", "targetMediaType": "application/vnd.ms-excel" }, + {"sourceMediaType": "text/tab-separated-values", "targetMediaType": "application/pdf" }, + + {"sourceMediaType": "text/plain", "targetMediaType": "text/html" }, + {"sourceMediaType": "text/plain", "targetMediaType": "application/vnd.oasis.opendocument.text" }, + {"sourceMediaType": "text/plain", "targetMediaType": "application/rtf" }, + {"sourceMediaType": "text/plain", "targetMediaType": "application/msword" }, + {"sourceMediaType": "text/plain", "maxSourceSizeBytes": 5242880, "targetMediaType": "application/pdf" }, + + {"sourceMediaType": "application/vnd.visio", "maxSourceSizeBytes": 4194304, "targetMediaType": "application/pdf" }, + {"sourceMediaType": "application/vnd.visio", "targetMediaType": "image/svg+xml" }, + {"sourceMediaType": "application/vnd.visio", "targetMediaType": "application/vnd.oasis.opendocument.graphics" }, + + {"sourceMediaType": "application/vnd.visio2013", "maxSourceSizeBytes": 4194304, "targetMediaType": "application/pdf" }, + {"sourceMediaType": "application/vnd.visio2013", "targetMediaType": "image/svg+xml" }, + {"sourceMediaType": "application/vnd.visio2013", "targetMediaType": "application/vnd.oasis.opendocument.graphics" }, + + {"sourceMediaType": "application/wordperfect", "targetMediaType": "application/msword" }, + {"sourceMediaType": "application/wordperfect", "targetMediaType": "text/html" }, + {"sourceMediaType": "application/wordperfect", "targetMediaType": "application/vnd.oasis.opendocument.text" }, + {"sourceMediaType": "application/wordperfect", "targetMediaType": "application/rtf" }, + {"sourceMediaType": "application/wordperfect", "targetMediaType": "application/pdf" }, + + {"sourceMediaType": "application/vnd.ms-excel", "targetMediaType": "text/html" }, + {"sourceMediaType": "application/vnd.ms-excel", "targetMediaType": "application/vnd.oasis.opendocument.spreadsheet" }, + {"sourceMediaType": "application/vnd.ms-excel", "targetMediaType": "application/vnd.oasis.opendocument.spreadsheet-template" }, + {"sourceMediaType": "application/vnd.ms-excel", "targetMediaType": "text/csv" }, + {"sourceMediaType": "application/vnd.ms-excel", "targetMediaType": "text/tab-separated-values" }, + {"sourceMediaType": "application/vnd.ms-excel", "maxSourceSizeBytes": 10485760, "targetMediaType": "application/pdf" }, + + {"sourceMediaType": "application/vnd.ms-excel.sheet.binary.macroenabled.12", "targetMediaType": "text/html" }, + {"sourceMediaType": "application/vnd.ms-excel.sheet.binary.macroenabled.12", "targetMediaType": "application/vnd.oasis.opendocument.spreadsheet" }, + {"sourceMediaType": "application/vnd.ms-excel.sheet.binary.macroenabled.12", "targetMediaType": "application/vnd.oasis.opendocument.spreadsheet-template" }, + {"sourceMediaType": "application/vnd.ms-excel.sheet.binary.macroenabled.12", "targetMediaType": "text/csv" }, + {"sourceMediaType": "application/vnd.ms-excel.sheet.binary.macroenabled.12", "targetMediaType": "text/tab-separated-values" }, + {"sourceMediaType": "application/vnd.ms-excel.sheet.binary.macroenabled.12", "targetMediaType": "application/vnd.ms-excel" }, + {"sourceMediaType": "application/vnd.ms-excel.sheet.binary.macroenabled.12", "maxSourceSizeBytes": 1572864, "targetMediaType": "application/pdf" }, + + {"sourceMediaType": "application/vnd.ms-excel.sheet.macroenabled.12", "targetMediaType": "text/html" }, + {"sourceMediaType": "application/vnd.ms-excel.sheet.macroenabled.12", "targetMediaType": "application/vnd.oasis.opendocument.spreadsheet" }, + {"sourceMediaType": "application/vnd.ms-excel.sheet.macroenabled.12", "targetMediaType": "application/vnd.oasis.opendocument.spreadsheet-template" }, + {"sourceMediaType": "application/vnd.ms-excel.sheet.macroenabled.12", "targetMediaType": "text/csv" }, + {"sourceMediaType": "application/vnd.ms-excel.sheet.macroenabled.12", "targetMediaType": "text/tab-separated-values" }, + {"sourceMediaType": "application/vnd.ms-excel.sheet.macroenabled.12", "targetMediaType": "application/vnd.ms-excel" }, + {"sourceMediaType": "application/vnd.ms-excel.sheet.macroenabled.12", "maxSourceSizeBytes": 1572864, "targetMediaType": "application/pdf" }, + + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "targetMediaType": "text/html" }, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "targetMediaType": "application/vnd.oasis.opendocument.spreadsheet" }, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "targetMediaType": "application/vnd.oasis.opendocument.spreadsheet-template" }, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "targetMediaType": "text/csv" }, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "targetMediaType": "text/tab-separated-values" }, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "targetMediaType": "application/vnd.ms-excel" }, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "maxSourceSizeBytes": 1572864, "targetMediaType": "application/pdf" }, + + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.template", "targetMediaType": "text/html" }, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.template", "targetMediaType": "application/vnd.oasis.opendocument.spreadsheet" }, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.template", "targetMediaType": "application/vnd.oasis.opendocument.spreadsheet-template" }, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.template", "targetMediaType": "text/csv" }, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.template", "targetMediaType": "text/tab-separated-values" }, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.template", "targetMediaType": "application/vnd.ms-excel" }, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.template", "maxSourceSizeBytes": 1572864, "targetMediaType": "application/pdf" } + ] + } + ] +} \ No newline at end of file diff --git a/alfresco-transform-misc/alfresco-transform-misc-boot/Dockerfile b/alfresco-transform-misc/alfresco-transform-misc-boot/Dockerfile index 961f546d..734d0169 100644 --- a/alfresco-transform-misc/alfresco-transform-misc-boot/Dockerfile +++ b/alfresco-transform-misc/alfresco-transform-misc-boot/Dockerfile @@ -9,7 +9,7 @@ ENV JAVA_OPTS="" ARG GROUPNAME=Alfresco ARG GROUPID=1000 ARG MISCUSERNAME=transform-misc -ARG USERID=33004 +ARG USERID=33006 COPY target/${env.project_artifactId}-${env.project_version}.jar /usr/bin diff --git a/alfresco-transform-misc/alfresco-transform-misc-boot/pom.xml b/alfresco-transform-misc/alfresco-transform-misc-boot/pom.xml index 1a1b6a81..d8f6e886 100644 --- a/alfresco-transform-misc/alfresco-transform-misc-boot/pom.xml +++ b/alfresco-transform-misc/alfresco-transform-misc-boot/pom.xml @@ -3,7 +3,7 @@ 4.0.0 alfresco-transform-misc-boot - Alfresco Docker Miscellaneous Transformers + Alfresco Miscellaneous Transformer Spring Boot jar diff --git a/alfresco-transform-misc/alfresco-transform-misc-boot/src/main/resources/application-default.yaml b/alfresco-transform-misc/alfresco-transform-misc-boot/src/main/resources/application-default.yaml index c0a793ba..a2ae6bff 100644 --- a/alfresco-transform-misc/alfresco-transform-misc-boot/src/main/resources/application-default.yaml +++ b/alfresco-transform-misc/alfresco-transform-misc-boot/src/main/resources/application-default.yaml @@ -1,2 +1,5 @@ queue: - engineRequestQueue: ${TRANSFORM_ENGINE_REQUEST_QUEUE:org.alfresco.transform.engine.misc.acs} \ No newline at end of file + engineRequestQueue: ${TRANSFORM_ENGINE_REQUEST_QUEUE:org.alfresco.transform.engine.misc.acs} +transform: + config: + location: classpath:misc_engine_config.json \ No newline at end of file diff --git a/alfresco-transform-misc/alfresco-transform-misc-boot/src/test/java/org/alfresco/transformer/MiscControllerTest.java b/alfresco-transform-misc/alfresco-transform-misc-boot/src/test/java/org/alfresco/transformer/MiscControllerTest.java index cd597f7f..23ca6988 100644 --- a/alfresco-transform-misc/alfresco-transform-misc-boot/src/test/java/org/alfresco/transformer/MiscControllerTest.java +++ b/alfresco-transform-misc/alfresco-transform-misc-boot/src/test/java/org/alfresco/transformer/MiscControllerTest.java @@ -71,6 +71,8 @@ public class MiscControllerTest extends AbstractTransformerControllerTest private final String targetEncoding = "UTF-8"; private final String targetMimetype = MIMETYPE_TEXT_PLAIN; + private static final String ENGINE_CONFIG_NAME = "misc_engine_config.json"; + @Before public void before() throws Exception { @@ -86,6 +88,12 @@ public class MiscControllerTest extends AbstractTransformerControllerTest expectedSourceFileBytes); } + @Override + public String getEngineConfigName() + { + return ENGINE_CONFIG_NAME; + } + @Override protected void mockTransformCommand(String sourceExtension, String targetExtension, String sourceMimetype, boolean readTargetFileBytes) diff --git a/alfresco-transform-misc/alfresco-transform-misc-boot/src/test/resources/misc_engine_config.json b/alfresco-transform-misc/alfresco-transform-misc-boot/src/test/resources/misc_engine_config.json new file mode 100644 index 00000000..5948332f --- /dev/null +++ b/alfresco-transform-misc/alfresco-transform-misc-boot/src/test/resources/misc_engine_config.json @@ -0,0 +1,80 @@ +{ + "transformOptions": { + "textToPdfOptions": [ + {"value": {"name": "pageLimit"}}, + {"value": {"name": "sourceEncoding"}} + ], + "stringOptions": [ + {"value": {"name": "sourceEncoding"}}, + {"value": {"name": "targetEncoding"}} + ], + "htmlOptions": [ + {"value": {"name": "sourceEncoding"}} + ] + }, + "transformers": [ + { + "transformerName": "html", + "supportedSourceAndTargetList": [ + {"sourceMediaType": "text/html", "targetMediaType": "text/plain"} + ], + "transformOptions": [ + "htmlOptions" + ] + }, + { + "transformerName": "string", + "supportedSourceAndTargetList": [ + {"sourceMediaType": "text/plain", "targetMediaType": "text/plain"}, + {"sourceMediaType": "text/mediawiki", "targetMediaType": "text/plain"}, + {"sourceMediaType": "text/css", "targetMediaType": "text/plain"}, + {"sourceMediaType": "text/csv", "targetMediaType": "text/plain"}, + {"sourceMediaType": "text/xml", "targetMediaType": "text/plain"}, + {"sourceMediaType": "text/html", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "text/richtext", "targetMediaType": "text/plain"}, + {"sourceMediaType": "text/sgml", "targetMediaType": "text/plain"}, + {"sourceMediaType": "text/tab-separated-values", "targetMediaType": "text/plain"}, + {"sourceMediaType": "text/x-setext", "targetMediaType": "text/plain"}, + {"sourceMediaType": "text/x-java-source", "targetMediaType": "text/plain"}, + {"sourceMediaType": "text/x-jsp", "targetMediaType": "text/plain"}, + {"sourceMediaType": "text/x-markdown", "targetMediaType": "text/plain"}, + {"sourceMediaType": "text/calendar", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/x-javascript", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/dita+xml", "targetMediaType": "text/plain"} + ], + "transformOptions": [ + "stringOptions" + ] + }, + { + "transformerName": "appleIWorks", + "supportedSourceAndTargetList": [ + {"sourceMediaType": "application/vnd.apple.keynote", "targetMediaType": "image/jpeg"}, + {"sourceMediaType": "application/vnd.apple.numbers", "targetMediaType": "image/jpeg"}, + {"sourceMediaType": "application/vnd.apple.pages", "targetMediaType": "image/jpeg"} + ], + "transformOptions": [ + ] + }, + { + "transformerName": "textToPdf", + "supportedSourceAndTargetList": [ + {"sourceMediaType": "text/plain", "priority": 55, "targetMediaType": "application/pdf"}, + {"sourceMediaType": "text/csv", "targetMediaType": "application/pdf"}, + {"sourceMediaType": "application/dita+xml", "targetMediaType": "application/pdf"}, + {"sourceMediaType": "text/xml", "targetMediaType": "application/pdf"} + ], + "transformOptions": [ + "textToPdfOptions" + ] + }, + { + "transformerName": "rfc822", + "supportedSourceAndTargetList": [ + {"sourceMediaType": "message/rfc822", "targetMediaType": "text/plain"} + ], + "transformOptions": [ + ] + } + ] +} \ No newline at end of file diff --git a/alfresco-transform-misc/alfresco-transform-misc/pom.xml b/alfresco-transform-misc/alfresco-transform-misc/pom.xml index 9e22e212..2a57f185 100644 --- a/alfresco-transform-misc/alfresco-transform-misc/pom.xml +++ b/alfresco-transform-misc/alfresco-transform-misc/pom.xml @@ -3,7 +3,7 @@ 4.0.0 alfresco-transform-misc - Alfresco Miscellaneous Transformers + Alfresco Miscellaneous Transformer jar diff --git a/alfresco-transform-misc/alfresco-transform-misc/src/main/resources/misc_engine_config.json b/alfresco-transform-misc/alfresco-transform-misc/src/main/resources/misc_engine_config.json new file mode 100644 index 00000000..5948332f --- /dev/null +++ b/alfresco-transform-misc/alfresco-transform-misc/src/main/resources/misc_engine_config.json @@ -0,0 +1,80 @@ +{ + "transformOptions": { + "textToPdfOptions": [ + {"value": {"name": "pageLimit"}}, + {"value": {"name": "sourceEncoding"}} + ], + "stringOptions": [ + {"value": {"name": "sourceEncoding"}}, + {"value": {"name": "targetEncoding"}} + ], + "htmlOptions": [ + {"value": {"name": "sourceEncoding"}} + ] + }, + "transformers": [ + { + "transformerName": "html", + "supportedSourceAndTargetList": [ + {"sourceMediaType": "text/html", "targetMediaType": "text/plain"} + ], + "transformOptions": [ + "htmlOptions" + ] + }, + { + "transformerName": "string", + "supportedSourceAndTargetList": [ + {"sourceMediaType": "text/plain", "targetMediaType": "text/plain"}, + {"sourceMediaType": "text/mediawiki", "targetMediaType": "text/plain"}, + {"sourceMediaType": "text/css", "targetMediaType": "text/plain"}, + {"sourceMediaType": "text/csv", "targetMediaType": "text/plain"}, + {"sourceMediaType": "text/xml", "targetMediaType": "text/plain"}, + {"sourceMediaType": "text/html", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "text/richtext", "targetMediaType": "text/plain"}, + {"sourceMediaType": "text/sgml", "targetMediaType": "text/plain"}, + {"sourceMediaType": "text/tab-separated-values", "targetMediaType": "text/plain"}, + {"sourceMediaType": "text/x-setext", "targetMediaType": "text/plain"}, + {"sourceMediaType": "text/x-java-source", "targetMediaType": "text/plain"}, + {"sourceMediaType": "text/x-jsp", "targetMediaType": "text/plain"}, + {"sourceMediaType": "text/x-markdown", "targetMediaType": "text/plain"}, + {"sourceMediaType": "text/calendar", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/x-javascript", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/dita+xml", "targetMediaType": "text/plain"} + ], + "transformOptions": [ + "stringOptions" + ] + }, + { + "transformerName": "appleIWorks", + "supportedSourceAndTargetList": [ + {"sourceMediaType": "application/vnd.apple.keynote", "targetMediaType": "image/jpeg"}, + {"sourceMediaType": "application/vnd.apple.numbers", "targetMediaType": "image/jpeg"}, + {"sourceMediaType": "application/vnd.apple.pages", "targetMediaType": "image/jpeg"} + ], + "transformOptions": [ + ] + }, + { + "transformerName": "textToPdf", + "supportedSourceAndTargetList": [ + {"sourceMediaType": "text/plain", "priority": 55, "targetMediaType": "application/pdf"}, + {"sourceMediaType": "text/csv", "targetMediaType": "application/pdf"}, + {"sourceMediaType": "application/dita+xml", "targetMediaType": "application/pdf"}, + {"sourceMediaType": "text/xml", "targetMediaType": "application/pdf"} + ], + "transformOptions": [ + "textToPdfOptions" + ] + }, + { + "transformerName": "rfc822", + "supportedSourceAndTargetList": [ + {"sourceMediaType": "message/rfc822", "targetMediaType": "text/plain"} + ], + "transformOptions": [ + ] + } + ] +} \ No newline at end of file diff --git a/alfresco-transform-pdf-renderer/alfresco-transform-pdf-renderer-boot/src/main/java/org/alfresco/transformer/AlfrescoPdfRendererController.java b/alfresco-transform-pdf-renderer/alfresco-transform-pdf-renderer-boot/src/main/java/org/alfresco/transformer/AlfrescoPdfRendererController.java index 2bfd9207..5a65ecc8 100644 --- a/alfresco-transform-pdf-renderer/alfresco-transform-pdf-renderer-boot/src/main/java/org/alfresco/transformer/AlfrescoPdfRendererController.java +++ b/alfresco-transform-pdf-renderer/alfresco-transform-pdf-renderer-boot/src/main/java/org/alfresco/transformer/AlfrescoPdfRendererController.java @@ -114,7 +114,7 @@ public class AlfrescoPdfRendererController extends AbstractTransformerController logger.debug("Processing request with: sourceFile '{}', targetFile '{}', transformOptions" + " '{}', timeout {} ms", sourceFile, targetFile, transformOptions, timeout); - final String options = OptionsBuilder + final String options = PdfRendererOptionsBuilder .builder() .withPage(transformOptions.get("page")) .withWidth(transformOptions.get("width")) @@ -147,7 +147,7 @@ public class AlfrescoPdfRendererController extends AbstractTransformerController File targetFile = createTargetFile(request, targetFilename); // Both files are deleted by TransformInterceptor.afterCompletion - final String options = OptionsBuilder + final String options = PdfRendererOptionsBuilder .builder() .withPage(page) .withWidth(width) diff --git a/alfresco-transform-pdf-renderer/alfresco-transform-pdf-renderer-boot/src/main/resources/application-default.yaml b/alfresco-transform-pdf-renderer/alfresco-transform-pdf-renderer-boot/src/main/resources/application-default.yaml index 729f6cc9..b0e1e764 100644 --- a/alfresco-transform-pdf-renderer/alfresco-transform-pdf-renderer-boot/src/main/resources/application-default.yaml +++ b/alfresco-transform-pdf-renderer/alfresco-transform-pdf-renderer-boot/src/main/resources/application-default.yaml @@ -1,2 +1,5 @@ queue: - engineRequestQueue: ${TRANSFORM_ENGINE_REQUEST_QUEUE:org.alfresco.transform.engine.alfresco-pdf-renderer.acs} \ No newline at end of file + engineRequestQueue: ${TRANSFORM_ENGINE_REQUEST_QUEUE:org.alfresco.transform.engine.alfresco-pdf-renderer.acs} +transform: + config: + location: classpath:pdfrenderer_engine_config.json \ No newline at end of file diff --git a/alfresco-transform-pdf-renderer/alfresco-transform-pdf-renderer-boot/src/test/java/org/alfresco/transformer/AlfrescoPdfRendererControllerTest.java b/alfresco-transform-pdf-renderer/alfresco-transform-pdf-renderer-boot/src/test/java/org/alfresco/transformer/AlfrescoPdfRendererControllerTest.java index de77009e..a14770d3 100644 --- a/alfresco-transform-pdf-renderer/alfresco-transform-pdf-renderer-boot/src/test/java/org/alfresco/transformer/AlfrescoPdfRendererControllerTest.java +++ b/alfresco-transform-pdf-renderer/alfresco-transform-pdf-renderer-boot/src/test/java/org/alfresco/transformer/AlfrescoPdfRendererControllerTest.java @@ -86,6 +86,9 @@ import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; @WebMvcTest(AlfrescoPdfRendererController.class) public class AlfrescoPdfRendererControllerTest extends AbstractTransformerControllerTest { + + private static final String ENGINE_CONFIG_NAME = "pdfrenderer_engine_config.json"; + @Mock private ExecutionResult mockExecutionResult; @@ -110,6 +113,12 @@ public class AlfrescoPdfRendererControllerTest extends AbstractTransformerContro mockTransformCommand("pdf", "png", "application/pdf", true); } + @Override + public String getEngineConfigName() + { + return ENGINE_CONFIG_NAME; + } + @Override public void mockTransformCommand(String sourceExtension, String targetExtension, String sourceMimetype, diff --git a/alfresco-transform-pdf-renderer/alfresco-transform-pdf-renderer-boot/src/main/resources/engine_config.json b/alfresco-transform-pdf-renderer/alfresco-transform-pdf-renderer-boot/src/test/resources/pdfrenderer_engine_config.json similarity index 100% rename from alfresco-transform-pdf-renderer/alfresco-transform-pdf-renderer-boot/src/main/resources/engine_config.json rename to alfresco-transform-pdf-renderer/alfresco-transform-pdf-renderer-boot/src/test/resources/pdfrenderer_engine_config.json diff --git a/alfresco-transform-pdf-renderer/alfresco-transform-pdf-renderer-boot/src/main/java/org/alfresco/transformer/OptionsBuilder.java b/alfresco-transform-pdf-renderer/alfresco-transform-pdf-renderer/src/main/java/org/alfresco/transformer/PdfRendererOptionsBuilder.java similarity index 74% rename from alfresco-transform-pdf-renderer/alfresco-transform-pdf-renderer-boot/src/main/java/org/alfresco/transformer/OptionsBuilder.java rename to alfresco-transform-pdf-renderer/alfresco-transform-pdf-renderer/src/main/java/org/alfresco/transformer/PdfRendererOptionsBuilder.java index 36c6a407..be8d0118 100644 --- a/alfresco-transform-pdf-renderer/alfresco-transform-pdf-renderer-boot/src/main/java/org/alfresco/transformer/OptionsBuilder.java +++ b/alfresco-transform-pdf-renderer/alfresco-transform-pdf-renderer/src/main/java/org/alfresco/transformer/PdfRendererOptionsBuilder.java @@ -36,7 +36,7 @@ import java.util.StringJoiner; * * @author Cezar Leahu */ -final class OptionsBuilder +public final class PdfRendererOptionsBuilder { private Integer page; private Integer width; @@ -44,58 +44,58 @@ final class OptionsBuilder private Boolean allowPdfEnlargement; private Boolean maintainPdfAspectRatio; - private OptionsBuilder() {} + private PdfRendererOptionsBuilder() {} - public OptionsBuilder withPage(final String page) + public PdfRendererOptionsBuilder withPage(final String page) { return withPage(stringToInteger(page)); } - public OptionsBuilder withPage(final Integer page) + public PdfRendererOptionsBuilder withPage(final Integer page) { this.page = page; return this; } - public OptionsBuilder withWidth(final String width) + public PdfRendererOptionsBuilder withWidth(final String width) { return withWidth(stringToInteger(width)); } - public OptionsBuilder withWidth(final Integer width) + public PdfRendererOptionsBuilder withWidth(final Integer width) { this.width = width; return this; } - public OptionsBuilder withHeight(final String height) + public PdfRendererOptionsBuilder withHeight(final String height) { return withHeight(stringToInteger(height)); } - public OptionsBuilder withHeight(final Integer height) + public PdfRendererOptionsBuilder withHeight(final Integer height) { this.height = height; return this; } - public OptionsBuilder withAllowPdfEnlargement(final String allowPdfEnlargement) + public PdfRendererOptionsBuilder withAllowPdfEnlargement(final String allowPdfEnlargement) { return withAllowPdfEnlargement(stringToBoolean(allowPdfEnlargement)); } - public OptionsBuilder withAllowPdfEnlargement(final Boolean allowPdfEnlargement) + public PdfRendererOptionsBuilder withAllowPdfEnlargement(final Boolean allowPdfEnlargement) { this.allowPdfEnlargement = allowPdfEnlargement; return this; } - public OptionsBuilder withMaintainPdfAspectRatio(final String maintainPdfAspectRatio) + public PdfRendererOptionsBuilder withMaintainPdfAspectRatio(final String maintainPdfAspectRatio) { return withMaintainPdfAspectRatio(stringToBoolean(maintainPdfAspectRatio)); } - public OptionsBuilder withMaintainPdfAspectRatio(final Boolean maintainPdfAspectRatio) + public PdfRendererOptionsBuilder withMaintainPdfAspectRatio(final Boolean maintainPdfAspectRatio) { this.maintainPdfAspectRatio = maintainPdfAspectRatio; return this; @@ -127,8 +127,8 @@ final class OptionsBuilder return args.toString(); } - public static OptionsBuilder builder() + public static PdfRendererOptionsBuilder builder() { - return new OptionsBuilder(); + return new PdfRendererOptionsBuilder(); } } diff --git a/alfresco-transform-pdf-renderer/alfresco-transform-pdf-renderer/src/main/resources/pdfrenderer_engine_config.json b/alfresco-transform-pdf-renderer/alfresco-transform-pdf-renderer/src/main/resources/pdfrenderer_engine_config.json new file mode 100644 index 00000000..74c0c6b5 --- /dev/null +++ b/alfresco-transform-pdf-renderer/alfresco-transform-pdf-renderer/src/main/resources/pdfrenderer_engine_config.json @@ -0,0 +1,23 @@ +{ + "transformOptions": { + "pdfRendererOptions": [ + {"value": {"name": "page"}}, + {"value": {"name": "width"}}, + {"value": {"name": "height"}}, + {"value": {"name": "allowPdfEnlargement"}}, + {"value": {"name": "maintainPdfAspectRatio"}} + ] + }, + "transformers": [ + { + "transformerName": "pdfrenderer", + "supportedSourceAndTargetList": [ + {"sourceMediaType": "application/pdf", "targetMediaType": "image/png" }, + {"sourceMediaType": "application/illustrator", "targetMediaType": "image/png" } + ], + "transformOptions": [ + "pdfRendererOptions" + ] + } + ] +} \ No newline at end of file diff --git a/alfresco-transform-tika/alfresco-transform-tika-boot/src/main/resources/application-default.yaml b/alfresco-transform-tika/alfresco-transform-tika-boot/src/main/resources/application-default.yaml index 473f77a2..ee9a4f68 100644 --- a/alfresco-transform-tika/alfresco-transform-tika-boot/src/main/resources/application-default.yaml +++ b/alfresco-transform-tika/alfresco-transform-tika-boot/src/main/resources/application-default.yaml @@ -1,2 +1,5 @@ queue: - engineRequestQueue: ${TRANSFORM_ENGINE_REQUEST_QUEUE:org.alfresco.transform.engine.tika.acs} \ No newline at end of file + engineRequestQueue: ${TRANSFORM_ENGINE_REQUEST_QUEUE:org.alfresco.transform.engine.tika.acs} +transform: + config: + location: classpath:tika_engine_config.json \ No newline at end of file diff --git a/alfresco-transform-tika/alfresco-transform-tika-boot/src/test/java/org/alfresco/transformer/TikaControllerTest.java b/alfresco-transform-tika/alfresco-transform-tika-boot/src/test/java/org/alfresco/transformer/TikaControllerTest.java index 36cb92ff..9126cb2d 100644 --- a/alfresco-transform-tika/alfresco-transform-tika-boot/src/test/java/org/alfresco/transformer/TikaControllerTest.java +++ b/alfresco-transform-tika/alfresco-transform-tika-boot/src/test/java/org/alfresco/transformer/TikaControllerTest.java @@ -116,6 +116,7 @@ import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; @WebMvcTest(TikaController.class) public class TikaControllerTest extends AbstractTransformerControllerTest { + private static final String ENGINE_CONFIG_NAME = "tika_engine_config.json"; private static final String EXPECTED_XHTML_CONTENT_CONTAINS = "

The quick brown fox jumps over the lazy dog

"; private static final String EXPECTED_TEXT_CONTENT_CONTAINS = "The quick brown fox jumps over the lazy dog"; private static final String EXPECTED_MSG_CONTENT_CONTAINS = "Recipients\n" + @@ -146,6 +147,12 @@ public class TikaControllerTest extends AbstractTransformerControllerTest targetExtension = "txt"; } + @Override + public String getEngineConfigName() + { + return ENGINE_CONFIG_NAME; + } + @Override protected void mockTransformCommand(String sourceExtension, String targetExtension, String sourceMimetype, diff --git a/alfresco-transform-tika/alfresco-transform-tika-boot/src/test/resources/tika_engine_config.json b/alfresco-transform-tika/alfresco-transform-tika-boot/src/test/resources/tika_engine_config.json new file mode 100644 index 00000000..ddf79787 --- /dev/null +++ b/alfresco-transform-tika/alfresco-transform-tika-boot/src/test/resources/tika_engine_config.json @@ -0,0 +1,508 @@ +{ + "transformOptions": { + "tikaOptions": [ + {"value": {"name": "targetEncoding"}} + ], + "archiveOptions": [ + {"value": {"name": "includeContents"}}, + {"value": {"name": "targetEncoding"}} + ], + "pdfboxOptions": [ + {"value": {"name": "notExtractBookmarksText"}}, + {"value": {"name": "targetEncoding"}} + ] + }, + "transformers": [ + { + "transformerName": "Archive", + "supportedSourceAndTargetList": [ + {"sourceMediaType": "application/x-cpio", "targetMediaType": "text/html"}, + {"sourceMediaType": "application/x-cpio", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/x-cpio", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/x-cpio", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/java-archive", "targetMediaType": "text/html"}, + {"sourceMediaType": "application/java-archive", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/java-archive", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/java-archive", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/x-tar", "targetMediaType": "text/html"}, + {"sourceMediaType": "application/x-tar", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/x-tar", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/x-tar", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/zip", "targetMediaType": "text/html"}, + {"sourceMediaType": "application/zip", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/zip", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/zip", "targetMediaType": "text/xml"} + ], + "transformOptions": [ + "archiveOptions" + ] + }, + { + "transformerName": "OutlookMsg", + "supportedSourceAndTargetList": [ + {"sourceMediaType": "application/vnd.ms-outlook", "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-outlook", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-outlook", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-outlook", "targetMediaType": "text/xml"} + ], + "transformOptions": [ + "tikaOptions" + ] + }, + { + "transformerName": "PdfBox", + "supportedSourceAndTargetList": [ + {"sourceMediaType": "application/pdf", "targetMediaType": "text/csv"}, + {"sourceMediaType": "application/pdf", "targetMediaType": "text/html"}, + {"sourceMediaType": "application/pdf", "maxSourceSizeBytes": 26214400, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/pdf", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/pdf", "targetMediaType": "text/xml"} + ], + "transformOptions": [ + "pdfboxOptions" + ] + }, + { + "transformerName": "Office", + "supportedSourceAndTargetList": [ + {"sourceMediaType": "application/msword", "priority": 60, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/msword", "priority": 60, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/msword", "priority": 60, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/msword", "priority": 60, "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.ms-project", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-project", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-project", "priority": 55, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-project", "priority": 55, "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.ms-outlook", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-outlook", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-outlook", "priority": 55, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-outlook", "priority": 55, "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.ms-powerpoint", "priority": 60, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-powerpoint", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-powerpoint", "priority": 55, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-powerpoint", "priority": 55, "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.visio", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.visio", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.visio", "priority": 55, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.visio", "priority": 55, "targetMediaType": "text/xml"} + ], + "transformOptions": [ + "tikaOptions" + ] + }, + { + "transformerName": "Poi", + "supportedSourceAndTargetList": [ + {"sourceMediaType": "application/vnd.ms-excel", "priority": 55, "targetMediaType": "text/csv"}, + {"sourceMediaType": "application/vnd.ms-excel", "priority": 60, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-excel", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-excel", "priority": 55, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-excel", "priority": 55, "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "priority": 55, "targetMediaType": "text/csv"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "priority": 65, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "priority": 60, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "priority": 60, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "priority": 60, "targetMediaType": "text/xml"} + ], + "transformOptions": [ + "tikaOptions" + ] + }, + { + "transformerName": "OOXML", + "supportedSourceAndTargetList": [ + {"sourceMediaType": "application/vnd.ms-word.document.macroenabled.12", "priority": 60, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-word.document.macroenabled.12", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-word.document.macroenabled.12", "priority": 55, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-word.document.macroenabled.12", "priority": 55, "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "priority": 60, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "priority": 55, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "priority": 55, "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.ms-word.template.macroenabled.12", "priority": 60, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-word.template.macroenabled.12", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-word.template.macroenabled.12", "priority": 55, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-word.template.macroenabled.12", "priority": 55, "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.wordprocessingml.template", "priority": 60, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.wordprocessingml.template", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.wordprocessingml.template", "priority": 55, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.wordprocessingml.template", "priority": 55, "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.ms-powerpoint.template.macroenabled.12", "priority": 60, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.template.macroenabled.12", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.template.macroenabled.12", "priority": 55, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.template.macroenabled.12", "priority": 55, "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.template", "priority": 60, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.template", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.template", "priority": 55, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.template", "priority": 55, "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.ms-powerpoint.addin.macroenabled.12", "priority": 60, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.addin.macroenabled.12", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.addin.macroenabled.12", "priority": 55, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.addin.macroenabled.12", "priority": 55, "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.ms-powerpoint.slideshow.macroenabled.12", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.slideshow.macroenabled.12", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.slideshow.macroenabled.12", "priority": 55, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.slideshow.macroenabled.12", "priority": 55, "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.slideshow", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.slideshow", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.slideshow", "priority": 55, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.slideshow", "priority": 55, "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.ms-powerpoint.presentation.macroenabled.12", "priority": 60, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.presentation.macroenabled.12", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.presentation.macroenabled.12", "priority": 55, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.presentation.macroenabled.12", "priority": 55, "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.presentation", "priority": 60, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.presentation", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.presentation", "priority": 55, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.presentation", "priority": 55, "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.ms-powerpoint.slide.macroenabled.12", "priority": 60, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.slide.macroenabled.12", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.slide.macroenabled.12", "priority": 55, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.slide.macroenabled.12", "priority": 55, "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.slide", "priority": 60, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.slide", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.slide", "priority": 55, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.slide", "priority": 55, "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.ms-excel.addin.macroenabled.12", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-excel.addin.macroenabled.12", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-excel.addin.macroenabled.12", "priority": 55, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-excel.addin.macroenabled.12", "priority": 55, "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.ms-excel.sheet.binary.macroenabled.12", "priority": 60, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-excel.sheet.binary.macroenabled.12", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-excel.sheet.binary.macroenabled.12", "priority": 55, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-excel.sheet.binary.macroenabled.12", "priority": 55, "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.ms-excel.sheet.macroenabled.12", "priority": 60, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-excel.sheet.macroenabled.12", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-excel.sheet.macroenabled.12", "priority": 55, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-excel.sheet.macroenabled.12", "priority": 55, "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "priority": 60, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "priority": 55, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "priority": 55, "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.ms-excel.template.macroenabled.12", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-excel.template.macroenabled.12", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-excel.template.macroenabled.12", "priority": 55, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-excel.template.macroenabled.12", "priority": 55, "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.template", "priority": 60, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.template", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.template", "priority": 55, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.template", "priority": 55, "targetMediaType": "text/xml"} + ], + "transformOptions": [ + "tikaOptions" + ] + }, + { + "transformerName": "TikaAuto", + "supportedSourceAndTargetList": [ + {"sourceMediaType": "application/x-cpio", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/x-cpio", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/x-cpio", "priority": 55, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/x-cpio", "priority": 55, "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/java-archive", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/java-archive", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/java-archive", "priority": 55, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/java-archive", "priority": 55, "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/x-netcdf", "targetMediaType": "text/html"}, + {"sourceMediaType": "application/x-netcdf", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/x-netcdf", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/x-netcdf", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/msword", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/msword", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/msword", "priority": 55, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/msword", "priority": 55, "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.ms-word.document.macroenabled.12", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-word.document.macroenabled.12", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-word.document.macroenabled.12", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-word.document.macroenabled.12", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document" , "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.ms-word.template.macroenabled.12", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-word.template.macroenabled.12", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-word.template.macroenabled.12", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-word.template.macroenabled.12", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.wordprocessingml.template", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.wordprocessingml.template", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.wordprocessingml.template", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.wordprocessingml.template", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/x-gzip", "targetMediaType": "text/html"}, + {"sourceMediaType": "application/x-gzip", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/x-gzip", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/x-gzip", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/x-hdf", "targetMediaType": "text/html"}, + {"sourceMediaType": "application/x-hdf", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/x-hdf", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/x-hdf", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "text/html", "targetMediaType": "text/html"}, + {"sourceMediaType": "text/html", "priority": 60, "targetMediaType": "text/plain"}, + {"sourceMediaType": "text/html", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "text/html", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "text/x-java-source", "targetMediaType": "text/html"}, + {"sourceMediaType": "text/x-java-source", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "text/x-java-source", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "text/x-java-source", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.apple.keynote", "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.apple.keynote", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.apple.keynote", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.ms-project", "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-project", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-project", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-project", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.apple.numbers", "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.apple.numbers", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.apple.numbers", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.oasis.opendocument.chart", "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.chart", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.chart", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.chart", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.oasis.opendocument.image", "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.image", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.image", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.image", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.oasis.opendocument.text-master", "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.text-master", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.text-master", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.text-master", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.oasis.opendocument.presentation", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.presentation", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.presentation", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.presentation", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.oasis.opendocument.spreadsheet", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.spreadsheet", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.spreadsheet", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.spreadsheet", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.oasis.opendocument.text", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.text", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.text", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.text", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/ogg", "targetMediaType": "text/html"}, + {"sourceMediaType": "application/ogg", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/ogg", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/ogg", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.oasis.opendocument.text-web", "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.text-web", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.text-web", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.text-web", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.oasis.opendocument.presentation-template", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.presentation-template", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.presentation-template", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.presentation-template", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.oasis.opendocument.spreadsheet-template", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.spreadsheet-template", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.spreadsheet-template", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.spreadsheet-template", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.oasis.opendocument.text-template", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.text-template", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.text-template", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.text-template", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.apple.pages", "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.apple.pages", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.apple.pages", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/pdf", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/pdf", "maxSourceSizeBytes": 26214400, "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/pdf", "priority": 55, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/pdf", "priority": 55, "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.ms-powerpoint.template.macroenabled.12", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.template.macroenabled.12", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.template.macroenabled.12", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.template.macroenabled.12", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.template", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.template", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.template", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.template", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.ms-powerpoint.addin.macroenabled.12", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.addin.macroenabled.12", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.addin.macroenabled.12", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.addin.macroenabled.12", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.ms-powerpoint.slideshow.macroenabled.12", "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.slideshow.macroenabled.12", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.slideshow.macroenabled.12", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.slideshow.macroenabled.12", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.slideshow", "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.slideshow", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.slideshow", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.slideshow", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.ms-powerpoint", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-powerpoint", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-powerpoint", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-powerpoint", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.ms-powerpoint.presentation.macroenabled.12", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.presentation.macroenabled.12", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.presentation.macroenabled.12", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.presentation.macroenabled.12", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.presentation", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.presentation", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.presentation", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.presentation", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/x-rar-compressed", "targetMediaType": "text/html"}, + {"sourceMediaType": "application/x-rar-compressed", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/x-rar-compressed", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/x-rar-compressed", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/rss+xml", "targetMediaType": "text/html"}, + {"sourceMediaType": "application/rss+xml", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/rss+xml", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/rss+xml", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/rtf", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/rtf", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/rtf", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/rtf", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.ms-powerpoint.slide.macroenabled.12", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.slide.macroenabled.12", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.slide.macroenabled.12", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.slide.macroenabled.12", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.slide", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.slide", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.slide", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.slide", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.sun.xml.writer", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.sun.xml.writer", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.sun.xml.writer", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.sun.xml.writer", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "text/plain", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "text/plain", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "text/plain", "priority": 55, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "text/plain", "priority": 55, "targetMediaType": "text/xml"}, + + {"sourceMediaType": "text/xml", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "text/xml", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "text/xml", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "text/xml", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.visio", "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.visio", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.visio", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.visio", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/xhtml+xml", "targetMediaType": "text/html"}, + {"sourceMediaType": "application/xhtml+xml", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/xhtml+xml", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/xhtml+xml", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.ms-excel.addin.macroenabled.12", "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-excel.addin.macroenabled.12", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-excel.addin.macroenabled.12", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-excel.addin.macroenabled.12", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.ms-excel", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-excel", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-excel", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-excel", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.ms-excel.sheet.binary.macroenabled.12", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-excel.sheet.binary.macroenabled.12", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-excel.sheet.binary.macroenabled.12", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-excel.sheet.binary.macroenabled.12", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.ms-excel.sheet.macroenabled.12", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-excel.sheet.macroenabled.12", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-excel.sheet.macroenabled.12", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-excel.sheet.macroenabled.12", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.ms-excel.template.macroenabled.12", "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-excel.template.macroenabled.12", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-excel.template.macroenabled.12", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-excel.template.macroenabled.12", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.template", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.template", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.template", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.template", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/x-compress", "targetMediaType": "text/html"}, + {"sourceMediaType": "application/x-compress", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/x-compress", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/x-compress", "targetMediaType": "text/xml"} + ], + "transformOptions": [ + "tikaOptions" + ] + }, + { + "transformerName": "TextMining", + "supportedSourceAndTargetList": [ + {"sourceMediaType": "application/msword", "priority": 65, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/msword", "priority": 65, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/msword", "priority": 65, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/msword", "targetMediaType": "text/xml"} + ], + "transformOptions": [ + "tikaOptions" + ] + } + ] +} \ No newline at end of file diff --git a/alfresco-transform-tika/alfresco-transform-tika/src/main/resources/tika_engine_config.json b/alfresco-transform-tika/alfresco-transform-tika/src/main/resources/tika_engine_config.json new file mode 100644 index 00000000..ddf79787 --- /dev/null +++ b/alfresco-transform-tika/alfresco-transform-tika/src/main/resources/tika_engine_config.json @@ -0,0 +1,508 @@ +{ + "transformOptions": { + "tikaOptions": [ + {"value": {"name": "targetEncoding"}} + ], + "archiveOptions": [ + {"value": {"name": "includeContents"}}, + {"value": {"name": "targetEncoding"}} + ], + "pdfboxOptions": [ + {"value": {"name": "notExtractBookmarksText"}}, + {"value": {"name": "targetEncoding"}} + ] + }, + "transformers": [ + { + "transformerName": "Archive", + "supportedSourceAndTargetList": [ + {"sourceMediaType": "application/x-cpio", "targetMediaType": "text/html"}, + {"sourceMediaType": "application/x-cpio", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/x-cpio", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/x-cpio", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/java-archive", "targetMediaType": "text/html"}, + {"sourceMediaType": "application/java-archive", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/java-archive", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/java-archive", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/x-tar", "targetMediaType": "text/html"}, + {"sourceMediaType": "application/x-tar", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/x-tar", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/x-tar", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/zip", "targetMediaType": "text/html"}, + {"sourceMediaType": "application/zip", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/zip", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/zip", "targetMediaType": "text/xml"} + ], + "transformOptions": [ + "archiveOptions" + ] + }, + { + "transformerName": "OutlookMsg", + "supportedSourceAndTargetList": [ + {"sourceMediaType": "application/vnd.ms-outlook", "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-outlook", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-outlook", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-outlook", "targetMediaType": "text/xml"} + ], + "transformOptions": [ + "tikaOptions" + ] + }, + { + "transformerName": "PdfBox", + "supportedSourceAndTargetList": [ + {"sourceMediaType": "application/pdf", "targetMediaType": "text/csv"}, + {"sourceMediaType": "application/pdf", "targetMediaType": "text/html"}, + {"sourceMediaType": "application/pdf", "maxSourceSizeBytes": 26214400, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/pdf", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/pdf", "targetMediaType": "text/xml"} + ], + "transformOptions": [ + "pdfboxOptions" + ] + }, + { + "transformerName": "Office", + "supportedSourceAndTargetList": [ + {"sourceMediaType": "application/msword", "priority": 60, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/msword", "priority": 60, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/msword", "priority": 60, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/msword", "priority": 60, "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.ms-project", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-project", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-project", "priority": 55, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-project", "priority": 55, "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.ms-outlook", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-outlook", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-outlook", "priority": 55, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-outlook", "priority": 55, "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.ms-powerpoint", "priority": 60, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-powerpoint", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-powerpoint", "priority": 55, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-powerpoint", "priority": 55, "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.visio", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.visio", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.visio", "priority": 55, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.visio", "priority": 55, "targetMediaType": "text/xml"} + ], + "transformOptions": [ + "tikaOptions" + ] + }, + { + "transformerName": "Poi", + "supportedSourceAndTargetList": [ + {"sourceMediaType": "application/vnd.ms-excel", "priority": 55, "targetMediaType": "text/csv"}, + {"sourceMediaType": "application/vnd.ms-excel", "priority": 60, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-excel", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-excel", "priority": 55, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-excel", "priority": 55, "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "priority": 55, "targetMediaType": "text/csv"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "priority": 65, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "priority": 60, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "priority": 60, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "priority": 60, "targetMediaType": "text/xml"} + ], + "transformOptions": [ + "tikaOptions" + ] + }, + { + "transformerName": "OOXML", + "supportedSourceAndTargetList": [ + {"sourceMediaType": "application/vnd.ms-word.document.macroenabled.12", "priority": 60, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-word.document.macroenabled.12", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-word.document.macroenabled.12", "priority": 55, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-word.document.macroenabled.12", "priority": 55, "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "priority": 60, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "priority": 55, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "priority": 55, "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.ms-word.template.macroenabled.12", "priority": 60, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-word.template.macroenabled.12", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-word.template.macroenabled.12", "priority": 55, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-word.template.macroenabled.12", "priority": 55, "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.wordprocessingml.template", "priority": 60, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.wordprocessingml.template", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.wordprocessingml.template", "priority": 55, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.wordprocessingml.template", "priority": 55, "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.ms-powerpoint.template.macroenabled.12", "priority": 60, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.template.macroenabled.12", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.template.macroenabled.12", "priority": 55, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.template.macroenabled.12", "priority": 55, "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.template", "priority": 60, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.template", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.template", "priority": 55, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.template", "priority": 55, "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.ms-powerpoint.addin.macroenabled.12", "priority": 60, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.addin.macroenabled.12", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.addin.macroenabled.12", "priority": 55, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.addin.macroenabled.12", "priority": 55, "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.ms-powerpoint.slideshow.macroenabled.12", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.slideshow.macroenabled.12", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.slideshow.macroenabled.12", "priority": 55, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.slideshow.macroenabled.12", "priority": 55, "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.slideshow", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.slideshow", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.slideshow", "priority": 55, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.slideshow", "priority": 55, "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.ms-powerpoint.presentation.macroenabled.12", "priority": 60, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.presentation.macroenabled.12", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.presentation.macroenabled.12", "priority": 55, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.presentation.macroenabled.12", "priority": 55, "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.presentation", "priority": 60, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.presentation", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.presentation", "priority": 55, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.presentation", "priority": 55, "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.ms-powerpoint.slide.macroenabled.12", "priority": 60, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.slide.macroenabled.12", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.slide.macroenabled.12", "priority": 55, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.slide.macroenabled.12", "priority": 55, "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.slide", "priority": 60, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.slide", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.slide", "priority": 55, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.slide", "priority": 55, "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.ms-excel.addin.macroenabled.12", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-excel.addin.macroenabled.12", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-excel.addin.macroenabled.12", "priority": 55, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-excel.addin.macroenabled.12", "priority": 55, "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.ms-excel.sheet.binary.macroenabled.12", "priority": 60, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-excel.sheet.binary.macroenabled.12", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-excel.sheet.binary.macroenabled.12", "priority": 55, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-excel.sheet.binary.macroenabled.12", "priority": 55, "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.ms-excel.sheet.macroenabled.12", "priority": 60, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-excel.sheet.macroenabled.12", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-excel.sheet.macroenabled.12", "priority": 55, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-excel.sheet.macroenabled.12", "priority": 55, "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "priority": 60, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "priority": 55, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "priority": 55, "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.ms-excel.template.macroenabled.12", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-excel.template.macroenabled.12", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-excel.template.macroenabled.12", "priority": 55, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-excel.template.macroenabled.12", "priority": 55, "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.template", "priority": 60, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.template", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.template", "priority": 55, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.template", "priority": 55, "targetMediaType": "text/xml"} + ], + "transformOptions": [ + "tikaOptions" + ] + }, + { + "transformerName": "TikaAuto", + "supportedSourceAndTargetList": [ + {"sourceMediaType": "application/x-cpio", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/x-cpio", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/x-cpio", "priority": 55, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/x-cpio", "priority": 55, "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/java-archive", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/java-archive", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/java-archive", "priority": 55, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/java-archive", "priority": 55, "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/x-netcdf", "targetMediaType": "text/html"}, + {"sourceMediaType": "application/x-netcdf", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/x-netcdf", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/x-netcdf", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/msword", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/msword", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/msword", "priority": 55, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/msword", "priority": 55, "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.ms-word.document.macroenabled.12", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-word.document.macroenabled.12", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-word.document.macroenabled.12", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-word.document.macroenabled.12", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document" , "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.ms-word.template.macroenabled.12", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-word.template.macroenabled.12", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-word.template.macroenabled.12", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-word.template.macroenabled.12", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.wordprocessingml.template", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.wordprocessingml.template", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.wordprocessingml.template", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.wordprocessingml.template", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/x-gzip", "targetMediaType": "text/html"}, + {"sourceMediaType": "application/x-gzip", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/x-gzip", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/x-gzip", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/x-hdf", "targetMediaType": "text/html"}, + {"sourceMediaType": "application/x-hdf", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/x-hdf", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/x-hdf", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "text/html", "targetMediaType": "text/html"}, + {"sourceMediaType": "text/html", "priority": 60, "targetMediaType": "text/plain"}, + {"sourceMediaType": "text/html", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "text/html", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "text/x-java-source", "targetMediaType": "text/html"}, + {"sourceMediaType": "text/x-java-source", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "text/x-java-source", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "text/x-java-source", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.apple.keynote", "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.apple.keynote", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.apple.keynote", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.ms-project", "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-project", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-project", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-project", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.apple.numbers", "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.apple.numbers", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.apple.numbers", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.oasis.opendocument.chart", "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.chart", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.chart", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.chart", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.oasis.opendocument.image", "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.image", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.image", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.image", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.oasis.opendocument.text-master", "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.text-master", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.text-master", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.text-master", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.oasis.opendocument.presentation", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.presentation", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.presentation", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.presentation", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.oasis.opendocument.spreadsheet", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.spreadsheet", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.spreadsheet", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.spreadsheet", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.oasis.opendocument.text", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.text", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.text", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.text", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/ogg", "targetMediaType": "text/html"}, + {"sourceMediaType": "application/ogg", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/ogg", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/ogg", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.oasis.opendocument.text-web", "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.text-web", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.text-web", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.text-web", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.oasis.opendocument.presentation-template", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.presentation-template", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.presentation-template", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.presentation-template", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.oasis.opendocument.spreadsheet-template", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.spreadsheet-template", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.spreadsheet-template", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.spreadsheet-template", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.oasis.opendocument.text-template", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.text-template", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.text-template", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.oasis.opendocument.text-template", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.apple.pages", "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.apple.pages", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.apple.pages", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/pdf", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/pdf", "maxSourceSizeBytes": 26214400, "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/pdf", "priority": 55, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/pdf", "priority": 55, "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.ms-powerpoint.template.macroenabled.12", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.template.macroenabled.12", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.template.macroenabled.12", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.template.macroenabled.12", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.template", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.template", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.template", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.template", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.ms-powerpoint.addin.macroenabled.12", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.addin.macroenabled.12", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.addin.macroenabled.12", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.addin.macroenabled.12", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.ms-powerpoint.slideshow.macroenabled.12", "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.slideshow.macroenabled.12", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.slideshow.macroenabled.12", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.slideshow.macroenabled.12", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.slideshow", "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.slideshow", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.slideshow", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.slideshow", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.ms-powerpoint", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-powerpoint", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-powerpoint", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-powerpoint", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.ms-powerpoint.presentation.macroenabled.12", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.presentation.macroenabled.12", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.presentation.macroenabled.12", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.presentation.macroenabled.12", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.presentation", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.presentation", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.presentation", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.presentation", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/x-rar-compressed", "targetMediaType": "text/html"}, + {"sourceMediaType": "application/x-rar-compressed", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/x-rar-compressed", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/x-rar-compressed", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/rss+xml", "targetMediaType": "text/html"}, + {"sourceMediaType": "application/rss+xml", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/rss+xml", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/rss+xml", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/rtf", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/rtf", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/rtf", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/rtf", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.ms-powerpoint.slide.macroenabled.12", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.slide.macroenabled.12", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.slide.macroenabled.12", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-powerpoint.slide.macroenabled.12", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.slide", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.slide", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.slide", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.presentationml.slide", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.sun.xml.writer", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.sun.xml.writer", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.sun.xml.writer", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.sun.xml.writer", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "text/plain", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "text/plain", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "text/plain", "priority": 55, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "text/plain", "priority": 55, "targetMediaType": "text/xml"}, + + {"sourceMediaType": "text/xml", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "text/xml", "priority": 55, "targetMediaType": "text/plain"}, + {"sourceMediaType": "text/xml", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "text/xml", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.visio", "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.visio", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.visio", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.visio", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/xhtml+xml", "targetMediaType": "text/html"}, + {"sourceMediaType": "application/xhtml+xml", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/xhtml+xml", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/xhtml+xml", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.ms-excel.addin.macroenabled.12", "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-excel.addin.macroenabled.12", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-excel.addin.macroenabled.12", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-excel.addin.macroenabled.12", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.ms-excel", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-excel", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-excel", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-excel", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.ms-excel.sheet.binary.macroenabled.12", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-excel.sheet.binary.macroenabled.12", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-excel.sheet.binary.macroenabled.12", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-excel.sheet.binary.macroenabled.12", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.ms-excel.sheet.macroenabled.12", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-excel.sheet.macroenabled.12", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-excel.sheet.macroenabled.12", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-excel.sheet.macroenabled.12", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.ms-excel.template.macroenabled.12", "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.ms-excel.template.macroenabled.12", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.ms-excel.template.macroenabled.12", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.ms-excel.template.macroenabled.12", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.template", "priority": 55, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.template", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.template", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.template", "targetMediaType": "text/xml"}, + + {"sourceMediaType": "application/x-compress", "targetMediaType": "text/html"}, + {"sourceMediaType": "application/x-compress", "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/x-compress", "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/x-compress", "targetMediaType": "text/xml"} + ], + "transformOptions": [ + "tikaOptions" + ] + }, + { + "transformerName": "TextMining", + "supportedSourceAndTargetList": [ + {"sourceMediaType": "application/msword", "priority": 65, "targetMediaType": "text/html"}, + {"sourceMediaType": "application/msword", "priority": 65, "targetMediaType": "text/plain"}, + {"sourceMediaType": "application/msword", "priority": 65, "targetMediaType": "application/xhtml+xml"}, + {"sourceMediaType": "application/msword", "targetMediaType": "text/xml"} + ], + "transformOptions": [ + "tikaOptions" + ] + } + ] +} \ No newline at end of file diff --git a/alfresco-transformer-base/src/main/java/org/alfresco/transformer/AbstractTransformerController.java b/alfresco-transformer-base/src/main/java/org/alfresco/transformer/AbstractTransformerController.java index 862d50ae..ab6e6ce3 100644 --- a/alfresco-transformer-base/src/main/java/org/alfresco/transformer/AbstractTransformerController.java +++ b/alfresco-transformer-base/src/main/java/org/alfresco/transformer/AbstractTransformerController.java @@ -115,6 +115,7 @@ public abstract class AbstractTransformerController implements TransformControll @GetMapping(value = "/transform/config") public ResponseEntity info() { + // TODO - This cast should not be here logger.info("GET Transform Config."); final TransformConfig transformConfig = ((TransformRegistryImpl) transformRegistry).getTransformConfig(); diff --git a/alfresco-transformer-base/src/main/java/org/alfresco/transformer/TransformRegistryImpl.java b/alfresco-transformer-base/src/main/java/org/alfresco/transformer/TransformRegistryImpl.java index f494685c..f08f4cea 100644 --- a/alfresco-transformer-base/src/main/java/org/alfresco/transformer/TransformRegistryImpl.java +++ b/alfresco-transformer-base/src/main/java/org/alfresco/transformer/TransformRegistryImpl.java @@ -40,10 +40,12 @@ import org.alfresco.transform.client.registry.TransformCache; import org.alfresco.transform.exceptions.TransformException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.core.io.Resource; import com.fasterxml.jackson.databind.ObjectMapper; +import org.springframework.core.io.ResourceLoader; /** * Used by clients to work out if a transformation is supported based on the engine_config.json. @@ -52,11 +54,22 @@ public class TransformRegistryImpl extends AbstractTransformRegistry { private static final Logger log = LoggerFactory.getLogger(TransformRegistryImpl.class); - private static final String ENGINE_CONFIG_JSON = "classpath:engine_config.json"; + @Autowired + ResourceLoader resourceLoader; + + @Value("${transform.config.location:classpath:engine_config.json}") + private String locationFromProperty; - @Value(ENGINE_CONFIG_JSON) private Resource engineConfig; + @PostConstruct + public void afterPropertiesSet() + { + engineConfig = resourceLoader.getResource(locationFromProperty); + TransformConfig transformConfig = getTransformConfig(); + registerAll(transformConfig, null, locationFromProperty); + } + // Holds the structures used by AbstractTransformRegistry to look up what is supported. // Unlike other sub classes this class does not extend Data or replace it at run time. private TransformCache data = new TransformCache(); @@ -72,17 +85,10 @@ public class TransformRegistryImpl extends AbstractTransformRegistry catch (IOException e) { throw new TransformException(INTERNAL_SERVER_ERROR.value(), - "Could not read " + ENGINE_CONFIG_JSON, e); + "Could not read " + locationFromProperty, e); } } - @PostConstruct - public void afterPropertiesSet() - { - TransformConfig transformConfig = getTransformConfig(); - registerAll(transformConfig, null, ENGINE_CONFIG_JSON); - } - @Override public TransformCache getData() { diff --git a/alfresco-transformer-base/src/main/java/org/alfresco/transformer/util/RequestParamMap.java b/alfresco-transformer-base/src/main/java/org/alfresco/transformer/util/RequestParamMap.java new file mode 100644 index 00000000..5f406afe --- /dev/null +++ b/alfresco-transformer-base/src/main/java/org/alfresco/transformer/util/RequestParamMap.java @@ -0,0 +1,60 @@ +/* + * #%L + * Alfresco Transform Core + * %% + * Copyright (C) 2005 - 2020 Alfresco Software Limited + * %% + * This file is part of the Alfresco software. + * - + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * - + * Alfresco is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * - + * Alfresco is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * - + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + * #L% + */ +package org.alfresco.transformer.util; + +public interface RequestParamMap +{ + String SOURCE_ENCODING = "sourceEncoding"; + String SOURCE_EXTENSION = "sourceExtension"; + String SOURCE_MIMETYPE = "sourceMimetype"; + String TARGET_EXTENSION = "targetExtension"; + String TARGET_MIMETYPE = "targetMimetype"; + String TEST_DELAY = "testDelay"; + String PAGE_REQUEST_PARAM = "page"; + String WIDTH_REQUEST_PARAM = "width"; + String HEIGHT_REQUEST_PARAM = "height"; + String ALLOW_PDF_ENLARGEMENT = "allowPdfEnlargement"; + String MAINTAIN_PDF_ASPECT_RATIO = "maintainPdfAspectRatio"; + String START_PAGE = "startPage"; + String END_PAGE = "endPage"; + String ALPHA_REMOVE = "alphaRemove"; + String AUTO_ORIENT = "autoOrient"; + String CROP_GRAVITY = "cropGravity"; + String CROP_WIDTH = "cropWidth"; + String CROP_HEIGHT = "cropHeight"; + String CROP_PERCENTAGE = "cropPercentage"; + String CROP_X_OFFSET = "cropXOffset"; + String CROP_Y_OFFSET = "cropYOffset"; + String THUMBNAIL = "thumbnail"; + String RESIZE_WIDTH = "resizeWidth"; + String RESIZE_HEIGHT = "resizeHeight"; + String RESIZE_PERCENTAGE = "resizePercentage"; + String ALLOW_ENLARGEMENT = "allowEnlargement"; + String MAINTAIN_ASPECT_RATIO = "maintainAspectRatio"; + String COMMAND_OPTIONS = "commandOptions"; + String TIMEOUT = "timeOut"; +} diff --git a/alfresco-transformer-base/src/main/java/org/alfresco/transformer/util/Util.java b/alfresco-transformer-base/src/main/java/org/alfresco/transformer/util/Util.java index 2f24b1f0..ead426a0 100644 --- a/alfresco-transformer-base/src/main/java/org/alfresco/transformer/util/Util.java +++ b/alfresco-transformer-base/src/main/java/org/alfresco/transformer/util/Util.java @@ -52,4 +52,15 @@ public class Util { return param == null ? null : Boolean.parseBoolean(param); } + + /** + * Safely converts a {@link String} to a {@link Long} + * + * @param param String to be converted + * @return Null if param is null or converted value as {@link Boolean} + */ + public static Long stringToLong(final String param) + { + return param == null ? null : Long.parseLong(param); + } } diff --git a/alfresco-transformer-base/src/test/java/org/alfresco/transformer/AbstractTransformerControllerTest.java b/alfresco-transformer-base/src/test/java/org/alfresco/transformer/AbstractTransformerControllerTest.java index 0d36966d..c6ba029f 100644 --- a/alfresco-transformer-base/src/test/java/org/alfresco/transformer/AbstractTransformerControllerTest.java +++ b/alfresco-transformer-base/src/test/java/org/alfresco/transformer/AbstractTransformerControllerTest.java @@ -340,15 +340,24 @@ public abstract class AbstractTransformerControllerTest assertEquals(BAD_REQUEST.value(), transformReply.getStatus()); } + /** + * + * @return transformer specific engine config name + */ + public String getEngineConfigName() + { + return "engine_config.json"; + } + @Test public void testGetTransformConfigInfo() throws Exception { TransformConfig expectedTransformConfig = objectMapper - .readValue(new ClassPathResource("engine_config.json").getFile(), + .readValue(new ClassPathResource(getEngineConfigName()).getFile(), TransformConfig.class); ReflectionTestUtils.setField(transformRegistry, "engineConfig", - new ClassPathResource("engine_config.json")); + new ClassPathResource(getEngineConfigName())); String response = mockMvc .perform(MockMvcRequestBuilders.get("/transform/config")) @@ -357,7 +366,6 @@ public abstract class AbstractTransformerControllerTest .andReturn().getResponse().getContentAsString(); TransformConfig transformConfig = objectMapper.readValue(response, TransformConfig.class); - assertEquals(expectedTransformConfig, transformConfig); } diff --git a/pom.xml b/pom.xml index 59dda0b1..13c6d0de 100644 --- a/pom.xml +++ b/pom.xml @@ -42,6 +42,8 @@ alfresco-transform-imagemagick/alfresco-transform-imagemagick-boot alfresco-transform-misc/alfresco-transform-misc alfresco-transform-misc/alfresco-transform-misc-boot + alfresco-transform-core-aio/alfresco-transform-core-aio + alfresco-transform-core-aio/alfresco-transform-core-aio-boot