Refactor packages in t-model to make them more readable

This commit is contained in:
alandavis
2022-06-17 10:16:04 +01:00
parent 69ec6cddc3
commit 78c82c9a01
105 changed files with 731 additions and 986 deletions

View File

@@ -26,8 +26,8 @@
*/ */
package org.alfresco.transformer; package org.alfresco.transformer;
import org.alfresco.transform.client.model.config.TransformConfig; import org.alfresco.transform.config.TransformConfig;
import org.alfresco.transform.exceptions.TransformException; import org.alfresco.transform.common.TransformException;
import org.alfresco.transformer.executors.Transformer; import org.alfresco.transformer.executors.Transformer;
import org.alfresco.transformer.probes.ProbeTestTransform; import org.alfresco.transformer.probes.ProbeTestTransform;
import org.slf4j.Logger; import org.slf4j.Logger;
@@ -41,13 +41,12 @@ import java.io.File;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_HTML; import static org.alfresco.transform.common.Mimetype.MIMETYPE_HTML;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_TEXT_PLAIN; import static org.alfresco.transform.common.Mimetype.MIMETYPE_TEXT_PLAIN;
import static org.alfresco.transform.client.model.config.CoreVersionDecorator.setOrClearCoreVersion; import static org.alfresco.transform.config.CoreVersionDecorator.setOrClearCoreVersion;
import static org.alfresco.transform.client.util.RequestParamMap.CONFIG_VERSION_DEFAULT; import static org.alfresco.transform.common.RequestParamMap.CONFIG_VERSION_DEFAULT;
import static org.alfresco.transformer.util.RequestParamMap.CONFIG_VERSION; import static org.alfresco.transformer.util.RequestParamMap.CONFIG_VERSION;
import static org.alfresco.transformer.util.RequestParamMap.SOURCE_ENCODING; import static org.alfresco.transformer.util.RequestParamMap.SOURCE_ENCODING;
import static org.alfresco.transformer.util.RequestParamMap.TRANSFORM_NAME_PARAMETER;
import static org.springframework.http.HttpStatus.INTERNAL_SERVER_ERROR; import static org.springframework.http.HttpStatus.INTERNAL_SERVER_ERROR;
import static org.springframework.http.HttpStatus.OK; import static org.springframework.http.HttpStatus.OK;

View File

@@ -26,7 +26,7 @@
*/ */
package org.alfresco.transformer; package org.alfresco.transformer;
import org.alfresco.transform.client.registry.TransformServiceRegistry; import org.alfresco.transform.registry.TransformServiceRegistry;
import org.alfresco.transformer.executors.ImageMagickCommandExecutor; import org.alfresco.transformer.executors.ImageMagickCommandExecutor;
import org.alfresco.transformer.executors.LibreOfficeJavaExecutor; import org.alfresco.transformer.executors.LibreOfficeJavaExecutor;
import org.alfresco.transformer.executors.PdfRendererCommandExecutor; import org.alfresco.transformer.executors.PdfRendererCommandExecutor;

View File

@@ -29,7 +29,7 @@ package org.alfresco.transformer;
import java.io.IOException; import java.io.IOException;
import org.alfresco.transform.client.model.TransformRequest; import org.alfresco.transform.client.model.TransformRequest;
import org.alfresco.transform.client.model.config.TransformConfig; import org.alfresco.transform.config.TransformConfig;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
@@ -37,8 +37,8 @@ import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import static org.alfresco.transform.client.util.RequestParamMap.CONFIG_VERSION_DEFAULT; import static org.alfresco.transform.common.RequestParamMap.CONFIG_VERSION_DEFAULT;
import static org.alfresco.transform.client.util.RequestParamMap.CONFIG_VERSION_LATEST; import static org.alfresco.transform.common.RequestParamMap.CONFIG_VERSION_LATEST;
import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertNull;

View File

@@ -2,7 +2,7 @@
* #%L * #%L
* Alfresco Transform Core * Alfresco Transform Core
* %% * %%
* Copyright (C) 2005 - 2021 Alfresco Software Limited * Copyright (C) 2005 - 2022 Alfresco Software Limited
* %% * %%
* This file is part of the Alfresco software. * This file is part of the Alfresco software.
* - * -
@@ -26,8 +26,8 @@
*/ */
package org.alfresco.transformer; package org.alfresco.transformer;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_HTML; import static org.alfresco.transform.common.Mimetype.MIMETYPE_HTML;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_TEXT_PLAIN; import static org.alfresco.transform.common.Mimetype.MIMETYPE_TEXT_PLAIN;
import java.util.UUID; import java.util.UUID;

View File

@@ -27,14 +27,13 @@
package org.alfresco.transformer; package org.alfresco.transformer;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import org.alfresco.transform.client.model.config.TransformConfig; import org.alfresco.transform.config.TransformConfig;
import org.alfresco.transform.client.registry.AbstractTransformRegistry; import org.alfresco.transform.registry.AbstractTransformRegistry;
import org.alfresco.transform.client.registry.CombinedTransformConfig; import org.alfresco.transform.registry.CombinedTransformConfig;
import org.alfresco.transform.client.registry.TransformCache; import org.alfresco.transform.registry.TransformCache;
import org.alfresco.transformer.executors.Transformer; import org.alfresco.transformer.executors.Transformer;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
@@ -44,7 +43,7 @@ import java.util.HashMap;
import java.util.Map; import java.util.Map;
import static java.nio.charset.StandardCharsets.UTF_8; import static java.nio.charset.StandardCharsets.UTF_8;
import static org.alfresco.transform.client.model.config.CoreVersionDecorator.setCoreVersionOnSingleStepTransformers; import static org.alfresco.transform.config.CoreVersionDecorator.setCoreVersionOnSingleStepTransformers;
/** /**
* AIOTransformRegistry manages all of the sub transformers registered to it and provides aggregated TransformConfig. * AIOTransformRegistry manages all of the sub transformers registered to it and provides aggregated TransformConfig.
@@ -91,7 +90,7 @@ public class AIOTransformRegistry extends AbstractTransformRegistry
combinedTransformConfig.addTransformConfig(transformConfig, location, transformerId, this); combinedTransformConfig.addTransformConfig(transformConfig, location, transformerId, this);
// Map all of the transforms defined in the config to this Transformer implementation // Map all of the transforms defined in the config to this Transformer implementation
for (org.alfresco.transform.client.model.config.Transformer transformerConfig : transformConfig.getTransformers()) for (org.alfresco.transform.config.Transformer transformerConfig : transformConfig.getTransformers())
{ {
String transformerName = transformerConfig.getTransformerName(); String transformerName = transformerConfig.getTransformerName();
// A later tEngine 'might' override one that has already been defined. That is fine. // A later tEngine 'might' override one that has already been defined. That is fine.

View File

@@ -27,7 +27,7 @@
package org.alfresco.transformer; package org.alfresco.transformer;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import org.alfresco.transform.client.model.config.TransformConfig; import org.alfresco.transform.config.TransformConfig;
import org.alfresco.transformer.executors.TikaJavaExecutor; import org.alfresco.transformer.executors.TikaJavaExecutor;
import org.alfresco.transformer.executors.Transformer; import org.alfresco.transformer.executors.Transformer;
import org.alfresco.transformer.transformers.SelectingTransformer; import org.alfresco.transformer.transformers.SelectingTransformer;
@@ -51,9 +51,7 @@ import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
import static org.alfresco.transformer.util.RequestParamMap.PAGE_LIMIT; import static org.alfresco.transformer.util.RequestParamMap.PAGE_LIMIT;
import static org.alfresco.transformer.util.RequestParamMap.TRANSFORM_NAME_PARAMETER;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.assertTrue;
public class AIOTransformRegistryTest public class AIOTransformRegistryTest

View File

@@ -26,8 +26,7 @@
*/ */
package org.alfresco.transformer; package org.alfresco.transformer;
import static org.alfresco.transform.client.util.RequestParamMap.ENDPOINT_TRANSFORM; import static org.alfresco.transform.common.RequestParamMap.ENDPOINT_TRANSFORM;
import static org.alfresco.transformer.util.MimetypeMap.PREFIX_IMAGE;
import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.containsString;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNotNull;
@@ -92,6 +91,8 @@ public class ImageMagickControllerTest extends AbstractTransformerControllerTest
{ {
private static final String ENGINE_CONFIG_NAME = "imagemagick_engine_config.json"; private static final String ENGINE_CONFIG_NAME = "imagemagick_engine_config.json";
private String PREFIX_IMAGE = "image/";
@Mock @Mock
protected ExecutionResult mockExecutionResult; protected ExecutionResult mockExecutionResult;

View File

@@ -2,7 +2,7 @@
* #%L * #%L
* Alfresco Transform Core * Alfresco Transform Core
* %% * %%
* Copyright (C) 2005 - 2021 Alfresco Software Limited * Copyright (C) 2005 - 2022 Alfresco Software Limited
* %% * %%
* This file is part of the Alfresco software. * This file is part of the Alfresco software.
* - * -
@@ -26,8 +26,8 @@
*/ */
package org.alfresco.transformer; package org.alfresco.transformer;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_IMAGE_JPEG; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_JPEG;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_IMAGE_PNG; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_PNG;
import java.util.UUID; import java.util.UUID;

View File

@@ -2,7 +2,7 @@
* #%L * #%L
* Alfresco Transform Core * Alfresco Transform Core
* %% * %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited * Copyright (C) 2005 - 2022 Alfresco Software Limited
* %% * %%
* This file is part of the Alfresco software. * This file is part of the Alfresco software.
* - * -
@@ -32,39 +32,39 @@ import static java.util.function.Function.identity;
import static java.util.stream.Collectors.toMap; import static java.util.stream.Collectors.toMap;
import static org.alfresco.transformer.EngineClient.sendTRequest; import static org.alfresco.transformer.EngineClient.sendTRequest;
import static org.alfresco.transformer.TestFileInfo.testFile; import static org.alfresco.transformer.TestFileInfo.testFile;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_APPLICATION_EPS; import static org.alfresco.transform.common.Mimetype.MIMETYPE_APPLICATION_EPS;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_IMAGE_BMP; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_BMP;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_IMAGE_CGM; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_CGM;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_IMAGE_GIF; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_GIF;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_IMAGE_IEF; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_IEF;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_IMAGE_JP2; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_JP2;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_IMAGE_JPEG; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_JPEG;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_IMAGE_PBM; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_PBM;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_IMAGE_PGM; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_PGM;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_IMAGE_PNG; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_PNG;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_IMAGE_PNM; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_PNM;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_IMAGE_PPJ; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_PPJ;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_IMAGE_PPM; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_PPM;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_IMAGE_PSD; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_PSD;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_IMAGE_RAS; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_RAS;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_IMAGE_RAW_3FR; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_RAW_3FR;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_IMAGE_RAW_ARW; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_RAW_ARW;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_IMAGE_RAW_CR2; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_RAW_CR2;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_IMAGE_RAW_DNG; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_RAW_DNG;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_IMAGE_RAW_K25; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_RAW_K25;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_IMAGE_RAW_MRW; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_RAW_MRW;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_IMAGE_RAW_NEF; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_RAW_NEF;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_IMAGE_RAW_ORF; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_RAW_ORF;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_IMAGE_RAW_PEF; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_RAW_PEF;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_IMAGE_RAW_R3D; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_RAW_R3D;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_IMAGE_RAW_RAF; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_RAW_RAF;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_IMAGE_RAW_RW2; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_RAW_RW2;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_IMAGE_RAW_RWL; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_RAW_RWL;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_IMAGE_RAW_X3F; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_RAW_X3F;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_IMAGE_TIFF; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_TIFF;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_IMAGE_XBM; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_XBM;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_IMAGE_XPM; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_XPM;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_IMAGE_XWD; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_XWD;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.fail; import static org.junit.jupiter.api.Assertions.fail;
import static org.springframework.http.HttpStatus.OK; import static org.springframework.http.HttpStatus.OK;

View File

@@ -2,7 +2,7 @@
* #%L * #%L
* Alfresco Transform Core * Alfresco Transform Core
* %% * %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited * Copyright (C) 2005 - 2022 Alfresco Software Limited
* %% * %%
* This file is part of the Alfresco software. * This file is part of the Alfresco software.
* - * -
@@ -27,7 +27,7 @@
package org.alfresco.transformer; package org.alfresco.transformer;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import org.alfresco.transform.exceptions.TransformException; import org.alfresco.transform.common.TransformException;
import java.util.List; import java.util.List;
import java.util.StringJoiner; import java.util.StringJoiner;

View File

@@ -2,7 +2,7 @@
* #%L * #%L
* Alfresco Transform Core * Alfresco Transform Core
* %% * %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited * Copyright (C) 2005 - 2022 Alfresco Software Limited
* %% * %%
* This file is part of the Alfresco software. * This file is part of the Alfresco software.
* - * -
@@ -26,7 +26,7 @@
*/ */
package org.alfresco.transformer.executors; package org.alfresco.transformer.executors;
import org.alfresco.transform.exceptions.TransformException; import org.alfresco.transform.common.TransformException;
import org.alfresco.transformer.ImageMagickOptionsBuilder; import org.alfresco.transformer.ImageMagickOptionsBuilder;
import java.io.File; import java.io.File;

View File

@@ -26,8 +26,8 @@
*/ */
package org.alfresco.transformer; package org.alfresco.transformer;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_PDF; import static org.alfresco.transform.common.Mimetype.MIMETYPE_PDF;
import static org.alfresco.transform.client.util.RequestParamMap.ENDPOINT_TRANSFORM; import static org.alfresco.transform.common.RequestParamMap.ENDPOINT_TRANSFORM;
import static org.alfresco.transformer.util.RequestParamMap.SOURCE_MIMETYPE; 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_EXTENSION;
import static org.alfresco.transformer.util.RequestParamMap.TARGET_MIMETYPE; import static org.alfresco.transformer.util.RequestParamMap.TARGET_MIMETYPE;

View File

@@ -26,7 +26,7 @@
*/ */
package org.alfresco.transformer; package org.alfresco.transformer;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_OPENXML_WORDPROCESSING; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENXML_WORDPROCESSING;
import java.util.UUID; import java.util.UUID;

View File

@@ -31,37 +31,37 @@ import static java.util.function.Function.identity;
import static java.util.stream.Collectors.toMap; import static java.util.stream.Collectors.toMap;
import static org.alfresco.transformer.EngineClient.sendTRequest; import static org.alfresco.transformer.EngineClient.sendTRequest;
import static org.alfresco.transformer.TestFileInfo.testFile; import static org.alfresco.transformer.TestFileInfo.testFile;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_EXCEL; import static org.alfresco.transform.common.Mimetype.MIMETYPE_EXCEL;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_HTML; import static org.alfresco.transform.common.Mimetype.MIMETYPE_HTML;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_IMAGE_SVG; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_SVG;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_OPENDOCUMENT_GRAPHICS; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENDOCUMENT_GRAPHICS;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_OPENDOCUMENT_PRESENTATION; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENDOCUMENT_PRESENTATION;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_OPENDOCUMENT_SPREADSHEET; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENDOCUMENT_SPREADSHEET;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_OPENDOCUMENT_TEXT; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENDOCUMENT_TEXT;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_OPENXML_PRESENTATION; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENXML_PRESENTATION;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_OPENXML_SPREADSHEET; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENXML_SPREADSHEET;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_OPENXML_WORDPROCESSING; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENXML_WORDPROCESSING;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_PDF; import static org.alfresco.transform.common.Mimetype.MIMETYPE_PDF;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_PPT; import static org.alfresco.transform.common.Mimetype.MIMETYPE_PPT;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_RTF; import static org.alfresco.transform.common.Mimetype.MIMETYPE_RTF;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_TEXT_CSV; import static org.alfresco.transform.common.Mimetype.MIMETYPE_TEXT_CSV;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_TSV; import static org.alfresco.transform.common.Mimetype.MIMETYPE_TSV;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_VISIO; import static org.alfresco.transform.common.Mimetype.MIMETYPE_VISIO;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_VISIO_2013; import static org.alfresco.transform.common.Mimetype.MIMETYPE_VISIO_2013;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_WORD; import static org.alfresco.transform.common.Mimetype.MIMETYPE_WORD;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_WORDPERFECT; import static org.alfresco.transform.common.Mimetype.MIMETYPE_WORDPERFECT;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_XML; import static org.alfresco.transform.common.Mimetype.MIMETYPE_XML;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_OPENXML_SPREADSHEET_TEMPLATE_MACRO; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENXML_SPREADSHEET_TEMPLATE_MACRO;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_OPENXML_PRESENTATION_SLIDESHOW; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENXML_PRESENTATION_SLIDESHOW;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_OPENXML_PRESENTATION_SLIDESHOW_MACRO; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENXML_PRESENTATION_SLIDESHOW_MACRO;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_OUTLOOK_MSG; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OUTLOOK_MSG;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_DITA; import static org.alfresco.transform.common.Mimetype.MIMETYPE_DITA;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_TEXT_PLAIN; import static org.alfresco.transform.common.Mimetype.MIMETYPE_TEXT_PLAIN;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_SXI; import static org.alfresco.transform.common.Mimetype.MIMETYPE_SXI;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_SXC; import static org.alfresco.transform.common.Mimetype.MIMETYPE_SXC;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_STW; import static org.alfresco.transform.common.Mimetype.MIMETYPE_STW;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_STI; import static org.alfresco.transform.common.Mimetype.MIMETYPE_STI;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_STC; import static org.alfresco.transform.common.Mimetype.MIMETYPE_STC;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.fail; import static org.junit.jupiter.api.Assertions.fail;
import static org.springframework.http.HttpStatus.OK; import static org.springframework.http.HttpStatus.OK;

View File

@@ -2,7 +2,7 @@
* #%L * #%L
* Alfresco Transform Core * Alfresco Transform Core
* %% * %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited * Copyright (C) 2005 - 2022 Alfresco Software Limited
* %% * %%
* This file is part of the Alfresco software. * This file is part of the Alfresco software.
* - * -
@@ -28,7 +28,7 @@ package org.alfresco.transformer.executors;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.sun.star.task.ErrorCodeIOException; import com.sun.star.task.ErrorCodeIOException;
import org.alfresco.transform.exceptions.TransformException; import org.alfresco.transform.common.TransformException;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.pdfbox.pdmodel.PDDocument; import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.pdmodel.PDPage; import org.apache.pdfbox.pdmodel.PDPage;

View File

@@ -36,8 +36,8 @@ import java.io.File;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_HTML; import static org.alfresco.transform.common.Mimetype.MIMETYPE_HTML;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_TEXT_PLAIN; import static org.alfresco.transform.common.Mimetype.MIMETYPE_TEXT_PLAIN;
import static org.alfresco.transformer.util.RequestParamMap.SOURCE_ENCODING; import static org.alfresco.transformer.util.RequestParamMap.SOURCE_ENCODING;
import static org.alfresco.transformer.util.RequestParamMap.TRANSFORM_NAME_PARAMETER; import static org.alfresco.transformer.util.RequestParamMap.TRANSFORM_NAME_PARAMETER;

View File

@@ -27,15 +27,15 @@
package org.alfresco.transformer; package org.alfresco.transformer;
import static java.nio.charset.StandardCharsets.UTF_8; import static java.nio.charset.StandardCharsets.UTF_8;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_HTML; import static org.alfresco.transform.common.Mimetype.MIMETYPE_HTML;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_IMAGE_JPEG; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_JPEG;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_IWORK_KEYNOTE; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IWORK_KEYNOTE;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_IWORK_NUMBERS; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IWORK_NUMBERS;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_OPENXML_WORDPROCESSING; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENXML_WORDPROCESSING;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_PDF; import static org.alfresco.transform.common.Mimetype.MIMETYPE_PDF;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_RFC822; import static org.alfresco.transform.common.Mimetype.MIMETYPE_RFC822;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_TEXT_PLAIN; import static org.alfresco.transform.common.Mimetype.MIMETYPE_TEXT_PLAIN;
import static org.alfresco.transform.client.util.RequestParamMap.ENDPOINT_TRANSFORM; import static org.alfresco.transform.common.RequestParamMap.ENDPOINT_TRANSFORM;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.assertTrue;

View File

@@ -2,7 +2,7 @@
* #%L * #%L
* Alfresco Transform Core * Alfresco Transform Core
* %% * %%
* Copyright (C) 2005 - 2021 Alfresco Software Limited * Copyright (C) 2005 - 2022 Alfresco Software Limited
* %% * %%
* This file is part of the Alfresco software. * This file is part of the Alfresco software.
* - * -
@@ -26,9 +26,9 @@
*/ */
package org.alfresco.transformer; package org.alfresco.transformer;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_HTML; import static org.alfresco.transform.common.Mimetype.MIMETYPE_HTML;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_RFC822; import static org.alfresco.transform.common.Mimetype.MIMETYPE_RFC822;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_XHTML; import static org.alfresco.transform.common.Mimetype.MIMETYPE_XHTML;
import static org.alfresco.transformer.TestFileInfo.testFile; import static org.alfresco.transformer.TestFileInfo.testFile;
import java.util.stream.Stream; import java.util.stream.Stream;

View File

@@ -2,7 +2,7 @@
* #%L * #%L
* Alfresco Transform Core * Alfresco Transform Core
* %% * %%
* Copyright (C) 2005 - 2021 Alfresco Software Limited * Copyright (C) 2005 - 2022 Alfresco Software Limited
* %% * %%
* This file is part of the Alfresco software. * This file is part of the Alfresco software.
* - * -
@@ -26,8 +26,8 @@
*/ */
package org.alfresco.transformer; package org.alfresco.transformer;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_HTML; import static org.alfresco.transform.common.Mimetype.MIMETYPE_HTML;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_TEXT_PLAIN; import static org.alfresco.transform.common.Mimetype.MIMETYPE_TEXT_PLAIN;
import java.util.UUID; import java.util.UUID;

View File

@@ -2,7 +2,7 @@
* #%L * #%L
* Alfresco Transform Core * Alfresco Transform Core
* %% * %%
* Copyright (C) 2005 - 2021 Alfresco Software Limited * Copyright (C) 2005 - 2022 Alfresco Software Limited
* %% * %%
* This file is part of the Alfresco software. * This file is part of the Alfresco software.
* - * -
@@ -29,31 +29,31 @@ package org.alfresco.transformer;
import static java.text.MessageFormat.format; import static java.text.MessageFormat.format;
import static java.util.function.Function.identity; import static java.util.function.Function.identity;
import static java.util.stream.Collectors.toMap; import static java.util.stream.Collectors.toMap;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_DITA; import static org.alfresco.transform.common.Mimetype.MIMETYPE_DITA;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_EXCEL; import static org.alfresco.transform.common.Mimetype.MIMETYPE_EXCEL;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_HTML; import static org.alfresco.transform.common.Mimetype.MIMETYPE_HTML;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_IMAGE_GIF; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_GIF;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_IMAGE_JPEG; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_JPEG;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_IMAGE_PNG; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_PNG;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_IMAGE_TIFF; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_TIFF;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_IWORK_KEYNOTE; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IWORK_KEYNOTE;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_IWORK_NUMBERS; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IWORK_NUMBERS;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_IWORK_PAGES; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IWORK_PAGES;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_JAVASCRIPT; import static org.alfresco.transform.common.Mimetype.MIMETYPE_JAVASCRIPT;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_OPENXML_PRESENTATION; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENXML_PRESENTATION;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_OPENXML_SPREADSHEET; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENXML_SPREADSHEET;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_OPENXML_WORDPROCESSING; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENXML_WORDPROCESSING;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_OUTLOOK_MSG; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OUTLOOK_MSG;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_PDF; import static org.alfresco.transform.common.Mimetype.MIMETYPE_PDF;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_PPT; import static org.alfresco.transform.common.Mimetype.MIMETYPE_PPT;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_RFC822; import static org.alfresco.transform.common.Mimetype.MIMETYPE_RFC822;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_TEXT_CSS; import static org.alfresco.transform.common.Mimetype.MIMETYPE_TEXT_CSS;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_TEXT_CSV; import static org.alfresco.transform.common.Mimetype.MIMETYPE_TEXT_CSV;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_TEXT_JAVASCRIPT; import static org.alfresco.transform.common.Mimetype.MIMETYPE_TEXT_JAVASCRIPT;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_TEXT_MEDIAWIKI; import static org.alfresco.transform.common.Mimetype.MIMETYPE_TEXT_MEDIAWIKI;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_TEXT_PLAIN; import static org.alfresco.transform.common.Mimetype.MIMETYPE_TEXT_PLAIN;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_WORD; import static org.alfresco.transform.common.Mimetype.MIMETYPE_WORD;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_XML; import static org.alfresco.transform.common.Mimetype.MIMETYPE_XML;
import static org.alfresco.transformer.EngineClient.sendTRequest; import static org.alfresco.transformer.EngineClient.sendTRequest;
import static org.alfresco.transformer.TestFileInfo.testFile; import static org.alfresco.transformer.TestFileInfo.testFile;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;

View File

@@ -2,7 +2,7 @@
* #%L * #%L
* Alfresco Transform Core * Alfresco Transform Core
* %% * %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited * Copyright (C) 2005 - 2022 Alfresco Software Limited
* %% * %%
* This file is part of the Alfresco software. * This file is part of the Alfresco software.
* - * -
@@ -41,7 +41,7 @@ import java.nio.file.StandardCopyOption;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_IMAGE_JPEG; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_JPEG;
/** /**
* Converts Apple iWorks files to JPEGs for thumbnailing and previewing. * Converts Apple iWorks files to JPEGs for thumbnailing and previewing.

View File

@@ -2,7 +2,7 @@
* #%L * #%L
* Alfresco Transform Core * Alfresco Transform Core
* %% * %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited * Copyright (C) 2005 - 2022 Alfresco Software Limited
* %% * %%
* This file is part of the Alfresco software. * This file is part of the Alfresco software.
* - * -
@@ -48,9 +48,9 @@ import java.io.Writer;
import java.util.Map; import java.util.Map;
import java.util.Properties; import java.util.Properties;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_HTML; import static org.alfresco.transform.common.Mimetype.MIMETYPE_HTML;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_MULTIPART_ALTERNATIVE; import static org.alfresco.transform.common.Mimetype.MIMETYPE_MULTIPART_ALTERNATIVE;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_TEXT_PLAIN; import static org.alfresco.transform.common.Mimetype.MIMETYPE_TEXT_PLAIN;
/** /**
* Uses javax.mail.MimeMessage to generate plain text versions of RFC822 email * Uses javax.mail.MimeMessage to generate plain text versions of RFC822 email

View File

@@ -42,7 +42,7 @@ import java.nio.charset.Charset;
import java.nio.charset.IllegalCharsetNameException; import java.nio.charset.IllegalCharsetNameException;
import java.util.Map; import java.util.Map;
import static org.alfresco.transform.client.util.RequestParamMap.SOURCE_ENCODING; import static org.alfresco.transform.common.RequestParamMap.SOURCE_ENCODING;
/** /**
* Content transformer which wraps the HTML Parser library for * Content transformer which wraps the HTML Parser library for

View File

@@ -42,8 +42,8 @@ import java.nio.charset.Charset;
import java.nio.charset.IllegalCharsetNameException; import java.nio.charset.IllegalCharsetNameException;
import java.util.Map; import java.util.Map;
import static org.alfresco.transform.client.util.RequestParamMap.SOURCE_ENCODING; import static org.alfresco.transform.common.RequestParamMap.SOURCE_ENCODING;
import static org.alfresco.transform.client.util.RequestParamMap.TARGET_ENCODING; import static org.alfresco.transform.common.RequestParamMap.TARGET_ENCODING;
/** /**
* Converts any textual format to plain text. * Converts any textual format to plain text.

View File

@@ -50,7 +50,7 @@ import java.nio.charset.Charset;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import static org.alfresco.transform.client.util.RequestParamMap.SOURCE_ENCODING; import static org.alfresco.transform.common.RequestParamMap.SOURCE_ENCODING;
/** /**
* <p> * <p>

View File

@@ -35,7 +35,7 @@ import java.nio.file.Files;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import static org.alfresco.transform.client.util.RequestParamMap.SOURCE_ENCODING; import static org.alfresco.transform.common.RequestParamMap.SOURCE_ENCODING;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
public class HtmlParserContentTransformerTest public class HtmlParserContentTransformerTest

View File

@@ -2,7 +2,7 @@
* #%L * #%L
* Alfresco Transform Core * Alfresco Transform Core
* %% * %%
* Copyright (C) 2005 - 2021 Alfresco Software Limited * Copyright (C) 2005 - 2022 Alfresco Software Limited
* %% * %%
* This file is part of the Alfresco software. * This file is part of the Alfresco software.
* - * -
@@ -263,7 +263,7 @@ public class TextToPdfContentTransformerTest
l = is.read(bytes); l = is.read(bytes);
off = 0; off = 0;
// When we read the first block, change the offset if we don't want the BOM and also work out // When we read the first block, change the offset if we don't want the BOM and also work out
// if the byte endian need to be switch. The source bytes allways start with a standard BOM. // if the byte endian need to be switch. The source bytes always start with a standard BOM.
if (firstRead) if (firstRead)
{ {
firstRead = false; firstRead = false;

View File

@@ -21,7 +21,7 @@
*/ */
package org.alfresco.transform.client.model; package org.alfresco.transform.client.model;
import org.alfresco.transform.router.TransformStack; import org.alfresco.transform.messages.TransformStack;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
@@ -34,6 +34,8 @@ import java.util.Map;
* @author Denis Ungureanu * @author Denis Ungureanu
* created on 10/01/2019 * created on 10/01/2019
*/ */
// This class is in the package org.alfresco.transform.messages in HxP because that is more readable, but in
// org.alfresco.transform.client.model in Alfresco for backward compatibility.
public class InternalContext implements Serializable public class InternalContext implements Serializable
{ {
private MultiStep multiStep; private MultiStep multiStep;

View File

@@ -1,364 +0,0 @@
/*
* #%L
* Alfresco Transform Model
* %%
* Copyright (C) 2005 - 2019 Alfresco Software Limited
* %%
* This program 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.
*
* This program 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 General Lesser Public License for more details.
*
* You should have received a copy of the GNU General Lesser Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/lgpl-3.0.html>.
* #L%
*/
package org.alfresco.transform.client.model;
import static java.util.Arrays.stream;
import static java.util.Collections.unmodifiableSet;
import static java.util.stream.Collectors.toSet;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.Objects;
import java.util.Set;
/**
* Mimetype
* <p>
* The same mimetypes defined in org.alfresco.repo.content.MimetypeMap
*/
public class Mimetype
{
//region Prefixes
public static final String PREFIX_APPLICATION = "application/";
public static final String PREFIX_AUDIO = "audio/";
public static final String PREFIX_IMAGE = "image/";
public static final String PREFIX_MESSAGE = "message/";
public static final String PREFIX_MODEL = "model/";
public static final String PREFIX_MULTIPART = "multipart/";
public static final String PREFIX_TEXT = "text/";
public static final String PREFIX_VIDEO = "video/";
public static final String EXTENSION_BINARY = "bin";
public static final String MACOS_RESOURCE_FORK_FILE_NAME_PREFIX = "._";
//endregion
//region Misc
public static final String MIMETYPE_MULTIPART_ALTERNATIVE = "multipart/alternative";
public static final String MIMETYPE_TEXT_PLAIN = "text/plain";
public static final String MIMETYPE_TEXT_MEDIAWIKI = "text/mediawiki";
public static final String MIMETYPE_TEXT_CSS = "text/css";
public static final String MIMETYPE_TEXT_CSV = "text/csv";
public static final String MIMETYPE_TEXT_JAVASCRIPT = "text/javascript";
public static final String MIMETYPE_XML = "text/xml";
public static final String MIMETYPE_HTML = "text/html";
public static final String MIMETYPE_XHTML = "application/xhtml+xml";
public static final String MIMETYPE_PDF = "application/pdf";
public static final String MIMETYPE_JSON = "application/json";
public static final String MIMETYPE_WORD = "application/msword";
public static final String MIMETYPE_EXCEL = "application/vnd.ms-excel";
public static final String MIMETYPE_BINARY = "application/octet-stream";
public static final String MIMETYPE_PPT = "application/vnd.ms-powerpoint";
public static final String MIMETYPE_APP_DWG = "application/dwg";
public static final String MIMETYPE_IMG_DWG = "image/vnd.dwg";
public static final String MIMETYPE_VIDEO_AVI = "video/x-msvideo";
public static final String MIMETYPE_VIDEO_QUICKTIME = "video/quicktime";
public static final String MIMETYPE_VIDEO_WMV = "video/x-ms-wmv";
public static final String MIMETYPE_VIDEO_3GP = "video/3gpp";
public static final String MIMETYPE_VIDEO_3GP2 = "video/3gpp2";
public static final String MIMETYPE_DITA = "application/dita+xml";
//endregion
//region Flash
public static final String MIMETYPE_FLASH = "application/x-shockwave-flash";
public static final String MIMETYPE_VIDEO_FLV = "video/x-flv";
public static final String MIMETYPE_APPLICATION_FLA = "application/x-fla";
public static final String MIMETYPE_VIDEO_MPG = "video/mpeg";
public static final String MIMETYPE_VIDEO_MP4 = "video/mp4";
public static final String MIMETYPE_IMAGE_GIF = "image/gif";
public static final String MIMETYPE_IMAGE_JPEG = "image/jpeg";
public static final String MIMETYPE_IMAGE_RGB = "image/x-rgb";
public static final String MIMETYPE_IMAGE_SVG = "image/svg+xml";
public static final String MIMETYPE_IMAGE_PNG = "image/png";
public static final String MIMETYPE_IMAGE_TIFF = "image/tiff";
public static final String MIMETYPE_IMAGE_RAW_DNG = "image/x-raw-adobe";
public static final String MIMETYPE_IMAGE_RAW_3FR = "image/x-raw-hasselblad";
public static final String MIMETYPE_IMAGE_RAW_RAF = "image/x-raw-fuji";
public static final String MIMETYPE_IMAGE_RAW_CR2 = "image/x-raw-canon";
public static final String MIMETYPE_IMAGE_RAW_K25 = "image/x-raw-kodak";
public static final String MIMETYPE_IMAGE_RAW_MRW = "image/x-raw-minolta";
public static final String MIMETYPE_IMAGE_RAW_NEF = "image/x-raw-nikon";
public static final String MIMETYPE_IMAGE_RAW_ORF = "image/x-raw-olympus";
public static final String MIMETYPE_IMAGE_RAW_PEF = "image/x-raw-pentax";
public static final String MIMETYPE_IMAGE_RAW_ARW = "image/x-raw-sony";
public static final String MIMETYPE_IMAGE_RAW_X3F = "image/x-raw-sigma";
public static final String MIMETYPE_IMAGE_RAW_RW2 = "image/x-raw-panasonic";
public static final String MIMETYPE_IMAGE_RAW_RWL = "image/x-raw-leica";
public static final String MIMETYPE_IMAGE_RAW_R3D = "image/x-raw-red";
public static final String MIMETYPE_IMAGE_DWT = "image/x-dwt";
public static final String MIMETYPE_APPLICATION_EPS = "application/eps";
public static final String MIMETYPE_APPLICATION_PS = "application/postscript";
public static final String MIMETYPE_JAVASCRIPT = "application/x-javascript";
public static final String MIMETYPE_ZIP = "application/zip";
public static final String MIMETYPE_OPENSEARCH_DESCRIPTION = "application/opensearchdescription+xml";
public static final String MIMETYPE_ATOM = "application/atom+xml";
public static final String MIMETYPE_RSS = "application/rss+xml";
public static final String MIMETYPE_RFC822 = "message/rfc822";
public static final String MIMETYPE_OUTLOOK_MSG = "application/vnd.ms-outlook";
public static final String MIMETYPE_VISIO = "application/vnd.visio";
public static final String MIMETYPE_VISIO_2013 = "application/vnd.visio2013";
//endregion
//region Adobe
public static final String MIMETYPE_APPLICATION_ILLUSTRATOR = "application/illustrator";
public static final String MIMETYPE_APPLICATION_PHOTOSHOP = "image/vnd.adobe.photoshop";
//endregion
//region Encrypted office document
public static final String MIMETYPE_ENCRYPTED_OFFICE = "application/x-tika-ooxml-protected";
//endregion
//region Open Document
public static final String MIMETYPE_OPENDOCUMENT_TEXT = "application/vnd.oasis.opendocument.text";
public static final String MIMETYPE_OPENDOCUMENT_TEXT_TEMPLATE = "application/vnd.oasis.opendocument.text-template";
public static final String MIMETYPE_OPENDOCUMENT_GRAPHICS = "application/vnd.oasis.opendocument.graphics";
public static final String MIMETYPE_OPENDOCUMENT_GRAPHICS_TEMPLATE = "application/vnd.oasis.opendocument.graphics-template";
public static final String MIMETYPE_OPENDOCUMENT_PRESENTATION = "application/vnd.oasis.opendocument.presentation";
public static final String MIMETYPE_OPENDOCUMENT_PRESENTATION_TEMPLATE = "application/vnd.oasis.opendocument.presentation-template";
public static final String MIMETYPE_OPENDOCUMENT_SPREADSHEET = "application/vnd.oasis.opendocument.spreadsheet";
public static final String MIMETYPE_OPENDOCUMENT_SPREADSHEET_TEMPLATE = "application/vnd.oasis.opendocument.spreadsheet-template";
public static final String MIMETYPE_OPENDOCUMENT_CHART = "application/vnd.oasis.opendocument.chart";
public static final String MIMETYPE_OPENDOCUMENT_CHART_TEMPLATE = "applicationvnd.oasis.opendocument.chart-template";
public static final String MIMETYPE_OPENDOCUMENT_IMAGE = "application/vnd.oasis.opendocument.image";
public static final String MIMETYPE_OPENDOCUMENT_IMAGE_TEMPLATE = "applicationvnd.oasis.opendocument.image-template";
public static final String MIMETYPE_OPENDOCUMENT_FORMULA = "application/vnd.oasis.opendocument.formula";
public static final String MIMETYPE_OPENDOCUMENT_FORMULA_TEMPLATE = "applicationvnd.oasis.opendocument.formula-template";
public static final String MIMETYPE_OPENDOCUMENT_TEXT_MASTER = "application/vnd.oasis.opendocument.text-master";
public static final String MIMETYPE_OPENDOCUMENT_TEXT_WEB = "application/vnd.oasis.opendocument.text-web";
public static final String MIMETYPE_OPENDOCUMENT_DATABASE = "application/vnd.oasis.opendocument.database";
//endregion
//region Open Office
public static final String MIMETYPE_OPENOFFICE1_WRITER = "application/vnd.sun.xml.writer";
public static final String MIMETYPE_OPENOFFICE1_CALC = "application/vnd.sun.xml.calc";
public static final String MIMETYPE_OPENOFFICE1_DRAW = "application/vnd.sun.xml.draw";
public static final String MIMETYPE_OPENOFFICE1_IMPRESS = "application/vnd.sun.xml.impress";
//endregion
//region Open XML
public static final String MIMETYPE_OPENXML_WORDPROCESSING = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
public static final String MIMETYPE_OPENXML_WORDPROCESSING_MACRO = "application/vnd.ms-word.document.macroenabled.12";
public static final String MIMETYPE_OPENXML_WORD_TEMPLATE = "application/vnd.openxmlformats-officedocument.wordprocessingml.template";
public static final String MIMETYPE_OPENXML_WORD_TEMPLATE_MACRO = "application/vnd.ms-word.template.macroenabled.12";
public static final String MIMETYPE_OPENXML_SPREADSHEET = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
public static final String MIMETYPE_OPENXML_SPREADSHEET_TEMPLATE = "application/vnd.openxmlformats-officedocument.spreadsheetml.template";
public static final String MIMETYPE_OPENXML_SPREADSHEET_MACRO = "application/vnd.ms-excel.sheet.macroenabled.12";
public static final String MIMETYPE_OPENXML_SPREADSHEET_TEMPLATE_MACRO = "application/vnd.ms-excel.template.macroenabled.12";
public static final String MIMETYPE_OPENXML_SPREADSHEET_ADDIN_MACRO = "application/vnd.ms-excel.addin.macroenabled.12";
public static final String MIMETYPE_OPENXML_SPREADSHEET_BINARY_MACRO = "application/vnd.ms-excel.sheet.binary.macroenabled.12";
public static final String MIMETYPE_OPENXML_PRESENTATION = "application/vnd.openxmlformats-officedocument.presentationml.presentation";
public static final String MIMETYPE_OPENXML_PRESENTATION_MACRO = "application/vnd.ms-powerpoint.presentation.macroenabled.12";
public static final String MIMETYPE_OPENXML_PRESENTATION_SLIDESHOW = "application/vnd.openxmlformats-officedocument.presentationml.slideshow";
public static final String MIMETYPE_OPENXML_PRESENTATION_SLIDESHOW_MACRO = "application/vnd.ms-powerpoint.slideshow.macroenabled.12";
public static final String MIMETYPE_OPENXML_PRESENTATION_TEMPLATE = "application/vnd.openxmlformats-officedocument.presentationml.template";
public static final String MIMETYPE_OPENXML_PRESENTATION_TEMPLATE_MACRO = "application/vnd.ms-powerpoint.template.macroenabled.12";
public static final String MIMETYPE_OPENXML_PRESENTATION_ADDIN = "application/vnd.ms-powerpoint.addin.macroenabled.12";
public static final String MIMETYPE_OPENXML_PRESENTATION_SLIDE = "application/vnd.openxmlformats-officedocument.presentationml.slide";
public static final String MIMETYPE_OPENXML_PRESENTATION_SLIDE_MACRO = "application/vnd.ms-powerpoint.slide.macroenabled.12";
//endregion
//region Star Office
public static final String MIMETYPE_STAROFFICE5_DRAW = "application/vnd.stardivision.draw";
public static final String MIMETYPE_STAROFFICE5_CALC = "application/vnd.stardivision.calc";
public static final String MIMETYPE_STAROFFICE5_IMPRESS = "application/vnd.stardivision.impress";
public static final String MIMETYPE_STAROFFICE5_IMPRESS_PACKED = "application/vnd.stardivision.impress-packed";
public static final String MIMETYPE_STAROFFICE5_CHART = "application/vnd.stardivision.chart";
public static final String MIMETYPE_STAROFFICE5_WRITER = "application/vnd.stardivision.writer";
public static final String MIMETYPE_STAROFFICE5_WRITER_GLOBAL = "application/vnd.stardivision.writer-global";
public static final String MIMETYPE_STAROFFICE5_MATH = "application/vnd.stardivision.math";
//endregion
//region Apple iWorks
public static final String MIMETYPE_IWORK_KEYNOTE = "application/vnd.apple.keynote";
public static final String MIMETYPE_IWORK_NUMBERS = "application/vnd.apple.numbers";
public static final String MIMETYPE_IWORK_PAGES = "application/vnd.apple.pages";
//endregion
//region MACOS
public static final String MIMETYPE_APPLEFILE = "application/applefile";
//endregion
//region WordPerfect
public static final String MIMETYPE_WORDPERFECT = "application/wordperfect";
//endregion
//region Audio
public static final String MIMETYPE_MP3 = "audio/mpeg";
public static final String MIMETYPE_AUDIO_MP4 = "audio/mp4";
public static final String MIMETYPE_VORBIS = "audio/vorbis";
public static final String MIMETYPE_FLAC = "audio/x-flac";
//endregion
//region Alfresco
public static final String MIMETYPE_ACP = "application/acp";
//region other
public static final String MIMETYPE_PBM = "image/x-portable-bitmap";
public static final String MIMETYPE_PNM = "image/x-portable-anymap";
public static final String MIMETYPE_XBM = "image/x-xbitmap";
public static final String MIMETYPE_XPM = "image/x-xpixmap";
public static final String MIMETYPE_Z = "application/x-compress";
public static final String MIMETYPE_PPM = "image/x-portable-pixmap";
public static final String MIMETYPE_TAR = "application/x-tar";
public static final String MIMETYPE_OGG = "application/ogg";
//endregion
private static final Set<String> ALL_MIMETYPES;
static
{
ALL_MIMETYPES = unmodifiableSet(stream(Mimetype.class.getDeclaredFields())
.filter(f -> Modifier.isPublic(f.getModifiers()))
.filter(f -> Modifier.isStatic(f.getModifiers()))
.filter(f -> Modifier.isFinal(f.getModifiers()))
.filter(f -> f.getType().isAssignableFrom(String.class))
.filter(f -> f.getName().startsWith("MIMETYPE_"))
.peek(f -> f.setAccessible(true))
.map(Mimetype::getFieldValue)
.filter(Objects::nonNull)
.collect(toSet()));
}
private static String getFieldValue(final Field f)
{
try
{
return (String) f.get(null);
}
catch (Exception e)
{
throw new RuntimeException(e);
}
}
public static Set<String> matchMimetypes(final String regex)
{
return unmodifiableSet(ALL_MIMETYPES
.stream()
.filter(t -> t.matches(regex))
.collect(toSet()));
}
}

View File

@@ -2,7 +2,7 @@
* #%L * #%L
* Alfresco Transform Model * Alfresco Transform Model
* %% * %%
* Copyright (C) 2005 - 2019 Alfresco Software Limited * Copyright (C) 2005 - 2022 Alfresco Software Limited
* %% * %%
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as * it under the terms of the GNU Lesser General Public License as
@@ -31,6 +31,8 @@ import java.util.List;
* @author Lucian Tuca * @author Lucian Tuca
* created on 19/12/2018 * created on 19/12/2018
*/ */
// This class is in the package org.alfresco.transform.messages in HxP because that is more readable, but in
// org.alfresco.transform.client.model in Alfresco for backward compatibility.
public class MultiStep implements Serializable public class MultiStep implements Serializable
{ {
private String initialRequestId; private String initialRequestId;

View File

@@ -2,7 +2,7 @@
* #%L * #%L
* Alfresco Transform Model * Alfresco Transform Model
* %% * %%
* Copyright (C) 2005 - 2019 Alfresco Software Limited * Copyright (C) 2005 - 2022 Alfresco Software Limited
* %% * %%
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as * it under the terms of the GNU Lesser General Public License as
@@ -24,6 +24,8 @@ package org.alfresco.transform.client.model;
import java.io.Serializable; import java.io.Serializable;
import java.util.Objects; import java.util.Objects;
// This class is in the package org.alfresco.transform.messages in HxP because that is more readable, but in
// org.alfresco.transform.client.model in Alfresco for backward compatibility.
public class TransformReply implements Serializable public class TransformReply implements Serializable
{ {
private String requestId; private String requestId;

View File

@@ -2,7 +2,7 @@
* #%L * #%L
* Alfresco Transform Model * Alfresco Transform Model
* %% * %%
* Copyright (C) 2005 - 2019 Alfresco Software Limited * Copyright (C) 2005 - 2022 Alfresco Software Limited
* %% * %%
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as * it under the terms of the GNU Lesser General Public License as
@@ -26,6 +26,8 @@ import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.Objects; import java.util.Objects;
// This class is in the package org.alfresco.transform.messages in HxP because that is more readable, but in
// org.alfresco.transform.client.model in Alfresco for backward compatibility.
public class TransformRequest implements Serializable public class TransformRequest implements Serializable
{ {
private String requestId; private String requestId;

View File

@@ -19,47 +19,47 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
* #L% * #L%
*/ */
package org.alfresco.transform.router; package org.alfresco.transform.common;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_DITA; import static org.alfresco.transform.common.Mimetype.MIMETYPE_DITA;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_EXCEL; import static org.alfresco.transform.common.Mimetype.MIMETYPE_EXCEL;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_IMAGE_SVG; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_SVG;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_OPENDOCUMENT_GRAPHICS; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENDOCUMENT_GRAPHICS;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_OPENDOCUMENT_PRESENTATION; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENDOCUMENT_PRESENTATION;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_OPENDOCUMENT_PRESENTATION_TEMPLATE; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENDOCUMENT_PRESENTATION_TEMPLATE;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_OPENDOCUMENT_SPREADSHEET; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENDOCUMENT_SPREADSHEET;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_OPENDOCUMENT_SPREADSHEET_TEMPLATE; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENDOCUMENT_SPREADSHEET_TEMPLATE;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_OPENDOCUMENT_TEXT; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENDOCUMENT_TEXT;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_OPENDOCUMENT_TEXT_TEMPLATE; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENDOCUMENT_TEXT_TEMPLATE;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_OPENOFFICE1_CALC; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENOFFICE1_CALC;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_OPENOFFICE1_IMPRESS; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENOFFICE1_IMPRESS;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_OPENOFFICE1_WRITER; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENOFFICE1_WRITER;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_OPENXML_PRESENTATION; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENXML_PRESENTATION;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_OPENXML_PRESENTATION_ADDIN; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENXML_PRESENTATION_ADDIN;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_OPENXML_PRESENTATION_MACRO; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENXML_PRESENTATION_MACRO;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_OPENXML_PRESENTATION_SLIDE; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENXML_PRESENTATION_SLIDE;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_OPENXML_PRESENTATION_SLIDESHOW; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENXML_PRESENTATION_SLIDESHOW;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_OPENXML_PRESENTATION_SLIDE_MACRO; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENXML_PRESENTATION_SLIDE_MACRO;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_OPENXML_PRESENTATION_TEMPLATE; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENXML_PRESENTATION_TEMPLATE;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_OPENXML_PRESENTATION_TEMPLATE_MACRO; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENXML_PRESENTATION_TEMPLATE_MACRO;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_OPENXML_SPREADSHEET; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENXML_SPREADSHEET;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_OPENXML_SPREADSHEET_BINARY_MACRO; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENXML_SPREADSHEET_BINARY_MACRO;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_OPENXML_SPREADSHEET_MACRO; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENXML_SPREADSHEET_MACRO;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_OPENXML_SPREADSHEET_TEMPLATE; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENXML_SPREADSHEET_TEMPLATE;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_OPENXML_SPREADSHEET_TEMPLATE_MACRO; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENXML_SPREADSHEET_TEMPLATE_MACRO;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_OPENXML_WORDPROCESSING; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENXML_WORDPROCESSING;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_OPENXML_WORDPROCESSING_MACRO; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENXML_WORDPROCESSING_MACRO;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_OPENXML_WORD_TEMPLATE; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENXML_WORD_TEMPLATE;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_OPENXML_WORD_TEMPLATE_MACRO; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENXML_WORD_TEMPLATE_MACRO;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_OUTLOOK_MSG; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OUTLOOK_MSG;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_PPT; import static org.alfresco.transform.common.Mimetype.MIMETYPE_PPT;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_VISIO; import static org.alfresco.transform.common.Mimetype.MIMETYPE_VISIO;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_VISIO_2013; import static org.alfresco.transform.common.Mimetype.MIMETYPE_VISIO_2013;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_WORD; import static org.alfresco.transform.common.Mimetype.MIMETYPE_WORD;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_WORDPERFECT; import static org.alfresco.transform.common.Mimetype.MIMETYPE_WORDPERFECT;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_TEXT_PLAIN; import static org.alfresco.transform.common.Mimetype.MIMETYPE_TEXT_PLAIN;
import static org.alfresco.transform.router.TransformerDebug.MIMETYPE_METADATA_EMBED; import static org.alfresco.transform.common.TransformerDebug.MIMETYPE_METADATA_EMBED;
import static org.alfresco.transform.router.TransformerDebug.MIMETYPE_METADATA_EXTRACT; import static org.alfresco.transform.common.TransformerDebug.MIMETYPE_METADATA_EXTRACT;
import java.util.Map; import java.util.Map;

View File

@@ -1,190 +1,192 @@
/* /*
* #%L * #%L
* Alfresco Transform Core * Alfresco Transform Model
* %% * %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited * Copyright (C) 2005 - 2022 Alfresco Software Limited
* %% * %%
* This file is part of the Alfresco software. * This program is free software: you can redistribute it and/or modify
* - * it under the terms of the GNU Lesser General Public License as
* If the software was purchased under a paid Alfresco license, the terms of * published by the Free Software Foundation, either version 3 of the
* the paid license agreement will prevail. Otherwise, the software is * License, or (at your option) any later version.
* provided under the following open source license terms: *
* - * This program is distributed in the hope that it will be useful,
* 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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details. * GNU General Lesser Public License for more details.
* - *
* You should have received a copy of the GNU Lesser General Public License * You should have received a copy of the GNU General Lesser Public
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>. * License along with this program. If not, see
* <http://www.gnu.org/licenses/lgpl-3.0.html>.
* #L% * #L%
*/ */
package org.alfresco.transformer.util; package org.alfresco.transform.common;
import static java.util.Arrays.stream;
import static java.util.Collections.unmodifiableSet;
import static java.util.stream.Collectors.toSet;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.Objects;
import java.util.Set;
/** /**
* Partially duplicated from *alfresco-data-model*. * Mimetype
* <p>
* Values from in Alfresco repo org.alfresco.repo.content.MimetypeMap
*/ */
public interface MimetypeMap public interface Mimetype
{ {
String MIMETYPE_METADATA_EXTRACT = "alfresco-metadata-extract"; String MIMETYPE_ACP = "application/acp";
String MIMETYPE_METADATA_EMBED = "alfresco-metadata-embed"; String MIMETYPE_APPLEFILE = "application/applefile";
String MIMETYPE_APPLICATION_EPS = "application/eps";
String PREFIX_APPLICATION = "application/";
String PREFIX_AUDIO = "audio/";
String PREFIX_IMAGE = "image/";
String PREFIX_MESSAGE = "message/";
String PREFIX_MODEL = "model/";
String PREFIX_MULTIPART = "multipart/";
String PREFIX_TEXT = "text/";
String PREFIX_VIDEO = "video/";
String EXTENSION_BINARY = "bin";
String MACOS_RESOURCE_FORK_FILE_NAME_PREFIX = "._";
String MIMETYPE_MULTIPART_ALTERNATIVE = "multipart/alternative";
String MIMETYPE_TEXT_PLAIN = "text/plain";
String MIMETYPE_TEXT_MEDIAWIKI = "text/mediawiki";
String MIMETYPE_TEXT_CSS = "text/css";
String MIMETYPE_TEXT_CSV = "text/csv";
String MIMETYPE_TEXT_JAVASCRIPT = "text/javascript";
String MIMETYPE_XML = "text/xml";
String MIMETYPE_HTML = "text/html";
String MIMETYPE_XHTML = "application/xhtml+xml";
String MIMETYPE_PDF = "application/pdf";
String MIMETYPE_JSON = "application/json";
String MIMETYPE_WORD = "application/msword";
String MIMETYPE_EXCEL = "application/vnd.ms-excel";
String MIMETYPE_BINARY = "application/octet-stream";
String MIMETYPE_PPT = "application/vnd.ms-powerpoint";
String MIMETYPE_RTF = "application/rtf";
String MIMETYPE_TSV = "text/tab-separated-values";
String MIMETYPE_APP_DWG = "application/dwg";
String MIMETYPE_IMG_DWG = "image/vnd.dwg";
String MIMETYPE_VIDEO_AVI = "video/x-msvideo";
String MIMETYPE_VIDEO_QUICKTIME = "video/quicktime";
String MIMETYPE_VIDEO_WMV = "video/x-ms-wmv";
String MIMETYPE_VIDEO_3GP = "video/3gpp";
String MIMETYPE_VIDEO_3GP2 = "video/3gpp2";
String MIMETYPE_DITA = "application/dita+xml";
String MIMETYPE_FLASH = "application/x-shockwave-flash";
String MIMETYPE_VIDEO_FLV = "video/x-flv";
String MIMETYPE_APPLICATION_FLA = "application/x-fla"; String MIMETYPE_APPLICATION_FLA = "application/x-fla";
String MIMETYPE_VIDEO_MPG = "video/mpeg"; String MIMETYPE_APPLICATION_ILLUSTRATOR = "application/illustrator";
String MIMETYPE_VIDEO_MP4 = "video/mp4"; String MIMETYPE_APPLICATION_PHOTOSHOP = "image/vnd.adobe.photoshop";
String MIMETYPE_APPLICATION_PS = "application/postscript";
String MIMETYPE_APP_DWG = "application/dwg";
String MIMETYPE_ATOM = "application/atom+xml";
String MIMETYPE_AUDIO_MP4 = "audio/mp4";
String MIMETYPE_BINARY = "application/octet-stream";
String MIMETYPE_DITA = "application/dita+xml";
String MIMETYPE_ENCRYPTED_OFFICE = "application/x-tika-ooxml-protected";
String MIMETYPE_EXCEL = "application/vnd.ms-excel";
String MIMETYPE_FLAC = "audio/x-flac";
String MIMETYPE_FLASH = "application/x-shockwave-flash";
String MIMETYPE_HTML = "text/html";
String MIMETYPE_IMAGE_BMP = "image/bmp"; String MIMETYPE_IMAGE_BMP = "image/bmp";
String MIMETYPE_IMAGE_CGM = "image/cgm"; String MIMETYPE_IMAGE_CGM = "image/cgm";
String MIMETYPE_IMAGE_DWT = "image/x-dwt";
String MIMETYPE_IMAGE_GIF = "image/gif"; String MIMETYPE_IMAGE_GIF = "image/gif";
String MIMETYPE_IMAGE_IEF = "image/ief"; String MIMETYPE_IMAGE_IEF = "image/ief";
String MIMETYPE_IMAGE_JPEG = "image/jpeg";
String MIMETYPE_IMAGE_JP2 = "image/jp2"; String MIMETYPE_IMAGE_JP2 = "image/jp2";
String MIMETYPE_IMAGE_RGB = "image/x-rgb"; String MIMETYPE_IMAGE_JPEG = "image/jpeg";
String MIMETYPE_IMAGE_SVG = "image/svg+xml";
String MIMETYPE_IMAGE_PBM = "image/x-portable-bitmap"; String MIMETYPE_IMAGE_PBM = "image/x-portable-bitmap";
String MIMETYPE_IMAGE_PGM = "image/x-portable-graymap"; String MIMETYPE_IMAGE_PGM = "image/x-portable-graymap";
String MIMETYPE_IMAGE_PNM = "image/x-portable-anymap";
String MIMETYPE_IMAGE_PNG = "image/png"; String MIMETYPE_IMAGE_PNG = "image/png";
String MIMETYPE_IMAGE_PPM = "image/x-portable-pixmap"; String MIMETYPE_IMAGE_PNM = "image/x-portable-anymap";
String MIMETYPE_IMAGE_PPJ = "image/vnd.adobe.premiere"; String MIMETYPE_IMAGE_PPJ = "image/vnd.adobe.premiere";
String MIMETYPE_IMAGE_PPM = "image/x-portable-pixmap";
String MIMETYPE_IMAGE_PSD = "image/vnd.adobe.photoshop"; String MIMETYPE_IMAGE_PSD = "image/vnd.adobe.photoshop";
String MIMETYPE_IMAGE_RAS = "image/x-cmu-raster"; String MIMETYPE_IMAGE_RAS = "image/x-cmu-raster";
String MIMETYPE_IMAGE_TIFF = "image/tiff";
String MIMETYPE_IMAGE_RAW_DNG = "image/x-raw-adobe";
String MIMETYPE_IMAGE_RAW_3FR = "image/x-raw-hasselblad"; String MIMETYPE_IMAGE_RAW_3FR = "image/x-raw-hasselblad";
String MIMETYPE_IMAGE_RAW_RAF = "image/x-raw-fuji"; String MIMETYPE_IMAGE_RAW_ARW = "image/x-raw-sony";
String MIMETYPE_IMAGE_RAW_CR2 = "image/x-raw-canon"; String MIMETYPE_IMAGE_RAW_CR2 = "image/x-raw-canon";
String MIMETYPE_IMAGE_RAW_DNG = "image/x-raw-adobe";
String MIMETYPE_IMAGE_RAW_K25 = "image/x-raw-kodak"; String MIMETYPE_IMAGE_RAW_K25 = "image/x-raw-kodak";
String MIMETYPE_IMAGE_RAW_MRW = "image/x-raw-minolta"; String MIMETYPE_IMAGE_RAW_MRW = "image/x-raw-minolta";
String MIMETYPE_IMAGE_RAW_NEF = "image/x-raw-nikon"; String MIMETYPE_IMAGE_RAW_NEF = "image/x-raw-nikon";
String MIMETYPE_IMAGE_RAW_ORF = "image/x-raw-olympus"; String MIMETYPE_IMAGE_RAW_ORF = "image/x-raw-olympus";
String MIMETYPE_IMAGE_RAW_PEF = "image/x-raw-pentax"; String MIMETYPE_IMAGE_RAW_PEF = "image/x-raw-pentax";
String MIMETYPE_IMAGE_RAW_ARW = "image/x-raw-sony"; String MIMETYPE_IMAGE_RAW_R3D = "image/x-raw-red";
String MIMETYPE_IMAGE_RAW_X3F = "image/x-raw-sigma"; String MIMETYPE_IMAGE_RAW_RAF = "image/x-raw-fuji";
String MIMETYPE_IMAGE_RAW_RW2 = "image/x-raw-panasonic"; String MIMETYPE_IMAGE_RAW_RW2 = "image/x-raw-panasonic";
String MIMETYPE_IMAGE_RAW_RWL = "image/x-raw-leica"; String MIMETYPE_IMAGE_RAW_RWL = "image/x-raw-leica";
String MIMETYPE_IMAGE_RAW_R3D = "image/x-raw-red"; String MIMETYPE_IMAGE_RAW_X3F = "image/x-raw-sigma";
String MIMETYPE_IMAGE_DWT = "image/x-dwt"; String MIMETYPE_IMAGE_RGB = "image/x-rgb";
String MIMETYPE_IMAGE_SVG = "image/svg+xml";
String MIMETYPE_IMAGE_TIFF = "image/tiff";
String MIMETYPE_IMAGE_XBM = "image/x-xbitmap"; String MIMETYPE_IMAGE_XBM = "image/x-xbitmap";
String MIMETYPE_IMAGE_XPM = "image/x-xpixmap"; String MIMETYPE_IMAGE_XPM = "image/x-xpixmap";
String MIMETYPE_IMAGE_XWD = "image/x-xwindowdump"; String MIMETYPE_IMAGE_XWD = "image/x-xwindowdump";
String MIMETYPE_APPLICATION_EPS = "application/eps"; String MIMETYPE_IMG_DWG = "image/vnd.dwg";
String MIMETYPE_APPLICATION_PS = "application/postscript"; String MIMETYPE_IWORK_KEYNOTE = "application/vnd.apple.keynote";
String MIMETYPE_IWORK_NUMBERS = "application/vnd.apple.numbers";
String MIMETYPE_IWORK_PAGES = "application/vnd.apple.pages";
String MIMETYPE_JAVASCRIPT = "application/x-javascript"; String MIMETYPE_JAVASCRIPT = "application/x-javascript";
String MIMETYPE_ZIP = "application/zip"; String MIMETYPE_JSON = "application/json";
String MIMETYPE_OPENSEARCH_DESCRIPTION = "application/opensearchdescription+xml"; String MIMETYPE_METADATA_EMBED = "alfresco-metadata-embed";
String MIMETYPE_ATOM = "application/atom+xml"; String MIMETYPE_METADATA_EXTRACT = "alfresco-metadata-extract";
String MIMETYPE_RSS = "application/rss+xml"; String MIMETYPE_MP3 = "audio/mpeg";
String MIMETYPE_RFC822 = "message/rfc822"; String MIMETYPE_MULTIPART_ALTERNATIVE = "multipart/alternative";
String MIMETYPE_OUTLOOK_MSG = "application/vnd.ms-outlook"; String MIMETYPE_OGG = "application/ogg";
String MIMETYPE_VISIO = "application/vnd.visio"; String MIMETYPE_OPENDOCUMENT_CHART = "application/vnd.oasis.opendocument.chart";
String MIMETYPE_VISIO_2013 = "application/vnd.visio2013"; String MIMETYPE_OPENDOCUMENT_CHART_TEMPLATE = "applicationvnd.oasis.opendocument.chart-template";
String MIMETYPE_APPLICATION_ILLUSTRATOR = "application/illustrator"; String MIMETYPE_OPENDOCUMENT_DATABASE = "application/vnd.oasis.opendocument.database";
String MIMETYPE_APPLICATION_PHOTOSHOP = "image/vnd.adobe.photoshop"; String MIMETYPE_OPENDOCUMENT_FORMULA = "application/vnd.oasis.opendocument.formula";
String MIMETYPE_ENCRYPTED_OFFICE = "application/x-tika-ooxml-protected"; String MIMETYPE_OPENDOCUMENT_FORMULA_TEMPLATE = "applicationvnd.oasis.opendocument.formula-template";
String MIMETYPE_OPENDOCUMENT_TEXT = "application/vnd.oasis.opendocument.text";
String MIMETYPE_OPENDOCUMENT_TEXT_TEMPLATE = "application/vnd.oasis.opendocument.text-template";
String MIMETYPE_OPENDOCUMENT_GRAPHICS = "application/vnd.oasis.opendocument.graphics"; String MIMETYPE_OPENDOCUMENT_GRAPHICS = "application/vnd.oasis.opendocument.graphics";
String MIMETYPE_OPENDOCUMENT_GRAPHICS_TEMPLATE = "application/vnd.oasis.opendocument.graphics-template"; String MIMETYPE_OPENDOCUMENT_GRAPHICS_TEMPLATE = "application/vnd.oasis.opendocument.graphics-template";
String MIMETYPE_OPENDOCUMENT_IMAGE = "application/vnd.oasis.opendocument.image";
String MIMETYPE_OPENDOCUMENT_IMAGE_TEMPLATE = "applicationvnd.oasis.opendocument.image-template";
String MIMETYPE_OPENDOCUMENT_PRESENTATION = "application/vnd.oasis.opendocument.presentation"; String MIMETYPE_OPENDOCUMENT_PRESENTATION = "application/vnd.oasis.opendocument.presentation";
String MIMETYPE_OPENDOCUMENT_PRESENTATION_TEMPLATE = "application/vnd.oasis.opendocument.presentation-template"; String MIMETYPE_OPENDOCUMENT_PRESENTATION_TEMPLATE = "application/vnd.oasis.opendocument.presentation-template";
String MIMETYPE_OPENDOCUMENT_SPREADSHEET = "application/vnd.oasis.opendocument.spreadsheet"; String MIMETYPE_OPENDOCUMENT_SPREADSHEET = "application/vnd.oasis.opendocument.spreadsheet";
String MIMETYPE_OPENDOCUMENT_SPREADSHEET_TEMPLATE = "application/vnd.oasis.opendocument.spreadsheet-template"; String MIMETYPE_OPENDOCUMENT_SPREADSHEET_TEMPLATE = "application/vnd.oasis.opendocument.spreadsheet-template";
String MIMETYPE_OPENDOCUMENT_CHART = "application/vnd.oasis.opendocument.chart"; String MIMETYPE_OPENDOCUMENT_TEXT = "application/vnd.oasis.opendocument.text";
String MIMETYPE_OPENDOCUMENT_CHART_TEMPLATE = "applicationvnd.oasis.opendocument.chart-template";
String MIMETYPE_OPENDOCUMENT_IMAGE = "application/vnd.oasis.opendocument.image";
String MIMETYPE_OPENDOCUMENT_IMAGE_TEMPLATE = "applicationvnd.oasis.opendocument.image-template";
String MIMETYPE_OPENDOCUMENT_FORMULA = "application/vnd.oasis.opendocument.formula";
String MIMETYPE_OPENDOCUMENT_FORMULA_TEMPLATE = "applicationvnd.oasis.opendocument.formula-template";
String MIMETYPE_OPENDOCUMENT_TEXT_MASTER = "application/vnd.oasis.opendocument.text-master"; String MIMETYPE_OPENDOCUMENT_TEXT_MASTER = "application/vnd.oasis.opendocument.text-master";
String MIMETYPE_OPENDOCUMENT_TEXT_TEMPLATE = "application/vnd.oasis.opendocument.text-template";
String MIMETYPE_OPENDOCUMENT_TEXT_WEB = "application/vnd.oasis.opendocument.text-web"; String MIMETYPE_OPENDOCUMENT_TEXT_WEB = "application/vnd.oasis.opendocument.text-web";
String MIMETYPE_OPENDOCUMENT_DATABASE = "application/vnd.oasis.opendocument.database";
String MIMETYPE_OPENOFFICE1_WRITER = "application/vnd.sun.xml.writer";
String MIMETYPE_OPENOFFICE1_CALC = "application/vnd.sun.xml.calc"; String MIMETYPE_OPENOFFICE1_CALC = "application/vnd.sun.xml.calc";
String MIMETYPE_OPENOFFICE1_DRAW = "application/vnd.sun.xml.draw"; String MIMETYPE_OPENOFFICE1_DRAW = "application/vnd.sun.xml.draw";
String MIMETYPE_OPENOFFICE1_IMPRESS = "application/vnd.sun.xml.impress"; String MIMETYPE_OPENOFFICE1_IMPRESS = "application/vnd.sun.xml.impress";
String MIMETYPE_OPENOFFICE1_WRITER = "application/vnd.sun.xml.writer";
String MIMETYPE_OPENSEARCH_DESCRIPTION = "application/opensearchdescription+xml";
String MIMETYPE_OPENXML_PRESENTATION = "application/vnd.openxmlformats-officedocument.presentationml.presentation";
String MIMETYPE_OPENXML_PRESENTATION_ADDIN = "application/vnd.ms-powerpoint.addin.macroenabled.12";
String MIMETYPE_OPENXML_PRESENTATION_MACRO = "application/vnd.ms-powerpoint.presentation.macroenabled.12";
String MIMETYPE_OPENXML_PRESENTATION_SLIDE = "application/vnd.openxmlformats-officedocument.presentationml.slide";
String MIMETYPE_OPENXML_PRESENTATION_SLIDESHOW = "application/vnd.openxmlformats-officedocument.presentationml.slideshow";
String MIMETYPE_OPENXML_PRESENTATION_SLIDESHOW_MACRO = "application/vnd.ms-powerpoint.slideshow.macroenabled.12";
String MIMETYPE_OPENXML_PRESENTATION_SLIDE_MACRO = "application/vnd.ms-powerpoint.slide.macroenabled.12";
String MIMETYPE_OPENXML_PRESENTATION_TEMPLATE = "application/vnd.openxmlformats-officedocument.presentationml.template";
String MIMETYPE_OPENXML_PRESENTATION_TEMPLATE_MACRO = "application/vnd.ms-powerpoint.template.macroenabled.12";
String MIMETYPE_OPENXML_SPREADSHEET = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
String MIMETYPE_OPENXML_SPREADSHEET_ADDIN_MACRO = "application/vnd.ms-excel.addin.macroenabled.12";
String MIMETYPE_OPENXML_SPREADSHEET_BINARY_MACRO = "application/vnd.ms-excel.sheet.binary.macroenabled.12";
String MIMETYPE_OPENXML_SPREADSHEET_MACRO = "application/vnd.ms-excel.sheet.macroenabled.12";
String MIMETYPE_OPENXML_SPREADSHEET_TEMPLATE = "application/vnd.openxmlformats-officedocument.spreadsheetml.template";
String MIMETYPE_OPENXML_SPREADSHEET_TEMPLATE_MACRO = "application/vnd.ms-excel.template.macroenabled.12";
String MIMETYPE_OPENXML_WORDPROCESSING = "application/vnd.openxmlformats-officedocument.wordprocessingml.document"; String MIMETYPE_OPENXML_WORDPROCESSING = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
String MIMETYPE_OPENXML_WORDPROCESSING_MACRO = "application/vnd.ms-word.document.macroenabled.12"; String MIMETYPE_OPENXML_WORDPROCESSING_MACRO = "application/vnd.ms-word.document.macroenabled.12";
String MIMETYPE_OPENXML_WORD_TEMPLATE = "application/vnd.openxmlformats-officedocument.wordprocessingml.template"; String MIMETYPE_OPENXML_WORD_TEMPLATE = "application/vnd.openxmlformats-officedocument.wordprocessingml.template";
String MIMETYPE_OPENXML_WORD_TEMPLATE_MACRO = "application/vnd.ms-word.template.macroenabled.12"; String MIMETYPE_OPENXML_WORD_TEMPLATE_MACRO = "application/vnd.ms-word.template.macroenabled.12";
String MIMETYPE_OPENXML_SPREADSHEET = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"; String MIMETYPE_OUTLOOK_MSG = "application/vnd.ms-outlook";
String MIMETYPE_OPENXML_SPREADSHEET_TEMPLATE = "application/vnd.openxmlformats-officedocument.spreadsheetml.template"; String MIMETYPE_PBM = "image/x-portable-bitmap";
String MIMETYPE_OPENXML_SPREADSHEET_MACRO = "application/vnd.ms-excel.sheet.macroenabled.12"; String MIMETYPE_PDF = "application/pdf";
String MIMETYPE_OPENXML_SPREADSHEET_TEMPLATE_MACRO = "application/vnd.ms-excel.template.macroenabled.12"; String MIMETYPE_PNM = "image/x-portable-anymap";
String MIMETYPE_OPENXML_SPREADSHEET_ADDIN_MACRO = "application/vnd.ms-excel.addin.macroenabled.12"; String MIMETYPE_PPM = "image/x-portable-pixmap";
String MIMETYPE_OPENXML_SPREADSHEET_BINARY_MACRO = "application/vnd.ms-excel.sheet.binary.macroenabled.12"; String MIMETYPE_PPT = "application/vnd.ms-powerpoint";
String MIMETYPE_OPENXML_PRESENTATION = "application/vnd.openxmlformats-officedocument.presentationml.presentation"; String MIMETYPE_RFC822 = "message/rfc822";
String MIMETYPE_OPENXML_PRESENTATION_MACRO = "application/vnd.ms-powerpoint.presentation.macroenabled.12"; String MIMETYPE_RSS = "application/rss+xml";
String MIMETYPE_OPENXML_PRESENTATION_SLIDESHOW = "application/vnd.openxmlformats-officedocument.presentationml.slideshow"; String MIMETYPE_RTF = "application/rtf";
String MIMETYPE_OPENXML_PRESENTATION_SLIDESHOW_MACRO = "application/vnd.ms-powerpoint.slideshow.macroenabled.12";
String MIMETYPE_OPENXML_PRESENTATION_TEMPLATE = "application/vnd.openxmlformats-officedocument.presentationml.template";
String MIMETYPE_OPENXML_PRESENTATION_TEMPLATE_MACRO = "application/vnd.ms-powerpoint.template.macroenabled.12";
String MIMETYPE_OPENXML_PRESENTATION_ADDIN = "application/vnd.ms-powerpoint.addin.macroenabled.12";
String MIMETYPE_OPENXML_PRESENTATION_SLIDE = "application/vnd.openxmlformats-officedocument.presentationml.slide";
String MIMETYPE_OPENXML_PRESENTATION_SLIDE_MACRO = "application/vnd.ms-powerpoint.slide.macroenabled.12";
String MIMETYPE_STAROFFICE5_DRAW = "application/vnd.stardivision.draw";
String MIMETYPE_STAROFFICE5_CALC = "application/vnd.stardivision.calc"; String MIMETYPE_STAROFFICE5_CALC = "application/vnd.stardivision.calc";
String MIMETYPE_STAROFFICE5_CHART = "application/vnd.stardivision.chart";
String MIMETYPE_STAROFFICE5_DRAW = "application/vnd.stardivision.draw";
String MIMETYPE_STAROFFICE5_IMPRESS = "application/vnd.stardivision.impress"; String MIMETYPE_STAROFFICE5_IMPRESS = "application/vnd.stardivision.impress";
String MIMETYPE_STAROFFICE5_IMPRESS_PACKED = "application/vnd.stardivision.impress-packed"; String MIMETYPE_STAROFFICE5_IMPRESS_PACKED = "application/vnd.stardivision.impress-packed";
String MIMETYPE_STAROFFICE5_CHART = "application/vnd.stardivision.chart"; String MIMETYPE_STAROFFICE5_MATH = "application/vnd.stardivision.math";
String MIMETYPE_STAROFFICE5_WRITER = "application/vnd.stardivision.writer"; String MIMETYPE_STAROFFICE5_WRITER = "application/vnd.stardivision.writer";
String MIMETYPE_STAROFFICE5_WRITER_GLOBAL = "application/vnd.stardivision.writer-global"; String MIMETYPE_STAROFFICE5_WRITER_GLOBAL = "application/vnd.stardivision.writer-global";
String MIMETYPE_STAROFFICE5_MATH = "application/vnd.stardivision.math";
String MIMETYPE_IWORK_KEYNOTE = "application/vnd.apple.keynote";
String MIMETYPE_IWORK_NUMBERS = "application/vnd.apple.numbers";
String MIMETYPE_IWORK_PAGES = "application/vnd.apple.pages";
String MIMETYPE_APPLEFILE = "application/applefile";
String MIMETYPE_WORDPERFECT = "application/wordperfect";
String MIMETYPE_MP3 = "audio/mpeg";
String MIMETYPE_AUDIO_MP4 = "audio/mp4";
String MIMETYPE_VORBIS = "audio/vorbis";
String MIMETYPE_FLAC = "audio/x-flac";
String MIMETYPE_ACP = "application/acp";
String MIMETYPE_STC = "application/vnd.sun.xml.calc.template"; String MIMETYPE_STC = "application/vnd.sun.xml.calc.template";
String MIMETYPE_STI = "application/vnd.sun.xml.impress.template"; String MIMETYPE_STI = "application/vnd.sun.xml.impress.template";
String MIMETYPE_STW = "application/vnd.sun.xml.writer.template"; String MIMETYPE_STW = "application/vnd.sun.xml.writer.template";
String MIMETYPE_SXC = "application/vnd.sun.xml.calc"; String MIMETYPE_SXC = "application/vnd.sun.xml.calc";
String MIMETYPE_SXI = "application/vnd.sun.xml.impress"; String MIMETYPE_SXI = "application/vnd.sun.xml.impress";
String MIMETYPE_TAR = "application/x-tar";
String MIMETYPE_TEXT_CSS = "text/css";
String MIMETYPE_TEXT_CSV = "text/csv";
String MIMETYPE_TEXT_JAVASCRIPT = "text/javascript";
String MIMETYPE_TEXT_MEDIAWIKI = "text/mediawiki";
String MIMETYPE_TEXT_PLAIN = "text/plain";
String MIMETYPE_TSV = "text/tab-separated-values";
String MIMETYPE_VIDEO_3GP = "video/3gpp";
String MIMETYPE_VIDEO_3GP2 = "video/3gpp2";
String MIMETYPE_VIDEO_AVI = "video/x-msvideo";
String MIMETYPE_VIDEO_FLV = "video/x-flv";
String MIMETYPE_VIDEO_MP4 = "video/mp4";
String MIMETYPE_VIDEO_MPG = "video/mpeg";
String MIMETYPE_VIDEO_QUICKTIME = "video/quicktime";
String MIMETYPE_VIDEO_WMV = "video/x-ms-wmv";
String MIMETYPE_VISIO = "application/vnd.visio";
String MIMETYPE_VISIO_2013 = "application/vnd.visio2013";
String MIMETYPE_VORBIS = "audio/vorbis";
String MIMETYPE_WORD = "application/msword";
String MIMETYPE_WORDPERFECT = "application/wordperfect";
String MIMETYPE_XBM = "image/x-xbitmap";
String MIMETYPE_XHTML = "application/xhtml+xml";
String MIMETYPE_XML = "text/xml";
String MIMETYPE_XPM = "image/x-xpixmap";
String MIMETYPE_Z = "application/x-compress";
String MIMETYPE_ZIP = "application/zip";
} }

View File

@@ -19,7 +19,7 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
* #L% * #L%
*/ */
package org.alfresco.transform.router; package org.alfresco.transform.common;
import java.util.StringJoiner; import java.util.StringJoiner;
import java.util.stream.Stream; import java.util.stream.Stream;
@@ -28,7 +28,7 @@ import java.util.stream.Stream;
* The client data supplied and echoed back to content repository (the client). May be modified to include * The client data supplied and echoed back to content repository (the client). May be modified to include
* TransformerDebug. * TransformerDebug.
*/ */
class RepositoryClientData public class RepositoryClientData
{ {
private static final String CLIENT_DATA_SEPARATOR = "\u23D0"; private static final String CLIENT_DATA_SEPARATOR = "\u23D0";
public static final String DEBUG_SEPARATOR = "\u23D1"; public static final String DEBUG_SEPARATOR = "\u23D1";

View File

@@ -19,9 +19,9 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
* #L% * #L%
*/ */
package org.alfresco.transform.client.util; package org.alfresco.transform.common;
import org.alfresco.transform.client.model.config.CoreVersionDecorator; import org.alfresco.transform.config.CoreVersionDecorator;
/** /**
* Request parameters and transform options used in the core transformers. * Request parameters and transform options used in the core transformers.

View File

@@ -2,7 +2,7 @@
* #%L * #%L
* Alfresco Transform Model * Alfresco Transform Model
* %% * %%
* Copyright (C) 2005 - 2018 Alfresco Software Limited * Copyright (C) 2005 - 2022 Alfresco Software Limited
* %% * %%
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as * it under the terms of the GNU Lesser General Public License as
@@ -19,7 +19,7 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
* #L% * #L%
*/ */
package org.alfresco.transform.exceptions; package org.alfresco.transform.common;
public class TransformException extends RuntimeException public class TransformException extends RuntimeException
{ {

View File

@@ -19,11 +19,12 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
* #L% * #L%
*/ */
package org.alfresco.transform.router; package org.alfresco.transform.common;
import org.alfresco.transform.client.model.InternalContext; import org.alfresco.transform.client.model.InternalContext;
import org.alfresco.transform.client.model.TransformReply; import org.alfresco.transform.client.model.TransformReply;
import org.alfresco.transform.client.model.TransformRequest; import org.alfresco.transform.client.model.TransformRequest;
import org.alfresco.transform.messages.TransformStack;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;

View File

@@ -2,7 +2,7 @@
* #%L * #%L
* Alfresco Transform Model * Alfresco Transform Model
* %% * %%
* Copyright (C) 2005 - 2019 Alfresco Software Limited * Copyright (C) 2005 - 2022 Alfresco Software Limited
* %% * %%
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as * it under the terms of the GNU Lesser General Public License as
@@ -19,7 +19,7 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
* #L% * #L%
*/ */
package org.alfresco.transform.client.model.config; package org.alfresco.transform.config;
import java.util.Objects; import java.util.Objects;

View File

@@ -2,7 +2,7 @@
* #%L * #%L
* Alfresco Transform Model * Alfresco Transform Model
* %% * %%
* Copyright (C) 2005 - 2021 Alfresco Software Limited * Copyright (C) 2005 - 2022 Alfresco Software Limited
* %% * %%
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as * it under the terms of the GNU Lesser General Public License as
@@ -19,7 +19,7 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
* #L% * #L%
*/ */
package org.alfresco.transform.client.model.config; package org.alfresco.transform.config;
/** /**
* Holds information to add new {@link SupportedSourceAndTarget} objects to an existing {@link Transformer}.<p><br> * Holds information to add new {@link SupportedSourceAndTarget} objects to an existing {@link Transformer}.<p><br>

View File

@@ -19,12 +19,12 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
* #L% * #L%
*/ */
package org.alfresco.transform.client.model.config; package org.alfresco.transform.config;
import org.apache.maven.artifact.versioning.ComparableVersion; import org.apache.maven.artifact.versioning.ComparableVersion;
import static org.alfresco.transform.client.model.config.CoreFunction.Constants.NO_UPPER_VERSION; import static org.alfresco.transform.config.CoreFunction.Constants.NO_UPPER_VERSION;
import static org.alfresco.transform.client.model.config.CoreFunction.Constants.NO_VERSION; import static org.alfresco.transform.config.CoreFunction.Constants.NO_VERSION;
/** /**
* Provides a mapping between a transform {@code coreVersion} and functionality (such as the use of Direct Access URLs) * Provides a mapping between a transform {@code coreVersion} and functionality (such as the use of Direct Access URLs)

View File

@@ -19,7 +19,7 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
* #L% * #L%
*/ */
package org.alfresco.transform.client.model.config; package org.alfresco.transform.config;
import org.apache.maven.artifact.versioning.ComparableVersion; import org.apache.maven.artifact.versioning.ComparableVersion;
@@ -32,9 +32,9 @@ import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static java.util.function.Predicate.not; import static java.util.function.Predicate.not;
import static org.alfresco.transform.client.model.config.CoreFunction.Constants.NO_VERSION; import static org.alfresco.transform.config.CoreFunction.Constants.NO_VERSION;
import static org.alfresco.transform.client.model.config.CoreFunction.newComparableVersion; import static org.alfresco.transform.config.CoreFunction.newComparableVersion;
import static org.alfresco.transform.client.util.RequestParamMap.DIRECT_ACCESS_URL; import static org.alfresco.transform.common.RequestParamMap.DIRECT_ACCESS_URL;
/** /**
* <p>Class sets or clears the {@code coreVersion} property of {@link Transformer}s in a {@link TransformConfig}<p/> * <p>Class sets or clears the {@code coreVersion} property of {@link Transformer}s in a {@link TransformConfig}<p/>

View File

@@ -2,7 +2,7 @@
* #%L * #%L
* Alfresco Transform Model * Alfresco Transform Model
* %% * %%
* Copyright (C) 2005 - 2021 Alfresco Software Limited * Copyright (C) 2005 - 2022 Alfresco Software Limited
* %% * %%
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as * it under the terms of the GNU Lesser General Public License as
@@ -19,7 +19,7 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
* #L% * #L%
*/ */
package org.alfresco.transform.client.model.config; package org.alfresco.transform.config;
/** /**
* Holds information to overriding existing {@link SupportedSourceAndTarget} objects with new {@code priority} and * Holds information to overriding existing {@link SupportedSourceAndTarget} objects with new {@code priority} and

View File

@@ -2,7 +2,7 @@
* #%L * #%L
* Alfresco Transform Model * Alfresco Transform Model
* %% * %%
* Copyright (C) 2005 - 2021 Alfresco Software Limited * Copyright (C) 2005 - 2022 Alfresco Software Limited
* %% * %%
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as * it under the terms of the GNU Lesser General Public License as
@@ -19,7 +19,7 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
* #L% * #L%
*/ */
package org.alfresco.transform.client.model.config; package org.alfresco.transform.config;
/** /**
* Holds information about existing {@link SupportedSourceAndTarget} objects that should be removed.<p><br> * Holds information about existing {@link SupportedSourceAndTarget} objects that should be removed.<p><br>

View File

@@ -2,7 +2,7 @@
* #%L * #%L
* Alfresco Transform Model * Alfresco Transform Model
* %% * %%
* Copyright (C) 2005 - 2021 Alfresco Software Limited * Copyright (C) 2005 - 2022 Alfresco Software Limited
* %% * %%
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as * it under the terms of the GNU Lesser General Public License as
@@ -19,7 +19,7 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
* #L% * #L%
*/ */
package org.alfresco.transform.client.model.config; package org.alfresco.transform.config;
import java.util.Objects; import java.util.Objects;
import java.util.StringJoiner; import java.util.StringJoiner;

View File

@@ -2,7 +2,7 @@
* #%L * #%L
* Alfresco Transform Model * Alfresco Transform Model
* %% * %%
* Copyright (C) 2005 - 2021 Alfresco Software Limited * Copyright (C) 2005 - 2022 Alfresco Software Limited
* %% * %%
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as * it under the terms of the GNU Lesser General Public License as
@@ -19,7 +19,7 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
* #L% * #L%
*/ */
package org.alfresco.transform.client.model.config; package org.alfresco.transform.config;
import java.util.Objects; import java.util.Objects;
import java.util.StringJoiner; import java.util.StringJoiner;

View File

@@ -2,7 +2,7 @@
* #%L * #%L
* Alfresco Transform Model * Alfresco Transform Model
* %% * %%
* Copyright (C) 2005 - 2021 Alfresco Software Limited * Copyright (C) 2005 - 2022 Alfresco Software Limited
* %% * %%
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as * it under the terms of the GNU Lesser General Public License as
@@ -19,7 +19,7 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
* #L% * #L%
*/ */
package org.alfresco.transform.client.model.config; package org.alfresco.transform.config;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;

View File

@@ -2,7 +2,7 @@
* #%L * #%L
* Alfresco Transform Model * Alfresco Transform Model
* %% * %%
* Copyright (C) 2005 - 2019 Alfresco Software Limited * Copyright (C) 2005 - 2022 Alfresco Software Limited
* %% * %%
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as * it under the terms of the GNU Lesser General Public License as
@@ -19,7 +19,7 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
* #L% * #L%
*/ */
package org.alfresco.transform.client.model.config; package org.alfresco.transform.config;
import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeInfo;

View File

@@ -2,7 +2,7 @@
* #%L * #%L
* Alfresco Transform Model * Alfresco Transform Model
* %% * %%
* Copyright (C) 2005 - 2019 Alfresco Software Limited * Copyright (C) 2005 - 2022 Alfresco Software Limited
* %% * %%
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as * it under the terms of the GNU Lesser General Public License as
@@ -19,7 +19,7 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
* #L% * #L%
*/ */
package org.alfresco.transform.client.model.config; package org.alfresco.transform.config;
import java.util.HashSet; import java.util.HashSet;
import java.util.Objects; import java.util.Objects;

View File

@@ -2,7 +2,7 @@
* #%L * #%L
* Alfresco Transform Model * Alfresco Transform Model
* %% * %%
* Copyright (C) 2005 - 2019 Alfresco Software Limited * Copyright (C) 2005 - 2022 Alfresco Software Limited
* %% * %%
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as * it under the terms of the GNU Lesser General Public License as
@@ -19,7 +19,7 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
* #L% * #L%
*/ */
package org.alfresco.transform.client.model.config; package org.alfresco.transform.config;
import java.util.Objects; import java.util.Objects;

View File

@@ -2,7 +2,7 @@
* #%L * #%L
* Alfresco Transform Model * Alfresco Transform Model
* %% * %%
* Copyright (C) 2005 - 2019 Alfresco Software Limited * Copyright (C) 2005 - 2022 Alfresco Software Limited
* %% * %%
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as * it under the terms of the GNU Lesser General Public License as
@@ -19,7 +19,7 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
* #L% * #L%
*/ */
package org.alfresco.transform.client.model.config; package org.alfresco.transform.config;
import java.util.Objects; import java.util.Objects;

View File

@@ -19,9 +19,9 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
* #L% * #L%
*/ */
package org.alfresco.transform.client.model.config; package org.alfresco.transform.config;
import org.alfresco.transform.client.registry.TransformServiceRegistry; import org.alfresco.transform.registry.TransformServiceRegistry;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashSet; import java.util.HashSet;

View File

@@ -2,7 +2,7 @@
* #%L * #%L
* Alfresco Transform Model * Alfresco Transform Model
* %% * %%
* Copyright (C) 2005 - 2021 Alfresco Software Limited * Copyright (C) 2005 - 2022 Alfresco Software Limited
* %% * %%
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as * it under the terms of the GNU Lesser General Public License as
@@ -19,7 +19,7 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
* #L% * #L%
*/ */
package org.alfresco.transform.client.model.config; package org.alfresco.transform.config;
import java.util.Objects; import java.util.Objects;
import java.util.StringJoiner; import java.util.StringJoiner;

View File

@@ -2,7 +2,7 @@
* #%L * #%L
* Alfresco Transform Model * Alfresco Transform Model
* %% * %%
* Copyright (C) 2005 - 2021 Alfresco Software Limited * Copyright (C) 2005 - 2022 Alfresco Software Limited
* %% * %%
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as * it under the terms of the GNU Lesser General Public License as
@@ -19,7 +19,7 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
* #L% * #L%
*/ */
package org.alfresco.transform.client.model.config; package org.alfresco.transform.config;
import java.util.Objects; import java.util.Objects;
import java.util.StringJoiner; import java.util.StringJoiner;

View File

@@ -2,7 +2,7 @@
* #%L * #%L
* Alfresco Transform Model * Alfresco Transform Model
* %% * %%
* Copyright (C) 2005 - 2021 Alfresco Software Limited * Copyright (C) 2005 - 2022 Alfresco Software Limited
* %% * %%
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as * it under the terms of the GNU Lesser General Public License as
@@ -19,7 +19,7 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
* #L% * #L%
*/ */
package org.alfresco.transform.client.model.config; package org.alfresco.transform.config;
import java.util.Objects; import java.util.Objects;
import java.util.StringJoiner; import java.util.StringJoiner;

View File

@@ -19,8 +19,9 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
* #L% * #L%
*/ */
package org.alfresco.transform.client.model; package org.alfresco.transform.messages;
import org.alfresco.transform.client.model.TransformRequest;
import org.springframework.validation.Errors; import org.springframework.validation.Errors;
import org.springframework.validation.Validator; import org.springframework.validation.Validator;

View File

@@ -19,10 +19,12 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
* #L% * #L%
*/ */
package org.alfresco.transform.router; package org.alfresco.transform.messages;
import org.alfresco.transform.client.model.InternalContext; import org.alfresco.transform.client.model.InternalContext;
import org.alfresco.transform.client.model.MultiStep;
import org.alfresco.transform.client.model.TransformReply; import org.alfresco.transform.client.model.TransformReply;
import org.alfresco.transform.common.TransformerDebug;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import java.util.ArrayList; import java.util.ArrayList;
@@ -34,7 +36,7 @@ import java.util.StringJoiner;
/** /**
* Represents the current state of a top level transform request in terms of its current nested call stack, which is * Represents the current state of a top level transform request in terms of its current nested call stack, which is
* the current transform step being performed and what other transform steps are still to be executed in the current * the current transform step being performed and what other transform steps are still to be executed in the current
* level. This information is encoded in the {@link org.alfresco.transform.client.model.MultiStep} structure of the * level. This information is encoded in the {@link MultiStep} structure of the
* internal context passed between T-Router and T-Engines. Ideally we would have changed the structure, * internal context passed between T-Router and T-Engines. Ideally we would have changed the structure,
* but for backward compatibility we are using the existing structure, which allows T-Engines that were developed * but for backward compatibility we are using the existing structure, which allows T-Engines that were developed
* previously to be used unchanged.<p><br/> * previously to be used unchanged.<p><br/>
@@ -69,7 +71,7 @@ public class TransformStack
public static final String PIPELINE_FLAG = "P"; public static final String PIPELINE_FLAG = "P";
public static final String FAILOVER_FLAG = "F"; public static final String FAILOVER_FLAG = "F";
static final String SEPARATOR = "\u23D0"; public static final String SEPARATOR = "\u23D0";
private static final String SEPARATOR_REGEX = "\u23D0"; private static final String SEPARATOR_REGEX = "\u23D0";
static final int OPTIONS_LEVEL = 0; static final int OPTIONS_LEVEL = 0;

View File

@@ -19,18 +19,18 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
* #L% * #L%
*/ */
package org.alfresco.transform.client.registry; package org.alfresco.transform.registry;
import static org.alfresco.transform.client.registry.TransformRegistryHelper.retrieveTransformListBySize; import static org.alfresco.transform.registry.TransformRegistryHelper.retrieveTransformListBySize;
import static org.alfresco.transform.client.registry.TransformRegistryHelper.lookupTransformOptions; import static org.alfresco.transform.registry.TransformRegistryHelper.lookupTransformOptions;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import org.alfresco.transform.client.model.config.CoreFunction; import org.alfresco.transform.config.CoreFunction;
import org.alfresco.transform.client.model.config.TransformOption; import org.alfresco.transform.config.TransformOption;
import org.alfresco.transform.client.model.config.Transformer; import org.alfresco.transform.config.Transformer;
/** /**
* Used to work out if a transformation is supported. Sub classes should implement {@link #getData()} to return an * Used to work out if a transformation is supported. Sub classes should implement {@link #getData()} to return an

View File

@@ -19,19 +19,19 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
* #L% * #L%
*/ */
package org.alfresco.transform.client.registry; package org.alfresco.transform.registry;
import org.alfresco.transform.client.model.config.AddSupported; import org.alfresco.transform.config.AddSupported;
import org.alfresco.transform.client.model.config.SupportedDefaults; import org.alfresco.transform.config.SupportedDefaults;
import org.alfresco.transform.client.model.config.OverrideSupported; import org.alfresco.transform.config.OverrideSupported;
import org.alfresco.transform.client.model.config.RemoveSupported; import org.alfresco.transform.config.RemoveSupported;
import org.alfresco.transform.client.model.config.SupportedSourceAndTarget; import org.alfresco.transform.config.SupportedSourceAndTarget;
import org.alfresco.transform.client.model.config.TransformConfig; import org.alfresco.transform.config.TransformConfig;
import org.alfresco.transform.client.model.config.TransformOption; import org.alfresco.transform.config.TransformOption;
import org.alfresco.transform.client.model.config.TransformStep; import org.alfresco.transform.config.TransformStep;
import org.alfresco.transform.client.model.config.Transformer; import org.alfresco.transform.config.Transformer;
import org.alfresco.transform.client.model.config.TransformerAndTypes; import org.alfresco.transform.config.TransformerAndTypes;
import org.alfresco.transform.client.model.config.Types; import org.alfresco.transform.config.Types;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
@@ -43,7 +43,7 @@ import java.util.StringJoiner;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static java.util.stream.Collectors.toSet; import static java.util.stream.Collectors.toSet;
import static org.alfresco.transform.client.model.config.CoreVersionDecorator.setCoreVersionOnMultiStepTransformers; import static org.alfresco.transform.config.CoreVersionDecorator.setCoreVersionOnMultiStepTransformers;
/** /**
* This class combines one or more T-Engine config and local files and registers them as if they were all in one file. * This class combines one or more T-Engine config and local files and registers them as if they were all in one file.

View File

@@ -19,9 +19,9 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
* #L% * #L%
*/ */
package org.alfresco.transform.client.registry; package org.alfresco.transform.registry;
import org.alfresco.transform.client.model.config.SupportedDefaults; import org.alfresco.transform.config.SupportedDefaults;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;

View File

@@ -2,7 +2,7 @@
* #%L * #%L
* Alfresco Transform Model * Alfresco Transform Model
* %% * %%
* Copyright (C) 2005 - 2021 Alfresco Software Limited * Copyright (C) 2005 - 2022 Alfresco Software Limited
* %% * %%
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as * it under the terms of the GNU Lesser General Public License as
@@ -19,7 +19,7 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
* #L% * #L%
*/ */
package org.alfresco.transform.client.registry; package org.alfresco.transform.registry;
import java.util.Collection; import java.util.Collection;
import java.util.HashSet; import java.util.HashSet;

View File

@@ -2,7 +2,7 @@
* #%L * #%L
* Alfresco Transform Model * Alfresco Transform Model
* %% * %%
* Copyright (C) 2005 - 2019 Alfresco Software Limited * Copyright (C) 2005 - 2022 Alfresco Software Limited
* %% * %%
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as * it under the terms of the GNU Lesser General Public License as
@@ -19,13 +19,13 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
* #L% * #L%
*/ */
package org.alfresco.transform.client.registry; package org.alfresco.transform.registry;
import java.util.Objects; import java.util.Objects;
import java.util.Set; import java.util.Set;
import org.alfresco.transform.client.model.config.TransformOption; import org.alfresco.transform.config.TransformOption;
import org.alfresco.transform.client.model.config.TransformOptionGroup; import org.alfresco.transform.config.TransformOptionGroup;
public class SupportedTransform public class SupportedTransform
{ {

View File

@@ -19,7 +19,7 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
* #L% * #L%
*/ */
package org.alfresco.transform.client.registry; package org.alfresco.transform.registry;
import static java.util.Collections.emptyMap; import static java.util.Collections.emptyMap;

View File

@@ -2,7 +2,7 @@
* #%L * #%L
* Alfresco Transform Model * Alfresco Transform Model
* %% * %%
* Copyright (C) 2005 - 2019 Alfresco Software Limited * Copyright (C) 2005 - 2022 Alfresco Software Limited
* %% * %%
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as * it under the terms of the GNU Lesser General Public License as
@@ -19,7 +19,7 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
* #L% * #L%
*/ */
package org.alfresco.transform.client.registry; package org.alfresco.transform.registry;
import static java.util.Collections.emptyList; import static java.util.Collections.emptyList;
import static java.util.Collections.emptyMap; import static java.util.Collections.emptyMap;
@@ -35,10 +35,10 @@ import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.function.Consumer; import java.util.function.Consumer;
import org.alfresco.transform.client.model.config.TransformOption; import org.alfresco.transform.config.TransformOption;
import org.alfresco.transform.client.model.config.TransformOptionGroup; import org.alfresco.transform.config.TransformOptionGroup;
import org.alfresco.transform.client.model.config.TransformOptionValue; import org.alfresco.transform.config.TransformOptionValue;
import org.alfresco.transform.exceptions.TransformException; import org.alfresco.transform.common.TransformException;
class TransformRegistryHelper class TransformRegistryHelper
{ {

View File

@@ -19,9 +19,9 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
* #L% * #L%
*/ */
package org.alfresco.transform.client.registry; package org.alfresco.transform.registry;
import org.alfresco.transform.client.model.config.CoreFunction; import org.alfresco.transform.config.CoreFunction;
import java.util.Map; import java.util.Map;

View File

@@ -2,7 +2,7 @@
* #%L * #%L
* Alfresco Transform Model * Alfresco Transform Model
* %% * %%
* Copyright (C) 2005 - 2021 Alfresco Software Limited * Copyright (C) 2005 - 2022 Alfresco Software Limited
* %% * %%
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as * it under the terms of the GNU Lesser General Public License as
@@ -19,9 +19,9 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
* #L% * #L%
*/ */
package org.alfresco.transform.client.registry; package org.alfresco.transform.registry;
import org.alfresco.transform.client.model.config.OverrideSupported; import org.alfresco.transform.config.OverrideSupported;
import java.util.Objects; import java.util.Objects;

View File

@@ -19,7 +19,7 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
* #L% * #L%
*/ */
package org.alfresco.transform.router; package org.alfresco.transform.common;
import ch.qos.logback.classic.Level; import ch.qos.logback.classic.Level;
import ch.qos.logback.classic.Logger; import ch.qos.logback.classic.Logger;
@@ -30,14 +30,15 @@ import com.google.common.collect.ImmutableMap;
import org.alfresco.transform.client.model.InternalContext; import org.alfresco.transform.client.model.InternalContext;
import org.alfresco.transform.client.model.TransformReply; import org.alfresco.transform.client.model.TransformReply;
import org.alfresco.transform.client.model.TransformRequest; import org.alfresco.transform.client.model.TransformRequest;
import org.alfresco.transform.messages.TransformStack;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import java.util.Map;
import java.util.StringJoiner; import java.util.StringJoiner;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_TEXT_PLAIN; import static org.alfresco.transform.common.Mimetype.MIMETYPE_TEXT_PLAIN;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_WORD; import static org.alfresco.transform.common.Mimetype.MIMETYPE_WORD;
import static org.junit.jupiter.api.Assertions.*; import static org.junit.jupiter.api.Assertions.*;
/** /**
@@ -123,7 +124,7 @@ class TransformerDebugTest
{ {
twoStepTransform(false, false, Level.DEBUG); twoStepTransform(false, false, Level.DEBUG);
assertEquals("" + Assertions.assertEquals("" +
"1 txt pdf 1.2 KB wrapper\n" + "1 txt pdf 1.2 KB wrapper\n" +
"1.1 txt doc transformer1\n" + "1.1 txt doc transformer1\n" +
"1.2 doc pdf transformer2\n" + "1.2 doc pdf transformer2\n" +
@@ -140,7 +141,7 @@ class TransformerDebugTest
// With trace there are "Finished" lines for nested transforms, like a T-Engine's debug but still without // With trace there are "Finished" lines for nested transforms, like a T-Engine's debug but still without
// the size and rendition name // the size and rendition name
assertEquals("" + Assertions.assertEquals("" +
"1 txt pdf 1.2 KB wrapper\n" + "1 txt pdf 1.2 KB wrapper\n" +
"1.1 txt doc transformer1\n" + "1.1 txt doc transformer1\n" +
"1.1 Finished in -- ms\n" + "1.1 Finished in -- ms\n" +
@@ -159,7 +160,7 @@ class TransformerDebugTest
// Note the first and last lines would only ever be logged on the router, but the expected data includes // Note the first and last lines would only ever be logged on the router, but the expected data includes
// the extra "Finished" lines, sizes and renditions (if set in client data). // the extra "Finished" lines, sizes and renditions (if set in client data).
assertEquals("" + Assertions.assertEquals("" +
"1 txt pdf 1.2 KB wrapper\n" + "1 txt pdf 1.2 KB wrapper\n" +
"1.1 txt doc 1.2 KB transformer1\n" + "1.1 txt doc 1.2 KB transformer1\n" +
"1.1 Finished in -- ms\n" + "1.1 Finished in -- ms\n" +
@@ -176,7 +177,7 @@ class TransformerDebugTest
{ {
twoStepTransform(false, true, Level.DEBUG); twoStepTransform(false, true, Level.DEBUG);
assertEquals("" + Assertions.assertEquals("" +
"1 txt pdf 1.2 KB wrapper\n" + "1 txt pdf 1.2 KB wrapper\n" +
"1.1 txt doc transformer1\n" + "1.1 txt doc transformer1\n" +
"1.2 doc pdf transformer2\n" + "1.2 doc pdf transformer2\n" +
@@ -198,7 +199,7 @@ class TransformerDebugTest
transformerDebug.logFailure(reply); transformerDebug.logFailure(reply);
assertEquals(" T-Request was null - a major error", getTransformerDebugOutput()); Assertions.assertEquals(" T-Request was null - a major error", getTransformerDebugOutput());
} }
@Test @Test

View File

@@ -19,7 +19,7 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
* #L% * #L%
*/ */
package org.alfresco.transform.client.model.config; package org.alfresco.transform.config;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;

View File

@@ -19,7 +19,7 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
* #L% * #L%
*/ */
package org.alfresco.transform.client.model.config; package org.alfresco.transform.config;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
@@ -30,12 +30,12 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import static org.alfresco.transform.client.model.config.CoreVersionDecorator.CONFIG_VERSION_INCLUDES_CORE_VERSION; import static org.alfresco.transform.common.RequestParamMap.CONFIG_VERSION_DEFAULT;
import static org.alfresco.transform.client.model.config.CoreVersionDecorator.setCoreVersionOnMultiStepTransformers; import static org.alfresco.transform.common.RequestParamMap.DIRECT_ACCESS_URL;
import static org.alfresco.transform.client.model.config.CoreVersionDecorator.setCoreVersionOnSingleStepTransformers; import static org.alfresco.transform.config.CoreVersionDecorator.CONFIG_VERSION_INCLUDES_CORE_VERSION;
import static org.alfresco.transform.client.model.config.CoreVersionDecorator.setOrClearCoreVersion; import static org.alfresco.transform.config.CoreVersionDecorator.setCoreVersionOnMultiStepTransformers;
import static org.alfresco.transform.client.util.RequestParamMap.CONFIG_VERSION_DEFAULT; import static org.alfresco.transform.config.CoreVersionDecorator.setCoreVersionOnSingleStepTransformers;
import static org.alfresco.transform.client.util.RequestParamMap.DIRECT_ACCESS_URL; import static org.alfresco.transform.config.CoreVersionDecorator.setOrClearCoreVersion;
import static org.junit.jupiter.api.Assertions.*; import static org.junit.jupiter.api.Assertions.*;
class CoreVersionDecoratorTest class CoreVersionDecoratorTest

View File

@@ -19,16 +19,17 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
* #L% * #L%
*/ */
package org.alfresco.transform.client.model; package org.alfresco.transform.messages;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_IMAGE_PNG; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_PNG;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_PDF; import static org.alfresco.transform.common.Mimetype.MIMETYPE_PDF;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
import java.util.UUID; import java.util.UUID;
import org.alfresco.transform.client.model.TransformRequest;
import org.junit.Test; import org.junit.Test;
import org.springframework.validation.DirectFieldBindingResult; import org.springframework.validation.DirectFieldBindingResult;
import org.springframework.validation.Errors; import org.springframework.validation.Errors;

View File

@@ -19,12 +19,14 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
* #L% * #L%
*/ */
package org.alfresco.transform.router; package org.alfresco.transform.messages;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import org.alfresco.transform.client.model.InternalContext; import org.alfresco.transform.client.model.InternalContext;
import org.alfresco.transform.client.model.MultiStep; import org.alfresco.transform.client.model.MultiStep;
import org.alfresco.transform.client.model.TransformReply; import org.alfresco.transform.client.model.TransformReply;
import org.alfresco.transform.common.TransformerDebug;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.mockito.Mock; import org.mockito.Mock;
@@ -36,15 +38,13 @@ import java.util.Arrays;
import java.util.Map; import java.util.Map;
import java.util.UUID; import java.util.UUID;
import static org.alfresco.transform.router.TransformStack.OPTIONS_LEVEL; import static org.alfresco.transform.messages.TransformStack.OPTIONS_LEVEL;
import static org.alfresco.transform.router.TransformStack.SEPARATOR; import static org.alfresco.transform.messages.TransformStack.SEPARATOR;
import static org.alfresco.transform.router.TransformStack.TOP_STACK_LEVEL; import static org.alfresco.transform.messages.TransformStack.TOP_STACK_LEVEL;
import static org.alfresco.transform.router.TransformStack.getInitialSourceReference; import static org.alfresco.transform.messages.TransformStack.getInitialSourceReference;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.doReturn;
class TransformStackTest class TransformStackTest
@@ -225,7 +225,7 @@ class TransformStackTest
removedLevels++; removedLevels++;
TransformStack.removeTransformLevel(internalContext); TransformStack.removeTransformLevel(internalContext);
} }
assertEquals(2, removedLevels); Assertions.assertEquals(2, removedLevels);
assertTrue(TransformStack.isLastStepInTransformLevel(internalContext)); assertTrue(TransformStack.isLastStepInTransformLevel(internalContext));
TransformStack.removeFailedStep(reply, transformerDebug); // Should remove the rest as failure was last step in failover TransformStack.removeFailedStep(reply, transformerDebug); // Should remove the rest as failure was last step in failover
assertTrue(TransformStack.isFinished(internalContext)); assertTrue(TransformStack.isFinished(internalContext));
@@ -413,10 +413,10 @@ class TransformStackTest
} }
if (transformStepCount >= 25) if (transformStepCount >= 25)
{ {
fail("Appear to be in an infinite loop"); Assertions.fail("Appear to be in an infinite loop");
} }
} while (!TransformStack.isFinished(internalContext)); } while (!TransformStack.isFinished(internalContext));
assertEquals(7, transformStepCount); Assertions.assertEquals(7, transformStepCount);
} }
@Test @Test
@@ -461,7 +461,7 @@ class TransformStackTest
{ {
System.out.println("TransformOptions value: " + value); System.out.println("TransformOptions value: " + value);
internalContext.getMultiStep().getTransformsToBeDone().set(OPTIONS_LEVEL, value); internalContext.getMultiStep().getTransformsToBeDone().set(OPTIONS_LEVEL, value);
assertNull(TransformStack.checkStructure(internalContext, "T-Reply")); Assertions.assertNull(TransformStack.checkStructure(internalContext, "T-Reply"));
// call the getter just in case we have missed something // call the getter just in case we have missed something
TransformStack.getInitialTransformRequestOptions(internalContext); TransformStack.getInitialTransformRequestOptions(internalContext);
} }
@@ -496,7 +496,7 @@ class TransformStackTest
{ {
System.out.println("TransformLevel value: " + value); System.out.println("TransformLevel value: " + value);
internalContext.getMultiStep().getTransformsToBeDone().set(TOP_STACK_LEVEL, value); internalContext.getMultiStep().getTransformsToBeDone().set(TOP_STACK_LEVEL, value);
assertNull(TransformStack.checkStructure(internalContext, "T-Reply")); Assertions.assertNull(TransformStack.checkStructure(internalContext, "T-Reply"));
// call a getter just in case we have missed something // call a getter just in case we have missed something
TransformStack.currentStep(internalContext); TransformStack.currentStep(internalContext);
}; };

View File

@@ -19,15 +19,15 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
* #L% * #L%
*/ */
package org.alfresco.transform.client.registry; package org.alfresco.transform.registry;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
import org.alfresco.transform.client.model.config.SupportedSourceAndTarget; import org.alfresco.transform.config.SupportedSourceAndTarget;
import org.alfresco.transform.client.model.config.TransformConfig; import org.alfresco.transform.config.TransformConfig;
import org.alfresco.transform.client.model.config.TransformStep; import org.alfresco.transform.config.TransformStep;
import org.alfresco.transform.client.model.config.Transformer; import org.alfresco.transform.config.Transformer;
import org.junit.Test; import org.junit.Test;
import java.util.List; import java.util.List;

View File

@@ -2,7 +2,7 @@
* #%L * #%L
* Alfresco Transform Model * Alfresco Transform Model
* %% * %%
* Copyright (C) 2005 - 2021 Alfresco Software Limited * Copyright (C) 2005 - 2022 Alfresco Software Limited
* %% * %%
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as * it under the terms of the GNU Lesser General Public License as
@@ -19,17 +19,17 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
* #L% * #L%
*/ */
package org.alfresco.transform.client.registry; package org.alfresco.transform.registry;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
import org.alfresco.transform.client.model.config.AddSupported; import org.alfresco.transform.config.AddSupported;
import org.alfresco.transform.client.model.config.SupportedDefaults; import org.alfresco.transform.config.SupportedDefaults;
import org.alfresco.transform.client.model.config.OverrideSupported; import org.alfresco.transform.config.OverrideSupported;
import org.alfresco.transform.client.model.config.RemoveSupported; import org.alfresco.transform.config.RemoveSupported;
import org.alfresco.transform.client.model.config.SupportedSourceAndTarget; import org.alfresco.transform.config.SupportedSourceAndTarget;
import org.alfresco.transform.client.model.config.TransformConfig; import org.alfresco.transform.config.TransformConfig;
import org.alfresco.transform.client.model.config.Transformer; import org.alfresco.transform.config.Transformer;
import org.junit.Test; import org.junit.Test;
import java.util.HashSet; import java.util.HashSet;

View File

@@ -2,7 +2,7 @@
* #%L * #%L
* Alfresco Transform Model * Alfresco Transform Model
* %% * %%
* Copyright (C) 2005 - 2021 Alfresco Software Limited * Copyright (C) 2005 - 2022 Alfresco Software Limited
* %% * %%
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as * it under the terms of the GNU Lesser General Public License as
@@ -19,10 +19,10 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
* #L% * #L%
*/ */
package org.alfresco.transform.client.registry; package org.alfresco.transform.registry;
import org.alfresco.transform.client.model.config.TransformOption; import org.alfresco.transform.config.TransformOption;
import org.alfresco.transform.client.model.config.Transformer; import org.alfresco.transform.config.Transformer;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;

View File

@@ -24,16 +24,16 @@
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>. * along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L% * #L%
*/ */
package org.alfresco.transform.client.registry; package org.alfresco.transform.registry;
import org.alfresco.transform.exceptions.TransformException; import org.alfresco.transform.common.TransformException;
import org.junit.Test; import org.junit.Test;
import java.util.List; import java.util.List;
import static java.util.Arrays.asList; import static java.util.Arrays.asList;
import static java.util.Collections.emptySet; import static java.util.Collections.emptySet;
import static org.alfresco.transform.client.registry.TransformRegistryHelper.retrieveTransformListBySize; import static org.alfresco.transform.registry.TransformRegistryHelper.retrieveTransformListBySize;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail; import static org.junit.Assert.fail;

View File

@@ -2,7 +2,7 @@
* #%L * #%L
* Alfresco Transform Model * Alfresco Transform Model
* %% * %%
* Copyright (C) 2005 - 2021 Alfresco Software Limited * Copyright (C) 2005 - 2022 Alfresco Software Limited
* %% * %%
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as * it under the terms of the GNU Lesser General Public License as
@@ -19,7 +19,7 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
* #L% * #L%
*/ */
package org.alfresco.transform.client.registry; package org.alfresco.transform.registry;
import static java.util.Collections.emptyMap; import static java.util.Collections.emptyMap;
import static java.util.Collections.emptySet; import static java.util.Collections.emptySet;
@@ -28,8 +28,8 @@ import static java.util.Collections.singletonList;
import static java.util.Collections.singletonMap; import static java.util.Collections.singletonMap;
import static java.util.function.Function.identity; import static java.util.function.Function.identity;
import static java.util.stream.Collectors.toMap; import static java.util.stream.Collectors.toMap;
import static org.alfresco.transform.client.registry.TransformRegistryHelper.addToPossibleTransformOptions; import static org.alfresco.transform.registry.TransformRegistryHelper.addToPossibleTransformOptions;
import static org.alfresco.transform.client.registry.TransformRegistryHelper.optionsMatch; import static org.alfresco.transform.registry.TransformRegistryHelper.optionsMatch;
import static org.apache.commons.lang3.StringUtils.isBlank; import static org.apache.commons.lang3.StringUtils.isBlank;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertFalse;
@@ -42,12 +42,12 @@ import java.util.HashSet;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import org.alfresco.transform.client.model.config.SupportedSourceAndTarget; import org.alfresco.transform.config.SupportedSourceAndTarget;
import org.alfresco.transform.client.model.config.TransformConfig; import org.alfresco.transform.config.TransformConfig;
import org.alfresco.transform.client.model.config.TransformOption; import org.alfresco.transform.config.TransformOption;
import org.alfresco.transform.client.model.config.TransformOptionGroup; import org.alfresco.transform.config.TransformOptionGroup;
import org.alfresco.transform.client.model.config.TransformOptionValue; import org.alfresco.transform.config.TransformOptionValue;
import org.alfresco.transform.client.model.config.Transformer; import org.alfresco.transform.config.Transformer;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;

View File

@@ -26,7 +26,7 @@
*/ */
package org.alfresco.transformer; package org.alfresco.transformer;
import static org.alfresco.transform.client.util.RequestParamMap.ENDPOINT_TRANSFORM; import static org.alfresco.transform.common.RequestParamMap.ENDPOINT_TRANSFORM;
import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.containsString;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNotNull;

View File

@@ -26,8 +26,8 @@
*/ */
package org.alfresco.transformer; package org.alfresco.transformer;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_OPENXML_WORDPROCESSING; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENXML_WORDPROCESSING;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_PDF; import static org.alfresco.transform.common.Mimetype.MIMETYPE_PDF;
import java.util.UUID; import java.util.UUID;

View File

@@ -2,7 +2,7 @@
* #%L * #%L
* Alfresco Transform Core * Alfresco Transform Core
* %% * %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited * Copyright (C) 2005 - 2022 Alfresco Software Limited
* %% * %%
* This file is part of the Alfresco software. * This file is part of the Alfresco software.
* - * -
@@ -26,7 +26,7 @@
*/ */
package org.alfresco.transformer.executors; package org.alfresco.transformer.executors;
import org.alfresco.transform.exceptions.TransformException; import org.alfresco.transform.common.TransformException;
import org.alfresco.transformer.PdfRendererOptionsBuilder; import org.alfresco.transformer.PdfRendererOptionsBuilder;
import java.io.File; import java.io.File;

View File

@@ -38,8 +38,8 @@ import java.util.HashMap;
import java.util.Map; import java.util.Map;
import static org.alfresco.transformer.executors.Tika.PDF_BOX; import static org.alfresco.transformer.executors.Tika.PDF_BOX;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_PDF; import static org.alfresco.transform.common.Mimetype.MIMETYPE_PDF;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_TEXT_PLAIN; import static org.alfresco.transform.common.Mimetype.MIMETYPE_TEXT_PLAIN;
/** /**
* Controller for the Docker based Tika transformers. * Controller for the Docker based Tika transformers.

View File

@@ -27,7 +27,7 @@
package org.alfresco.transformer; package org.alfresco.transformer;
import static java.nio.file.Files.readAllBytes; import static java.nio.file.Files.readAllBytes;
import static org.alfresco.transform.client.util.RequestParamMap.ENDPOINT_TRANSFORM; import static org.alfresco.transform.common.RequestParamMap.ENDPOINT_TRANSFORM;
import static org.alfresco.transformer.executors.Tika.ARCHIVE; import static org.alfresco.transformer.executors.Tika.ARCHIVE;
import static org.alfresco.transformer.executors.Tika.CSV; import static org.alfresco.transformer.executors.Tika.CSV;
import static org.alfresco.transformer.executors.Tika.DOC; import static org.alfresco.transformer.executors.Tika.DOC;
@@ -48,19 +48,19 @@ import static org.alfresco.transformer.executors.Tika.XHTML;
import static org.alfresco.transformer.executors.Tika.XML; import static org.alfresco.transformer.executors.Tika.XML;
import static org.alfresco.transformer.executors.Tika.XSLX; import static org.alfresco.transformer.executors.Tika.XSLX;
import static org.alfresco.transformer.executors.Tika.ZIP; import static org.alfresco.transformer.executors.Tika.ZIP;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_HTML; import static org.alfresco.transform.common.Mimetype.MIMETYPE_HTML;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_METADATA_EMBED; import static org.alfresco.transform.common.Mimetype.MIMETYPE_METADATA_EMBED;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_OPENXML_PRESENTATION; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENXML_PRESENTATION;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_OPENXML_SPREADSHEET; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENXML_SPREADSHEET;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_OPENXML_WORDPROCESSING; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENXML_WORDPROCESSING;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_OUTLOOK_MSG; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OUTLOOK_MSG;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_PDF; import static org.alfresco.transform.common.Mimetype.MIMETYPE_PDF;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_TEXT_CSV; import static org.alfresco.transform.common.Mimetype.MIMETYPE_TEXT_CSV;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_TEXT_PLAIN; import static org.alfresco.transform.common.Mimetype.MIMETYPE_TEXT_PLAIN;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_WORD; import static org.alfresco.transform.common.Mimetype.MIMETYPE_WORD;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_XHTML; import static org.alfresco.transform.common.Mimetype.MIMETYPE_XHTML;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_XML; import static org.alfresco.transform.common.Mimetype.MIMETYPE_XML;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_ZIP; import static org.alfresco.transform.common.Mimetype.MIMETYPE_ZIP;
import static org.alfresco.transformer.util.RequestParamMap.INCLUDE_CONTENTS; import static org.alfresco.transformer.util.RequestParamMap.INCLUDE_CONTENTS;
import static org.alfresco.transformer.util.RequestParamMap.NOT_EXTRACT_BOOKMARKS_TEXT; import static org.alfresco.transformer.util.RequestParamMap.NOT_EXTRACT_BOOKMARKS_TEXT;
import static org.junit.jupiter.api.Assertions.assertArrayEquals; import static org.junit.jupiter.api.Assertions.assertArrayEquals;

View File

@@ -2,7 +2,7 @@
* #%L * #%L
* Alfresco Transform Core * Alfresco Transform Core
* %% * %%
* Copyright (C) 2005 - 2021 Alfresco Software Limited * Copyright (C) 2005 - 2022 Alfresco Software Limited
* %% * %%
* This file is part of the Alfresco software. * This file is part of the Alfresco software.
* - * -
@@ -26,51 +26,51 @@
*/ */
package org.alfresco.transformer; package org.alfresco.transformer;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_APP_DWG; import static org.alfresco.transform.common.Mimetype.MIMETYPE_APP_DWG;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_OUTLOOK_MSG; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OUTLOOK_MSG;
import static org.alfresco.transformer.TestFileInfo.testFile; import static org.alfresco.transformer.TestFileInfo.testFile;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_AUDIO_MP4; import static org.alfresco.transform.common.Mimetype.MIMETYPE_AUDIO_MP4;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_EXCEL; import static org.alfresco.transform.common.Mimetype.MIMETYPE_EXCEL;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_IMAGE_BMP; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_BMP;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_IMAGE_GIF; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_GIF;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_IMAGE_JPEG; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_JPEG;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_IMAGE_PNG; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_PNG;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_IMAGE_TIFF; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_TIFF;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_IWORK_KEYNOTE; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IWORK_KEYNOTE;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_IWORK_NUMBERS; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IWORK_NUMBERS;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_IWORK_PAGES; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IWORK_PAGES;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_MP3; import static org.alfresco.transform.common.Mimetype.MIMETYPE_MP3;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_OPENDOCUMENT_FORMULA; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENDOCUMENT_FORMULA;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_OPENDOCUMENT_GRAPHICS; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENDOCUMENT_GRAPHICS;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_OPENDOCUMENT_GRAPHICS_TEMPLATE; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENDOCUMENT_GRAPHICS_TEMPLATE;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_OPENDOCUMENT_PRESENTATION; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENDOCUMENT_PRESENTATION;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_OPENDOCUMENT_PRESENTATION_TEMPLATE; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENDOCUMENT_PRESENTATION_TEMPLATE;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_OPENDOCUMENT_SPREADSHEET; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENDOCUMENT_SPREADSHEET;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_OPENDOCUMENT_SPREADSHEET_TEMPLATE; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENDOCUMENT_SPREADSHEET_TEMPLATE;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_OPENDOCUMENT_TEXT; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENDOCUMENT_TEXT;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_OPENDOCUMENT_TEXT_TEMPLATE; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENDOCUMENT_TEXT_TEMPLATE;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_OPENOFFICE1_WRITER; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENOFFICE1_WRITER;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_OPENXML_PRESENTATION; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENXML_PRESENTATION;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_OPENXML_SPREADSHEET; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENXML_SPREADSHEET;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_OPENXML_WORDPROCESSING; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENXML_WORDPROCESSING;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_PDF; import static org.alfresco.transform.common.Mimetype.MIMETYPE_PDF;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_PPT; import static org.alfresco.transform.common.Mimetype.MIMETYPE_PPT;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_TEXT_PLAIN; import static org.alfresco.transform.common.Mimetype.MIMETYPE_TEXT_PLAIN;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_VIDEO_3GP; import static org.alfresco.transform.common.Mimetype.MIMETYPE_VIDEO_3GP;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_VIDEO_3GP2; import static org.alfresco.transform.common.Mimetype.MIMETYPE_VIDEO_3GP2;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_VIDEO_FLV; import static org.alfresco.transform.common.Mimetype.MIMETYPE_VIDEO_FLV;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_VIDEO_MP4; import static org.alfresco.transform.common.Mimetype.MIMETYPE_VIDEO_MP4;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_VIDEO_QUICKTIME; import static org.alfresco.transform.common.Mimetype.MIMETYPE_VIDEO_QUICKTIME;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_VISIO; import static org.alfresco.transform.common.Mimetype.MIMETYPE_VISIO;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_VORBIS; import static org.alfresco.transform.common.Mimetype.MIMETYPE_VORBIS;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_WORD; import static org.alfresco.transform.common.Mimetype.MIMETYPE_WORD;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_XML; import static org.alfresco.transform.common.Mimetype.MIMETYPE_XML;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_ZIP; import static org.alfresco.transform.common.Mimetype.MIMETYPE_ZIP;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_IMAGE_RAW_RAF; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_RAW_RAF;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_IMAGE_RAW_ARW; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_RAW_ARW;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_IMAGE_RAW_CR2; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_RAW_CR2;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_IMAGE_RAW_RW2; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_RAW_RW2;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_IMAGE_RAW_NEF; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_RAW_NEF;
import java.util.stream.Stream; import java.util.stream.Stream;

View File

@@ -2,7 +2,7 @@
* #%L * #%L
* Alfresco Transform Core * Alfresco Transform Core
* %% * %%
* Copyright (C) 2005 - 2021 Alfresco Software Limited * Copyright (C) 2005 - 2022 Alfresco Software Limited
* %% * %%
* This file is part of the Alfresco software. * This file is part of the Alfresco software.
* - * -
@@ -26,8 +26,8 @@
*/ */
package org.alfresco.transformer; package org.alfresco.transformer;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_OPENXML_WORDPROCESSING; import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENXML_WORDPROCESSING;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_TEXT_PLAIN; import static org.alfresco.transform.common.Mimetype.MIMETYPE_TEXT_PLAIN;
import java.util.UUID; import java.util.UUID;

View File

@@ -2,7 +2,7 @@
* #%L * #%L
* Alfresco Transform Core * Alfresco Transform Core
* %% * %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited * Copyright (C) 2005 - 2022 Alfresco Software Limited
* %% * %%
* This file is part of the Alfresco software. * This file is part of the Alfresco software.
* - * -
@@ -65,14 +65,14 @@ import java.net.URL;
import java.util.List; import java.util.List;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_HTML; import static org.alfresco.transform.common.Mimetype.MIMETYPE_HTML;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_IMAGE_JPEG; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_JPEG;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_IMAGE_PNG; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_PNG;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_IMAGE_TIFF; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_TIFF;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_TEXT_CSV; import static org.alfresco.transform.common.Mimetype.MIMETYPE_TEXT_CSV;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_TEXT_PLAIN; import static org.alfresco.transform.common.Mimetype.MIMETYPE_TEXT_PLAIN;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_XHTML; import static org.alfresco.transform.common.Mimetype.MIMETYPE_XHTML;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_XML; import static org.alfresco.transform.common.Mimetype.MIMETYPE_XML;
/** /**
* Stripped down command line Tika transformers. Not actually run as a separate process, but the code fits the patten * Stripped down command line Tika transformers. Not actually run as a separate process, but the code fits the patten

View File

@@ -2,7 +2,7 @@
* #%L * #%L
* Alfresco Transform Core * Alfresco Transform Core
* %% * %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited * Copyright (C) 2005 - 2022 Alfresco Software Limited
* %% * %%
* This file is part of the Alfresco software. * This file is part of the Alfresco software.
* - * -
@@ -26,7 +26,7 @@
*/ */
package org.alfresco.transformer.metadataExtractors; package org.alfresco.transformer.metadataExtractors;
import org.alfresco.transformer.util.MimetypeMap; import org.alfresco.transform.common.Mimetype;
import org.apache.tika.config.TikaConfig; import org.apache.tika.config.TikaConfig;
import org.apache.tika.metadata.Metadata; import org.apache.tika.metadata.Metadata;
import org.apache.tika.metadata.TIFF; import org.apache.tika.metadata.TIFF;
@@ -38,6 +38,7 @@ import org.slf4j.LoggerFactory;
import java.io.Serializable; import java.io.Serializable;
import java.util.Map; import java.util.Map;
import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_JPEG;
import static org.alfresco.transformer.executors.Tika.readTikaConfig; import static org.alfresco.transformer.executors.Tika.readTikaConfig;
/** /**
@@ -100,7 +101,7 @@ public class TikaAutoMetadataExtractor extends AbstractTikaMetadataExtractor
protected Map<String, Serializable> extractSpecific(Metadata metadata, protected Map<String, Serializable> extractSpecific(Metadata metadata,
Map<String, Serializable> properties, Map<String,String> headers) Map<String, Serializable> properties, Map<String,String> headers)
{ {
if (MimetypeMap.MIMETYPE_IMAGE_JPEG.equals(metadata.get(Metadata.CONTENT_TYPE))) if (MIMETYPE_IMAGE_JPEG.equals(metadata.get(Metadata.CONTENT_TYPE)))
{ {
//check if the image has exif information //check if the image has exif information
if (metadata.get(EXIF_IMAGE_WIDTH_TAG) != null if (metadata.get(EXIF_IMAGE_WIDTH_TAG) != null

View File

@@ -2,7 +2,7 @@
* #%L * #%L
* Alfresco Transform Core * Alfresco Transform Core
* %% * %%
* Copyright (C) 2005 - 2021 Alfresco Software Limited * Copyright (C) 2005 - 2022 Alfresco Software Limited
* %% * %%
* This file is part of the Alfresco software. * This file is part of the Alfresco software.
* - * -
@@ -27,8 +27,8 @@
package org.alfresco.transformer.tika.parsers; package org.alfresco.transformer.tika.parsers;
import static java.nio.charset.StandardCharsets.UTF_8; import static java.nio.charset.StandardCharsets.UTF_8;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_IMAGE_JPEG; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_JPEG;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_IMAGE_TIFF; import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_TIFF;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.File; import java.io.File;

View File

@@ -0,0 +1,38 @@
/*
* #%L
* Alfresco Transform Core
* %%
* Copyright (C) 2005 - 2022 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 <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.transform;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Map;
public interface CustomTransformer
{
void transform(String transformerName, String sourceMimetype, String targetMimetype,
Map<String, String> transformOptions,
InputStream inputStream, OutputStream outputStream) throws Exception;
}

View File

@@ -0,0 +1,58 @@
/*
* #%L
* Alfresco Transform Core
* %%
* Copyright (C) 2005 - 2022 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 <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.transform;
import org.alfresco.transform.config.TransformConfig;
import org.alfresco.transformer.probes.ProbeTestTransform;
import java.util.Set;
/**
* The interface to the custom transform code applied on top of a base t-engine.
*/
public interface TransformEngine
{
/**
* @return the name of the t-engine. The t-router reads config from t-engines in name order.
*/
String getTransformEngineName();
/**
* @return a definition of what the t-engine supports. Normally read from a json Resource on the classpath.
*/
TransformConfig getTransformConfig();
/**
* @return actual transform codes.
*/
Set<CustomTransformer> getTransformers();
/**
* @return a ProbeTestTransform (will do a quick transform) for k8 liveness and readiness probes.
*/
ProbeTestTransform getLivenessAndReadinessProbeTestTransform();
}

View File

@@ -26,14 +26,14 @@
*/ */
package org.alfresco.transformer; package org.alfresco.transformer;
import org.alfresco.transform.common.TransformerDebug;
import org.alfresco.transform.client.model.InternalContext; import org.alfresco.transform.client.model.InternalContext;
import org.alfresco.transform.client.model.TransformReply; import org.alfresco.transform.client.model.TransformReply;
import org.alfresco.transform.client.model.TransformRequest; import org.alfresco.transform.client.model.TransformRequest;
import org.alfresco.transform.client.model.TransformRequestValidator; import org.alfresco.transform.messages.TransformRequestValidator;
import org.alfresco.transform.client.model.config.TransformConfig; import org.alfresco.transform.config.TransformConfig;
import org.alfresco.transform.client.registry.TransformServiceRegistry; import org.alfresco.transform.registry.TransformServiceRegistry;
import org.alfresco.transform.exceptions.TransformException; import org.alfresco.transform.common.TransformException;
import org.alfresco.transform.router.TransformerDebug;
import org.alfresco.transformer.clients.AlfrescoSharedFileStoreClient; import org.alfresco.transformer.clients.AlfrescoSharedFileStoreClient;
import org.alfresco.transformer.logging.LogEntry; import org.alfresco.transformer.logging.LogEntry;
import org.alfresco.transformer.model.FileRefResponse; import org.alfresco.transformer.model.FileRefResponse;
@@ -67,12 +67,12 @@ import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
import static java.util.stream.Collectors.joining; import static java.util.stream.Collectors.joining;
import static org.alfresco.transform.client.model.config.CoreVersionDecorator.setOrClearCoreVersion; import static org.alfresco.transform.config.CoreVersionDecorator.setOrClearCoreVersion;
import static org.alfresco.transform.client.util.RequestParamMap.DIRECT_ACCESS_URL; import static org.alfresco.transform.common.RequestParamMap.DIRECT_ACCESS_URL;
import static org.alfresco.transform.client.util.RequestParamMap.CONFIG_VERSION; import static org.alfresco.transform.common.RequestParamMap.CONFIG_VERSION;
import static org.alfresco.transform.client.util.RequestParamMap.CONFIG_VERSION_DEFAULT; import static org.alfresco.transform.common.RequestParamMap.CONFIG_VERSION_DEFAULT;
import static org.alfresco.transform.client.util.RequestParamMap.ENDPOINT_TRANSFORM; import static org.alfresco.transform.common.RequestParamMap.ENDPOINT_TRANSFORM;
import static org.alfresco.transform.client.util.RequestParamMap.ENDPOINT_TRANSFORM_CONFIG; import static org.alfresco.transform.common.RequestParamMap.ENDPOINT_TRANSFORM_CONFIG;
import static org.alfresco.transformer.fs.FileManager.TempFileProvider.createTempFile; import static org.alfresco.transformer.fs.FileManager.TempFileProvider.createTempFile;
import static org.alfresco.transformer.fs.FileManager.buildFile; import static org.alfresco.transformer.fs.FileManager.buildFile;
import static org.alfresco.transformer.fs.FileManager.createAttachment; import static org.alfresco.transformer.fs.FileManager.createAttachment;

View File

@@ -37,7 +37,7 @@ import javax.jms.Message;
import org.alfresco.transform.client.model.TransformReply; import org.alfresco.transform.client.model.TransformReply;
import org.alfresco.transform.client.model.TransformRequest; import org.alfresco.transform.client.model.TransformRequest;
import org.alfresco.transform.exceptions.TransformException; import org.alfresco.transform.common.TransformException;
import org.alfresco.transformer.messaging.TransformMessageConverter; import org.alfresco.transformer.messaging.TransformMessageConverter;
import org.alfresco.transformer.messaging.TransformReplySender; import org.alfresco.transformer.messaging.TransformReplySender;
import org.slf4j.Logger; import org.slf4j.Logger;

View File

@@ -2,7 +2,7 @@
* #%L * #%L
* Alfresco Transform Core * Alfresco Transform Core
* %% * %%
* Copyright (C) 2005 - 2019 Alfresco Software Limited * Copyright (C) 2005 - 2022 Alfresco Software Limited
* %% * %%
* This file is part of the Alfresco software. * This file is part of the Alfresco software.
* - * -
@@ -39,7 +39,7 @@ import javax.servlet.http.HttpServletResponse;
import org.alfresco.transform.client.model.TransformReply; import org.alfresco.transform.client.model.TransformReply;
import org.alfresco.transform.client.model.TransformRequest; import org.alfresco.transform.client.model.TransformRequest;
import org.alfresco.transform.exceptions.TransformException; import org.alfresco.transform.common.TransformException;
import org.alfresco.transformer.logging.LogEntry; import org.alfresco.transformer.logging.LogEntry;
import org.alfresco.transformer.probes.ProbeTestTransform; import org.alfresco.transformer.probes.ProbeTestTransform;
import org.slf4j.Logger; import org.slf4j.Logger;

View File

@@ -2,7 +2,7 @@
* #%L * #%L
* Alfresco Repository * Alfresco Repository
* %% * %%
* Copyright (C) 2005 - 2021 Alfresco Software Limited * Copyright (C) 2005 - 2022 Alfresco Software Limited
* %% * %%
* This file is part of the Alfresco software. * This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of * If the software was purchased under a paid Alfresco license, the terms of
@@ -26,7 +26,7 @@
package org.alfresco.transformer; package org.alfresco.transformer;
import static java.nio.charset.StandardCharsets.UTF_8; import static java.nio.charset.StandardCharsets.UTF_8;
import static org.alfresco.transform.client.model.config.CoreVersionDecorator.setCoreVersionOnSingleStepTransformers; import static org.alfresco.transform.config.CoreVersionDecorator.setCoreVersionOnSingleStepTransformers;
import static org.springframework.http.HttpStatus.INTERNAL_SERVER_ERROR; import static org.springframework.http.HttpStatus.INTERNAL_SERVER_ERROR;
import java.io.IOException; import java.io.IOException;
@@ -35,11 +35,11 @@ import java.io.Reader;
import javax.annotation.PostConstruct; import javax.annotation.PostConstruct;
import org.alfresco.transform.client.model.config.TransformConfig; import org.alfresco.transform.config.TransformConfig;
import org.alfresco.transform.client.registry.AbstractTransformRegistry; import org.alfresco.transform.registry.AbstractTransformRegistry;
import org.alfresco.transform.client.registry.CombinedTransformConfig; import org.alfresco.transform.registry.CombinedTransformConfig;
import org.alfresco.transform.client.registry.TransformCache; import org.alfresco.transform.registry.TransformCache;
import org.alfresco.transform.exceptions.TransformException; import org.alfresco.transform.common.TransformException;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;

View File

@@ -2,7 +2,7 @@
* #%L * #%L
* Alfresco Transform Core * Alfresco Transform Core
* %% * %%
* Copyright (C) 2005 - 2019 Alfresco Software Limited * Copyright (C) 2005 - 2022 Alfresco Software Limited
* %% * %%
* This file is part of the Alfresco software. * This file is part of the Alfresco software.
* - * -
@@ -31,7 +31,7 @@ import static org.springframework.http.MediaType.MULTIPART_FORM_DATA;
import java.io.File; import java.io.File;
import org.alfresco.transform.exceptions.TransformException; import org.alfresco.transform.common.TransformException;
import org.alfresco.transformer.model.FileRefResponse; import org.alfresco.transformer.model.FileRefResponse;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;

View File

@@ -26,9 +26,9 @@
*/ */
package org.alfresco.transformer.config; package org.alfresco.transformer.config;
import org.alfresco.transform.client.model.TransformRequestValidator; import org.alfresco.transform.messages.TransformRequestValidator;
import org.alfresco.transform.client.registry.TransformServiceRegistry; import org.alfresco.transform.registry.TransformServiceRegistry;
import org.alfresco.transform.router.TransformerDebug; import org.alfresco.transform.common.TransformerDebug;
import org.alfresco.transformer.TransformInterceptor; import org.alfresco.transformer.TransformInterceptor;
import org.alfresco.transformer.TransformRegistryImpl; import org.alfresco.transformer.TransformRegistryImpl;
import org.alfresco.transformer.clients.AlfrescoSharedFileStoreClient; import org.alfresco.transformer.clients.AlfrescoSharedFileStoreClient;
@@ -38,7 +38,7 @@ import org.springframework.web.client.RestTemplate;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import static org.alfresco.transform.client.util.RequestParamMap.ENDPOINT_TRANSFORM; import static org.alfresco.transform.common.RequestParamMap.ENDPOINT_TRANSFORM;
@Configuration @Configuration
public class WebApplicationConfig implements WebMvcConfigurer public class WebApplicationConfig implements WebMvcConfigurer

View File

@@ -2,7 +2,7 @@
* #%L * #%L
* Alfresco Transform Core * Alfresco Transform Core
* %% * %%
* Copyright (C) 2005 - 2019 Alfresco Software Limited * Copyright (C) 2005 - 2022 Alfresco Software Limited
* %% * %%
* This file is part of the Alfresco software. * This file is part of the Alfresco software.
* - * -
@@ -33,7 +33,7 @@ import static org.springframework.http.HttpStatus.INTERNAL_SERVER_ERROR;
import java.io.File; import java.io.File;
import java.util.Map; import java.util.Map;
import org.alfresco.transform.exceptions.TransformException; import org.alfresco.transform.common.TransformException;
/** /**
* *

View File

@@ -27,13 +27,13 @@ package org.alfresco.transformer.executors;
* #L% * #L%
*/ */
import org.alfresco.transform.exceptions.TransformException; import org.alfresco.transform.common.TransformException;
import java.io.File; import java.io.File;
import java.util.Map; import java.util.Map;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_METADATA_EMBED; import static org.alfresco.transform.common.Mimetype.MIMETYPE_METADATA_EMBED;
import static org.alfresco.transformer.util.MimetypeMap.MIMETYPE_METADATA_EXTRACT; import static org.alfresco.transform.common.Mimetype.MIMETYPE_METADATA_EXTRACT;
import static org.alfresco.transformer.util.RequestParamMap.TRANSFORM_NAME_PARAMETER; import static org.alfresco.transformer.util.RequestParamMap.TRANSFORM_NAME_PARAMETER;
import static org.springframework.http.HttpStatus.BAD_REQUEST; import static org.springframework.http.HttpStatus.BAD_REQUEST;
import static org.springframework.http.HttpStatus.INTERNAL_SERVER_ERROR; import static org.springframework.http.HttpStatus.INTERNAL_SERVER_ERROR;

View File

@@ -2,7 +2,7 @@
* #%L * #%L
* Alfresco Transform Core * Alfresco Transform Core
* %% * %%
* Copyright (C) 2005 - 2019 Alfresco Software Limited * Copyright (C) 2005 - 2022 Alfresco Software Limited
* %% * %%
* This file is part of the Alfresco software. * This file is part of the Alfresco software.
* - * -
@@ -42,7 +42,7 @@ import java.util.Arrays;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import org.alfresco.transform.exceptions.TransformException; import org.alfresco.transform.common.TransformException;
import org.alfresco.transformer.logging.LogEntry; import org.alfresco.transformer.logging.LogEntry;
import org.springframework.core.io.Resource; import org.springframework.core.io.Resource;
import org.springframework.core.io.UrlResource; import org.springframework.core.io.UrlResource;

View File

@@ -29,7 +29,7 @@ package org.alfresco.transformer.messaging;
import javax.jms.ConnectionFactory; import javax.jms.ConnectionFactory;
import javax.jms.Queue; import javax.jms.Queue;
import org.alfresco.transform.client.model.TransformRequestValidator; import org.alfresco.transform.messages.TransformRequestValidator;
import org.apache.activemq.command.ActiveMQQueue; import org.apache.activemq.command.ActiveMQQueue;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;

View File

@@ -2,7 +2,7 @@
* #%L * #%L
* Alfresco Transform Core * Alfresco Transform Core
* %% * %%
* Copyright (C) 2005 - 2019 Alfresco Software Limited * Copyright (C) 2005 - 2022 Alfresco Software Limited
* %% * %%
* This file is part of the Alfresco software. * This file is part of the Alfresco software.
* - * -
@@ -44,7 +44,7 @@ import java.util.concurrent.atomic.AtomicLong;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import org.alfresco.transform.exceptions.TransformException; import org.alfresco.transform.common.TransformException;
import org.alfresco.transformer.AbstractTransformerController; import org.alfresco.transformer.AbstractTransformerController;
import org.alfresco.transformer.logging.LogEntry; import org.alfresco.transformer.logging.LogEntry;
import org.slf4j.Logger; import org.slf4j.Logger;
@@ -56,7 +56,7 @@ import org.slf4j.LoggerFactory;
* <p><b>K8s probes</b>: A readiness probe indicates if the pod should accept request. <b>It does not indicate that a pod is * <p><b>K8s probes</b>: A readiness probe indicates if the pod should accept request. <b>It does not indicate that a pod is
* ready after startup</b>. The liveness probe indicates when to kill the pod. <b>Both probes are called throughout the * ready after startup</b>. The liveness probe indicates when to kill the pod. <b>Both probes are called throughout the
* lifetime of the pod</b> and a <b>liveness probes can take place before a readiness probe.</b> The k8s * lifetime of the pod</b> and a <b>liveness probes can take place before a readiness probe.</b> The k8s
* <b>initialDelaySeconds field is not fully honoured</b> as it multiplied by a random number, so is * <b>initialDelaySeconds field is not fully honoured</b> as it is multiplied by a random number, so is
* actually a maximum initial delay in seconds, but could be 0. </p> * actually a maximum initial delay in seconds, but could be 0. </p>
* *
* <p>Live and readiness probes might do test transforms. The first 6 requests result in a transformation * <p>Live and readiness probes might do test transforms. The first 6 requests result in a transformation

View File

@@ -30,7 +30,7 @@ package org.alfresco.transformer.util;
* Extends the list of transform options with historic request parameters or 'extra' parameters used in testing * Extends the list of transform options with historic request parameters or 'extra' parameters used in testing
* or communication in the all-in-one transformer. * or communication in the all-in-one transformer.
*/ */
public interface RequestParamMap extends org.alfresco.transform.client.util.RequestParamMap public interface RequestParamMap extends org.alfresco.transform.common.RequestParamMap
{ {
// This property can be sent by acs repository's legacy transformers to force a transform, // This property can be sent by acs repository's legacy transformers to force a transform,
// instead of letting this T-Engine determine it based on the request parameters. // instead of letting this T-Engine determine it based on the request parameters.

Some files were not shown because too many files have changed in this diff Show More