mirror of
https://github.com/Alfresco/alfresco-transform-core.git
synced 2026-09-16 18:12:54 +00:00
ACS-10404 Base Branch - Test ATS T-core runtime compatibility with Java 21 and 25 (#1147)
* ACS-10404 Base Branch - Test ATS T-core runtime compatibility with Java 21 and 25 * ACS-10404 Test e2e AIO runtime compatibility with Java 21 and 25 (#1148) * ACS-10404 Test e2e AIO runtime compatibility with Java 21 and 25 * ACS-10404 pull failure * ACS-10404 review changes * ACS-10404 review changes * ACS-10404 ADDITIONAL_MAVEN_OPTS * ACS-10404 bin/sh failure fix * ACS-10404 fix * ACS-10404 updating to latest java images * ACS-10404: e2e tika tests failure - updating output property version (#1152) * ACS-10404: e2e tika tests failure - updating output property version * ACS-10404: precommit * ACS-10404: updating output property version to 1.1 * ACS-10404: updating output property version to 1.1 for HTML * ACS-10404: clean up * ACS-10404: clean up
This commit is contained in:
+59
-17
@@ -38,7 +38,7 @@ jobs:
|
|||||||
pre_commit:
|
pre_commit:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: Alfresco/alfresco-build-tools/.github/actions/pre-commit@v8.26.0
|
- uses: Alfresco/alfresco-build-tools/.github/actions/pre-commit@v9.3.1
|
||||||
|
|
||||||
veracode_sca:
|
veracode_sca:
|
||||||
name: "Veracode - Source Clear Scan (SCA)"
|
name: "Veracode - Source Clear Scan (SCA)"
|
||||||
@@ -50,11 +50,11 @@ jobs:
|
|||||||
github.event_name == 'pull_request'
|
github.event_name == 'pull_request'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.26.0
|
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v9.3.1
|
||||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.26.0
|
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v9.3.1
|
||||||
- name: "Clean-up SNAPSHOT artifacts"
|
- name: "Clean-up SNAPSHOT artifacts"
|
||||||
run: find "${HOME}/.m2/repository/" -type d -name "*-SNAPSHOT*" | xargs -r -l rm -rf
|
run: find "${HOME}/.m2/repository/" -type d -name "*-SNAPSHOT*" | xargs -r -l rm -rf
|
||||||
- uses: Alfresco/alfresco-build-tools/.github/actions/veracode@v8.26.0
|
- uses: Alfresco/alfresco-build-tools/.github/actions/veracode@v9.3.1
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
with:
|
with:
|
||||||
srcclr-api-token: ${{ secrets.SRCCLR_API_TOKEN }}
|
srcclr-api-token: ${{ secrets.SRCCLR_API_TOKEN }}
|
||||||
@@ -70,8 +70,8 @@ jobs:
|
|||||||
!contains(github.event.head_commit.message, '[skip tests]')
|
!contains(github.event.head_commit.message, '[skip tests]')
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.26.0
|
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v9.3.1
|
||||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.26.0
|
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v9.3.1
|
||||||
- name: "Login to Docker Hub"
|
- name: "Login to Docker Hub"
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
@@ -83,7 +83,7 @@ jobs:
|
|||||||
registry: quay.io
|
registry: quay.io
|
||||||
username: ${{ secrets.QUAY_USERNAME }}
|
username: ${{ secrets.QUAY_USERNAME }}
|
||||||
password: ${{ secrets.QUAY_PASSWORD }}
|
password: ${{ secrets.QUAY_PASSWORD }}
|
||||||
- uses: Alfresco/alfresco-build-tools/.github/actions/github-download-file@v8.26.0
|
- uses: Alfresco/alfresco-build-tools/.github/actions/github-download-file@v9.3.1
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.BOT_GITHUB_TOKEN }}
|
token: ${{ secrets.BOT_GITHUB_TOKEN }}
|
||||||
repository: "Alfresco/veracode-baseline-archive"
|
repository: "Alfresco/veracode-baseline-archive"
|
||||||
@@ -137,8 +137,8 @@ jobs:
|
|||||||
!contains(github.event.head_commit.message, '[skip tests]')
|
!contains(github.event.head_commit.message, '[skip tests]')
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.26.0
|
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v9.3.1
|
||||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.26.0
|
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v9.3.1
|
||||||
- uses: Alfresco/ya-pmd-scan@v4.1.0
|
- uses: Alfresco/ya-pmd-scan@v4.1.0
|
||||||
with:
|
with:
|
||||||
classpath-build-command: "mvn -ntp package -DskipTests"
|
classpath-build-command: "mvn -ntp package -DskipTests"
|
||||||
@@ -153,8 +153,8 @@ jobs:
|
|||||||
github.event_name != 'pull_request'
|
github.event_name != 'pull_request'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.26.0
|
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v9.3.1
|
||||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.26.0
|
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v9.3.1
|
||||||
- name: "Login to Docker Hub"
|
- name: "Login to Docker Hub"
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
@@ -210,8 +210,8 @@ jobs:
|
|||||||
testProfile: aio-test
|
testProfile: aio-test
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.26.0
|
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v9.3.1
|
||||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.26.0
|
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v9.3.1
|
||||||
- name: "Login to Docker Hub"
|
- name: "Login to Docker Hub"
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
@@ -238,10 +238,52 @@ jobs:
|
|||||||
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
|
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
|
||||||
run: bash _ci/test.sh ${{ matrix.testProfile }}
|
run: bash _ci/test.sh ${{ matrix.testProfile }}
|
||||||
|
|
||||||
|
e2e_javaruntime_tests:
|
||||||
|
name: "E2E AIO Smoke Tests ( Java: ${{ matrix.java }}"
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs:
|
||||||
|
- pre_commit
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
java: [ '21', '25' ]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v9.3.1
|
||||||
|
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v9.3.1
|
||||||
|
- name: "Login to Docker Hub"
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
- name: "Login to Quay.io"
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: quay.io
|
||||||
|
username: ${{ secrets.QUAY_USERNAME }}
|
||||||
|
password: ${{ secrets.QUAY_PASSWORD }}
|
||||||
|
- name: "Enable experimental docker features"
|
||||||
|
run: |
|
||||||
|
echo '{"experimental":true}' | sudo tee /etc/docker/daemon.json
|
||||||
|
sudo service docker restart
|
||||||
|
- name: "Clean-up SNAPSHOT artifacts"
|
||||||
|
run: find "${HOME}/.m2/repository/" -type d -name "*-SNAPSHOT*" | xargs -r -l rm -rf
|
||||||
|
- name: "Build local docker image"
|
||||||
|
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
|
||||||
|
run: bash _ci/build.sh full-build
|
||||||
|
- name: "Cache LibreOffice"
|
||||||
|
run: bash _ci/cache_artifacts.sh
|
||||||
|
- name: "Run tests"
|
||||||
|
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
|
||||||
|
env:
|
||||||
|
SMOKE_TESTS: true
|
||||||
|
JAVA_RUNTIME_VERSION: ${{ matrix.java }}
|
||||||
|
run: bash _ci/test.sh aio-test
|
||||||
|
|
||||||
release:
|
release:
|
||||||
name: "Release"
|
name: "Release"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [veracode_sca, build_and_test, all_tests_matrix]
|
needs: [veracode_sca, build_and_test, all_tests_matrix, e2e_javaruntime_tests]
|
||||||
if: >
|
if: >
|
||||||
!(failure() || cancelled()) &&
|
!(failure() || cancelled()) &&
|
||||||
contains(github.event.head_commit.message, '[release]') &&
|
contains(github.event.head_commit.message, '[release]') &&
|
||||||
@@ -251,8 +293,8 @@ jobs:
|
|||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.26.0
|
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v9.3.1
|
||||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.26.0
|
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v9.3.1
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v3
|
uses: docker/setup-qemu-action@v3
|
||||||
with:
|
with:
|
||||||
@@ -274,7 +316,7 @@ jobs:
|
|||||||
sudo service docker restart
|
sudo service docker restart
|
||||||
- name: "Clean-up SNAPSHOT artifacts"
|
- name: "Clean-up SNAPSHOT artifacts"
|
||||||
run: find "${HOME}/.m2/repository/" -type d -name "*-SNAPSHOT*" | xargs -r -l rm -rf
|
run: find "${HOME}/.m2/repository/" -type d -name "*-SNAPSHOT*" | xargs -r -l rm -rf
|
||||||
- uses: Alfresco/alfresco-build-tools/.github/actions/configure-git-author@v8.26.0
|
- uses: Alfresco/alfresco-build-tools/.github/actions/configure-git-author@v9.3.1
|
||||||
with:
|
with:
|
||||||
username: ${{ env.GIT_USERNAME }}
|
username: ${{ env.GIT_USERNAME }}
|
||||||
email: ${{ env.GIT_EMAIL }}
|
email: ${{ env.GIT_EMAIL }}
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
if [ -n "$JAVA_RUNTIME_VERSION" ]; then
|
||||||
|
declare -A JAVA_IMAGE_MAP=(
|
||||||
|
[21]="alfresco/alfresco-base-java:jre21-rockylinux9@sha256:792079aa36a7a1076e7d48dd800b5de5ffc1cd48e8460fd7e56f7107d375c0cc"
|
||||||
|
[25]="alfresco/alfresco-base-java:jre25-rockylinux9@sha256:2e8664a6148157e0fd8c7861120c31768f510b5baaac86fd90c8b58aef5941eb"
|
||||||
|
)
|
||||||
|
JAVA_BASE_IMAGE="${JAVA_IMAGE_MAP[$JAVA_RUNTIME_VERSION]}"
|
||||||
|
export JAVA_BASE_IMAGE
|
||||||
|
fi
|
||||||
+10
-1
@@ -11,12 +11,21 @@ pushd "$(dirname "${BASH_SOURCE[0]}")/../"
|
|||||||
# If the branch is "master" and the commit is not a Pull Request then deploy the JAR SNAPSHOT artifacts
|
# If the branch is "master" and the commit is not a Pull Request then deploy the JAR SNAPSHOT artifacts
|
||||||
[ "${PULL_REQUEST}" = "false" ] && [ "${BRANCH_NAME}" = "master" ] && DEPLOY="deploy" || DEPLOY="verify"
|
[ "${PULL_REQUEST}" = "false" ] && [ "${BRANCH_NAME}" = "master" ] && DEPLOY="deploy" || DEPLOY="verify"
|
||||||
|
|
||||||
|
if [ "${SMOKE_TESTS}" = "true" ]; then
|
||||||
|
ADDITIONAL_MAVEN_OPTS="-Dit.test=**/*IT.java"
|
||||||
|
else
|
||||||
|
ADDITIONAL_MAVEN_OPTS=""
|
||||||
|
fi
|
||||||
|
|
||||||
|
source "$(dirname "${BASH_SOURCE[0]}")/java_base_image_map.sh"
|
||||||
|
|
||||||
# Do not deploy snapshots for alfresco-transform-core, alfresco-transformer-base and alfresco-base-t-engine
|
# Do not deploy snapshots for alfresco-transform-core, alfresco-transformer-base and alfresco-base-t-engine
|
||||||
mvn -B -U -Dmaven.wagon.http.pool=false \
|
mvn -B -U -Dmaven.wagon.http.pool=false \
|
||||||
clean ${DEPLOY} \
|
clean ${DEPLOY} \
|
||||||
-DadditionalOption=-Xdoclint:none -Dmaven.javadoc.skip=true \
|
-DadditionalOption=-Xdoclint:none -Dmaven.javadoc.skip=true \
|
||||||
-Dparent.core.deploy.skip=true -Dtransformer.base.deploy.skip=true \
|
-Dparent.core.deploy.skip=true -Dtransformer.base.deploy.skip=true \
|
||||||
"-P${PROFILE},docker-it-setup,${1}"
|
"-P${PROFILE},docker-it-setup,${1}" \
|
||||||
|
${ADDITIONAL_MAVEN_OPTS}
|
||||||
|
|
||||||
docker ps -a -q | xargs -r -l docker stop ; docker ps -a -q | xargs -r -l docker rm
|
docker ps -a -q | xargs -r -l docker stop ; docker ps -a -q | xargs -r -l docker rm
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,8 @@
|
|||||||
# 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.
|
||||||
|
|
||||||
# More infos about this image: https://github.com/Alfresco/alfresco-docker-base-java
|
# More infos about this image: https://github.com/Alfresco/alfresco-docker-base-java
|
||||||
FROM alfresco/alfresco-base-java:jre17-rockylinux9@sha256:f98833508b7be8c4b44a25450f9faac44cacfdc075f2295e02836b93fd05bb9c
|
ARG JAVA_BASE_IMAGE=alfresco/alfresco-base-java:jre17-rockylinux9@sha256:f98833508b7be8c4b44a25450f9faac44cacfdc075f2295e02836b93fd05bb9c
|
||||||
|
FROM ${JAVA_BASE_IMAGE}
|
||||||
|
|
||||||
ARG EXIFTOOL_VERSION=12.25
|
ARG EXIFTOOL_VERSION=12.25
|
||||||
ARG EXIFTOOL_FOLDER=Image-ExifTool-${EXIFTOOL_VERSION}
|
ARG EXIFTOOL_FOLDER=Image-ExifTool-${EXIFTOOL_VERSION}
|
||||||
@@ -53,7 +54,8 @@ RUN ln /usr/bin/${env.project_artifactId}-${env.project_version}.jar /usr/bin/${
|
|||||||
else \
|
else \
|
||||||
LIBREOFFICE_ARM64_RPM_VERSION=$(curl -s $LIBREOFFICE_ARM64_RPM_URL | grep -o "${LIBREOFFICE_ARM64_RPM_VERSION}.*" | cut -d '"' -f 1 | sort | tail -n1) && \
|
LIBREOFFICE_ARM64_RPM_VERSION=$(curl -s $LIBREOFFICE_ARM64_RPM_URL | grep -o "${LIBREOFFICE_ARM64_RPM_VERSION}.*" | cut -d '"' -f 1 | sort | tail -n1) && \
|
||||||
dnf --enablerepo=devel install -y ${LIBREOFFICE_ARM64_RPM_URL}${LIBREOFFICE_ARM64_RPM_VERSION} && \
|
dnf --enablerepo=devel install -y ${LIBREOFFICE_ARM64_RPM_URL}${LIBREOFFICE_ARM64_RPM_VERSION} && \
|
||||||
update-alternatives --set java java-17-openjdk.aarch64; \
|
JAVA_VERSION=$(echo "$JAVA_BASE_IMAGE" | sed -E 's/.*jre([0-9]+).*/\1/') && \
|
||||||
|
update-alternatives --set java java-${JAVA_VERSION}-openjdk.aarch64; \
|
||||||
fi && \
|
fi && \
|
||||||
if [ "$(uname -m)" = "x86_64" ]; then \
|
if [ "$(uname -m)" = "x86_64" ]; then \
|
||||||
curl -s -S $ALFRESCO_PDF_RENDERER_LIB_RPM_URL -o alfresco-pdf-renderer-linux.tgz; \
|
curl -s -S $ALFRESCO_PDF_RENDERER_LIB_RPM_URL -o alfresco-pdf-renderer-linux.tgz; \
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
# 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.
|
||||||
|
|
||||||
# More infos about this image: https://github.com/Alfresco/alfresco-docker-base-java
|
# More infos about this image: https://github.com/Alfresco/alfresco-docker-base-java
|
||||||
FROM alfresco/alfresco-base-java:jre17-rockylinux9@sha256:f98833508b7be8c4b44a25450f9faac44cacfdc075f2295e02836b93fd05bb9c
|
ARG JAVA_BASE_IMAGE=alfresco/alfresco-base-java:jre17-rockylinux9@sha256:f98833508b7be8c4b44a25450f9faac44cacfdc075f2295e02836b93fd05bb9c
|
||||||
|
FROM ${JAVA_BASE_IMAGE}
|
||||||
|
|
||||||
# For other ImageMagick versions please look at https://github.com/Alfresco/imagemagick-build tags
|
# For other ImageMagick versions please look at https://github.com/Alfresco/imagemagick-build tags
|
||||||
ARG IMAGEMAGICK_VERSION=7.1.2-6
|
ARG IMAGEMAGICK_VERSION=7.1.2-6
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
# 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.
|
||||||
|
|
||||||
# More infos about this image: https://github.com/Alfresco/alfresco-docker-base-java
|
# More infos about this image: https://github.com/Alfresco/alfresco-docker-base-java
|
||||||
FROM alfresco/alfresco-base-java:jre17-rockylinux9@sha256:f98833508b7be8c4b44a25450f9faac44cacfdc075f2295e02836b93fd05bb9c
|
ARG JAVA_BASE_IMAGE=alfresco/alfresco-base-java:jre17-rockylinux9@sha256:f98833508b7be8c4b44a25450f9faac44cacfdc075f2295e02836b93fd05bb9c
|
||||||
|
FROM ${JAVA_BASE_IMAGE}
|
||||||
|
|
||||||
ARG LIBREOFFICE_VERSION=7.2.5
|
ARG LIBREOFFICE_VERSION=7.2.5
|
||||||
|
|
||||||
@@ -32,7 +33,8 @@ RUN ln /${env.project_artifactId}-${env.project_version}.jar /usr/bin/${env.proj
|
|||||||
else \
|
else \
|
||||||
LIBREOFFICE_ARM64_RPM_VERSION=$(curl -s $LIBREOFFICE_ARM64_RPM_URL | grep -o "${LIBREOFFICE_ARM64_RPM_VERSION}.*" | cut -d '"' -f 1 | sort | tail -n1) && \
|
LIBREOFFICE_ARM64_RPM_VERSION=$(curl -s $LIBREOFFICE_ARM64_RPM_URL | grep -o "${LIBREOFFICE_ARM64_RPM_VERSION}.*" | cut -d '"' -f 1 | sort | tail -n1) && \
|
||||||
dnf --enablerepo=devel install -y ${LIBREOFFICE_ARM64_RPM_URL}${LIBREOFFICE_ARM64_RPM_VERSION} && \
|
dnf --enablerepo=devel install -y ${LIBREOFFICE_ARM64_RPM_URL}${LIBREOFFICE_ARM64_RPM_VERSION} && \
|
||||||
update-alternatives --set java java-17-openjdk.aarch64; \
|
JAVA_VERSION=$(echo "$JAVA_BASE_IMAGE" | sed -E 's/.*jre([0-9]+).*/\1/') && \
|
||||||
|
update-alternatives --set java java-${JAVA_VERSION}-openjdk.aarch64; \
|
||||||
fi && \
|
fi && \
|
||||||
yum clean all
|
yum clean all
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
# 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.
|
||||||
|
|
||||||
# More infos about this image: https://github.com/Alfresco/alfresco-docker-base-java
|
# More infos about this image: https://github.com/Alfresco/alfresco-docker-base-java
|
||||||
FROM alfresco/alfresco-base-java:jre17-rockylinux9@sha256:f98833508b7be8c4b44a25450f9faac44cacfdc075f2295e02836b93fd05bb9c
|
ARG JAVA_BASE_IMAGE=alfresco/alfresco-base-java:jre17-rockylinux9@sha256:f98833508b7be8c4b44a25450f9faac44cacfdc075f2295e02836b93fd05bb9c
|
||||||
|
FROM ${JAVA_BASE_IMAGE}
|
||||||
|
|
||||||
ENV JAVA_OPTS=""
|
ENV JAVA_OPTS=""
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
# 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.
|
||||||
|
|
||||||
# More infos about this image: https://github.com/Alfresco/alfresco-docker-base-java
|
# More infos about this image: https://github.com/Alfresco/alfresco-docker-base-java
|
||||||
FROM alfresco/alfresco-base-java:jre17-rockylinux9@sha256:f98833508b7be8c4b44a25450f9faac44cacfdc075f2295e02836b93fd05bb9c
|
ARG JAVA_BASE_IMAGE=alfresco/alfresco-base-java:jre17-rockylinux9@sha256:f98833508b7be8c4b44a25450f9faac44cacfdc075f2295e02836b93fd05bb9c
|
||||||
|
FROM ${JAVA_BASE_IMAGE}
|
||||||
|
|
||||||
ARG PDF_RENDERER_VERSION=1.2
|
ARG PDF_RENDERER_VERSION=1.2
|
||||||
ENV ALFRESCO_PDF_RENDERER_LIB_RPM_URL=https://nexus.alfresco.com/nexus/service/local/repositories/releases/org/alfresco/alfresco-pdf-renderer/${PDF_RENDERER_VERSION}/alfresco-pdf-renderer-${PDF_RENDERER_VERSION}-linux.tgz
|
ENV ALFRESCO_PDF_RENDERER_LIB_RPM_URL=https://nexus.alfresco.com/nexus/service/local/repositories/releases/org/alfresco/alfresco-pdf-renderer/${PDF_RENDERER_VERSION}/alfresco-pdf-renderer-${PDF_RENDERER_VERSION}-linux.tgz
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
# 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.
|
||||||
|
|
||||||
# More infos about this image: https://github.com/Alfresco/alfresco-docker-base-java
|
# More infos about this image: https://github.com/Alfresco/alfresco-docker-base-java
|
||||||
FROM alfresco/alfresco-base-java:jre17-rockylinux9@sha256:f98833508b7be8c4b44a25450f9faac44cacfdc075f2295e02836b93fd05bb9c
|
ARG JAVA_BASE_IMAGE=alfresco/alfresco-base-java:jre17-rockylinux9@sha256:f98833508b7be8c4b44a25450f9faac44cacfdc075f2295e02836b93fd05bb9c
|
||||||
|
FROM ${JAVA_BASE_IMAGE}
|
||||||
|
|
||||||
ARG EXIFTOOL_VERSION=12.25
|
ARG EXIFTOOL_VERSION=12.25
|
||||||
ARG EXIFTOOL_FOLDER=Image-ExifTool-${EXIFTOOL_VERSION}
|
ARG EXIFTOOL_FOLDER=Image-ExifTool-${EXIFTOOL_VERSION}
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ import java.util.List;
|
|||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
import javax.xml.transform.OutputKeys;
|
import javax.xml.transform.OutputKeys;
|
||||||
|
import javax.xml.transform.Transformer;
|
||||||
import javax.xml.transform.TransformerConfigurationException;
|
import javax.xml.transform.TransformerConfigurationException;
|
||||||
import javax.xml.transform.sax.SAXTransformerFactory;
|
import javax.xml.transform.sax.SAXTransformerFactory;
|
||||||
import javax.xml.transform.sax.TransformerHandler;
|
import javax.xml.transform.sax.TransformerHandler;
|
||||||
@@ -248,40 +249,37 @@ public class Tika
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
ContentHandler handler;
|
|
||||||
if (MIMETYPE_TEXT_PLAIN.equals(targetMimetype))
|
if (MIMETYPE_TEXT_PLAIN.equals(targetMimetype))
|
||||||
{
|
{
|
||||||
handler = new BodyContentHandler(output);
|
return new BodyContentHandler(output);
|
||||||
|
}
|
||||||
|
if (MIMETYPE_TEXT_CSV.equals(targetMimetype))
|
||||||
|
{
|
||||||
|
return new CsvContentHandler(output);
|
||||||
|
}
|
||||||
|
|
||||||
|
SAXTransformerFactory factory = (SAXTransformerFactory) SAXTransformerFactory.newInstance();
|
||||||
|
TransformerHandler transformerHandler = factory.newTransformerHandler();
|
||||||
|
Transformer transformer = transformerHandler.getTransformer();
|
||||||
|
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
|
||||||
|
|
||||||
|
if (MIMETYPE_HTML.equals(targetMimetype))
|
||||||
|
{
|
||||||
|
transformer.setOutputProperty(OutputKeys.VERSION, "1.1");
|
||||||
|
transformer.setOutputProperty(OutputKeys.METHOD, HTML);
|
||||||
|
transformerHandler.setResult(new StreamResult(output));
|
||||||
|
return new ExpandedTitleContentHandler(transformerHandler);
|
||||||
|
}
|
||||||
|
else if (MIMETYPE_XHTML.equals(targetMimetype) || MIMETYPE_XML.equals(targetMimetype))
|
||||||
|
{
|
||||||
|
transformer.setOutputProperty(OutputKeys.METHOD, XML);
|
||||||
|
transformerHandler.setResult(new StreamResult(output));
|
||||||
|
return transformerHandler;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SAXTransformerFactory factory = (SAXTransformerFactory) SAXTransformerFactory.newInstance();
|
throw new IllegalArgumentException("Invalid target mimetype " + targetMimetype);
|
||||||
TransformerHandler transformerHandler;
|
|
||||||
transformerHandler = factory.newTransformerHandler();
|
|
||||||
transformerHandler.getTransformer().setOutputProperty(OutputKeys.INDENT, "yes");
|
|
||||||
transformerHandler.setResult(new StreamResult(output));
|
|
||||||
handler = transformerHandler;
|
|
||||||
|
|
||||||
if (MIMETYPE_HTML.equals(targetMimetype))
|
|
||||||
{
|
|
||||||
transformerHandler.getTransformer().setOutputProperty(OutputKeys.METHOD, HTML);
|
|
||||||
return new ExpandedTitleContentHandler(transformerHandler);
|
|
||||||
}
|
|
||||||
else if (MIMETYPE_XHTML.equals(targetMimetype) ||
|
|
||||||
MIMETYPE_XML.equals(targetMimetype))
|
|
||||||
{
|
|
||||||
transformerHandler.getTransformer().setOutputProperty(OutputKeys.METHOD, XML);
|
|
||||||
}
|
|
||||||
else if (MIMETYPE_TEXT_CSV.equals(targetMimetype))
|
|
||||||
{
|
|
||||||
handler = new CsvContentHandler(output);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
throw new IllegalArgumentException("Invalid target mimetype " + targetMimetype);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return handler;
|
|
||||||
}
|
}
|
||||||
catch (TransformerConfigurationException e)
|
catch (TransformerConfigurationException e)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user