mirror of
https://github.com/Alfresco/alfresco-transform-core.git
synced 2025-08-14 17:58:27 +00:00
Save point: [skip ci]
* Using org.alfresco.transform.libreoffice package
This commit is contained in:
@@ -26,10 +26,9 @@
|
||||
*/
|
||||
package org.alfresco.transform.aio;
|
||||
|
||||
import org.alfresco.transform.aio.AIOTransformRegistry;
|
||||
import org.alfresco.transform.registry.TransformServiceRegistry;
|
||||
import org.alfresco.transform.imagemagick.transformers.ImageMagickCommandExecutor;
|
||||
import org.alfresco.transform.office.transformers.LibreOfficeJavaExecutor;
|
||||
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;
|
||||
|
@@ -30,11 +30,8 @@ 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.office.LibreOfficeControllerTest;
|
||||
import org.alfresco.transform.office.transformers.LibreOfficeJavaExecutor;
|
||||
import org.alfresco.transform.libreoffice.LibreOfficeControllerTest;
|
||||
import org.alfresco.transform.libreoffice.transformers.LibreOfficeJavaExecutor;
|
||||
import org.alfresco.transform.base.executors.Transformer;
|
||||
import org.alfresco.transformer.AbstractTransformerController;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
@@ -26,7 +26,7 @@
|
||||
*/
|
||||
package org.alfresco.transform.aio;
|
||||
|
||||
import org.alfresco.transform.office.LibreOfficeTransformationIT;
|
||||
import org.alfresco.transform.libreoffice.LibreOfficeTransformationIT;
|
||||
|
||||
public class AIOLibreOfficeTransformationIT extends LibreOfficeTransformationIT
|
||||
{
|
||||
|
@@ -24,10 +24,10 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
package org.alfresco.transform.office;
|
||||
package org.alfresco.transform.libreoffice;
|
||||
|
||||
import io.micrometer.core.instrument.MeterRegistry;
|
||||
import org.alfresco.transform.office.transformers.LibreOfficeJavaExecutor;
|
||||
import org.alfresco.transform.libreoffice.transformers.LibreOfficeJavaExecutor;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
@@ -24,10 +24,10 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
package org.alfresco.transform.office;
|
||||
package org.alfresco.transform.libreoffice;
|
||||
|
||||
import org.alfresco.transformer.AbstractTransformerController;
|
||||
import org.alfresco.transform.office.transformers.LibreOfficeJavaExecutor;
|
||||
import org.alfresco.transform.libreoffice.transformers.LibreOfficeJavaExecutor;
|
||||
import org.alfresco.transformer.probes.ProbeTestTransform;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
@@ -24,7 +24,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
package org.alfresco.transform.office;
|
||||
package org.alfresco.transform.libreoffice;
|
||||
|
||||
import static org.alfresco.transform.common.Mimetype.MIMETYPE_PDF;
|
||||
import static org.alfresco.transform.common.RequestParamMap.ENDPOINT_TRANSFORM;
|
||||
@@ -60,7 +60,7 @@ import org.alfresco.transform.client.model.TransformReply;
|
||||
import org.alfresco.transform.client.model.TransformRequest;
|
||||
import org.alfresco.transformer.AbstractTransformerController;
|
||||
import org.alfresco.transformer.AbstractTransformerControllerTest;
|
||||
import org.alfresco.transform.office.transformers.LibreOfficeJavaExecutor;
|
||||
import org.alfresco.transform.libreoffice.transformers.LibreOfficeJavaExecutor;
|
||||
import org.alfresco.transformer.executors.RuntimeExec.ExecutionResult;
|
||||
import org.alfresco.transformer.model.FileRefEntity;
|
||||
import org.alfresco.transformer.model.FileRefResponse;
|
@@ -24,7 +24,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
package org.alfresco.transform.office;
|
||||
package org.alfresco.transform.libreoffice;
|
||||
|
||||
import org.alfresco.transformer.AbstractHttpRequestTest;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
@@ -24,7 +24,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
package org.alfresco.transform.office;
|
||||
package org.alfresco.transform.libreoffice;
|
||||
|
||||
import static org.alfresco.transform.common.Mimetype.MIMETYPE_OPENXML_WORDPROCESSING;
|
||||
|
@@ -24,7 +24,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
package org.alfresco.transform.office;
|
||||
package org.alfresco.transform.libreoffice;
|
||||
|
||||
import static java.text.MessageFormat.format;
|
||||
import static java.util.function.Function.identity;
|
@@ -24,7 +24,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
package org.alfresco.transform.office.transformers;
|
||||
package org.alfresco.transform.libreoffice.transformers;
|
||||
|
||||
import org.artofsolving.jodconverter.office.OfficeManager;
|
||||
|
@@ -24,7 +24,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
package org.alfresco.transform.office.transformers;
|
||||
package org.alfresco.transform.libreoffice.transformers;
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
import static java.util.Objects.requireNonNull;
|
@@ -24,7 +24,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
package org.alfresco.transform.office.transformers;
|
||||
package org.alfresco.transform.libreoffice.transformers;
|
||||
|
||||
import com.sun.star.beans.PropertyValue;
|
||||
import com.sun.star.beans.UnknownPropertyException;
|
@@ -24,7 +24,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
package org.alfresco.transform.office.transformers;
|
||||
package org.alfresco.transform.libreoffice.transformers;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.sun.star.task.ErrorCodeIOException;
|
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
* #%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.misc;
|
||||
|
||||
import org.alfresco.transform.base.TransformEngine;
|
||||
import org.alfresco.transform.base.probes.ProbeTestTransform;
|
||||
import org.alfresco.transform.common.TransformConfigResourceReader;
|
||||
import org.alfresco.transform.config.TransformConfig;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
import static org.alfresco.transform.common.Mimetype.MIMETYPE_PDF;
|
||||
import static org.alfresco.transform.common.Mimetype.MIMETYPE_TEXT_PLAIN;
|
||||
|
||||
@Component
|
||||
public class MiscTransformEngine implements TransformEngine
|
||||
{
|
||||
private static final String LICENCE =
|
||||
"This transformer uses Tika from Apache. See the license at http://www.apache.org/licenses/LICENSE-2.0. or in /Apache\\ 2.0.txt\n" +
|
||||
"This transformer uses ExifTool by Phil Harvey. See license at https://exiftool.org/#license. or in /Perl-Artistic-License.txt";
|
||||
|
||||
@Autowired
|
||||
private TransformConfigResourceReader transformConfigResourceReader;
|
||||
@Value("${transform.core.config.location:classpath:engine_config.json}")
|
||||
private String engineConfigLocation;
|
||||
|
||||
@Override
|
||||
public String getTransformEngineName()
|
||||
{
|
||||
return "0001-Tika";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getStartupMessage() {
|
||||
return LICENCE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TransformConfig getTransformConfig()
|
||||
{
|
||||
return transformConfigResourceReader.read(engineConfigLocation);
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user