Merge pull request #74 from Alfresco/ATS-473

ATS 473
This commit is contained in:
aftene 2019-07-11 16:42:54 +03:00 committed by GitHub
commit 634bcf2725
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
39 changed files with 286 additions and 102 deletions

View File

@ -1,9 +1,8 @@
# Image provides a container in which to run alfresco-pdf-renderer transformations for Alfresco Enterprise Content Services. # Image provides a container in which to run alfresco-pdf-renderer transformations for Alfresco Content Services.
# The container is only intended to be used with the Alfresco Enterprise editon which is covered by https://www.alfresco.com/legal/agreements and https://www.alfresco.com/terms-use.
# alfresco-pdf-renderer uses the PDFium library from Google Inc. See the license at https://pdfium.googlesource.com/pdfium/+/master/LICENSE or in /pdfium.txt. # alfresco-pdf-renderer uses the PDFium library from Google Inc. See the license at https://pdfium.googlesource.com/pdfium/+/master/LICENSE or in /pdfium.txt.
FROM alfresco/alfresco-base-java:11.0.1-openjdk-centos-7-3e4e9f4e5d6a FROM alfresco/alfresco-base-java:11.0.1-openjdk-centos-7-6784d76a7b81
ENV ALFRESCO_PDF_RENDERER_LIB_RPM_URL=https://nexus.alfresco.com/nexus/service/local/repositories/releases/content/org/alfresco/alfresco-pdf-renderer/1.1/alfresco-pdf-renderer-1.1-linux.tgz ENV ALFRESCO_PDF_RENDERER_LIB_RPM_URL=https://nexus.alfresco.com/nexus/service/local/repositories/releases/content/org/alfresco/alfresco-pdf-renderer/1.1/alfresco-pdf-renderer-1.1-linux.tgz
ENV PDFIUM_LICENSE_FILE=https://github.com/Alfresco/acs-community-packaging/blob/master/distribution/src/main/resources/licenses/3rd-party/pdfium.txt ENV PDFIUM_LICENSE_FILE=https://github.com/Alfresco/acs-community-packaging/blob/master/distribution/src/main/resources/licenses/3rd-party/pdfium.txt

View File

@ -1,6 +1,4 @@
### Licenses ### Licenses
* The code in the alfresco-docker-alfresco-pdf-renderer project is only intended to be use with the Alfresco Enterprise
Content Repository which is covered by [https://www.alfresco.com/legal/agreements](https://www.alfresco.com/legal/agreements) and [https://www.alfresco.com/terms-use](https://www.alfresco.com/terms-use)
* The alfresco-pdf-renderer transformer uses the PDFium library from Google Inc. See [https://pdfium.googlesource.com/pdfium/+/master/LICENSE](https://pdfium.googlesource.com/pdfium/+/master/LICENSE) * The alfresco-pdf-renderer transformer uses the PDFium library from Google Inc. See [https://pdfium.googlesource.com/pdfium/+/master/LICENSE](https://pdfium.googlesource.com/pdfium/+/master/LICENSE)
or the [pdfium.txt](https://github.com/Alfresco/acs-community-packaging/blob/master/zip/src/main/resources/licenses/3rd-party/pdfium.txt) file placed in the root directory of the docker image. or the [pdfium.txt](https://github.com/Alfresco/acs-community-packaging/blob/master/zip/src/main/resources/licenses/3rd-party/pdfium.txt) file placed in the root directory of the docker image.

View File

@ -45,10 +45,27 @@
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.alfresco</groupId> <groupId>org.alfresco</groupId>
<artifactId>alfresco-core</artifactId> <artifactId>alfresco-core</artifactId>
<!--
TODO temp workaround for ATS-481 / REPO-4514 (exclude: dom4j.dom4j 1.6.1 / include org.dom4j.dom4j 2.1.1)
TODO remove this workaround once transitive dependencies have been fixed (surf-core-configservice -> alfresco-core)
-->
<exclusions>
<exclusion>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
</exclusion>
</exclusions>
</dependency> </dependency>
<dependency>
<groupId>org.dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>2.1.1</version>
</dependency>
</dependencies> </dependencies>
<build> <build>

View File

@ -6,7 +6,7 @@
# - Apache License 2.0 # - Apache License 2.0
# - Apache License, Version 2.0 # - Apache License, Version 2.0
# - Apache License, version 2.0 # - Apache License, version 2.0
# - BSD # - BSD 3-clause New License
# - CDDL + GPLv2 with classpath exception # - CDDL + GPLv2 with classpath exception
# - CDDL 1.1 # - CDDL 1.1
# - CDDL+GPL License # - CDDL+GPL License
@ -19,18 +19,16 @@
# - MIT License # - MIT License
# - MIT license # - MIT license
# - Public Domain, per Creative Commons CC0 # - Public Domain, per Creative Commons CC0
# - Sun Binary Code License Agreement
# - The Apache License, Version 2.0 # - The Apache License, Version 2.0
# - The Apache Software License, Version 2.0 # - The Apache Software License, Version 2.0
# - The JSON License # - The JSON License
# - The MIT License # - The MIT License
# - The SAX License
# - The W3C License
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# Please fill the missing licenses for dependencies : # Please fill the missing licenses for dependencies :
# #
# #
#Fri Jun 21 12:08:50 EEST 2019 #Tue Jul 09 13:35:12 EEST 2019
javax.transaction--jta--1.1=Sun Binary Code License Agreement javax.transaction--jta--1.1=Sun Binary Code License Agreement
commons-httpclient--commons-httpclient--3.1-HTTPCLIENT-1265=Apache License 2.0 commons-httpclient--commons-httpclient--3.1-HTTPCLIENT-1265=Apache License 2.0
org.codehaus.guessencoding--guessencoding--1.4=Apache License 2.0 org.codehaus.guessencoding--guessencoding--1.4=Apache License 2.0
dom4j--dom4j--1.6.1=BSD

View File

@ -30,7 +30,7 @@ import static org.alfresco.transformer.fs.FileManager.createAttachment;
import static org.alfresco.transformer.fs.FileManager.createSourceFile; import static org.alfresco.transformer.fs.FileManager.createSourceFile;
import static org.alfresco.transformer.fs.FileManager.createTargetFile; import static org.alfresco.transformer.fs.FileManager.createTargetFile;
import static org.alfresco.transformer.fs.FileManager.createTargetFileName; import static org.alfresco.transformer.fs.FileManager.createTargetFileName;
import static org.alfresco.transformer.logging.StandardMessages.ENTERPRISE_LICENCE; import static org.alfresco.transformer.logging.StandardMessages.LICENCE;
import static org.springframework.http.HttpStatus.OK; import static org.springframework.http.HttpStatus.OK;
import java.io.File; import java.io.File;
@ -85,7 +85,7 @@ public class AlfrescoPdfRendererController extends AbstractTransformerController
public AlfrescoPdfRendererController() public AlfrescoPdfRendererController()
{ {
logger.info("-----------------------------------------------------------------------------------------------------------------------------------------------------------"); logger.info("-----------------------------------------------------------------------------------------------------------------------------------------------------------");
Arrays.stream(ENTERPRISE_LICENCE.split("\\n")).forEach(logger::info); Arrays.stream(LICENCE.split("\\n")).forEach(logger::info);
logger.info("alfresco-pdf-renderer uses the PDFium library from Google Inc. See the license at https://pdfium.googlesource.com/pdfium/+/master/LICENSE or in /pdfium.txt"); logger.info("alfresco-pdf-renderer uses the PDFium library from Google Inc. See the license at https://pdfium.googlesource.com/pdfium/+/master/LICENSE or in /pdfium.txt");
logger.info("-----------------------------------------------------------------------------------------------------------------------------------------------------------"); logger.info("-----------------------------------------------------------------------------------------------------------------------------------------------------------");
} }

View File

@ -41,7 +41,8 @@ import org.springframework.test.context.junit4.SpringRunner;
* created on 15/01/2019 * created on 15/01/2019
*/ */
@RunWith(SpringRunner.class) @RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
properties = {"activemq.url=nio://localhost:61616"})
public class AlfrescoPdfRendererQueueTransformServiceIT extends AbstractQueueTransformServiceIT public class AlfrescoPdfRendererQueueTransformServiceIT extends AbstractQueueTransformServiceIT
{ {
@Override @Override

View File

@ -1,9 +1,8 @@
# Image provides a container in which to run ImageMagick transformations for Alfresco Enterprise Content Services. # Image provides a container in which to run ImageMagick transformations for Alfresco Content Services.
# The container is only intended to be used with the Alfresco Enterprise editon which is covered by https://www.alfresco.com/legal/agreements and https://www.alfresco.com/terms-use.
# ImageMagick is from ImageMagick Studio LLC. See the license at http://www.imagemagick.org/script/license.php or in /ImageMagick-license.txt. # ImageMagick is from ImageMagick Studio LLC. See the license at http://www.imagemagick.org/script/license.php or in /ImageMagick-license.txt.
FROM alfresco/alfresco-base-java:11.0.1-openjdk-centos-7-3e4e9f4e5d6a FROM alfresco/alfresco-base-java:11.0.1-openjdk-centos-7-6784d76a7b81
ENV IMAGEMAGICK_RPM_URL=https://nexus.alfresco.com/nexus/service/local/repositories/thirdparty/content/org/imagemagick/imagemagick-distribution/7.0.7-27/imagemagick-distribution-7.0.7-27-linux.rpm ENV IMAGEMAGICK_RPM_URL=https://nexus.alfresco.com/nexus/service/local/repositories/thirdparty/content/org/imagemagick/imagemagick-distribution/7.0.7-27/imagemagick-distribution-7.0.7-27-linux.rpm
ENV IMAGEMAGICK_LIB_RPM_URL=https://nexus.alfresco.com/nexus/service/local/repositories/thirdparty/content/org/imagemagick/imagemagick-distribution/7.0.7-27/imagemagick-distribution-7.0.7-27-libs-linux.rpm ENV IMAGEMAGICK_LIB_RPM_URL=https://nexus.alfresco.com/nexus/service/local/repositories/thirdparty/content/org/imagemagick/imagemagick-distribution/7.0.7-27/imagemagick-distribution-7.0.7-27-libs-linux.rpm

View File

@ -1,7 +1,5 @@
### Licenses ### Licenses
* The code in the alfresco-docker-imagemagick project is only intended to be use with the Alfresco Enterprise
Content Repository which is covered by [https://www.alfresco.com/legal/agreements](https://www.alfresco.com/legal/agreements) and [https://www.alfresco.com/terms-use](https://www.alfresco.com/terms-use)
* ImageMagick is from ImageMagick Studio LLC. See the license at [http://www.imagemagick.org/script/license.php](http://www.imagemagick.org/script/license.php) * ImageMagick is from ImageMagick Studio LLC. See the license at [http://www.imagemagick.org/script/license.php](http://www.imagemagick.org/script/license.php)
or the [ImageMagick-license.txt](https://github.com/Alfresco/acs-community-packaging/blob/master/zip/src/main/resources/licenses/3rd-party/ImageMagick-license.txt) or the [ImageMagick-license.txt](https://github.com/Alfresco/acs-community-packaging/blob/master/zip/src/main/resources/licenses/3rd-party/ImageMagick-license.txt)
file placed in the root directory of the docker image. file placed in the root directory of the docker image.

View File

@ -45,10 +45,27 @@
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.alfresco</groupId> <groupId>org.alfresco</groupId>
<artifactId>alfresco-core</artifactId> <artifactId>alfresco-core</artifactId>
<!--
TODO temp workaround for ATS-481 / REPO-4514 (exclude: dom4j.dom4j 1.6.1 / include org.dom4j.dom4j 2.1.1)
TODO remove this workaround once transitive dependencies have been fixed (surf-core-configservice -> alfresco-core)
-->
<exclusions>
<exclusion>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
</exclusion>
</exclusions>
</dependency> </dependency>
<dependency>
<groupId>org.dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>2.1.1</version>
</dependency>
</dependencies> </dependencies>
<build> <build>

View File

@ -6,7 +6,7 @@
# - Apache License 2.0 # - Apache License 2.0
# - Apache License, Version 2.0 # - Apache License, Version 2.0
# - Apache License, version 2.0 # - Apache License, version 2.0
# - BSD # - BSD 3-clause New License
# - CDDL + GPLv2 with classpath exception # - CDDL + GPLv2 with classpath exception
# - CDDL 1.1 # - CDDL 1.1
# - CDDL+GPL License # - CDDL+GPL License
@ -19,18 +19,16 @@
# - MIT License # - MIT License
# - MIT license # - MIT license
# - Public Domain, per Creative Commons CC0 # - Public Domain, per Creative Commons CC0
# - Sun Binary Code License Agreement
# - The Apache License, Version 2.0 # - The Apache License, Version 2.0
# - The Apache Software License, Version 2.0 # - The Apache Software License, Version 2.0
# - The JSON License # - The JSON License
# - The MIT License # - The MIT License
# - The SAX License
# - The W3C License
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# Please fill the missing licenses for dependencies : # Please fill the missing licenses for dependencies :
# #
# #
#Fri Jun 21 12:09:05 EEST 2019 #Tue Jul 09 13:35:40 EEST 2019
javax.transaction--jta--1.1=Sun Binary Code License Agreement javax.transaction--jta--1.1=Sun Binary Code License Agreement
commons-httpclient--commons-httpclient--3.1-HTTPCLIENT-1265=Apache License 2.0 commons-httpclient--commons-httpclient--3.1-HTTPCLIENT-1265=Apache License 2.0
org.codehaus.guessencoding--guessencoding--1.4=Apache License 2.0 org.codehaus.guessencoding--guessencoding--1.4=Apache License 2.0
dom4j--dom4j--1.6.1=BSD

View File

@ -30,7 +30,7 @@ import static org.alfresco.transformer.fs.FileManager.createAttachment;
import static org.alfresco.transformer.fs.FileManager.createSourceFile; import static org.alfresco.transformer.fs.FileManager.createSourceFile;
import static org.alfresco.transformer.fs.FileManager.createTargetFile; import static org.alfresco.transformer.fs.FileManager.createTargetFile;
import static org.alfresco.transformer.fs.FileManager.createTargetFileName; import static org.alfresco.transformer.fs.FileManager.createTargetFileName;
import static org.alfresco.transformer.logging.StandardMessages.ENTERPRISE_LICENCE; import static org.alfresco.transformer.logging.StandardMessages.LICENCE;
import static org.alfresco.transformer.util.Util.stringToInteger; import static org.alfresco.transformer.util.Util.stringToInteger;
import static org.springframework.http.HttpStatus.OK; import static org.springframework.http.HttpStatus.OK;
@ -88,7 +88,7 @@ public class ImageMagickController extends AbstractTransformerController
public ImageMagickController() public ImageMagickController()
{ {
logger.info("--------------------------------------------------------------------------------------------------------------------------------------------------------------"); logger.info("--------------------------------------------------------------------------------------------------------------------------------------------------------------");
Arrays.stream(ENTERPRISE_LICENCE.split("\\n")).forEach(logger::info); Arrays.stream(LICENCE.split("\\n")).forEach(logger::info);
logger.info("This transformer uses ImageMagick from ImageMagick Studio LLC. See the license at http://www.imagemagick.org/script/license.php or in /ImageMagick-license.txt"); logger.info("This transformer uses ImageMagick from ImageMagick Studio LLC. See the license at http://www.imagemagick.org/script/license.php or in /ImageMagick-license.txt");
logger.info("--------------------------------------------------------------------------------------------------------------------------------------------------------------"); logger.info("--------------------------------------------------------------------------------------------------------------------------------------------------------------");
} }

View File

@ -41,7 +41,8 @@ import org.springframework.test.context.junit4.SpringRunner;
* created on 15/01/2019 * created on 15/01/2019
*/ */
@RunWith(SpringRunner.class) @RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
properties = {"activemq.url=nio://localhost:61616"})
public class ImageMagickQueueTransformServiceIT extends AbstractQueueTransformServiceIT public class ImageMagickQueueTransformServiceIT extends AbstractQueueTransformServiceIT
{ {
@Override @Override

View File

@ -1,9 +1,8 @@
# Image provides a container in which to run LibreOffice transformations for Alfresco Enterprise Content Services. # Image provides a container in which to run LibreOffice transformations for Alfresco Content Services.
# The container is only intended to be used with the Alfresco Enterprise editon which is covered by https://www.alfresco.com/legal/agreements and https://www.alfresco.com/terms-use.
# LibreOffice is from The Document Foundation. See the license at https://www.libreoffice.org/download/license/ or in /libreoffice.txt. # LibreOffice is from The Document Foundation. See the license at https://www.libreoffice.org/download/license/ or in /libreoffice.txt.
FROM alfresco/alfresco-base-java:11.0.1-openjdk-centos-7-3e4e9f4e5d6a FROM alfresco/alfresco-base-java:11.0.1-openjdk-centos-7-6784d76a7b81
ENV LIBREOFFICE_RPM_URL=https://nexus.alfresco.com/nexus/service/local/repositories/thirdparty/content/org/libreoffice/libreoffice-dist/5.4.6/libreoffice-dist-5.4.6-linux.gz ENV LIBREOFFICE_RPM_URL=https://nexus.alfresco.com/nexus/service/local/repositories/thirdparty/content/org/libreoffice/libreoffice-dist/5.4.6/libreoffice-dist-5.4.6-linux.gz
ENV LIBREOFFICE_LICENSE_FILE=https://github.com/Alfresco/acs-community-packaging/blob/master/distribution/src/main/resources/licenses/3rd-party/libreoffice.txt ENV LIBREOFFICE_LICENSE_FILE=https://github.com/Alfresco/acs-community-packaging/blob/master/distribution/src/main/resources/licenses/3rd-party/libreoffice.txt

View File

@ -1,7 +1,5 @@
### Licenses ### Licenses
* The code in the alfresco-docker-libreoffice project is only intended to be use with the Alfresco Enterprise
Content Repository which is covered by [https://www.alfresco.com/legal/agreements](https://www.alfresco.com/legal/agreements) and [https://www.alfresco.com/terms-use](https://www.alfresco.com/terms-use)
* This transformer uses LibreOffice from The Document Foundation. See the license at * This transformer uses LibreOffice from The Document Foundation. See the license at
[https://www.libreoffice.org/download/license/](https://www.libreoffice.org/download/license/) [https://www.libreoffice.org/download/license/](https://www.libreoffice.org/download/license/)
or the [libreoffice.txt](https://github.com/Alfresco/acs-community-packaging/blob/master/zip/src/main/resources/licenses/3rd-party/libreoffice.txt) or the [libreoffice.txt](https://github.com/Alfresco/acs-community-packaging/blob/master/zip/src/main/resources/licenses/3rd-party/libreoffice.txt)

View File

@ -45,10 +45,27 @@
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.alfresco</groupId> <groupId>org.alfresco</groupId>
<artifactId>alfresco-core</artifactId> <artifactId>alfresco-core</artifactId>
<!--
TODO temp workaround for ATS-481 / REPO-4514 (exclude: dom4j.dom4j 1.6.1 / include org.dom4j.dom4j 2.1.1)
TODO remove this workaround once transitive dependencies have been fixed (surf-core-configservice -> alfresco-core)
-->
<exclusions>
<exclusion>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
</exclusion>
</exclusions>
</dependency> </dependency>
<dependency>
<groupId>org.dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>2.1.1</version>
</dependency>
<dependency> <dependency>
<groupId>org.alfresco</groupId> <groupId>org.alfresco</groupId>
<artifactId>alfresco-jodconverter-core</artifactId> <artifactId>alfresco-jodconverter-core</artifactId>

View File

@ -6,7 +6,7 @@
# - Apache License 2.0 # - Apache License 2.0
# - Apache License, Version 2.0 # - Apache License, Version 2.0
# - Apache License, version 2.0 # - Apache License, version 2.0
# - BSD # - BSD 3-clause New License
# - CDDL + GPLv2 with classpath exception # - CDDL + GPLv2 with classpath exception
# - CDDL 1.1 # - CDDL 1.1
# - CDDL+GPL License # - CDDL+GPL License
@ -19,18 +19,16 @@
# - MIT License # - MIT License
# - MIT license # - MIT license
# - Public Domain, per Creative Commons CC0 # - Public Domain, per Creative Commons CC0
# - Sun Binary Code License Agreement
# - The Apache License, Version 2.0 # - The Apache License, Version 2.0
# - The Apache Software License, Version 2.0 # - The Apache Software License, Version 2.0
# - The JSON License # - The JSON License
# - The MIT License # - The MIT License
# - The SAX License
# - The W3C License
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# Please fill the missing licenses for dependencies : # Please fill the missing licenses for dependencies :
# #
# #
#Fri Jun 21 12:09:19 EEST 2019 #Tue Jul 09 13:36:53 EEST 2019
javax.transaction--jta--1.1=Sun Binary Code License Agreement javax.transaction--jta--1.1=Sun Binary Code License Agreement
commons-httpclient--commons-httpclient--3.1-HTTPCLIENT-1265=Apache License 2.0 commons-httpclient--commons-httpclient--3.1-HTTPCLIENT-1265=Apache License 2.0
org.codehaus.guessencoding--guessencoding--1.4=Apache License 2.0 org.codehaus.guessencoding--guessencoding--1.4=Apache License 2.0
dom4j--dom4j--1.6.1=BSD

View File

@ -30,7 +30,7 @@ import static org.alfresco.transformer.fs.FileManager.createAttachment;
import static org.alfresco.transformer.fs.FileManager.createSourceFile; import static org.alfresco.transformer.fs.FileManager.createSourceFile;
import static org.alfresco.transformer.fs.FileManager.createTargetFile; import static org.alfresco.transformer.fs.FileManager.createTargetFile;
import static org.alfresco.transformer.fs.FileManager.createTargetFileName; import static org.alfresco.transformer.fs.FileManager.createTargetFileName;
import static org.alfresco.transformer.logging.StandardMessages.ENTERPRISE_LICENCE; import static org.alfresco.transformer.logging.StandardMessages.LICENCE;
import static org.springframework.http.HttpStatus.OK; import static org.springframework.http.HttpStatus.OK;
import java.io.File; import java.io.File;
@ -86,7 +86,7 @@ public class LibreOfficeController extends AbstractTransformerController
public LibreOfficeController() public LibreOfficeController()
{ {
logger.info("-------------------------------------------------------------------------------------------------------------------------------------------------------"); logger.info("-------------------------------------------------------------------------------------------------------------------------------------------------------");
Arrays.stream(ENTERPRISE_LICENCE.split("\\n")).forEach(logger::info); Arrays.stream(LICENCE.split("\\n")).forEach(logger::info);
logger.info("This transformer uses LibreOffice from The Document Foundation. See the license at https://www.libreoffice.org/download/license/ or in /libreoffice.txt"); logger.info("This transformer uses LibreOffice from The Document Foundation. See the license at https://www.libreoffice.org/download/license/ or in /libreoffice.txt");
logger.info("-------------------------------------------------------------------------------------------------------------------------------------------------------"); logger.info("-------------------------------------------------------------------------------------------------------------------------------------------------------");
} }

View File

@ -40,7 +40,8 @@ import org.springframework.test.context.junit4.SpringRunner;
* created on 15/01/2019 * created on 15/01/2019
*/ */
@RunWith(SpringRunner.class) @RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
properties = {"activemq.url=nio://localhost:61616"})
public class LibreOfficeQueueTransformServiceIT extends AbstractQueueTransformServiceIT public class LibreOfficeQueueTransformServiceIT extends AbstractQueueTransformServiceIT
{ {
@Override @Override

View File

@ -1,9 +1,8 @@
# Image provides a container in which to run Tika transformations for Alfresco Enterprise Content Services. # Image provides a container in which to run Tika transformations for Alfresco Content Services.
# The container is only intended to be used with the Alfresco Enterprise editon which is covered by https://www.alfresco.com/legal/agreements and https://www.alfresco.com/terms-use.
# Tika is from Apache. See the license at http://www.apache.org/licenses/LICENSE-2.0. # Tika is from Apache. See the license at http://www.apache.org/licenses/LICENSE-2.0.
FROM alfresco/alfresco-base-java:11.0.1-openjdk-centos-7-3e4e9f4e5d6a FROM alfresco/alfresco-base-java:11.0.1-openjdk-centos-7-6784d76a7b81
ENV APACHE_LICENSE_FILE=https://github.com/Alfresco/acs-community-packaging/blob/master/distribution/src/main/resources/licenses/3rd-party/Apache%202.0.txt ENV APACHE_LICENSE_FILE=https://github.com/Alfresco/acs-community-packaging/blob/master/distribution/src/main/resources/licenses/3rd-party/Apache%202.0.txt
ENV JAVA_OPTS="" ENV JAVA_OPTS=""

View File

@ -1,7 +1,5 @@
### Licenses ### Licenses
* The code in the alfresco-docker-imagemagick project is only intended to be use with the Alfresco Enterprise
Content Repository which is covered by [https://www.alfresco.com/legal/agreements](https://www.alfresco.com/legal/agreements) and [https://www.alfresco.com/terms-use](https://www.alfresco.com/terms-use)
* Tika is from Apache. See the license at http://www.apache.org/licenses/LICENSE-2.0 or the * Tika is from Apache. See the license at http://www.apache.org/licenses/LICENSE-2.0 or the
[Apache 2.0.txt](https://github.com/Alfresco/acs-community-packaging/blob/master/distribution/src/main/resources/licenses/3rd-party/Apache%202.0.txt) [Apache 2.0.txt](https://github.com/Alfresco/acs-community-packaging/blob/master/distribution/src/main/resources/licenses/3rd-party/Apache%202.0.txt)
file placed in the root directory of the docker image. file placed in the root directory of the docker image.

View File

@ -46,10 +46,27 @@
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.alfresco</groupId> <groupId>org.alfresco</groupId>
<artifactId>alfresco-core</artifactId> <artifactId>alfresco-core</artifactId>
<!--
TODO temp workaround for ATS-481 / REPO-4514 (exclude: dom4j.dom4j 1.6.1 / include org.dom4j.dom4j 2.1.1)
TODO remove this workaround once transitive dependencies have been fixed (surf-core-configservice -> alfresco-core)
-->
<exclusions>
<exclusion>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
</exclusion>
</exclusions>
</dependency> </dependency>
<dependency>
<groupId>org.dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>2.1.1</version>
</dependency>
<dependency> <dependency>
<groupId>org.alfresco</groupId> <groupId>org.alfresco</groupId>
<artifactId>alfresco-data-model</artifactId> <artifactId>alfresco-data-model</artifactId>

View File

@ -11,20 +11,17 @@
# - Apache License, version 2.0 # - Apache License, version 2.0
# - Apache Software License - Version 2.0 # - Apache Software License - Version 2.0
# - BSD # - BSD
# - BSD 3-clause New License
# - BSD License # - BSD License
# - BSD licence # - BSD licence
# - Bouncy Castle Licence # - Bouncy Castle Licence
# - CDDL + GPLv2 with classpath exception # - CDDL + GPLv2 with classpath exception
# - CDDL 1.1 # - CDDL 1.1
# - CDDL v1.1 / GPL v2 dual license
# - CDDL+GPL License # - CDDL+GPL License
# - CDDL, v1.0 # - CDDL, v1.0
# - CDDL/GPLv2+CE # - CDDL/GPLv2+CE
# - COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 # - COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
# - CPL # - CPL
# - Common Development and Distribution License (CDDL) v1.0
# - Dual license consisting of the CDDL v1.1 and GPL v2
# - EDL 1.0
# - EPL 2.0 # - EPL 2.0
# - Eclipse Distribution License - v 1.0 # - Eclipse Distribution License - v 1.0
# - Eclipse Public License - v 1.0 # - Eclipse Public License - v 1.0
@ -45,6 +42,7 @@
# - Public Domain, per Creative Commons CC0 # - Public Domain, per Creative Commons CC0
# - Similar to Apache License but with the acknowledgment clause removed # - Similar to Apache License but with the acknowledgment clause removed
# - Specification License # - Specification License
# - Sun Binary Code License Agreement
# - The Apache License, Version 2.0 # - The Apache License, Version 2.0
# - The Apache Software License, Version 2.0 # - The Apache Software License, Version 2.0
# - The BSD License # - The BSD License
@ -53,12 +51,11 @@
# - The SAX License # - The SAX License
# - The W3C License # - The W3C License
# - UnRar License # - UnRar License
# - lgpl
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# Please fill the missing licenses for dependencies : # Please fill the missing licenses for dependencies :
# #
# #
#Fri Jun 21 12:08:04 EEST 2019 #Tue Jul 09 13:34:27 EEST 2019
org.acegisecurity--acegi-security--0.8.2_patched=Apache License 2.0 org.acegisecurity--acegi-security--0.8.2_patched=Apache License 2.0
net.jcip--jcip-annotations--1.0=Public net.jcip--jcip-annotations--1.0=Public
xerces--xercesImpl--2.11.0-alfresco-patched-20180402=Apache License 2.0 xerces--xercesImpl--2.11.0-alfresco-patched-20180402=Apache License 2.0
@ -66,4 +63,3 @@ javax.transaction--jta--1.1=Sun Binary Code License Agreement
commons-httpclient--commons-httpclient--3.1-HTTPCLIENT-1265=Apache License 2.0 commons-httpclient--commons-httpclient--3.1-HTTPCLIENT-1265=Apache License 2.0
xpp3--xpp3--1.1.3_8=Apache 1.1 xpp3--xpp3--1.1.3_8=Apache 1.1
org.codehaus.guessencoding--guessencoding--1.4=Apache License 2.0 org.codehaus.guessencoding--guessencoding--1.4=Apache License 2.0
dom4j--dom4j--1.6.1=BSD

View File

@ -37,7 +37,7 @@ import static org.alfresco.transformer.fs.FileManager.createAttachment;
import static org.alfresco.transformer.fs.FileManager.createSourceFile; import static org.alfresco.transformer.fs.FileManager.createSourceFile;
import static org.alfresco.transformer.fs.FileManager.createTargetFile; import static org.alfresco.transformer.fs.FileManager.createTargetFile;
import static org.alfresco.transformer.fs.FileManager.createTargetFileName; import static org.alfresco.transformer.fs.FileManager.createTargetFileName;
import static org.alfresco.transformer.logging.StandardMessages.ENTERPRISE_LICENCE; import static org.alfresco.transformer.logging.StandardMessages.LICENCE;
import static org.alfresco.transformer.util.Util.stringToBoolean; import static org.alfresco.transformer.util.Util.stringToBoolean;
import static org.springframework.http.HttpStatus.BAD_REQUEST; import static org.springframework.http.HttpStatus.BAD_REQUEST;
import static org.springframework.http.HttpStatus.OK; import static org.springframework.http.HttpStatus.OK;
@ -96,7 +96,7 @@ public class TikaController extends AbstractTransformerController
public TikaController() public TikaController()
{ {
logger.info("--------------------------------------------------------------------------------------------------------------------------------------------------------------"); logger.info("--------------------------------------------------------------------------------------------------------------------------------------------------------------");
Arrays.stream(ENTERPRISE_LICENCE.split("\\n")).forEach(logger::info); Arrays.stream(LICENCE.split("\\n")).forEach(logger::info);
logger.info("Tika is from Apache. See the license at http://www.apache.org/licenses/LICENSE-2.0. or in /Apache\\ 2.0.txt"); logger.info("Tika is from Apache. See the license at http://www.apache.org/licenses/LICENSE-2.0. or in /Apache\\ 2.0.txt");
logger.info("--------------------------------------------------------------------------------------------------------------------------------------------------------------"); logger.info("--------------------------------------------------------------------------------------------------------------------------------------------------------------");
} }

View File

@ -41,7 +41,8 @@ import org.springframework.test.context.junit4.SpringRunner;
* created on 15/01/2019 * created on 15/01/2019
*/ */
@RunWith(SpringRunner.class) @RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
properties = {"activemq.url=nio://localhost:61616"})
public class TikaQueueTransformServiceIT extends AbstractQueueTransformServiceIT public class TikaQueueTransformServiceIT extends AbstractQueueTransformServiceIT
{ {
@Override @Override

View File

@ -1,6 +1,6 @@
# Image provides a container in which to run miscellaneous transformations for Alfresco Content Services. # Image provides a container in which to run miscellaneous transformations for Alfresco Content Services.
FROM alfresco/alfresco-base-java:11.0.1-openjdk-centos-7-3e4e9f4e5d6a FROM alfresco/alfresco-base-java:11.0.1-openjdk-centos-7-6784d76a7b81
ENV APACHE_LICENSE_FILE=https://github.com/Alfresco/acs-community-packaging/blob/master/distribution/src/main/resources/licenses/3rd-party/Apache%202.0.txt ENV APACHE_LICENSE_FILE=https://github.com/Alfresco/acs-community-packaging/blob/master/distribution/src/main/resources/licenses/3rd-party/Apache%202.0.txt
ENV JAVA_OPTS="" ENV JAVA_OPTS=""

View File

@ -47,9 +47,25 @@
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.alfresco</groupId> <groupId>org.alfresco</groupId>
<artifactId>alfresco-core</artifactId> <artifactId>alfresco-core</artifactId>
<!--
TODO temp workaround for ATS-481 / REPO-4514 (exclude: dom4j.dom4j 1.6.1 / include org.dom4j.dom4j 2.1.1)
TODO remove this workaround once transitive dependencies have been fixed (surf-core-configservice -> alfresco-core)
-->
<exclusions>
<exclusion>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>2.1.1</version>
</dependency> </dependency>
<!-- HtmlParserContentTransformer --> <!-- HtmlParserContentTransformer -->
@ -69,7 +85,7 @@
<dependency> <dependency>
<groupId>org.apache.pdfbox</groupId> <groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox-tools</artifactId> <artifactId>pdfbox-tools</artifactId>
<version>2.0.15</version> <version>2.0.16</version>
</dependency> </dependency>
<!-- OOXMLThumbnailContentTransformer --> <!-- OOXMLThumbnailContentTransformer -->

View File

@ -6,7 +6,7 @@
# - Apache License 2.0 # - Apache License 2.0
# - Apache License, Version 2.0 # - Apache License, Version 2.0
# - Apache License, version 2.0 # - Apache License, version 2.0
# - BSD # - BSD 3-clause New License
# - BSD License # - BSD License
# - CDDL + GPLv2 with classpath exception # - CDDL + GPLv2 with classpath exception
# - CDDL 1.1 # - CDDL 1.1
@ -21,18 +21,16 @@
# - MIT License # - MIT License
# - MIT license # - MIT license
# - Public Domain, per Creative Commons CC0 # - Public Domain, per Creative Commons CC0
# - Sun Binary Code License Agreement
# - The Apache License, Version 2.0 # - The Apache License, Version 2.0
# - The Apache Software License, Version 2.0 # - The Apache Software License, Version 2.0
# - The JSON License # - The JSON License
# - The MIT License # - The MIT License
# - The SAX License
# - The W3C License
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# Please fill the missing licenses for dependencies : # Please fill the missing licenses for dependencies :
# #
# #
#Fri Jun 21 12:09:33 EEST 2019 #Tue Jul 09 13:38:31 EEST 2019
javax.transaction--jta--1.1=Sun Binary Code License Agreement javax.transaction--jta--1.1=Sun Binary Code License Agreement
commons-httpclient--commons-httpclient--3.1-HTTPCLIENT-1265=Apache License 2.0 commons-httpclient--commons-httpclient--3.1-HTTPCLIENT-1265=Apache License 2.0
org.codehaus.guessencoding--guessencoding--1.4=Apache License 2.0 org.codehaus.guessencoding--guessencoding--1.4=Apache License 2.0
dom4j--dom4j--1.6.1=BSD

View File

@ -26,9 +26,26 @@
*/ */
package org.alfresco.transformer; package org.alfresco.transformer;
import org.alfresco.transformer.transformers.SelectingTransformer; import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_HTML;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_TEXT_PLAIN;
import static org.alfresco.transformer.fs.FileManager.createAttachment;
import static org.alfresco.transformer.fs.FileManager.createSourceFile;
import static org.alfresco.transformer.fs.FileManager.createTargetFile;
import static org.alfresco.transformer.fs.FileManager.createTargetFileName;
import static org.alfresco.transformer.transformers.HtmlParserContentTransformer.SOURCE_ENCODING;
import static org.alfresco.transformer.transformers.HtmlParserContentTransformer.TARGET_ENCODING;
import static org.springframework.http.HttpStatus.OK;
import static org.springframework.http.MediaType.MULTIPART_FORM_DATA_VALUE;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
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.alfresco.transformer.transformers.SelectingTransformer;
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;
@ -39,24 +56,6 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_HTML;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_TEXT_PLAIN;
import static org.alfresco.transformer.transformers.HtmlParserContentTransformer.SOURCE_ENCODING;
import static org.alfresco.transformer.transformers.HtmlParserContentTransformer.TARGET_ENCODING;
import static org.alfresco.transformer.fs.FileManager.createAttachment;
import static org.alfresco.transformer.fs.FileManager.createSourceFile;
import static org.alfresco.transformer.fs.FileManager.createTargetFile;
import static org.alfresco.transformer.fs.FileManager.createTargetFileName;
import static org.alfresco.transformer.logging.StandardMessages.ENTERPRISE_LICENCE;
import static org.springframework.http.HttpStatus.OK;
import static org.springframework.http.MediaType.MULTIPART_FORM_DATA_VALUE;
@Controller @Controller
public class MiscController extends AbstractTransformerController public class MiscController extends AbstractTransformerController
{ {

View File

@ -63,7 +63,7 @@ public class SelectingTransformer
transformers.add(new HtmlParserContentTransformer()); transformers.add(new HtmlParserContentTransformer());
transformers.add(new StringExtractingContentTransformer()); transformers.add(new StringExtractingContentTransformer());
transformers.add(new TextToPdfContentTransformer()); transformers.add(new TextToPdfContentTransformer());
// transformers.add(new OOXMLThumbnailContentTransformer()); // Doesn't work with java 11, comment put and disabled test // transformers.add(new OOXMLThumbnailContentTransformer()); // Doesn't work with java 11, transformer and test disabled
} }
/** /**
@ -90,10 +90,15 @@ public class SelectingTransformer
{ {
throw new TransformException(INTERNAL_SERVER_ERROR.value(), getMessage(e)); throw new TransformException(INTERNAL_SERVER_ERROR.value(), getMessage(e));
} }
if (!targetFile.exists() || targetFile.length() == 0) if (!targetFile.exists())
{ {
throw new TransformException(INTERNAL_SERVER_ERROR.value(), throw new TransformException(INTERNAL_SERVER_ERROR.value(),
"Transformer failed to create an output file"); "Transformer failed to create an output file. Target file does not exist.");
}
if (sourceFile.length() > 0 && targetFile.length() == 0)
{
throw new TransformException(INTERNAL_SERVER_ERROR.value(),
"Transformer failed to create an output file. Target file is empty but source file was not empty.");
} }
} }
@ -104,6 +109,11 @@ public class SelectingTransformer
{ {
if (transformer.isTransformable(sourceMimetype, targetMimetype, parameters)) if (transformer.isTransformable(sourceMimetype, targetMimetype, parameters))
{ {
if (logger.isDebugEnabled())
{
logger.debug("Using " + transformer.getClass().getName()
+ " to transform from " + sourceMimetype + " to " + targetMimetype );
}
return transformer; return transformer;
} }
} }

View File

@ -155,7 +155,7 @@ public class MiscControllerTest extends AbstractTransformerControllerTest
} }
@Test @Test
public void testStringtoString() throws Exception public void testStringToString() throws Exception
{ {
String expected = null; String expected = null;
byte[] content = null; byte[] content = null;
@ -181,6 +181,23 @@ public class MiscControllerTest extends AbstractTransformerControllerTest
assertTrue("The content did not include \""+expected, contentResult.contains(expected)); assertTrue("The content did not include \""+expected, contentResult.contains(expected));
} }
@Test
public void testEmptyTextFileReturnsEmptyFile() throws Exception
{
// Use empty content to create an empty source file
byte[] content = new byte[0];
MvcResult result = sendText("txt",
"UTF-8",
MIMETYPE_TEXT_PLAIN,
"txt",
MIMETYPE_TEXT_PLAIN,
"UTF-8",
content);
assertEquals("Returned content should be empty for an empty source file", 0, result.getResponse().getContentLength());
}
@Test @Test
public void textToPdf() throws Exception public void textToPdf() throws Exception
{ {

View File

@ -37,7 +37,8 @@ import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_HTML;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_TEXT_PLAIN; import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_TEXT_PLAIN;
@RunWith(SpringRunner.class) @RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
properties = {"activemq.url=nio://localhost:61616"})
public class MiscQueueTransformServiceIT extends AbstractQueueTransformServiceIT public class MiscQueueTransformServiceIT extends AbstractQueueTransformServiceIT
{ {
@Override @Override

View File

@ -39,10 +39,27 @@
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.alfresco</groupId> <groupId>org.alfresco</groupId>
<artifactId>alfresco-core</artifactId> <artifactId>alfresco-core</artifactId>
<!--
TODO temp workaround for ATS-481 / REPO-4514 (exclude: dom4j.dom4j 1.6.1 / include org.dom4j.dom4j 2.1.1)
TODO remove this workaround once transitive dependencies have been fixed (surf-core-configservice -> alfresco-core)
-->
<exclusions>
<exclusion>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
</exclusion>
</exclusions>
</dependency> </dependency>
<dependency>
<groupId>org.dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>2.1.1</version>
</dependency>
<dependency> <dependency>
<groupId>org.alfresco</groupId> <groupId>org.alfresco</groupId>
<artifactId>alfresco-transform-model</artifactId> <artifactId>alfresco-transform-model</artifactId>

View File

@ -38,6 +38,7 @@ import org.alfresco.transformer.messaging.TransformReplySender;
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;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.jms.annotation.JmsListener; import org.springframework.jms.annotation.JmsListener;
import org.springframework.jms.support.converter.MessageConversionException; import org.springframework.jms.support.converter.MessageConversionException;
@ -55,6 +56,7 @@ import java.util.Optional;
* created on 18/12/2018 * created on 18/12/2018
*/ */
@Component @Component
@ConditionalOnProperty(name="activemq.url")
public class QueueTransformService public class QueueTransformService
{ {
private static final Logger logger = LoggerFactory.getLogger(QueueTransformService.class); private static final Logger logger = LoggerFactory.getLogger(QueueTransformService.class);

View File

@ -28,10 +28,7 @@ package org.alfresco.transformer.logging;
public interface StandardMessages public interface StandardMessages
{ {
String ENTERPRISE_LICENCE = String LICENCE =
"This image is only intended to be used with the Alfresco Enterprise Content Repository which is covered by\n"+
"https://www.alfresco.com/legal/agreements and https://www.alfresco.com/terms-use\n" +
"\n" +
"License rights for this program may be obtained from Alfresco Software, Ltd. pursuant to a written agreement\n" + "License rights for this program may be obtained from Alfresco Software, Ltd. pursuant to a written agreement\n" +
"and any use of this program without such an agreement is prohibited.\n" + "and any use of this program without such an agreement is prohibited.\n" +
"\n" ; "\n" ;

View File

@ -34,6 +34,7 @@ import org.apache.activemq.command.ActiveMQQueue;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.jms.annotation.JmsListenerConfigurer; import org.springframework.jms.annotation.JmsListenerConfigurer;
@ -52,6 +53,7 @@ import org.springframework.transaction.PlatformTransactionManager;
* created on 18/12/2018 * created on 18/12/2018
*/ */
@Configuration @Configuration
@ConditionalOnProperty(name = "activemq.url")
public class MessagingConfig implements JmsListenerConfigurer public class MessagingConfig implements JmsListenerConfigurer
{ {
private static final Logger logger = LoggerFactory.getLogger(MessagingConfig.class); private static final Logger logger = LoggerFactory.getLogger(MessagingConfig.class);
@ -63,6 +65,7 @@ public class MessagingConfig implements JmsListenerConfigurer
} }
@Bean @Bean
@ConditionalOnProperty(name = "activemq.url")
public DefaultMessageHandlerMethodFactory methodFactory() public DefaultMessageHandlerMethodFactory methodFactory()
{ {
DefaultMessageHandlerMethodFactory factory = new DefaultMessageHandlerMethodFactory(); DefaultMessageHandlerMethodFactory factory = new DefaultMessageHandlerMethodFactory();
@ -71,6 +74,7 @@ public class MessagingConfig implements JmsListenerConfigurer
} }
@Bean @Bean
@ConditionalOnProperty(name = "activemq.url")
public DefaultJmsListenerContainerFactory jmsListenerContainerFactory( public DefaultJmsListenerContainerFactory jmsListenerContainerFactory(
final ConnectionFactory connectionFactory, final ConnectionFactory connectionFactory,
final TransformMessageConverter transformMessageConverter) final TransformMessageConverter transformMessageConverter)
@ -84,6 +88,7 @@ public class MessagingConfig implements JmsListenerConfigurer
} }
@Bean @Bean
@ConditionalOnProperty(name = "activemq.url")
public PlatformTransactionManager transactionManager(final ConnectionFactory connectionFactory) public PlatformTransactionManager transactionManager(final ConnectionFactory connectionFactory)
{ {
final JmsTransactionManager transactionManager = new JmsTransactionManager(); final JmsTransactionManager transactionManager = new JmsTransactionManager();
@ -92,6 +97,7 @@ public class MessagingConfig implements JmsListenerConfigurer
} }
@Bean @Bean
@ConditionalOnProperty(name = "activemq.url")
public Queue engineRequestQueue(@Value("${queue.engineRequestQueue}") String engineRequestQueueValue) public Queue engineRequestQueue(@Value("${queue.engineRequestQueue}") String engineRequestQueueValue)
{ {
return new ActiveMQQueue(engineRequestQueueValue); return new ActiveMQQueue(engineRequestQueueValue);

View File

@ -0,0 +1,56 @@
/*
* #%L
* Alfresco Transform Core
* %%
* Copyright (C) 2005 - 2019 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.transformer.messaging;
import javax.annotation.PostConstruct;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
/**
* Prints JMS status information at application startup.
*
* @author Cezar Leahu
*/
@Configuration
public class MessagingInfo
{
private static final Logger logger = LoggerFactory.getLogger(MessagingInfo.class);
@Value("${activemq.url:}")
private String activemqUrl;
@PostConstruct
public void init()
{
final boolean jms = activemqUrl != null && !activemqUrl.isBlank();
logger.info("JMS client is {}, activemq.url: '{}'", jms ? "ENABLED" : "DISABLED",
activemqUrl);
}
}

View File

@ -1,3 +1,4 @@
---
spring: spring:
servlet: servlet:
multipart: multipart:
@ -18,7 +19,7 @@ server:
logging: logging:
level: level:
#org.alfresco.util.exec.RuntimeExec: debug # org.alfresco.util.exec.RuntimeExec: debug
org.alfresco.transformer.LibreOfficeController: debug org.alfresco.transformer.LibreOfficeController: debug
org.alfresco.transformer.JodConverterSharedInstance: debug org.alfresco.transformer.JodConverterSharedInstance: debug
org.alfresco.transformer.AlfrescoPdfRendererController: debug org.alfresco.transformer.AlfrescoPdfRendererController: debug
@ -36,9 +37,9 @@ management:
web: web:
exposure: exposure:
include: include:
- metrics - metrics
- prometheus - prometheus
- health - health
metrics: metrics:
enable[http]: false enable[http]: false
enable[logback]: false enable[logback]: false
@ -46,4 +47,4 @@ management:
enable[jvm.classes]: false enable[jvm.classes]: false
container: container:
name: ${HOSTNAME:t-engine} name: ${HOSTNAME:t-engine}

View File

@ -26,12 +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.client.model.Mimetype.MIMETYPE_PDF;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import java.util.UUID;
import javax.jms.Queue; import javax.jms.Queue;
import org.alfresco.transform.client.model.TransformReply; import org.alfresco.transform.client.model.TransformReply;
@ -49,7 +45,7 @@ import org.springframework.test.context.junit4.SpringRunner;
* created on 15/01/2019 * created on 15/01/2019
*/ */
@RunWith(SpringRunner.class) @RunWith(SpringRunner.class)
@SpringBootTest @SpringBootTest(properties = {"activemq.url=nio://localhost:61616"})
public abstract class AbstractQueueTransformServiceIT public abstract class AbstractQueueTransformServiceIT
{ {
@Autowired @Autowired

24
pom.xml
View File

@ -14,10 +14,11 @@
<version>2.1.0-EA4-SNAPSHOT</version> <version>2.1.0-EA4-SNAPSHOT</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<properties> <properties>
<java.version>1.8</java.version> <java.version>1.8</java.version>
<image.tag>latest</image.tag> <image.tag>latest</image.tag>
<dependency.pdfbox.version>2.0.15</dependency.pdfbox.version> <dependency.pdfbox.version>2.0.16</dependency.pdfbox.version>
<dependency.alfresco-core.version>7.17</dependency.alfresco-core.version> <dependency.alfresco-core.version>7.17</dependency.alfresco-core.version>
<dependency.alfresco-data-model.version>8.39</dependency.alfresco-data-model.version> <dependency.alfresco-data-model.version>8.39</dependency.alfresco-data-model.version>
<dependency.alfresco-jodconverter-core.version>3.0.1.1</dependency.alfresco-jodconverter-core.version> <dependency.alfresco-jodconverter-core.version>3.0.1.1</dependency.alfresco-jodconverter-core.version>
@ -45,12 +46,29 @@
</scm> </scm>
<dependencyManagement> <dependencyManagement>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.alfresco</groupId> <groupId>org.alfresco</groupId>
<artifactId>alfresco-core</artifactId> <artifactId>alfresco-core</artifactId>
<version>${dependency.alfresco-core.version}</version> <version>${dependency.alfresco-core.version}</version>
<!--
TODO temp workaround for ATS-481 / REPO-4514 (exclude: dom4j.dom4j 1.6.1 / include org.dom4j.dom4j 2.1.1)
TODO remove this workaround once transitive dependencies have been fixed (surf-core-configservice -> alfresco-core)
-->
<exclusions>
<exclusion>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
</exclusion>
</exclusions>
</dependency> </dependency>
<dependency>
<groupId>org.dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>2.1.1</version>
</dependency>
<dependency> <dependency>
<groupId>org.alfresco</groupId> <groupId>org.alfresco</groupId>
<artifactId>alfresco-data-model</artifactId> <artifactId>alfresco-data-model</artifactId>
@ -149,7 +167,7 @@
<dependency> <dependency>
<groupId>com.github.junrar</groupId> <groupId>com.github.junrar</groupId>
<artifactId>junrar</artifactId> <artifactId>junrar</artifactId>
<version>1.0.1</version> <version>4.0.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.commons</groupId> <groupId>org.apache.commons</groupId>
@ -205,7 +223,7 @@
<plugin> <plugin>
<groupId>org.codehaus.mojo</groupId> <groupId>org.codehaus.mojo</groupId>
<artifactId>license-maven-plugin</artifactId> <artifactId>license-maven-plugin</artifactId>
<version>1.20</version> <version>2.0.0</version>
<configuration> <configuration>
<inceptionYear>2005</inceptionYear> <inceptionYear>2005</inceptionYear>
<organizationName>Alfresco Software Limited</organizationName> <organizationName>Alfresco Software Limited</organizationName>