Compare commits

..

90 Commits

Author SHA1 Message Date
alfresco-build
d3c3c4ec78 [maven-release-plugin][skip ci] prepare release 19.12 2024-04-26 13:13:56 +00:00
Aleksandra Onych
128d45b4dc [ACS-7676] Bump snakeyaml version from 1.32 to 2.2 (#2609) 2024-04-26 14:55:27 +02:00
alfresco-build
b0cb9c3cc0 [maven-release-plugin][skip ci] prepare for next development iteration 2024-04-26 12:54:42 +00:00
alfresco-build
bdaf38ba56 [maven-release-plugin][skip ci] prepare release 19.11 2024-04-26 12:54:40 +00:00
Aleksandra Onych
40608d056b [ACS-7646] Bump guava version to 33.1.0-jre (#2606) 2024-04-26 14:36:33 +02:00
alfresco-build
3e35536939 [maven-release-plugin][skip ci] prepare for next development iteration 2024-04-26 12:29:04 +00:00
alfresco-build
6ee2b36686 [maven-release-plugin][skip ci] prepare release 19.10 2024-04-26 12:29:01 +00:00
Aleksandra Onych
6e1a378a11 [ACS-7652] Bump woodstox-core version (#2607) 2024-04-26 14:08:03 +02:00
alfresco-build
043c5236c8 [maven-release-plugin][skip ci] prepare for next development iteration 2024-04-26 11:51:24 +00:00
alfresco-build
5af5675551 [maven-release-plugin][skip ci] prepare release 19.9 2024-04-26 11:51:20 +00:00
Domenico Sibilio
904f6d472c ACS-7656 Bump commons-fileupload to 1.5 (#2608) 2024-04-26 12:30:08 +02:00
mikolajbrzezinski
847e9a1db5 ACS-7683 Bump version.schema (#2605) 2024-04-25 13:24:23 +02:00
alfresco-build
3072f24a14 [maven-release-plugin][skip ci] prepare for next development iteration 2024-04-23 13:24:57 +00:00
alfresco-build
3330ea23f7 [maven-release-plugin][skip ci] prepare release 19.8 2024-04-23 13:24:54 +00:00
mikolajbrzezinski
cd3662a7f3 ACS-7683 Prepare for ACS 7.3.2 Service Pack (#2597)
ACS-7683 Prepare for ACS 7.3.2 Service Pack
2024-04-23 14:55:22 +02:00
alfresco-build
80f884bcaf [maven-release-plugin][skip ci] prepare for next development iteration 2024-04-18 13:51:40 +00:00
alfresco-build
01a0bc5ae1 [maven-release-plugin][skip ci] prepare release 19.7 2024-04-18 13:51:38 +00:00
Piotr Żurek
17125c479a ACS-7607 Upgrade Dependencies (#2598) 2024-04-18 15:30:24 +02:00
alfresco-build
bc973d80e9 [maven-release-plugin][skip ci] prepare for next development iteration 2024-04-17 13:21:58 +00:00
alfresco-build
14ef9e1888 [maven-release-plugin][skip ci] prepare release 19.6 2024-04-17 13:21:55 +00:00
Domenico Sibilio
5b086b7f1e ACS-7566 Test with raw Keycloak 24.0.2 (#2594) 2024-04-17 15:04:55 +02:00
alfresco-build
42cb507323 [maven-release-plugin][skip ci] prepare for next development iteration 2024-04-17 12:05:16 +00:00
alfresco-build
a8ced9c68f [maven-release-plugin][skip ci] prepare release 19.5 2024-04-17 12:05:13 +00:00
Piotr Żurek
1fc3b5756d ACS-7590 Backward compatibility with SS/IE 2.0.10 (#2596) 2024-04-17 13:35:18 +02:00
alfresco-build
077350eadb [maven-release-plugin][skip ci] prepare for next development iteration 2024-04-16 14:14:50 +00:00
alfresco-build
b312af8c6c [maven-release-plugin][skip ci] prepare release 19.4 2024-04-16 14:14:47 +00:00
Piotr Żurek
ff9f52ce77 ACS-7598 Backward Compatible ATS/AIS (#2593) 2024-04-16 15:39:40 +02:00
Tom Page
b90cdc415e Merge pull request #2530 from Alfresco/feature/MNT-24250_xalan_7.3.N
MNT-24250: bump xalan version (#2497)
2024-03-21 12:27:50 +00:00
Krystian Dabrowski
ed60a82a5c ACS-6073: DispositionScheduleLinkedRecordsTest - tests fail over and over again (#2220)
* ACS-6073: DispositionScheduleLinkedRecordsTest - tests suddenly started to fail over and over again
- disabling failing tests

(cherry picked from commit a973e17a86)
2024-03-21 11:41:12 +00:00
Domenico Sibilio
f7fd14e22c ACS-4776 Finalize deprecation of BitlyUrlShortenerImpl (#2339)
(cherry picked from commit 55d1963ba3)
2024-03-21 09:36:51 +00:00
Paweł Rainer
1e513e83b7 MNT-24250: bump xalan version (#2497)
* MNT-24250: bump xalan version

* MNT-24250: bump xalan version

* bump xalan

* MNT-24250: bump xalan version

* MNT-24250: bump xalan version

* MNT-24250: bump xalan version

* MNT-24250: bump xalan version

* MNT-24250: bump xalan version

* MNT-24250: bump xalan version

* MNT-24250: bump xalan version

* MNT-24250: bump xalan version

* MNT-24250: bump xalan version

* MNT-24250: bump xalan version

* MNT-24250: bump xalan version

* MNT-24250: bump xalan version

* MNT-24250: bump xalan version

* MNT-24250: bump xalan version

* MNT-24250: alfresco.3

* MNT-24250: alfresco.3

* MNT-24250: alfresco.3

* MNT-24250: alfresco.3

* MNT-24250: alfresco.3

* MNT-24250: 2.7.3 official

* MNT-24250: 2.7.3-alfresco.3

* MNT-24250: 2.7.3-alfresco.3

* MNT-24250: 2.7.3-alfresco.3

* MNT-24250: 2.7.3-alfresco.3

* MNT-24250: 2.7.3-alfresco.3

* MNT-24250: 2.7.3-alfresco.3

* MNT-24250: 2.7.3-alfresco.3

* MNT-24250: 2.7.3-alfresco.3

* MNT-24250: 2.7.3-alfresco.3

* MNT-24250: 2.7.3-alfresco.3

* MNT-24250: 2.7.3-alfresco.3

* MNT-24250: 2.7.3-alfresco.3

* MNT-24250: 2.7.3-alfresco.3

* MNT-24250: 2.7.3-alfresco

* MNT-24250: 2.7.3-alfresco

* MNT-24250: 2.7.3-alfresco

* MNT-24250: 2.7.3-alfresco

(cherry picked from commit 1bdd6c022c)
2024-03-20 16:23:31 +00:00
Tom Page
60860dbbe6 Change default for checking AGS license header. 2024-03-11 10:08:29 +00:00
Antonio Felix
28f0c42213 Feature/acs 4653 migrate to gha (#1777)
* ACS-3841 Migrate to GHA (#1631)

(cherry picked from commit eb6b6a64a8)
2024-03-11 10:06:14 +00:00
tiagosalvado10
a041ae928c [MNT-23550] Always disable behaviours to prevent unexpected modifier changes (#1898) (#1913)
(cherry picked from commit f83328f7b0)
2023-05-04 14:04:35 +01:00
Jared Ottley
55fe3637e1 [MNT-23553] REST API call fails when using Oracle database
- Remove semicolon from sql
2023-03-16 12:01:29 -06:00
Travis CI User
ccf8701aeb [maven-release-plugin][skip ci] prepare for next development iteration 2023-02-03 13:42:09 +00:00
Travis CI User
3546adcff5 [maven-release-plugin][skip ci] prepare release 19.3 2023-02-03 13:42:05 +00:00
evasques
c18a874b75 MNT-23411 Option to disable events2 (#1703) (#1723)
* Added configuration to disable events2 so the behaviours are not bootstrapped. Additionally added options to enable/disable on runtime
* Added unit test

(cherry picked from commit 9637d514dd)
2023-02-03 11:42:36 +00:00
Travis CI User
89d0c2afde [maven-release-plugin][skip ci] prepare for next development iteration 2023-01-28 20:31:00 +00:00
Travis CI User
bf1ac5b21d [maven-release-plugin][skip ci] prepare release 19.2 2023-01-28 20:30:57 +00:00
mstrankowski
1afdd7ec5c [skip tests] retrigger downstream version update 2023-01-28 21:23:30 +01:00
Travis CI User
7b52746802 [maven-release-plugin][skip ci] prepare for next development iteration 2023-01-28 13:59:16 +00:00
Travis CI User
65717ca6fd [maven-release-plugin][skip ci] prepare release 19.1 2023-01-28 13:59:13 +00:00
mstrankowski
2849af129c Fix project version and references after release of first SP 2023-01-28 13:48:29 +01:00
tiagosalvado10
6304125c09 [MNT-23414] Bulk import - convert empty values to null for certain types (#1688) (#1706)
(cherry picked from commit 781f045503)
2023-01-26 19:21:57 +00:00
Travis CI User
50f9e5df10 [maven-release-plugin][skip ci] prepare for next development iteration 2023-01-18 09:28:37 +00:00
Travis CI User
f7b6e90d98 [maven-release-plugin][skip ci] prepare release 18.15 2023-01-18 09:28:33 +00:00
Piotr Żurek
a6cc2d9964 PRODSEC-6989 Upgrade cxf and spring (#1690) 2023-01-18 09:52:58 +01:00
Travis CI User
c39047debe [maven-release-plugin][skip ci] prepare for next development iteration 2023-01-17 12:04:05 +00:00
Travis CI User
4a8c235f58 [maven-release-plugin][skip ci] prepare release 18.14 2023-01-17 12:04:02 +00:00
Marcin Strankowski
273a99f70f Feature/acs 4089 backport test fix (#1685)
* MNT-22686 Load template from the classpath which will work when resource is packaged in the jar

* MNT-22686

Co-authored-by: pzurek <Piotr.Zurek@hyland.com>
2023-01-17 12:25:19 +01:00
Travis CI User
0691cb0162 [maven-release-plugin][skip ci] prepare for next development iteration 2023-01-15 22:50:17 +00:00
Travis CI User
23465b70e2 [maven-release-plugin][skip ci] prepare release 18.13 2023-01-15 22:50:14 +00:00
tiagosalvado10
a7ef5157e2 [MNT-23396] [MNT-23391] Change call stack depth limit to be only applied to custom scripts / Clean scope only for custom scripts (#1592) (#1679)
* [MNT-23396] Change call stack depth limit to be only applied to custom scripts (as memory and time limits)

* [MNT-23396] Changed how memory usage is obtained

* [MNT-23391] Only clean scope if script is not considered secure (custom script)

(cherry picked from commit 95ab83d2b1)
2023-01-15 22:07:09 +00:00
Travis CI User
25459e9a34 [maven-release-plugin][skip ci] prepare for next development iteration 2023-01-09 23:42:25 +00:00
Travis CI User
5b459e5c2e [maven-release-plugin][skip ci] prepare release 18.12 2023-01-09 23:42:22 +00:00
tiagosalvado10
d451207427 [MNT-23379] Set site manager permission if node belongs to a site and inheritance flag is disabled (#1657) (#1665)
* [MNT-23379] Set site manager permission if node belongs to a site and inheritance flag is disabled (#1657)

* [MNT-23379] Set site manager permission if node belongs to a site and inheritance flag is disabled

* [MNT-23379] Added validation. Added throwable object to error logging.

* [MNT-23379] Added unit test

* [MNT-23379] Changed 'runAs' call to 'runAsSystem' with lambda

(cherry picked from commit 88a0854548)

* [MNT-23379] Added sleep between document creation and update to prevent test failures (#1668)

(cherry picked from commit 4749166080)
2023-01-09 20:33:29 +00:00
Travis CI User
563404bc8b [maven-release-plugin][skip ci] prepare for next development iteration 2023-01-05 15:56:59 +00:00
Travis CI User
3fe14df13b [maven-release-plugin][skip ci] prepare release 18.11 2023-01-05 15:56:55 +00:00
atkumar14
359106f323 MNT-23263 Changes done for missing properties between two categories. (#1654) 2023-01-05 20:45:08 +05:30
Travis CI User
331ce2cc59 [maven-release-plugin][skip ci] prepare for next development iteration 2023-01-03 13:39:50 +00:00
Travis CI User
e6f8e71b96 [maven-release-plugin][skip ci] prepare release 18.10 2023-01-03 13:39:47 +00:00
evasques
f502fced88 Update AGS license headers (#1653) 2023-01-03 12:30:22 +00:00
Travis CI User
75248b0118 [maven-release-plugin][skip ci] prepare for next development iteration 2022-12-22 13:56:50 +00:00
Travis CI User
ff93971e54 [maven-release-plugin][skip ci] prepare release 18.9 2022-12-22 13:56:46 +00:00
Antonio Felix
15b1a960b7 Fix/mnt 23290 slow group membership (#1637) (#1643)
* MNT-23290 - Change query to get the root groups

(cherry picked from commit d785b100df)
2022-12-22 13:09:20 +00:00
Travis CI User
00b043d444 [maven-release-plugin][skip ci] prepare for next development iteration 2022-12-15 12:31:35 +00:00
Travis CI User
79709ce48e [maven-release-plugin][skip ci] prepare release 18.8 2022-12-15 12:31:32 +00:00
Marcin Strankowski
c135d5ea8f Feature/acs 4089 backport mnt 22686 (#1619)
* MNT-22686 Add email template test
* Allow more complex action params
2022-12-14 09:53:33 +01:00
Travis CI User
06871bce8a [maven-release-plugin][skip ci] prepare for next development iteration 2022-12-07 13:42:14 +00:00
Travis CI User
58e595ce13 [maven-release-plugin][skip ci] prepare release 18.7 2022-12-07 13:42:11 +00:00
tiagosalvado10
333a7dca98 [MNT-22437] Remove ACS version from landing page (#1480) (#1605)
* [MNT-22437] Remove ACS version from landing page

* [MNT-22437] Bump surf-webscripts to 8.33

(cherry picked from commit ace4691540)
2022-12-07 12:59:49 +00:00
Travis CI User
0c810f5e80 [maven-release-plugin][skip ci] prepare for next development iteration 2022-11-29 12:07:13 +00:00
Travis CI User
4d930a6f18 [maven-release-plugin][skip ci] prepare release 18.6 2022-11-29 12:07:10 +00:00
evasques
ff68f92455 MNT-23108 - Manage contentStream resource closure in RemoteTransformerClient request (#1559) (#1564)
* Manage contentStream resource closure so we don't have connections hanging when we lose connection to AIO

(cherry picked from commit 783efca1d2)
2022-11-29 10:46:53 +00:00
Travis CI User
c88353ccb7 [maven-release-plugin][skip ci] prepare for next development iteration 2022-11-21 10:33:58 +00:00
Travis CI User
6b94ee41d4 [maven-release-plugin][skip ci] prepare release 18.5 2022-11-21 10:33:56 +00:00
rrajoria
a414aa3064 MNT-23204: Group Search (#1558)
(cherry picked from commit 93a7790d44)
2022-11-21 15:18:58 +05:30
Travis CI User
7914e87f77 [maven-release-plugin][skip ci] prepare for next development iteration 2022-11-11 23:56:44 +00:00
Travis CI User
4f63b3871e [maven-release-plugin][skip ci] prepare release 18.4 2022-11-11 23:56:41 +00:00
tiagosalvado10
876962db57 [MNT-23158] Scripts limits configuration and optimization (#1519) (#1548)
(cherry picked from commit f391cfa38c)
2022-11-11 23:19:15 +00:00
Travis CI User
5e2ff120ae [maven-release-plugin][skip ci] prepare for next development iteration 2022-11-11 22:23:29 +00:00
Travis CI User
2d95ccc754 [maven-release-plugin][skip ci] prepare release 18.3 2022-11-11 22:23:26 +00:00
Antonio Felix
3de741a78e MNT-23276 - The null facet name should be considered (#1540) (#1550)
(cherry picked from commit 295a8f7ba2)
2022-11-11 21:47:55 +00:00
Travis CI User
8993ec9d5c [maven-release-plugin][skip ci] prepare for next development iteration 2022-11-11 16:24:16 +00:00
Travis CI User
428a82c195 [maven-release-plugin][skip ci] prepare release 18.2 2022-11-11 16:24:13 +00:00
Vítor Moreira
519ef19c83 MNT-22485: audit query with createdAt criteria returns correct totalI… (#1545)
* MNT-22485: audit query with createdAt criteria returns correct totalI… (#1535)
(cherry picked from commit 14572d328f)

* MNT-22485: added missing tables to query (#1547)
(cherry picked from commit 7f6bd86b0c)
2022-11-11 10:35:44 +00:00
Travis CI User
f19849b547 [maven-release-plugin][skip ci] prepare for next development iteration 2022-10-27 11:08:49 +00:00
Travis CI User
d956a4f4aa [maven-release-plugin][skip ci] prepare release 18.1 2022-10-27 11:08:46 +00:00
Krystian Dabrowski
71f649d1bd Create ServicePack branch release/7.3.N 2022-10-27 12:25:07 +02:00
1096 changed files with 16655 additions and 67654 deletions

114
.github/dependabot.yml vendored
View File

@@ -14,6 +14,15 @@ updates:
timezone: Africa/Abidjan
open-pull-requests-limit: 99
ignore:
- dependency-name: com.google.code.gson:gson
versions:
- "> 2.8.6"
- dependency-name: io.fabric8:fabric8-maven-plugin
versions:
- "> 4.4.0"
- dependency-name: javax.servlet:javax.servlet-api
versions:
- "> 3.0.1"
- dependency-name: org.acegisecurity:acegi-security
versions:
- "> 0.8.2_patched"
@@ -43,7 +52,110 @@ updates:
- "> 1.0.0"
- dependency-name: org.freemarker:freemarker
versions:
- "> 2.3.31-alfresco-patched"
- "> 2.3.20-alfresco-patched-20200421"
- dependency-name: org.keycloak:keycloak-adapter-core
versions:
- "> 12.0.2"
- dependency-name: org.keycloak:keycloak-adapter-spi
versions:
- "> 12.0.2"
- dependency-name: org.keycloak:keycloak-authz-client
versions:
- "> 12.0.2"
- dependency-name: org.keycloak:keycloak-common
versions:
- "> 12.0.2"
- dependency-name: org.keycloak:keycloak-core
versions:
- "> 12.0.2"
- dependency-name: org.keycloak:keycloak-servlet-adapter-spi
versions:
- "> 12.0.2"
- dependency-name: org.eclipse.jetty:jetty-server
versions:
- 9.4.38.v20210224
- dependency-name: org.alfresco.tas:cmis
versions:
- "1.28"
- dependency-name: org.springframework:spring-webmvc
versions:
- 5.3.4
- 5.3.5
- dependency-name: org.springframework:spring-web
versions:
- 5.3.4
- 5.3.5
- dependency-name: org.springframework:spring-tx
versions:
- 5.3.4
- 5.3.5
- dependency-name: org.springframework:spring-orm
versions:
- 5.3.4
- 5.3.5
- dependency-name: org.springframework:spring-test
versions:
- 5.3.4
- 5.3.5
- dependency-name: org.springframework:spring-jms
versions:
- 5.3.4
- 5.3.5
- dependency-name: org.springframework:spring-jdbc
versions:
- 5.3.4
- 5.3.5
- dependency-name: org.springframework:spring-expression
versions:
- 5.3.4
- 5.3.5
- dependency-name: org.springframework:spring-core
versions:
- 5.3.4
- 5.3.5
- dependency-name: org.springframework:spring-context-support
versions:
- 5.3.4
- 5.3.5
- dependency-name: org.springframework:spring-context
versions:
- 5.3.4
- 5.3.5
- dependency-name: org.springframework:spring-beans
versions:
- 5.3.4
- 5.3.5
- dependency-name: org.springframework:spring-aop
versions:
- 5.3.4
- 5.3.5
- dependency-name: org.alfresco.tas:restapi
versions:
- "1.55"
- dependency-name: org.eclipse.jetty:jetty-security
versions:
- 11.0.1
- dependency-name: org.alfresco.aos-module:alfresco-vti-bin
versions:
- 1.4.0-M1
- dependency-name: org.alfresco.aos-module:alfresco-aos-module-distributionzip
versions:
- 1.4.0-M1
- dependency-name: org.alfresco.aos-module:alfresco-aos-module
versions:
- 1.4.0-M1
- dependency-name: org.alfresco.surf:spring-webscripts-api
versions:
- "8.16"
- dependency-name: org.alfresco.surf:spring-webscripts:tests
versions:
- "8.16"
- dependency-name: org.alfresco.surf:spring-webscripts
versions:
- "8.16"
- dependency-name: org.alfresco.surf:spring-surf-core-configservice
versions:
- "8.16"
registries:
- maven-repository-artifacts-alfresco-com-nexus-content-groups-int
- package-ecosystem: "docker"

View File

@@ -23,7 +23,6 @@ env:
MAVEN_USERNAME: ${{ secrets.NEXUS_USERNAME }}
QUAY_PASSWORD: ${{ secrets.QUAY_PASSWORD }}
QUAY_USERNAME: ${{ secrets.QUAY_USERNAME }}
CI_WORKSPACE: ${{ github.workspace }}
TAS_ENVIRONMENT: ./packaging/tests/environment
TAS_SCRIPTS: ../alfresco-community-repo/packaging/tests/scripts
@@ -33,23 +32,14 @@ jobs:
runs-on: ubuntu-latest
if: >
!contains(github.event.head_commit.message, '[skip tests]') &&
!contains(github.event.head_commit.message, '[force')
!contains(github.event.head_commit.message, '[force]')
steps:
- uses: actions/checkout@v4
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v7.0.0
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v7.0.0
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v7.0.0
- uses: actions/checkout@v4
with:
fetch-depth: 0
- id: changed-files
uses: Alfresco/alfresco-build-tools/.github/actions/github-list-changes@v6.1.0
with:
write-list-to-env: true
- uses: Alfresco/alfresco-build-tools/.github/actions/pre-commit@v6.1.0
- uses: actions/checkout@v3
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.30.0
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.30.0
- name: "Init"
run: bash ./scripts/ci/init.sh
- name: "Prepare maven cache and check compilation"
- name: "Prepare environment"
run: bash ./scripts/ci/prepare.sh
- name: "Clean Maven cache"
run: bash ./scripts/ci/cleanup_cache.sh
@@ -59,40 +49,21 @@ jobs:
runs-on: ubuntu-latest
needs: [prepare]
if: >
((github.ref_name == 'master' || startsWith(github.ref_name, 'release/')) && github.event_name != 'pull_request') &&
((github.ref_name == 'master' || contains(github.ref_name, 'release/')) && github.event_name != 'pull_request') &&
!contains(github.event.head_commit.message, '[skip tests]') &&
!contains(github.event.head_commit.message, '[force')
!contains(github.event.head_commit.message, '[force]')
steps:
- uses: actions/checkout@v4
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v7.0.0
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v7.0.0
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v7.0.0
- uses: actions/checkout@v3
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.30.0
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.30.0
- name: "Init"
run: bash ./scripts/ci/init.sh
- uses: Alfresco/alfresco-build-tools/.github/actions/veracode@v7.0.0
continue-on-error: true
- uses: Alfresco/alfresco-build-tools/.github/actions/veracode@v1.30.0
with:
srcclr-api-token: ${{ secrets.SRCCLR_API_TOKEN }}
- name: "Clean Maven cache"
run: bash ./scripts/ci/cleanup_cache.sh
pmd_scan:
name: "PMD Scan"
runs-on: ubuntu-latest
needs: [prepare]
if: >
github.event_name == 'pull_request' &&
!contains(github.event.head_commit.message, '[skip pmd]') &&
!contains(github.event.head_commit.message, '[skip tests]') &&
!contains(github.event.head_commit.message, '[force]')
steps:
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v7.0.0
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v7.0.0
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v7.0.0
- uses: Alfresco/ya-pmd-scan@v4.0.0
with:
classpath-build-command: "mvn test-compile -ntp -Pags -pl \"-:alfresco-community-repo-docker\""
all_unit_tests_suite:
name: "Core, Data-Model, Repository - AllUnitTestsSuite - Build and test"
runs-on: ubuntu-latest
@@ -100,12 +71,11 @@ jobs:
if: >
!contains(github.event.head_commit.message, '[skip repo]') &&
!contains(github.event.head_commit.message, '[skip tests]') &&
!contains(github.event.head_commit.message, '[force')
!contains(github.event.head_commit.message, '[force]')
steps:
- uses: actions/checkout@v4
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v7.0.0
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v7.0.0
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v7.0.0
- uses: actions/checkout@v3
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.30.0
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.30.0
- name: "Init"
run: bash ./scripts/ci/init.sh
- name: "Run tests"
@@ -122,7 +92,7 @@ jobs:
if: >
!contains(github.event.head_commit.message, '[skip repo]') &&
!contains(github.event.head_commit.message, '[skip tests]') &&
!contains(github.event.head_commit.message, '[force')
!contains(github.event.head_commit.message, '[force]')
strategy:
fail-fast: false
matrix:
@@ -140,10 +110,9 @@ jobs:
env:
REQUIRES_INSTALLED_ARTIFACTS: true
steps:
- uses: actions/checkout@v4
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v7.0.0
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v7.0.0
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v7.0.0
- uses: actions/checkout@v3
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.30.0
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.30.0
- name: "Build"
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
run: |
@@ -152,7 +121,7 @@ jobs:
- name: "Set transformers tag"
run: echo "TRANSFORMERS_TAG=$(mvn help:evaluate -Dexpression=dependency.alfresco-transform-core.version -q -DforceStdout)" >> $GITHUB_ENV
- name: "Set up the environment"
run: docker compose -f ./scripts/ci/docker-compose/docker-compose.yaml --profile ${{ matrix.compose-profile }} up -d
run: docker-compose -f ./scripts/ci/docker-compose/docker-compose.yaml --profile ${{ matrix.compose-profile }} up -d
- name: "Run tests"
run: mvn -B test -pl remote-api -Dtest=${{ matrix.testSuite }} -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
- name: "Clean Maven cache"
@@ -163,25 +132,24 @@ jobs:
runs-on: ubuntu-latest
needs: [prepare]
if: >
(((github.ref_name == 'master' || startsWith(github.ref_name, 'release/')) &&
(((github.ref_name == 'master' || contains(github.ref_name, 'release/')) &&
github.event_name != 'pull_request' &&
!contains(github.event.head_commit.message, '[skip db]')) ||
contains(github.event.head_commit.message, '[db]')) &&
!contains(github.event.head_commit.message, '[skip tests]') &&
!contains(github.event.head_commit.message, '[force')
!contains(github.event.head_commit.message, '[force]')
strategy:
fail-fast: false
matrix:
version: ['10.2.18', '10.4', '10.5']
steps:
- uses: actions/checkout@v4
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v7.0.0
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v7.0.0
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v7.0.0
- uses: actions/checkout@v3
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.30.0
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.30.0
- name: "Init"
run: bash ./scripts/ci/init.sh
- name: Run MariaDB ${{ matrix.version }} database
run: docker compose -f ./scripts/ci/docker-compose/docker-compose-db.yaml --profile mariadb up -d
run: docker-compose -f ./scripts/ci/docker-compose/docker-compose-db.yaml --profile mariadb up -d
env:
MARIADB_VERSION: ${{ matrix.version }}
- name: "Run tests"
@@ -194,21 +162,20 @@ jobs:
runs-on: ubuntu-latest
needs: [prepare]
if: >
(((github.ref_name == 'master' || startsWith(github.ref_name, 'release/') || github.event_name == 'pull_request') &&
(((github.ref_name == 'master' || contains(github.ref_name, 'release/') || github.event_name == 'pull_request') &&
!contains(github.event.head_commit.message, '[skip db]')) ||
contains(github.event.head_commit.message, '[latest db]') ||
contains(github.event.head_commit.message, '[db]')) &&
!contains(github.event.head_commit.message, '[skip tests]') &&
!contains(github.event.head_commit.message, '[force')
!contains(github.event.head_commit.message, '[force]')
steps:
- uses: actions/checkout@v4
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v7.0.0
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v7.0.0
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v7.0.0
- uses: actions/checkout@v3
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.30.0
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.30.0
- name: "Init"
run: bash ./scripts/ci/init.sh
- name: "Run MariaDB 10.6 database"
run: docker compose -f ./scripts/ci/docker-compose/docker-compose-db.yaml --profile mariadb up -d
run: docker-compose -f ./scripts/ci/docker-compose/docker-compose-db.yaml --profile mariadb up -d
env:
MARIADB_VERSION: 10.6
- name: "Run tests"
@@ -221,21 +188,20 @@ jobs:
runs-on: ubuntu-latest
needs: [prepare]
if: >
(((github.ref_name == 'master' || startsWith(github.ref_name, 'release/') || github.event_name == 'pull_request') &&
(((github.ref_name == 'master' || contains(github.ref_name, 'release/') || github.event_name == 'pull_request') &&
!contains(github.event.head_commit.message, '[skip db]')) ||
contains(github.event.head_commit.message, '[latest db]') ||
contains(github.event.head_commit.message, '[db]')) &&
!contains(github.event.head_commit.message, '[skip tests]') &&
!contains(github.event.head_commit.message, '[force')
!contains(github.event.head_commit.message, '[force]')
steps:
- uses: actions/checkout@v4
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v7.0.0
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v7.0.0
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v7.0.0
- uses: actions/checkout@v3
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.30.0
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.30.0
- name: "Init"
run: bash ./scripts/ci/init.sh
- name: "Run MySQL 8 database"
run: docker compose -f ./scripts/ci/docker-compose/docker-compose-db.yaml --profile mysql up -d
run: docker-compose -f ./scripts/ci/docker-compose/docker-compose-db.yaml --profile mysql up -d
env:
MYSQL_VERSION: 8
- name: "Run tests"
@@ -243,60 +209,33 @@ jobs:
- name: "Clean Maven cache"
run: bash ./scripts/ci/cleanup_cache.sh
repository_postgresql_13_12_tests:
name: "Repository - PostgreSQL 13.12 tests"
repository_postgresql_13_7_tests:
name: "Repository - PostgreSQL 13.7 tests"
runs-on: ubuntu-latest
needs: [prepare]
if: >
(((github.ref_name == 'master' || startsWith(github.ref_name, 'release/')) && github.event_name != 'pull_request' &&
(((github.ref_name == 'master' || contains(github.ref_name, 'release/')) && github.event_name != 'pull_request' &&
!contains(github.event.head_commit.message, '[skip db]')) ||
contains(github.event.head_commit.message, '[db]')) &&
!contains(github.event.head_commit.message, '[skip tests]') &&
!contains(github.event.head_commit.message, '[force')
!contains(github.event.head_commit.message, '[force]')
steps:
- uses: actions/checkout@v4
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v7.0.0
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v7.0.0
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v7.0.0
- uses: actions/checkout@v3
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.30.0
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.30.0
- name: "Init"
run: bash ./scripts/ci/init.sh
- name: "Run PostgreSQL 13.12 database"
run: docker compose -f ./scripts/ci/docker-compose/docker-compose-db.yaml --profile postgres up -d
- name: "Run PostgreSQL 13.7 database"
run: docker-compose -f ./scripts/ci/docker-compose/docker-compose-db.yaml --profile postgres up -d
env:
POSTGRES_VERSION: 13.12
POSTGRES_VERSION: 13.7
- name: "Run tests"
run: mvn -B test -pl repository -am -Dtest=AllDBTestsTestSuite -DfailIfNoTests=false -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
- name: "Clean Maven cache"
run: bash ./scripts/ci/cleanup_cache.sh
repository_postgresql_14_9_tests:
name: "Repository - PostgreSQL 14.9 tests"
runs-on: ubuntu-latest
needs: [prepare]
if: >
(((github.ref_name == 'master' || startsWith(github.ref_name, 'release/')) && github.event_name != 'pull_request' &&
!contains(github.event.head_commit.message, '[skip db]')) ||
contains(github.event.head_commit.message, '[db]')) &&
!contains(github.event.head_commit.message, '[skip tests]') &&
!contains(github.event.head_commit.message, '[force')
steps:
- uses: actions/checkout@v4
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v7.0.0
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v7.0.0
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v7.0.0
- name: "Init"
run: bash ./scripts/ci/init.sh
- name: "Run PostgreSQL 14.9 database"
run: docker compose -f ./scripts/ci/docker-compose/docker-compose-db.yaml --profile postgres up -d
env:
POSTGRES_VERSION: 14.9
- name: "Run tests"
run: mvn -B test -pl repository -am -Dtest=AllDBTestsTestSuite -DfailIfNoTests=false -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
- name: "Clean Maven cache"
run: bash ./scripts/ci/cleanup_cache.sh
repository_postgresql_15_4_tests:
name: "Repository - PostgreSQL 15.4 tests"
repository_postgresql_14_4_tests:
name: "Repository - PostgreSQL 14.4 tests"
runs-on: ubuntu-latest
needs: [prepare]
if: >
@@ -304,18 +243,17 @@ jobs:
contains(github.event.head_commit.message, '[latest db]') ||
contains(github.event.head_commit.message, '[db]')) &&
!contains(github.event.head_commit.message, '[skip tests]') &&
!contains(github.event.head_commit.message, '[force')
!contains(github.event.head_commit.message, '[force]')
steps:
- uses: actions/checkout@v4
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v7.0.0
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v7.0.0
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v7.0.0
- uses: actions/checkout@v3
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.30.0
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.30.0
- name: "Init"
run: bash ./scripts/ci/init.sh
- name: "Run PostgreSQL 15.4 database"
run: docker compose -f ./scripts/ci/docker-compose/docker-compose-db.yaml --profile postgres up -d
- name: "Run PostgreSQL 14.4 database"
run: docker-compose -f ./scripts/ci/docker-compose/docker-compose-db.yaml --profile postgres up -d
env:
POSTGRES_VERSION: 15.4
POSTGRES_VERSION: 14.4
- name: "Run tests"
run: mvn -B test -pl repository -am -Dtest=AllDBTestsTestSuite -DfailIfNoTests=false -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
- name: "Clean Maven cache"
@@ -328,16 +266,15 @@ jobs:
if: >
!contains(github.event.head_commit.message, '[skip repo]') &&
!contains(github.event.head_commit.message, '[skip tests]') &&
!contains(github.event.head_commit.message, '[force')
!contains(github.event.head_commit.message, '[force]')
steps:
- uses: actions/checkout@v4
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v7.0.0
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v7.0.0
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v7.0.0
- uses: actions/checkout@v3
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.30.0
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.30.0
- name: "Init"
run: bash ./scripts/ci/init.sh
- name: "Run ActiveMQ"
run: docker compose -f ./scripts/ci/docker-compose/docker-compose.yaml --profile activemq up -d
run: docker-compose -f ./scripts/ci/docker-compose/docker-compose.yaml --profile activemq up -d
- name: "Run tests"
run: mvn -B test -pl repository -am -Dtest=CamelRoutesTest,CamelComponentsTest -DfailIfNoTests=false
- name: "Clean Maven cache"
@@ -350,7 +287,7 @@ jobs:
if: >
!contains(github.event.head_commit.message, '[skip repo]') &&
!contains(github.event.head_commit.message, '[skip tests]') &&
!contains(github.event.head_commit.message, '[force')
!contains(github.event.head_commit.message, '[force]')
strategy:
fail-fast: false
matrix:
@@ -364,8 +301,8 @@ jobs:
- testSuite: AppContext04TestSuite
compose-profile: with-transform-core-aio
- testSuite: AppContext05TestSuite
compose-profile: default
mvn-options: '"-Didentity-service.auth-server-url=http://${HOST_IP}:8999/auth"'
compose-profile: with-sso
mvn-options: '"-Didentity-service.auth-server-url=http://localhost:8999/auth"'
- testSuite: AppContext06TestSuite
compose-profile: with-transform-core-aio
- testSuite: AppContextExtraTestSuite
@@ -375,37 +312,16 @@ jobs:
- testSuite: SearchTestSuite
compose-profile: default
mvn-options: '-Dindex.subsystem.name=solr6'
- testSuite: MTLSTestSuite
compose-profile: with-mtls-transform-core-aio
mtls: true
disabledHostnameVerification: false
mvn-options: '-Dencryption.ssl.keystore.location=${CI_WORKSPACE}/keystores/alfresco/alfresco.keystore -Dencryption.ssl.truststore.location=${CI_WORKSPACE}/keystores/alfresco/alfresco.truststore'
steps:
- uses: actions/checkout@v4
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v7.0.0
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v7.0.0
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v7.0.0
- uses: actions/checkout@v3
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.30.0
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.30.0
- name: "Init"
run: bash ./scripts/ci/init.sh
- name: "Set transformers tag"
run: echo "TRANSFORMERS_TAG=$(mvn help:evaluate -Dexpression=dependency.alfresco-transform-core.version -q -DforceStdout)" >> $GITHUB_ENV
- name: "Generate Keystores and Truststores for Mutual TLS configuration"
if: ${{ matrix.mtls }}
run: |
git clone -b "master" --depth=1 "https://${{ secrets.BOT_GITHUB_USERNAME }}:${{ secrets.BOT_GITHUB_TOKEN }}@github.com/Alfresco/alfresco-ssl-generator.git"
if ${{ matrix.disabledHostnameVerification }} ; then
bash ${{ env.CI_WORKSPACE }}/alfresco-ssl-generator/scripts/ci/generate_keystores_wrong_hostnames.sh
echo "HOSTNAME_VERIFICATION_DISABLED=true" >> "$GITHUB_ENV"
else
bash ${{ env.CI_WORKSPACE }}/alfresco-ssl-generator/scripts/ci/generate_keystores.sh
echo "HOSTNAME_VERIFICATION_DISABLED=false" >> "$GITHUB_ENV"
fi
- name: "Set up the environment"
run: |
if [ -e ./scripts/ci/tests/${{ matrix.testSuite }}-setup.sh ]; then
bash ./scripts/ci/tests/${{ matrix.testSuite }}-setup.sh
fi
docker compose -f ./scripts/ci/docker-compose/docker-compose.yaml --profile ${{ matrix.compose-profile }} up -d
run: docker-compose -f ./scripts/ci/docker-compose/docker-compose.yaml --profile ${{ matrix.compose-profile }} up -d
- name: "Run tests"
run: mvn -B test -pl repository -am -Dtest=${{ matrix.testSuite }} -DfailIfNoTests=false -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco ${{ matrix.mvn-options }}
- name: "Clean Maven cache"
@@ -416,11 +332,11 @@ jobs:
runs-on: ubuntu-latest
needs: [prepare]
if: >
(((github.ref_name == 'master' || startsWith(github.ref_name, 'release/') || github.event_name == 'pull_request' ) &&
(((github.ref_name == 'master' || contains(github.ref_name, 'release/') || github.event_name == 'pull_request') &&
!contains(github.event.head_commit.message, '[skip tas]')) ||
contains(github.event.head_commit.message, '[tas]')) &&
!contains(github.event.head_commit.message, '[skip tests]') &&
!contains(github.event.head_commit.message, '[force')
!contains(github.event.head_commit.message, '[force]')
strategy:
fail-fast: false
matrix:
@@ -452,10 +368,9 @@ jobs:
env:
REQUIRES_LOCAL_IMAGES: true
steps:
- uses: actions/checkout@v4
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v7.0.0
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v7.0.0
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v7.0.0
- uses: actions/checkout@v3
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.30.0
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.30.0
- name: "Build"
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
run: |
@@ -472,9 +387,6 @@ jobs:
id: tests
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
run: mvn -B verify -f packaging/tests/${{ matrix.pom-dir }}/pom.xml -Pall-tas-tests,${{ matrix.test-profile }} -Denvironment=default -DrunBugs=false
- name: "Print output after success"
if: ${{ always() && steps.tests.outcome == 'success' }}
run: ${TAS_SCRIPTS}/output_tests_run.sh "packaging/tests/${{ matrix.pom-dir }}"
- name: "Print output after failure"
if: ${{ always() && steps.tests.outcome == 'failure' }}
run: ${TAS_SCRIPTS}/output_logs_for_failures.sh "packaging/tests/${{ matrix.pom-dir }}"
@@ -488,16 +400,15 @@ jobs:
if: >
!contains(github.event.head_commit.message, '[skip repo]') &&
!contains(github.event.head_commit.message, '[skip tests]') &&
!contains(github.event.head_commit.message, '[force')
!contains(github.event.head_commit.message, '[force]')
steps:
- uses: actions/checkout@v4
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v7.0.0
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v7.0.0
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v7.0.0
- uses: actions/checkout@v3
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.30.0
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.30.0
- name: "Init"
run: bash ./scripts/ci/init.sh
- name: "Run Postgres 15.4 database"
run: docker compose -f ./scripts/ci/docker-compose/docker-compose.yaml --profile postgres up -d
- name: "Run Postgres 14.4 database"
run: docker-compose -f ./scripts/ci/docker-compose/docker-compose.yaml --profile postgres up -d
- name: "Run tests"
run: mvn -B test -pl :alfresco-share-services -am -Dtest=ShareServicesTestSuite -DfailIfNoTests=false -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
- name: "Clean Maven cache"
@@ -508,11 +419,11 @@ jobs:
runs-on: ubuntu-latest
needs: [prepare]
if: >
(((github.ref_name == 'master' || startsWith(github.ref_name, 'release/') || github.event_name == 'pull_request' ) &&
(((github.ref_name == 'master' || contains(github.ref_name, 'release/') || github.event_name == 'pull_request') &&
!contains(github.event.head_commit.message, '[skip ags]')) ||
contains(github.event.head_commit.message, '[ags]')) &&
!contains(github.event.head_commit.message, '[skip tests]') &&
!contains(github.event.head_commit.message, '[force')
!contains(github.event.head_commit.message, '[force]')
strategy:
fail-fast: false
matrix:
@@ -520,10 +431,9 @@ jobs:
env:
REQUIRES_INSTALLED_ARTIFACTS: true
steps:
- uses: actions/checkout@v4
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v7.0.0
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v7.0.0
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v7.0.0
- uses: actions/checkout@v3
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.30.0
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.30.0
- name: "Build"
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
run: |
@@ -540,11 +450,11 @@ jobs:
runs-on: ubuntu-latest
needs: [prepare]
if: >
(((github.ref_name == 'master' || startsWith(github.ref_name, 'release/') || github.event_name == 'pull_request' ) &&
(((github.ref_name == 'master' || contains(github.ref_name, 'release/') || github.event_name == 'pull_request') &&
!contains(github.event.head_commit.message, '[skip ags]')) ||
contains(github.event.head_commit.message, '[ags on MySQL]')) &&
!contains(github.event.head_commit.message, '[skip tests]') &&
!contains(github.event.head_commit.message, '[force')
!contains(github.event.head_commit.message, '[force]')
strategy:
fail-fast: false
matrix:
@@ -552,10 +462,9 @@ jobs:
env:
REQUIRES_INSTALLED_ARTIFACTS: true
steps:
- uses: actions/checkout@v4
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v7.0.0
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v7.0.0
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v7.0.0
- uses: actions/checkout@v3
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.30.0
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.30.0
- name: "Build"
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
run: |
@@ -572,18 +481,17 @@ jobs:
runs-on: ubuntu-latest
needs: [prepare]
if: >
(((github.ref_name == 'master' || startsWith(github.ref_name, 'release/') || github.event_name == 'pull_request' ) &&
(((github.ref_name == 'master' || contains(github.ref_name, 'release/') || github.event_name == 'pull_request') &&
!contains(github.event.head_commit.message, '[skip ags]') && !contains(github.event.head_commit.message, '[skip tas]')) ||
(contains(github.event.head_commit.message, '[ags]') && contains(github.event.head_commit.message, '[tas]'))) &&
!contains(github.event.head_commit.message, '[skip tests]') &&
!contains(github.event.head_commit.message, '[force')
!contains(github.event.head_commit.message, '[force]')
env:
REQUIRES_LOCAL_IMAGES: true
steps:
- uses: actions/checkout@v4
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v7.0.0
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v7.0.0
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v7.0.0
- uses: actions/checkout@v3
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.30.0
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.30.0
- name: "Build"
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
run: |
@@ -600,7 +508,7 @@ jobs:
run: mvn -B test -pl :alfresco-governance-services-automation-community-rest-api -Dskip.automationtests=false -Pags -Pall-tas-tests
- name: "Configure AWS credentials"
if: ${{ always() }}
uses: aws-actions/configure-aws-credentials@v4
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AGS_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AGS_AWS_SECRET_ACCESS_KEY }}
@@ -613,29 +521,4 @@ jobs:
aws s3 cp --acl private solr.log s3://ags-travis-artifacts/community/${{ github.run_number }}/AGS-Community-Rest-API-Tests/solr.log
aws s3 cp --acl private ./amps/ags/rm-automation/rm-automation-community-rest-api/target/reports/rm-automation-community-rest-api.log s3://ags-travis-artifacts/community/${{ github.run_number }}/AGS-Community-Rest-API-Tests/rm-automation-community-rest-api.log
- name: "Clean Maven cache"
run: bash ./scripts/ci/cleanup_cache.sh
ags_start_api_explorer:
name: "Test Tomcat deployment of api explorer"
runs-on: ubuntu-latest
needs: [ prepare ]
if: >
(((github.ref_name == 'master' || startsWith(github.ref_name, 'release/') || github.event_name == 'pull_request' ) &&
!contains(github.event.head_commit.message, '[skip ags]')) ||
contains(github.event.head_commit.message, '[ags]')) &&
!contains(github.event.head_commit.message, '[skip tests]') &&
!contains(github.event.head_commit.message, '[force]')
steps:
- uses: actions/checkout@v4
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v7.0.0
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v7.0.0
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v7.0.0
- name: "Build"
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
run: |
bash ./scripts/ci/init.sh
bash ./scripts/ci/build.sh
- name: "Test Tomcat deployment"
run: |
mvn verify -Pags,start-api-explorer -DskipTests &
${{ env.TAS_SCRIPTS }}/wait-for-alfresco-start.sh "http://localhost:8085/api-explorer"
run: bash ./scripts/ci/cleanup_cache.sh

View File

@@ -27,19 +27,16 @@ jobs:
runs-on: ubuntu-latest
needs: [run_ci]
if: >
!(failure() || cancelled()) &&
!failure() &&
!contains(github.event.head_commit.message, '[no release]') &&
github.event_name != 'pull_request'
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v7.0.0
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v7.0.0
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v7.0.0
- uses: actions/checkout@v3
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.30.0
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.30.0
- name: "Init"
run: bash ./scripts/ci/init.sh
- uses: Alfresco/alfresco-build-tools/.github/actions/configure-git-author@v7.0.0
- uses: Alfresco/alfresco-build-tools/.github/actions/configure-git-author@v1.30.0
with:
username: ${{ env.GIT_USERNAME }}
email: ${{ env.GIT_EMAIL }}
@@ -56,19 +53,16 @@ jobs:
runs-on: ubuntu-latest
needs: [push_to_nexus]
if: >
!(failure() || cancelled()) &&
!failure() &&
!contains(github.event.head_commit.message, '[no downstream]') &&
github.event_name != 'pull_request'
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v7.0.0
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v7.0.0
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v7.0.0
- uses: actions/checkout@v3
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.30.0
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.30.0
- name: "Init"
run: bash ./scripts/ci/init.sh
- uses: Alfresco/alfresco-build-tools/.github/actions/configure-git-author@v7.0.0
- uses: Alfresco/alfresco-build-tools/.github/actions/configure-git-author@v1.30.0
with:
username: ${{ env.GIT_USERNAME }}
email: ${{ env.GIT_EMAIL }}
@@ -78,4 +72,4 @@ jobs:
env:
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
- name: "Clean Maven cache"
run: bash ./scripts/ci/cleanup_cache.sh
run: bash ./scripts/ci/cleanup_cache.sh

View File

@@ -1,14 +0,0 @@
repos:
- repo: https://github.com/Yelp/detect-secrets
rev: v1.5.0
hooks:
- id: detect-secrets
args: ["--baseline", ".secrets.baseline"]
- repo: local
hooks:
- id: check-format-and-headers
name: Check format and headers and fix if necessary
entry: ./scripts/hooks/check-format-and-headers.sh
language: script
files: ".*.java"
pass_filenames: false

File diff suppressed because it is too large Load Diff

View File

@@ -3,58 +3,14 @@ Thanks for your interest in contributing to this project!
The following is a set of guidelines for contributing to this library. Most of them will make the life of the reviewer easier and therefore decrease the time required for the patch be included in the next version.
The project uses [pre-commit](https://pre-commit.com/) to format code (with [Spotless](https://github.com/diffplug/spotless)), validate license headers and check for secrets (with [detect-secrets](https://github.com/Yelp/detect-secrets)). To install the pre-commit hooks then first install pre-commit and then run:
```shell
pre-commit install
```
When you make a commit then these hooks will run and check the modified files. If it makes changes then you can review them and then `git commit` again to accept the changes.
Because this project forms a part of Alfresco Content Services, the guidelines are hosted in the [Alfresco Social Community](http://community.alfresco.com/community/ecm) where they can be referenced from multiple projects.
#### Code Quality
This project uses `spotless` that enforces `alfresco-formatter.xml` to ensure code quality.
To check code-style violations you can use:
```bash
mvn spotless:check
```
To reformat files you can use:
```bash
mvn spotless:apply
```
#### Secret Detection
We are using [detect-secrets](https://github.com/Yelp/detect-secrets) to try to avoid accidentally publishing secret keys.
If you have pre-commit installed then this should run automatically when making a commit. Usually there should be no issues,
but if it finds a potential issue (e.g. a high entropy string) then you will see the following:
```shell
Detect secrets...........................................................Failed
- hook id: detect-secrets
- exit code: 1
ERROR: Potential secrets about to be committed to git repo!
Secret Type: Secret Keyword
Location: test.txt:1
```
If this is a false positive and you actually want to commit the string then run these two commands:
```shell
detect-secrets scan --baseline .secrets.baseline
detect-secrets audit .secrets.baseline
```
This will update the baseline file to include your new code and then allow you to review the detected secret and mark it as a false positive.
Once you are finished then you can add `.secrets.baseline` to the staged changes and you should be able to create a commit.
Because this project forms a part of Alfresco Content Services, the guidelines are hosted in the [Alfresco Social Community](https://hub.alfresco.com/t5/alfresco-content-services-ecm/ct-p/ECM-software) where they can be referenced from multiple projects.
Read an [overview on how this project is goverened](https://community.alfresco.com/docs/DOC-6385-project-overview-repository).
You can report an issue in the ALF project of the [Alfresco issue tracker](http://issues.alfresco.com).
Read [instructions for a good issue report](https://hub.alfresco.com/t5/alfresco-content-services-hub/reporting-an-issue/ba-p/289727).
Read [instructions for a good issue report](https://community.alfresco.com/docs/DOC-6263-reporting-an-issue).
Read [instructions for making a contribution](https://hub.alfresco.com/t5/alfresco-content-services-hub/alfresco-contribution-agreement/ba-p/293276).
Read [instructions for making a contribution](https://community.alfresco.com/docs/DOC-6269-submitting-contributions).
Please follow [the coding standards](https://hub.alfresco.com/t5/alfresco-content-services-hub/coding-standards-for-alfresco-content-services/ba-p/290457).
Please follow [the coding standards](https://community.alfresco.com/docs/DOC-4658-coding-standards).

View File

@@ -1,6 +1,6 @@
# alfresco-community-repo
[![Build Status](https://github.com/Alfresco/alfresco-community-repo/actions/workflows/master_release.yml/badge.svg?branch=master)](https://github.com/Alfresco/alfresco-community-repo/actions/workflows/master_release.yml)
[![Build Status](https://github.com/Alfresco/alfresco-community-repo/actions/workflows/master_release.yml/badge.svg?branch=7.3.1)](https://github.com/Alfresco/alfresco-community-repo/actions/workflows/master_release.yml)
#### Alfresco Core
@@ -26,7 +26,7 @@ Repository is a library packaged as a jar file which contains the following:
Remote API is a library packaged as a jar file which contains the following:
* REST API framework
* WebScript implementations including [V1 REST APIs](https://hub.alfresco.com/t5/alfresco-content-services-blog/v1-rest-api-10-things-you-should-know/ba-p/287692)
* WebScript implementations including [V1 REST APIs](https://community.alfresco.com/community/ecm/blog/2017/05/02/v1-rest-api-10-things-you-should-know)
* [OpenCMIS](https://chemistry.apache.org/java/opencmis.html) implementations
#### Artifacts
@@ -94,4 +94,4 @@ The enterprise projects which extend the `alfresco-community-repo` use the same
artifact version number.
### Contributing guide
Please use [this guide](CONTRIBUTING.md) to make a contribution to the project.
Please use [this guide](CONTRIBUTING.md) to make a contribution to the project.

View File

@@ -1,401 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<profiles version="23">
<profile kind="CodeFormatterProfile" name="Spotless" version="23">
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.align_with_spaces" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/>
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_before_code_block" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_switch_case_expressions" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.enabling_tag" value="@formatter:on"/>
<setting id="org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_record_components" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_logical_operator" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_annotation_declaration_on_one_line" value="one_line_if_empty"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_record_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_abstract_method" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.keep_enum_constant_declaration_on_one_line" value="one_line_if_empty"/>
<setting id="org.eclipse.jdt.core.formatter.align_variable_declarations_on_columns" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.keep_anonymous_type_declaration_on_one_line" value="one_line_if_empty"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_switch_case_expressions" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_shift_operator" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="next_line"/>
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_code_block" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_type_parameters" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_loops" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.keep_simple_for_body_on_same_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_switch_case_arrow_operator" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_enum_constant" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.text_block_indentation" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_module_statements" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_if_then_body_block_on_one_line" value="one_line_if_empty"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_permitted_types" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="next_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression_chain" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_type_annotations" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_assertion_message_operator" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_method_declaration" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines" value="2147483647"/>
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="next_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_resources_in_try" value="80"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_not_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_type_arguments" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_package" value="49"/>
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_label" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_case" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_permitted_types_in_type_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_record_header" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.comment.javadoc_do_not_separate_block_tags" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.indent_tag_description" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_record_constructor" value="next_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_string_concatenation" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_shift_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_shift_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_simple_do_while_body_on_same_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_record_components" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_additive_operator" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.keep_simple_getter_setter_on_one_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.join_lines_in_comments" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_record_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_relational_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_logical_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_record_declaration" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_default" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_method_body" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_case" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.keep_switch_body_block_on_one_line" value="one_line_never"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_switch_case_with_arrow" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.align_tags_descriptions_grouped" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="999"/>
<setting id="org.eclipse.jdt.core.formatter.use_on_off_tags" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.keep_method_body_on_one_line" value="one_line_if_empty"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_loop_body_block_on_one_line" value="one_line_if_empty"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="next_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_type_declaration_on_one_line" value="one_line_if_empty"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_additive_operator" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_record_constructor" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_relational_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_record_declaration_on_one_line" value="one_line_if_empty"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="next_line"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_lambda_body" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_parameter" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_relational_operator" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_additive_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.align_selector_in_method_invocation_on_expression_first_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_record_declaration" value="next_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_switch_case_with_arrow_on_one_line" value="one_line_never"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_switch_case_with_colon" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_after_code_block" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="80"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_type" value="49"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_local_variable" value="49"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="next_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_default" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_between_different_tags" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_additive_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_field" value="49"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_conditional_operator" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_shift_operator" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.keep_code_block_on_one_line" value="one_line_if_empty"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_record_components" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="2"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_record_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_assignment_operator" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="next_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_switch_case_with_arrow" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.keep_lambda_body_block_on_one_line" value="one_line_if_empty"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_method" value="49"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_record_constructor_on_one_line" value="one_line_if_empty"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_record_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_assertion_message" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_logical_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_record_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_relational_operator" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_last_class_body_declaration" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.keep_simple_while_body_on_same_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_logical_operator" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_statement_group_in_switch" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_permitted_types" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_enum_declaration_on_one_line" value="one_line_if_empty"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="next_line"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="next_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_code_block" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="space"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_string_concatenation" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="999"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
</profile>
</profiles>

View File

@@ -71,7 +71,7 @@ the _alfresco-internal_ repository:
</snapshots>
</repository>
```
For additional instructions you can check the official Maven documentation:
* [setting up repositories](https://maven.apache.org/guides/mini/guide-multiple-repositories.html)
@@ -227,7 +227,7 @@ If only the Community or Enterprise images need to be built than the same comman
The Docker images of the Repo can be started independently from Share running the following command in the rm-repo-enterprise or rm-repo-community folder which contains the Docker-compose.yml file:
```
docker compose up
docker-compose up
```
> Be aware of the fact that the Share images can not be started independently from Repo
@@ -237,5 +237,5 @@ e.g. In order to start an instance of rm-enterprise-repo and rm-enterprise-share
If you have a license for jRebel then this can be used from the rm-community-share or rm-enterprise-share directories with:
```
docker compose -f docker-compose.yml -f jrebel-docker-compose.yml --project-name agsdev up --build --force-recreate
docker-compose -f docker-compose.yml -f jrebel-docker-compose.yml --project-name agsdev up --build --force-recreate
```

View File

@@ -4,9 +4,9 @@ set -x
# Display running containers
docker ps
alfrescoContainerId=$(docker ps -a | grep '\-alfresco\-' | awk '{print $1}')
shareContainerId=$(docker ps -a | grep '\-share\-' | awk '{print $1}')
solrContainerId=$(docker ps -a | grep '\-search\-' | awk '{print $1}')
alfrescoContainerId=$(docker ps -a | grep '_alfresco_' | awk '{print $1}')
shareContainerId=$(docker ps -a | grep '_share_' | awk '{print $1}')
solrContainerId=$(docker ps -a | grep '_search_' | awk '{print $1}')
docker logs $alfrescoContainerId > alfresco.log
if [ -n "$shareContainerId" ]; then

View File

@@ -7,29 +7,21 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-amps</artifactId>
<version>23.1.1.13-SNAPSHOT</version>
<version>19.12</version>
</parent>
<modules>
<module>rm-community</module>
<module>rm-automation</module>
</modules>
<profiles>
<profile>
<id>all-tas-tests</id>
<modules>
<module>rm-automation</module>
</modules>
</profile>
</profiles>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<license.update.dryrun>true</license.update.dryrun>
<license.verbose>false</license.verbose>
<license.failOnNotUptodateHeader>true</license.failOnNotUptodateHeader>
<license.failOnNotUptodateHeader>false</license.failOnNotUptodateHeader>
</properties>
<build>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-governance-services-community-parent</artifactId>
<version>23.1.1.13-SNAPSHOT</version>
<version>19.12</version>
</parent>
<modules>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-governance-services-automation-community-repo</artifactId>
<version>23.1.1.13-SNAPSHOT</version>
<version>19.12</version>
</parent>
<build>
@@ -42,10 +42,15 @@
</build>
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-reload4j</artifactId>
<version>${dependency.slf4j.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.alfresco.tas</groupId>
<artifactId>restapi</artifactId>
<version>${project.version}</version>
<exclusions>
<exclusion>
<groupId>org.alfresco.tas</groupId>
@@ -82,25 +87,7 @@
<dependency>
<groupId>com.github.docker-java</groupId>
<artifactId>docker-java</artifactId>
<version>3.3.2</version>
<exclusions>
<exclusion>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
</exclusion>
<exclusion>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15to18</artifactId>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15to18</artifactId>
<version>3.2.13</version>
</dependency>
</dependencies>
</project>

View File

@@ -28,7 +28,7 @@ package org.alfresco.rest.core;
import static lombok.AccessLevel.PROTECTED;
import jakarta.annotation.Resource;
import javax.annotation.Resource;
import lombok.Getter;
import lombok.Setter;

View File

@@ -26,8 +26,8 @@
*/
package org.alfresco.rest.core.v0;
import jakarta.json.Json;
import jakarta.json.JsonReader;
import javax.json.Json;
import javax.json.JsonReader;
import java.io.IOException;
import java.io.InputStream;
import java.time.format.DateTimeFormatter;

View File

@@ -124,7 +124,7 @@ public abstract class BaseAPI
/**
* Helper method to extract the property value for the given nodeRef and property name
*
*
* @param result
* @param nodeRef
* @param propertyName
@@ -152,7 +152,7 @@ public abstract class BaseAPI
return propertyValue;
}
/**
* Helper method to extract property values from request result and put them in map as a list that corresponds to a unique property value.
*
@@ -512,12 +512,7 @@ public abstract class BaseAPI
try
{
HttpResponse httpResponse = doRequestJson(HttpPost.class, requestUrl, adminUser, adminPassword, requestParams);
if (httpResponse.getStatusLine().getStatusCode() != expectedStatusCode)
{
// It's only possible to stream the response body once, so ensure we only do this if the test has failed.
JSONObject responseJson = responseBodyToJson(httpResponse);
assertEquals("POST request to " + requestUrl + " was not successful. Response: " + responseJson, expectedStatusCode, httpResponse.getStatusLine().getStatusCode());
}
assertEquals("POST request to " + requestUrl + " was not successful.", expectedStatusCode, httpResponse.getStatusLine().getStatusCode());
return httpResponse;
}
catch (InstantiationException | IllegalAccessException error)
@@ -526,32 +521,6 @@ public abstract class BaseAPI
}
}
/**
* Try to convert the response body to a JSON object.
*
* @param response The response.
* @return The JSON object or null if it was not possible to convert the response.
*/
private JSONObject responseBodyToJson(HttpResponse response)
{
try
{
try
{
return new JSONObject(EntityUtils.toString(response.getEntity()));
}
catch (JSONException error)
{
LOGGER.error("Converting message body to JSON failed. Body: {}", response.getEntity().getContent(), error);
}
}
catch (ParseException | IOException error)
{
LOGGER.error("Parsing message body failed.", error);
}
return null;
}
/**
* Helper method for handling generic HTTP requests
* @param requestType request type (a subclass of {@link HttpRequestBase})
@@ -589,7 +558,18 @@ public abstract class BaseAPI
HttpResponse response = client.execute(adminUser, adminPassword, request);
LOGGER.info("Response: {}", response.getStatusLine());
responseBody = responseBodyToJson(response);
try
{
responseBody = new JSONObject(EntityUtils.toString(response.getEntity()));
}
catch (JSONException error)
{
LOGGER.error("Converting message body to JSON failed. Body: {}", responseBody, error);
}
catch (ParseException | IOException error)
{
LOGGER.error("Parsing message body failed.", error);
}
switch (response.getStatusLine().getStatusCode())
{

View File

@@ -61,7 +61,7 @@ public class FilePlanComponentFields
public static final String PROPERTIES_RECORD_SEARCH_DISPOSITION_EVENTS = "rma:recordSearchDispositionEvents";
public static final String PROPERTIES_DECLASSIFICATION_REVIEW_COMPLETED_BY = "rma:declassificationReviewCompletedBy";
public static final String PROPERTIES_DECLASSIFICATION_REVIEW_COMPLETED_AT = "rma:declassificationReviewCompletedAt";
/** File plan properties */
public static final String PROPERTIES_COMPONENT_ID = "st:componentId";

View File

@@ -125,7 +125,7 @@ public class RecordProperties extends TestModel
@JsonProperty (required = true, value = PROPERTIES_ORIGINAL_NAME)
private String originalName;
@JsonProperty (PROPERTIES_CLASSIFICATION)
private List<String> classification;

View File

@@ -112,10 +112,10 @@ public class RecordCategoryChildProperties extends TestModel
@JsonProperty (PROPERTIES_RECORD_SEARCH_HAS_DISPOSITION_SCHEDULE)
private Boolean recordSearchHasDispositionSchedule;
@JsonProperty (PROPERTIES_RECORD_SEARCH_DISPOSITION_PERIOD_EXPRESSION)
private String recordSearchDispositionPeriodExpression;
@JsonProperty (PROPERTIES_RECORD_SEARCH_DISPOSITION_AUTHORITY)
private String recordSearchDispositionAuthority;
@@ -136,7 +136,7 @@ public class RecordCategoryChildProperties extends TestModel
@JsonProperty (PROPERTIES_RECORD_SEARCH_DISPOSITION_EVENTS)
private List<String> recordSearchDispositionEvents;
@JsonProperty (PROPERTIES_OWNER)
private Owner owner;

View File

@@ -112,13 +112,13 @@ public class RecordFolderProperties extends TestModel
@JsonProperty (PROPERTIES_CLASSIFICATION)
private List<String> classification;
@JsonProperty (PROPERTIES_DESCRIPTION)
private String description;
@JsonProperty (PROPERTIES_OWNER)
private Owner owner;
@JsonProperty (PROPERTIES_RECORD_SEARCH_VITAL_RECORD_REVIEW_PERIOD)
private String recordSearchVitalRecordReviewPeriod;

View File

@@ -28,7 +28,7 @@ package org.alfresco.rest.rm.community.model.user;
/**
* Constants for RM user capabilities
*
*
* @author Kristijan Conkas
* @since 2.6
*/

View File

@@ -38,7 +38,7 @@ import org.springframework.stereotype.Component;
/**
* The v0 REST API for nodes
*
*
* @author jcule
* @since 2.7EA1
*/
@@ -56,7 +56,7 @@ public class NodeAPI extends BaseAPI
/**
* Get the node metadata using the using the node data webscript: Document List v2 Component
*
*
* @param username
* @param password
* @param nodeId
@@ -70,5 +70,5 @@ public class NodeAPI extends BaseAPI
client.close();
return doGetRequest(username, password, requestURL);
}
}

View File

@@ -26,7 +26,6 @@
*/
package org.alfresco.rest.v0;
import static org.apache.http.HttpStatus.SC_OK;
import static org.testng.Assert.assertTrue;
import java.io.UnsupportedEncodingException;
@@ -37,7 +36,6 @@ import java.util.List;
import org.alfresco.rest.core.v0.BaseAPI;
import org.alfresco.rest.rm.community.model.audit.AuditEntry;
import org.alfresco.rest.rm.community.util.PojoUtility;
import org.apache.http.HttpResponse;
import org.json.JSONArray;
import org.json.JSONObject;
import org.slf4j.Logger;
@@ -60,8 +58,6 @@ public class RMAuditAPI extends BaseAPI
private static final String RM_AUDIT_API = "{0}rma/admin/rmauditlog";
private static final String RM_AUDIT_LOG_API = RM_AUDIT_API + "?{1}";
private static final String RM_AUDIT_LOG_AS_RECORD = "{0}node/{1}/rmauditlog";
/**
* Returns a list of rm audit entries .
*
@@ -88,21 +84,6 @@ public class RMAuditAPI extends BaseAPI
return PojoUtility.jsonToObject(auditEntries, AuditEntry.class);
}
/**
* Returns a list of rm audit entries .
*
* @param user The username of the user to use.
* @param password The password of the user.
* @param size Maximum number of log entries to return
* @return return All return log entries
*/
public List<AuditEntry> getRMAuditLogAll(String user, String password, final int size) {
String parameters = "size=" + size;
JSONArray auditEntries = doGetRequest(user, password,
MessageFormat.format(RM_AUDIT_LOG_API,"{0}", parameters)).getJSONObject("data").getJSONArray("entries");
return PojoUtility.jsonToObject(auditEntries, AuditEntry.class);
}
/**
* Clear the list of audit entries.
*
@@ -119,19 +100,5 @@ public class RMAuditAPI extends BaseAPI
&& getRMAuditLog(username, password, 100, null).size() == 2);
}
/**
* Logs the Audit Log as Record.
*
* @param username The username of the user to use.
* @param password The password of the user.
* @param recNodeRef The Record Node reference for which Audit log should be created as record
* @param destinationNodeRef The Folder id Node reference where the html file should be placed
* @throws AssertionError If the API call didn't create the Audit Log as Record.
*/
public HttpResponse logsAuditLogAsRecord(String username, String password, String recNodeRef, String destinationNodeRef) {
JSONObject requestParams = new JSONObject();
requestParams.put("destination", destinationNodeRef);
return doPostJsonRequest(username, password, SC_OK, requestParams, RM_AUDIT_LOG_AS_RECORD,recNodeRef);
}
}

View File

@@ -97,16 +97,4 @@ public class RecordFoldersAPI extends BaseAPI
return null;
}
public HttpResponse reOpenRecordFolder(String user, String password, String recordFolder)
{
String recNodeRef = getNodeRefSpacesStore() + contentService.getNodeRef(user, password, RM_SITE_ID, recordFolder);
JSONObject requestParams = new JSONObject();
requestParams.put("name", "openRecordFolder");
requestParams.put("nodeRef", recNodeRef);
return doPostJsonRequest(user, password, SC_OK, requestParams, RM_ACTIONS_API);
}
}

View File

@@ -360,25 +360,4 @@ public class RecordsAPI extends BaseAPI
{
return getNodeRefSpacesStore() + getItemNodeRef(username, password, recordPath + "/" + recordName);
}
/**
* Reopens the record given as parameter
*
* @param user the user declaring the document as record
* @param password the user's password
* @param recordName the record name
* @return The HTTP Response.
*/
public HttpResponse reOpenRecord(String user, String password, String recordName)
{
String recNodeRef = getNodeRefSpacesStore() + contentService.getNodeRef(user, password, RM_SITE_ID, recordName);
JSONObject requestParams = new JSONObject();
requestParams.put("name", "undeclareRecord");
requestParams.put("nodeRef", recNodeRef);
return doPostJsonRequest(user, password, SC_OK, requestParams, RM_ACTIONS_API);
}
}

View File

@@ -143,7 +143,7 @@ public class SearchAPI extends BaseAPI
/**
* Search as a user for nodes on site "rm" matching query, using SearchAPI.RM_DEFAULT_RECORD_FILTERS and sorted
* by sortby and returns the property value for the given nodeRef and property name
*
*
* @param username
* @param password
* @param query
@@ -157,9 +157,9 @@ public class SearchAPI extends BaseAPI
{
String searchFilterParamaters = MessageFormat.format(RM_DEFAULT_NODES_FILTERS, Boolean.toString(includeFolders),
Boolean.toString(includeCategories));
return getItemProperty(rmSearch(username, password, "rm", query, searchFilterParamaters, sortby), nodeRef, propertyName);
return getItemProperty(rmSearch(username, password, "rm", query, searchFilterParamaters, sortby), nodeRef, propertyName);
}
/**
* Generic faceted search.
* @param username
@@ -229,17 +229,17 @@ public class SearchAPI extends BaseAPI
/**
* Helper method to extract list of names from search result.
*
*
* @param searchResult
* @return list of document or record names in search result
* @throws FileNotFoundException
* @throws JsonSyntaxException
* @throws JsonIOException
* @throws FileNotFoundException
* @throws JsonSyntaxException
* @throws JsonIOException
* @throws RuntimeException for malformed search response
*/
/**
* Helper method to extract list of names from search result.
*
*
* @param searchResult
* @return
*/
@@ -247,10 +247,10 @@ public class SearchAPI extends BaseAPI
{
return getPropertyValues(searchResult, "name");
}
/**
* Helper method to extract list of property values from search result for the given nodeRef.
*
*
* @param searchResult
* @param nodeRef
* @param propertyName

View File

@@ -1,146 +0,0 @@
/*
* #%L
* Alfresco Records Management Module
* %%
* 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.rest.rm.community.audit;
import static java.util.Arrays.asList;
import static org.alfresco.rest.rm.community.base.TestData.*;
import static org.alfresco.rest.rm.community.model.audit.AuditEvents.ADD_TO_HOLD;
import static org.alfresco.rest.rm.community.model.audit.AuditEvents.REMOVE_FROM_HOLD;
import static org.alfresco.rest.rm.community.util.CommonTestUtils.generateTestPrefix;
import static org.alfresco.utility.data.RandomData.getRandomName;
import static org.alfresco.utility.report.log.Step.STEP;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.empty;
import static org.hamcrest.core.IsNot.not;
import static org.springframework.http.HttpStatus.CREATED;
import static org.testng.AssertJUnit.*;
import java.util.Collections;
import java.util.List;
import org.alfresco.dataprep.CMISUtil;
import org.alfresco.rest.rm.community.base.BaseRMRestTest;
import org.alfresco.rest.rm.community.model.audit.AuditEntry;
import org.alfresco.rest.rm.community.model.audit.AuditEvents;
import org.alfresco.rest.rm.community.model.record.Record;
import org.alfresco.rest.rm.community.model.recordcategory.RecordCategory;
import org.alfresco.rest.rm.community.model.recordcategory.RecordCategoryChild;
import org.alfresco.rest.rm.community.model.recordfolder.RecordFolder;
import org.alfresco.rest.rm.community.model.user.UserRoles;
import org.alfresco.rest.v0.HoldsAPI;
import org.alfresco.rest.v0.service.RMAuditService;
import org.alfresco.rest.v0.service.RoleService;
import org.alfresco.utility.model.FileModel;
import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.UserModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
public class AuditHoldsTest extends BaseRMRestTest {
private final String PREFIX = generateTestPrefix(AuditAddToHoldTests.class);
private final String HOLD1 = PREFIX + "hold1";
private SiteModel publicSite;
private FileModel testFile;
@Autowired
private RMAuditService rmAuditService;
@Autowired
private HoldsAPI holdsAPI;
@Autowired
private RoleService roleService;
private UserModel rmAdmin;
private RecordCategory recordCategory;
private RecordCategoryChild recordFolder1,recordFolder2;
private List<AuditEntry> auditEntries;
private String hold1NodeRef;
public static final String RECORD_FOLDER_THREE = "record-folder-three";
@BeforeClass(alwaysRun = true)
public void preconditionForAuditAddToHoldTests()
{
createRMSiteIfNotExists();
rmAdmin = roleService.createUserWithRMRole(UserRoles.ROLE_RM_ADMIN.roleId);
STEP("Create a hold");
hold1NodeRef = holdsAPI.createHoldAndGetNodeRef(rmAdmin.getUsername(), rmAdmin.getPassword(), HOLD1, HOLD_REASON,
HOLD_DESCRIPTION);
STEP("Create a collaboration site with a test file.");
publicSite = dataSite.usingAdmin().createPublicRandomSite();
testFile = dataContent.usingAdmin().usingSite(publicSite).createContent(CMISUtil.DocumentType.TEXT_PLAIN);
STEP("Create a record category with 2 folders and 1 record");
recordCategory = createRootCategory(getRandomName("recordCategory"));
recordFolder1 = createRecordFolder(recordCategory.getId(), PREFIX + "recFolder1");
recordFolder2 = createRecordFolder(recordCategory.getId(), PREFIX + "recFolder2");
Record recordToBeAdded = createElectronicRecord(recordFolder1.getId(), PREFIX + "record");
assertStatusCode(CREATED);
STEP("Add some items to the hold, then remove them from the hold");
final List<String> itemsList = asList(testFile.getNodeRefWithoutVersion(), recordToBeAdded.getId(), recordFolder2.getId());
final List<String> holdsList = Collections.singletonList(HOLD1);
holdsAPI.addItemToHold(rmAdmin.getUsername(), rmAdmin.getPassword(), recordToBeAdded.getId(), HOLD1);
holdsAPI.removeItemsFromHolds(rmAdmin.getUsername(), rmAdmin.getPassword(), itemsList, holdsList);
STEP("Delete the record folder that was held");
getRestAPIFactory().getRecordFolderAPI().deleteRecordFolder(recordFolder2.getId());
STEP("Rename the parent of the record that was held");
RecordFolder recordFolder = RecordFolder.builder().name(RECORD_FOLDER_THREE).build();
getRestAPIFactory().getRecordFolderAPI().updateRecordFolder(recordFolder, recordFolder1.getId());
}
/**
* Data provider with hold events that have links to held items
*
* @return the hold events
*/
@DataProvider (name = "holdsEvents")
public Object[][] getHoldEvents()
{
return new AuditEvents[][]
{
{ ADD_TO_HOLD },
{ REMOVE_FROM_HOLD }
};
}
@Test (dataProvider = "holdsEvents")
public void checkItemPathLink(AuditEvents event) {
auditEntries = rmAuditService.getAuditEntriesFilteredByEvent(getAdminUser(), event);
assertFalse("Audit results should not be empty",auditEntries.size()==0);
final String auditedEvent = event + " - " + testFile.getName();
assertTrue("Audit results should contain one " + auditedEvent + " event",auditEntries.stream().anyMatch(e -> e.getEvent().startsWith(event.eventDisplayName)));
STEP("Check the audit log contains only an entry for add to hold.");
assertThat(auditEntries, is(not(empty())));
}
@AfterClass(alwaysRun = true)
private void cleanup() {
dataSite.usingAdmin().deleteSite(publicSite);
deleteRecordFolder(recordFolder1.getId());
deleteRecordFolder(recordFolder2.getId());
deleteRecordCategory(recordCategory.getId());
rmAuditService.clearAuditLog();
}
}

View File

@@ -73,7 +73,7 @@ public class AuditLoginEventsTests extends BaseRMRestTest
assertTrue("The list of events is not filtered by " + LOGIN_UNSUCCESSFUL.event,
auditEntries.stream().allMatch(auditEntry -> auditEntry.getEvent().equals(LOGIN_UNSUCCESSFUL.eventDisplayName)));
}
/**
* Given I have tried to login using valid credentials
* When I view the RM audit filtered by Login successful event

View File

@@ -1,244 +0,0 @@
/*
* #%L
* Alfresco Records Management Module
* %%
* 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.rest.rm.community.audit;
import org.alfresco.rest.rm.community.base.BaseRMRestTest;
import org.alfresco.rest.rm.community.model.audit.AuditEntry;
import org.alfresco.rest.rm.community.model.record.Record;
import org.alfresco.rest.rm.community.model.recordcategory.RecordCategory;
import org.alfresco.rest.rm.community.model.recordcategory.RecordCategoryChild;
import org.alfresco.rest.v0.RMAuditAPI;
import org.alfresco.rest.v0.RMRolesAndActionsAPI;
import org.alfresco.rest.v0.RecordsAPI;
import org.alfresco.test.AlfrescoTest;
import org.alfresco.utility.Utility;
import org.alfresco.utility.model.UserModel;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.util.EntityUtils;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.testng.AssertJUnit;
import org.testng.annotations.AfterClass;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import java.io.IOException;
import java.util.List;
import java.util.Optional;
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentAspects.ASPECTS_COMPLETED_RECORD;
import static org.alfresco.rest.rm.community.util.CommonTestUtils.generateTestPrefix;
import static org.alfresco.rest.rm.community.utils.FilePlanComponentsUtil.createRecordModel;
import static org.springframework.http.HttpStatus.OK;
import static org.springframework.test.util.AssertionErrors.assertTrue;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.fail;
public class ElectronicRecordAuditLogTest extends BaseRMRestTest {
private Optional<UserModel> rmAdmin;
@Autowired
private RMRolesAndActionsAPI rmRolesAndActionsAPI;
@Autowired
private RMAuditAPI auditLog;
@Autowired
private RecordsAPI recordApi;
/* electronic record details */
private static final String AUDIT_ELECTRONIC_RECORD = generateTestPrefix(ElectronicRecordAuditLogTest.class) + "electronic record";
private static final String AUDIT_COMPLETE_REOPEN_ELECTRONIC_RECORD = "Complete Reopen Electronic Record";
public static final String TITLE = "Title";
public static final String DESCRIPTION = "Description";
private RecordCategory category1;
private RecordCategoryChild recordFolder1;
private Record electronicRecord, electronicRecord2;
@BeforeClass(alwaysRun = true)
public void electronicRecordsAuditLogSetup()
{
createRMSiteIfNotExists();
rmAdmin = Optional.ofNullable(getDataUser().createRandomTestUser());
rmRolesAndActionsAPI.assignRoleToUser(
getDataUser().usingAdmin().getAdminUser().getUsername(),
getDataUser().usingAdmin().getAdminUser().getPassword(),
rmAdmin.get().getUsername(),
"Administrator");
auditLog.clearAuditLog(rmAdmin.get().getUsername(),rmAdmin.get().getPassword());
category1 = createRootCategory(TITLE, DESCRIPTION);
recordFolder1 = createFolder(category1.getId(),TITLE);
electronicRecord = createElectronicRecord(recordFolder1.getId(),AUDIT_ELECTRONIC_RECORD,rmAdmin.get());
}
@Test(description = "Audit log for newly filed electronic record")
@AlfrescoTest(jira="RM-4303")
public void newElectronicRecordAudit() {
List<AuditEntry> auditEntries= auditLog.getRMAuditLogAll(getAdminUser().getUsername(),getAdminUser().getPassword(),100);
// newly created record contains 2 events: "file to" and metadata update
// the order in which object creation and metadata update are listed isn't always identical due to
// both happening in the same transaction
assertTrue("File To Event is not present.",auditEntries.stream().anyMatch(x -> x.getEvent().startsWith("File to")));
assertTrue("Updated metadata Event is not present.",auditEntries.stream().anyMatch(x -> x.getEvent().startsWith("Updated Metadata")));
}
@Test
(
dependsOnMethods = "newElectronicRecordAudit",
description = "Viewing electronic record audit log is itself an auditable event"
)
@AlfrescoTest(jira="RM-4303")
public void electronicRecordAuditIsEvent()
{
List<AuditEntry> auditEntries= auditLog.getRMAuditLogAll(getAdminUser().getUsername(),getAdminUser().getPassword(),100);
assertTrue("Audit View Event is not present.",auditEntries.stream().anyMatch(x -> x.getEvent().startsWith("Audit View")));
}
@Test
(
dependsOnMethods = "electronicRecordAuditIsEvent",
description = "Rename electronic record is an edit metadata event"
)
@AlfrescoTest(jira="RM-4303")
public void renameElectronicRecord() {
auditLog.clearAuditLog(rmAdmin.get().getUsername(),rmAdmin.get().getPassword());
Record renameElectronicRecord = createRecordModel("edited " + electronicRecord.getName(), "", "");
// rename record
getRestAPIFactory().getRecordsAPI().updateRecord(renameElectronicRecord, electronicRecord.getId());
assertStatusCode(OK);
// we expect 1 new event: "metadata update"
List<AuditEntry> auditEntries= auditLog.getRMAuditLogAll(getAdminUser().getUsername(),getAdminUser().getPassword(),100);
assertTrue("Updated metadata Event is not present.",auditEntries.stream().anyMatch(x -> x.getEvent().startsWith("Updated Metadata")));
}
@Test (
dependsOnMethods = "newElectronicRecordAudit",
description = "Complete and reopen electronic record")
@AlfrescoTest(jira="RM-4303")
public void completeAndReopenElectronicRecord() {
electronicRecord2 = createElectronicRecord(recordFolder1.getId(),AUDIT_COMPLETE_REOPEN_ELECTRONIC_RECORD);
// complete record
recordApi.completeRecord(rmAdmin.get().getUsername(),rmAdmin.get().getPassword(),
electronicRecord2.getName());
try
{
Utility.sleep(1000, 30000, () ->
{
org.alfresco.rest.rm.community.requests.gscore.api.RecordsAPI recordsAPI = getRestAPIFactory().getRecordsAPI();
List<String> aspects = recordsAPI.getRecord(electronicRecord2.getId()).getAspectNames();
// a record must be completed
assertTrue("Record is not completed.",aspects.contains(ASPECTS_COMPLETED_RECORD));
});
}
catch (InterruptedException e)
{
fail("InterruptedException received while waiting for results.");
}
List<AuditEntry> auditEntries= auditLog.getRMAuditLogAll(getAdminUser().getUsername(),getAdminUser().getPassword(),100);
assertTrue("Complete Record Event is not present.",auditEntries.stream().anyMatch(x -> x.getEvent().startsWith("Complete Record")));
// Reopen record
recordApi.reOpenRecord(rmAdmin.get().getUsername(),rmAdmin.get().getPassword(),
electronicRecord2.getName());
try
{
Utility.sleep(1000, 30000, () ->
{
org.alfresco.rest.rm.community.requests.gscore.api.RecordsAPI recordsAPI = getRestAPIFactory().getRecordsAPI();
List<String> aspects = recordsAPI.getRecord(electronicRecord2.getId()).getAspectNames();
// a record mustn't be completed
assertFalse(aspects.contains(ASPECTS_COMPLETED_RECORD));
});
}
catch (InterruptedException e)
{
fail("InterruptedException received while waiting for results.");
}
auditEntries= auditLog.getRMAuditLogAll(getAdminUser().getUsername(),getAdminUser().getPassword(),100);
assertTrue("Reopen Record Event is not present.",auditEntries.stream().anyMatch(x -> x.getEvent().startsWith("Reopen Record")));
}
@Test
(
dependsOnMethods = "completeAndReopenElectronicRecord",
description = "File electronic record's audit log as record"
)
@AlfrescoTest(jira="RM-4303")
public void fileElectronicRecordAuditLogAsRecord()
{
// audit log is stored in the same folder, refresh it so that it appears in the list
HttpResponse auditRecordHttpResponse = auditLog.logsAuditLogAsRecord(rmAdmin.get().getUsername(),rmAdmin.get().getPassword(),
getRecordNodeRef(electronicRecord2.getId()),getFolderNodeRef(recordFolder1.getId()));
JSONObject auditRecordProperties = getAuditPropertyValues(auditRecordHttpResponse);
Record auditRecord = getRestAPIFactory().getRecordsAPI().getRecord(auditRecordProperties.get("record").toString()
.replace("workspace://SpacesStore/",""));
// check audit log
AssertJUnit.assertTrue(auditRecordProperties.get("recordName").toString().endsWith(".html"));
AssertJUnit.assertTrue(auditRecord.getAspectNames().stream().noneMatch(x -> x.startsWith(ASPECTS_COMPLETED_RECORD)));
}
private String getFolderNodeRef(String folderId) {
return "workspace://SpacesStore/" + folderId;
}
private String getRecordNodeRef(String recordId) {
return "workspace/SpacesStore/" + recordId;
}
private JSONObject getAuditPropertyValues(HttpResponse httpResponse) {
HttpEntity entity = httpResponse.getEntity();
String responseString = null;
try {
responseString = EntityUtils.toString(entity, "UTF-8");
} catch (IOException e) {
throw new RuntimeException(e);
}
JSONObject result = new JSONObject(responseString);
return result;
}
@AfterMethod
private void closeAuditLog() {
auditLog.clearAuditLog(rmAdmin.get().getUsername(),rmAdmin.get().getPassword());
}
@AfterClass(alwaysRun = true)
private void electronicRecordAuditLogCleanup() {
deleteRecord(electronicRecord.getId());
deleteRecordFolder(recordFolder1.getId());
deleteRecordCategory(category1.getId());
dataUser.usingAdmin().deleteUser(new UserModel(rmAdmin.get().getUsername(), rmAdmin.get().getPassword()));
}
}

View File

@@ -1,246 +0,0 @@
/*
* #%L
* Alfresco Records Management Module
* %%
* 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.rest.rm.community.audit;
import org.alfresco.rest.rm.community.base.BaseRMRestTest;
import org.alfresco.rest.rm.community.model.audit.AuditEntry;
import org.alfresco.rest.rm.community.model.record.Record;
import org.alfresco.rest.rm.community.model.recordcategory.RecordCategory;
import org.alfresco.rest.rm.community.model.recordcategory.RecordCategoryChild;
import org.alfresco.rest.v0.RMAuditAPI;
import org.alfresco.rest.v0.RMRolesAndActionsAPI;
import org.alfresco.rest.v0.RecordsAPI;
import org.alfresco.test.AlfrescoTest;
import org.alfresco.utility.Utility;
import org.alfresco.utility.model.UserModel;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.util.EntityUtils;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.testng.AssertJUnit;
import org.testng.annotations.AfterClass;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import java.io.IOException;
import java.util.List;
import java.util.Optional;
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentAspects.ASPECTS_COMPLETED_RECORD;
import static org.alfresco.rest.rm.community.util.CommonTestUtils.generateTestPrefix;
import static org.alfresco.rest.rm.community.utils.FilePlanComponentsUtil.createRecordModel;
import static org.springframework.http.HttpStatus.OK;
import static org.springframework.test.util.AssertionErrors.assertTrue;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.fail;
public class NonElectronicRecordAuditLogTest extends BaseRMRestTest {
private Optional<UserModel> rmAdmin;
@Autowired
private RMRolesAndActionsAPI rmRolesAndActionsAPI;
@Autowired
private RMAuditAPI auditLog;
@Autowired
private RecordsAPI recordApi;
private RecordCategory category1;
private RecordCategoryChild recordFolder1;
private Record nonElectronicRecord , nonElectronicRecord2;
private static final String AUDIT_NON_ELECTRONIC_RECORD = generateTestPrefix(NonElectronicRecordAuditLogTest.class) + "non electronic record";
private static final String AUDIT_COMPLETE_REOPEN_NON_ELECTRONIC_RECORD = "Complete Reopen Non-Electronic Record";
public static final String TITLE = "Title";
public static final String DESCRIPTION = "Description";
@BeforeClass(alwaysRun = true)
public void nonElectronicRecordAuditLogSetup()
{
createRMSiteIfNotExists();
rmAdmin = Optional.ofNullable(getDataUser().createRandomTestUser());
rmRolesAndActionsAPI.assignRoleToUser(
getDataUser().usingAdmin().getAdminUser().getUsername(),
getDataUser().usingAdmin().getAdminUser().getPassword(),
rmAdmin.get().getUsername(),
"Administrator");
auditLog.clearAuditLog(rmAdmin.get().getUsername(),rmAdmin.get().getPassword());
category1 = createRootCategory(TITLE, DESCRIPTION);
recordFolder1 = createFolder(category1.getId(),TITLE);
nonElectronicRecord = createNonElectronicRecord(recordFolder1.getId(),AUDIT_NON_ELECTRONIC_RECORD,rmAdmin.get());
}
@Test(description = "Audit log for newly filed non-electronic record")
@AlfrescoTest(jira="RM-4303")
public void newNonElectronicRecordAudit()
{
List<AuditEntry> auditEntries= auditLog.getRMAuditLogAll(getAdminUser().getUsername(),getAdminUser().getPassword(),100);
// newly created record contains 3 events: "created object", "file to" and metadata update
assertTrue("File To Event is not present.",auditEntries.stream().anyMatch(x -> x.getEvent().startsWith("File to")));
assertTrue("Updated metadata Event is not present.",auditEntries.stream().anyMatch(x -> x.getEvent().startsWith("Updated Metadata")));
assertTrue("Created Object Event is not present.",auditEntries.stream().anyMatch(x -> x.getEvent().startsWith("Created Object")));
}
@Test
(
dependsOnMethods = "newNonElectronicRecordAudit",
description = "Viewing Non electronic record audit log is itself an auditable event"
)
@AlfrescoTest(jira="RM-4303")
public void nonElectronicRecordAuditIsEvent()
{
List<AuditEntry> auditEntries= auditLog.getRMAuditLogAll(getAdminUser().getUsername(),getAdminUser().getPassword(),100);
assertTrue("Audit View Event is not present.",auditEntries.stream().anyMatch(x -> x.getEvent().startsWith("Audit View")));
}
@Test
(
dependsOnMethods = "nonElectronicRecordAuditIsEvent",
description = "Rename electronic record is an edit metadata event"
)
@AlfrescoTest(jira="RM-4303")
public void renameNonElectronicRecord()
{
auditLog.clearAuditLog(rmAdmin.get().getUsername(),rmAdmin.get().getPassword());
Record renameNonElectronicRecord = createRecordModel("edited " + nonElectronicRecord.getName(), "", "");
// rename record
getRestAPIFactory().getRecordsAPI().updateRecord(renameNonElectronicRecord, nonElectronicRecord.getId());
assertStatusCode(OK);
// we expect 1 new event: "metadata update"
List<AuditEntry> auditEntries= auditLog.getRMAuditLogAll(getAdminUser().getUsername(),getAdminUser().getPassword(),100);
assertTrue("Updated metadata Event is not present.",auditEntries.stream().anyMatch(x -> x.getEvent().startsWith("Updated Metadata")));
}
@Test (dependsOnMethods = "newNonElectronicRecordAudit",description = "Complete and reopen electronic record")
@AlfrescoTest(jira="RM-4303")
public void completeAndReopenNonElectronicRecord()
{
nonElectronicRecord2 = createNonElectronicRecord(recordFolder1.getId(),AUDIT_COMPLETE_REOPEN_NON_ELECTRONIC_RECORD);
// complete record
recordApi.completeRecord(rmAdmin.get().getUsername(),rmAdmin.get().getPassword(),
nonElectronicRecord2.getName());
try
{
Utility.sleep(1000, 30000, () ->
{
org.alfresco.rest.rm.community.requests.gscore.api.RecordsAPI recordsAPI = getRestAPIFactory().getRecordsAPI();
List<String> aspects = recordsAPI.getRecord(nonElectronicRecord2.getId()).getAspectNames();
// a record must be completed
assertTrue("Record is not completed.",aspects.contains(ASPECTS_COMPLETED_RECORD));
});
}
catch (InterruptedException e)
{
fail("InterruptedException received while waiting for results.");
}
List<AuditEntry> auditEntries= auditLog.getRMAuditLogAll(getAdminUser().getUsername(),getAdminUser().getPassword(),100);
assertTrue("Complete Record Event is not present.",auditEntries.stream().anyMatch(x -> x.getEvent().startsWith("Complete Record")));
// Reopen record
recordApi.reOpenRecord(rmAdmin.get().getUsername(),rmAdmin.get().getPassword(),
nonElectronicRecord2.getName());
try
{
Utility.sleep(1000, 30000, () ->
{
org.alfresco.rest.rm.community.requests.gscore.api.RecordsAPI recordsAPI = getRestAPIFactory().getRecordsAPI();
List<String> aspects = recordsAPI.getRecord(nonElectronicRecord2.getId()).getAspectNames();
// a record mustn't be completed
assertFalse(aspects.contains(ASPECTS_COMPLETED_RECORD));
});
}
catch (InterruptedException e)
{
fail("InterruptedException received while waiting for results.");
}
auditEntries= auditLog.getRMAuditLogAll(getAdminUser().getUsername(),getAdminUser().getPassword(),100);
assertTrue("Reopen Record Event is not present.",auditEntries.stream().anyMatch(x -> x.getEvent().startsWith("Reopen Record")));
}
@Test
(
dependsOnMethods = "completeAndReopenNonElectronicRecord",
description = "File electronic record's audit log as record"
)
@AlfrescoTest(jira="RM-4303")
public void fileNonElectronicRecordAuditLogAsRecord()
{
// audit log is stored in the same folder, refresh it so that it appears in the list
HttpResponse auditRecordHttpResponse = auditLog.logsAuditLogAsRecord(rmAdmin.get().getUsername(),rmAdmin.get().getPassword(),
getRecordNodeRef(nonElectronicRecord2.getId()),getFolderNodeRef(recordFolder1.getId()));
JSONObject auditRecordProperties = getAuditPropertyValues(auditRecordHttpResponse);
Record auditRecord = getRestAPIFactory().getRecordsAPI().getRecord(auditRecordProperties.get("record").toString()
.replace("workspace://SpacesStore/",""));
// check audit log
AssertJUnit.assertTrue(auditRecordProperties.get("recordName").toString().endsWith(".html"));
AssertJUnit.assertTrue(auditRecord.getAspectNames().stream().noneMatch(x -> x.startsWith(ASPECTS_COMPLETED_RECORD)));
}
private String getFolderNodeRef(String folderId) {
return "workspace://SpacesStore/" + folderId;
}
private String getRecordNodeRef(String recordId) {
return "workspace/SpacesStore/" + recordId;
}
private JSONObject getAuditPropertyValues(HttpResponse httpResponse) {
HttpEntity entity = httpResponse.getEntity();
String responseString = null;
try {
responseString = EntityUtils.toString(entity, "UTF-8");
} catch (IOException e) {
throw new RuntimeException(e);
}
JSONObject result = new JSONObject(responseString);
return result;
}
@AfterMethod
private void closeAuditLog() {
auditLog.clearAuditLog(rmAdmin.get().getUsername(),rmAdmin.get().getPassword());
}
@AfterClass(alwaysRun = true)
private void nonElectronicRecordAuditLogCleanup() {
deleteRecord(nonElectronicRecord.getId());
deleteRecord(nonElectronicRecord2.getId());
deleteRecordFolder(recordFolder1.getId());
deleteRecordCategory(category1.getId());
dataUser.usingAdmin().deleteUser(new UserModel(rmAdmin.get().getUsername(), rmAdmin.get().getPassword()));
}
}

View File

@@ -1,120 +0,0 @@
/*
* #%L
* Alfresco Records Management Module
* %%
* 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.rest.rm.community.audit;
import org.alfresco.rest.rm.community.base.BaseRMRestTest;
import org.alfresco.rest.rm.community.model.audit.AuditEntry;
import org.alfresco.rest.rm.community.model.recordcategory.RecordCategory;
import org.alfresco.rest.v0.RMAuditAPI;
import org.alfresco.rest.v0.RMRolesAndActionsAPI;
import org.alfresco.test.AlfrescoTest;
import org.alfresco.utility.model.UserModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import java.util.List;
import static org.alfresco.rest.rm.community.util.CommonTestUtils.generateTestPrefix;
import static org.alfresco.utility.data.RandomData.getRandomAlphanumeric;
import static org.alfresco.utility.report.log.Step.STEP;
import static org.springframework.http.HttpStatus.OK;
import static org.springframework.test.util.AssertionErrors.assertTrue;
public class RecordCategoryAuditLogTest extends BaseRMRestTest {
@Autowired
private RMRolesAndActionsAPI rmRolesAndActionsAPI;
@Autowired
private RMAuditAPI auditLog;
private final String TEST_PREFIX = generateTestPrefix(RecordCategoryAuditLogTest.class);
private final String RM_ADMIN = TEST_PREFIX + "rm_admin";
private static final String AUDIT_CATEGORY = generateTestPrefix(RecordCategoryAuditLogTest.class) + "category";
private RecordCategory recordCategoryAudit;
@BeforeClass(alwaysRun = true)
public void recordCategoryAuditLogSetup() {
STEP("Create RM Site");
createRMSiteIfNotExists();
STEP("Create RM Admin user");
rmRolesAndActionsAPI.createUserAndAssignToRole(getAdminUser().getUsername(), getAdminUser().getPassword(), RM_ADMIN,
getAdminUser().getPassword(),
"Administrator");
}
@Test
@AlfrescoTest(jira = "RM-2768")
public void recordCategoryAudit() throws Exception {
STEP("Create root level category");
recordCategoryAudit = createRootCategory(AUDIT_CATEGORY);
List<AuditEntry> auditEntries = auditLog.getRMAuditLogAll(getAdminUser().getUsername(), getAdminUser().getPassword(), 100);
// newly created record category contains 3 events: object creation, inherited permissions set to false and metadata update
// the order in which object creation and metadata update are listed isn't always identical due to
// both happening in the same transaction
assertTrue("Created Object Event is not present.", auditEntries.stream().anyMatch(x -> x.getEvent().startsWith("Created Object")));
assertTrue("Updated metadata Event is not present.", auditEntries.stream().anyMatch(x -> x.getEvent().startsWith("Updated Metadata")));
}
@Test
(
dependsOnMethods = "recordCategoryAudit",
description = "Viewing audit log is itself an auditable event"
)
@AlfrescoTest(jira="RM-4303")
public void recordCategoryAuditIsEvent() {
List<AuditEntry> auditEntries = auditLog.getRMAuditLogAll(getAdminUser().getUsername(), getAdminUser().getPassword(), 100);
assertTrue("Audit View Event is not present.", auditEntries.stream().anyMatch(x -> x.getEvent().startsWith("Audit View")));
}
@Test
(
dependsOnMethods = "recordCategoryAuditIsEvent",
description = "Record category rename is an edit metadata event"
)
@AlfrescoTest(jira="RM-4303")
public void renameRecordCategory() {
String categoryName = "Category name " + getRandomAlphanumeric();
RecordCategory rootRecordCategory = createRootCategory(categoryName);
String newCategoryName = "Rename " + categoryName;
RecordCategory recordCategoryUpdated = RecordCategory.builder().name(newCategoryName).build();
RecordCategory renamedRecordCategory = getRestAPIFactory().getRecordCategoryAPI().updateRecordCategory(recordCategoryUpdated, rootRecordCategory.getId());
assertStatusCode(OK);
// we expect 1 new event: "metadata update"
List<AuditEntry> auditEntries = auditLog.getRMAuditLogAll(getAdminUser().getUsername(), getAdminUser().getPassword(), 100);
assertTrue("Updated metadata Event is not present.", auditEntries.stream().anyMatch(x -> x.getEvent().startsWith("Updated Metadata")));
}
@AfterClass(alwaysRun = true)
private void electronicRecordAuditLogCleanup() {
deleteRecordCategory(recordCategoryAudit.getId());
dataUser.deleteUser(new UserModel(RM_ADMIN,
getAdminUser().getPassword()));
auditLog.clearAuditLog(getAdminUser().getUsername(), getAdminUser().getPassword());
}
}

View File

@@ -1,175 +0,0 @@
/*
* #%L
* Alfresco Records Management Module
* %%
* 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.rest.rm.community.audit;
import org.alfresco.rest.rm.community.base.BaseRMRestTest;
import org.alfresco.rest.rm.community.model.audit.AuditEntry;
import org.alfresco.rest.rm.community.model.recordcategory.RecordCategory;
import org.alfresco.rest.rm.community.model.recordcategory.RecordCategoryChild;
import org.alfresco.rest.rm.community.model.recordfolder.RecordFolder;
import org.alfresco.rest.v0.RMAuditAPI;
import org.alfresco.rest.v0.RMRolesAndActionsAPI;
import org.alfresco.rest.v0.RecordFoldersAPI;
import org.alfresco.test.AlfrescoTest;
import org.alfresco.utility.Utility;
import org.alfresco.utility.model.UserModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.testng.annotations.AfterClass;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import java.util.List;
import java.util.Optional;
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentAspects.ASPECTS_COMPLETED_RECORD;
import static org.alfresco.rest.rm.community.utils.FilePlanComponentsUtil.createRecordFolderModel;
import static org.springframework.http.HttpStatus.OK;
import static org.springframework.test.util.AssertionErrors.assertTrue;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.fail;
public class RecordFolderAuditLogTest extends BaseRMRestTest {
private Optional<UserModel> rmAdmin;
@Autowired
private RMRolesAndActionsAPI rmRolesAndActionsAPI;
@Autowired
private RMAuditAPI auditLog;
@Autowired
private RecordFoldersAPI recordFoldersAPI;
private RecordCategory category1;
private RecordCategoryChild recordFolder1;
public static final String TITLE = "Title";
public static final String DESCRIPTION = "Description";
@BeforeClass(alwaysRun = true)
public void recordFolderAuditLogSetup() {
createRMSiteIfNotExists();
rmAdmin = Optional.ofNullable(getDataUser().createRandomTestUser());
rmRolesAndActionsAPI.assignRoleToUser(
getDataUser().usingAdmin().getAdminUser().getUsername(),
getDataUser().usingAdmin().getAdminUser().getPassword(),
rmAdmin.get().getUsername(),
"Administrator");
}
@Test(description = "Audit log for empty record folder")
@AlfrescoTest(jira = "RM-4303")
public void recordFolderAudit() {
category1 = createRootCategory(TITLE, DESCRIPTION);
recordFolder1 = createFolder(category1.getId(), TITLE);
List<AuditEntry> auditEntries = auditLog.getRMAuditLogAll(getAdminUser().getUsername(), getAdminUser().getPassword(), 100);
assertTrue("Created Object Event is not present.", auditEntries.stream().anyMatch(x -> x.getEvent().startsWith("Created Object")));
assertTrue("Updated metadata Event is not present.", auditEntries.stream().anyMatch(x -> x.getEvent().startsWith("Updated Metadata")));
}
@Test
(
dependsOnMethods = "recordFolderAudit",
description = "Viewing record folder audit log is itself an auditable event"
)
@AlfrescoTest(jira = "RM-4303")
public void recordFolderAuditIsEvent() {
List<AuditEntry> auditEntries = auditLog.getRMAuditLogAll(getAdminUser().getUsername(), getAdminUser().getPassword(), 100);
assertTrue("Audit View Event is not present.", auditEntries.stream().anyMatch(x -> x.getEvent().startsWith("Audit View")));
}
@Test
(
dependsOnMethods = "recordFolderAuditIsEvent",
description = "Record folder rename is an edit metadata event"
)
@AlfrescoTest(jira = "RM-4303")
public void renameRecordFolder() {
auditLog.clearAuditLog(rmAdmin.get().getUsername(), rmAdmin.get().getPassword());
RecordFolder renameRecordFolder = createRecordFolderModel(category1.getId(), "edited");
getRestAPIFactory().getRecordFolderAPI().updateRecordFolder(renameRecordFolder, recordFolder1.getId());
assertStatusCode(OK);
// we expect 1 new event: "metadata update"
List<AuditEntry> auditEntries = auditLog.getRMAuditLogAll(getAdminUser().getUsername(), getAdminUser().getPassword(), 100);
// assertTrue("Move To Event is not present.",auditEntries.stream().anyMatch(x -> x.getEvent().startsWith("Move to")));
assertTrue("Updated metadata Event is not present.", auditEntries.stream().anyMatch(x -> x.getEvent().startsWith("Updated Metadata")));
}
@Test(dependsOnMethods = "recordFolderAudit",
description = "Close and reopen folder")
@AlfrescoTest(jira = "RM-4303")
public void closeReopenFolder() {
//close folder
recordFoldersAPI.closeRecordFolder(rmAdmin.get().getUsername(), rmAdmin.get().getPassword(),
recordFolder1.getName());
try
{
Utility.sleep(1000, 30000, () ->
{
List<AuditEntry> auditEntries = auditLog.getRMAuditLogAll(getAdminUser().getUsername(), getAdminUser().getPassword(), 100);
assertTrue("Folder Close Record Event is not present.", auditEntries.stream().anyMatch(x -> x.getEvent().startsWith("Close Record Folder")));
});
}
catch (InterruptedException e)
{
fail("InterruptedException received while waiting for results.");
}
//reopen folder
recordFoldersAPI.reOpenRecordFolder(rmAdmin.get().getUsername(), rmAdmin.get().getPassword(),
recordFolder1.getName());
try
{
Utility.sleep(1000, 30000, () ->
{
List<AuditEntry> auditEntries = auditLog.getRMAuditLogAll(getAdminUser().getUsername(), getAdminUser().getPassword(), 100);
assertTrue("Reopen Record Event is not present.", auditEntries.stream().anyMatch(x -> x.getEvent().startsWith("Open Record Folder")));
});
}
catch (InterruptedException e)
{
fail("InterruptedException received while waiting for results.");
}
}
@AfterMethod
private void closeAuditLog()
{
auditLog.clearAuditLog(rmAdmin.get().getUsername(),rmAdmin.get().getPassword());
}
@AfterClass (alwaysRun = true)
public void recordFolderAuditLogCleanup()
{
deleteRecordFolder(recordFolder1.getId());
deleteRecordCategory(category1.getId());
dataUser.usingAdmin().deleteUser(new UserModel(rmAdmin.get().getUsername(), rmAdmin.get().getPassword()));
}
}

View File

@@ -42,8 +42,8 @@ import static org.testng.Assert.assertNotNull;
import static org.testng.Assert.assertTrue;
import static org.testng.AssertJUnit.assertFalse;
import jakarta.json.Json;
import jakarta.json.JsonObject;
import javax.json.Json;
import javax.json.JsonObject;
import java.io.File;
import org.alfresco.dataprep.CMISUtil;

View File

@@ -33,9 +33,7 @@ import org.alfresco.rest.rm.community.model.record.Record;
import org.alfresco.rest.v0.RecordsAPI;
import org.alfresco.utility.Utility;
import org.alfresco.utility.constants.UserRole;
import org.alfresco.utility.data.RandomData;
import org.alfresco.utility.model.FileModel;
import org.alfresco.utility.model.FileType;
import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.UserModel;
import org.json.JSONObject;
@@ -99,10 +97,9 @@ public class InplaceRecordSearchTests extends BaseRMRestTest {
@Test
public void searchForInplaceRecord() {
// And a document that isn't a record
final String fileName = "File" + RandomData.getRandomAlphanumeric();
uploadedDocbyCollabUser = dataContent.usingSite(privateSite)
.usingUser(siteCollaborator)
.createContent(new FileModel(fileName, FileType.fromName(fileName + "." + CMISUtil.DocumentType.TEXT_PLAIN.extention)));
.createContent(CMISUtil.DocumentType.TEXT_PLAIN);
assertNotNull(uploadedDocbyCollabUser.getNodeRef());

View File

@@ -1,118 +0,0 @@
/*
* #%L
* Alfresco Records Management Module
* %%
* 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.rest.rm.community.rules;
import org.alfresco.rest.rm.community.base.BaseRMRestTest;
import org.alfresco.rest.rm.community.model.record.Record;
import org.alfresco.rest.rm.community.model.recordcategory.RecordCategory;
import org.alfresco.rest.rm.community.model.recordcategory.RecordCategoryChild;
import org.alfresco.rest.rm.community.model.rules.ActionsOnRule;
import org.alfresco.rest.rm.community.model.rules.RuleDefinition;
import org.alfresco.rest.rm.community.requests.gscore.api.RecordCategoryAPI;
import org.alfresco.rest.rm.community.requests.gscore.api.RecordFolderAPI;
import org.alfresco.rest.rm.community.requests.gscore.api.RecordsAPI;
import org.alfresco.rest.rm.community.smoke.CreateCategoriesTests;
import org.alfresco.rest.v0.RulesAPI;
import org.alfresco.test.AlfrescoTest;
import org.springframework.beans.factory.annotation.Autowired;
import org.testng.annotations.Test;
import java.util.Collections;
import static org.alfresco.rest.core.v0.BaseAPI.NODE_PREFIX;
import static org.alfresco.rest.rm.community.base.TestData.ELECTRONIC_RECORD_NAME;
import static org.alfresco.rest.rm.community.base.TestData.NONELECTRONIC_RECORD_NAME;
import static org.alfresco.rest.rm.community.util.CommonTestUtils.generateTestPrefix;
import static org.alfresco.rest.rm.community.utils.CoreUtil.createBodyForMoveCopy;
import static org.alfresco.rest.rm.community.utils.CoreUtil.toContentModel;
import static org.alfresco.rest.rm.community.utils.FilePlanComponentsUtil.*;
import static org.alfresco.utility.data.RandomData.getRandomName;
import static org.alfresco.utility.report.log.Step.STEP;
import static org.springframework.http.HttpStatus.*;
public class CopyToRuleOnFoldersTest extends BaseRMRestTest {
private RecordCategory category;
private RecordCategoryChild folder1,folder2;
private final static String title = "Run in background";
private final String TEST_PREFIX = generateTestPrefix(CopyToRuleOnFoldersTest.class);
private final String RM_ADMIN = TEST_PREFIX + "rm_admin";
private final String electronicRecord = TEST_PREFIX + "record_electronic_for_copyTo";
private final String nonElectronicRecord = TEST_PREFIX + "record_non_electronic_for_copyTo";
@Autowired
private RulesAPI rulesAPI;
@Test
@AlfrescoTest(jira = "RM-2994")
public void copyToRuleOnFoldersTest()
{
RuleDefinition ruleDefinition = RuleDefinition.createNewRule().title("name").description("description1")
.runInBackground(true).title(title)
.actions(Collections.singletonList(ActionsOnRule.COPY_TO.getActionValue()));
STEP("Create the RM site if doesn't exist");
createRMSiteIfNotExists();
STEP("Create record categories and record folders");
category= createRootCategory(getRandomName("recordCategory"));
String folder1 = createCategoryFolderInFilePlan().getId();
String folder2 = createCategoryFolderInFilePlan().getId();
// create a rule on folder
rulesAPI.createRule(getAdminUser().getUsername(), getAdminUser().getPassword(), NODE_PREFIX + folder1, ruleDefinition);
// create electronic record in record folder
String electronicRecordId = createElectronicRecord(folder1, ELECTRONIC_RECORD_NAME).getId();
assertStatusCode(CREATED);
// create non-electronic record in record folder
String nonElectronicRecord = createElectronicRecord(folder1, NONELECTRONIC_RECORD_NAME).getId();
assertStatusCode(CREATED);
// Move the electronic and non-electronic records from "Category with records"> "Folder with rule"
// to "Copy Category with records" > "Folder with rule"
getRestAPIFactory().getNodeAPI(toContentModel(folder1)).copy(createBodyForMoveCopy(category.getId()));
getRestAPIFactory().getNodeAPI(toContentModel( electronicRecord)).move(createBodyForMoveCopy(folder2));
getRestAPIFactory().getNodeAPI(toContentModel( nonElectronicRecord)).move(createBodyForMoveCopy(folder2));
RecordsAPI recordsAPI = getRestAPIFactory().getRecordsAPI();
// Delete the record category
RecordCategoryAPI recordCategoryAPI = getRestAPIFactory().getRecordCategoryAPI();
String recordCategoryId = category.getId();
recordCategoryAPI.deleteRecordCategory(recordCategoryId);
recordsAPI.deleteRecord(electronicRecord);
recordsAPI.deleteRecord(nonElectronicRecord);
assertStatusCode(NO_CONTENT);
}
}

View File

@@ -1,229 +0,0 @@
/*
* #%L
* Alfresco Records Management Module
* %%
* 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.rest.rm.community.rules;
import org.alfresco.dataprep.CMISUtil;
import org.alfresco.rest.rm.community.base.BaseRMRestTest;
import org.alfresco.rest.rm.community.model.recordcategory.RecordCategory;
import org.alfresco.rest.rm.community.model.recordcategory.RecordCategoryChild;
import org.alfresco.rest.rm.community.model.rules.ActionsOnRule;
import org.alfresco.rest.rm.community.model.rules.RuleDefinition;
import org.alfresco.rest.rm.community.model.unfiledcontainer.UnfiledContainerChildEntry;
import org.alfresco.rest.rm.community.model.user.UserRoles;
import org.alfresco.rest.rm.community.requests.gscore.api.UnfiledContainerAPI;
import org.alfresco.rest.rm.community.smoke.FileAsRecordTests;
import org.alfresco.rest.v0.RulesAPI;
import org.alfresco.rest.v0.service.RoleService;
import org.alfresco.test.AlfrescoTest;
import org.alfresco.utility.model.FileModel;
import org.alfresco.utility.model.FolderModel;
import org.alfresco.utility.model.UserModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
import static org.alfresco.rest.core.v0.BaseAPI.NODE_PREFIX;
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentAlias.FILE_PLAN_ALIAS;
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentAlias.UNFILED_RECORDS_CONTAINER_ALIAS;
import static org.alfresco.rest.rm.community.model.user.UserPermissions.PERMISSION_FILING;
import static org.alfresco.rest.rm.community.util.CommonTestUtils.generateTestPrefix;
import static org.alfresco.utility.data.RandomData.getRandomName;
import static org.alfresco.utility.report.log.Step.STEP;
import static org.springframework.http.HttpStatus.CREATED;
@AlfrescoTest (jira = "APPS-36")
public class FileAsRecordRuleTests extends BaseRMRestTest
{
private UserModel nonRMUser, rmManager;
private RecordCategory category_manager, category_admin;
private RecordCategoryChild folder_admin, folder_manager ;
private static final String CATEGORY_MANAGER = "catManager" + generateTestPrefix(FileAsRecordTests.class);
private static final String CATEGORY_ADMIN = "catAdmin" + generateTestPrefix(FileAsRecordTests.class);
private static final String FOLDER_MANAGER = "recordFolder" + generateTestPrefix(FileAsRecordTests.class);
private static final String FOLDER_ADMIN = "recordFolder" + generateTestPrefix(FileAsRecordTests.class);
private FolderModel testFolder;
private FileModel document,inPlaceRecord;
@Autowired
private RoleService roleService;
@Autowired
private RulesAPI rulesAPI;
/**
* Create preconditions:
* 1. RM site is created
* 2. Two users: user without RM role and a user with RM manager role
* 3. Two Record categories with one folder each
* 4. User with RM MANAGER role has Filling permission over one category
* 5. A collaboration folder with rule set to declare and file as record to a record folder
**/
@BeforeClass(alwaysRun = true)
public void preconditionForDeclareFileAsRecordRuleTests()
{
STEP("Create the RM site if doesn't exist");
createRMSiteIfNotExists();
STEP("Create a user");
nonRMUser = dataUser.createRandomTestUser("testUser");
STEP("Create a collaboration site");
testSite = dataSite.usingUser(nonRMUser).createPublicRandomSite();
STEP("Create two categories with two folders");
category_manager = createRootCategory(CATEGORY_MANAGER);
category_admin = createRootCategory(CATEGORY_ADMIN);
folder_admin = createFolder(category_admin.getId(),FOLDER_ADMIN);
folder_manager = createFolder(category_manager.getId(),FOLDER_MANAGER);
STEP("Create an rm user and give filling permission over CATEGORY_MANAGER record category");
RecordCategory recordCategory = new RecordCategory().builder()
.id(category_manager.getId()).build();
rmManager = roleService.createCollaboratorWithRMRoleAndPermission(testSite, recordCategory,
UserRoles.ROLE_RM_MANAGER, PERMISSION_FILING);
STEP("Create a collaboration folder with a rule set to declare and file as record to a record folder");
RecordCategoryChild folderWithRule = createFolder(recordCategory.getId(), getRandomName("recordFolder"));
RuleDefinition ruleDefinition = RuleDefinition.createNewRule().title("name").description("description")
.applyToChildren(true)
.actions(Collections.singletonList(ActionsOnRule.DECLARE_AS_RECORD.getActionValue()));
rulesAPI.createRule(getAdminUser().getUsername(), getAdminUser().getPassword(), NODE_PREFIX + folderWithRule.getId(), ruleDefinition);
assertStatusCode(CREATED);
}
/**
* Given I am a user that can create a rule on a folder in a collaboration site
* When I am creating the rule
* Then I have the option of adding a "Declare and File as Record" action to the rule
* <p>
* Given I am creating a rule
* When I add the "Declare and File as Record" action to the rule
* Then I am able to select the record folder I want the declared record to be filed to
* <p>
* Given I am configuring a "Declare and File as Record" action within a rule
* And I have at least one records management role (eg RM User)
* When I am selecting the record folder location to file the declared record to
* Then I see the record folders in the file plan that I have file access to as the creator of the record
**/
@Test
public void declareAsRecordRuleAsRMUserWithFilingPermissions() {
STEP("Create a collaboration folder");
testFolder = dataContent.usingSite(testSite)
.usingUser(rmManager)
.createFolder();
STEP("Create a rule with Declare as Record action and check that user can select a record folder.");
RecordCategory recordCategory = new RecordCategory().builder()
.id(category_manager.getId()).build();
RecordCategoryChild folderWithRule = createFolder(recordCategory.getId(), getRandomName("recordFolder"));
RuleDefinition ruleDefinition = RuleDefinition.createNewRule().title("name").description("description")
.applyToChildren(true)
.actions(Collections.singletonList(ActionsOnRule.DECLARE_AS_RECORD.getActionValue()));
rulesAPI.createRule(getAdminUser().getUsername(), getAdminUser().getPassword(), NODE_PREFIX + folderWithRule.getId(), ruleDefinition);
assertStatusCode(CREATED);
}
/**
* Given I am configuring a "Declare and File as Record" action within a rule
* And I don't have a records management role
* When I am selecting the record folder location to file the declared record to
* Then I can see only the file plan
*/
@Test
public void declareAsRecordRuleAsNonRMUser()
{
STEP("Create a collaboration folder");
testFolder = dataContent.usingSite(testSite)
.usingUser(nonRMUser)
.createFolder();
STEP("Create a rule with Declare as Record action and check that user can select a record folder.");
RecordCategory recordCategory = new RecordCategory().builder()
.id(category_manager.getId()).build();
RuleDefinition ruleDefinition = RuleDefinition.createNewRule().title("name").description("description")
.applyToChildren(true)
.actions(Collections.singletonList(ActionsOnRule.DECLARE_AS_RECORD.getActionValue()));
rulesAPI.createRule(nonRMUser.getUsername(), nonRMUser.getPassword(), NODE_PREFIX + testFolder.getNodeRef(), ruleDefinition);
assertStatusCode(CREATED);
}
/**
* Given I have not selected a record folder location
* When the rule is triggered
* Then the file is declared as record to the UnFiled Records folder
*/
@Test
public void triggerDeclareToUnfiledRuleAsNonRMUser()
{
STEP("Create a collaboration folder with a rule set to declare and file as record without a record folder location");
RecordCategory recordCategory = new RecordCategory().builder()
.id(category_manager.getId()).build();
RecordCategoryChild folderWithRule = createFolder(recordCategory.getId(), getRandomName("recordFolder"));
RuleDefinition ruleDefinition = RuleDefinition.createNewRule().title("name").description("description")
.applyToChildren(true)
.actions(Collections.singletonList(ActionsOnRule.DECLARE_AS_RECORD.getActionValue()));
rulesAPI.createRule(getAdminUser().getUsername(), getAdminUser().getPassword(), NODE_PREFIX + folderWithRule.getId(), ruleDefinition);
assertStatusCode(CREATED);
STEP("Create as nonRMUser a new file into the previous folder in order to trigger the rule");
inPlaceRecord = dataContent.usingUser(nonRMUser).usingResource(testFolder).createContent(CMISUtil.DocumentType.TEXT_PLAIN);
// Verify that declared record is in Unfilled Records Folder
UnfiledContainerAPI unfiledContainersAPI = getRestAPIFactory().getUnfiledContainersAPI();
List<UnfiledContainerChildEntry> matchingRecords = unfiledContainersAPI.getUnfiledContainerChildren(UNFILED_RECORDS_CONTAINER_ALIAS)
.getEntries()
.stream()
.filter(e -> e.getEntry().getId().equals(inPlaceRecord.getNodeRefWithoutVersion()))
.collect(Collectors.toList());
}
@AfterClass(alwaysRun = true)
public void cleanupDeclareAsRecordRuleTests()
{
STEP("Delete the collaboration site");
dataSite.usingUser(nonRMUser).deleteSite(testSite);
STEP("Delete Users");
dataUser.deleteUser(nonRMUser);
dataUser.deleteUser(rmManager);
STEP("Delete categories");
getRestAPIFactory().getFilePlansAPI().getRootRecordCategories(FILE_PLAN_ALIAS).getEntries().forEach(recordCategoryEntry ->
deleteRecordCategory(recordCategoryEntry.getEntry().getId()));
}
}

View File

@@ -1,221 +0,0 @@
/*
* #%L
* Alfresco Records Management Module
* %%
* 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.rest.rm.community.rules;
import org.alfresco.dataprep.CMISUtil;
import org.alfresco.rest.rm.community.base.BaseRMRestTest;
import org.alfresco.rest.rm.community.model.recordcategory.RecordCategory;
import org.alfresco.rest.rm.community.model.recordcategory.RecordCategoryChild;
import org.alfresco.rest.rm.community.model.rules.ActionsOnRule;
import org.alfresco.rest.rm.community.model.rules.RuleDefinition;
import org.alfresco.rest.rm.community.model.unfiledcontainer.UnfiledContainerChildEntry;
import org.alfresco.rest.rm.community.model.user.UserRoles;
import org.alfresco.rest.rm.community.requests.gscore.api.UnfiledContainerAPI;
import org.alfresco.rest.rm.community.smoke.FileAsRecordTests;
import org.alfresco.rest.v0.RulesAPI;
import org.alfresco.rest.v0.service.RoleService;
import org.alfresco.utility.model.FileModel;
import org.alfresco.utility.model.FileType;
import org.alfresco.utility.model.FolderModel;
import org.alfresco.utility.model.UserModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
import static org.alfresco.rest.core.v0.BaseAPI.NODE_PREFIX;
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentAlias.FILE_PLAN_ALIAS;
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentAlias.UNFILED_RECORDS_CONTAINER_ALIAS;
import static org.alfresco.rest.rm.community.model.user.UserPermissions.PERMISSION_FILING;
import static org.alfresco.rest.rm.community.util.CommonTestUtils.generateTestPrefix;
import static org.alfresco.utility.data.RandomData.getRandomName;
import static org.alfresco.utility.report.log.Step.STEP;
import static org.springframework.http.HttpStatus.CREATED;
public class FileVersionAsRecordRuleTest extends BaseRMRestTest {
private UserModel nonRMuser, rmManager;
private RecordCategory category_manager, category_admin;
private RecordCategoryChild folder_admin, folder_manager ;
private static final String CATEGORY_MANAGER = "catManager" + generateTestPrefix(FileAsRecordTests.class);
private static final String CATEGORY_ADMIN = "catAdmin" + generateTestPrefix(FileAsRecordTests.class);
private static final String FOLDER_MANAGER = "recordFolder" + generateTestPrefix(FileAsRecordTests.class);
private static final String FOLDER_ADMIN = "recordFolder" + generateTestPrefix(FileAsRecordTests.class);
private FolderModel testFolder;
private FileModel document,inPlaceRecord;
@Autowired
private RoleService roleService;
@Autowired
private RulesAPI rulesAPI;
@BeforeClass(alwaysRun = true)
public void createTestPrecondition()
{
STEP("Create the RM site if doesn't exist");
createRMSiteIfNotExists();
STEP("Create a user");
nonRMuser = dataUser.createRandomTestUser("testUser");
STEP("Create a collaboration site");
testSite = dataSite.usingUser(nonRMuser).createPublicRandomSite();
STEP("Create a document with the user without RM role");
document = dataContent.usingSite(testSite)
.usingUser(nonRMuser)
.createContent(CMISUtil.DocumentType.TEXT_PLAIN);
STEP("Create two categories with two folders");
category_manager = createRootCategory(CATEGORY_MANAGER);
category_admin = createRootCategory(CATEGORY_ADMIN);
folder_admin = createFolder(category_admin.getId(),FOLDER_ADMIN);
folder_manager = createFolder(category_manager.getId(),FOLDER_MANAGER);
STEP("Create an rm user and give filling permission over CATEGORY_MANAGER record category");
RecordCategory recordCategory = new RecordCategory().builder()
.id(category_manager.getId())
.build();
rmManager = roleService.createCollaboratorWithRMRoleAndPermission(testSite, recordCategory,
UserRoles.ROLE_RM_MANAGER, PERMISSION_FILING);
STEP("Create a collaboration folder with a rule set to declare and file version as record to a record folder");
RecordCategoryChild folderWithRule = createFolder(recordCategory.getId(), getRandomName("recordFolder"));
RuleDefinition ruleDefinition = RuleDefinition.createNewRule().title("name").description("description")
.applyToChildren(true)
.actions(Collections.singletonList(ActionsOnRule.DECLARE_AS_RECORD.getActionValue()));
rulesAPI.createRule(getAdminUser().getUsername(), getAdminUser().getPassword(), NODE_PREFIX + folderWithRule.getId(), ruleDefinition);
assertStatusCode(CREATED);
}
@Test
public void declareVersionAsRecordRuleAsRMUserWithFilingPermissions()
{
STEP("Create a collaboration folder");
testFolder = dataContent.usingSite(testSite)
.usingUser(rmManager)
.createFolder();
STEP("Create a rule with Declare as Record action and check that user can select a record folder.");
RecordCategory recordCategory = new RecordCategory().builder()
.id(category_manager.getId()).build();
RecordCategoryChild folderWithRule = createFolder(recordCategory.getId(), getRandomName("recordFolder"));
RuleDefinition ruleDefinition = RuleDefinition.createNewRule().title("name").description("description")
.applyToChildren(true)
.actions(Collections.singletonList(ActionsOnRule.DECLARE_AS_RECORD.getActionValue()));
rulesAPI.createRule(rmManager.getUsername(), rmManager.getPassword(), NODE_PREFIX + testFolder.getNodeRef(), ruleDefinition);
assertStatusCode(CREATED);
}
@Test
public void declareVersionAsRecordRuleAsNonRMUser()
{
STEP("Create a collaboration folder");
testFolder = dataContent.usingSite(testSite)
.usingUser(nonRMuser)
.createFolder();
STEP("Create a rule with Declare as Record action and check that user can select a record folder.");
RecordCategory recordCategory = new RecordCategory().builder()
.id(category_manager.getId()).build();
RuleDefinition ruleDefinition = RuleDefinition.createNewRule().title("name").description("description")
.applyToChildren(true)
.actions(Collections.singletonList(ActionsOnRule.DECLARE_AS_RECORD.getActionValue()));
rulesAPI.createRule(nonRMuser.getUsername(), nonRMuser.getPassword(), NODE_PREFIX + testFolder.getNodeRef(), ruleDefinition);
assertStatusCode(CREATED);
}
@Test
public void triggerDeclareToUnfiledRuleAsNonRMUser() throws Exception {
STEP("Create a collaboration folder with a rule set to declare and file as record without a record folder location");
FileModel inplaceRecord = dataContent.usingSite(testSite).usingUser(nonRMuser)
.createContent(new FileModel("declareAndFileToIntoUnfiledRecordFolder",
FileType.TEXT_PLAIN));
RecordCategory recordCategory = new RecordCategory().builder()
.id(category_manager.getId()).build();
RuleDefinition ruleDefinition = RuleDefinition.createNewRule().title("name").description("description")
.applyToChildren(true)
.actions(Collections.singletonList(ActionsOnRule.DECLARE_AS_RECORD.getActionValue()));
rulesAPI.createRule(nonRMuser.getUsername(), nonRMuser.getPassword(), NODE_PREFIX + inplaceRecord.getNodeRef(), ruleDefinition);
assertStatusCode(CREATED);
STEP("Create as nonRMuser a new file into the previous folder in order to trigger the rule");
inPlaceRecord = dataContent.usingUser(nonRMuser).usingResource(testFolder).createContent(CMISUtil.DocumentType.TEXT_PLAIN);
// verify the declared record is in Unfilled Records folder
UnfiledContainerAPI unfiledContainersAPI = getRestAPIFactory().getUnfiledContainersAPI();
List<UnfiledContainerChildEntry> matchingRecords = unfiledContainersAPI.getUnfiledContainerChildren(UNFILED_RECORDS_CONTAINER_ALIAS)
.getEntries()
.stream()
.filter(e -> e.getEntry().getId().equals(inplaceRecord.getNodeRefWithoutVersion()))
.collect(Collectors.toList());
}
@AfterClass(alwaysRun = true)
public void cleanupDeclareVersionAsRecordRuleTests()
{
STEP("Delete the collaboration site");
dataSite.usingUser(nonRMuser).deleteSite(testSite);
STEP("Delete Users");
dataUser.deleteUser(nonRMuser);
dataUser.deleteUser(rmManager);
STEP("Delete categories");
getRestAPIFactory().getFilePlansAPI().getRootRecordCategories(FILE_PLAN_ALIAS).getEntries().forEach(recordCategoryEntry ->
deleteRecordCategory(recordCategoryEntry.getEntry().getId()));
}
}

View File

@@ -1,237 +0,0 @@
/*
* #%L
* Alfresco Records Management Module
* %%
* 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.rest.rm.community.rules;
import org.alfresco.rest.model.RestNodeModel;
import org.alfresco.rest.rm.community.base.BaseRMRestTest;
import org.alfresco.rest.rm.community.model.fileplan.FilePlan;
import org.alfresco.rest.rm.community.model.record.Record;
import org.alfresco.rest.rm.community.model.recordcategory.RecordCategory;
import org.alfresco.rest.rm.community.model.recordcategory.RecordCategoryChild;
import org.alfresco.rest.rm.community.model.rules.ActionsOnRule;
import org.alfresco.rest.rm.community.model.rules.ConditionsOnRule;
import org.alfresco.rest.rm.community.model.rules.RuleDefinition;
import org.alfresco.rest.rm.community.model.unfiledcontainer.UnfiledContainer;
import org.alfresco.rest.rm.community.model.unfiledcontainer.UnfiledContainerChildEntry;
import org.alfresco.rest.rm.community.model.user.UserRoles;
import org.alfresco.rest.rm.community.requests.gscore.api.RecordFolderAPI;
import org.alfresco.rest.rm.community.requests.gscore.api.UnfiledContainerAPI;
import org.alfresco.rest.search.RestRequestQueryModel;
import org.alfresco.rest.v0.HoldsAPI;
import org.alfresco.rest.v0.RecordsAPI;
import org.alfresco.rest.v0.RulesAPI;
import org.alfresco.rest.v0.service.RoleService;
import org.alfresco.utility.model.UserModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import java.io.InputStream;
import java.util.Collections;
import java.util.List;
import java.util.Random;
import java.util.stream.Collectors;
import static java.lang.Integer.MAX_VALUE;
import static java.util.Arrays.asList;
import static org.alfresco.rest.core.v0.BaseAPI.NODE_PREFIX;
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentAlias.FILE_PLAN_ALIAS;
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentAlias.UNFILED_RECORDS_CONTAINER_ALIAS;
import static org.alfresco.rest.rm.community.util.CommonTestUtils.generateTestPrefix;
import static org.alfresco.rest.rm.community.utils.CoreUtil.createBodyForMoveCopy;
import static org.alfresco.rest.rm.community.utils.CoreUtil.toContentModel;
import static org.alfresco.rest.rm.community.utils.FilePlanComponentsUtil.*;
import static org.alfresco.utility.data.RandomData.getRandomAlphanumeric;
import static org.alfresco.utility.data.RandomData.getRandomName;
import static org.alfresco.utility.report.log.Step.STEP;
import static org.springframework.http.HttpStatus.*;
import static org.testng.Assert.assertNotNull;
public class MoveToRuleOnFoldersTest extends BaseRMRestTest{
private RecordCategoryChild recordFolder2;
private RecordCategoryChild recordFolder1;
private String nonElectronicId;
public Record electronicRecord;
private String ruleType = ConditionsOnRule.UPDATE.getWhenConditionValue();
private UserModel rmAdmin;
public RecordCategory RecordCategoryOne;
private RecordCategoryChild recordFolder;
public static final String RECORD_FOLDER_ONE = "record-folder-one";
private final String TEST_PREFIX = generateTestPrefix(MoveToRuleOnFoldersTest.class);
private final String RECORD_CATEGORY_ONE = TEST_PREFIX + "category";
private final String recordName = "Test record";
private final String recordTitle = recordName + " title";
private final String recordDescription = recordName + " description";
private Record nonElectrinicRecordModel;
private RecordFolderAPI recordFolderAPI;
public String title,description,box,file,shelf,storageLocation,name;
@Autowired
private RulesAPI rulesAPI;
@Autowired
private HoldsAPI holdsAPI;
@Autowired
private RoleService roleService;
@Autowired
public RecordsAPI recordsAPI;
@BeforeClass(alwaysRun = true)
public void precondition()
{
//create RM site
createRMSiteIfNotExists();
rmAdmin = roleService.createUserWithRMRole(UserRoles.ROLE_RM_ADMIN.roleId);
//create root category, create folders , add electronic and non electronic records
RecordCategoryOne = createRootCategory(RECORD_CATEGORY_ONE);
recordFolder1=createRecordFolder(RecordCategoryOne.getId(), getRandomName("recFolder"));
// recordFolder1_id = createRecordFolder(RecordCategoryOne.getId(), getRandomName("recFolder")).getId();
recordFolder2 = createFolder(getAdminUser(),RecordCategoryOne.getId(),getRandomName("recFolder"));
STEP("CREATE ELECTRONIC RECORD");
recordFolderAPI = getRestAPIFactory().getRecordFolderAPI();
electronicRecord = recordFolderAPI.createRecord(createElectronicRecordModel(), recordFolder1.getId(), getFile(IMAGE_FILE));
STEP("Check the electronic record has been created");
assertStatusCode(CREATED);
STEP("Create a non-electronic record by completing some of the fields");
// Use these properties for non-electronic record to be created
title = "Title " + getRandomAlphanumeric();
description = "Description " + getRandomAlphanumeric();
box = "Box "+ getRandomAlphanumeric();
file = "File " + getRandomAlphanumeric();
shelf = "Shelf " + getRandomAlphanumeric();
storageLocation = "Storage Location " + getRandomAlphanumeric();
name = "Record " + getRandomAlphanumeric();
Random random = new Random();
Integer numberOfCopies = random.nextInt(MAX_VALUE);
Integer physicalSize = random.nextInt(MAX_VALUE);
// Set values of all available properties for the non electronic records
nonElectrinicRecordModel = createFullNonElectronicRecordModel(name, title, description, box, file, shelf, storageLocation, numberOfCopies, physicalSize);
// Create non-electronic record
nonElectronicId = recordFolderAPI.createRecord(nonElectrinicRecordModel, recordFolder1.getId()).getId();
STEP("Check the non-electronic record has been created");
assertStatusCode(CREATED);
}
@Test
public void MoveToRuleFoldersTest()
{
String CatName=RecordCategoryOne.getName();
String folder2name=recordFolder2.getName();
String recfolder2_path="/"+CatName+"/"+folder2name;
STEP("create a rule MOVE_TO for folder 1");
RuleDefinition ruleDefinition = RuleDefinition.createNewRule().title("name").description("description1")
.runInBackground(true).title(title)
.actions(Collections.singletonList(ActionsOnRule.MOVE_TO.getActionValue())).ruleType(ruleType).path(recfolder2_path);
rulesAPI.createRule(getAdminUser().getUsername(), getAdminUser().getPassword(), NODE_PREFIX +recordFolder1.getId() , ruleDefinition);
STEP("Update metadata for Non-Electronic Record");
updateRecordMetadata();
STEP("Delete ELECTRONIC AND NON-ELECTRONIC RECORDS IN FOLDER 2");
org.alfresco.rest.rm.community.requests.gscore.api.RecordsAPI recordsAPI = getRestAPIFactory().getRecordsAPI();
recordsAPI.deleteRecord(electronicRecord.getId());
assertStatusCode(NO_CONTENT);
recordsAPI.deleteRecord(nonElectronicId);
assertStatusCode(NO_CONTENT);
STEP("RULE CREATION FOR FOLDER 1 WITHOUT RUNNING IN BACKGROUND");
RuleDefinition ruleDefinition_notinbackground = RuleDefinition.createNewRule().title("name").description("description1")
.runInBackground(false).title(title)
.actions(Collections.singletonList(ActionsOnRule.MOVE_TO.getActionValue())).ruleType(ruleType).path(recfolder2_path);
rulesAPI.createRule(getAdminUser().getUsername(), getAdminUser().getPassword(), NODE_PREFIX +recordFolder1.getId() , ruleDefinition);
STEP("CREATE ELECTRONIC AND NON-ELECTRONIC RECORDS");
electronicRecord = recordFolderAPI.createRecord(createElectronicRecordModel(), recordFolder1.getId(), getFile(IMAGE_FILE));
STEP("Check the electronic record has been created");
assertStatusCode(CREATED);
nonElectronicId = recordFolderAPI.createRecord(nonElectrinicRecordModel, recordFolder1.getId()).getId();
STEP("Check the non-electronic record has been created");
assertStatusCode(CREATED);
STEP("UPDATE METADATA");
updateRecordMetadata();
STEP("CHECK IF ELECTRONIC AND NON-ELECTRONIC RECORDS MOVED TO FOLDER2");
updateRecordMetadata();
}
@AfterClass(alwaysRun = true)
public void cleanMoveToRuleOnFoldersTest()
{
deleteRecordCategory(RecordCategoryOne.getId());
getDataUser().deleteUser(rmAdmin);
}
private String getModifiedPropertyValue(String originalValue) {
/* to be used to append to modifications */
String MODIFIED_PREFIX = "modified_";
return MODIFIED_PREFIX + originalValue;
}
private void updateRecordMetadata(){
STEP("Update metadata for Non-Electronic Record");
org.alfresco.rest.rm.community.requests.gscore.api.RecordsAPI recordsAPI = getRestAPIFactory().getRecordsAPI();
Record nonelecrecord = recordsAPI.getRecord(nonElectronicId);
String nonelecnewName = getModifiedPropertyValue(nonElectrinicRecordModel.getName());
String nonelecnewTitle = getModifiedPropertyValue(nonElectrinicRecordModel.getProperties().getTitle());
String nonelecnewDescription = getModifiedPropertyValue(nonElectrinicRecordModel.getProperties().getDescription());
recordsAPI.updateRecord(createRecordModel(nonelecnewName, nonelecnewDescription, nonelecnewTitle),nonelecrecord.getId());
assertStatusCode(OK);
STEP("Update metadata for Electronic Record");
Record elecrecord = recordsAPI.getRecord(electronicRecord.getId());
String elecnewName = getModifiedPropertyValue(electronicRecord.getName());
String elecnewTitle = getModifiedPropertyValue(electronicRecord.getProperties().getTitle());
String elecnewDescription = getModifiedPropertyValue(electronicRecord.getProperties().getDescription());
recordsAPI.updateRecord(createRecordModel(elecnewName, elecnewDescription, elecnewTitle),elecrecord.getId());
assertStatusCode(OK);
}
}

View File

@@ -72,7 +72,7 @@ public class SearchDocumentsV1Test extends BaseRMRestTest
cmisQueryModel.setLanguage("cmis");
RestRequestQueryModel aftsQueryModel = new RestRequestQueryModel();
aftsQueryModel.setQuery("cm:name:*" + SEARCH_TERM + ".txt");
aftsQueryModel.setQuery("cm:name:*" + SEARCH_TERM);
aftsQueryModel.setLanguage("afts");
return new RestRequestQueryModel[][] {
@@ -107,7 +107,7 @@ public class SearchDocumentsV1Test extends BaseRMRestTest
private void waitIndexing() throws Exception
{
RestRequestQueryModel queryType = new RestRequestQueryModel();
queryType.setQuery("cm:name:*" + SEARCH_TERM + ".txt");
queryType.setQuery("cm:name:*" + SEARCH_TERM);
queryType.setLanguage("afts");
Utility.sleep(1000, 80000, () ->
{

View File

@@ -53,6 +53,7 @@ import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.testng.AssertJUnit;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Ignore;
import org.testng.annotations.Test;
import java.io.IOException;
@@ -68,6 +69,7 @@ import static org.alfresco.rest.rm.community.model.recordcategory.RetentionPerio
import static org.alfresco.rest.rm.community.model.recordcategory.RetentionPeriodProperty.DATE_FILED;
import static org.alfresco.rest.rm.community.model.recordcategory.RetentionPeriodProperty.CUT_OFF_DATE;
import static org.alfresco.rest.rm.community.util.CommonTestUtils.generateTestPrefix;
import static org.alfresco.utility.data.RandomData.getRandomName;
import static org.alfresco.utility.report.log.Step.STEP;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
@@ -120,7 +122,7 @@ public class DispositionScheduleLinkedRecordsTest extends BaseRMRestTest {
// create "rm Manager" user if it does not exist and assign it to RM Administrator role
UserModel rmManager = getDataUser().createRandomTestUser();
rmRolesAndActionsAPI.assignRoleToUser(getDataUser().usingAdmin().getAdminUser().getUsername(),
getDataUser().usingAdmin().getAdminUser().getPassword(), rmManager.getUsername(),
getDataUser().usingAdmin().getAdminUser().getPassword(),rmManager.getUsername(),
UserRoles.ROLE_RM_MANAGER.roleId);
}
@@ -137,6 +139,7 @@ public class DispositionScheduleLinkedRecordsTest extends BaseRMRestTest {
**/
@Test(enabled = false) // temporary disabled, see ACS-6073
@AlfrescoTest(jira = "RM-1622")
@Ignore
public void dispositionScheduleLinkedRecords() throws UnsupportedEncodingException {
STEP("Create record category");
RecordCategory category1 = createRootCategory(CATEGORY_RM_3077);
@@ -204,6 +207,7 @@ public class DispositionScheduleLinkedRecordsTest extends BaseRMRestTest {
* */
@Test(enabled = false) // temporary disabled, see ACS-6073
@AlfrescoTest (jira = "RM-3060")
@Ignore
public void sameDispositionScheduleLinkedRecords() throws UnsupportedEncodingException {
// create a category with retention applied on records level

View File

@@ -1,42 +1,52 @@
/*
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2023 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.messaging;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class LoggingDeadLetterQueue
{
private static final Logger LOG = LoggerFactory.getLogger(LoggingDeadLetterQueue.class);
public void onReceive(Object message)
{
if (message != null)
{
LOG.debug("Received:\n\n{}}\n\n", message);
}
}
}
/*
* #%L
* Alfresco Records Management Module
* %%
* 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.rest.rm.community.utils;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;
import org.testng.IMethodInstance;
import org.testng.IMethodInterceptor;
import org.testng.ITestContext;
/**
* A method interceptor that sorts test classes alphabetically.
*
* @author Damian Ujma
*/
public class AlphabeticalPriorityInterceptor implements IMethodInterceptor
{
@Override
public List<IMethodInstance> intercept(List<IMethodInstance> methods,
ITestContext context)
{
return methods.stream()
.sorted(Comparator.comparing(methodInstance -> methodInstance.getMethod().getTestClass().getName()))
.collect(Collectors.toList());
}
}

View File

@@ -0,0 +1,11 @@
# Root logger option
log4j.rootLogger=INFO, file
# Direct log messages to a log file
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=./target/reports/rm-automation-community-rest-api.log
log4j.appender.file.MaxBackupIndex=10
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=[%t] %d{HH:mm:ss} %-5p %c{1}:%L - %m%n
log4j.logger.com.example=debug

View File

@@ -1,20 +0,0 @@
###### Root Logger #######
rootLogger.level=info
rootLogger.appenderRef.rolling.ref=RollingAppender
###### File appender definition #######
appender.rolling.type=RollingFile
appender.rolling.name=RollingAppender
appender.rolling.fileName=target/reports/rm-automation-community-rest-api.log
appender.rolling.filePattern=target/reports/rm-automation-community-rest-api.log.%i
appender.rolling.layout.type=PatternLayout
appender.rolling.layout.pattern=[%t] %d{HH:mm:ss} %-5p %c{1}:%L - %replace{%m}{[\r\n]+}{}%n
appender.rolling.policies.type=Policies
appender.rolling.policies.size.type=SizeBasedTriggeringPolicy
appender.rolling.policies.size.size=10MB
appender.rolling.strategy.type=DefaultRolloverStrategy
appender.rolling.strategy.max=10
###### Loggers definitions #######
logger.com-example.name=com.example
logger.com-example.level=debug

View File

@@ -2,7 +2,7 @@
<suite name="TestNG AllTestSuite" configfailurepolicy="continue" verbose="1" time-out="300000">
<listeners>
<listener class-name="org.alfresco.utility.testng.AlphabeticalPriorityInterceptor" />
<listener class-name="org.alfresco.rest.rm.community.utils.AlphabeticalPriorityInterceptor" />
</listeners>
<test name="restapi" preserve-order="false">
<packages>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-governance-services-community-parent</artifactId>
<version>23.1.1.13-SNAPSHOT</version>
<version>19.12</version>
</parent>
<modules>

View File

@@ -1,3 +1,3 @@
SOLR6_TAG=2.0.11
POSTGRES_TAG=15.4
ACTIVEMQ_TAG=5.18.3-jre17-rockylinux8
SOLR6_TAG=2.0.10
POSTGRES_TAG=14.4
ACTIVEMQ_TAG=5.17.6-jre17-rockylinux8

View File

@@ -1,4 +1,3 @@
ARG BASE_IMAGE
# BUILD STAGE AGS
FROM debian:11-slim AS AGSBUILDER
@@ -13,7 +12,7 @@ RUN unzip -q /build/gs-api-explorer-*.war -d /build/gs-api-explorer && \
chmod -R g-w,o= /build
# ACTUAL IMAGE
FROM ${BASE_IMAGE}
FROM alfresco/alfresco-community-repo-base:${image.tag}
# Alfresco user does not have permissions to modify webapps or configuration. Switch to root.
# The access will be fixed after all operations are done.

View File

@@ -39,7 +39,7 @@ cache.jsonConversionComponentCache.timeToLiveSeconds=0
cache.jsonConversionComponentCache.maxIdleSeconds=0
cache.jsonConversionComponentCache.backup-count=1
cache.jsonConversionComponentCache.eviction-policy=NONE
cache.jsonConversionComponentCache.merge-policy=com.hazelcast.spi.merge.PutIfAbsentMergePolicy
cache.jsonConversionComponentCache.merge-policy=com.hazelcast.map.merge.PutIfAbsentMapMergePolicy
cache.jsonConversionComponentCache.nearCache.maxSize=50
cache.jsonConversionComponentCache.nearCache.maxIdleSeconds=0
cache.jsonConversionComponentCache.nearCache.timeToLiveSeconds=0
@@ -116,8 +116,8 @@ rm.patch.v35.holdNewChildAssocPatch.batchSize=1000
# Permission mapping
# these take a comma separated string of permissions from org.alfresco.service.cmr.security.PermissionService
# read maps to ReadRecords and write to FileRecords
rm.haspermissionmap.read=Read
rm.haspermissionmap.write=WriteProperties,AddChildren,ReadContent
rm.haspermissionmap.read=ReadProperties,ReadChildren
rm.haspermissionmap.write=WriteProperties,AddChildren
#
# Extended auto-version behaviour. If true and other auto-version properties are satisfied, then

View File

@@ -33,7 +33,7 @@ function main()
{
// Log debug message
logger.log("Record " + node.name + " has been superseded. Sending notification");
// Send notification
rmService.sendSupersededNotification(node);
}

View File

@@ -0,0 +1,60 @@
#
# Warnings
#
log4j.logger.org.alfresco.module.org_alfresco_module_rm.caveat=warn
log4j.logger.org.alfresco.module.org_alfresco_module_rm.security.RMMethodSecurityPostProcessor=warn
#
# Module patches
#
log4j.logger.org.alfresco.module.org_alfresco_module_rm.patch=info
#
# Set to 'debug' to see details of capability failures when AccessDenied is thrown. May be
# removed to enhance performance.
#
log4j.logger.org.alfresco.module.org_alfresco_module_rm.security.RMMethodSecurityInterceptor=info
#
# RM permission debug
#
#log4j.logger.org.alfresco.module.org_alfresco_module_rm.capability.RMEntryVoter=debug
#log4j.logger.org.alfresco.module.org_alfresco_module_rm.capability.RMAfterInvocationProvider=debug
#log4j.logger.org.alfresco.module.org_alfresco_module_rm.capability.declarative=debug
#
# RM Audit service debug
#
#log4j.logger.org.alfresco.module.org_alfresco_module_rm.audit.RecordsManagementAuditService=debug
#
# Job debug
#
#log4j.logger.org.alfresco.module.org_alfresco_module_rm.job=debug
#
# Script logging level
#
log4j.logger.org.alfresco.repo.jscript.ScriptLogger=error
#
# Behaviour debug
#
log4j.logger.org.alfresco.repo.policy.annotation.AnnotatedBehaviourPostProcessor=info
log4j.logger.org.alfresco.module.org_alfresco_module_rm.behaviour.BaseBehaviourBean=info
#
# Patch debug
#
log4j.logger.org.alfresco.module.org_alfresco_module_rm.patch=info
#
# RM Audit service debug
#
#log4j.logger.org.alfresco.module.org_alfresco_module_rm.audit.RecordsManagementAuditService=debug
#
# Job debug
#
#log4j.logger.org.alfresco.module.org_alfresco_module_rm.job=debug
log4j.logger.org.alfresco.repo.web.scripts.roles.DynamicAuthoritiesGet=info
log4j.logger.org.alfresco.module.org_alfresco_module_rm.query.RecordsManagementQueryDAOImpl=info

View File

@@ -1,50 +0,0 @@
# Warnings
logger.alfresco-module-org_alfresco_module_rm-caveat.name=org.alfresco.module.org_alfresco_module_rm.caveat
logger.alfresco-module-org_alfresco_module_rm-caveat.level=warn
logger.alfresco-module-org_alfresco_module_rm-security-RMMethodSecurityPostProcessor.name=org.alfresco.module.org_alfresco_module_rm.security.RMMethodSecurityPostProcessor
logger.alfresco-module-org_alfresco_module_rm-security-RMMethodSecurityPostProcessor.level=warn
# Module patches
logger.alfresco-module-org_alfresco_module_rm-patch.name=org.alfresco.module.org_alfresco_module_rm.patch
logger.alfresco-module-org_alfresco_module_rm-patch.level=info
# Set to 'debug' to see details of capability failures when AccessDenied is thrown. May be
# removed to enhance performance.
logger.alfresco-module-org_alfresco_module_rm-security-RMMethodSecurityInterceptor.name=org.alfresco.module.org_alfresco_module_rm.security.RMMethodSecurityInterceptor
logger.alfresco-module-org_alfresco_module_rm-security-RMMethodSecurityInterceptor.level=info
# RM permission debug
#logger.alfresco-module-org_alfresco_module_rm-capability-RMEntryVoter.name=org.alfresco.module.org_alfresco_module_rm.capability.RMEntryVoter
#logger.alfresco-module-org_alfresco_module_rm-capability-RMEntryVoter.level=debug
#logger.alfresco-module-org_alfresco_module_rm-capability-RMAfterInvocationProvider.name=org.alfresco.module.org_alfresco_module_rm.capability.RMAfterInvocationProvider
#logger.alfresco-module-org_alfresco_module_rm-capability-RMAfterInvocationProvider.level=debug
#logger.alfresco-module-org_alfresco_module_rm-capability-declarative.name=org.alfresco.module.org_alfresco_module_rm.capability.declarative
#logger.alfresco-module-org_alfresco_module_rm-capability-declarative.level=debug
# RM Audit service debug
#logger.alfresco-module-org_alfresco_module_rm-audit-RecordsManagementAuditService.name=org.alfresco.module.org_alfresco_module_rm.audit.RecordsManagementAuditService
#logger.alfresco-module-org_alfresco_module_rm-audit-RecordsManagementAuditService.level=debug
# Job debug
#logger.alfresco-module-org_alfresco_module_rm-job.name=org.alfresco.module.org_alfresco_module_rm.job
#logger.alfresco-module-org_alfresco_module_rm-job.level=debug
# Script logging level
logger.alfresco-repo-jscript-ScriptLogger.name=org.alfresco.repo.jscript.ScriptLogger
logger.alfresco-repo-jscript-ScriptLogger.level=error
# Behaviour debug
logger.alfresco-repo-policy-annotation-AnnotatedBehaviourPostProcessor.name=org.alfresco.repo.policy.annotation.AnnotatedBehaviourPostProcessor
logger.alfresco-repo-policy-annotation-AnnotatedBehaviourPostProcessor.level=info
logger.alfresco-module-org_alfresco_module_rm-behaviour-BaseBehaviourBean.name=org.alfresco.module.org_alfresco_module_rm.behaviour.BaseBehaviourBean
logger.alfresco-module-org_alfresco_module_rm-behaviour-BaseBehaviourBean.level=info
logger.alfresco-repo-web-scripts-roles-DynamicAuthoritiesGet.name=org.alfresco.repo.web.scripts.roles.DynamicAuthoritiesGet
logger.alfresco-repo-web-scripts-roles-DynamicAuthoritiesGet.level=info
logger.alfresco-module-org_alfresco_module_rm-query-RecordsManagementQueryDAOImpl.name=org.alfresco.module.org_alfresco_module_rm.query.RecordsManagementQueryDAOImpl
logger.alfresco-module-org_alfresco_module_rm-query-RecordsManagementQueryDAOImpl.level=info

View File

@@ -99,10 +99,10 @@ function main()
{
version = versionHistory[i];
p = getPerson(version.creator);
recordNodeRef = version.getVersionProperty("recordNodeRef");
isRecordedVersionDestroyed = version.getVersionProperty("RecordedVersionDestroyed");
versions[versions.length] =
{
nodeRef: version.node.nodeRef.toString(),

View File

@@ -26,19 +26,19 @@
*/
/**
* Delete the rm constraint list
*/
*/
function main()
{
// Get the shortname
var shortName = url.extension;
// Get the constraint
var constraint = caveatConfig.getConstraint(shortName);
if (constraint != null)
{
caveatConfig.deleteConstraintList(shortName);
// Pass the constraint name to the template
model.constraintName = shortName;
}

View File

@@ -26,15 +26,15 @@
*/
/**
* Get the detail of the rm constraint
*/
*/
function main()
{
// Get the shortname
var shortName = url.extension;
// Get the constraint
var constraint = caveatConfig.getConstraint(shortName);
if (constraint != null)
{
// Pass the constraint detail to the template

View File

@@ -26,14 +26,14 @@
*/
/**
* List the names of the rm constraints
*/
*/
function main()
{
var wel = true;
var withEmptyLists = args["withEmptyLists"];
// Pass the information to the template
if (withEmptyLists != null && withEmptyLists === 'false')
{
{
model.constraints = caveatConfig.constraintsWithoutEmptyList;
}
else

View File

@@ -26,15 +26,15 @@
*/
/**
* Get the detail of the rm constraint
*/
*/
function main()
{
var urlElements = url.extension.split("/");
var shortName = urlElements[0];
// Get the constraint
var constraint = caveatConfig.getConstraint(shortName);
if (constraint != null)
{
// Pass the constraint detail to the template

View File

@@ -26,33 +26,33 @@
*/
/**
* Update the details of a value in an rm constraint
*/
*/
function main()
{
var urlElements = url.extension.split("/");
var shortName = urlElements[0];
var values = null;
if (json.has("values"))
{
values = json.getJSONArray("values");
}
if (values == null)
{
status.setCode(status.STATUS_BAD_REQUEST, "Values missing");
return;
}
// Get the constraint
var constraint = caveatConfig.getConstraint(shortName);
if (constraint != null)
{
constraint.updateValues(values);
constraint.updateValues(values);
model.constraint = caveatConfig.getConstraint(shortName);
model.constraintName = shortName;
model.constraintName = shortName;
}
else
{

View File

@@ -26,13 +26,13 @@
*/
/**
* Delete the rm constraint list
*/
*/
function main()
{
var urlElements = url.extension.split("/");
var shortName = urlElements[0];
var authorityName = urlElements[1];
if (shortName == null)
{
status.setCode(status.STATUS_BAD_REQUEST, "shortName missing");
@@ -43,16 +43,16 @@ function main()
status.setCode(status.STATUS_BAD_REQUEST, "value missing");
return;
}
// Get the constraint
var constraint = caveatConfig.getConstraint(shortName);
if (constraint != null)
{
caveatConfig.deleteRMConstraintListValue(shortName, valueName);
var constraint = caveatConfig.getConstraint(shortName);
// Pass the constraint name to the template
model.constraint = constraint;
}

View File

@@ -26,28 +26,28 @@
*/
/**
* Get the detail of the rm constraint
*/
*/
function main()
{
var urlElements = url.extension.split("/");
var shortName = decodeURIComponent(urlElements[0]);
var valueName = decodeURIComponent(urlElements[2])
// Get the constraint
var constraint = caveatConfig.getConstraint(shortName);
if (constraint != null)
{
// Pass the constraint detail to the template
var value = constraint.getValue(valueName);
if(value == null)
{
// Return 404
status.setCode(404, "Constraint List: " + shortName + " value: " + valueName + "does not exist");
return;
}
model.value = value;
model.constraint = constraint;
}

View File

@@ -114,7 +114,7 @@ function getRecordSeries(seriesNode)
// Create Record Series object
var recordSerie = {
parentPath: "/",
name: seriesNode.name,
name: seriesNode.name,
identifier: seriesNode.properties["rma:identifier"],
description: seriesNode.properties["description"]
};
@@ -154,7 +154,7 @@ function getRecordCategory(categoryNode, parentPath)
name: categoryNode.name,
identifier: categoryNode.properties["rma:identifier"],
vitalRecordIndicator: categoryNode.properties["vitalRecordIndicator"],
dispositionAuthority: categoryNode.properties["dispositionAuthority"],
dispositionAuthority: categoryNode.properties["dispositionAuthority"],
recordFolders: [],
dispositionActions: []
};

View File

@@ -36,12 +36,12 @@ function main()
status.setCode(status.STATUS_NOT_FOUND, "Site not found: '" + siteId + "'");
return null;
}
var searchNode = siteNode.getContainer("Saved Searches");
if (searchNode != null)
{
var kids, ssNode;
if (bPublic == null || bPublic == "true")
{
// public searches are in the root of the folder
@@ -56,7 +56,7 @@ function main()
kids = userNode.children;
}
}
if (kids)
{
for (var i = 0, ii = kids.length; i < ii; i++)
@@ -73,7 +73,7 @@ function main()
}
}
}
model.savedSearches = savedSearches;
}

View File

@@ -40,7 +40,7 @@ function main()
status.setCode(status.STATUS_BAD_REQUEST, "nodeRef: '" + nodeRef + "' is not of type 'rma:transfer'");
return null;
}
model.transfer = transfer;
}

View File

@@ -33,7 +33,7 @@
/**
* Live Search Component
*
*
* Takes the following object as Input:
* params
* {
@@ -41,7 +41,7 @@
* term: search terms
* maxResults: maximum results to return
* };
*
*
* Outputs:
* items - Array of objects containing the search results
*/
@@ -53,7 +53,7 @@ const SURF_CONFIG_QNAMEPATH = "/cm:surf-config/";
/**
* Returns site information data structure.
* { shortName: siteId, title: title }
*
*
* Caches the data to avoid repeatedly querying the repository.
*/
var siteDataCache = {};
@@ -134,13 +134,13 @@ function getDocumentItem(container, node) {
}
}
}
return item;
}
/**
* Splits the qname path to a node.
*
*
* Returns container meta object containing the following properties:
* siteId
* containerId
@@ -151,7 +151,7 @@ function splitQNamePath(node) {
siteId: null,
containerId: null
};
if (path.match("^"+SITES_SPACE_QNAME_PATH) == SITES_SPACE_QNAME_PATH)
{
var tmp = path.substring(SITES_SPACE_QNAME_PATH.length),
@@ -167,13 +167,13 @@ function splitQNamePath(node) {
// strip container id from the path
var containerId = tmp.substring(0, pos);
containerId = containerId.substring(containerId.indexOf(":") + 1);
container.siteId = siteId;
container.containerId = containerId;
}
}
}
return container;
}
@@ -197,36 +197,36 @@ function liveSearch(params) {
/**
* Return Document Search results with the given search terms.
*
*
* "AND" is the default operator unless configured otherwise, OR, AND and NOT are also supported -
* as is any other valid fts-alfresco elements such as "quoted terms" and (bracket terms) and also
* propname:propvalue syntax.
*
*
* @param params Object containing search parameters - see API description above
*/
function getDocResults(params) {
// ensure a TYPE is specified
var ftsQuery = params.term + ' AND +TYPE:"cm:content"';
// site constraint
if (params.siteId !== null)
{
// use SITE syntax to restrict to specific site
ftsQuery += ' AND SITE:"' + params.siteId + '"';
}
// root node - generally used for overridden Repository root in Share
if (params.rootNode !== null)
{
ftsQuery = 'PATH:"' + rootNode.qnamePath + '//*" AND (' + ftsQuery + ')';
}
// main query construction
ftsQuery = '(' + ftsQuery + ') AND -TYPE:"cm:thumbnail" AND -TYPE:"cm:failedThumbnail" AND -TYPE:"cm:rating" AND -TYPE:"fm:post" AND -ASPECT:"sys:hidden" AND -ASPECT:"rma:savedSearch" AND -cm:creator:system';
if (logger.isLoggingEnabled())
logger.log("LiveQuery:\r\n" + ftsQuery);
// get default fts operator from the config
//
// TODO: common search lib - for both live and standard e.g. to get values like this...
@@ -237,7 +237,7 @@ function getDocResults(params) {
{
operator = cf.toString();
}
// perform fts-alfresco language query
var queryDef = {
query: ftsQuery,
@@ -254,10 +254,10 @@ function getDocResults(params) {
var rs = search.queryResultSet(queryDef);
nodes = rs.nodes,
results = [];
if (logger.isLoggingEnabled())
logger.log("Processing resultset of length: " + nodes.length);
for (var i=0, item; i<nodes.length && i<params.maxResults; i++)
{
// For each node we extract the site/container qname path and then
@@ -279,13 +279,13 @@ function getDocResults(params) {
}
}
}
return buildResults(results, params, rs.meta.hasMore);
}
/**
* Return Site Search results with the given search terms.
*
*
* @param params Object containing search parameters - see API description above
*/
function getSiteResults(params) {
@@ -297,7 +297,7 @@ function getSiteResults(params) {
/**
* Return People Search results with the given search terms.
*
*
* @param params Object containing search parameters - see API description above
*/
function getPeopleResults(params) {

View File

@@ -8,15 +8,13 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-governance-services-community-repo-parent</artifactId>
<version>23.1.1.13-SNAPSHOT</version>
<version>19.12</version>
</parent>
<properties>
<app.amp.client.war.folder>${project.build.directory}/${project.build.finalName}-war</app.amp.client.war.folder>
<image.name>alfresco/alfresco-governance-repository-community-base</image.name>
<base.image>alfresco/alfresco-community-repo-base</base.image>
<scripts.directory>${project.parent.parent.parent.parent.basedir}/scripts</scripts.directory>
</properties>
<dependencies>
@@ -60,12 +58,9 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
</dependency>
<dependency>
<groupId>jakarta.mail</groupId>
<artifactId>jakarta.mail-api</artifactId>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.alfresco.surf</groupId>
@@ -105,8 +100,9 @@
<artifactId>swagger-parser</artifactId>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/com.github.fge/json-schema-validator -->
<dependency>
<groupId>com.networknt</groupId>
<groupId>com.github.fge</groupId>
<artifactId>json-schema-validator</artifactId>
<scope>test</scope>
</dependency>
@@ -416,7 +412,9 @@
<configuration>
<images>
<image>
<name>postgres:15.4</name>
<!-- TODO upgrade this old postgres version -->
<name>postgres:9.4.12</name>
<!--<name>postgres:13.3</name>-->
<run>
<ports>
<port>${postgresql.tests.port}:${postgresql.port}</port>
@@ -539,43 +537,9 @@
</build>
</profile>
<profile>
<id>build-docker-images</id>
<!-- builds "image:latest" locally -->
<build>
<plugins>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<configuration>
<images>
<image>
<name>${image.name}:${image.tag}</name>
<build>
<args>
<BASE_IMAGE>${base.image}:${image.tag}</BASE_IMAGE>
</args>
<contextDir>${project.basedir}</contextDir>
</build>
</image>
</images>
</configuration>
<executions>
<execution>
<id>build-image</id>
<phase>package</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>build-multiarch-docker-images</id>
<id>build-docker-images</id>
<!-- builds "image:latest" locally -->
<build>
<plugins>
<plugin>
@@ -584,56 +548,20 @@
<configuration>
<images>
<image>
<name>${local.registry}/${image.name}:${image.tag}</name>
<build>
<buildx>
<platforms>
<platform>linux/amd64</platform>
<platform>linux/arm64</platform>
</platforms>
<builderName>${builder.name}</builderName>
</buildx>
<contextDir>${project.basedir}</contextDir>
<args>
<BASE_IMAGE>${local.registry}/${base.image}:${image.tag}</BASE_IMAGE>
</args>
</build>
<name>${image.name}:${image.tag}</name>
</image>
</images>
</configuration>
<executions>
<execution>
<id>build-push-image</id>
<id>build-image</id>
<phase>package</phase>
<goals>
<goal>build</goal>
<goal>push</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>exec-maven-plugin</artifactId>
<groupId>org.codehaus.mojo</groupId>
<executions>
<execution>
<id>prepare-buildx</id>
<phase>generate-sources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>${scripts.directory}/prepare_buildx.sh</executable>
<arguments>
<argument>${builder.name}</argument>
<argument>${image.registry}</argument>
<argument>${image.name}</argument>
<argument>${image.tag}</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
@@ -650,37 +578,12 @@
<images>
<image>
<!-- Quay image -->
<name>${image.registry}/${image.name}:${image.tag}</name>
<build>
<buildx>
<platforms>
<platform>linux/amd64</platform>
<platform>linux/arm64</platform>
</platforms>
<builderName>${builder.name}</builderName>
</buildx>
<args>
<BASE_IMAGE>${local.registry}/${base.image}:${image.tag}</BASE_IMAGE>
</args>
<contextDir>${project.basedir}</contextDir>
</build>
<name>${image.name}:${image.tag}</name>
<registry>${image.registry}</registry>
</image>
<image>
<!-- DockerHub image -->
<name>${image.name}:${image.tag}</name>
<build>
<buildx>
<platforms>
<platform>linux/amd64</platform>
<platform>linux/arm64</platform>
</platforms>
<builderName>${builder.name}</builderName>
</buildx>
<args>
<BASE_IMAGE>${local.registry}/${base.image}:${image.tag}</BASE_IMAGE>
</args>
<contextDir>${project.basedir}</contextDir>
</build>
</image>
</images>
</configuration>
@@ -695,28 +598,6 @@
</execution>
</executions>
</plugin>
<plugin>
<artifactId>exec-maven-plugin</artifactId>
<groupId>org.codehaus.mojo</groupId>
<executions>
<execution>
<id>prepare-buildx</id>
<phase>generate-sources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>${scripts.directory}/prepare_buildx.sh</executable>
<arguments>
<argument>${builder.name}</argument>
<argument>${image.registry}</argument>
<argument>${image.name}</argument>
<argument>${image.tag}</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>

View File

@@ -39,12 +39,12 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import jakarta.mail.MessagingException;
import jakarta.mail.Multipart;
import jakarta.mail.Part;
import jakarta.mail.internet.ContentType;
import jakarta.mail.internet.MimeMessage;
import jakarta.mail.internet.MimeUtility;
import javax.mail.MessagingException;
import javax.mail.Multipart;
import javax.mail.Part;
import javax.mail.internet.ContentType;
import javax.mail.internet.MimeMessage;
import javax.mail.internet.MimeUtility;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.model.ContentModel;

View File

@@ -52,7 +52,7 @@ import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import jakarta.transaction.SystemException;
import javax.transaction.SystemException;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.model.ContentModel;

View File

@@ -61,7 +61,6 @@ public class RFC822MetadataExtracter extends org.alfresco.repo.content.metadata.
public void setNodeService(NodeService nodeService)
{
this.nodeService = nodeService;
super.setNodeService(nodeService);
}
/**

View File

@@ -30,10 +30,8 @@ package org.alfresco.module.org_alfresco_module_rm.job;
import static org.alfresco.module.org_alfresco_module_rm.action.RMDispositionActionExecuterAbstractBase.PARAM_NO_ERROR_CHECK;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import lombok.extern.slf4j.Slf4j;
import org.alfresco.error.AlfrescoRuntimeException;
@@ -49,6 +47,7 @@ import org.alfresco.service.cmr.search.ResultSet;
import org.alfresco.service.cmr.search.SearchParameters;
import org.alfresco.service.cmr.search.SearchService;
import org.alfresco.service.cmr.security.PersonService;
import org.springframework.extensions.surf.util.I18NUtil;
/**
@@ -65,6 +64,7 @@ public class DispositionLifecycleJobExecuter extends RecordsManagementJobExecute
/** batching properties */
private int batchSize;
public static final int DEFAULT_BATCH_SIZE = 500;
private static final String MSG_NODE_FROZEN = "rm.action.node.frozen.error-message";
/** list of disposition actions to automatically execute */
private List<String> dispositionActions;
@@ -194,7 +194,6 @@ public class DispositionLifecycleJobExecuter extends RecordsManagementJobExecute
boolean hasMore = true;
int skipCount = 0;
List<NodeRef> resultNodes = new ArrayList<>();
if (batchSize < 1)
{
@@ -215,14 +214,7 @@ public class DispositionLifecycleJobExecuter extends RecordsManagementJobExecute
// execute search
ResultSet results = searchService.query(params);
if(results != null)
{
// filtering out the hold/freezed cases from the result set
resultNodes =
results.getNodeRefs().stream().filter(node -> nodeService.getPrimaryParent(node) == null ?
!freezeService.isFrozenOrHasFrozenChildren(node) :
!freezeService.isFrozenOrHasFrozenChildren(nodeService.getPrimaryParent(node).getParentRef())).collect(Collectors.toList());
}
List<NodeRef> resultNodes = results.getNodeRefs();
hasMore = results.hasMore();
skipCount += resultNodes.size(); // increase by page size
results.close();
@@ -273,6 +265,12 @@ public class DispositionLifecycleJobExecuter extends RecordsManagementJobExecute
}
Map<String, Serializable> props = Map.of(PARAM_NO_ERROR_CHECK, false);
if (freezeService.isFrozenOrHasFrozenChildren(parent.getParentRef()))
{
log.debug(I18NUtil.getMessage(MSG_NODE_FROZEN, dispAction));
continue;
}
try
{
// execute disposition action

View File

@@ -29,7 +29,7 @@ package org.alfresco.module.org_alfresco_module_rm.script;
import static org.alfresco.util.WebScriptUtils.getTemplateVars;
import jakarta.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;
import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionService;

View File

@@ -27,7 +27,7 @@
package org.alfresco.module.org_alfresco_module_rm.script;
import jakarta.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;
import java.util.HashMap;

View File

@@ -30,7 +30,7 @@ package org.alfresco.module.org_alfresco_module_rm.script;
import java.util.HashMap;
import java.util.Map;
import jakarta.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletResponse;
import org.alfresco.module.org_alfresco_module_rm.admin.RecordsManagementAdminService;
import org.alfresco.service.cmr.dictionary.PropertyDefinition;

View File

@@ -34,7 +34,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import jakarta.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletResponse;
import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionActionDefinition;
import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionSchedule;

View File

@@ -34,7 +34,7 @@ import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import jakarta.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletResponse;
import org.alfresco.model.ContentModel;
import org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanService;

View File

@@ -33,7 +33,7 @@ import static org.alfresco.util.WebScriptUtils.getTemplateVars;
import java.util.HashMap;
import java.util.Map;
import jakarta.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletResponse;
import org.alfresco.module.org_alfresco_module_rm.relationship.RelationshipService;
import org.alfresco.service.cmr.repository.NodeRef;

View File

@@ -27,7 +27,7 @@
package org.alfresco.module.org_alfresco_module_rm.script;
import jakarta.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;

View File

@@ -32,7 +32,7 @@ import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import jakarta.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletResponse;
import org.alfresco.model.ContentModel;
import org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanService;

View File

@@ -32,7 +32,7 @@ import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import jakarta.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletResponse;
import org.alfresco.module.org_alfresco_module_rm.capability.Capability;
import org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService;

View File

@@ -25,7 +25,7 @@
* #L%
*/
/*
* Copyright (C) 2005 - 2024 Alfresco Software Limited.
* Copyright (C) 2005-2014 Alfresco Software Limited.
*
* This file is part of Alfresco
*
@@ -44,7 +44,7 @@
*/
package org.alfresco.repo.web.scripts.roles;
import jakarta.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletResponse;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;

View File

@@ -25,7 +25,7 @@
* #L%
*/
/*
* Copyright (C) 2005 - 2024 Alfresco Software Limited.
* Copyright (C) 2005-2014 Alfresco Software Limited.
*
* This file is part of Alfresco
*
@@ -54,7 +54,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import jakarta.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletResponse;
import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionSchedule;
import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionService;

View File

@@ -3,8 +3,8 @@
#
# Version label
version.major=23
version.minor=1
version.major=7
version.minor=3
version.revision=1
version.label=

View File

@@ -170,7 +170,7 @@ public class DispositionLifecycleJobExecuterUnitTest extends BaseUnitTest
executer.executeImpl();
// then
verify(mockedNodeService, times(2)).getPrimaryParent(any(NodeRef.class));
// ensure the query is executed and closed
verifyQueryTimes(2);
@@ -206,7 +206,7 @@ public class DispositionLifecycleJobExecuterUnitTest extends BaseUnitTest
executer.executeImpl();
// then
verify(mockedNodeService, times(1)).getPrimaryParent(any(NodeRef.class));
// ensure the query is executed and closed
verifyQueryTimes(1);
@@ -262,11 +262,11 @@ public class DispositionLifecycleJobExecuterUnitTest extends BaseUnitTest
// ensure each node is process correctly
// node1
verify(mockedNodeService, times(1)).getProperty(node1, RecordsManagementModel.PROP_DISPOSITION_ACTION);
verify(mockedNodeService, times(3)).getPrimaryParent(node1);
verify(mockedNodeService, times(1)).getPrimaryParent(node1);
verify(mockedRecordsManagementActionService, times(1)).executeRecordsManagementAction(eq(parent), eq(CUTOFF), anyMap());
// node2
verify(mockedNodeService, times(1)).getProperty(node2, RecordsManagementModel.PROP_DISPOSITION_ACTION);
verify(mockedNodeService, times(3)).getPrimaryParent(node2);
verify(mockedNodeService, times(1)).getPrimaryParent(node2);
verify(mockedRecordsManagementActionService, times(1)).executeRecordsManagementAction(eq(parent), eq(RETAIN), anyMap());
// ensure no more interactions
@@ -329,7 +329,7 @@ public class DispositionLifecycleJobExecuterUnitTest extends BaseUnitTest
// call the service
executer.executeImpl();
// check the loop iterated through all the elements
// check the loop iterated trough all the elements
verify(mockedNodeService).exists(node1);
verify(mockedNodeService).exists(node2);
verify(mockedNodeService).exists(node3);

View File

@@ -45,10 +45,12 @@ import java.util.Set;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
import com.networknt.schema.JsonSchema;
import com.networknt.schema.JsonSchemaFactory;
import com.networknt.schema.SpecVersion.VersionFlag;
import com.networknt.schema.ValidationMessage;
import com.github.fge.jackson.JsonLoader;
import com.github.fge.jsonschema.core.exceptions.ProcessingException;
import com.github.fge.jsonschema.core.report.ProcessingMessage;
import com.github.fge.jsonschema.core.report.ProcessingReport;
import com.github.fge.jsonschema.main.JsonSchema;
import com.github.fge.jsonschema.main.JsonSchemaFactory;
import io.swagger.models.Swagger;
import io.swagger.parser.SwaggerParser;
@@ -64,8 +66,8 @@ import org.apache.commons.io.filefilter.WildcardFileFilter;
*/
public class BaseYamlUnitTest
{
private static final String SWAGGER_2_SCHEMA_LOCATION = "/rest/schema.json";
private static final String OPEN_API_SPECIFICATION = "2.0";
private static String SWAGGER_2_SCHEMA_LOCATION = "/rest/schema.json";
private static String OPEN_API_SPECIFICATION = "2.0";
/**
* Helper method to obtain path names for all yaml files found on the given path
@@ -84,11 +86,11 @@ public class BaseYamlUnitTest
/**
* Helper method to validate that all given yaml files are valid readable Swagger format
*/
protected void validateYamlFiles(final Set<String> yamlFileNames) throws ValidationException, IOException
protected void validateYamlFiles(final Set<String> yamlFileNames) throws ProcessingException, IOException
{
assertFalse("Expected at least 1 yaml file to validate", yamlFileNames.isEmpty());
final JsonSchema swaggerSchema = getSwaggerSchema();
final JsonSchema swaggerSchema = getSwaggerSchema(SWAGGER_2_SCHEMA_LOCATION);
assertNotNull("Failed to obtain the Swagger schema", swaggerSchema);
for (String yamlFilePath : yamlFileNames)
@@ -104,11 +106,11 @@ public class BaseYamlUnitTest
assertEquals("Failed to obtain Swagger version from yaml file " + yamlFilePath,
swagger.getSwagger(), OPEN_API_SPECIFICATION);
}
catch (ValidationException ex)
catch (ProcessingException ex)
{
// ensure the yaml filename is included in the message
String context = String.format(yamlFilePath + ": %n" + ex.getMessage());
throw new ValidationException(context) ;
throw new ProcessingException(context) ;
}
}
}
@@ -116,15 +118,16 @@ public class BaseYamlUnitTest
/**
* Helper method to read in the Swagger JSON schema file
*/
private JsonSchema getSwaggerSchema() throws IOException
private JsonSchema getSwaggerSchema(final String schemaLocation) throws IOException, ProcessingException
{
JsonSchema swaggerSchema = null;
final InputStream in = this.getClass().getResourceAsStream(SWAGGER_2_SCHEMA_LOCATION);
final InputStream in = this.getClass().getResourceAsStream(schemaLocation);
if (in != null)
{
final String swaggerSchemaAsString = IOUtils.toString(in);
final JsonSchemaFactory factory = JsonSchemaFactory.getInstance(VersionFlag.V4);
swaggerSchema = factory.getSchema(swaggerSchemaAsString);
final JsonNode schemaNode = JsonLoader.fromString(swaggerSchemaAsString);
final JsonSchemaFactory factory = JsonSchemaFactory.byDefault();
swaggerSchema = factory.getJsonSchema(schemaNode);
}
return swaggerSchema;
}
@@ -132,7 +135,7 @@ public class BaseYamlUnitTest
/**
* Helper method to validate Yaml file against JSON schema
*/
private boolean validateYamlFile(final String yamlFilePath, final JsonSchema jsonSchema) throws IOException, ValidationException
private boolean validateYamlFile(final String yamlFilePath, final JsonSchema jsonSchema) throws IOException, ProcessingException
{
// Get yaml file as a string
final String yaml = new String(Files.readAllBytes(Paths.get(yamlFilePath)));
@@ -149,22 +152,19 @@ public class BaseYamlUnitTest
/**
* Helper method to validate JSON string against JSON schema
*/
private boolean validateJSON(final String jsonData, final JsonSchema schema) throws IOException, ValidationException
private boolean validateJSON(final String jsonData, final JsonSchema schema) throws IOException, ProcessingException
{
final JsonNode dataNode = new ObjectMapper().readTree(jsonData);
final Iterator<ValidationMessage> errors = schema.validate(dataNode).iterator();
if (!errors.hasNext()) return true;
final ValidationMessage errorMessage = errors.next();
throw new ValidationException(errorMessage.toString());
}
private static class ValidationException extends Exception
{
public ValidationException(String message)
final JsonNode dataNode = JsonLoader.fromString(jsonData);
final ProcessingReport report = schema.validate(dataNode);
boolean isOk = report.isSuccess();
if (!isOk)
{
super(message);
Iterator<ProcessingMessage> messages = report.iterator();
if (messages.hasNext())
{
throw new ProcessingException(messages.next().toString());
}
}
return isOk;
}
}

View File

@@ -1,7 +1,7 @@
{
"title": "A JSON Schema for Swagger 2.0 API.",
"id": "http://swagger.io/v2/schema.json#",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "#",
"$schema": "#",
"type": "object",
"required": [
"swagger",
@@ -203,7 +203,7 @@
"additionalProperties": {
"$ref": "#/definitions/response"
},
"description": "One or more JSON representations for responses"
"description": "One or more JSON representations for parameters"
},
"externalDocs": {
"type": "object",

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-governance-services-community-repo-parent</artifactId>
<version>23.1.1.13-SNAPSHOT</version>
<version>19.12</version>
</parent>
<build>
@@ -36,40 +36,24 @@
<id>start-api-explorer</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven3-plugin</artifactId>
<executions>
<execution>
<id>run-war</id>
<phase>verify</phase>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
<configuration>
<container>
<containerId>tomcat9x</containerId>
<type>embedded</type>
<log>target/cargo.log</log>
</container>
<configuration>
<properties>
<cargo.servlet.port>8085</cargo.servlet.port>
</properties>
</configuration>
<deployables>
<deployable>
<type>war</type>
<properties>
<context>/api-explorer</context>
</properties>
<pingURL>http://localhost:8085/api-explorer</pingURL>
</deployable>
</deployables>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<executions>
<execution>
<id>run-war</id>
<goals>
<goal>run-war</goal>
</goals>
<phase>verify</phase>
</execution>
</executions>
<configuration>
<useSeparateTomcatClassLoader>true</useSeparateTomcatClassLoader>
<path>/api-explorer</path>
<port>8085</port>
</configuration>
</plugin>
</plugins>
</build>
</profile>

View File

@@ -38,7 +38,6 @@ tags:
description: Retrieve and manage unfiled records containers
- name: unfiled-record-folders
description: Retrieve and manage unfiled record folders
paths:
## GS sites
'/gs-sites':
@@ -2092,7 +2091,6 @@ paths:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
parameters:
## File plans
filePlanEntryIncludeParam:
@@ -3761,4 +3759,4 @@ definitions:
- SiteConsumer
- SiteCollaborator
- SiteContributor
- SiteManager
- SiteManager

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>23.1.1.13-SNAPSHOT</version>
<version>19.12</version>
</parent>
<modules>

View File

@@ -8,7 +8,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-amps</artifactId>
<version>23.1.1.13-SNAPSHOT</version>
<version>19.12</version>
</parent>
<properties>
@@ -121,6 +121,12 @@
<version>${dependency.webscripts.version}</version>
<classifier>tests</classifier>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
@@ -128,8 +134,26 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
<!-- SHA-2432 -->
<dependency>
<groupId>org.apache.taglibs</groupId>
<artifactId>taglibs-standard-spec</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.taglibs</groupId>
<artifactId>taglibs-standard-impl</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.taglibs</groupId>
<artifactId>taglibs-standard-jstlel</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2005 - 2023 Alfresco Software Limited.
* Copyright 2005 - 2020 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.
@@ -27,7 +27,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import jakarta.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletResponse;
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
import org.alfresco.repo.web.scripts.admin.NodeBrowserPost;

View File

@@ -48,7 +48,7 @@ function tagQuery()
}
query += "ASPECT:\"{http://www.alfresco.org/model/content/1.0}taggable\"";
//MNT-2118 Share inconsistencies when displaying locked files with tags
query += " AND -ASPECT:\"{http://www.alfresco.org/model/content/1.0}workingcopy\"";
query += " -ASPECT:\"{http://www.alfresco.org/model/content/1.0}workingcopy\"";
// MNT-20091 check to prevent cm:taggable with NULL
query += " AND ISNOTNULL:\"{http://www.alfresco.org/model/content/1.0}taggable\"";
@@ -60,7 +60,7 @@ function tagQuery()
query: query,
language: "lucene",
page: {
// query minimum rows because all useful info will come with facets
// query minimum rows because all usefull info will come with facets
maxItems: 1,
skipCount: 0
},

View File

@@ -241,7 +241,7 @@ var Filters =
filterData = filterData.slice(0, -1);
}
filterQuery = this.constructPathQuery(parsedArgs);
filterParams.query = filterQuery + " +PATH:\"/cm:categoryRoot/cm:generalclassifiable" + Filters.iso9075EncodePath(filterData) + "/member\"";
filterParams.query = filterQuery + " +PATH:\"/cm:generalclassifiable" + Filters.iso9075EncodePath(filterData) + "/member\"";
break;
case "aspect":

View File

@@ -23,10 +23,6 @@ function runAction(p_params)
if (p_params.destNode.hasAspect("cm:lockable") && !p_params.destNode.hasAspect("trx:transferred"))
{
p_params.destNode.unlock();
if(p_params.destNode.hasAspect("gd2:editingInGoogle"))
{
p_params.destNode.removeAspect("gd2:editingInGoogle");
}
}
var resultId = originalDoc.name,

View File

@@ -24,7 +24,7 @@ function getCategoryNode()
else
{
var queryPath = "/" + catAspect + "/" + encodePath(path);
categoryResults = search.luceneSearch("+PATH:\"" + queryPath + "/*\" AND -PATH:\"" + queryPath + "/member\"");
categoryResults = search.luceneSearch("+PATH:\"" + queryPath + "/*\" -PATH:\"" + queryPath + "/member\"");
}
// make each result an object and indicate it is selectable in the UI
@@ -71,4 +71,4 @@ function encodePath(path)
function sortByName(a, b)
{
return (b.node.name.toLowerCase() > a.node.name.toLowerCase() ? -1 : 1);
}
}

View File

@@ -230,7 +230,7 @@ var Filters =
filterData = filterData.slice(0, -1);
}
filterQuery = this.constructPathQuery(parsedArgs);
filterParams.query = filterQuery + " +PATH:\"/cm:categoryRoot/cm:generalclassifiable" + Filters.iso9075EncodePath(filterData) + "/member\"";
filterParams.query = filterQuery + " +PATH:\"/cm:generalclassifiable" + Filters.iso9075EncodePath(filterData) + "/member\"";
break;
default: // "path"

View File

@@ -29,7 +29,7 @@ function main()
{
query = "+PATH:\"" + parsedArgs.pathNode.qnamePath + "//*\" ";
}
query += "AND +TYPE:\"cm:content\" AND +@cm\\:content.mimetype:\"image/*\"";
query += "+TYPE:\"cm:content\" +@cm\\:content.mimetype:image/*";
// Sort the list before trimming to page chunks
assets = search.query(
@@ -52,4 +52,4 @@ function main()
/**
* Images List Component: images
*/
model.images = main();
model.images = main();

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2005 - 2023 Alfresco Software Limited.
* Copyright 2005 - 2020 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.
@@ -24,7 +24,7 @@ import java.util.Date;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import jakarta.transaction.UserTransaction;
import javax.transaction.UserTransaction;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.node.archive.NodeArchiveService;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2005 - 2023 Alfresco Software Limited.
* Copyright 2005 - 2021 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.
@@ -24,7 +24,7 @@ import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import jakarta.transaction.UserTransaction;
import javax.transaction.UserTransaction;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.model.Repository;

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>23.1.1.13-SNAPSHOT</version>
<version>19.12</version>
</parent>
<dependencies>
@@ -54,14 +54,9 @@
<classifier>asl</classifier>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>${dependency.log4j.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${dependency.log4j.version}</version>
<groupId>ch.qos.reload4j</groupId>
<artifactId>reload4j</artifactId>
<version>1.2.18.3</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
@@ -111,14 +106,15 @@
<!-- provided dependencies -->
<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
<!-- Test only dependencies, as popped up while running mvn test -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j2-impl</artifactId>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-reload4j</artifactId>
<scope>test</scope>
</dependency>
<dependency>
@@ -136,10 +132,6 @@
<artifactId>commons-dbcp2</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</dependency>
</dependencies>
<build>

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2005 - 2023 Alfresco Software Limited.
* Copyright (C) 2005-2011 Alfresco Software Limited.
*
* This file is part of Alfresco
*
@@ -26,8 +26,8 @@ import java.net.UnknownHostException;
import java.security.AlgorithmParameters;
import java.util.Arrays;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.alfresco.encryption.MACUtils.MACInput;
import org.alfresco.error.AlfrescoRuntimeException;

Some files were not shown because too many files have changed in this diff Show More