mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-09-10 14:11:58 +00:00
Compare commits
38 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
d978b1cd68 | ||
|
dce356fe74 | ||
|
f965165894 | ||
|
2ac44c24a8 | ||
|
a0dc5a0d70 | ||
|
af94063bbb | ||
|
87b91b6cae | ||
|
6bdcaa9b10 | ||
|
86070d881c | ||
|
a82199967c | ||
|
f09266c081 | ||
|
563f65825f | ||
|
8bedeedfd5 | ||
|
a73cf6a71d | ||
|
1bdd6c022c | ||
|
1b553dbcaf | ||
|
5a3b4e1a0d | ||
|
1a0156b1e5 | ||
|
6ac9248262 | ||
|
70290c8f23 | ||
|
7d135b9356 | ||
|
df4629b801 | ||
|
df6f656b95 | ||
|
f27718c43b | ||
|
cbf0aaaaa4 | ||
|
2da78a94ad | ||
|
3325e08d57 | ||
|
985205e78e | ||
|
5fd5e75bd2 | ||
|
279bc15aac | ||
|
a3283b4521 | ||
|
e09c9118b2 | ||
|
330256438b | ||
|
2214f16e6e | ||
|
2237a45e76 | ||
|
f71a003904 | ||
|
10d55824f8 | ||
|
69f8bda762 |
102
.github/workflows/ci.yml
vendored
102
.github/workflows/ci.yml
vendored
@@ -71,56 +71,58 @@ jobs:
|
||||
- name: "Clean Maven cache"
|
||||
run: bash ./scripts/ci/cleanup_cache.sh
|
||||
|
||||
veracode_sast:
|
||||
name: "Pipeline SAST Scan"
|
||||
runs-on: ubuntu-latest
|
||||
needs: [prepare]
|
||||
if: >
|
||||
(github.ref_name == 'master' || startsWith(github.ref_name, 'release/') || github.event_name == 'pull_request') &&
|
||||
github.actor != 'dependabot[bot]' &&
|
||||
!contains(github.event.head_commit.message, '[skip tests]') &&
|
||||
!contains(github.event.head_commit.message, '[force')
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.35.2
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v1.35.2
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.35.2
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/github-download-file@v5.6.0
|
||||
with:
|
||||
token: ${{ secrets.BOT_GITHUB_TOKEN }}
|
||||
repository: "Alfresco/veracode-baseline-archive"
|
||||
file-path: "alfresco-community-repo/alfresco-community-repo-baseline.json"
|
||||
target: "baseline.json"
|
||||
- name: "Build"
|
||||
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
|
||||
run: |
|
||||
bash ./scripts/ci/init.sh
|
||||
bash ./scripts/ci/build.sh
|
||||
- name: "Run SAST Scan"
|
||||
uses: veracode/Veracode-pipeline-scan-action@v1.0.10
|
||||
with:
|
||||
vid: ${{ secrets.VERACODE_API_ID }}
|
||||
vkey: ${{ secrets.VERACODE_API_KEY }}
|
||||
file: "packaging/war/target/alfresco.war"
|
||||
fail_build: true
|
||||
project_name: alfresco-community-repo
|
||||
issue_details: true
|
||||
veracode_policy_name: Alfresco Default
|
||||
summary_output: true
|
||||
summary_output_file: results.json
|
||||
summary_display: true
|
||||
baseline_file: baseline.json
|
||||
- name: Upload scan result
|
||||
if: success() || failure()
|
||||
run: zip readable_output.zip results.json
|
||||
- name: Upload Artifact
|
||||
if: success() || failure()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Veracode Pipeline-Scan Results (Human Readable)
|
||||
path: readable_output.zip
|
||||
- name: "Clean Maven cache"
|
||||
run: bash ./scripts/ci/cleanup_cache.sh
|
||||
# SEE: ACS-6931 Currently times out after an hour. TO BE RESTORED after resolving the issue with Veracode Support.
|
||||
#
|
||||
# veracode_sast:
|
||||
# name: "Pipeline SAST Scan"
|
||||
# runs-on: ubuntu-latest
|
||||
# needs: [prepare]
|
||||
# if: >
|
||||
# (github.ref_name == 'master' || startsWith(github.ref_name, 'release/') || github.event_name == 'pull_request') &&
|
||||
# github.actor != 'dependabot[bot]' &&
|
||||
# !contains(github.event.head_commit.message, '[skip tests]') &&
|
||||
# !contains(github.event.head_commit.message, '[force')
|
||||
# steps:
|
||||
# - uses: actions/checkout@v3
|
||||
# - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.35.2
|
||||
# - uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v1.35.2
|
||||
# - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.35.2
|
||||
# - uses: Alfresco/alfresco-build-tools/.github/actions/github-download-file@v5.6.0
|
||||
# with:
|
||||
# token: ${{ secrets.BOT_GITHUB_TOKEN }}
|
||||
# repository: "Alfresco/veracode-baseline-archive"
|
||||
# file-path: "alfresco-community-repo/alfresco-community-repo-baseline.json"
|
||||
# target: "baseline.json"
|
||||
# - name: "Build"
|
||||
# timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
|
||||
# run: |
|
||||
# bash ./scripts/ci/init.sh
|
||||
# bash ./scripts/ci/build.sh
|
||||
# - name: "Run SAST Scan"
|
||||
# uses: veracode/Veracode-pipeline-scan-action@v1.0.10
|
||||
# with:
|
||||
# vid: ${{ secrets.VERACODE_API_ID }}
|
||||
# vkey: ${{ secrets.VERACODE_API_KEY }}
|
||||
# file: "packaging/war/target/alfresco.war"
|
||||
# fail_build: true
|
||||
# project_name: alfresco-community-repo
|
||||
# issue_details: true
|
||||
# veracode_policy_name: Alfresco Default
|
||||
# summary_output: true
|
||||
# summary_output_file: results.json
|
||||
# summary_display: true
|
||||
# baseline_file: baseline.json
|
||||
# - name: Upload scan result
|
||||
# if: success() || failure()
|
||||
# run: zip readable_output.zip results.json
|
||||
# - name: Upload Artifact
|
||||
# if: success() || failure()
|
||||
# uses: actions/upload-artifact@v3
|
||||
# with:
|
||||
# name: Veracode Pipeline-Scan Results (Human Readable)
|
||||
# path: readable_output.zip
|
||||
# - name: "Clean Maven cache"
|
||||
# run: bash ./scripts/ci/cleanup_cache.sh
|
||||
|
||||
pmd_scan:
|
||||
name: "PMD Scan"
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-amps</artifactId>
|
||||
<version>23.3.0.1</version>
|
||||
<version>23.3.0.13</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-governance-services-community-parent</artifactId>
|
||||
<version>23.3.0.1</version>
|
||||
<version>23.3.0.13</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-governance-services-automation-community-repo</artifactId>
|
||||
<version>23.3.0.1</version>
|
||||
<version>23.3.0.13</version>
|
||||
</parent>
|
||||
|
||||
<build>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-governance-services-community-parent</artifactId>
|
||||
<version>23.3.0.1</version>
|
||||
<version>23.3.0.13</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
@@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-governance-services-community-repo-parent</artifactId>
|
||||
<version>23.3.0.1</version>
|
||||
<version>23.3.0.13</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-governance-services-community-repo-parent</artifactId>
|
||||
<version>23.3.0.1</version>
|
||||
<version>23.3.0.13</version>
|
||||
</parent>
|
||||
|
||||
<build>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>23.3.0.1</version>
|
||||
<version>23.3.0.13</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
@@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-amps</artifactId>
|
||||
<version>23.3.0.1</version>
|
||||
<version>23.3.0.13</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>23.3.0.1</version>
|
||||
<version>23.3.0.13</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>23.3.0.1</version>
|
||||
<version>23.3.0.13</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>23.3.0.1</version>
|
||||
<version>23.3.0.13</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
@@ -9,6 +9,6 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||
<version>23.3.0.1</version>
|
||||
<version>23.3.0.13</version>
|
||||
</parent>
|
||||
</project>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||
<version>23.3.0.1</version>
|
||||
<version>23.3.0.13</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>23.3.0.1</version>
|
||||
<version>23.3.0.13</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||
<version>23.3.0.1</version>
|
||||
<version>23.3.0.13</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>23.3.0.1</version>
|
||||
<version>23.3.0.13</version>
|
||||
</parent>
|
||||
|
||||
<organization>
|
||||
|
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>23.3.0.1</version>
|
||||
<version>23.3.0.13</version>
|
||||
</parent>
|
||||
|
||||
<developers>
|
||||
|
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>23.3.0.1</version>
|
||||
<version>23.3.0.13</version>
|
||||
</parent>
|
||||
|
||||
<developers>
|
||||
|
@@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>23.3.0.1</version>
|
||||
<version>23.3.0.13</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>23.3.0.1</version>
|
||||
<version>23.3.0.13</version>
|
||||
</parent>
|
||||
|
||||
<developers>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||
<version>23.3.0.1</version>
|
||||
<version>23.3.0.13</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
22
pom.xml
22
pom.xml
@@ -2,7 +2,7 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>23.3.0.1</version>
|
||||
<version>23.3.0.13</version>
|
||||
<packaging>pom</packaging>
|
||||
<name>Alfresco Community Repo Parent</name>
|
||||
|
||||
@@ -51,14 +51,14 @@
|
||||
<dependency.alfresco-server-root.version>7.0.1</dependency.alfresco-server-root.version>
|
||||
<dependency.activiti-engine.version>5.23.0</dependency.activiti-engine.version>
|
||||
<dependency.activiti.version>5.23.0</dependency.activiti.version>
|
||||
<dependency.alfresco-transform-core.version>5.1.0-A1</dependency.alfresco-transform-core.version>
|
||||
<dependency.alfresco-transform-service.version>4.1.0-A1</dependency.alfresco-transform-service.version>
|
||||
<dependency.alfresco-transform-core.version>5.1.0</dependency.alfresco-transform-core.version>
|
||||
<dependency.alfresco-transform-service.version>4.1.0</dependency.alfresco-transform-service.version>
|
||||
<dependency.alfresco-greenmail.version>7.0</dependency.alfresco-greenmail.version>
|
||||
<dependency.acs-event-model.version>0.0.27</dependency.acs-event-model.version>
|
||||
|
||||
<dependency.aspectj.version>1.9.20.1</dependency.aspectj.version>
|
||||
<dependency.spring.version>6.0.14</dependency.spring.version>
|
||||
<dependency.spring-security.version>6.1.4</dependency.spring-security.version>
|
||||
<dependency.spring.version>6.0.17</dependency.spring.version>
|
||||
<dependency.spring-security.version>6.2.2</dependency.spring-security.version>
|
||||
<dependency.antlr.version>3.5.3</dependency.antlr.version>
|
||||
<dependency.jackson.version>2.15.2</dependency.jackson.version>
|
||||
<dependency.cxf.version>4.0.2</dependency.cxf.version>
|
||||
@@ -88,7 +88,7 @@
|
||||
<dependency.camel.version>4.0.0</dependency.camel.version> <!-- when bumping this version, please keep track/sync with included netty.io dependencies -->
|
||||
<dependency.netty.version>4.1.96.Final</dependency.netty.version> <!-- must be in sync with camels transitive dependencies, e.g.: netty-common -->
|
||||
<dependency.activemq.version>5.18.3</dependency.activemq.version>
|
||||
<dependency.apache-compress.version>1.25.0</dependency.apache-compress.version>
|
||||
<dependency.apache-compress.version>1.26.0</dependency.apache-compress.version>
|
||||
<dependency.awaitility.version>4.2.0</dependency.awaitility.version>
|
||||
<dependency.swagger-ui.version>4.1.3</dependency.swagger-ui.version>
|
||||
<dependency.swagger-parser.version>1.0.67</dependency.swagger-parser.version>
|
||||
@@ -112,9 +112,9 @@
|
||||
<dependency.jakarta-ee-json-impl.version>1.1.4</dependency.jakarta-ee-json-impl.version>
|
||||
<dependency.jakarta-json-path.version>2.9.0</dependency.jakarta-json-path.version>
|
||||
<dependency.json-smart.version>2.5.0</dependency.json-smart.version>
|
||||
<alfresco.googledrive.version>4.1.0-A1</alfresco.googledrive.version>
|
||||
<alfresco.aos-module.version>3.0.0-A1</alfresco.aos-module.version>
|
||||
<alfresco.api-explorer.version>23.1.0</alfresco.api-explorer.version> <!-- Also in alfresco-enterprise-share -->
|
||||
<alfresco.googledrive.version>4.1.0</alfresco.googledrive.version>
|
||||
<alfresco.aos-module.version>3.0.0</alfresco.aos-module.version>
|
||||
<alfresco.api-explorer.version>23.2.0</alfresco.api-explorer.version> <!-- Also in alfresco-enterprise-share -->
|
||||
|
||||
<alfresco.maven-plugin.version>2.2.0</alfresco.maven-plugin.version>
|
||||
<license-maven-plugin.version>2.0.1</license-maven-plugin.version>
|
||||
@@ -151,7 +151,7 @@
|
||||
<connection>scm:git:https://github.com/Alfresco/alfresco-community-repo.git</connection>
|
||||
<developerConnection>scm:git:https://github.com/Alfresco/alfresco-community-repo.git</developerConnection>
|
||||
<url>https://github.com/Alfresco/alfresco-community-repo</url>
|
||||
<tag>23.3.0.1</tag>
|
||||
<tag>23.3.0.13</tag>
|
||||
</scm>
|
||||
|
||||
<distributionManagement>
|
||||
@@ -328,7 +328,7 @@
|
||||
<dependency>
|
||||
<groupId>xalan</groupId>
|
||||
<artifactId>xalan</artifactId>
|
||||
<version>2.7.2-alfresco</version>
|
||||
<version>2.7.3-alfresco</version>
|
||||
<exclusions>
|
||||
<!-- [ACS-544] Excluded to avoid conflict in JDK9+ as it includes javax.xml and w3c.org -->
|
||||
<exclusion>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>23.3.0.1</version>
|
||||
<version>23.3.0.13</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>23.3.0.1</version>
|
||||
<version>23.3.0.13</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
@@ -1,28 +1,28 @@
|
||||
/*
|
||||
* #%L
|
||||
* Alfresco Repository
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2016 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%
|
||||
*/
|
||||
/*
|
||||
* #%L
|
||||
* Alfresco Repository
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2024 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.repo.template;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -59,6 +59,7 @@ import org.apache.bsf.BSFManager;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.xalan.processor.TransformerFactoryImpl;
|
||||
import org.apache.xml.utils.Constants;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
@@ -142,6 +143,7 @@ public class XSLTProcessor extends BaseProcessor implements TemplateProcessor
|
||||
|
||||
XSLTemplateModel xsltModel = (XSLTemplateModel) model;
|
||||
System.setProperty("org.apache.xalan.extensions.bsf.BSFManager", BSFManager.class.getName());
|
||||
System.setProperty("javax.xml.transform.TransformerFactory", TransformerFactoryImpl.class.getName());
|
||||
|
||||
Document xslTemplate;
|
||||
try
|
||||
|
@@ -318,13 +318,13 @@
|
||||
<select id="select_MinMaxAuditEntryId" parameterMap="parameter_IdMinMaxMap" resultMap="result_minMaxMap">
|
||||
select
|
||||
<if test="max != null">
|
||||
max(alf_audit_entry.id)
|
||||
max(alf_audit_entry.id) as max
|
||||
</if>
|
||||
<if test="max != null and min != null">
|
||||
,
|
||||
</if>
|
||||
<if test="min != null">
|
||||
min(alf_audit_entry.id)
|
||||
min(alf_audit_entry.id) as min
|
||||
</if>
|
||||
from
|
||||
alf_audit_entry
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Repository
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2023 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2024 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
@@ -36,6 +36,7 @@ import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import jakarta.transaction.UserTransaction;
|
||||
|
||||
@@ -60,6 +61,7 @@ import org.alfresco.util.GUID;
|
||||
import org.alfresco.util.Pair;
|
||||
import org.alfresco.util.testing.category.DBTests;
|
||||
import org.apache.commons.lang3.mutable.MutableInt;
|
||||
import org.junit.Test;
|
||||
import org.junit.experimental.categories.Category;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
|
||||
@@ -157,30 +159,41 @@ public class AuditDAOTest extends TestCase
|
||||
doAuditEntryImpl(1000);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAuditMinMaxByApp() throws Exception
|
||||
{
|
||||
final String[] expectedExtremes = {"min", "max"};
|
||||
final AuditApplicationInfo appInfo = doAuditEntryImpl(12);
|
||||
|
||||
final Map<String, Long> minMax = auditDAO.getAuditMinMaxByApp(appInfo.getId(), List.of(expectedExtremes));
|
||||
|
||||
assertEquals(Set.of(expectedExtremes), minMax.keySet());
|
||||
assertNotNull(minMax.get(expectedExtremes[0]));
|
||||
assertNotNull(minMax.get(expectedExtremes[1]));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Returns the name of the application
|
||||
*/
|
||||
private String doAuditEntryImpl(final int count) throws Exception
|
||||
private AuditApplicationInfo doAuditEntryImpl(final int count) throws Exception
|
||||
{
|
||||
final File file = AbstractContentTransformerTest.loadQuickTestFile("pdf");
|
||||
assertNotNull(file);
|
||||
final URL url = new URL("file:" + file.getAbsolutePath());
|
||||
final String appName = getName() + "." + System.currentTimeMillis();
|
||||
|
||||
RetryingTransactionCallback<Long> createAppCallback = new RetryingTransactionCallback<Long>()
|
||||
RetryingTransactionCallback<AuditApplicationInfo> createAppCallback = () ->
|
||||
{
|
||||
public Long execute() throws Throwable
|
||||
AuditApplicationInfo appInfo = auditDAO.getAuditApplication(appName);
|
||||
if (appInfo == null)
|
||||
{
|
||||
AuditApplicationInfo appInfo = auditDAO.getAuditApplication(appName);
|
||||
if (appInfo == null)
|
||||
{
|
||||
Long modelId = auditDAO.getOrCreateAuditModel(url).getFirst();
|
||||
appInfo = auditDAO.createAuditApplication(appName, modelId);
|
||||
}
|
||||
return appInfo.getId();
|
||||
Long modelId = auditDAO.getOrCreateAuditModel(url).getFirst();
|
||||
appInfo = auditDAO.createAuditApplication(appName, modelId);
|
||||
}
|
||||
return appInfo;
|
||||
};
|
||||
final Long sessionId = txnHelper.doInTransaction(createAppCallback);
|
||||
final AuditApplicationInfo appInfo = txnHelper.doInTransaction(createAppCallback);
|
||||
final Long sessionId = appInfo.getId();
|
||||
|
||||
final String username = "alexi";
|
||||
RetryingTransactionCallback<Void> createEntryCallback = new RetryingTransactionCallback<Void>()
|
||||
@@ -203,7 +216,7 @@ public class AuditDAOTest extends TestCase
|
||||
"Time for " + count + " entry creations was " +
|
||||
((double)(after - before)/(10E6)) + "ms");
|
||||
// Done
|
||||
return appName;
|
||||
return appInfo;
|
||||
}
|
||||
|
||||
public synchronized void testAuditQuery() throws Exception
|
||||
@@ -476,7 +489,7 @@ public class AuditDAOTest extends TestCase
|
||||
};
|
||||
|
||||
// Some entries
|
||||
final String appName = doAuditEntryImpl(1);
|
||||
final String appName = doAuditEntryImpl(1).getName();
|
||||
|
||||
final AuditQueryParameters params = new AuditQueryParameters();
|
||||
params.setApplicationName(appName);
|
||||
@@ -501,8 +514,8 @@ public class AuditDAOTest extends TestCase
|
||||
*/
|
||||
public void testAuditDeleteEntriesForApplication() throws Exception
|
||||
{
|
||||
final String app1 = doAuditEntryImpl(6);
|
||||
final String app2 = doAuditEntryImpl(18);
|
||||
final String app1 = doAuditEntryImpl(6).getName();
|
||||
final String app2 = doAuditEntryImpl(18).getName();
|
||||
|
||||
final AuditQueryCallbackImpl resultsCallback = new AuditQueryCallbackImpl();
|
||||
|
||||
|
@@ -263,7 +263,7 @@ public class XSLTRenderingEngineTest extends BaseAlfrescoSpringTest
|
||||
fail();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private FileInfo createXmlFile(NodeRef folder)
|
||||
{
|
||||
return createXmlFile(folder, sampleXML);
|
||||
|
Reference in New Issue
Block a user