mirror of
https://github.com/Alfresco/alfresco-transform-core.git
synced 2025-08-14 17:58:27 +00:00
Save point: [skip ci]
* pick up alfresco-t-engine-base in 5 base t-engines * Switch over to using new base * Moved files in 5 base t-engines so we can remove the -boot package in the next round of changes
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-transformer-base</artifactId>
|
||||
<artifactId>alfresco-t-engine-base</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@@ -30,7 +30,7 @@
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-transformer-base</artifactId>
|
||||
<artifactId>alfresco-t-engine-base</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<classifier>tests</classifier>
|
||||
<type>test-jar</type>
|
||||
|
@@ -1,122 +0,0 @@
|
||||
/*
|
||||
* #%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.aio;
|
||||
|
||||
import org.alfresco.transform.config.TransformConfig;
|
||||
import org.alfresco.transform.common.TransformException;
|
||||
import org.alfresco.transform.base.executors.Transformer;
|
||||
import org.alfresco.transformer.AbstractTransformerController;
|
||||
import org.alfresco.transformer.probes.ProbeTestTransform;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import static org.alfresco.transform.common.Mimetype.MIMETYPE_HTML;
|
||||
import static org.alfresco.transform.common.Mimetype.MIMETYPE_TEXT_PLAIN;
|
||||
import static org.alfresco.transform.config.CoreVersionDecorator.setOrClearCoreVersion;
|
||||
import static org.alfresco.transform.common.RequestParamMap.CONFIG_VERSION_DEFAULT;
|
||||
import static org.alfresco.transform.base.util.RequestParamMap.CONFIG_VERSION;
|
||||
import static org.alfresco.transform.base.util.RequestParamMap.SOURCE_ENCODING;
|
||||
import static org.springframework.http.HttpStatus.INTERNAL_SERVER_ERROR;
|
||||
import static org.springframework.http.HttpStatus.OK;
|
||||
|
||||
@Controller
|
||||
public class AIOController extends AbstractTransformerController
|
||||
{
|
||||
private static final Logger logger = LoggerFactory.getLogger(AIOController.class);
|
||||
|
||||
@Autowired
|
||||
private AIOTransformRegistry transformRegistry;
|
||||
|
||||
@Override
|
||||
public String getTransformerName()
|
||||
{
|
||||
return "All in One Transformer";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String version()
|
||||
{
|
||||
return getTransformerName() + " available";
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProbeTestTransform getProbeTestTransform()
|
||||
{
|
||||
return new ProbeTestTransform(this, "quick.html", "quick.txt",
|
||||
119, 30, 150, 1024,
|
||||
60 * 2 + 1, 60 * 2)
|
||||
{
|
||||
@Override
|
||||
protected void executeTransformCommand(File sourceFile, File targetFile)
|
||||
{
|
||||
Map<String, String> parameters = new HashMap<>();
|
||||
parameters.put(SOURCE_ENCODING, "UTF-8");
|
||||
transformImpl("html", MIMETYPE_HTML, MIMETYPE_TEXT_PLAIN, parameters, sourceFile, targetFile);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseEntity<TransformConfig> info(
|
||||
@RequestParam(value = CONFIG_VERSION, defaultValue = CONFIG_VERSION_DEFAULT) int configVersion)
|
||||
{
|
||||
logger.info("GET Transform Config version: " + configVersion);
|
||||
TransformConfig transformConfig = transformRegistry.getTransformConfig();
|
||||
transformConfig = setOrClearCoreVersion(transformConfig, configVersion);
|
||||
return new ResponseEntity<>(transformConfig, OK);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void transformImpl(String transformName, String sourceMimetype, String targetMimetype,
|
||||
Map<String, String> transformOptions, File sourceFile, File targetFile)
|
||||
{
|
||||
logger.debug("Processing transform with: transformName; '{}', sourceFile '{}', targetFile '{}', transformOptions" +
|
||||
" {}", transformName, sourceFile, targetFile, transformOptions);
|
||||
|
||||
Transformer transformer = transformRegistry.getByTransformName(transformName);
|
||||
if (transformer == null)
|
||||
{
|
||||
throw new TransformException(INTERNAL_SERVER_ERROR.value(), "No transformer mapping for - transform:"
|
||||
+ transformName + " sourceMimetype:" + sourceMimetype + " targetMimetype:" + targetMimetype);
|
||||
}
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("Performing transform with name '{}' using transformer with id '{}'.", transformName, transformer.getTransformerId());
|
||||
}
|
||||
|
||||
transformer.transformExtractOrEmbed(transformName, sourceMimetype, targetMimetype, transformOptions, sourceFile, targetFile);
|
||||
}
|
||||
}
|
@@ -1,123 +0,0 @@
|
||||
/*
|
||||
* #%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.aio;
|
||||
|
||||
import org.alfresco.transform.registry.TransformServiceRegistry;
|
||||
import org.alfresco.transform.imagemagick.transformers.ImageMagickCommandExecutor;
|
||||
import org.alfresco.transform.libreoffice.transformers.LibreOfficeJavaExecutor;
|
||||
import org.alfresco.transform.pdfRenderer.transformers.PdfRendererCommandExecutor;
|
||||
import org.alfresco.transform.base.executors.Transformer;
|
||||
import org.alfresco.transformer.AbstractTransformerController;
|
||||
import org.alfresco.transform.misc.transformers.SelectingTransformer;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@Configuration
|
||||
public class AIOCustomConfig
|
||||
{
|
||||
@Value("${transform.core.libreoffice.path}")
|
||||
private String libreofficePath;
|
||||
|
||||
@Value("${transform.core.libreoffice.maxTasksPerProcess}")
|
||||
private String libreofficeMaxTasksPerProcess;
|
||||
|
||||
@Value("${transform.core.libreoffice.timeout}")
|
||||
private String libreofficeTimeout;
|
||||
|
||||
@Value("${transform.core.libreoffice.portNumbers}")
|
||||
private String libreofficePortNumbers;
|
||||
|
||||
@Value("${transform.core.libreoffice.templateProfileDir}")
|
||||
private String libreofficeTemplateProfileDir;
|
||||
|
||||
@Value("${transform.core.libreoffice.isEnabled}")
|
||||
private String libreofficeIsEnabled;
|
||||
|
||||
@Value("${transform.core.pdfrenderer.exe}")
|
||||
private String pdfRendererPath;
|
||||
|
||||
@Value("${transform.core.imagemagick.exe}")
|
||||
private String imageMagickExePath;
|
||||
|
||||
@Value("${transform.core.imagemagick.dyn}")
|
||||
private String imageMagickDynPath;
|
||||
|
||||
@Value("${transform.core.imagemagick.root}")
|
||||
private String imageMagickRootPath;
|
||||
|
||||
@Value("${transform.core.imagemagick.coders}")
|
||||
private String imageMagickCodersPath;
|
||||
|
||||
@Value("${transform.core.imagemagick.config}")
|
||||
private String imageMagickConfigPath;
|
||||
|
||||
@Value("${transform.core.tika.pdfBox.notExtractBookmarksTextDefault:false}")
|
||||
private boolean notExtractBookmarksTextDefault;
|
||||
|
||||
@Value("${transform.core.version}")
|
||||
private String coreVersion;
|
||||
|
||||
/**
|
||||
*
|
||||
* @return Override the TransformRegistryImpl used in {@link AbstractTransformerController}
|
||||
*/
|
||||
@Bean
|
||||
@Primary
|
||||
public TransformServiceRegistry aioTransformRegistry() throws Exception
|
||||
{
|
||||
AIOTransformRegistry aioTransformRegistry = new AIOTransformRegistry();
|
||||
aioTransformRegistry.setCoreVersion(coreVersion);
|
||||
|
||||
// T-Engines are sorted by name so they are combined in the same order as in the T-Router
|
||||
// and Content Repository with individual T-Engines. See TransformersConfigRegistry#retrieveRemoteConfig and
|
||||
// LocalTransformServiceRegistry#getTEngineUrlsSortedByName.
|
||||
for (Transformer tEngine : getTEnginesSortedByName())
|
||||
{
|
||||
aioTransformRegistry.registerTransformer(tEngine); // now a poor name - should be combineTransformers
|
||||
}
|
||||
aioTransformRegistry.registerCombinedTransformers();
|
||||
return aioTransformRegistry;
|
||||
}
|
||||
|
||||
List<Transformer> getTEnginesSortedByName()
|
||||
{
|
||||
return Stream.of(new SelectingTransformer(),
|
||||
// new TikaJavaExecutor(notExtractBookmarksTextDefault),
|
||||
new ImageMagickCommandExecutor(imageMagickExePath, imageMagickDynPath, imageMagickRootPath, imageMagickCodersPath, imageMagickConfigPath),
|
||||
new LibreOfficeJavaExecutor(libreofficePath, libreofficeMaxTasksPerProcess, libreofficeTimeout, libreofficePortNumbers, libreofficeTemplateProfileDir, libreofficeIsEnabled),
|
||||
new PdfRendererCommandExecutor(pdfRendererPath))
|
||||
.sorted(Comparator.comparing(Transformer::getTransformerId))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
}
|
@@ -14,7 +14,7 @@
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-transformer-base</artifactId>
|
||||
<artifactId>alfresco-t-engine-base</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@@ -1,183 +0,0 @@
|
||||
/*
|
||||
* #%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.aio;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.alfresco.transform.config.TransformConfig;
|
||||
import org.alfresco.transform.registry.AbstractTransformRegistry;
|
||||
import org.alfresco.transform.registry.CombinedTransformConfig;
|
||||
import org.alfresco.transform.registry.TransformCache;
|
||||
import org.alfresco.transform.base.executors.Transformer;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.Reader;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import static java.nio.charset.StandardCharsets.UTF_8;
|
||||
import static org.alfresco.transform.config.CoreVersionDecorator.setCoreVersionOnSingleStepTransformers;
|
||||
|
||||
/**
|
||||
* AIOTransformRegistry manages all of the sub transformers registered to it and provides aggregated TransformConfig.
|
||||
*/
|
||||
public class AIOTransformRegistry extends AbstractTransformRegistry
|
||||
{
|
||||
private static final Logger log = LoggerFactory.getLogger(AIOTransformRegistry.class);
|
||||
|
||||
private static final String ENGINE_CONFIG_LOCATION_POSTFIX = "_engine_config.json";
|
||||
|
||||
private String coreVersion;
|
||||
|
||||
private CombinedTransformConfig combinedTransformConfig = new CombinedTransformConfig();
|
||||
|
||||
// Holds the structures used by AbstractTransformRegistry to look up what is supported.
|
||||
// Unlike other sub classes this class does not extend Data or replace it at run time.
|
||||
private TransformCache data = new TransformCache();
|
||||
|
||||
private ObjectMapper jsonObjectMapper = new ObjectMapper();
|
||||
|
||||
// Represents the mapping between a transform and a transformer, multiple mappings can point to the same transformer.
|
||||
private Map<String, Transformer> transformerEngineMapping = new HashMap();
|
||||
|
||||
public void setCoreVersion(String coreVersion)
|
||||
{
|
||||
this.coreVersion = coreVersion;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a transformer's (T-Engine) config to the configuration and creates a map of transforms to the T-Engine.
|
||||
* The name of this method is now misleading as the registry of transforms takes place in
|
||||
* {@link #registerCombinedTransformers()} .
|
||||
* @param tEngine The transformer implementation, this could be a single transformer
|
||||
* or a transformer managing multiple sub transformers. The transformer's configuration file will
|
||||
* be read based on the {@link Transformer#getTransformerId()} value.
|
||||
*/
|
||||
public void registerTransformer(final Transformer tEngine) throws Exception
|
||||
{
|
||||
// Load config for the transformer
|
||||
String location = getTransformConfigLocation(tEngine);
|
||||
TransformConfig transformConfig = loadTransformConfig(location);
|
||||
setCoreVersionOnSingleStepTransformers(transformConfig, coreVersion);
|
||||
String transformerId = tEngine.getTransformerId();
|
||||
combinedTransformConfig.addTransformConfig(transformConfig, location, transformerId, this);
|
||||
|
||||
// Map all of the transforms defined in the config to this Transformer implementation
|
||||
for (org.alfresco.transform.config.Transformer transformerConfig : transformConfig.getTransformers())
|
||||
{
|
||||
String transformerName = transformerConfig.getTransformerName();
|
||||
// A later tEngine 'might' override one that has already been defined. That is fine.
|
||||
Transformer originalTEngine = transformerEngineMapping.get(transformerName);
|
||||
if (originalTEngine != null)
|
||||
{
|
||||
log.debug("Overriding transform with name: '{}' originally defined in '{}'.", transformerName, originalTEngine.getTransformerId());
|
||||
}
|
||||
transformerEngineMapping.put(transformerName, tEngine);
|
||||
log.debug("Registered transform with name: '{}' defined in '{}'.", transformerName, transformerId);
|
||||
}
|
||||
}
|
||||
|
||||
public void registerCombinedTransformers()
|
||||
{
|
||||
combinedTransformConfig.combineTransformerConfig(this);
|
||||
combinedTransformConfig.registerCombinedTransformers(this);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param transformName The transform name as it appears in TransformConfig.
|
||||
* @return The transformer implementation mapped to the transform name.
|
||||
*/
|
||||
public Transformer getByTransformName(final String transformName)
|
||||
{
|
||||
return getTransformerEngineMapping().get(transformName);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return The aggregated config of all the registered transformers
|
||||
*/
|
||||
public TransformConfig getTransformConfig()
|
||||
{
|
||||
return combinedTransformConfig.buildTransformConfig();
|
||||
}
|
||||
|
||||
protected String getTransformConfigLocation(final Transformer transformer)
|
||||
{
|
||||
String location = transformer.getTransformerId() + ENGINE_CONFIG_LOCATION_POSTFIX;
|
||||
return location;
|
||||
}
|
||||
|
||||
protected TransformConfig loadTransformConfig(final String name) throws Exception
|
||||
{
|
||||
if (getClass().getClassLoader().getResource(name) == null)
|
||||
{
|
||||
throw new Exception("Configuration '" + name + "' does not exist on the classpath.");
|
||||
}
|
||||
|
||||
try (InputStream is = getClass().getClassLoader().getResourceAsStream(name);
|
||||
Reader reader = new InputStreamReader(is, UTF_8))
|
||||
{
|
||||
return jsonObjectMapper.readValue(reader, TransformConfig.class);
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
throw new Exception("Could not read '" + name + "' from the classpath.", e);
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, Transformer> getTransformerEngineMapping()
|
||||
{
|
||||
return transformerEngineMapping;
|
||||
}
|
||||
|
||||
void setTransformerEngineMapping(Map<String, Transformer> transformerEngineMapping)
|
||||
{
|
||||
this.transformerEngineMapping = transformerEngineMapping;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TransformCache getData()
|
||||
{
|
||||
return data;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void logError(String msg)
|
||||
{
|
||||
log.error(msg);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void logWarn(String msg)
|
||||
{
|
||||
log.warn(msg);
|
||||
}
|
||||
}
|
@@ -0,0 +1,88 @@
|
||||
/*
|
||||
* #%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.coreaio;
|
||||
|
||||
import org.alfresco.transform.base.TransformEngine;
|
||||
import org.alfresco.transform.base.TransformRegistryImpl;
|
||||
import org.alfresco.transform.base.probes.ProbeTestTransform;
|
||||
import org.alfresco.transform.config.TransformConfig;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static org.alfresco.transform.base.logging.StandardMessages.COMMUNITY_LICENCE;
|
||||
import static org.alfresco.transform.common.Mimetype.MIMETYPE_HTML;
|
||||
import static org.alfresco.transform.common.Mimetype.MIMETYPE_PDF;
|
||||
import static org.alfresco.transform.common.Mimetype.MIMETYPE_TEXT_PLAIN;
|
||||
|
||||
@Component
|
||||
public class AIOTransformEngine implements TransformEngine
|
||||
{
|
||||
@Autowired
|
||||
private TransformRegistryImpl transformRegistry;
|
||||
@Autowired(required = false)
|
||||
private List<TransformEngine> transformEngines;
|
||||
|
||||
@Override
|
||||
public String getTransformEngineName()
|
||||
{
|
||||
return "0060-AllInOne";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getStartupMessage()
|
||||
{
|
||||
String message = "";
|
||||
if (transformEngines != null)
|
||||
{
|
||||
// Combines the messages of the component TransformEngines. Removes duplicate community license messages.
|
||||
message = transformEngines.stream()
|
||||
.filter(transformEngine -> transformEngine != this)
|
||||
.map(transformEngine -> transformEngine.getStartupMessage())
|
||||
.collect( Collectors.joining("\\n"));
|
||||
message.replace(COMMUNITY_LICENCE + "\\n", "");
|
||||
}
|
||||
return COMMUNITY_LICENCE + "\\n" + message;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TransformConfig getTransformConfig()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProbeTestTransform getLivenessAndReadinessProbeTestTransform()
|
||||
{
|
||||
return new ProbeTestTransform("quick.pdf", "quick.txt",
|
||||
MIMETYPE_PDF, MIMETYPE_TEXT_PLAIN, Collections.emptyMap(),
|
||||
60, 16, 400, 10240, 60 * 30 + 1, 60 * 15 + 20);
|
||||
}
|
||||
}
|
@@ -24,9 +24,9 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
package org.alfresco.transform.aio;
|
||||
package org.alfresco.transform.coreaio;
|
||||
|
||||
import org.alfresco.transformer.AbstractHttpRequestTest;
|
||||
import org.alfresco.transform.base.AbstractHttpRequestTest;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
||||
|
@@ -24,7 +24,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
package org.alfresco.transform.aio;
|
||||
package org.alfresco.transform.coreaio;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
@@ -24,14 +24,14 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
package org.alfresco.transform.aio;
|
||||
package org.alfresco.transform.coreaio;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.transform.libreoffice.LibreOfficeControllerTest;
|
||||
import org.alfresco.transform.libreoffice.transformers.LibreOfficeJavaExecutor;
|
||||
import org.alfresco.transform.libreoffice.transformers.LibreOfficeTransformer;
|
||||
import org.alfresco.transform.base.executors.Transformer;
|
||||
import org.alfresco.transformer.AbstractTransformerController;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -62,7 +62,7 @@ public class AIOControllerLibreOfficeTest extends LibreOfficeControllerTest
|
||||
|
||||
@Override
|
||||
// Used by the super class to mock the javaExecutor, a different implementation is required here
|
||||
protected void setJavaExecutor(AbstractTransformerController controller, LibreOfficeJavaExecutor javaExecutor)
|
||||
protected void setJavaExecutor(AbstractTransformerController controller, LibreOfficeTransformer javaExecutor)
|
||||
{
|
||||
//Need to wire in the mocked javaExecutor into the controller...
|
||||
Map<String,Transformer> transformers = transformRegistry.getTransformerEngineMapping();
|
@@ -24,7 +24,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
package org.alfresco.transform.aio;
|
||||
package org.alfresco.transform.coreaio;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
@@ -24,16 +24,13 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
package org.alfresco.transform.aio;
|
||||
package org.alfresco.transform.coreaio;
|
||||
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.transform.aio.AIOController;
|
||||
import org.alfresco.transform.aio.AIOCustomConfig;
|
||||
import org.alfresco.transform.aio.AIOTransformRegistry;
|
||||
import org.alfresco.transform.pdfRenderer.AlfrescoPdfRendererControllerTest;
|
||||
import org.alfresco.transform.base.executors.Transformer;
|
||||
import org.junit.jupiter.api.Test;
|
@@ -24,7 +24,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
package org.alfresco.transform.aio;
|
||||
package org.alfresco.transform.coreaio;
|
||||
|
||||
import java.io.IOException;
|
||||
|
@@ -24,7 +24,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
package org.alfresco.transform.aio;
|
||||
package org.alfresco.transform.coreaio;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
@@ -24,7 +24,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
package org.alfresco.transform.aio;
|
||||
package org.alfresco.transform.coreaio;
|
||||
|
||||
import org.alfresco.transform.aio.AIOController;
|
||||
import org.alfresco.transform.aio.AIOCustomConfig;
|
@@ -24,7 +24,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
package org.alfresco.transform.aio;
|
||||
package org.alfresco.transform.coreaio;
|
||||
|
||||
import org.alfresco.transform.imagemagick.ImageMagickTransformationIT;
|
||||
|
@@ -24,7 +24,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
package org.alfresco.transform.aio;
|
||||
package org.alfresco.transform.coreaio;
|
||||
|
||||
import org.alfresco.transform.libreoffice.LibreOfficeTransformationIT;
|
||||
|
@@ -24,7 +24,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
package org.alfresco.transform.aio;
|
||||
package org.alfresco.transform.coreaio;
|
||||
|
||||
import org.alfresco.transform.misc.MiscMetadataExtractsIT;
|
||||
|
@@ -24,7 +24,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
package org.alfresco.transform.aio;
|
||||
package org.alfresco.transform.coreaio;
|
||||
|
||||
import org.alfresco.transform.misc.MiscTransformsIT;
|
||||
|
@@ -24,7 +24,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
package org.alfresco.transform.aio;
|
||||
package org.alfresco.transform.coreaio;
|
||||
|
||||
import org.alfresco.transform.pdfRenderer.AlfrescoPdfRendererTransformationIT;
|
||||
|
@@ -24,7 +24,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
package org.alfresco.transform.aio;
|
||||
package org.alfresco.transform.coreaio;
|
||||
|
||||
import static org.alfresco.transform.common.Mimetype.MIMETYPE_HTML;
|
||||
import static org.alfresco.transform.common.Mimetype.MIMETYPE_TEXT_PLAIN;
|
@@ -24,7 +24,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
package org.alfresco.transform.aio;
|
||||
package org.alfresco.transform.coreaio;
|
||||
|
||||
import org.alfresco.transform.tika.TikaMetadataExtractsIT;
|
||||
|
@@ -24,7 +24,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
package org.alfresco.transform.aio;
|
||||
package org.alfresco.transform.coreaio;
|
||||
|
||||
import org.alfresco.transform.tika.TikaTransformationIT;
|
||||
|
@@ -24,7 +24,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
package org.alfresco.transform.aio;
|
||||
package org.alfresco.transform.coreaio;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.alfresco.transform.aio.AIOTransformRegistry;
|
||||
@@ -49,7 +49,7 @@ import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static org.alfresco.transform.base.util.RequestParamMap.PAGE_LIMIT;
|
||||
import static org.alfresco.transform.common.RequestParamMap.PAGE_LIMIT;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
Reference in New Issue
Block a user