mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-09-10 14:11:58 +00:00
Compare commits
305 Commits
11.82
...
terraform-
Author | SHA1 | Date | |
---|---|---|---|
|
f0478515e6 | ||
|
868672e7ea | ||
|
e712d188fe | ||
|
bdedc23c95 | ||
|
aff84374c4 | ||
|
779731018d | ||
|
e242f5db98 | ||
|
68cde24419 | ||
|
7daef9ee21 | ||
|
db52b87849 | ||
|
cf379f3baa | ||
|
de04ce6944 | ||
|
caf5fdede4 | ||
|
2d4140ea64 | ||
|
3c928a4928 | ||
|
599f5727a0 | ||
|
7ac5cb1807 | ||
|
d311ef2c5f | ||
|
6f820e2c25 | ||
|
e515dacab1 | ||
|
5041249f03 | ||
|
1b26e3a937 | ||
|
a2d9afcecc | ||
|
577de6bf4c | ||
|
f71f53c988 | ||
|
7e4d72a66a | ||
|
142f99b2a2 | ||
|
1b0ddb1e74 | ||
|
4fa0157594 | ||
|
c1196ed8e9 | ||
|
90a69173bd | ||
|
cb0a07d5da | ||
|
77e721d66a | ||
|
25d2a51254 | ||
|
54fe4bb969 | ||
|
7e719cae80 | ||
|
157a6ba1c5 | ||
|
4fc165150a | ||
|
d574d05066 | ||
|
f66426bb60 | ||
|
b846ccd85e | ||
|
09fc6f1e25 | ||
|
630f553fce | ||
|
7242a78705 | ||
|
539a89537b | ||
|
608c16d4a4 | ||
|
c00736c639 | ||
|
15cb7ff44e | ||
|
4776e37223 | ||
|
cbd45fcb3e | ||
|
655cadbda0 | ||
|
6d7e3bb787 | ||
|
bb8d10074e | ||
|
806880a86b | ||
|
e68f56270a | ||
|
8705d97407 | ||
|
44e3242132 | ||
|
8a3cdd55a7 | ||
|
cff2a70b17 | ||
|
3b41308ecc | ||
|
8a60e26ff0 | ||
|
accfc4662d | ||
|
1e0fcfcc14 | ||
|
837a706514 | ||
|
db290c98f2 | ||
|
12682ddcff | ||
|
0ed2e9b3a7 | ||
|
3442e91575 | ||
|
59b636e0ba | ||
|
0333fe05b5 | ||
|
9b592bfc13 | ||
|
386696d58b | ||
|
1f243d629e | ||
|
dee7625998 | ||
|
1c541281db | ||
|
c991290c01 | ||
|
9b62808ed7 | ||
|
d4e8bba9f5 | ||
|
5ae240c392 | ||
|
a5b35b7d96 | ||
|
d2544b7a4d | ||
|
b9abc05eda | ||
|
04e3743f01 | ||
|
745295c4ba | ||
|
c9b08594de | ||
|
1d8044076c | ||
|
377b082ef8 | ||
|
ad2525bf17 | ||
|
888b26ef72 | ||
|
aa4a5a6063 | ||
|
7ea91ea702 | ||
|
b3e8051f08 | ||
|
4ba0d3a899 | ||
|
8d78b257aa | ||
|
df67011596 | ||
|
871bd40d6d | ||
|
2ef97e0b23 | ||
|
f1d48f7aab | ||
|
b5f24f5d58 | ||
|
14668044f4 | ||
|
c5281d7f10 | ||
|
00565f3bc9 | ||
|
f15c4d7a8f | ||
|
85a3c71849 | ||
|
4db8ca16e1 | ||
|
52e71719d1 | ||
|
507161a1d0 | ||
|
559171a32c | ||
|
b9f449df57 | ||
|
3185ecf6cb | ||
|
bd7f2a4250 | ||
|
79efa12b10 | ||
|
5807e756bd | ||
|
6ecb019b84 | ||
|
c26f933c44 | ||
|
43e528878e | ||
|
b120a9658f | ||
|
3875a84f74 | ||
|
8dddf293d0 | ||
|
d01e9ffbbc | ||
|
6f8507ebe2 | ||
|
923261d9b9 | ||
|
078e461b71 | ||
|
ddde92ef21 | ||
|
189011d528 | ||
|
af849d2144 | ||
|
53208f207c | ||
|
4cf3f77824 | ||
|
9d24e083bb | ||
|
6345c0a825 | ||
|
cda3d11c7e | ||
|
7ad35ac60d | ||
|
a164917232 | ||
|
507c6b2ed8 | ||
|
ab0d65897c | ||
|
d92844cebb | ||
|
25986d77d6 | ||
|
2b8948b84b | ||
|
64bf49cc22 | ||
|
3ce95c5262 | ||
|
e854a01988 | ||
|
65ba8b16e0 | ||
|
d2bb3a980d | ||
|
59b641474f | ||
|
9ee56762fb | ||
|
6cb8e84ee4 | ||
|
d540bb319b | ||
|
30a2bff92a | ||
|
ac08612183 | ||
|
031d1c740c | ||
|
aac73e2064 | ||
|
ec72000380 | ||
|
015e3213af | ||
|
d97510dfba | ||
|
df98ad9e92 | ||
|
19a7239612 | ||
|
2af2e7b868 | ||
|
84824edffa | ||
|
646419c073 | ||
|
ea854b55a4 | ||
|
4bfb26a660 | ||
|
1f608b1eb5 | ||
|
8652c9d644 | ||
|
57e8ee2c76 | ||
|
6cb00d8e3b | ||
|
bb58c4a2d9 | ||
|
1766ce6e31 | ||
|
0c5498fba0 | ||
|
48045c8c38 | ||
|
89adfacca6 | ||
|
6159bee521 | ||
|
a8a06f4b1f | ||
|
279ff3a0d8 | ||
|
b6a50ae6e1 | ||
|
83097d452b | ||
|
b26d03cc0c | ||
|
af24fef02b | ||
|
85fa4b5a93 | ||
|
01b5fb5593 | ||
|
09f8d7a806 | ||
|
77691ec5fd | ||
|
472710ffd4 | ||
|
16f0714e99 | ||
|
c7c40b06e1 | ||
|
439a9254a3 | ||
|
a9f19de31c | ||
|
d237e51bb2 | ||
|
d7758d5509 | ||
|
f8b40d3cc0 | ||
|
6d48c0979e | ||
|
1b7bada294 | ||
|
924f64409e | ||
|
7267ea5846 | ||
|
c86d82e9cd | ||
|
f7e6320a83 | ||
|
cff733bbdf | ||
|
57942cd43b | ||
|
4aaae012c5 | ||
|
1c387add9d | ||
|
d3ab782b57 | ||
|
b3d43b0500 | ||
|
a8e1ce909e | ||
|
76e815f9c5 | ||
|
5e973504d6 | ||
|
b84e1f8100 | ||
|
42d1176ccf | ||
|
113c27d130 | ||
|
e7cec99d07 | ||
|
aa6c347d74 | ||
|
3f8f05b0d4 | ||
|
2c6a7e3af6 | ||
|
692ff3ffa8 | ||
|
6b4df496ce | ||
|
6ce7d45aa2 | ||
|
d5210ab058 | ||
|
b7df7a80c1 | ||
|
b2d3c6e8c6 | ||
|
e2965a57f5 | ||
|
f395275129 | ||
|
ed3cc88b71 | ||
|
d41f3dcfde | ||
|
6bc03c02fb | ||
|
b68e805a37 | ||
|
68f34c284a | ||
|
3dcd47fac4 | ||
|
11354630f7 | ||
|
6eb7538bde | ||
|
2da894d82b | ||
|
b996987426 | ||
|
8b6dfa47b8 | ||
|
456e442438 | ||
|
b779613910 | ||
|
3530e3dc3b | ||
|
c4dcbba707 | ||
|
5b539b4248 | ||
|
6f1e35217b | ||
|
5d3f3f866e | ||
|
ad97dcd6f4 | ||
|
597056b1c4 | ||
|
4be9aad5f6 | ||
|
b066520e0e | ||
|
dcf564d3ba | ||
|
254d29d45f | ||
|
e0751568db | ||
|
fa696cfec5 | ||
|
49bc40bdea | ||
|
4f0b16b881 | ||
|
33155c8d92 | ||
|
838d758983 | ||
|
eee7e00310 | ||
|
d726ab8099 | ||
|
216f60a0ec | ||
|
8e973c2b60 | ||
|
d9c0016591 | ||
|
2deb07b97b | ||
|
3cf1cfd133 | ||
|
a1c0344828 | ||
|
b639c6ba62 | ||
|
e95100e429 | ||
|
9626f5ace6 | ||
|
48af7ebe9e | ||
|
f635bd9754 | ||
|
3cac5ebfc5 | ||
|
28eaa8c2f8 | ||
|
d6e096a06c | ||
|
c71e536245 | ||
|
9e7c3f3502 | ||
|
2fcbc29491 | ||
|
9559a15fe9 | ||
|
8374215221 | ||
|
964b2bb61c | ||
|
84c32c2665 | ||
|
6eb18af654 | ||
|
9cb719e853 | ||
|
4a6a847504 | ||
|
456525c1f8 | ||
|
16e9ebd7d1 | ||
|
d2671b9c39 | ||
|
e79f4900c0 | ||
|
ac4a1643e1 | ||
|
af0fd146f2 | ||
|
fd0931fb1c | ||
|
e0cbd1fba6 | ||
|
0477533383 | ||
|
705f7e2488 | ||
|
b2109b1867 | ||
|
d5a6947918 | ||
|
ec13994ccf | ||
|
0b1623ee93 | ||
|
6dcf78c211 | ||
|
c4547b3533 | ||
|
6e99df9d3e | ||
|
baca7759a6 | ||
|
e109bcdaf6 | ||
|
05aee70c30 | ||
|
84b59efed8 | ||
|
8ccce1740f | ||
|
e7b5d98dba | ||
|
8263a9ccd1 | ||
|
8173d06a76 | ||
|
754eadc05a | ||
|
8c5a56de14 | ||
|
b1a027a776 | ||
|
bd713ffbe9 | ||
|
6141fe2a03 |
181
.github/dependabot.yml
vendored
Normal file
181
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,181 @@
|
||||
version: 2
|
||||
registries:
|
||||
maven-repository-artifacts-alfresco-com-nexus-content-groups-int:
|
||||
type: maven-repository
|
||||
url: https://artifacts.alfresco.com/nexus/content/groups/internal
|
||||
username: ${{secrets.NEXUS_USERNAME}}
|
||||
password: ${{secrets.NEXUS_PASSWORD}}
|
||||
updates:
|
||||
- package-ecosystem: maven
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: daily
|
||||
time: "22:00"
|
||||
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"
|
||||
- dependency-name: org.activiti:activiti-engine
|
||||
versions:
|
||||
- "> 5.23.0"
|
||||
- dependency-name: org.activiti:activiti-engine
|
||||
versions:
|
||||
- ">= 7.1.a, < 7.2"
|
||||
- dependency-name: org.activiti:activiti-spring
|
||||
versions:
|
||||
- "> 5.23.0"
|
||||
- dependency-name: org.activiti:activiti-spring
|
||||
versions:
|
||||
- ">= 7.1.a, < 7.2"
|
||||
- dependency-name: org.apache.camel:camel-activemq
|
||||
versions:
|
||||
- "> 3.7.1"
|
||||
- dependency-name: org.apache.camel:camel-amqp
|
||||
versions:
|
||||
- "> 3.7.1"
|
||||
- dependency-name: org.apache.camel:camel-direct
|
||||
versions:
|
||||
- "> 3.7.1"
|
||||
- dependency-name: org.apache.camel:camel-directvm
|
||||
versions:
|
||||
- "> 3.7.1"
|
||||
- dependency-name: org.apache.camel:camel-jackson
|
||||
versions:
|
||||
- "> 3.7.1"
|
||||
- dependency-name: org.apache.camel:camel-mock
|
||||
versions:
|
||||
- "> 3.7.1"
|
||||
- dependency-name: org.apache.camel:camel-spring
|
||||
versions:
|
||||
- "> 3.7.1"
|
||||
- dependency-name: org.apache.chemistry.opencmis:chemistry-opencmis-client-impl
|
||||
versions:
|
||||
- "> 1.0.0"
|
||||
- dependency-name: org.apache.chemistry.opencmis:chemistry-opencmis-commons-impl
|
||||
versions:
|
||||
- "> 1.0.0"
|
||||
- dependency-name: org.apache.chemistry.opencmis:chemistry-opencmis-server-bindings
|
||||
versions:
|
||||
- "> 1.0.0"
|
||||
- dependency-name: org.apache.chemistry.opencmis:chemistry-opencmis-test-tck
|
||||
versions:
|
||||
- "> 1.0.0"
|
||||
- dependency-name: org.freemarker:freemarker
|
||||
versions:
|
||||
- "> 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
|
5
.gitignore
vendored
5
.gitignore
vendored
@@ -24,16 +24,17 @@ target
|
||||
*.log.*
|
||||
|
||||
# Mobile Tools for Java (J2ME)
|
||||
|
||||
.mtj
|
||||
.tmp/
|
||||
|
||||
# Package Files #
|
||||
|
||||
*.jar
|
||||
*.war
|
||||
*.ear
|
||||
|
||||
# maven-shade-plugin for mmt tool
|
||||
dependency-reduced-pom.xml
|
||||
|
||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||
|
||||
hs_err_pid*
|
||||
|
88
.travis.yml
88
.travis.yml
@@ -43,6 +43,11 @@ install: travis_retry travis_wait 40 bash scripts/travis/build.sh
|
||||
|
||||
jobs:
|
||||
include:
|
||||
- name: "Source Clear Scan (SCA)"
|
||||
if: branch = master OR branch =~ /release\/.*/
|
||||
# Run Veracode
|
||||
install: skip
|
||||
script: travis_wait 30 bash scripts/travis/source_clear.sh
|
||||
|
||||
- name: "Core, Data-Model, Repository - AllUnitTestsSuite - Build and test"
|
||||
if: commit_message !~ /\[skip repo\]/
|
||||
@@ -53,38 +58,38 @@ jobs:
|
||||
- name: "Repository - AppContext01TestSuite"
|
||||
if: commit_message !~ /\[skip repo\]/
|
||||
before_script:
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.1 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.3 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.0
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.3
|
||||
script: travis_wait 20 mvn -B test -pl repository -Dtest=AppContext01TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
|
||||
- name: "Repository - AppContext02TestSuite"
|
||||
if: commit_message !~ /\[skip repo\]/
|
||||
before_script:
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.1 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.3 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
|
||||
script: travis_wait 20 mvn -B test -pl repository -Dtest=AppContext02TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
|
||||
- name: "Repository - AppContext03TestSuite"
|
||||
if: commit_message !~ /\[skip repo\]/
|
||||
before_script:
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.1 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.3 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.0
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.3
|
||||
script: travis_wait 20 mvn -B test -pl repository -Dtest=AppContext03TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
|
||||
- name: "Repository - AppContext04TestSuite"
|
||||
if: commit_message !~ /\[skip repo\]/
|
||||
before_script:
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.1 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.3 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.0
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.3
|
||||
script: travis_wait 20 mvn -B test -pl repository -Dtest=AppContext04TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
|
||||
- name: "Repository - AppContext05TestSuite"
|
||||
if: commit_message !~ /\[skip repo\]/
|
||||
before_script:
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.1 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.3 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
|
||||
- mkdir -p "${HOME}/tmp"
|
||||
- cp repository/src/test/resources/realms/alfresco-realm.json "${HOME}/tmp"
|
||||
@@ -95,31 +100,31 @@ jobs:
|
||||
- name: "Repository - AppContext06TestSuite"
|
||||
if: commit_message !~ /\[skip repo\]/
|
||||
before_script:
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.1 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.3 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.0
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.3
|
||||
script: travis_wait 20 mvn -B test -pl repository -Dtest=AppContext06TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
|
||||
- name: "Repository - AppContextExtraTestSuite"
|
||||
if: commit_message !~ /\[skip repo\]/
|
||||
before_script:
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.1 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.3 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.0
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.3
|
||||
script: travis_wait 20 mvn -B test -pl repository -Dtest=AppContextExtraTestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
|
||||
- name: "Repository - MiscContextTestSuite"
|
||||
if: commit_message !~ /\[skip repo\]/
|
||||
before_script:
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.1 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.3 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.0
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.3
|
||||
script: travis_wait 20 mvn -B test -pl repository -Dtest=MiscContextTestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
|
||||
- name: "Repository - SearchTestSuite"
|
||||
if: commit_message !~ /\[skip repo\]/
|
||||
before_script:
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.1 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.3 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
|
||||
script: travis_wait 20 mvn -B test -pl repository -Dtest=SearchTestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco -Dindex.subsystem.name=solr6
|
||||
|
||||
@@ -144,6 +149,14 @@ jobs:
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
|
||||
script: travis_wait 20 mvn -B test -pl repository -Dtest=AllDBTestsTestSuite -Ddb.name=alfresco -Ddb.url=jdbc:mariadb://localhost:3307/alfresco?useUnicode=yes\&characterEncoding=UTF-8 -Ddb.username=alfresco -Ddb.password=alfresco -Ddb.driver=org.mariadb.jdbc.Driver
|
||||
|
||||
- name: "Repository - MariaDB 10.6 tests"
|
||||
# We run tests on the latest version of MariaDB on pull requests plus the normal master and release branches - ignored on feature branches
|
||||
if: (branch =~ /(release\/.*$|master)/ AND commit_message !~ /\[skip db\]/ ) OR commit_message =~ /\[db\]/ OR commit_message =~ /\[latest db\]/
|
||||
before_script:
|
||||
- docker run -d -p 3307:3306 --name mariadb -e MYSQL_ROOT_PASSWORD=alfresco -e MYSQL_USER=alfresco -e MYSQL_DATABASE=alfresco -e MYSQL_PASSWORD=alfresco mariadb:10.6 --transaction-isolation=READ-COMMITTED --max-connections=300 --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
|
||||
script: travis_wait 20 mvn -B test -pl repository -Dtest=AllDBTestsTestSuite -Ddb.name=alfresco -Ddb.url=jdbc:mariadb://localhost:3307/alfresco?useUnicode=yes\&characterEncoding=UTF-8 -Ddb.username=alfresco -Ddb.password=alfresco -Ddb.driver=org.mariadb.jdbc.Driver
|
||||
|
||||
- name: "Repository - MySQL 5.7.23 tests"
|
||||
if: (branch =~ /(release\/.*$|master)/ AND commit_message !~ /\[skip db\]/ AND type != pull_request) OR commit_message =~ /\[db\]/
|
||||
before_script:
|
||||
@@ -152,7 +165,8 @@ jobs:
|
||||
script: travis_wait 20 mvn -B test -pl repository -Dtest=AllDBTestsTestSuite -Ddb.driver=com.mysql.jdbc.Driver -Ddb.name=alfresco -Ddb.url=jdbc:mysql://localhost:3307/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
|
||||
- name: "Repository - MySQL 8 tests"
|
||||
if: (branch =~ /(release\/.*$|master)/ AND commit_message !~ /\[skip db\]/ AND type != pull_request) OR commit_message =~ /\[db\]/
|
||||
# We run tests on the latest version of MySQL on pull requests plus the normal master and release branches - ignored on feature branches
|
||||
if: (branch =~ /(release\/.*$|master)/ AND commit_message !~ /\[skip db\]/ ) OR commit_message =~ /\[db\]/ OR commit_message =~ /\[latest db\]/
|
||||
before_script:
|
||||
- docker run -d -p 3307:3306 -e MYSQL_ROOT_PASSWORD=alfresco -e MYSQL_USER=alfresco -e MYSQL_DATABASE=alfresco -e MYSQL_PASSWORD=alfresco mysql:8 --transaction-isolation='READ-COMMITTED'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
|
||||
@@ -172,6 +186,13 @@ jobs:
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
|
||||
script: travis_wait 20 mvn -B test -pl repository -Dtest=AllDBTestsTestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
|
||||
- name: "Repository - PostgreSQL 11.12 tests"
|
||||
if: (branch =~ /(release\/.*$|master)/ AND commit_message !~ /\[skip db\]/ AND type != pull_request) OR commit_message =~ /\[db\]/
|
||||
before_script:
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:11.12 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
|
||||
script: travis_wait 20 mvn -B test -pl repository -Dtest=AllDBTestsTestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
|
||||
- name: "Repository - PostgreSQL 12.4 tests"
|
||||
if: (branch =~ /(release\/.*$|master)/ AND commit_message !~ /\[skip db\]/ AND type != pull_request) OR commit_message =~ /\[db\]/
|
||||
before_script:
|
||||
@@ -179,14 +200,29 @@ jobs:
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
|
||||
script: travis_wait 20 mvn -B test -pl repository -Dtest=AllDBTestsTestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
|
||||
- name: "Repository - PostgreSQL 12.7 tests"
|
||||
if: (branch =~ /(release\/.*$|master)/ AND commit_message !~ /\[skip db\]/ AND type != pull_request) OR commit_message =~ /\[db\]/
|
||||
before_script:
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:12.7 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
|
||||
script: travis_wait 20 mvn -B test -pl repository -Dtest=AllDBTestsTestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
|
||||
- name: "Repository - PostgreSQL 13.1 tests"
|
||||
# We only run DB tests on the latest version of PostgreSQL on feature branches
|
||||
if: commit_message !~ /\[skip db\]/
|
||||
if: (branch =~ /(release\/.*$|master)/ AND commit_message !~ /\[skip db\]/ AND type != pull_request) OR commit_message =~ /\[db\]/
|
||||
before_script:
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.1 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
|
||||
script: travis_wait 20 mvn -B test -pl repository -Dtest=AllDBTestsTestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
|
||||
- name: "Repository - PostgreSQL 13.3 tests"
|
||||
# We only run DB tests on the latest version of PostgreSQL on feature branches
|
||||
if: commit_message !~ /\[skip db\]/ OR commit_message =~ /\[latest db\]/
|
||||
before_script:
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.3 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
|
||||
script: travis_wait 20 mvn -B test -pl repository -Dtest=AllDBTestsTestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
|
||||
- name: "Repository - Messaging tests"
|
||||
if: commit_message !~ /\[skip repo\]/
|
||||
before_script:
|
||||
@@ -196,38 +232,38 @@ jobs:
|
||||
- name: "Remote-api - AppContext01TestSuite"
|
||||
if: commit_message !~ /\[skip repo\]/
|
||||
before_script:
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.1 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.3 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
|
||||
script: travis_wait 20 mvn -B test -pl remote-api -Dtest=AppContext01TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
|
||||
- name: "Remote-api - AppContext02TestSuite"
|
||||
if: commit_message !~ /\[skip repo\]/
|
||||
before_script:
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.1 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.3 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.0
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.3
|
||||
script: travis_wait 20 mvn -B test -pl remote-api -Dtest=AppContext02TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
|
||||
- name: "Remote-api - AppContext03TestSuite"
|
||||
if: commit_message !~ /\[skip repo\]/
|
||||
before_script:
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.1 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.3 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.0
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.3
|
||||
script: travis_wait 20 mvn -B test -pl remote-api -Dtest=AppContext03TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
|
||||
- name: "Remote-api - AppContext04TestSuite"
|
||||
if: commit_message !~ /\[skip repo\]/
|
||||
before_script:
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.1 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.3 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.0
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.3
|
||||
script: travis_wait 20 mvn -B test -pl remote-api -Dtest=AppContext04TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
|
||||
- name: "Remote-api - AppContextExtraTestSuite"
|
||||
if: commit_message !~ /\[skip repo\]/
|
||||
before_script:
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.1 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.3 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
|
||||
script: travis_wait 20 mvn -B test -pl remote-api -Dtest=AppContextExtraTestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
|
||||
@@ -298,7 +334,7 @@ jobs:
|
||||
- name: "Share Services - ShareServicesTestSuite"
|
||||
if: commit_message !~ /\[skip repo\]/
|
||||
before_script:
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.1 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.3 postgres -c 'max_connections=300'
|
||||
script: travis_wait 20 mvn -B test -pl :alfresco-share-services -Dtest=ShareServicesTestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
|
||||
- name: "AGS Unit & Integration Tests 01 (PostgreSQL)"
|
||||
|
74
README.md
74
README.md
@@ -2,13 +2,6 @@
|
||||
|
||||
[](https://travis-ci.com/Alfresco/alfresco-community-repo)
|
||||
|
||||
This project contains the bulk of the [Alfresco Content Services Repository](https://community.alfresco.com/docs/DOC-6385-project-overview-repository) code.
|
||||
|
||||
To make the development process simpler, it brings together code historically in `alfresco-core`,
|
||||
`alfresco-data-madel`, `alfresco-repository`, `alfresco-remote-api` and repository specific
|
||||
tests and war file creation from `acs-community-packaging`. They exist as sub projects within the Maven Reactor and still
|
||||
create the same artifacts.
|
||||
|
||||
#### Alfresco Core
|
||||
|
||||
Alfresco Core is a library packaged as a jar file which contains the following:
|
||||
@@ -16,8 +9,6 @@ Alfresco Core is a library packaged as a jar file which contains the following:
|
||||
* Canned queries interface and supporting classes
|
||||
* Generic encryption supporting classes
|
||||
|
||||
Version 7 of the library uses Spring 5, Quartz 2.3 and does not have Hibernate dependency.
|
||||
|
||||
#### Alfresco Data Model
|
||||
Data model is a library packaged as a jar file which contains the following:
|
||||
* Dictionary, Repository and Search Services interfaces
|
||||
@@ -31,14 +22,6 @@ Repository is a library packaged as a jar file which contains the following:
|
||||
* Various Service implementations
|
||||
* Utility classes
|
||||
|
||||
Tests are combined into test classes split by test type or Spring application context used in the test, see classes
|
||||
in _src/test/java/org/alfresco_. All of these classes as well as individual tests can be run by specifying the test
|
||||
class name and a set of DB connection properties. Check the travis.yml file for docker images that should be started
|
||||
to provide a suitable test environment. For example:
|
||||
~~~
|
||||
mvn clean test -Dtest=SomeRepoTest -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql:alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
~~~
|
||||
|
||||
#### Alfresco Remote API
|
||||
|
||||
Remote API is a library packaged as a jar file which contains the following:
|
||||
@@ -46,13 +29,10 @@ Remote API is a library packaged as a jar file which contains the following:
|
||||
* 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
|
||||
|
||||
Like the `alfresco-repository` tests are combined in test classes split by test type or Spring application context used
|
||||
in the test.
|
||||
|
||||
#### Artifacts
|
||||
The artifacts can be obtained by:
|
||||
* downloading from [Alfresco maven repository](https://artifacts.alfresco.com/nexus/content/groups/public)
|
||||
* getting as Maven dependency by adding the dependency to your pom file:
|
||||
* as Maven dependency by adding the dependency to your pom file:
|
||||
~~~
|
||||
<dependency>
|
||||
<groupId>org.alfresco</groupId>
|
||||
@@ -94,40 +74,24 @@ and Alfresco maven repository:
|
||||
~~~
|
||||
The SNAPSHOT versions of the artifact are not published.
|
||||
|
||||
All current source versions are held in github. Historic versions can be found in [Alfresco SVN](https://svn.alfresco.com/repos/alfresco-open-mirror/services/alfresco-core/)
|
||||
|
||||
### Contributing guide
|
||||
Please use [this guide](CONTRIBUTING.md) to make a contribution to the project.
|
||||
|
||||
## Setting up your development environment
|
||||
Although it is possible to work on individual github projects, we recommend working on the `alfresco-community-repo`
|
||||
and `acs-community-packaging` in a single Intellij IDEA project. They depend on each other and typically you will
|
||||
want to make changes to both of them if you are changing the repository code.
|
||||
|
||||
~~~
|
||||
mkdir work
|
||||
cd work
|
||||
git clone git@github.com:Alfresco/alfresco-community-repo.git
|
||||
git clone git@github.com:Alfresco/acs-community-packaging.git
|
||||
~~~
|
||||
If you wish to build these projects from the command line, use the following commands.
|
||||
~~~
|
||||
cd alfresco-community-repo
|
||||
mvn clean install -Pbuild-docker-images -DskipTests=true -Dversion.edition=Community
|
||||
cd ..
|
||||
|
||||
cd acs-community-packaging
|
||||
mvn clean install -Pbuild-docker-images -Dmaven.javadoc.skip=true
|
||||
cd ..
|
||||
~~~
|
||||
In Intellij IDEA, create a new project using the `work` directory as the source.
|
||||
* File > New Project from Existing Sources > .../work > Maven
|
||||
## Setting up and building your development environment
|
||||
See the [Development Tomcat Environment](https://github.com/Alfresco/acs-community-packaging/tree/master/dev/README.md)
|
||||
page which will show you how to try out your repository changes in a local tomcat instance.
|
||||
If you wish to use Docker images, take a look at the aliases ending in `D` and the docker-compose files in this
|
||||
project's test modules.
|
||||
|
||||
## Branches
|
||||
As multiple projects have been combined, branch names use the ACS version they are targeting.
|
||||
For example the code used to create the repository in ACS 6.2.1 is a branch called `releases/6.2.1`.
|
||||
This project has a branch for each ACS release. For example the code in ACS 6.2.1 is a
|
||||
branch called `releases/6.2.2`. In addition to the original 6.2.2 release it will also contain Hot Fixes
|
||||
added later. The latest unreleased code is on the `master` branch. There are also `.N` branches, such as
|
||||
`releases/7.1.N` on which we gather unreleased fixes for future service pack releases. They do not indicate
|
||||
that one is planned.
|
||||
|
||||
The actual version number of the **repository artifacts** created by `alfresco-community-repo` are however different.
|
||||
For example `release/6.2.1` artifacts are `7.183.x`. This adds some complexity, but ensures that
|
||||
version numbers do not go backwards in existing releases. It also provides some level of
|
||||
independence between the repository and other ACS components.
|
||||
For historic reasons the version of artifacts created on each branch do not match the ACS version.
|
||||
For example artifact in ACS 7.2.0 will be `14.<something>`.
|
||||
|
||||
The enterprise projects which extend the `alfresco-community-repo` use the same branch names and leading
|
||||
artifact version number.
|
||||
|
||||
### Contributing guide
|
||||
Please use [this guide](CONTRIBUTING.md) to make a contribution to the project.
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-amps</artifactId>
|
||||
<version>11.82</version>
|
||||
<version>14.28-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-governance-services-community-parent</artifactId>
|
||||
<version>11.82</version>
|
||||
<version>14.28-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-governance-services-automation-community-repo</artifactId>
|
||||
<version>11.82</version>
|
||||
<version>14.28-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-log4j12</artifactId>
|
||||
<version>1.7.26</version>
|
||||
<version>1.7.32</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@@ -82,7 +82,7 @@
|
||||
<dependency>
|
||||
<groupId>com.github.docker-java</groupId>
|
||||
<artifactId>docker-java</artifactId>
|
||||
<version>3.0.14</version>
|
||||
<version>3.2.12</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
@@ -55,6 +55,7 @@ import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanCo
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_RECORD_SEARCH_DISPOSITION_ACTION_AS_OF;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_RECORD_SEARCH_DISPOSITION_ACTION_NAME;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_RECORD_SEARCH_DISPOSITION_AUTHORITY;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_RECORD_SEARCH_DISPOSITION_EVENTS;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_RECORD_SEARCH_DISPOSITION_EVENTS_ELIGIBLE;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_RECORD_SEARCH_DISPOSITION_INSTRUCTIONS;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_RECORD_SEARCH_DISPOSITION_PERIOD;
|
||||
@@ -248,6 +249,9 @@ public class RecordProperties extends TestModel
|
||||
@JsonProperty (PROPERTIES_RECORD_SEARCH_DISPOSITION_EVENTS_ELIGIBLE)
|
||||
private Boolean recordSearchDispositionEventsEligible;
|
||||
|
||||
@JsonProperty (PROPERTIES_RECORD_SEARCH_DISPOSITION_EVENTS)
|
||||
private List<String> recordSearchDispositionEvents;
|
||||
|
||||
@JsonProperty (PROPERTIES_RECORD_SEARCH_DISPOSITION_INSTRUCTIONS)
|
||||
private String recordSearchDispositionInstructions;
|
||||
|
||||
|
@@ -47,6 +47,7 @@ import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanCo
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_VITAL_RECORD_INDICATOR;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
@@ -134,7 +135,7 @@ public class RecordCategoryChildProperties extends TestModel
|
||||
private String recordSearchDispositionInstructions;
|
||||
|
||||
@JsonProperty (PROPERTIES_RECORD_SEARCH_DISPOSITION_EVENTS)
|
||||
private Boolean recordSearchDispositionEvents;
|
||||
private List<String> recordSearchDispositionEvents;
|
||||
|
||||
@JsonProperty (PROPERTIES_OWNER)
|
||||
private Owner owner;
|
||||
|
@@ -0,0 +1,103 @@
|
||||
/*
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 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. 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.v0;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.alfresco.rest.core.v0.BaseAPI;
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* Methods to make API requests using v0 API for Exporting Items
|
||||
*
|
||||
* @author Shubham Jain
|
||||
* @since 7.1.0
|
||||
*/
|
||||
|
||||
@Component
|
||||
public class ExportAPI extends BaseAPI
|
||||
{
|
||||
/**
|
||||
* The URI to export an item
|
||||
*/
|
||||
private static final String EXPORT_API = "{0}rma/admin/export";
|
||||
|
||||
/**
|
||||
* Export a single Record/Record Folder/Record Category using V0 Export API
|
||||
*
|
||||
* @param user User performing the export
|
||||
* @param password User's Password
|
||||
* @param expectedStatusCode Expected Response Code
|
||||
* @param nodeID ID of the Node(Record/RecordFolder) to be exported
|
||||
* @return HTTP Response
|
||||
*/
|
||||
public HttpResponse exportRMNode(String user, String password, int expectedStatusCode, String nodeID)
|
||||
{
|
||||
return export(user, password, expectedStatusCode, Collections.singletonList(getNodeRefSpacesStore() + nodeID));
|
||||
}
|
||||
|
||||
/**
|
||||
* Export a list of nodes using V0 Export API
|
||||
*
|
||||
* @param user User performing the export
|
||||
* @param password User's Password
|
||||
* @param expectedStatusCode Expected Response Code
|
||||
* @param nodeIDList List of the nodes to be exported
|
||||
* @return HTTP Response
|
||||
*/
|
||||
public HttpResponse exportRMNodes(String user, String password, int expectedStatusCode, List<String> nodeIDList)
|
||||
{
|
||||
|
||||
List<String> nodeRefs =
|
||||
nodeIDList.stream().map(nodeID -> getNodeRefSpacesStore() + nodeID).collect(Collectors.toList());
|
||||
|
||||
return export(user, password, expectedStatusCode, nodeRefs);
|
||||
}
|
||||
|
||||
/**
|
||||
* Export API function to perform Export Operation on items with given noderefs using V0 Export Rest API
|
||||
*
|
||||
* @param user User performing the export
|
||||
* @param password User's Password
|
||||
* @param expectedStatusCode Expected Response Code
|
||||
* @param nodeRefs list of the noderefs for the items to be exported
|
||||
* @return Rest API Post Request
|
||||
*/
|
||||
public HttpResponse export(String user, String password, int expectedStatusCode, List<String> nodeRefs)
|
||||
{
|
||||
final JSONObject requestParams = new JSONObject();
|
||||
|
||||
requestParams.put("nodeRefs", new JSONArray(nodeRefs));
|
||||
|
||||
return doPostJsonRequest(user, password, expectedStatusCode, requestParams, EXPORT_API);
|
||||
}
|
||||
}
|
@@ -619,11 +619,27 @@ public class BaseRMRestTest extends RestTest
|
||||
* @return
|
||||
*/
|
||||
public List<String> searchForContentAsUser(UserModel user, String term)
|
||||
{
|
||||
String query = "cm:name:*" + term + "*";
|
||||
return searchForContentAsUser(user,query,"afts");
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns search results for the given search term
|
||||
*
|
||||
* @param user
|
||||
* @param term
|
||||
* @param query language
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<String> searchForContentAsUser(UserModel user, String q, String queryLanguage)
|
||||
{
|
||||
getRestAPIFactory().getRmRestWrapper().authenticateUser(user);
|
||||
RestRequestQueryModel queryReq = new RestRequestQueryModel();
|
||||
SearchRequest query = new SearchRequest(queryReq);
|
||||
queryReq.setQuery("cm:name:*" + term + "*");
|
||||
queryReq.setQuery(q);
|
||||
queryReq.setLanguage(queryLanguage);
|
||||
|
||||
List<String> names = new ArrayList<>();
|
||||
// wait for solr indexing
|
||||
|
@@ -67,7 +67,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.testng.annotations.AfterClass;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import static org.apache.commons.httpclient.HttpStatus.SC_INTERNAL_SERVER_ERROR;
|
||||
/**
|
||||
* API tests to check actions on frozen content
|
||||
*
|
||||
@@ -309,11 +309,11 @@ public class PreventActionsOnFrozenContentTests extends BaseRMRestTest
|
||||
|
||||
STEP("Execute the retain action");
|
||||
rmRolesAndActionsAPI.executeAction(getAdminUser().getUsername(), getAdminUser().getPassword(), record.getName(),
|
||||
RM_ACTIONS.END_RETENTION);
|
||||
RM_ACTIONS.END_RETENTION, null, SC_INTERNAL_SERVER_ERROR);
|
||||
|
||||
STEP("Check the record search disposition properties");
|
||||
Record recordUpdated = getRestAPIFactory().getRecordsAPI().getRecord(record.getId());
|
||||
assertTrue(recordUpdated.getProperties().getRecordSearchDispositionActionName().contains(RM_ACTIONS.DESTROY.getAction()));
|
||||
assertTrue(recordUpdated.getProperties().getRecordSearchDispositionActionName().contains(RM_ACTIONS.END_RETENTION.getAction()));
|
||||
assertTrue(recordUpdated.getProperties().getRecordSearchDispositionPeriod().contains("immediately"));
|
||||
}
|
||||
|
||||
|
@@ -0,0 +1,268 @@
|
||||
/*-
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 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. 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.recordcategories;
|
||||
|
||||
import static org.alfresco.rest.rm.community.model.recordcategory.RetentionPeriodProperty.CREATED_DATE;
|
||||
import static org.alfresco.rest.rm.community.model.recordcategory.RetentionPeriodProperty.CUT_OFF_DATE;
|
||||
import static org.alfresco.rest.rm.community.model.recordcategory.RetentionPeriodProperty.DATE_FILED;
|
||||
import static org.alfresco.rest.rm.community.utils.CoreUtil.createBodyForMoveCopy;
|
||||
import static org.alfresco.rest.rm.community.utils.CoreUtil.toContentModel;
|
||||
import static org.alfresco.utility.data.RandomData.getRandomName;
|
||||
import static org.alfresco.utility.report.log.Step.STEP;
|
||||
import static org.springframework.http.HttpStatus.OK;
|
||||
import static org.testng.Assert.assertFalse;
|
||||
import static org.testng.Assert.assertTrue;
|
||||
|
||||
import org.alfresco.rest.core.v0.BaseAPI.RM_ACTIONS;
|
||||
import org.alfresco.rest.core.v0.RMEvents;
|
||||
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.v0.service.DispositionScheduleService;
|
||||
import org.alfresco.test.AlfrescoTest;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.testng.annotations.AfterMethod;
|
||||
import org.testng.annotations.BeforeMethod;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/**
|
||||
* Tests for moving record categories between record categories with different retention schedule
|
||||
*/
|
||||
public class MoveRecCategoriesWithRSTests extends BaseRMRestTest
|
||||
{
|
||||
private RecordCategory rootCategory, rootCategory2;
|
||||
private Record elRecord, nonElRecord;
|
||||
@Autowired
|
||||
private DispositionScheduleService dispositionScheduleService;
|
||||
|
||||
/**
|
||||
* Create two root categories with some retention schedules on record level
|
||||
*/
|
||||
@BeforeMethod
|
||||
private void setUpMoveRecCategoriesWithRSTests()
|
||||
{
|
||||
STEP("Create record category with retention schedule and apply it to records.");
|
||||
rootCategory = createRootCategory(getRandomName("rootCategory1"));
|
||||
dispositionScheduleService.createCategoryRetentionSchedule(rootCategory.getName(), true);
|
||||
|
||||
STEP("Create record category with retention schedule and apply it to records.");
|
||||
rootCategory2 = createRootCategory(getRandomName("rootCategory2"));
|
||||
dispositionScheduleService.createCategoryRetentionSchedule(rootCategory2.getName(), true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Given following structure is created:
|
||||
* rootCategory1 with RS applied on record level with cut off and destroy after 1 day
|
||||
* - subCategory1 without RS
|
||||
* - recFolder
|
||||
* - incomplete electronic record
|
||||
* - complete non-electronic record
|
||||
* rootCategory2 with RS with retain and destroy both after 2 day
|
||||
* When moving subcategory1 within rootCategory2
|
||||
* Then the records will inherit the RS from rootCategory2
|
||||
*/
|
||||
@Test
|
||||
@AlfrescoTest (jira = "APPS-1005")
|
||||
public void testInheritWhenMoveToDifferentRSStep() throws Exception
|
||||
{
|
||||
STEP("Add retention schedule cut off step after 1 day period.");
|
||||
dispositionScheduleService.addCutOffAfterPeriodStep(rootCategory.getName(), "day|1", CREATED_DATE);
|
||||
|
||||
STEP("Add retention schedule destroy step after 1 Day period.");
|
||||
dispositionScheduleService.addDestroyWithGhostingAfterPeriodStep(rootCategory.getName(), "day|1", CUT_OFF_DATE);
|
||||
|
||||
STEP("Create a subcategory with a record folder and records.");
|
||||
RecordCategoryChild subCategory = createSubCategoryWithRecords();
|
||||
|
||||
STEP("Add retention schedule retain step after 2 day period.");
|
||||
dispositionScheduleService.addRetainAfterPeriodStep(rootCategory2.getName(), "day|2");
|
||||
|
||||
STEP("Add retention schedule destroy step after 2 Day period.");
|
||||
dispositionScheduleService.addDestroyWithGhostingAfterPeriodStep(rootCategory2.getName(), "day|2", DATE_FILED);
|
||||
|
||||
STEP("Move the subcategory within the rootCategory2.");
|
||||
getRestAPIFactory().getNodeAPI(toContentModel(subCategory.getId())).move(createBodyForMoveCopy(rootCategory2.getId()));
|
||||
assertStatusCode(OK);
|
||||
|
||||
STEP("Check that both records inherit rootCategory2 retention schedule");
|
||||
elRecord = getRestAPIFactory().getRecordsAPI().getRecord(elRecord.getId());
|
||||
nonElRecord = getRestAPIFactory().getRecordsAPI().getRecord(nonElRecord.getId());
|
||||
assertTrue(elRecord.getProperties().getRecordSearchDispositionActionName().equalsIgnoreCase(RM_ACTIONS.END_RETENTION.getAction()),
|
||||
"Disposition action should be retain");
|
||||
assertTrue(elRecord.getProperties().getRecordSearchDispositionPeriod().equalsIgnoreCase("day"),
|
||||
"Disposition period property should be day");
|
||||
assertTrue(elRecord.getProperties().getRecordSearchDispositionPeriodExpression().equalsIgnoreCase("2"),
|
||||
"Disposition period expression should be 2");
|
||||
assertTrue(nonElRecord.getProperties().getRecordSearchDispositionActionName().equalsIgnoreCase(RM_ACTIONS.END_RETENTION.getAction()),
|
||||
"Disposition action should be retain");
|
||||
assertTrue(nonElRecord.getProperties().getRecordSearchDispositionPeriod().equalsIgnoreCase("day"),
|
||||
"Disposition period property should be day");
|
||||
assertTrue(nonElRecord.getProperties().getRecordSearchDispositionPeriodExpression().equalsIgnoreCase("2"),
|
||||
"Disposition period expression should be 2");
|
||||
}
|
||||
|
||||
/**
|
||||
* Given following structure is created:
|
||||
* rootCategory1 with RS applied on record level with retain and destroy after 1 day
|
||||
* - subCategory without RS
|
||||
* - recFolder
|
||||
* - incomplete electronic record
|
||||
* - complete non-electronic record
|
||||
* rootCategory2 with RS with cut off on event case closed and destroy both after 2 day
|
||||
* When moving subcategory within rootCategory2
|
||||
* Then the records will inherit the RS from rootCategory2
|
||||
*/
|
||||
@Test
|
||||
@AlfrescoTest (jira = "APPS-1004")
|
||||
public void testInheritWhenMoveToDifferentRSStepOnEventBase() throws Exception
|
||||
{
|
||||
STEP("Add retention schedule retain step after 1 day period.");
|
||||
dispositionScheduleService.addRetainAfterPeriodStep(rootCategory.getName(), "day|1");
|
||||
|
||||
STEP("Add retention schedule destroy step after 1 Day period.");
|
||||
dispositionScheduleService.addDestroyWithGhostingAfterPeriodStep(rootCategory.getName(), "day|1", CUT_OFF_DATE);
|
||||
|
||||
STEP("Create a subcategory with a record folder and records.");
|
||||
RecordCategoryChild subCategory = createSubCategoryWithRecords();
|
||||
|
||||
STEP("Add retention schedule cut off step on event case closed.");
|
||||
dispositionScheduleService.addCutOffAfterEventStep(rootCategory2.getName(), RMEvents.CASE_CLOSED.getEventName());
|
||||
|
||||
STEP("Add retention schedule destroy step after 1 Day period.");
|
||||
dispositionScheduleService.addDestroyWithGhostingAfterPeriodStep(rootCategory2.getName(), "day|2", DATE_FILED);
|
||||
|
||||
STEP("Move the subcategory within the rootCategory2.");
|
||||
getRestAPIFactory().getNodeAPI(toContentModel(subCategory.getId())).move(createBodyForMoveCopy(rootCategory2.getId()));
|
||||
assertStatusCode(OK);
|
||||
|
||||
STEP("Check that both records inherit rootCategory2 retention schedule");
|
||||
elRecord = getRestAPIFactory().getRecordsAPI().getRecord(elRecord.getId());
|
||||
nonElRecord = getRestAPIFactory().getRecordsAPI().getRecord(nonElRecord.getId());
|
||||
assertTrue(elRecord.getProperties().getRecordSearchDispositionActionName().equalsIgnoreCase(RM_ACTIONS.CUT_OFF.getAction()),
|
||||
"Disposition action should be cut off");
|
||||
assertTrue(elRecord.getProperties().getRecordSearchDispositionPeriod().equalsIgnoreCase("none"),
|
||||
"Disposition period property should none");
|
||||
assertTrue(elRecord.getProperties().getRecordSearchDispositionPeriodExpression().equalsIgnoreCase("0"),
|
||||
"Disposition period expression should be 0");
|
||||
assertTrue(elRecord.getProperties().getRecordSearchDispositionEvents().contains(RMEvents.CASE_CLOSED.getEventName()),
|
||||
"Disposition event list doesn't contain case closed event");
|
||||
assertTrue(nonElRecord.getProperties().getRecordSearchDispositionActionName().equalsIgnoreCase(RM_ACTIONS.CUT_OFF.getAction()),
|
||||
"Disposition action should be cut off");
|
||||
assertTrue(nonElRecord.getProperties().getRecordSearchDispositionPeriod().equalsIgnoreCase("none"),
|
||||
"Disposition period property should be none");
|
||||
assertTrue(nonElRecord.getProperties().getRecordSearchDispositionPeriodExpression().equalsIgnoreCase("0"),
|
||||
"Disposition period expression should be 0");
|
||||
assertTrue(nonElRecord.getProperties().getRecordSearchDispositionEvents().contains(RMEvents.CASE_CLOSED.getEventName()),
|
||||
"Disposition event list doesn't contain case closed event");
|
||||
}
|
||||
|
||||
/**
|
||||
* Given following structure is created:
|
||||
* rootCategory1 with RS applied on record level with cut off on event case closed and destroy after 1 day
|
||||
* - subCategory2 without RS
|
||||
* - recFolder
|
||||
* - incomplete electronic record
|
||||
* - complete non-electronic record
|
||||
* rootCategory2 with cut off on event Obsolete and destroy both after 2 day
|
||||
* When moving subcategory2 within rootCategory2
|
||||
* Then the records will inherit the RS from rootCategory2
|
||||
*/
|
||||
@Test
|
||||
@AlfrescoTest (jira = "APPS-1004")
|
||||
public void testInheritWhenMoveToSameStepDifferentEvent() throws Exception
|
||||
{
|
||||
STEP("Add retention schedule cut off on case closed.");
|
||||
dispositionScheduleService.addCutOffAfterEventStep(rootCategory.getName(), RMEvents.CASE_CLOSED.getEventName());
|
||||
|
||||
STEP("Add retention schedule destroy step after 1 Day period.");
|
||||
dispositionScheduleService.addDestroyWithGhostingAfterPeriodStep(rootCategory.getName(), "day|1", CUT_OFF_DATE);
|
||||
|
||||
STEP("Create a subcategory with a record folder and records.");
|
||||
RecordCategoryChild subCategory = createSubCategoryWithRecords();
|
||||
|
||||
STEP("Add retention schedule cut off step on event separation.");
|
||||
dispositionScheduleService.addCutOffAfterEventStep(rootCategory2.getName(), RMEvents.OBSOLETE.getEventName());
|
||||
|
||||
STEP("Add retention schedule destroy step after 2 Day period.");
|
||||
dispositionScheduleService.addDestroyWithGhostingAfterPeriodStep(rootCategory2.getName(), "day|2", DATE_FILED);
|
||||
|
||||
STEP("Move the subcategory within the rootCategory2.");
|
||||
getRestAPIFactory().getNodeAPI(toContentModel(subCategory.getId())).move(createBodyForMoveCopy(rootCategory2.getId()));
|
||||
assertStatusCode(OK);
|
||||
|
||||
STEP("Check that both records inherit rootCategory2 retention schedule");
|
||||
elRecord = getRestAPIFactory().getRecordsAPI().getRecord(elRecord.getId());
|
||||
nonElRecord = getRestAPIFactory().getRecordsAPI().getRecord(nonElRecord.getId());
|
||||
assertTrue(elRecord.getProperties().getRecordSearchDispositionActionName().equalsIgnoreCase(RM_ACTIONS.CUT_OFF.getAction()),
|
||||
"Disposition action should be cut off");
|
||||
assertTrue(elRecord.getProperties().getRecordSearchDispositionPeriod().equalsIgnoreCase("none"),
|
||||
"Disposition period property should be none");
|
||||
assertTrue(elRecord.getProperties().getRecordSearchDispositionPeriodExpression().equalsIgnoreCase("0"),
|
||||
"Disposition period expression should be 0");
|
||||
assertFalse(elRecord.getProperties().getRecordSearchDispositionEvents().contains(RMEvents.CASE_CLOSED.getEventName()),
|
||||
"Event list contain the event from the previous RS ");
|
||||
assertTrue(elRecord.getProperties().getRecordSearchDispositionEvents().contains(RMEvents.OBSOLETE.getEventName()),
|
||||
"Event list doesn't contain the event from the current RS ");
|
||||
assertTrue(nonElRecord.getProperties().getRecordSearchDispositionActionName().equalsIgnoreCase(RM_ACTIONS.CUT_OFF.getAction()),
|
||||
"Disposition action should be cut off");
|
||||
assertTrue(nonElRecord.getProperties().getRecordSearchDispositionPeriod().equalsIgnoreCase("none"),
|
||||
"Disposition period property should be none");
|
||||
assertTrue(nonElRecord.getProperties().getRecordSearchDispositionPeriodExpression().equalsIgnoreCase("0"),
|
||||
"Disposition period expression should be 0");
|
||||
assertFalse(nonElRecord.getProperties().getRecordSearchDispositionEvents().contains(RMEvents.CASE_CLOSED.getEventName()),
|
||||
"Event list contain the event from the previous RS ");
|
||||
assertTrue(nonElRecord.getProperties().getRecordSearchDispositionEvents().contains(RMEvents.OBSOLETE.getEventName()),
|
||||
"Event list doesn't contain the event from the current RS ");
|
||||
}
|
||||
|
||||
@AfterMethod (alwaysRun = true)
|
||||
public void cleanupMoveRecCategoriesWithRSTests()
|
||||
{
|
||||
getRestAPIFactory().getRecordCategoryAPI().deleteRecordCategory(rootCategory.getId());
|
||||
getRestAPIFactory().getRecordCategoryAPI().deleteRecordCategory(rootCategory2.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method to create a sub-category with a folder, an incomplete electronic record and a complete
|
||||
* electronic record
|
||||
* @return
|
||||
*/
|
||||
private RecordCategoryChild createSubCategoryWithRecords()
|
||||
{
|
||||
STEP("Create a subcategory with a record folder");
|
||||
RecordCategoryChild subCategory = createRecordCategory(rootCategory.getId(), getRandomName("subCategory"));
|
||||
RecordCategoryChild recFolder = createFolder(subCategory.getId(), getRandomName("recFolder"));
|
||||
|
||||
STEP("Create 2 records in the record folder. Complete one of them.");
|
||||
elRecord = createElectronicRecord(recFolder.getId(), getRandomName("elRecord"));
|
||||
nonElRecord = createNonElectronicRecord(recFolder.getId(), getRandomName("nonElRecord"));
|
||||
getRestAPIFactory().getRecordsAPI().completeRecord(nonElRecord.getId());
|
||||
return subCategory;
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,136 @@
|
||||
/*
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 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. 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.records;
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.CONTENT_TYPE;
|
||||
import static org.alfresco.rest.rm.community.utils.FilePlanComponentsUtil.createTempFile;
|
||||
import static org.alfresco.utility.data.RandomData.getRandomName;
|
||||
import static org.alfresco.utility.report.log.Step.STEP;
|
||||
import static org.apache.http.HttpStatus.SC_OK;
|
||||
|
||||
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.v0.ExportAPI;
|
||||
import org.alfresco.test.AlfrescoTest;
|
||||
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;
|
||||
|
||||
/**
|
||||
* This class contains tests for testing the Export functionality on RM site
|
||||
*
|
||||
* @author Shubham Jain
|
||||
* @since 7.1.0
|
||||
*/
|
||||
public class ExportRecordsTests extends BaseRMRestTest
|
||||
{
|
||||
private RecordCategory rootCategory;
|
||||
|
||||
private RecordCategoryChild recordFolder;
|
||||
|
||||
@Autowired
|
||||
private ExportAPI exportAPI;
|
||||
|
||||
@BeforeClass (alwaysRun = true)
|
||||
public void exportRecordsTestsBeforeClass()
|
||||
{
|
||||
STEP("Create root level category");
|
||||
rootCategory = createRootCategory(getRandomName("Category"));
|
||||
|
||||
STEP("Create the record folder inside the rootCategory");
|
||||
recordFolder = createRecordFolder(rootCategory.getId(), getRandomName("Folder"));
|
||||
|
||||
}
|
||||
|
||||
@DataProvider (name = "CreateRMNodes")
|
||||
public Object[][] getRMNodeID()
|
||||
{
|
||||
return new String[][] {
|
||||
{ createRecord("Record_4MB", 4).getId() },
|
||||
{ createRecord("Record_200MB", 200).getId() },
|
||||
{ recordFolder.getId() }
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a record with size > 4 MB
|
||||
* When I export the record using API
|
||||
* Then the request is successful
|
||||
*/
|
||||
@Test (description = "Testing the RM Export functionality for records of size >4MB and Record " +
|
||||
"Folder containing records with size >4MB",
|
||||
dataProvider = "CreateRMNodes")
|
||||
@AlfrescoTest (jira = "APPS-986")
|
||||
public void exportRMNodeTest(String nodeID)
|
||||
{
|
||||
STEP("Export the created record/record folder with size greater than 4 MB and verifying the expected response" +
|
||||
" code");
|
||||
exportAPI.exportRMNode(getAdminUser().getUsername(), getAdminUser().getPassword(), SC_OK, nodeID);
|
||||
}
|
||||
|
||||
/**
|
||||
* I would change this to
|
||||
* Given a list of records with a size > 4MB
|
||||
* When I export the records
|
||||
* Then the request is succesfull
|
||||
*/
|
||||
@Test (description = "Testing the RM Export functionality using API for a list of Records at once with " +
|
||||
"collective size of more than 4MB")
|
||||
public void exportRecordsTest()
|
||||
{
|
||||
STEP("Export all the created records at once and verifying the expected response code");
|
||||
exportAPI.exportRMNodes(getAdminUser().getUsername(), getAdminUser().getPassword(),
|
||||
SC_OK, asList(createRecord("Record_2MB", 2).getId(), createRecord("Record_3MB", 3).getId()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Record with a specific size in RM Site inside already created Record Folder
|
||||
*
|
||||
* @param recordName Name of the record to be created
|
||||
* @param sizeInMegaBytes Size of the record to be created in MegaBytes
|
||||
* @return Created record with defined size
|
||||
*/
|
||||
public Record createRecord(String recordName, int sizeInMegaBytes)
|
||||
{
|
||||
return getRestAPIFactory().getRecordFolderAPI().createRecord(Record.builder().name(recordName)
|
||||
.nodeType(CONTENT_TYPE).build(), recordFolder.getId(),
|
||||
createTempFile("TempFile", sizeInMegaBytes));
|
||||
}
|
||||
|
||||
@AfterClass (alwaysRun = true)
|
||||
public void exportRecordsTestsAfter()
|
||||
{
|
||||
STEP("Delete the created rootCategory along with corresponding record folders/records present in it");
|
||||
getRestAPIFactory().getRecordCategoryAPI().deleteRecordCategory(rootCategory.getId());
|
||||
}
|
||||
}
|
@@ -41,6 +41,7 @@ import static org.testng.Assert.assertTrue;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.io.RandomAccessFile;
|
||||
|
||||
import org.alfresco.rest.rm.community.model.record.Record;
|
||||
import org.alfresco.rest.rm.community.model.record.RecordProperties;
|
||||
@@ -66,13 +67,19 @@ public class FilePlanComponentsUtil
|
||||
// Intentionally blank
|
||||
}
|
||||
|
||||
/** Name of the image resource file to be used for records body */
|
||||
/**
|
||||
* Name of the image resource file to be used for records body
|
||||
*/
|
||||
public static final String IMAGE_FILE = "money.JPG";
|
||||
|
||||
/** Title prefix for record category children */
|
||||
/**
|
||||
* Title prefix for record category children
|
||||
*/
|
||||
public static final String TITLE_PREFIX = "Title for ";
|
||||
|
||||
/** Description prefix for record category children */
|
||||
/**
|
||||
* Description prefix for record category children
|
||||
*/
|
||||
public static final String DESCRIPTION_PREFIX = "This is the description for";
|
||||
|
||||
|
||||
@@ -87,7 +94,7 @@ public class FilePlanComponentsUtil
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a record model with the given type and a random name (with "Record " prefix)
|
||||
* Creates a record model with the given type and a random name (with "Record " prefix)
|
||||
*
|
||||
* @param nodeType The node type
|
||||
* @return The {@link Record} with for the given node type
|
||||
@@ -95,9 +102,9 @@ public class FilePlanComponentsUtil
|
||||
private static Record createRecordModel(String nodeType)
|
||||
{
|
||||
return Record.builder()
|
||||
.name("Record " + getRandomAlphanumeric())
|
||||
.nodeType(nodeType)
|
||||
.build();
|
||||
.name("Record " + getRandomAlphanumeric())
|
||||
.nodeType(nodeType)
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -133,22 +140,22 @@ public class FilePlanComponentsUtil
|
||||
/**
|
||||
* Creates an unfiled records container child record model with the given name and type
|
||||
*
|
||||
* @param name The name of the unfiled records container child
|
||||
* @param name The name of the unfiled records container child
|
||||
* @param nodeType The type of the record category child
|
||||
* @return The {@link UnfiledContainerChild} with the given details
|
||||
*/
|
||||
public static UnfiledContainerChild createUnfiledContainerChildRecordModel(String name, String nodeType)
|
||||
{
|
||||
return UnfiledContainerChild.builder()
|
||||
.name(name)
|
||||
.nodeType(nodeType)
|
||||
.build();
|
||||
.name(name)
|
||||
.nodeType(nodeType)
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a nonElectronic container child record model with all available properties for the non electronic records
|
||||
*
|
||||
* @param name The name of the unfiled records container child
|
||||
* @param name The name of the unfiled records container child
|
||||
* @param nodeType The type of the record category child
|
||||
* @return The {@link UnfiledContainerChild} with the given details
|
||||
*/
|
||||
@@ -156,19 +163,19 @@ public class FilePlanComponentsUtil
|
||||
String shelf, String storageLocation, Integer numberOfCopies, Integer physicalSize)
|
||||
{
|
||||
return UnfiledContainerChild.builder()
|
||||
.name(name)
|
||||
.nodeType(NON_ELECTRONIC_RECORD_TYPE)
|
||||
.properties(UnfiledContainerChildProperties.builder()
|
||||
.title(title)
|
||||
.description(description)
|
||||
.box(box)
|
||||
.file(file)
|
||||
.shelf(shelf)
|
||||
.storageLocation(storageLocation)
|
||||
.numberOfCopies(numberOfCopies)
|
||||
.physicalSize(physicalSize)
|
||||
.build())
|
||||
.build();
|
||||
.name(name)
|
||||
.nodeType(NON_ELECTRONIC_RECORD_TYPE)
|
||||
.properties(UnfiledContainerChildProperties.builder()
|
||||
.title(title)
|
||||
.description(description)
|
||||
.box(box)
|
||||
.file(file)
|
||||
.shelf(shelf)
|
||||
.storageLocation(storageLocation)
|
||||
.numberOfCopies(numberOfCopies)
|
||||
.physicalSize(physicalSize)
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -190,110 +197,110 @@ public class FilePlanComponentsUtil
|
||||
String shelf, String storageLocation, Integer numberOfCopies, Integer physicalSize)
|
||||
{
|
||||
return Record.builder()
|
||||
.name(name)
|
||||
.nodeType(NON_ELECTRONIC_RECORD_TYPE)
|
||||
.properties(RecordProperties.builder()
|
||||
.title(title)
|
||||
.description(description)
|
||||
.box(box)
|
||||
.file(file)
|
||||
.shelf(shelf)
|
||||
.storageLocation(storageLocation)
|
||||
.numberOfCopies(numberOfCopies)
|
||||
.physicalSize(physicalSize)
|
||||
.build())
|
||||
.build();
|
||||
.name(name)
|
||||
.nodeType(NON_ELECTRONIC_RECORD_TYPE)
|
||||
.properties(RecordProperties.builder()
|
||||
.title(title)
|
||||
.description(description)
|
||||
.box(box)
|
||||
.file(file)
|
||||
.shelf(shelf)
|
||||
.storageLocation(storageLocation)
|
||||
.numberOfCopies(numberOfCopies)
|
||||
.physicalSize(physicalSize)
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a record model with the given name, description and title
|
||||
*
|
||||
* @param name The name of the record
|
||||
* @param name The name of the record
|
||||
* @param description The description of the record
|
||||
* @param title The title of the record
|
||||
* @param title The title of the record
|
||||
* @return The {@link Record} with the given details
|
||||
*/
|
||||
public static Record createRecordModel(String name, String description, String title)
|
||||
{
|
||||
return Record.builder()
|
||||
.name(name)
|
||||
.properties(RecordProperties.builder()
|
||||
.description(description)
|
||||
.title(title)
|
||||
.build())
|
||||
.build();
|
||||
.name(name)
|
||||
.properties(RecordProperties.builder()
|
||||
.description(description)
|
||||
.title(title)
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a record category child model with the given name and type
|
||||
*
|
||||
* @param name The name of the record category child
|
||||
* @param name The name of the record category child
|
||||
* @param nodeType The type of the record category child
|
||||
* @return The {@link RecordCategoryChild} with the given details
|
||||
*/
|
||||
public static RecordCategoryChild createRecordCategoryChildModel(String name, String nodeType)
|
||||
{
|
||||
return RecordCategoryChild.builder()
|
||||
.name(name)
|
||||
.nodeType(nodeType)
|
||||
.properties(RecordCategoryChildProperties.builder()
|
||||
.title(TITLE_PREFIX + name)
|
||||
.build())
|
||||
.build();
|
||||
.name(name)
|
||||
.nodeType(nodeType)
|
||||
.properties(RecordCategoryChildProperties.builder()
|
||||
.title(TITLE_PREFIX + name)
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a record category model with the given name and title
|
||||
*
|
||||
* @param name The name of the record category
|
||||
* @param name The name of the record category
|
||||
* @param title The title of the record category
|
||||
* @return The {@link RecordCategory} with the given details
|
||||
*/
|
||||
public static RecordCategory createRecordCategoryModel(String name, String title)
|
||||
{
|
||||
return RecordCategory.builder()
|
||||
.name(name)
|
||||
.nodeType(RECORD_CATEGORY_TYPE)
|
||||
.properties(RecordCategoryProperties.builder()
|
||||
.title(title)
|
||||
.build())
|
||||
.build();
|
||||
.name(name)
|
||||
.nodeType(RECORD_CATEGORY_TYPE)
|
||||
.properties(RecordCategoryProperties.builder()
|
||||
.title(title)
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a record folder model with the given name and title
|
||||
*
|
||||
* @param name The name of the record folder
|
||||
* @param name The name of the record folder
|
||||
* @param title The title of the record folder
|
||||
* @return The {@link RecordFolder} with the given details
|
||||
*/
|
||||
public static RecordFolder createRecordFolderModel(String name, String title)
|
||||
{
|
||||
return RecordFolder.builder()
|
||||
.name(name)
|
||||
.nodeType(RECORD_FOLDER_TYPE)
|
||||
.properties(RecordFolderProperties.builder()
|
||||
.title(title)
|
||||
.build())
|
||||
.build();
|
||||
.name(name)
|
||||
.nodeType(RECORD_FOLDER_TYPE)
|
||||
.properties(RecordFolderProperties.builder()
|
||||
.title(title)
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an unfiled records container child model with the given name and type
|
||||
*
|
||||
* @param name The name of the unfiled records container child
|
||||
* @param name The name of the unfiled records container child
|
||||
* @param nodeType The type of the record category child
|
||||
* @return The {@link UnfiledContainerChild} with the given details
|
||||
*/
|
||||
public static UnfiledContainerChild createUnfiledContainerChildModel(String name, String nodeType)
|
||||
{
|
||||
return UnfiledContainerChild.builder()
|
||||
.name(name)
|
||||
.nodeType(nodeType)
|
||||
.properties(UnfiledContainerChildProperties.builder()
|
||||
.title(TITLE_PREFIX + name)
|
||||
.build())
|
||||
.build();
|
||||
.name(name)
|
||||
.nodeType(nodeType)
|
||||
.properties(UnfiledContainerChildProperties.builder()
|
||||
.title(TITLE_PREFIX + name)
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -324,6 +331,32 @@ public class FilePlanComponentsUtil
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to create a temporary file with specific size
|
||||
*
|
||||
* @param name file name
|
||||
* @param sizeInMegaBytes size
|
||||
* @return temporary file
|
||||
*/
|
||||
public static File createTempFile(final String name, long sizeInMegaBytes)
|
||||
{
|
||||
try
|
||||
{
|
||||
// Create file
|
||||
final File file = File.createTempFile(name, ".txt");
|
||||
|
||||
RandomAccessFile raf = new RandomAccessFile(file, "rw");
|
||||
raf.setLength(sizeInMegaBytes * 1024 * 1024);
|
||||
raf.close();
|
||||
|
||||
return file;
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
throw new RuntimeException("Unable to create test file.", exception);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method to verify all properties of a nonElectronic record
|
||||
*
|
||||
|
@@ -0,0 +1,89 @@
|
||||
# dataprep related
|
||||
alfresco.scheme=http
|
||||
alfresco.server=localhost
|
||||
alfresco.port=8082
|
||||
|
||||
# sync service related
|
||||
sync.scheme=http
|
||||
sync.server=localhost
|
||||
sync.port=9090
|
||||
|
||||
# Solr Server Settings
|
||||
solr.scheme=http
|
||||
solr.server=localhost
|
||||
solr.port=8083
|
||||
|
||||
#Solr Indexing Time
|
||||
solrWaitTimeInSeconds=20
|
||||
|
||||
# credentials
|
||||
admin.user=admin
|
||||
admin.password=admin
|
||||
|
||||
# Identity Service configuration
|
||||
# set this property to run tests using AIS
|
||||
# identity-service.auth-server-url=http://localhost:8999/auth
|
||||
|
||||
# in containers we cannot access directly JMX, so we will use http://jolokia.org agent
|
||||
# disabling this we will use direct JMX calls to server
|
||||
jmx.useJolokiaAgent=false
|
||||
|
||||
# Server Health section
|
||||
# in ServerHealth#isServerReachable() - could also be shown.
|
||||
# enable this option to view if on server there are tenants or not
|
||||
serverHealth.showTenants=false
|
||||
|
||||
# TEST MANAGEMENT SECTION - Test Rail
|
||||
#
|
||||
# (currently supporting Test Rail v5.2.1.3472 integration)
|
||||
#
|
||||
# Example of configuration:
|
||||
# ------------------------------------------------------
|
||||
# if testManagement.enabled=true we enabled TestRailExecutorListener (if used in your suite xml file)
|
||||
# testManagement.updateTestExecutionResultsOnly=true (this will just update the results of a test: no step will be updated - good for performance)
|
||||
# testManagement.endPoint=https://alfresco.testrail.com/
|
||||
# testManagement.username=<username>
|
||||
# testManagement.apiKey=<api-key>
|
||||
# testManagement.project=<id-of-your-project
|
||||
# testManagement.testRun=<test-run-name>
|
||||
# testManagement.includeOnlyTestCasesExecuted=true #if you want to include in your run ONLY the test cases that you run, then set this value to false
|
||||
# testManagement.rateLimitInSeconds=1 #is the default rate limit after what minimum time, should we upload the next request. http://docs.gurock.com/testrail-api2/introduction #Rate Limit
|
||||
# testManagement.suiteId=23 (the id of the Master suite)
|
||||
# ------------------------------------------------------
|
||||
testManagement.enabled=false
|
||||
testManagement.endPoint=https://alfresco.testrail.com/
|
||||
testManagement.username=
|
||||
testManagement.apiKey=
|
||||
testManagement.project=7
|
||||
testManagement.includeOnlyTestCasesExecuted=true
|
||||
testManagement.rateLimitInSeconds=1
|
||||
testManagement.testRun=MyTestRunInTestRail
|
||||
testManagement.suiteId=12
|
||||
|
||||
# The location of the reports path
|
||||
reports.path=./target/reports
|
||||
|
||||
#
|
||||
# Database Section
|
||||
# You should provide here the database URL, that can be a differed server as alfresco.
|
||||
# https://docs.oracle.com/javase/tutorial/jdbc/basics/connecting.html
|
||||
#
|
||||
# Current supported db.url:
|
||||
#
|
||||
# MySQL:
|
||||
# db.url = jdbc:mysql://${alfresco.server}:3306/alfresco
|
||||
#
|
||||
# PostgreSQL:
|
||||
# db.url = jdbc:postgresql://<your-DB-IP>:3306/alfresco
|
||||
#
|
||||
# Oracle:
|
||||
# db.url = jdbc:oracle://<your-DB-IP>:3306/alfresco
|
||||
#
|
||||
# MariaDB:
|
||||
# db.url = jdbc:mariadb://<your-DB-IP>:3306/alfresco
|
||||
#
|
||||
db.url = jdbc:mysql://${alfresco.server}:3306/alfresco
|
||||
db.username = alfresco
|
||||
db.password = alfresco
|
||||
|
||||
environment=default
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-governance-services-community-parent</artifactId>
|
||||
<version>11.82</version>
|
||||
<version>14.28-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
@@ -1,4 +1,4 @@
|
||||
TRANSFORMERS_TAG=2.5.0
|
||||
TRANSFORMERS_TAG=2.5.3
|
||||
SOLR6_TAG=2.0.2-RC1
|
||||
POSTGRES_TAG=13.1
|
||||
POSTGRES_TAG=13.3
|
||||
ACTIVEMQ_TAG=5.16.1
|
||||
|
@@ -45,4 +45,4 @@ rm.action.create.transfer.container.child-error-message=You can't create items i
|
||||
rm.action.create.transfer.child-error-message=You can't create items in Transfer Folders.
|
||||
rm.action.create.record.folder.child-error-message=You can only create records in record folders and this was a {0}.
|
||||
rm.action.transfer-non-editable=You can't edit transfer folder or container metadata.
|
||||
|
||||
rm.action.node.frozen.error-message=Unable to perform action {0} because the node is frozen or has frozen children.
|
||||
|
@@ -45,4 +45,4 @@ rm.action.create.transfer.container.child-error-message=Nelze vytv\u00e1\u0159et
|
||||
rm.action.create.transfer.child-error-message=Nelze vytv\u00e1\u0159et polo\u017eky ve slo\u017ece p\u0159enosu.
|
||||
rm.action.create.record.folder.child-error-message=Z\u00e1znamy je mo\u017en\u00e9 vytv\u00e1\u0159et pouze ve slo\u017ek\u00e1ch z\u00e1znam\u016f a toto bylo {0}.
|
||||
rm.action.transfer-non-editable=Nelze upravovat metadata kontejneru nebo slo\u017eky pro p\u0159enos.
|
||||
|
||||
rm.action.node.frozen.error-message=Akci {0} nelze prov\u00e9st, proto\u017ee uzel je zablokovan\u00fd nebo m\u00e1 zablokovan\u00e9 pod\u0159\u00edzen\u00e9 prvky.
|
||||
|
@@ -45,4 +45,4 @@ rm.action.create.transfer.container.child-error-message=Du kan ikke oprette elem
|
||||
rm.action.create.transfer.child-error-message=Du kan ikke oprette elementer i Overf\u00f8r-mapper.
|
||||
rm.action.create.record.folder.child-error-message=Du kan kun oprette poster i postmapper, og dette var en {0}.
|
||||
rm.action.transfer-non-editable=Du kan ikke redigere overf\u00f8rselsmappe- eller container-metadata.
|
||||
|
||||
rm.action.node.frozen.error-message=Handlingen kan ikke udf\u00f8res {0}, fordi noden er l\u00e5st eller har l\u00e5ste underordnede noder.
|
||||
|
@@ -45,4 +45,4 @@ rm.action.create.transfer.container.child-error-message=Sie k\u00f6nnen keine El
|
||||
rm.action.create.transfer.child-error-message=Sie k\u00f6nnen keine Elemente in \u00dcbertragungsordnern erstellen.
|
||||
rm.action.create.record.folder.child-error-message=In Record-Ordnern k\u00f6nnen Sie nur Records erstellen. Das war aber ein {0}.
|
||||
rm.action.transfer-non-editable=Sie k\u00f6nnen Metadaten von \u00dcbertragungsordnern oder -containern nicht bearbeiten.
|
||||
|
||||
rm.action.node.frozen.error-message=Die Aktion ''{0}'' kann nicht ausgef\u00fchrt werden, da der Knoten oder untergeordnete Elemente von ihm festgefahren ist bzw. sind.
|
||||
|
@@ -45,4 +45,4 @@ rm.action.create.transfer.container.child-error-message=No se pueden crear eleme
|
||||
rm.action.create.transfer.child-error-message=No se pueden crear elementos en las carpetas de transferencia.
|
||||
rm.action.create.record.folder.child-error-message=Solo puede crear documentos de archivo en carpetas de documentos de archivo. {0} no se puede crear aqu\u00ed.
|
||||
rm.action.transfer-non-editable=No se puede editar una carpeta de transferencia ni los metadatos de un contenedor.
|
||||
|
||||
rm.action.node.frozen.error-message=No se puede realizar la acci\u00f3n {0} porque el nodo est\u00e1 congelado o tiene elementos secundarios congelados.
|
||||
|
@@ -45,4 +45,4 @@ rm.action.create.transfer.container.child-error-message=Siirtos\u00e4ili\u00f6\u
|
||||
rm.action.create.transfer.child-error-message=Siirtokansioihin ei voi luoda kohteita.
|
||||
rm.action.create.record.folder.child-error-message=Tietuekansioihin voi luoda ainoastaan tietueita, mutta t\u00e4m\u00e4 oli {0}.
|
||||
rm.action.transfer-non-editable=Siirtokansion tai -s\u00e4ili\u00f6n metatietoja ei voi muokata.
|
||||
|
||||
rm.action.node.frozen.error-message=Toimintoa {0} ei voitu suorittaa, koska solmu on j\u00e4\u00e4dytetty tai sill\u00e4 on j\u00e4\u00e4dytettyj\u00e4 alatasoja.
|
||||
|
@@ -45,4 +45,4 @@ rm.action.create.transfer.container.child-error-message=Impossible de cr\u00e9er
|
||||
rm.action.create.transfer.child-error-message=Impossible de cr\u00e9er des \u00e9l\u00e9ments dans les dossiers de transfert.
|
||||
rm.action.create.record.folder.child-error-message=Vous ne pouvez cr\u00e9er des documents d''archives que dans les dossiers d''archives, dans le cas pr\u00e9sent {0}.
|
||||
rm.action.transfer-non-editable=Impossible de modifier les m\u00e9tadonn\u00e9es de dossier de transfert ou de contenant.
|
||||
|
||||
rm.action.node.frozen.error-message=Impossible d''effectuer l''action {0} car le n\u0153ud ou ses enfants sont gel\u00e9s.
|
||||
|
@@ -45,4 +45,4 @@ rm.action.create.transfer.container.child-error-message=Impossibile creare eleme
|
||||
rm.action.create.transfer.child-error-message=Impossibile creare elementi nelle cartelle Trasferimento.
|
||||
rm.action.create.record.folder.child-error-message=I record possono essere creati solo nelle cartelle dei record e questa era {0}.
|
||||
rm.action.transfer-non-editable=Impossibile modificare la cartella di trasferimento o i metadati dei contenitori.
|
||||
|
||||
rm.action.node.frozen.error-message=Impossibile eseguire l''azione {0} poich\u00e9 il nodo \u00e8 congelato o presenta nodi figlio congelati.
|
||||
|
@@ -45,4 +45,4 @@ rm.action.create.transfer.container.child-error-message=\u8ee2\u9001\u30b3\u30f3
|
||||
rm.action.create.transfer.child-error-message=\u8ee2\u9001\u30d5\u30a9\u30eb\u30c0\u5185\u3067\u306f\u30a2\u30a4\u30c6\u30e0\u3092\u4f5c\u6210\u3067\u304d\u307e\u305b\u3093\u3002
|
||||
rm.action.create.record.folder.child-error-message=\u30ec\u30b3\u30fc\u30c9\u3092\u4f5c\u6210\u3067\u304d\u308b\u306e\u306f\u30ec\u30b3\u30fc\u30c9\u30d5\u30a9\u30eb\u30c0\u5185\u306e\u307f\u3067\u3001\u3053\u308c\u306f {0} \u3067\u3059\u3002
|
||||
rm.action.transfer-non-editable=\u8ee2\u9001\u30d5\u30a9\u30eb\u30c0\u307e\u305f\u306f\u30b3\u30f3\u30c6\u30ca\u30e1\u30bf\u30c7\u30fc\u30bf\u306f\u7de8\u96c6\u3067\u304d\u307e\u305b\u3093\u3002
|
||||
|
||||
rm.action.node.frozen.error-message=\u30ce\u30fc\u30c9\u304c\u30d5\u30ea\u30fc\u30ba\u3057\u3066\u3044\u308b\u304b\u3001\u307e\u305f\u306f\u5b50\u304c\u51cd\u7d50\u3057\u3066\u3044\u308b\u305f\u3081\u3001\u30a2\u30af\u30b7\u30e7\u30f3 {0}\u3092\u5b9f\u884c\u3067\u304d\u307e\u305b\u3093
|
||||
|
@@ -45,4 +45,4 @@ rm.action.create.transfer.container.child-error-message=Elementer kan ikke oppre
|
||||
rm.action.create.transfer.child-error-message=Elementer kan ikke opprettes i overf\u00f8ringsmapper.
|
||||
rm.action.create.record.folder.child-error-message=Oppf\u00f8ringer kan bare opprettes i oppf\u00f8ringsmapper, og dette er en {0}.
|
||||
rm.action.transfer-non-editable=Overf\u00f8ringsmapper eller beholdermetadata kan ikke redigeres.
|
||||
|
||||
rm.action.node.frozen.error-message=Kan ikke utf\u00f8re handlingen {0} fordi noden er frossen eller har frosne underordnede elementer.
|
||||
|
@@ -45,4 +45,4 @@ rm.action.create.transfer.container.child-error-message=U kunt geen onderdelen m
|
||||
rm.action.create.transfer.child-error-message=U kunt geen onderdelen maken in overdrachtsmappen.
|
||||
rm.action.create.record.folder.child-error-message=U kunt alleen archiefstukken maken in archiefmappen en dit was een {0}.
|
||||
rm.action.transfer-non-editable=U kunt metagegevens in een overdrachtsmap of -container niet bewerken.
|
||||
|
||||
rm.action.node.frozen.error-message=Kan de actie {0} niet uitvoeren omdat de node geblokkeerd is of geblokkeerde onderliggende elementen heeft.
|
||||
|
@@ -45,4 +45,4 @@ rm.action.create.transfer.container.child-error-message=Nie mo\u017cna utworzy\u
|
||||
rm.action.create.transfer.child-error-message=Nie mo\u017cna utworzy\u0107 pozycji w folderach przesy\u0142ania.
|
||||
rm.action.create.record.folder.child-error-message=W folderach rekord\u00f3w mo\u017cna tworzy\u0107 tylko rekordy, a to by\u0142o {0}.
|
||||
rm.action.transfer-non-editable=Nie mo\u017cna edytowa\u0107 folderu przesy\u0142ania ani metadanych kontenera.
|
||||
|
||||
rm.action.node.frozen.error-message=Nie mo\u017cna wykona\u0107 czynno\u015bci {0}, poniewa\u017c w\u0119ze\u0142 jest zablokowany lub ma zablokowane elementy podrz\u0119dne.
|
||||
|
@@ -45,4 +45,4 @@ rm.action.create.transfer.container.child-error-message=N\u00e3o \u00e9 poss\u00
|
||||
rm.action.create.transfer.child-error-message=N\u00e3o \u00e9 poss\u00edvel criar itens nas pastas de Transfer\u00eancia.
|
||||
rm.action.create.record.folder.child-error-message=\u00c9 poss\u00edvel apenas criar documentos arquiv\u00edsticos em pastas de documentos arquiv\u00edsticos; esta foi {0}.
|
||||
rm.action.transfer-non-editable=N\u00e3o \u00e9 poss\u00edvel editar os metadados das pastas de transfer\u00eancia ou cont\u00eainer.
|
||||
|
||||
rm.action.node.frozen.error-message=N\u00e3o \u00e9 poss\u00edvel executar a a\u00e7\u00e3o {0} porque o n\u00f3 est\u00e1 congelado ou tem filhos congelados.
|
||||
|
@@ -45,4 +45,4 @@ rm.action.create.transfer.container.child-error-message=\u041d\u0435\u0432\u043e
|
||||
rm.action.create.transfer.child-error-message=\u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0432 \u043f\u0430\u043f\u043a\u0430\u0445 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438.
|
||||
rm.action.create.record.folder.child-error-message=\u0417\u0430\u043f\u0438\u0441\u0438 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043f\u0430\u043f\u043a\u0430\u0445 \u0437\u0430\u043f\u0438\u0441\u0435\u0439, \u0430 \u044d\u0442\u043e {0}.
|
||||
rm.action.transfer-non-editable=\u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0438\u043b\u0438 \u043f\u0430\u043f\u043a\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438.
|
||||
|
||||
rm.action.node.frozen.error-message=\u041d\u0435 \u0443\u0434\u0430\u0435\u0442\u0441\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 {0}, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0443\u0437\u0435\u043b \u0437\u0430\u043a\u0440\u0435\u043f\u043b\u0435\u043d \u0438\u043b\u0438 \u0438\u043c\u0435\u0435\u0442 \u0437\u0430\u043a\u0440\u0435\u043f\u043b\u0435\u043d\u043d\u044b\u0435 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b.
|
||||
|
@@ -45,4 +45,4 @@ rm.action.create.transfer.container.child-error-message=Du kan inte skapa objekt
|
||||
rm.action.create.transfer.child-error-message=Du kan inte skapa objekt i \u00d6verf\u00f6ringsmappar.
|
||||
rm.action.create.record.folder.child-error-message=Du kan endast skapa handlingar i handlingsmappar och detta var en {0}.
|
||||
rm.action.transfer-non-editable=Du kan inte redigera \u00f6verf\u00f6ringsmappen eller beh\u00e5llarens metadata.
|
||||
|
||||
rm.action.node.frozen.error-message=Det gick inte att utf\u00f6ra \u00e5tg\u00e4rd {0} eftersom noden \u00e4r frusen eller har frysta underordnade.
|
||||
|
@@ -45,4 +45,4 @@ rm.action.create.transfer.container.child-error-message=\u60a8\u65e0\u6cd5\u5728
|
||||
rm.action.create.transfer.child-error-message=\u60a8\u65e0\u6cd5\u5728 Transfer \u6587\u4ef6\u5939\u4e2d\u521b\u5efa\u9879\u76ee\u3002
|
||||
rm.action.create.record.folder.child-error-message=\u60a8\u53ea\u80fd\u5728\u8bb0\u5f55\u6587\u4ef6\u5939\u4e2d\u521b\u5efa\u8bb0\u5f55\uff0c\u4e14\u8fd9\u662f\u4e00\u4e2a {0}\u3002
|
||||
rm.action.transfer-non-editable=\u60a8\u65e0\u6cd5\u7f16\u8f91\u4f20\u8f93\u6587\u4ef6\u5939\u6216\u5bb9\u5668\u5143\u6570\u636e\u3002
|
||||
|
||||
rm.action.node.frozen.error-message=\u65e0\u6cd5\u6267\u884c\u64cd\u4f5c{0}\uff0c\u56e0\u4e3a\u8282\u70b9\u5df2\u51bb\u7ed3\u6216\u51bb\u7ed3\u7684\u5b50\u8282\u70b9\u3002
|
||||
|
@@ -80,6 +80,7 @@
|
||||
<property name="searchService" ref="searchService" />
|
||||
<property name="personService" ref="personService" />
|
||||
<property name="recordsManagementActionService" ref="recordsManagementActionService" />
|
||||
<property name="freezeService" ref="freezeService"/>
|
||||
<property name="batchSize" value="${rm.dispositionlifecycletrigger.batchsize}"/>
|
||||
</bean>
|
||||
|
||||
|
@@ -102,9 +102,11 @@
|
||||
<bean id="rma.unfiledRecordFolder" class="org.alfresco.module.org_alfresco_module_rm.model.rma.type.UnfiledRecordFolderType" parent="rm.baseBehaviour" />
|
||||
|
||||
<bean id="rma.recordCategory" class="org.alfresco.module.org_alfresco_module_rm.model.rma.type.RecordCategoryType" parent="rm.baseBehaviour">
|
||||
<property name="recordService" ref="RecordService" />
|
||||
<property name="vitalRecordService" ref="VitalRecordService" />
|
||||
<property name="filePlanPermissionService" ref="FilePlanPermissionService" />
|
||||
<property name="recordFolderService" ref="RecordFolderService" />
|
||||
<property name="dispositionService" ref="DispositionService" />
|
||||
</bean>
|
||||
|
||||
<bean id="rma.recordFolder" class="org.alfresco.module.org_alfresco_module_rm.model.rma.type.RecordFolderType" parent="rm.baseBehaviour">
|
||||
|
@@ -112,7 +112,6 @@
|
||||
<property name="filePlanService" ref="FilePlanService" />
|
||||
<property name="recordFolderService" ref="RecordFolderService"/>
|
||||
<property name="recordService" ref="RecordService"/>
|
||||
<property name="freezeService" ref="FreezeService"/>
|
||||
<property name="transactionService" ref="transactionService" />
|
||||
</bean>
|
||||
|
||||
@@ -696,6 +695,13 @@
|
||||
init-method="init" depends-on="org_alfresco_module_rm_resourceBundles">
|
||||
<property name="policyComponent" ref="policyComponent"/>
|
||||
<property name="nodeService" ref="nodeService"/>
|
||||
<!-- list of disposition actions to automatically execute when eligible -->
|
||||
<property name="retentionActions">
|
||||
<list>
|
||||
<value>retain</value>
|
||||
</list>
|
||||
</property>
|
||||
<property name="freezeService" ref="freezeService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="RecordsManagementActionService" class="org.springframework.aop.framework.ProxyFactoryBean">
|
||||
@@ -900,6 +906,8 @@
|
||||
<bean id="freezeService" class="org.alfresco.module.org_alfresco_module_rm.freeze.FreezeServiceImpl" parent="baseService">
|
||||
<property name="filePlanService" ref="FilePlanService" />
|
||||
<property name="holdService" ref="HoldService" />
|
||||
<property name="recordFolderService" ref="RecordFolderService"/>
|
||||
<property name="recordService" ref="RecordService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="FreezeService" class="org.springframework.aop.framework.ProxyFactoryBean">
|
||||
@@ -945,6 +953,7 @@
|
||||
org.alfresco.module.org_alfresco_module_rm.freeze.FreezeService.hasFrozenChildren=RM_ALLOW
|
||||
org.alfresco.module.org_alfresco_module_rm.freeze.FreezeService.getFreezeDate=RM_ALLOW
|
||||
org.alfresco.module.org_alfresco_module_rm.freeze.FreezeService.getFreezeInitiator=RM_ALLOW
|
||||
org.alfresco.module.org_alfresco_module_rm.freeze.FreezeService.isFrozenOrHasFrozenChildren=RM_ALLOW
|
||||
org.alfresco.module.org_alfresco_module_rm.freeze.FreezeService.*=RM_DENY
|
||||
]]>
|
||||
</value>
|
||||
|
@@ -5,7 +5,7 @@ version: "3"
|
||||
services:
|
||||
alfresco:
|
||||
# acs repo community image with ags repo community amp applied
|
||||
image: alfresco/alfresco-governance-repository-community:latest
|
||||
image: alfresco/alfresco-governance-repository-community-base:latest
|
||||
environment:
|
||||
CATALINA_OPTS : "
|
||||
-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n
|
||||
|
@@ -8,13 +8,13 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-governance-services-community-repo-parent</artifactId>
|
||||
<version>11.82</version>
|
||||
<version>14.28-SNAPSHOT</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</image.name>
|
||||
<image.name>alfresco/alfresco-governance-repository-community-base</image.name>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
@@ -108,7 +108,7 @@
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-all</artifactId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@@ -141,6 +141,11 @@
|
||||
<artifactId>spring-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
@@ -396,7 +401,7 @@
|
||||
<image>
|
||||
<!-- TODO upgrade this old postgres version -->
|
||||
<name>postgres:9.4.12</name>
|
||||
<!--<name>postgres:13.1</name>-->
|
||||
<!--<name>postgres:13.3</name>-->
|
||||
<run>
|
||||
<ports>
|
||||
<port>${postgresql.tests.port}:${postgresql.port}</port>
|
||||
|
@@ -35,17 +35,17 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.module.org_alfresco_module_rm.RecordsManagementPolicies.BeforeRMActionExecution;
|
||||
import org.alfresco.module.org_alfresco_module_rm.RecordsManagementPolicies.OnRMActionExecution;
|
||||
import org.alfresco.module.org_alfresco_module_rm.freeze.FreezeService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.util.PoliciesUtil;
|
||||
import org.alfresco.repo.policy.ClassPolicyDelegate;
|
||||
import org.alfresco.repo.policy.PolicyComponent;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
|
||||
/**
|
||||
@@ -53,14 +53,13 @@ import org.springframework.extensions.surf.util.I18NUtil;
|
||||
*
|
||||
* @author Roy Wetherall
|
||||
*/
|
||||
@Slf4j
|
||||
public class RecordsManagementActionServiceImpl implements RecordsManagementActionService
|
||||
{
|
||||
/** I18N */
|
||||
private static final String MSG_NOT_DEFINED = "rm.action.not-defined";
|
||||
private static final String MSG_NO_IMPLICIT_NODEREF = "rm.action.no-implicit-noderef";
|
||||
|
||||
/** Logger */
|
||||
private static Log logger = LogFactory.getLog(RecordsManagementActionServiceImpl.class);
|
||||
private static final String MSG_NODE_FROZEN = "rm.action.node.frozen.error-message";
|
||||
|
||||
/** Registered records management actions */
|
||||
private Map<String, RecordsManagementAction> rmActions = new HashMap<>(13);
|
||||
@@ -78,6 +77,16 @@ public class RecordsManagementActionServiceImpl implements RecordsManagementActi
|
||||
private ClassPolicyDelegate<BeforeRMActionExecution> beforeRMActionExecutionDelegate;
|
||||
private ClassPolicyDelegate<OnRMActionExecution> onRMActionExecutionDelegate;
|
||||
|
||||
/**
|
||||
* Freeze Service
|
||||
*/
|
||||
private FreezeService freezeService;
|
||||
|
||||
/**
|
||||
* list of retention actions to automatically execute
|
||||
*/
|
||||
private List<String> retentionActions;
|
||||
|
||||
/**
|
||||
* @return Policy component
|
||||
*/
|
||||
@@ -94,6 +103,19 @@ public class RecordsManagementActionServiceImpl implements RecordsManagementActi
|
||||
return this.nodeService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param freezeService freeze service
|
||||
*/
|
||||
public void setFreezeService(FreezeService freezeService)
|
||||
{
|
||||
this.freezeService = freezeService;
|
||||
}
|
||||
|
||||
public void setRetentionActions(List<String> retentionActions)
|
||||
{
|
||||
this.retentionActions = retentionActions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the policy component
|
||||
*
|
||||
@@ -267,21 +289,23 @@ public class RecordsManagementActionServiceImpl implements RecordsManagementActi
|
||||
*/
|
||||
public RecordsManagementActionResult executeRecordsManagementAction(NodeRef nodeRef, String name, Map<String, Serializable> parameters)
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("Executing record management action on " + nodeRef);
|
||||
logger.debug(" actionName = " + name);
|
||||
logger.debug(" parameters = " + parameters);
|
||||
}
|
||||
log.debug("Executing record management action on " + nodeRef);
|
||||
log.debug(" actionName = " + name);
|
||||
log.debug(" parameters = " + parameters);
|
||||
|
||||
RecordsManagementAction rmAction = this.rmActions.get(name);
|
||||
if (rmAction == null)
|
||||
{
|
||||
String msg = I18NUtil.getMessage(MSG_NOT_DEFINED, name);
|
||||
if (logger.isWarnEnabled())
|
||||
{
|
||||
logger.warn(msg);
|
||||
}
|
||||
log.warn(msg);
|
||||
throw new AlfrescoRuntimeException(msg);
|
||||
}
|
||||
|
||||
if (retentionActions.contains(name.toLowerCase()) && freezeService.isFrozenOrHasFrozenChildren(nodeRef))
|
||||
{
|
||||
String msg = I18NUtil.getMessage(MSG_NODE_FROZEN, name);
|
||||
log.debug(msg);
|
||||
|
||||
throw new AlfrescoRuntimeException(msg);
|
||||
}
|
||||
|
||||
@@ -307,10 +331,7 @@ public class RecordsManagementActionServiceImpl implements RecordsManagementActi
|
||||
if (implicitTargetNode == null)
|
||||
{
|
||||
String msg = I18NUtil.getMessage(MSG_NO_IMPLICIT_NODEREF, name);
|
||||
if (logger.isWarnEnabled())
|
||||
{
|
||||
logger.warn(msg);
|
||||
}
|
||||
log.warn(msg);
|
||||
throw new AlfrescoRuntimeException(msg);
|
||||
}
|
||||
else
|
||||
|
@@ -306,7 +306,7 @@ public class RMAfterInvocationProvider extends RMSecurityCommon
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isUnfiltered(NodeRef nodeRef)
|
||||
protected boolean isUnfiltered(NodeRef nodeRef)
|
||||
{
|
||||
return !nodeService.hasAspect(nodeRef, RecordsManagementModel.ASPECT_FILE_PLAN_COMPONENT);
|
||||
|
||||
|
@@ -45,7 +45,6 @@ import org.alfresco.module.org_alfresco_module_rm.disposition.property.Dispositi
|
||||
import org.alfresco.module.org_alfresco_module_rm.event.RecordsManagementEvent;
|
||||
import org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanComponentKind;
|
||||
import org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.freeze.FreezeService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.record.RecordService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.recordfolder.RecordFolderService;
|
||||
@@ -59,7 +58,6 @@ import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
|
||||
import org.alfresco.repo.transaction.AlfrescoTransactionSupport;
|
||||
import org.alfresco.repo.transaction.AlfrescoTransactionSupport.TxnReadState;
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper;
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
|
||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
@@ -117,9 +115,6 @@ public class DispositionServiceImpl extends ServiceBaseImpl
|
||||
/** Record Service */
|
||||
private RecordService recordService;
|
||||
|
||||
/** Freeze Service */
|
||||
private FreezeService freezeService;
|
||||
|
||||
/** Transaction service */
|
||||
private TransactionService transactionService;
|
||||
|
||||
@@ -192,14 +187,6 @@ public class DispositionServiceImpl extends ServiceBaseImpl
|
||||
this.recordService = recordService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param freezeService freeze service
|
||||
*/
|
||||
public void setFreezeService(FreezeService freezeService)
|
||||
{
|
||||
this.freezeService = freezeService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param transactionService transaction service
|
||||
*/
|
||||
@@ -1191,7 +1178,7 @@ public class DispositionServiceImpl extends ServiceBaseImpl
|
||||
if (FilePlanComponentKind.RECORD_FOLDER.equals(filePlanService.getFilePlanComponentKind(nodeRef)) ||
|
||||
FilePlanComponentKind.RECORD.equals(filePlanService.getFilePlanComponentKind(nodeRef)))
|
||||
{
|
||||
if (!isDisposableItemCutoff(nodeRef) && !isFrozenOrHasFrozenChildren(nodeRef))
|
||||
if (!isDisposableItemCutoff(nodeRef))
|
||||
{
|
||||
if (recordFolderService.isRecordFolder(nodeRef))
|
||||
{
|
||||
@@ -1283,32 +1270,6 @@ public class DispositionServiceImpl extends ServiceBaseImpl
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method to determine if a node is frozen or has frozen children
|
||||
*
|
||||
* @param nodeRef Node to be checked
|
||||
* @return <code>true</code> if the node is frozen or has frozen children, <code>false</code> otherwise
|
||||
*/
|
||||
private boolean isFrozenOrHasFrozenChildren(NodeRef nodeRef)
|
||||
{
|
||||
boolean result = false;
|
||||
|
||||
if (recordFolderService.isRecordFolder(nodeRef))
|
||||
{
|
||||
result = freezeService.isFrozen(nodeRef) || freezeService.hasFrozenChildren(nodeRef);
|
||||
}
|
||||
else if (recordService.isRecord(nodeRef))
|
||||
{
|
||||
result = freezeService.isFrozen(nodeRef);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new AlfrescoRuntimeException("The nodeRef '" + nodeRef + "' is neither a record nor a record folder.");
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method to apply the cut off
|
||||
*
|
||||
|
@@ -150,4 +150,12 @@ public interface FreezeService
|
||||
*/
|
||||
@Deprecated
|
||||
Set<NodeRef> getHolds(NodeRef filePlan);
|
||||
|
||||
/**
|
||||
* Check given node or its children are frozen
|
||||
* The node should be record or record folder for retention schedule
|
||||
*
|
||||
* @param nodeRef
|
||||
*/
|
||||
boolean isFrozenOrHasFrozenChildren(NodeRef nodeRef);
|
||||
}
|
||||
|
@@ -43,6 +43,8 @@ import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.hold.HoldService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.record.RecordService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.recordfolder.RecordFolderService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.util.ServiceBaseImpl;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
|
||||
@@ -75,6 +77,32 @@ public class FreezeServiceImpl extends ServiceBaseImpl
|
||||
/** Hold service */
|
||||
private HoldService holdService;
|
||||
|
||||
/**
|
||||
* Record Folder Service
|
||||
*/
|
||||
private RecordFolderService recordFolderService;
|
||||
|
||||
/**
|
||||
* Record Service
|
||||
*/
|
||||
private RecordService recordService;
|
||||
|
||||
/**
|
||||
* @param recordFolderService record folder service
|
||||
*/
|
||||
public void setRecordFolderService(RecordFolderService recordFolderService)
|
||||
{
|
||||
this.recordFolderService = recordFolderService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param recordService record service
|
||||
*/
|
||||
public void setRecordService(RecordService recordService)
|
||||
{
|
||||
this.recordService = recordService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return File plan service
|
||||
*/
|
||||
@@ -392,4 +420,24 @@ public class FreezeServiceImpl extends ServiceBaseImpl
|
||||
// create hold
|
||||
return getHoldService().createHold(filePlan, holdName, reason, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method to determine if a node is frozen or has frozen children
|
||||
*
|
||||
* @param nodeRef Node to be checked
|
||||
* @return <code>true</code> if the node is frozen or has frozen children, <code>false</code> otherwise
|
||||
*/
|
||||
@Override
|
||||
public boolean isFrozenOrHasFrozenChildren(NodeRef nodeRef)
|
||||
{
|
||||
if (recordFolderService.isRecordFolder(nodeRef))
|
||||
{
|
||||
return isFrozen(nodeRef) || hasFrozenChildren(nodeRef);
|
||||
}
|
||||
else if (recordService.isRecord(nodeRef))
|
||||
{
|
||||
return isFrozen(nodeRef);
|
||||
}
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
}
|
||||
|
@@ -27,15 +27,17 @@
|
||||
|
||||
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.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.module.org_alfresco_module_rm.action.RMDispositionActionExecuterAbstractBase;
|
||||
import org.alfresco.module.org_alfresco_module_rm.action.RecordsManagementActionService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
|
||||
|
||||
import org.alfresco.module.org_alfresco_module_rm.freeze.FreezeService;
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
@@ -45,8 +47,8 @@ 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.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
|
||||
|
||||
/**
|
||||
* The Disposition Lifecycle Job Finds all disposition action nodes which are for disposition actions specified Where
|
||||
@@ -55,14 +57,14 @@ import org.apache.commons.logging.LogFactory;
|
||||
* @author mrogers
|
||||
* @author Roy Wetherall
|
||||
*/
|
||||
@Slf4j
|
||||
public class DispositionLifecycleJobExecuter extends RecordsManagementJobExecuter
|
||||
{
|
||||
/** logger */
|
||||
private static Log logger = LogFactory.getLog(DispositionLifecycleJobExecuter.class);
|
||||
|
||||
/** 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;
|
||||
@@ -82,6 +84,17 @@ public class DispositionLifecycleJobExecuter extends RecordsManagementJobExecute
|
||||
/** person service */
|
||||
private PersonService personService;
|
||||
|
||||
/** freeze service */
|
||||
private FreezeService freezeService;
|
||||
|
||||
/**
|
||||
* @param freezeService freeze service
|
||||
*/
|
||||
public void setFreezeService(FreezeService freezeService)
|
||||
{
|
||||
this.freezeService = freezeService;
|
||||
}
|
||||
|
||||
/**
|
||||
* List of disposition actions to automatically execute when eligible.
|
||||
*
|
||||
@@ -166,66 +179,59 @@ public class DispositionLifecycleJobExecuter extends RecordsManagementJobExecute
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.job.RecordsManagementJobExecuter#execute()
|
||||
*/
|
||||
@Override
|
||||
public void executeImpl()
|
||||
{
|
||||
try
|
||||
{
|
||||
logger.debug("Job Starting");
|
||||
log.debug("Job Starting");
|
||||
|
||||
if (dispositionActions != null && !dispositionActions.isEmpty())
|
||||
if (dispositionActions == null || dispositionActions.isEmpty())
|
||||
{
|
||||
boolean hasMore = true;
|
||||
int skipCount = 0;
|
||||
log.debug("Job Finished as disposition action is empty");
|
||||
return;
|
||||
}
|
||||
|
||||
if (batchSize < 1)
|
||||
boolean hasMore = true;
|
||||
int skipCount = 0;
|
||||
|
||||
if (batchSize < 1)
|
||||
{
|
||||
log.debug("Invalid value for batch size: " + batchSize + " default value used instead.");
|
||||
batchSize = DEFAULT_BATCH_SIZE;
|
||||
}
|
||||
|
||||
log.trace("Using batch size of " + batchSize);
|
||||
|
||||
while (hasMore)
|
||||
{
|
||||
SearchParameters params = new SearchParameters();
|
||||
params.addStore(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE);
|
||||
params.setLanguage(SearchService.LANGUAGE_FTS_ALFRESCO);
|
||||
params.setQuery(getQuery());
|
||||
params.setSkipCount(skipCount);
|
||||
params.setMaxItems(batchSize);
|
||||
|
||||
// execute search
|
||||
ResultSet results = searchService.query(params);
|
||||
List<NodeRef> resultNodes = results.getNodeRefs();
|
||||
hasMore = results.hasMore();
|
||||
skipCount += resultNodes.size(); // increase by page size
|
||||
results.close();
|
||||
|
||||
log.debug("Processing " + resultNodes.size() + " nodes");
|
||||
|
||||
// process search results
|
||||
if (!resultNodes.isEmpty())
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("Invalid value for batch size: " + batchSize + " default value used instead.");
|
||||
}
|
||||
batchSize = DEFAULT_BATCH_SIZE;
|
||||
}
|
||||
if (logger.isTraceEnabled())
|
||||
{
|
||||
logger.trace("Using batch size of " + batchSize);
|
||||
}
|
||||
|
||||
while (hasMore)
|
||||
{
|
||||
SearchParameters params = new SearchParameters();
|
||||
params.addStore(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE);
|
||||
params.setLanguage(SearchService.LANGUAGE_FTS_ALFRESCO);
|
||||
params.setQuery(getQuery());
|
||||
params.setSkipCount(skipCount);
|
||||
params.setMaxItems(batchSize);
|
||||
|
||||
// execute search
|
||||
ResultSet results = searchService.query(params);
|
||||
List<NodeRef> resultNodes = results.getNodeRefs();
|
||||
hasMore = results.hasMore();
|
||||
skipCount += resultNodes.size(); // increase by page size
|
||||
results.close();
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("Processing " + resultNodes.size() + " nodes");
|
||||
}
|
||||
|
||||
// process search results
|
||||
if (!resultNodes.isEmpty())
|
||||
{
|
||||
executeAction(resultNodes);
|
||||
}
|
||||
executeAction(resultNodes);
|
||||
}
|
||||
}
|
||||
logger.debug("Job Finished");
|
||||
log.debug("Job Finished");
|
||||
}
|
||||
catch (AlfrescoRuntimeException exception)
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug(exception);
|
||||
}
|
||||
log.debug(exception.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -239,40 +245,45 @@ public class DispositionLifecycleJobExecuter extends RecordsManagementJobExecute
|
||||
RetryingTransactionCallback<Boolean> processTranCB = () -> {
|
||||
for (NodeRef actionNode : actionNodes)
|
||||
{
|
||||
if (nodeService.exists(actionNode))
|
||||
if (!nodeService.exists(actionNode))
|
||||
{
|
||||
final String dispAction = (String) nodeService
|
||||
.getProperty(actionNode, RecordsManagementModel.PROP_DISPOSITION_ACTION);
|
||||
continue;
|
||||
}
|
||||
|
||||
// Run disposition action
|
||||
if (dispAction != null && dispositionActions.contains(dispAction))
|
||||
{
|
||||
ChildAssociationRef parent = nodeService.getPrimaryParent(actionNode);
|
||||
if (parent.getTypeQName().equals(RecordsManagementModel.ASSOC_NEXT_DISPOSITION_ACTION))
|
||||
{
|
||||
Map<String, Serializable> props = new HashMap<>(1);
|
||||
props.put(RMDispositionActionExecuterAbstractBase.PARAM_NO_ERROR_CHECK, Boolean.FALSE);
|
||||
final String dispAction = (String) nodeService.getProperty(actionNode, PROP_DISPOSITION_ACTION);
|
||||
|
||||
try
|
||||
{
|
||||
// execute disposition action
|
||||
recordsManagementActionService
|
||||
.executeRecordsManagementAction(parent.getParentRef(), dispAction, props);
|
||||
// Run disposition action
|
||||
if (dispAction == null || !dispositionActions.contains(dispAction))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
ChildAssociationRef parent = nodeService.getPrimaryParent(actionNode);
|
||||
if (!parent.getTypeQName().equals(ASSOC_NEXT_DISPOSITION_ACTION))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
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
|
||||
recordsManagementActionService
|
||||
.executeRecordsManagementAction(parent.getParentRef(), dispAction, props);
|
||||
|
||||
log.debug("Processed action: " + dispAction + "on" + parent);
|
||||
|
||||
}
|
||||
catch (AlfrescoRuntimeException exception)
|
||||
{
|
||||
log.debug(exception.getMessage());
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("Processed action: " + dispAction + "on" + parent);
|
||||
}
|
||||
}
|
||||
catch (AlfrescoRuntimeException exception)
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug(exception);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return Boolean.TRUE;
|
||||
|
@@ -69,15 +69,9 @@ public abstract class RecordsManagementJobExecuter implements RecordsManagementM
|
||||
// jobs not allowed to execute unless bootstrap is complete
|
||||
if (!repositoryState.isBootstrapping())
|
||||
{
|
||||
retryingTransactionHelper.doInTransaction(new RetryingTransactionCallback<Void>()
|
||||
{
|
||||
@Override
|
||||
public Void execute()
|
||||
{
|
||||
executeImpl();
|
||||
|
||||
return null;
|
||||
}
|
||||
retryingTransactionHelper.doInTransaction((RetryingTransactionCallback<Void>) () -> {
|
||||
executeImpl();
|
||||
return null;
|
||||
}, false, true);
|
||||
}
|
||||
}
|
||||
|
@@ -30,6 +30,10 @@ package org.alfresco.module.org_alfresco_module_rm.model.behaviour;
|
||||
import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionAction;
|
||||
import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.model.BaseBehaviourBean;
|
||||
import org.alfresco.module.org_alfresco_module_rm.record.RecordService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.recordfolder.RecordFolderService;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
@@ -52,7 +56,13 @@ public abstract class AbstractDisposableItem extends BaseBehaviourBean
|
||||
|
||||
/** disposition service */
|
||||
protected DispositionService dispositionService;
|
||||
|
||||
|
||||
/** record service */
|
||||
protected RecordService recordService;
|
||||
|
||||
/** record folder service */
|
||||
protected RecordFolderService recordFolderService;
|
||||
|
||||
/**
|
||||
* @param dispositionService disposition service
|
||||
*/
|
||||
@@ -60,6 +70,22 @@ public abstract class AbstractDisposableItem extends BaseBehaviourBean
|
||||
{
|
||||
this.dispositionService = dispositionService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param recordService record service
|
||||
*/
|
||||
public void setRecordService(RecordService recordService)
|
||||
{
|
||||
this.recordService = recordService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param recordFolderService record folder service
|
||||
*/
|
||||
public void setRecordFolderService(RecordFolderService recordFolderService)
|
||||
{
|
||||
this.recordFolderService = recordFolderService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes unwanted aspects
|
||||
@@ -86,4 +112,35 @@ public abstract class AbstractDisposableItem extends BaseBehaviourBean
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Cleans and re-initiates the containing records
|
||||
*
|
||||
* @param childAssociationRef
|
||||
*/
|
||||
protected void reinitializeRecordFolder(ChildAssociationRef childAssociationRef)
|
||||
{
|
||||
|
||||
NodeRef newNodeRef = childAssociationRef.getChildRef();
|
||||
|
||||
AuthenticationUtil.runAs(() -> {
|
||||
// clean record folder
|
||||
cleanDisposableItem(nodeService, newNodeRef);
|
||||
|
||||
// re-initialise the record folder
|
||||
recordFolderService.setupRecordFolder(newNodeRef);
|
||||
|
||||
// sort out the child records
|
||||
for (NodeRef record : recordService.getRecords(newNodeRef))
|
||||
{
|
||||
// clean record
|
||||
cleanDisposableItem(nodeService, record);
|
||||
|
||||
// Re-initiate the records in the new folder.
|
||||
recordService.file(record);
|
||||
}
|
||||
|
||||
return null;
|
||||
}, AuthenticationUtil.getSystemUserName());
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -27,13 +27,14 @@
|
||||
|
||||
package org.alfresco.module.org_alfresco_module_rm.model.rma.type;
|
||||
|
||||
import static org.alfresco.model.ContentModel.TYPE_CONTENT;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.model.BaseBehaviourBean;
|
||||
import org.alfresco.module.org_alfresco_module_rm.recordfolder.RecordFolderService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.model.behaviour.AbstractDisposableItem;
|
||||
import org.alfresco.module.org_alfresco_module_rm.security.FilePlanPermissionService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.vital.VitalRecordService;
|
||||
import org.alfresco.repo.copy.CopyBehaviourCallback;
|
||||
@@ -49,6 +50,7 @@ import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.service.namespace.RegexQNamePattern;
|
||||
|
||||
/**
|
||||
* rma:recordCategory behaviour bean
|
||||
@@ -60,9 +62,10 @@ import org.alfresco.service.namespace.QName;
|
||||
(
|
||||
defaultType = "rma:recordCategory"
|
||||
)
|
||||
public class RecordCategoryType extends BaseBehaviourBean
|
||||
public class RecordCategoryType extends AbstractDisposableItem
|
||||
implements NodeServicePolicies.OnCreateChildAssociationPolicy,
|
||||
NodeServicePolicies.OnCreateNodePolicy
|
||||
NodeServicePolicies.OnCreateNodePolicy,
|
||||
NodeServicePolicies.OnMoveNodePolicy
|
||||
{
|
||||
private final static List<QName> ACCEPTED_UNIQUE_CHILD_TYPES = new ArrayList<>();
|
||||
private final static List<QName> ACCEPTED_NON_UNIQUE_CHILD_TYPES = Arrays.asList(TYPE_RECORD_CATEGORY, TYPE_RECORD_FOLDER);
|
||||
@@ -73,9 +76,6 @@ public class RecordCategoryType extends BaseBehaviourBean
|
||||
/** file plan permission service */
|
||||
protected FilePlanPermissionService filePlanPermissionService;
|
||||
|
||||
/** record folder service */
|
||||
private RecordFolderService recordFolderService;
|
||||
|
||||
/**
|
||||
* @param vitalRecordService vital record service
|
||||
*/
|
||||
@@ -92,14 +92,6 @@ public class RecordCategoryType extends BaseBehaviourBean
|
||||
this.filePlanPermissionService = filePlanPermissionService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param recordFolderService record folder service
|
||||
*/
|
||||
public void setRecordFolderService(RecordFolderService recordFolderService)
|
||||
{
|
||||
this.recordFolderService = recordFolderService;
|
||||
}
|
||||
|
||||
/**
|
||||
* On every event
|
||||
*
|
||||
@@ -204,6 +196,53 @@ public class RecordCategoryType extends BaseBehaviourBean
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Record Category move behaviour
|
||||
*
|
||||
* @see org.alfresco.repo.node.NodeServicePolicies.OnMoveNodePolicy#onMoveNode(org.alfresco.service.cmr.repository.ChildAssociationRef, org.alfresco.service.cmr.repository.ChildAssociationRef)
|
||||
*/
|
||||
@Override
|
||||
@Behaviour
|
||||
(
|
||||
kind = BehaviourKind.CLASS,
|
||||
notificationFrequency = NotificationFrequency.FIRST_EVENT
|
||||
)
|
||||
public void onMoveNode(ChildAssociationRef oldChildAssocRef, ChildAssociationRef newChildAssocRef)
|
||||
{
|
||||
// clean the child folders and records only if the old parent category has a disposition schedule set
|
||||
// if it doesn't, then there are no old properties on the child nodes that have to be cleaned in order
|
||||
// for new ones to be set
|
||||
if (nodeService.getType(newChildAssocRef.getChildRef()).equals(TYPE_RECORD_CATEGORY)
|
||||
&& dispositionService.getDispositionSchedule(oldChildAssocRef.getParentRef()) != null)
|
||||
{
|
||||
reinitializeRecordFolders(newChildAssocRef);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Recursively reinitialize each folder in a structure of categories
|
||||
* Unwanted aspects will be removed from the child records and the records will be re-filed
|
||||
* Disposition schedule aspects and properties will be inherited from the new parent category
|
||||
*
|
||||
* @param childAssociationRef
|
||||
*/
|
||||
private void reinitializeRecordFolders(ChildAssociationRef childAssociationRef)
|
||||
{
|
||||
for (ChildAssociationRef newChildRef : nodeService.getChildAssocs(childAssociationRef.getChildRef(),
|
||||
ContentModel.ASSOC_CONTAINS,
|
||||
RegexQNamePattern.MATCH_ALL))
|
||||
{
|
||||
if (nodeService.getType(newChildRef.getChildRef()).equals(TYPE_RECORD_CATEGORY))
|
||||
{
|
||||
reinitializeRecordFolders(newChildRef);
|
||||
}
|
||||
else if (!nodeService.getType(newChildRef.getChildRef()).equals(TYPE_CONTENT))
|
||||
{
|
||||
reinitializeRecordFolder(newChildRef);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy callback for record category
|
||||
*/
|
||||
|
@@ -34,8 +34,6 @@ import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.identifier.IdentifierService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.model.behaviour.AbstractDisposableItem;
|
||||
import org.alfresco.module.org_alfresco_module_rm.record.RecordService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.recordfolder.RecordFolderService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.vital.VitalRecordService;
|
||||
import org.alfresco.repo.copy.CopyBehaviourCallback;
|
||||
import org.alfresco.repo.copy.CopyDetails;
|
||||
@@ -68,11 +66,6 @@ public class RecordFolderType extends AbstractDisposableItem
|
||||
implements NodeServicePolicies.OnMoveNodePolicy,
|
||||
NodeServicePolicies.OnCreateChildAssociationPolicy
|
||||
{
|
||||
/** record service */
|
||||
private RecordService recordService;
|
||||
|
||||
/** record folder service */
|
||||
private RecordFolderService recordFolderService;
|
||||
|
||||
/** vital record service */
|
||||
protected VitalRecordService vitalRecordService;
|
||||
@@ -85,22 +78,6 @@ public class RecordFolderType extends AbstractDisposableItem
|
||||
|
||||
private static final String MSG_CANNOT_CREATE_CHILDREN_IN_CLOSED_RECORD_FOLDER = "rm.service.add-children-to-closed-record-folder";
|
||||
|
||||
/**
|
||||
* @param recordService record service
|
||||
*/
|
||||
public void setRecordService(RecordService recordService)
|
||||
{
|
||||
this.recordService = recordService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param recordFolderService record folder service
|
||||
*/
|
||||
public void setRecordFolderService(RecordFolderService recordFolderService)
|
||||
{
|
||||
this.recordFolderService = recordFolderService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param vitalRecordService vital record service
|
||||
*/
|
||||
@@ -131,31 +108,7 @@ public class RecordFolderType extends AbstractDisposableItem
|
||||
{
|
||||
if (!oldChildAssocRef.getParentRef().equals(newChildAssocRef.getParentRef()))
|
||||
{
|
||||
final NodeRef newNodeRef = newChildAssocRef.getChildRef();
|
||||
|
||||
AuthenticationUtil.runAs(new AuthenticationUtil.RunAsWork<Object>()
|
||||
{
|
||||
public Object doWork()
|
||||
{
|
||||
// clean record folder
|
||||
cleanDisposableItem(nodeService, newNodeRef);
|
||||
|
||||
// re-initialise the record folder
|
||||
recordFolderService.setupRecordFolder(newNodeRef);
|
||||
|
||||
// sort out the child records
|
||||
for (NodeRef record : recordService.getRecords(newNodeRef))
|
||||
{
|
||||
// clean record
|
||||
cleanDisposableItem(nodeService, record);
|
||||
|
||||
// Re-initiate the records in the new folder.
|
||||
recordService.file(record);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}, AuthenticationUtil.getSystemUserName());
|
||||
reinitializeRecordFolder(newChildAssocRef);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@@ -140,9 +140,8 @@ public class CustomPropertyDefinitionPost extends BaseCustomPropertyWebScript
|
||||
for (Iterator iter = json.keys(); iter.hasNext(); )
|
||||
{
|
||||
String nextKeyString = (String)iter.next();
|
||||
String nextValueString = json.getString(nextKeyString);
|
||||
|
||||
params.put(nextKeyString, nextValueString);
|
||||
Serializable nextValue = (Serializable) json.get(nextKeyString);
|
||||
params.put(nextKeyString, nextValue);
|
||||
}
|
||||
|
||||
return params;
|
||||
|
@@ -28,6 +28,8 @@ package org.alfresco.module.org_alfresco_module_rm.test.integration.disposition;
|
||||
|
||||
import static org.alfresco.module.org_alfresco_module_rm.test.util.CommonRMTestUtils.DEFAULT_DISPOSITION_DESCRIPTION;
|
||||
import static org.alfresco.module.org_alfresco_module_rm.test.util.CommonRMTestUtils.DEFAULT_DISPOSITION_INSTRUCTIONS;
|
||||
import static org.alfresco.module.org_alfresco_module_rm.test.util.CommonRMTestUtils.DEFAULT_EVENT_NAME;
|
||||
import static org.alfresco.module.org_alfresco_module_rm.test.util.CommonRMTestUtils.SEPARATION_EVENT_NAME;
|
||||
import static org.alfresco.util.GUID.generate;
|
||||
|
||||
import java.io.Serializable;
|
||||
@@ -37,6 +39,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.module.org_alfresco_module_rm.action.impl.CutOffAction;
|
||||
import org.alfresco.module.org_alfresco_module_rm.action.impl.DestroyAction;
|
||||
import org.alfresco.module.org_alfresco_module_rm.action.impl.RetainAction;
|
||||
import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionAction;
|
||||
import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionSchedule;
|
||||
@@ -190,6 +193,162 @@ public class DispositionScheduleInheritanceTest extends BaseRMTestCase
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a root record category A with a retention schedule set to retain and destroy after 1 day
|
||||
* and another root record category B with a retention schedule set to cut off and destroy after 1 day containing a
|
||||
* subcategory
|
||||
* When moving the subcategory into the first root category
|
||||
* Then records under the subcategory inherit the retention schedule of the parent record category
|
||||
* The events list contain the retain event step inherited from the new parent category
|
||||
* <p>
|
||||
* Please see https://alfresco.atlassian.net/browse/APPS-1004
|
||||
*/
|
||||
public void testRetentionScheduleInheritance_APPS_1004()
|
||||
{
|
||||
doBehaviourDrivenTest(new BehaviourDrivenTest()
|
||||
{
|
||||
NodeRef category1;
|
||||
NodeRef subcategory2;
|
||||
NodeRef record;
|
||||
Date asOfDateBeforeMove;
|
||||
|
||||
@Override
|
||||
public void given()
|
||||
{
|
||||
// create root category1
|
||||
category1 = filePlanService.createRecordCategory(filePlan, generate());
|
||||
|
||||
// create record level disposition schedule for category1
|
||||
createDispositionScheduleRetainAndCutOffOneDay(category1);
|
||||
|
||||
// create root category2
|
||||
NodeRef category2 = filePlanService.createRecordCategory(filePlan, generate());
|
||||
|
||||
// create record level disposition schedule for category2
|
||||
createDispositionScheduleCutOffAndDestroyOneDay(category2);
|
||||
|
||||
// create subcategory2 under category2
|
||||
subcategory2 = filePlanService.createRecordCategory(category2, generate());
|
||||
|
||||
// create folder under subcategory2
|
||||
folder = recordFolderService.createRecordFolder(subcategory2, generate());
|
||||
|
||||
// file record in folder and complete it
|
||||
record = utils.createRecord(folder, generate(), generate());
|
||||
utils.completeRecord(record);
|
||||
|
||||
//store the date to check if it was updated
|
||||
asOfDateBeforeMove = dispositionService.getNextDispositionAction(record).getAsOfDate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void when() throws Exception
|
||||
{
|
||||
// move subcategory2 under category1
|
||||
fileFolderService.move(subcategory2, category1, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void then() throws Exception
|
||||
{
|
||||
dispositionService.getDispositionSchedule(record);
|
||||
// check the next disposition action
|
||||
DispositionAction dispositionActionAfterMove = dispositionService.getNextDispositionAction(record);
|
||||
assertNotNull(dispositionActionAfterMove);
|
||||
assertEquals(RetainAction.NAME, dispositionActionAfterMove.getName());
|
||||
assertNotNull(dispositionActionAfterMove.getAsOfDate());
|
||||
assertTrue(dispositionActionAfterMove.getAsOfDate().after(asOfDateBeforeMove));
|
||||
|
||||
// check the search aspect details
|
||||
assertTrue(nodeService.hasAspect(record, ASPECT_RM_SEARCH));
|
||||
assertEquals(RetainAction.NAME, nodeService.getProperty(record, PROP_RS_DISPOSITION_ACTION_NAME));
|
||||
assertNotNull(nodeService.getProperty(record, PROP_RS_DISPOSITION_ACTION_AS_OF));
|
||||
assertNull((List<String>) nodeService.getProperty(record, PROP_RS_DISPOSITION_EVENTS));
|
||||
assertNotNull(nodeService.getProperty(record, PROP_RS_DISPOITION_INSTRUCTIONS));
|
||||
assertNotNull(nodeService.getProperty(record, PROP_RS_DISPOITION_AUTHORITY));
|
||||
assertTrue((Boolean) nodeService.getProperty(record, PROP_RS_HAS_DISPOITION_SCHEDULE));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a root record category A with a retention schedule set to cut off on event 'case closed'
|
||||
* and another root record category B with a retention schedule set to cut off on event 'separation'
|
||||
* When moving the subcategory into the first root category
|
||||
* Then records under the subcategory inherit the retention schedule of the parent record category
|
||||
* The events list contain the case closed event step inherited from the new parent category
|
||||
* <p>
|
||||
* Please see https://alfresco.atlassian.net/browse/APPS-1005
|
||||
*/
|
||||
public void testRetentionScheduleInheritance_APPS_1005()
|
||||
{
|
||||
doBehaviourDrivenTest(new BehaviourDrivenTest()
|
||||
{
|
||||
NodeRef category1;
|
||||
NodeRef subcategory2;
|
||||
NodeRef record;
|
||||
Date asOfDateBeforeMove;
|
||||
|
||||
@Override
|
||||
public void given()
|
||||
{
|
||||
// create root category1
|
||||
category1 = filePlanService.createRecordCategory(filePlan, generate());
|
||||
|
||||
utils.createDispositionSchedule(category1, DEFAULT_DISPOSITION_INSTRUCTIONS,
|
||||
DEFAULT_DISPOSITION_DESCRIPTION, true, true, false, DEFAULT_EVENT_NAME);
|
||||
|
||||
// create root category2
|
||||
NodeRef category2 = filePlanService.createRecordCategory(filePlan, generate());
|
||||
|
||||
// create record level disposition schedule for category2
|
||||
utils.createDispositionSchedule(category2, DEFAULT_DISPOSITION_INSTRUCTIONS,
|
||||
DEFAULT_DISPOSITION_DESCRIPTION, true, true, false, SEPARATION_EVENT_NAME);
|
||||
|
||||
// create subcategory2 under category2
|
||||
subcategory2 = filePlanService.createRecordCategory(category2, generate());
|
||||
|
||||
// create folder under subcategory2
|
||||
folder = recordFolderService.createRecordFolder(subcategory2, generate());
|
||||
|
||||
// file record in folder and complete it
|
||||
record = utils.createRecord(folder, generate(), generate());
|
||||
utils.completeRecord(record);
|
||||
|
||||
//store the date to check if it was updated
|
||||
asOfDateBeforeMove = dispositionService.getNextDispositionAction(record).getAsOfDate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void when() throws Exception
|
||||
{
|
||||
// move subcategory2 under category1
|
||||
fileFolderService.move(subcategory2, category1, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void then() throws Exception
|
||||
{
|
||||
// check the next disposition action
|
||||
DispositionAction dispositionActionAfterMove = dispositionService.getNextDispositionAction(record);
|
||||
assertNotNull(dispositionActionAfterMove);
|
||||
assertEquals(CutOffAction.NAME, dispositionActionAfterMove.getName());
|
||||
|
||||
// check the search aspect details
|
||||
assertTrue(nodeService.hasAspect(record, ASPECT_RM_SEARCH));
|
||||
assertEquals(CutOffAction.NAME, nodeService.getProperty(record, PROP_RS_DISPOSITION_ACTION_NAME));
|
||||
assertNotNull((List<String>) nodeService.getProperty(record, PROP_RS_DISPOSITION_EVENTS));
|
||||
assertEquals(((List<String>) ((List<String>) nodeService.getProperty(record,
|
||||
PROP_RS_DISPOSITION_EVENTS))).size(), 1);
|
||||
assertEquals(DEFAULT_EVENT_NAME, ((List<String>) ((List<String>) nodeService.getProperty(record,
|
||||
PROP_RS_DISPOSITION_EVENTS))).get(0));
|
||||
assertNotNull(nodeService.getProperty(record, PROP_RS_DISPOITION_INSTRUCTIONS));
|
||||
assertNotNull(nodeService.getProperty(record, PROP_RS_DISPOITION_AUTHORITY));
|
||||
assertTrue((Boolean) nodeService.getProperty(record, PROP_RS_HAS_DISPOITION_SCHEDULE));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void createDispositionScheduleCutOff(NodeRef category, String action, String period)
|
||||
{
|
||||
DispositionSchedule ds = utils.createDispositionSchedule(category, DEFAULT_DISPOSITION_INSTRUCTIONS, DEFAULT_DISPOSITION_DESCRIPTION, true, false, false);
|
||||
@@ -205,6 +364,22 @@ public class DispositionScheduleInheritanceTest extends BaseRMTestCase
|
||||
createDispositionScheduleStep(ds, RetainAction.NAME, CommonRMTestUtils.PERIOD_IMMEDIATELY);
|
||||
}
|
||||
|
||||
private void createDispositionScheduleRetainAndCutOffOneDay(NodeRef category)
|
||||
{
|
||||
DispositionSchedule ds = utils.createDispositionSchedule(category, DEFAULT_DISPOSITION_INSTRUCTIONS, DEFAULT_DISPOSITION_DESCRIPTION, true, false, false);
|
||||
|
||||
createDispositionScheduleStep(ds, RetainAction.NAME, CommonRMTestUtils.PERIOD_ONE_DAY);
|
||||
createDispositionScheduleStep(ds, DestroyAction.NAME, CommonRMTestUtils.PERIOD_ONE_DAY);
|
||||
}
|
||||
|
||||
private void createDispositionScheduleCutOffAndDestroyOneDay(NodeRef category)
|
||||
{
|
||||
DispositionSchedule ds = utils.createDispositionSchedule(category, DEFAULT_DISPOSITION_INSTRUCTIONS, DEFAULT_DISPOSITION_DESCRIPTION, true, false, false);
|
||||
|
||||
createDispositionScheduleStep(ds, CutOffAction.NAME, CommonRMTestUtils.PERIOD_ONE_DAY);
|
||||
createDispositionScheduleStep(ds, DestroyAction.NAME, CommonRMTestUtils.PERIOD_ONE_DAY);
|
||||
}
|
||||
|
||||
private void createDispositionScheduleStep(DispositionSchedule ds, String action, String period)
|
||||
{
|
||||
Map<QName, Serializable> step = new HashMap<QName, Serializable>(3);
|
||||
|
@@ -0,0 +1,171 @@
|
||||
/*
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 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. 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.module.org_alfresco_module_rm.test.legacy.action;
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.action.dm.ExecuteScriptAction;
|
||||
import org.alfresco.module.org_alfresco_module_rm.test.util.BaseRMTestCase;
|
||||
import org.alfresco.repo.content.MimetypeMap;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
|
||||
import org.alfresco.service.cmr.action.Action;
|
||||
import org.alfresco.service.cmr.repository.ContentWriter;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.namespace.NamespaceService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
|
||||
/**
|
||||
* RM Action Execute Script Unit test
|
||||
*
|
||||
* @author Eva Vasques
|
||||
*/
|
||||
public class ExecuteScriptActionTest extends BaseRMTestCase
|
||||
{
|
||||
|
||||
@Override
|
||||
protected boolean isCollaborationSiteTest()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public void testExecuteScript()
|
||||
{
|
||||
|
||||
AuthenticationUtil.setFullyAuthenticatedUser(AuthenticationUtil.getAdminUserName());
|
||||
String fileOriginalName = (String) nodeService.getProperty(dmDocument, ContentModel.PROP_NAME);
|
||||
|
||||
// Valid Script
|
||||
NodeRef validScriptRef = addTempScript("valid-rm-script.js",
|
||||
"document.properties.name = \"Valid_\" + document.properties.name;\ndocument.save();");
|
||||
|
||||
// Invalid Script
|
||||
NodeRef invalidScriptRef = addTempScript("invalid-rm-script.js",
|
||||
"document.properties.name = \"Invalid_\" + document.properties.name;\ndocument.save();", dmFolder);
|
||||
|
||||
// Attempt to execute a script not in RM Scripts folder should fail
|
||||
doTestInTransaction(new FailureTest("Script outside proper Data Dictionary folder should not be executed",
|
||||
IllegalStateException.class)
|
||||
{
|
||||
public void run() throws Exception
|
||||
{
|
||||
executeAction(invalidScriptRef, dmDocument);
|
||||
}
|
||||
}, dmCollaborator);
|
||||
|
||||
// Scripts in correct data dictionary folder should be executed
|
||||
doTestInTransaction(new Test<Void>()
|
||||
{
|
||||
@Override
|
||||
public Void run() throws Exception
|
||||
{
|
||||
executeAction(validScriptRef, dmDocument);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void test(Void result) throws Exception
|
||||
{
|
||||
// Assert the script was executed and the document was renamed
|
||||
String currentName = (String) nodeService.getProperty(dmDocument, ContentModel.PROP_NAME);
|
||||
assertEquals(currentName, "Valid_" + fileOriginalName);
|
||||
}
|
||||
}, dmCollaborator);
|
||||
|
||||
retryingTransactionHelper.doInTransaction(new RetryingTransactionCallback<Void>()
|
||||
{
|
||||
public Void execute() throws Throwable
|
||||
{
|
||||
// Set the name back to what it was
|
||||
nodeService.setProperty(dmDocument, ContentModel.PROP_NAME, fileOriginalName);
|
||||
return null;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private NodeRef addTempScript(final String scriptFileName, final String javaScript, final NodeRef parentRef)
|
||||
{
|
||||
AuthenticationUtil.setFullyAuthenticatedUser(AuthenticationUtil.getAdminUserName());
|
||||
return retryingTransactionHelper.doInTransaction(new RetryingTransactionCallback<NodeRef>()
|
||||
{
|
||||
public NodeRef execute() throws Throwable
|
||||
{
|
||||
|
||||
NodeRef script = nodeService.getChildByName(parentRef, ContentModel.ASSOC_CONTAINS, scriptFileName);
|
||||
|
||||
if (script == null)
|
||||
{
|
||||
// Create the script node reference
|
||||
script = nodeService.createNode(parentRef, ContentModel.ASSOC_CONTAINS,
|
||||
QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, scriptFileName), ContentModel.TYPE_CONTENT)
|
||||
.getChildRef();
|
||||
|
||||
nodeService.setProperty(script, ContentModel.PROP_NAME, scriptFileName);
|
||||
|
||||
ContentWriter contentWriter = contentService.getWriter(script, ContentModel.PROP_CONTENT, true);
|
||||
contentWriter.setMimetype(MimetypeMap.MIMETYPE_JAVASCRIPT);
|
||||
contentWriter.setEncoding("UTF-8");
|
||||
contentWriter.putContent(javaScript);
|
||||
|
||||
}
|
||||
return script;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private NodeRef addTempScript(final String scriptFileName, final String javaScript)
|
||||
{
|
||||
AuthenticationUtil.setFullyAuthenticatedUser(AuthenticationUtil.getAdminUserName());
|
||||
return retryingTransactionHelper.doInTransaction(new RetryingTransactionCallback<NodeRef>()
|
||||
{
|
||||
public NodeRef execute() throws Throwable
|
||||
{
|
||||
|
||||
// get the company_home
|
||||
NodeRef companyHomeRef = repositoryHelper.getCompanyHome();
|
||||
// get the Data Dictionary
|
||||
NodeRef dataDictionaryRef = nodeService.getChildByName(companyHomeRef, ContentModel.ASSOC_CONTAINS,
|
||||
"Data Dictionary");
|
||||
// get the Scripts Folder
|
||||
NodeRef rmFolder = nodeService.getChildByName(dataDictionaryRef, ContentModel.ASSOC_CONTAINS,
|
||||
"Records Management");
|
||||
NodeRef scriptsRef = nodeService.getChildByName(rmFolder, ContentModel.ASSOC_CONTAINS,
|
||||
"Records Management Scripts");
|
||||
|
||||
return addTempScript(scriptFileName, javaScript, scriptsRef);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void executeAction(NodeRef scriptRef, NodeRef nodeRef)
|
||||
{
|
||||
Action action = actionService.createAction("rmscript");
|
||||
action.setParameterValue(ExecuteScriptAction.PARAM_SCRIPTREF, scriptRef);
|
||||
actionService.executeAction(action, nodeRef);
|
||||
}
|
||||
|
||||
}
|
@@ -53,7 +53,7 @@ public class FreezeServiceImplTest extends BaseRMTestCase
|
||||
|
||||
/**
|
||||
* Test freeze service methods.
|
||||
*
|
||||
*
|
||||
* @deprecated as of 2.2
|
||||
*/
|
||||
public void testFreezeService() throws Exception
|
||||
@@ -219,7 +219,7 @@ public class FreezeServiceImplTest extends BaseRMTestCase
|
||||
// hold is not automatically removed
|
||||
holdAssocs = holdService.getHolds(filePlan);
|
||||
assertEquals(1, holdAssocs.size());
|
||||
|
||||
|
||||
// delete hold
|
||||
holdService.deleteHold(holdNodeRef);
|
||||
|
||||
@@ -265,8 +265,38 @@ public class FreezeServiceImplTest extends BaseRMTestCase
|
||||
assertFalse(freezeService.isFrozen(recordFour));
|
||||
// assertFalse(freezeService.hasFrozenChildren(rmFolder));
|
||||
|
||||
return null;
|
||||
}
|
||||
});
|
||||
}
|
||||
return null;
|
||||
}
|
||||
});
|
||||
|
||||
doTestInTransaction(new Test<Void>()
|
||||
{
|
||||
@Override
|
||||
public Void run() throws Exception
|
||||
{
|
||||
NodeRef hold101 = holdService.createHold(filePlan, "freezename 103", "FreezeReason", null);
|
||||
// Freeze a record folder
|
||||
assertNotNull(hold101);
|
||||
holdService.addToHold(hold101, rmFolder);
|
||||
assertTrue(recordFolderService.isRecordFolder(rmFolder));
|
||||
assertTrue(freezeService.isFrozenOrHasFrozenChildren(rmFolder));
|
||||
return null;
|
||||
}
|
||||
});
|
||||
|
||||
doTestInTransaction(new Test<Void>()
|
||||
{
|
||||
@Override
|
||||
public Void run() throws Exception
|
||||
{
|
||||
NodeRef hold101 = holdService.createHold(filePlan, "freezename 104", "FreezeReason", null);
|
||||
// Freeze a record inside a record folder
|
||||
assertNotNull(hold101);
|
||||
holdService.addToHold(hold101, recordThree);
|
||||
assertTrue(recordService.isRecord(recordThree));
|
||||
assertTrue(freezeService.isFrozenOrHasFrozenChildren(rmFolder));
|
||||
return null;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@@ -59,6 +59,7 @@ import org.alfresco.module.org_alfresco_module_rm.security.ExtendedSecurityServi
|
||||
import org.alfresco.module.org_alfresco_module_rm.security.FilePlanPermissionService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.util.RMContainerCacheManager;
|
||||
import org.alfresco.module.org_alfresco_module_rm.vital.VitalRecordService;
|
||||
import org.alfresco.repo.model.Repository;
|
||||
import org.alfresco.repo.policy.BehaviourFilter;
|
||||
import org.alfresco.repo.policy.PolicyComponent;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
@@ -150,6 +151,7 @@ public abstract class BaseRMTestCase extends RetryingTransactionHelperTestCase
|
||||
protected OwnableService ownableService;
|
||||
protected VersionService versionService;
|
||||
protected DocumentLinkService documentLinkService;
|
||||
protected Repository repositoryHelper;
|
||||
|
||||
/** RM Services */
|
||||
protected DispositionService dispositionService;
|
||||
@@ -405,6 +407,7 @@ public abstract class BaseRMTestCase extends RetryingTransactionHelperTestCase
|
||||
ownableService = (OwnableService)applicationContext.getBean("OwnableService");
|
||||
versionService = (VersionService)applicationContext.getBean("VersionService");
|
||||
documentLinkService = (DocumentLinkService)applicationContext.getBean("DocumentLinkService");
|
||||
repositoryHelper = (Repository)applicationContext.getBean("repositoryHelper");
|
||||
|
||||
// Get RM services
|
||||
dispositionService = (DispositionService)applicationContext.getBean("DispositionService");
|
||||
|
@@ -82,8 +82,10 @@ public class CommonRMTestUtils implements RecordsManagementModel
|
||||
public static final String DEFAULT_DISPOSITION_INSTRUCTIONS = "disposition instructions";
|
||||
public static final String DEFAULT_DISPOSITION_DESCRIPTION = "disposition action description";
|
||||
public static final String DEFAULT_EVENT_NAME = "case_closed";
|
||||
public static final String SEPARATION_EVENT_NAME = "separation";
|
||||
public static final String PERIOD_NONE = "none|0";
|
||||
public static final String PERIOD_IMMEDIATELY = "immediately|0";
|
||||
public static final String PERIOD_ONE_DAY = "day|1";
|
||||
public static final String PERIOD_FIVE_DAYS = "day|5";
|
||||
public static final String PERIOD_TEN_DAYS = "day|10";
|
||||
public static final String PERIOD_ONE_WEEK = "week|1";
|
||||
|
@@ -27,8 +27,9 @@
|
||||
|
||||
package org.alfresco.module.org_alfresco_module_rm.action.dm;
|
||||
|
||||
import static org.mockito.Matchers.any;
|
||||
import static org.mockito.Matchers.eq;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.ArgumentMatchers.eq;
|
||||
import static org.mockito.ArgumentMatchers.nullable;
|
||||
import static org.mockito.Mockito.doReturn;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.never;
|
||||
@@ -352,7 +353,7 @@ public class DeclareAsVersionRecordActionUnitTest extends BaseActionUnitTest
|
||||
private void setupMockedAspects()
|
||||
{
|
||||
doReturn(true).when(mockedNodeService).exists(actionedUponNodeRef);
|
||||
doReturn(true).when(mockedDictionaryService).isSubClass(any(QName.class), eq(ContentModel.TYPE_CONTENT));
|
||||
doReturn(true).when(mockedDictionaryService).isSubClass(nullable(QName.class), eq(ContentModel.TYPE_CONTENT));
|
||||
doReturn(true).when(mockedNodeService).hasAspect(actionedUponNodeRef, ContentModel.ASPECT_VERSIONABLE);
|
||||
doReturn(false).when(mockedNodeService).hasAspect(actionedUponNodeRef, ASPECT_RECORD);
|
||||
doReturn(false).when(mockedNodeService).hasAspect(actionedUponNodeRef, ContentModel.ASPECT_WORKING_COPY);
|
||||
|
@@ -36,15 +36,13 @@ import org.junit.Test;
|
||||
import org.mockito.InjectMocks;
|
||||
import org.mockito.Mock;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import static org.mockito.Matchers.any;
|
||||
import static org.mockito.Matchers.eq;
|
||||
import static org.mockito.Matchers.isNull;
|
||||
import static org.mockito.ArgumentMatchers.anyMap;
|
||||
import static org.mockito.ArgumentMatchers.eq;
|
||||
import static org.mockito.ArgumentMatchers.isNull;
|
||||
import static org.mockito.ArgumentMatchers.nullable;
|
||||
import static org.mockito.Mockito.times;
|
||||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.when;
|
||||
import static org.mockito.MockitoAnnotations.initMocks;
|
||||
|
||||
/**
|
||||
* Unit tests for {@link AddToHoldAuditEvent}.
|
||||
@@ -67,8 +65,6 @@ public class AddToHoldAuditEventUnitTest extends BaseUnitTest
|
||||
@Before
|
||||
public void setUp()
|
||||
{
|
||||
initMocks(this);
|
||||
|
||||
holdNodeRef = generateNodeRef();
|
||||
String holdName = "Hold " + GUID.generate();
|
||||
|
||||
@@ -87,6 +83,6 @@ public class AddToHoldAuditEventUnitTest extends BaseUnitTest
|
||||
public void testAddToHoldCausesAuditEvent()
|
||||
{
|
||||
addToHoldAuditEvent.onAddToHold(holdNodeRef, contentNodeRef);
|
||||
verify(mockedRecordsManagementAuditService, times(1)).auditEvent(eq(contentNodeRef), any(String.class), isNull(Map.class), any(Map.class), eq(true), eq(false));
|
||||
verify(mockedRecordsManagementAuditService, times(1)).auditEvent(eq(contentNodeRef), nullable(String.class), isNull(), anyMap(), eq(true), eq(false));
|
||||
}
|
||||
}
|
||||
|
@@ -37,15 +37,13 @@ import org.junit.Test;
|
||||
import org.mockito.InjectMocks;
|
||||
import org.mockito.Mock;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import static org.mockito.Matchers.any;
|
||||
import static org.mockito.Matchers.eq;
|
||||
import static org.mockito.Matchers.isNull;
|
||||
import static org.mockito.ArgumentMatchers.anyMap;
|
||||
import static org.mockito.ArgumentMatchers.eq;
|
||||
import static org.mockito.ArgumentMatchers.isNull;
|
||||
import static org.mockito.ArgumentMatchers.nullable;
|
||||
import static org.mockito.Mockito.times;
|
||||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.when;
|
||||
import static org.mockito.MockitoAnnotations.initMocks;
|
||||
|
||||
/**
|
||||
* Unit tests for {@link CreateHoldAuditEvent}.
|
||||
@@ -68,8 +66,6 @@ public class CreateHoldAuditEventUnitTest extends BaseUnitTest
|
||||
@Before
|
||||
public void setUp()
|
||||
{
|
||||
initMocks(this);
|
||||
|
||||
holdNodeRef = generateNodeRef();
|
||||
String holdName = "Hold " + GUID.generate();
|
||||
String holdReason = "Reason " + GUID.generate();
|
||||
@@ -88,6 +84,6 @@ public class CreateHoldAuditEventUnitTest extends BaseUnitTest
|
||||
public void testCreateHoldCausesAuditEvent()
|
||||
{
|
||||
createHoldAuditEvent.onCreateNode(childAssociationRef);
|
||||
verify(mockedRecordsManagementAuditService, times(1)).auditEvent(eq(holdNodeRef), any(String.class), isNull(Map.class), any(Map.class));
|
||||
verify(mockedRecordsManagementAuditService, times(1)).auditEvent(eq(holdNodeRef), nullable(String.class), isNull(), anyMap());
|
||||
}
|
||||
}
|
||||
|
@@ -34,18 +34,15 @@ import org.alfresco.util.GUID;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.mockito.InjectMocks;
|
||||
import org.mockito.Matchers;
|
||||
import org.mockito.Mock;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import static org.mockito.Matchers.any;
|
||||
import static org.mockito.Matchers.eq;
|
||||
import static org.mockito.Matchers.isNull;
|
||||
import static org.mockito.ArgumentMatchers.anyMap;
|
||||
import static org.mockito.ArgumentMatchers.eq;
|
||||
import static org.mockito.ArgumentMatchers.isNull;
|
||||
import static org.mockito.ArgumentMatchers.nullable;
|
||||
import static org.mockito.Mockito.times;
|
||||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.when;
|
||||
import static org.mockito.MockitoAnnotations.initMocks;
|
||||
|
||||
/**
|
||||
* Unit tests for {@link DeleteHoldAuditEvent}.
|
||||
@@ -67,8 +64,6 @@ public class DeleteHoldAuditEventUnitTest extends BaseUnitTest
|
||||
@Before
|
||||
public void setUp()
|
||||
{
|
||||
initMocks(this);
|
||||
|
||||
holdNodeRef = generateNodeRef();
|
||||
String holdName = "Hold " + GUID.generate();
|
||||
|
||||
@@ -84,6 +79,6 @@ public class DeleteHoldAuditEventUnitTest extends BaseUnitTest
|
||||
{
|
||||
deleteHoldAuditEvent.beforeDeleteNode(holdNodeRef);
|
||||
verify(mockedRecordsManagementAuditService, times(1))
|
||||
.auditEvent(eq(holdNodeRef), any(String.class), any(Map.class), isNull(Map.class), Matchers.eq(true), Matchers.eq(false));
|
||||
.auditEvent(eq(holdNodeRef), nullable(String.class), anyMap(), isNull(), eq(true), eq(false));
|
||||
}
|
||||
}
|
||||
|
@@ -27,25 +27,24 @@
|
||||
|
||||
package org.alfresco.module.org_alfresco_module_rm.audit.event;
|
||||
|
||||
import static org.mockito.Matchers.any;
|
||||
import static org.mockito.Matchers.eq;
|
||||
import static org.mockito.Matchers.isNull;
|
||||
import static org.mockito.ArgumentMatchers.anyMap;
|
||||
import static org.mockito.ArgumentMatchers.eq;
|
||||
import static org.mockito.ArgumentMatchers.isNull;
|
||||
import static org.mockito.ArgumentMatchers.nullable;
|
||||
import static org.mockito.Mockito.lenient;
|
||||
import static org.mockito.Mockito.times;
|
||||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.when;
|
||||
import static org.mockito.MockitoAnnotations.initMocks;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.module.org_alfresco_module_rm.test.util.BaseUnitTest;
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.util.GUID;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.InjectMocks;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.junit.MockitoJUnitRunner;
|
||||
|
||||
/**
|
||||
* Unit tests for {@link RemoveFromHoldAuditEvent}.
|
||||
@@ -53,6 +52,7 @@ import org.mockito.Mock;
|
||||
* @author Chris Shields
|
||||
* @since 3.3
|
||||
*/
|
||||
@RunWith(MockitoJUnitRunner.class)
|
||||
public class RemoveFromHoldAuditEventUnitTest extends BaseUnitTest
|
||||
{
|
||||
@InjectMocks
|
||||
@@ -70,16 +70,14 @@ public class RemoveFromHoldAuditEventUnitTest extends BaseUnitTest
|
||||
@Before
|
||||
public void setUp()
|
||||
{
|
||||
initMocks(this);
|
||||
|
||||
holdNodeRef = generateNodeRef();
|
||||
String holdName = "Hold " + GUID.generate();
|
||||
|
||||
contentNodeRef = generateNodeRef();
|
||||
String contentName = "Content " + GUID.generate();
|
||||
|
||||
when(mockedNodeService.getProperty(holdNodeRef, PROP_NAME)).thenReturn(holdName);
|
||||
when(mockedNodeService.getProperty(contentNodeRef, PROP_NAME)).thenReturn(contentName);
|
||||
lenient().when(mockedNodeService.getProperty(holdNodeRef, PROP_NAME)).thenReturn(holdName);
|
||||
lenient().when(mockedNodeService.getProperty(contentNodeRef, PROP_NAME)).thenReturn(contentName);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -89,7 +87,7 @@ public class RemoveFromHoldAuditEventUnitTest extends BaseUnitTest
|
||||
public void testRemoveFromHoldCausesAuditEvent()
|
||||
{
|
||||
removeFromHoldAuditEvent.onRemoveFromHold(holdNodeRef, contentNodeRef);
|
||||
verify(mockedRecordsManagementAuditService, times(1)).auditEvent(eq(contentNodeRef), any(String.class), any(Map.class), isNull(Map.class), eq(true));
|
||||
verify(mockedRecordsManagementAuditService, times(1)).auditEvent(eq(contentNodeRef), nullable(String.class), anyMap(), isNull(), eq(true));
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -28,14 +28,14 @@
|
||||
package org.alfresco.module.org_alfresco_module_rm.forms;
|
||||
|
||||
import static org.alfresco.module.org_alfresco_module_rm.test.util.AlfMock.generateQName;
|
||||
import static org.mockito.Matchers.any;
|
||||
import static org.mockito.Matchers.anyListOf;
|
||||
import static org.mockito.Matchers.anyString;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.ArgumentMatchers.anyList;
|
||||
import static org.mockito.ArgumentMatchers.nullable;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.never;
|
||||
import static org.mockito.Mockito.times;
|
||||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.verifyZeroInteractions;
|
||||
import static org.mockito.Mockito.verifyNoMoreInteractions;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -45,7 +45,6 @@ import java.util.Map;
|
||||
|
||||
import org.alfresco.module.org_alfresco_module_rm.admin.RecordsManagementAdminService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.test.util.BaseUnitTest;
|
||||
import org.alfresco.repo.forms.Field;
|
||||
import org.alfresco.repo.forms.FieldDefinition;
|
||||
import org.alfresco.repo.forms.Form;
|
||||
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
|
||||
@@ -81,7 +80,7 @@ public class RecordsManagementTypeFormFilterUnitTest extends BaseUnitTest
|
||||
public void testAddCustomRMPropertiesNoneFound()
|
||||
{
|
||||
typeFormFilter.addCustomRMProperties(MY_CUSTOM_TYPE, mockForm);
|
||||
verifyZeroInteractions(mockForm);
|
||||
verifyNoMoreInteractions(mockForm);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -130,8 +129,8 @@ public class RecordsManagementTypeFormFilterUnitTest extends BaseUnitTest
|
||||
|
||||
typeFormFilter.afterGenerate(mockTypeDefinition, null, null, mockForm, null);
|
||||
|
||||
verify(mockedIdentifierService).generateIdentifier(any(QName.class), any(NodeRef.class));
|
||||
verify(idDef).setDefaultValue(anyString());
|
||||
verify(mockedIdentifierService).generateIdentifier(nullable(QName.class), nullable(NodeRef.class));
|
||||
verify(idDef).setDefaultValue(nullable(String.class));
|
||||
verify(vrDef).setDefaultValue(Boolean.FALSE.toString());
|
||||
verify(rpDef).setDefaultValue("none|0");
|
||||
}
|
||||
@@ -162,7 +161,7 @@ public class RecordsManagementTypeFormFilterUnitTest extends BaseUnitTest
|
||||
typeFormFilter.addCustomRMProperties(MY_CUSTOM_TYPE, mockForm);
|
||||
|
||||
// ensure that two custom properties have been added to the form
|
||||
verify(mockForm, times(1)).addFields(anyListOf(Field.class));
|
||||
verify(mockForm, times(1)).addFields(anyList());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -30,16 +30,16 @@ package org.alfresco.module.org_alfresco_module_rm.job;
|
||||
import static org.alfresco.module.org_alfresco_module_rm.test.util.AlfMock.generateQName;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.mockito.Matchers.any;
|
||||
import static org.mockito.Matchers.anyMap;
|
||||
import static org.mockito.Matchers.eq;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.ArgumentMatchers.anyBoolean;
|
||||
import static org.mockito.ArgumentMatchers.anyMap;
|
||||
import static org.mockito.ArgumentMatchers.eq;
|
||||
import static org.mockito.Mockito.doAnswer;
|
||||
import static org.mockito.Mockito.doReturn;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.times;
|
||||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.verifyNoMoreInteractions;
|
||||
import static org.mockito.Mockito.verifyZeroInteractions;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import java.util.Arrays;
|
||||
@@ -57,7 +57,6 @@ import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.mockito.ArgumentCaptor;
|
||||
import org.mockito.InjectMocks;
|
||||
import org.mockito.Matchers;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.stubbing.Answer;
|
||||
|
||||
@@ -98,7 +97,7 @@ public class DispositionLifecycleJobExecuterUnitTest extends BaseUnitTest
|
||||
return callback.execute();
|
||||
};
|
||||
doAnswer(doInTransactionAnswer).when(mockedRetryingTransactionHelper).doInTransaction(any(RetryingTransactionCallback.class),
|
||||
Matchers.anyBoolean(), Matchers.anyBoolean());
|
||||
anyBoolean(), anyBoolean());
|
||||
|
||||
// setup data
|
||||
List<String> dispositionActions = buildList(CUTOFF, RETAIN);
|
||||
@@ -141,7 +140,7 @@ public class DispositionLifecycleJobExecuterUnitTest extends BaseUnitTest
|
||||
verifyQueryTimes(1);
|
||||
|
||||
// ensure nothing else happens becuase we have no results
|
||||
verifyZeroInteractions(mockedNodeService, mockedRecordFolderService, mockedRetryingTransactionHelper);
|
||||
verifyNoMoreInteractions(mockedNodeService, mockedRecordFolderService, mockedRetryingTransactionHelper);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -178,7 +177,7 @@ public class DispositionLifecycleJobExecuterUnitTest extends BaseUnitTest
|
||||
// ensure work is executed in transaction for each node processed
|
||||
verify(mockedNodeService, times(2)).exists(any(NodeRef.class));
|
||||
verify(mockedRetryingTransactionHelper, times(2)).doInTransaction(any(RetryingTransactionCallback.class),
|
||||
Matchers.anyBoolean(), Matchers.anyBoolean());
|
||||
anyBoolean(), anyBoolean());
|
||||
|
||||
// ensure each node is process correctly
|
||||
verify(mockedNodeService, times(1)).getProperty(node1, RecordsManagementModel.PROP_DISPOSITION_ACTION);
|
||||
@@ -186,7 +185,7 @@ public class DispositionLifecycleJobExecuterUnitTest extends BaseUnitTest
|
||||
|
||||
// ensure no more interactions
|
||||
verifyNoMoreInteractions(mockedNodeService);
|
||||
verifyZeroInteractions(mockedRecordsManagementActionService);
|
||||
verifyNoMoreInteractions(mockedRecordsManagementActionService);
|
||||
|
||||
}
|
||||
|
||||
@@ -216,7 +215,7 @@ public class DispositionLifecycleJobExecuterUnitTest extends BaseUnitTest
|
||||
|
||||
// ensure no more interactions
|
||||
verifyNoMoreInteractions(mockedNodeService);
|
||||
verifyZeroInteractions(mockedRecordsManagementActionService);
|
||||
verifyNoMoreInteractions(mockedRecordsManagementActionService);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -235,6 +234,9 @@ public class DispositionLifecycleJobExecuterUnitTest extends BaseUnitTest
|
||||
doReturn(CUTOFF).when(mockedNodeService).getProperty(node1, RecordsManagementModel.PROP_DISPOSITION_ACTION);
|
||||
doReturn(RETAIN).when(mockedNodeService).getProperty(node2, RecordsManagementModel.PROP_DISPOSITION_ACTION);
|
||||
doReturn(parentAssoc).when(mockedNodeService).getPrimaryParent(any(NodeRef.class));
|
||||
doReturn(false).when(mockedRecordFolderService).isRecordFolder(parentAssoc.getParentRef());
|
||||
doReturn(true).when(mockedRecordService).isRecord(parentAssoc.getParentRef());
|
||||
doReturn(false).when(mockedFreezeService).isFrozen(parentAssoc.getParentRef());
|
||||
|
||||
when(mockedResultSet.getNodeRefs())
|
||||
.thenReturn(buildList(node1))
|
||||
@@ -255,7 +257,7 @@ public class DispositionLifecycleJobExecuterUnitTest extends BaseUnitTest
|
||||
// ensure work is executed in transaction for each node processed
|
||||
verify(mockedNodeService, times(2)).exists(any(NodeRef.class));
|
||||
verify(mockedRetryingTransactionHelper, times(2)).doInTransaction(any(RetryingTransactionCallback.class),
|
||||
Matchers.anyBoolean(), Matchers.anyBoolean());
|
||||
anyBoolean(), anyBoolean());
|
||||
|
||||
// ensure each node is process correctly
|
||||
// node1
|
||||
@@ -304,7 +306,7 @@ public class DispositionLifecycleJobExecuterUnitTest extends BaseUnitTest
|
||||
|
||||
// mock the search service to return the right page
|
||||
when(mockedSearchService.query(any(SearchParameters.class))).thenAnswer((Answer<ResultSet>) invocation -> {
|
||||
SearchParameters params = invocation.getArgumentAt(0, SearchParameters.class);
|
||||
SearchParameters params = invocation.getArgument(0, SearchParameters.class);
|
||||
if (params.getSkipCount() == 0)
|
||||
{
|
||||
// mock first page
|
||||
|
@@ -27,17 +27,15 @@
|
||||
package org.alfresco.module.org_alfresco_module_rm.model.rma.aspect;
|
||||
|
||||
import static org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel.ASPECT_HELD_CHILDREN;
|
||||
import static org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel.ASPECT_RECORD;
|
||||
import static org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel.PROP_HELD_CHILDREN_COUNT;
|
||||
import static org.mockito.Matchers.any;
|
||||
import static org.mockito.Matchers.anyMap;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.ArgumentMatchers.anyMap;
|
||||
import static org.mockito.Mockito.times;
|
||||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.freeze.FreezeService;
|
||||
@@ -51,24 +49,22 @@ import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.InjectMocks;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.MockitoAnnotations;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.mockito.junit.MockitoJUnitRunner;
|
||||
|
||||
/**
|
||||
* Test class for frozen aspect
|
||||
* @author Ross Gale
|
||||
* @since 3.2
|
||||
*/
|
||||
@RunWith(MockitoJUnitRunner.class)
|
||||
public class FrozenAspectUnitTest
|
||||
{
|
||||
@Mock
|
||||
private NodeService mockNodeService;
|
||||
|
||||
@Mock
|
||||
private ApplicationContext mockApplicationContext;
|
||||
|
||||
@Mock
|
||||
private ChildAssociationRef mockChildAssociationRef;
|
||||
|
||||
@@ -90,9 +86,6 @@ public class FrozenAspectUnitTest
|
||||
@Mock
|
||||
private ChildAssociationRef mockOldRef;
|
||||
|
||||
@Mock
|
||||
private Set mockSet;
|
||||
|
||||
@Mock
|
||||
private PropertyModificationAllowedCheck mockPropertyModificationAllowedCheck;
|
||||
|
||||
@@ -110,18 +103,17 @@ public class FrozenAspectUnitTest
|
||||
@Before
|
||||
public void setUp()
|
||||
{
|
||||
MockitoAnnotations.initMocks(this);
|
||||
when(mockNodeService.exists(record)).thenReturn(true);
|
||||
when(mockNodeService.getType(record)).thenReturn(ContentModel.TYPE_CONTENT);
|
||||
when(mockedNodeTypeUtility.instanceOf(mockNodeService.getType(record), ContentModel.TYPE_CONTENT)).thenReturn(true);
|
||||
when(mockNodeService.exists(content)).thenReturn(true);
|
||||
when(mockNodeService.hasAspect(folder, ASPECT_HELD_CHILDREN)).thenReturn(true);
|
||||
when(mockNodeService.getProperty(folder, PROP_HELD_CHILDREN_COUNT)).thenReturn(1);
|
||||
when(mockApplicationContext.getBean("dbNodeService")).thenReturn(mockNodeService);
|
||||
when(mockFreezeService.isFrozen(content)).thenReturn(false);
|
||||
children.add(mockChildRef);
|
||||
when(mockNodeService.getChildAssocs(content)).thenReturn(children);
|
||||
when(mockChildRef.isPrimary()).thenReturn(true);
|
||||
frozenAspect.setNodeService(mockNodeService);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -142,7 +134,6 @@ public class FrozenAspectUnitTest
|
||||
@Test
|
||||
public void testRemoveAspectForContent()
|
||||
{
|
||||
when(mockNodeService.hasAspect(content, ASPECT_RECORD)).thenReturn(false);
|
||||
when(mockNodeService.getType(content)).thenReturn(ContentModel.TYPE_CONTENT);
|
||||
when(mockedNodeTypeUtility.instanceOf(mockNodeService.getType(content), ContentModel.TYPE_CONTENT)).thenReturn(true);
|
||||
when(mockNodeService.getPrimaryParent(content)).thenReturn(mockChildAssociationRef);
|
||||
@@ -157,7 +148,6 @@ public class FrozenAspectUnitTest
|
||||
@Test
|
||||
public void testRemoveAspectForContentDoesntUpdateForOtherTypes()
|
||||
{
|
||||
when(mockNodeService.hasAspect(content, ASPECT_RECORD)).thenReturn(false);
|
||||
when(mockNodeService.getType(content)).thenReturn(ContentModel.TYPE_FOLDER);
|
||||
when(mockedNodeTypeUtility.instanceOf(mockNodeService.getType(content), ContentModel.TYPE_CONTENT)).thenReturn(false);
|
||||
frozenAspect.onRemoveAspect(content, null);
|
||||
@@ -233,7 +223,6 @@ public class FrozenAspectUnitTest
|
||||
@Test(expected = PermissionDeniedException.class)
|
||||
public void testBeforeMoveThrowsExceptionForFrozenNode()
|
||||
{
|
||||
when(mockOldRef.getParentRef()).thenReturn(parent);
|
||||
when(mockOldRef.getChildRef()).thenReturn(child);
|
||||
when(mockNodeService.exists(child)).thenReturn(true);
|
||||
when(mockFreezeService.isFrozen(child)).thenReturn(true);
|
||||
@@ -247,8 +236,6 @@ public class FrozenAspectUnitTest
|
||||
public void testUpdatePropertiesThrowsExceptionForFrozenNode()
|
||||
{
|
||||
when(mockFreezeService.isFrozen(content)).thenReturn(true);
|
||||
when(mockResourceHelper.getSet(content)).thenReturn(mockSet);
|
||||
when(mockSet.contains("frozen")).thenReturn(false);
|
||||
when(mockPropertyModificationAllowedCheck.check(null, null)).thenReturn(false);
|
||||
frozenAspect.onUpdateProperties(content, null, null);
|
||||
}
|
||||
|
@@ -33,7 +33,6 @@ import static org.alfresco.module.org_alfresco_module_rm.model.RecordsManagement
|
||||
import static org.mockito.Mockito.times;
|
||||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.when;
|
||||
import static org.mockito.MockitoAnnotations.initMocks;
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.security.ExtendedSecurityService;
|
||||
@@ -43,14 +42,17 @@ import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.InjectMocks;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.junit.MockitoJUnitRunner;
|
||||
|
||||
/**
|
||||
* Unit tests for the {@link RecordAspect}.
|
||||
*
|
||||
* @author Claudia Agache
|
||||
*/
|
||||
@RunWith(MockitoJUnitRunner.class)
|
||||
public class RecordAspectUnitTest
|
||||
{
|
||||
private static final NodeRef NODE_REF = new NodeRef("node://Ref/");
|
||||
@@ -72,7 +74,7 @@ public class RecordAspectUnitTest
|
||||
@Before
|
||||
public void setUp()
|
||||
{
|
||||
initMocks(this);
|
||||
recordAspect.setNodeService(mockNodeService);
|
||||
}
|
||||
|
||||
/** Check that the bin is duplicated before adding the aspect if the file has a copy. */
|
||||
|
@@ -45,13 +45,15 @@ import org.alfresco.service.cmr.repository.StoreRef;
|
||||
import org.alfresco.util.GUID;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.InjectMocks;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.MockitoAnnotations;
|
||||
import org.mockito.junit.MockitoJUnitRunner;
|
||||
|
||||
/**
|
||||
* @author silviudinuta
|
||||
*/
|
||||
@RunWith(MockitoJUnitRunner.class)
|
||||
public class NonElectronicRecordTypeUnitTest implements RecordsManagementModel, ContentModel
|
||||
{
|
||||
private final static NodeRef CHILD_NODE_REF = new NodeRef(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE,
|
||||
@@ -74,17 +76,15 @@ public class NonElectronicRecordTypeUnitTest implements RecordsManagementModel,
|
||||
@Before
|
||||
public void setUp()
|
||||
{
|
||||
MockitoAnnotations.initMocks(this);
|
||||
MockAuthenticationUtilHelper.setup(mockAuthenticationUtil);
|
||||
when(mockedNodeService.exists(CHILD_NODE_REF)).thenReturn(true);
|
||||
when(mockedNodeService.exists(PARENT_NODE_REF)).thenReturn(true);
|
||||
|
||||
ChildAssociationRef generateChildAssociationRef = mock(ChildAssociationRef.class);
|
||||
when(generateChildAssociationRef.getParentRef()).thenReturn(PARENT_NODE_REF);
|
||||
when(generateChildAssociationRef.getChildRef()).thenReturn(CHILD_NODE_REF);
|
||||
|
||||
when(mockedNodeService.getPrimaryParent(CHILD_NODE_REF)).thenReturn(generateChildAssociationRef);
|
||||
when(mockedNodeService.getType(PARENT_NODE_REF)).thenReturn(TYPE_UNFILED_RECORD_FOLDER);
|
||||
nonElectronicRecordType.setNodeService(mockedNodeService);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@@ -27,6 +27,7 @@
|
||||
|
||||
package org.alfresco.module.org_alfresco_module_rm.script.hold;
|
||||
|
||||
import static org.mockito.Mockito.lenient;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -71,8 +72,8 @@ public abstract class BaseHoldWebScriptUnitTest extends BaseWebScriptUnitTest
|
||||
|
||||
// generate active content
|
||||
dmNodeRef = generateNodeRef(TYPE_CONTENT);
|
||||
when(mockedExtendedPermissionService.hasPermission(dmNodeRef, PermissionService.WRITE)).thenReturn(AccessStatus.ALLOWED);
|
||||
when(mockedDictionaryService.isSubClass(mockedNodeService.getType(dmNodeRef), ContentModel.TYPE_CONTENT)).thenReturn(true);
|
||||
lenient().when(mockedExtendedPermissionService.hasPermission(dmNodeRef, PermissionService.WRITE)).thenReturn(AccessStatus.ALLOWED);
|
||||
lenient().when(mockedDictionaryService.isSubClass(mockedNodeService.getType(dmNodeRef), ContentModel.TYPE_CONTENT)).thenReturn(true);
|
||||
|
||||
// list of active contents
|
||||
activeContents = Collections.singletonList(dmNodeRef);
|
||||
|
@@ -37,9 +37,12 @@ import java.util.List;
|
||||
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.json.JSONObject;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.InjectMocks;
|
||||
import org.mockito.Spy;
|
||||
import org.mockito.junit.MockitoJUnitRunner;
|
||||
import org.springframework.extensions.webscripts.DeclarativeWebScript;
|
||||
|
||||
/**
|
||||
@@ -48,6 +51,7 @@ import org.springframework.extensions.webscripts.DeclarativeWebScript;
|
||||
* @author Roy Wetherall
|
||||
* @since 2.2
|
||||
*/
|
||||
@RunWith(MockitoJUnitRunner.class)
|
||||
public class HoldPutUnitTest extends BaseHoldWebScriptWithContentUnitTest
|
||||
{
|
||||
/** classpath location of ftl template for web script */
|
||||
@@ -77,6 +81,12 @@ public class HoldPutUnitTest extends BaseHoldWebScriptWithContentUnitTest
|
||||
/**
|
||||
* Test that a record can be removed from holds.
|
||||
*/
|
||||
|
||||
@Before
|
||||
public void setUp(){
|
||||
webScript.setHoldService(mockedHoldService);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test
|
||||
public void removeRecordFromHolds() throws Exception
|
||||
|
@@ -34,11 +34,12 @@ import static org.alfresco.service.cmr.security.PermissionService.GROUP_PREFIX;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.mockito.Matchers.any;
|
||||
import static org.mockito.Matchers.anySet;
|
||||
import static org.mockito.Matchers.anyString;
|
||||
import static org.mockito.Matchers.eq;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.ArgumentMatchers.anySet;
|
||||
import static org.mockito.ArgumentMatchers.anyString;
|
||||
import static org.mockito.ArgumentMatchers.eq;
|
||||
import static org.mockito.Mockito.doAnswer;
|
||||
import static org.mockito.Mockito.lenient;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.never;
|
||||
import static org.mockito.Mockito.verify;
|
||||
@@ -75,10 +76,11 @@ import org.alfresco.service.namespace.RegexQNamePattern;
|
||||
import org.alfresco.service.transaction.TransactionService;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.InjectMocks;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.MockitoAnnotations;
|
||||
import org.mockito.invocation.InvocationOnMock;
|
||||
import org.mockito.junit.MockitoJUnitRunner;
|
||||
import org.mockito.stubbing.Answer;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.event.ContextRefreshedEvent;
|
||||
@@ -89,6 +91,7 @@ import org.springframework.context.event.ContextRefreshedEvent;
|
||||
* @author Roy Wetherall
|
||||
* @since 2.5
|
||||
*/
|
||||
@RunWith(MockitoJUnitRunner.class)
|
||||
public class ExtendedSecurityServiceImplUnitTest
|
||||
{
|
||||
/** service mocks*/
|
||||
@@ -145,9 +148,6 @@ public class ExtendedSecurityServiceImplUnitTest
|
||||
@SuppressWarnings("unchecked")
|
||||
@Before public void before()
|
||||
{
|
||||
// initialise mocks
|
||||
MockitoAnnotations.initMocks(this);
|
||||
|
||||
// setup node
|
||||
nodeRef = AlfMock.generateNodeRef(mockedNodeService);
|
||||
|
||||
@@ -157,7 +157,7 @@ public class ExtendedSecurityServiceImplUnitTest
|
||||
.thenReturn(filePlan);
|
||||
|
||||
// set-up application context
|
||||
when(mockedApplicationContext.getBean("dbNodeService"))
|
||||
lenient().when(mockedApplicationContext.getBean("dbNodeService"))
|
||||
.thenReturn(mockedNodeService);
|
||||
|
||||
// setup retrying transaction helper
|
||||
@@ -199,6 +199,7 @@ public class ExtendedSecurityServiceImplUnitTest
|
||||
.forEach((a) ->
|
||||
when(mockedAuthorityService.authorityExists(a))
|
||||
.thenReturn(true));
|
||||
extendedSecurityService.setNodeService(mockedNodeService);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -481,7 +482,7 @@ public class ExtendedSecurityServiceImplUnitTest
|
||||
.thenReturn(mockedWritePagingResults);
|
||||
|
||||
// setup exact match
|
||||
when(mockedAuthorityService.authorityExists(GROUP_PREFIX + writeGroup))
|
||||
lenient().when(mockedAuthorityService.authorityExists(GROUP_PREFIX + writeGroup))
|
||||
.thenReturn(true);
|
||||
when(mockedAuthorityService.getContainedAuthorities(null, GROUP_PREFIX + readGroup, true))
|
||||
.thenReturn(Stream
|
||||
@@ -560,7 +561,7 @@ public class ExtendedSecurityServiceImplUnitTest
|
||||
.thenReturn(mockedWritePagingResults);
|
||||
|
||||
// setup exact match
|
||||
when(mockedAuthorityService.authorityExists(GROUP_PREFIX + writeGroup))
|
||||
lenient().when(mockedAuthorityService.authorityExists(GROUP_PREFIX + writeGroup))
|
||||
.thenReturn(true);
|
||||
when(mockedAuthorityService.getContainedAuthorities(null, GROUP_PREFIX + readGroup, true))
|
||||
.thenReturn(Stream
|
||||
@@ -651,7 +652,7 @@ public class ExtendedSecurityServiceImplUnitTest
|
||||
.thenReturn(mockedWritePagingResults);
|
||||
|
||||
// setup exact match
|
||||
when(mockedAuthorityService.authorityExists(GROUP_PREFIX + writeGroup))
|
||||
lenient().when(mockedAuthorityService.authorityExists(GROUP_PREFIX + writeGroup))
|
||||
.thenReturn(true);
|
||||
when(mockedAuthorityService.getContainedAuthorities(null, GROUP_PREFIX + readGroup, true))
|
||||
.thenReturn(Stream
|
||||
|
@@ -27,8 +27,9 @@
|
||||
|
||||
package org.alfresco.module.org_alfresco_module_rm.test.util;
|
||||
|
||||
import static org.mockito.Matchers.eq;
|
||||
import static org.mockito.ArgumentMatchers.eq;
|
||||
import static org.mockito.Mockito.doReturn;
|
||||
import static org.mockito.Mockito.lenient;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import java.util.UUID;
|
||||
@@ -119,7 +120,7 @@ public class AlfMock
|
||||
public static NodeRef generateNodeRef(NodeService mockedNodeService, QName type, boolean exists)
|
||||
{
|
||||
NodeRef nodeRef = new NodeRef(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, GUID.generate());
|
||||
when(mockedNodeService.exists(eq(nodeRef))).thenReturn(exists);
|
||||
lenient().when(mockedNodeService.exists(eq(nodeRef))).thenReturn(exists);
|
||||
if (type != null)
|
||||
{
|
||||
when(mockedNodeService.getType(eq(nodeRef))).thenReturn(type);
|
||||
|
@@ -28,10 +28,10 @@
|
||||
package org.alfresco.module.org_alfresco_module_rm.test.util;
|
||||
|
||||
import static org.alfresco.module.org_alfresco_module_rm.test.util.AlfMock.generateQName;
|
||||
import static org.mockito.Matchers.any;
|
||||
import static org.mockito.Matchers.eq;
|
||||
import static org.mockito.Mockito.doAnswer;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.ArgumentMatchers.eq;
|
||||
import static org.mockito.Mockito.doReturn;
|
||||
import static org.mockito.Mockito.lenient;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
@@ -168,7 +168,7 @@ public class BaseUnitTest implements RecordsManagementModel, ContentModel
|
||||
MockitoAnnotations.initMocks(this);
|
||||
|
||||
// setup application context
|
||||
doReturn(mockedNodeService).when(mockedApplicationContext).getBean("dbNodeService");
|
||||
lenient().doReturn(mockedNodeService).when(mockedApplicationContext).getBean("dbNodeService");
|
||||
|
||||
// setup retrying transaction helper
|
||||
Answer<Object> doInTransactionAnswer = new Answer<Object>()
|
||||
@@ -181,7 +181,7 @@ public class BaseUnitTest implements RecordsManagementModel, ContentModel
|
||||
return callback.execute();
|
||||
}
|
||||
};
|
||||
doAnswer(doInTransactionAnswer).when(mockedRetryingTransactionHelper).<Object>doInTransaction(any(RetryingTransactionCallback.class));
|
||||
lenient().doAnswer(doInTransactionAnswer).when(mockedRetryingTransactionHelper).<Object>doInTransaction(any(RetryingTransactionCallback.class));
|
||||
|
||||
// setup mocked authentication util
|
||||
MockAuthenticationUtilHelper.setup(mockedAuthenticationUtil);
|
||||
@@ -189,15 +189,15 @@ public class BaseUnitTest implements RecordsManagementModel, ContentModel
|
||||
// setup file plan
|
||||
filePlan = generateNodeRef(TYPE_FILE_PLAN);
|
||||
setupAsFilePlanComponent(filePlan);
|
||||
doReturn(true).when(mockedFilePlanService).isFilePlan(filePlan);
|
||||
lenient().doReturn(true).when(mockedFilePlanService).isFilePlan(filePlan);
|
||||
|
||||
// setup basic file plan component
|
||||
filePlanComponent = generateNodeRef();
|
||||
setupAsFilePlanComponent(filePlanComponent);
|
||||
|
||||
// setup namespace service
|
||||
doReturn(RM_URI).when(mockedNamespaceService).getNamespaceURI(RM_PREFIX);
|
||||
doReturn(CollectionUtils.unmodifiableSet(RM_PREFIX)).when(mockedNamespaceService).getPrefixes(RM_URI);
|
||||
lenient().doReturn(RM_URI).when(mockedNamespaceService).getNamespaceURI(RM_PREFIX);
|
||||
lenient().doReturn(CollectionUtils.unmodifiableSet(RM_PREFIX)).when(mockedNamespaceService).getPrefixes(RM_URI);
|
||||
|
||||
// setup record folder and record
|
||||
recordFolder = generateRecordFolder();
|
||||
@@ -206,10 +206,10 @@ public class BaseUnitTest implements RecordsManagementModel, ContentModel
|
||||
// set record as child of record folder
|
||||
List<ChildAssociationRef> result = new ArrayList<>(1);
|
||||
result.add(new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, recordFolder, generateQName(RM_URI), record, true, 1));
|
||||
doReturn(result).when(mockedNodeService).getChildAssocs(eq(recordFolder), eq(ContentModel.ASSOC_CONTAINS), any(QNamePattern.class));
|
||||
doReturn(result).when(mockedNodeService).getParentAssocs(record);
|
||||
doReturn(Collections.singletonList(recordFolder)).when(mockedRecordFolderService).getRecordFolders(record);
|
||||
doReturn(Collections.singletonList(record)).when(mockedRecordService).getRecords(recordFolder);
|
||||
lenient().doReturn(result).when(mockedNodeService).getChildAssocs(eq(recordFolder), eq(ContentModel.ASSOC_CONTAINS), any(QNamePattern.class));
|
||||
lenient().doReturn(result).when(mockedNodeService).getParentAssocs(record);
|
||||
lenient().doReturn(Collections.singletonList(recordFolder)).when(mockedRecordFolderService).getRecordFolders(record);
|
||||
lenient().doReturn(Collections.singletonList(record)).when(mockedRecordService).getRecords(recordFolder);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -221,7 +221,7 @@ public class BaseUnitTest implements RecordsManagementModel, ContentModel
|
||||
protected NodeRef generateHoldNodeRef(String name)
|
||||
{
|
||||
NodeRef hold = generateNodeRef(TYPE_HOLD);
|
||||
doReturn(name).when(mockedNodeService).getProperty(hold, ContentModel.PROP_NAME);
|
||||
lenient().doReturn(name).when(mockedNodeService).getProperty(hold, ContentModel.PROP_NAME);
|
||||
doReturn(true).when(mockedHoldService).isHold(hold);
|
||||
return hold;
|
||||
}
|
||||
@@ -235,7 +235,7 @@ public class BaseUnitTest implements RecordsManagementModel, ContentModel
|
||||
{
|
||||
NodeRef recordFolder = generateNodeRef(TYPE_RECORD_FOLDER);
|
||||
setupAsFilePlanComponent(recordFolder);
|
||||
doReturn(true).when(mockedRecordFolderService).isRecordFolder(recordFolder);
|
||||
lenient().doReturn(true).when(mockedRecordFolderService).isRecordFolder(recordFolder);
|
||||
return recordFolder;
|
||||
}
|
||||
|
||||
@@ -248,8 +248,8 @@ public class BaseUnitTest implements RecordsManagementModel, ContentModel
|
||||
{
|
||||
NodeRef record = generateNodeRef(ContentModel.TYPE_CONTENT);
|
||||
setupAsFilePlanComponent(record);
|
||||
doReturn(true).when(mockedNodeService).hasAspect(record, ASPECT_RECORD);
|
||||
doReturn(true).when(mockedRecordService).isRecord(record);
|
||||
lenient().doReturn(true).when(mockedNodeService).hasAspect(record, ASPECT_RECORD);
|
||||
lenient().doReturn(true).when(mockedRecordService).isRecord(record);
|
||||
return record;
|
||||
}
|
||||
|
||||
@@ -260,10 +260,10 @@ public class BaseUnitTest implements RecordsManagementModel, ContentModel
|
||||
*/
|
||||
protected void setupAsFilePlanComponent(NodeRef nodeRef)
|
||||
{
|
||||
doReturn(true).when(mockedNodeService).hasAspect(nodeRef, ASPECT_FILE_PLAN_COMPONENT);
|
||||
doReturn(true).when(mockedFilePlanService).isFilePlanComponent(nodeRef);
|
||||
doReturn(filePlan).when(mockedFilePlanService).getFilePlan(nodeRef);
|
||||
doReturn(filePlan).when(mockedNodeService).getProperty(nodeRef, PROP_ROOT_NODEREF);
|
||||
lenient().doReturn(true).when(mockedNodeService).hasAspect(nodeRef, ASPECT_FILE_PLAN_COMPONENT);
|
||||
lenient().doReturn(true).when(mockedFilePlanService).isFilePlanComponent(nodeRef);
|
||||
lenient().doReturn(filePlan).when(mockedFilePlanService).getFilePlan(nodeRef);
|
||||
lenient().doReturn(filePlan).when(mockedNodeService).getProperty(nodeRef, PROP_ROOT_NODEREF);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -297,7 +297,7 @@ public class BaseUnitTest implements RecordsManagementModel, ContentModel
|
||||
protected NodeRef generateCmContent(String name)
|
||||
{
|
||||
NodeRef nodeRef = generateNodeRef(ContentModel.TYPE_CONTENT, true);
|
||||
doReturn(name).when(mockedNodeService).getProperty(nodeRef, ContentModel.PROP_NAME);
|
||||
lenient().doReturn(name).when(mockedNodeService).getProperty(nodeRef, ContentModel.PROP_NAME);
|
||||
return nodeRef;
|
||||
}
|
||||
|
||||
@@ -312,11 +312,11 @@ public class BaseUnitTest implements RecordsManagementModel, ContentModel
|
||||
protected NodeRef generateNodeRef(QName type, boolean exists)
|
||||
{
|
||||
NodeRef nodeRef = new NodeRef(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, GUID.generate());
|
||||
when(mockedNodeService.exists(eq(nodeRef))).thenReturn(exists);
|
||||
lenient().when(mockedNodeService.exists(eq(nodeRef))).thenReturn(exists);
|
||||
if (type != null)
|
||||
{
|
||||
when(mockedNodeService.getType(eq(nodeRef))).thenReturn(type);
|
||||
when(mockedNodeTypeUtility.instanceOf(type, type)).thenReturn(true);
|
||||
lenient().when(mockedNodeService.getType(eq(nodeRef))).thenReturn(type);
|
||||
lenient().when(mockedNodeTypeUtility.instanceOf(type, type)).thenReturn(true);
|
||||
}
|
||||
return nodeRef;
|
||||
}
|
||||
@@ -334,7 +334,7 @@ public class BaseUnitTest implements RecordsManagementModel, ContentModel
|
||||
|
||||
if (parent != null)
|
||||
{
|
||||
doReturn(parent).when(mockedChildAssociationRef).getParentRef();
|
||||
lenient().doReturn(parent).when(mockedChildAssociationRef).getParentRef();
|
||||
}
|
||||
|
||||
if (child != null)
|
||||
|
@@ -29,10 +29,12 @@ package org.alfresco.module.org_alfresco_module_rm.test.util;
|
||||
|
||||
import static java.util.Collections.emptyMap;
|
||||
|
||||
import static org.mockito.ArgumentMatchers.nullable;
|
||||
import static org.mockito.Matchers.anyString;
|
||||
import static org.mockito.Matchers.eq;
|
||||
import static org.mockito.Mockito.doAnswer;
|
||||
import static org.mockito.Mockito.doReturn;
|
||||
import static org.mockito.Mockito.lenient;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
@@ -179,19 +181,19 @@ public abstract class BaseWebScriptUnitTest extends BaseUnitTest
|
||||
org.springframework.extensions.webscripts.Runtime mockedRuntime = mock(org.springframework.extensions.webscripts.Runtime.class);
|
||||
|
||||
WebScriptRequest mockedRequest = mock(WebScriptRequest.class);
|
||||
doReturn(match).when(mockedRequest).getServiceMatch();
|
||||
doReturn(mockedRuntime).when(mockedRequest).getRuntime();
|
||||
lenient().doReturn(match).when(mockedRequest).getServiceMatch();
|
||||
lenient().doReturn(mockedRuntime).when(mockedRequest).getRuntime();
|
||||
|
||||
if (content != null && !content.isEmpty())
|
||||
{
|
||||
Content mockedContent = mock(Content.class);
|
||||
doReturn(content).when(mockedContent).getContent();
|
||||
doReturn(mockedContent).when(mockedRequest).getContent();
|
||||
lenient().doReturn(content).when(mockedContent).getContent();
|
||||
lenient().doReturn(mockedContent).when(mockedRequest).getContent();
|
||||
}
|
||||
|
||||
String [] paramNames = (String[])parameters.keySet().toArray(new String[parameters.size()]);
|
||||
doReturn(paramNames).when(mockedRequest).getParameterNames();
|
||||
doAnswer(new Answer()
|
||||
lenient().doReturn(paramNames).when(mockedRequest).getParameterNames();
|
||||
lenient().doAnswer(new Answer()
|
||||
{
|
||||
@Override
|
||||
public Object answer(InvocationOnMock invocation) throws Throwable
|
||||
@@ -201,9 +203,9 @@ public abstract class BaseWebScriptUnitTest extends BaseUnitTest
|
||||
}
|
||||
|
||||
}).when(mockedRequest).getParameter(anyString());
|
||||
|
||||
doReturn(new String[0]).when(mockedRequest).getHeaderNames();
|
||||
doReturn("json").when(mockedRequest).getFormat();
|
||||
|
||||
lenient().doReturn(new String[0]).when(mockedRequest).getHeaderNames();
|
||||
lenient().doReturn("json").when(mockedRequest).getFormat();
|
||||
|
||||
return mockedRequest;
|
||||
}
|
||||
@@ -217,7 +219,7 @@ public abstract class BaseWebScriptUnitTest extends BaseUnitTest
|
||||
{
|
||||
WebScriptResponse mockedResponse = mock(WebScriptResponse.class);
|
||||
StringWriter writer = new StringWriter();
|
||||
doReturn(writer).when(mockedResponse).getWriter();
|
||||
lenient().doReturn(writer).when(mockedResponse).getWriter();
|
||||
return mockedResponse;
|
||||
}
|
||||
|
||||
@@ -230,13 +232,13 @@ public abstract class BaseWebScriptUnitTest extends BaseUnitTest
|
||||
protected Container getMockedContainer(String template) throws Exception
|
||||
{
|
||||
FormatRegistry mockedFormatRegistry = mock(FormatRegistry.class);
|
||||
doReturn("application/json").when(mockedFormatRegistry).getMimeType(anyString(), anyString());
|
||||
lenient().doReturn("application/json").when(mockedFormatRegistry).getMimeType(nullable(String.class), nullable(String.class));
|
||||
|
||||
ScriptProcessorRegistry mockedScriptProcessorRegistry = mock(ScriptProcessorRegistry.class);
|
||||
doReturn(null).when(mockedScriptProcessorRegistry).findValidScriptPath(anyString());
|
||||
lenient().doReturn(null).when(mockedScriptProcessorRegistry).findValidScriptPath(anyString());
|
||||
|
||||
TemplateProcessorRegistry mockedTemplateProcessorRegistry = mock(TemplateProcessorRegistry.class);
|
||||
doReturn(template).when(mockedTemplateProcessorRegistry).findValidTemplatePath(anyString());
|
||||
lenient().doReturn(template).when(mockedTemplateProcessorRegistry).findValidTemplatePath(anyString());
|
||||
|
||||
FTLTemplateProcessor ftlTemplateProcessor = new FTLTemplateProcessor()
|
||||
{
|
||||
@@ -248,25 +250,25 @@ public abstract class BaseWebScriptUnitTest extends BaseUnitTest
|
||||
};
|
||||
ftlTemplateProcessor.init();
|
||||
|
||||
doReturn(ftlTemplateProcessor).when(mockedTemplateProcessorRegistry).getTemplateProcessor(anyString());
|
||||
lenient().doReturn(ftlTemplateProcessor).when(mockedTemplateProcessorRegistry).getTemplateProcessor(anyString());
|
||||
|
||||
Container mockedContainer = mock(Container.class);
|
||||
doReturn(mockedFormatRegistry).when(mockedContainer).getFormatRegistry();
|
||||
doReturn(mockedScriptProcessorRegistry).when(mockedContainer).getScriptProcessorRegistry();
|
||||
doReturn(mockedTemplateProcessorRegistry).when(mockedContainer).getTemplateProcessorRegistry();
|
||||
lenient().doReturn(mockedFormatRegistry).when(mockedContainer).getFormatRegistry();
|
||||
lenient().doReturn(mockedScriptProcessorRegistry).when(mockedContainer).getScriptProcessorRegistry();
|
||||
lenient().doReturn(mockedTemplateProcessorRegistry).when(mockedContainer).getTemplateProcessorRegistry();
|
||||
|
||||
Map<String, Object> containerTemplateParameters = new HashMap<>(5);
|
||||
containerTemplateParameters.put("jsonUtils", new JSONUtils());
|
||||
containerTemplateParameters.put("people", getMockedPeopleObject());
|
||||
doReturn(containerTemplateParameters).when(mockedContainer).getTemplateParameters();
|
||||
lenient().doReturn(containerTemplateParameters).when(mockedContainer).getTemplateParameters();
|
||||
|
||||
SearchPath mockedSearchPath = mock(SearchPath.class);
|
||||
doReturn(false).when(mockedSearchPath).hasDocument(anyString());
|
||||
doReturn(mockedSearchPath).when(mockedContainer).getSearchPath();
|
||||
lenient().doReturn(false).when(mockedSearchPath).hasDocument(anyString());
|
||||
lenient().doReturn(mockedSearchPath).when(mockedContainer).getSearchPath();
|
||||
|
||||
// setup description
|
||||
Description mockDescription = mock(Description.class);
|
||||
doReturn(mock(RequiredCache.class)).when(mockDescription).getRequiredCache();
|
||||
lenient().doReturn(mock(RequiredCache.class)).when(mockDescription).getRequiredCache();
|
||||
|
||||
return mockedContainer;
|
||||
}
|
||||
|
@@ -27,11 +27,10 @@
|
||||
|
||||
package org.alfresco.module.org_alfresco_module_rm.test.util;
|
||||
|
||||
import static org.mockito.Matchers.any;
|
||||
import static org.mockito.Matchers.anyString;
|
||||
import static org.mockito.Mockito.doAnswer;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.ArgumentMatchers.anyString;
|
||||
import static org.mockito.Mockito.lenient;
|
||||
import static org.mockito.Mockito.reset;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import org.alfresco.module.org_alfresco_module_rm.util.AuthenticationUtil;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
|
||||
@@ -74,7 +73,7 @@ public class MockAuthenticationUtilHelper
|
||||
reset(mockAuthenticationUtil);
|
||||
|
||||
// just do the work
|
||||
doAnswer(new Answer<Object>()
|
||||
lenient().doAnswer(new Answer<Object>()
|
||||
{
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
@@ -87,7 +86,7 @@ public class MockAuthenticationUtilHelper
|
||||
}).when(mockAuthenticationUtil).<Object> runAsSystem(any(RunAsWork.class));
|
||||
|
||||
// just do the work
|
||||
doAnswer(new Answer<Object>()
|
||||
lenient().doAnswer(new Answer<Object>()
|
||||
{
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
@@ -99,10 +98,10 @@ public class MockAuthenticationUtilHelper
|
||||
|
||||
}).when(mockAuthenticationUtil).<Object> runAs(any(RunAsWork.class), anyString());
|
||||
|
||||
when(mockAuthenticationUtil.getAdminUserName()).thenReturn(ADMIN_USER);
|
||||
when(mockAuthenticationUtil.getFullyAuthenticatedUser()).thenReturn(fullyAuthenticatedUser);
|
||||
when(mockAuthenticationUtil.getRunAsUser()).thenReturn(fullyAuthenticatedUser);
|
||||
when(mockAuthenticationUtil.getSystemUserName()).thenReturn(SYSTEM_USER);
|
||||
when(mockAuthenticationUtil.getGuestUserName()).thenReturn(GUEST_USER);
|
||||
lenient().when(mockAuthenticationUtil.getAdminUserName()).thenReturn(ADMIN_USER);
|
||||
lenient().when(mockAuthenticationUtil.getFullyAuthenticatedUser()).thenReturn(fullyAuthenticatedUser);
|
||||
lenient().when(mockAuthenticationUtil.getRunAsUser()).thenReturn(fullyAuthenticatedUser);
|
||||
lenient().when(mockAuthenticationUtil.getSystemUserName()).thenReturn(SYSTEM_USER);
|
||||
lenient().when(mockAuthenticationUtil.getGuestUserName()).thenReturn(GUEST_USER);
|
||||
}
|
||||
}
|
||||
|
@@ -87,6 +87,7 @@ public class ContentBinDuplicationUtilityUnitTest
|
||||
public void setUp()
|
||||
{
|
||||
MockitoAnnotations.initMocks(this);
|
||||
contentBinDuplicationUtility.setNodeService(mockNodeService);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -29,10 +29,11 @@ package org.alfresco.module.org_alfresco_module_rm.version;
|
||||
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.mockito.Matchers.any;
|
||||
import static org.mockito.Matchers.anyMap;
|
||||
import static org.mockito.Matchers.anyString;
|
||||
import static org.mockito.Matchers.eq;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.ArgumentMatchers.anyMap;
|
||||
import static org.mockito.ArgumentMatchers.anyString;
|
||||
import static org.mockito.ArgumentMatchers.eq;
|
||||
import static org.mockito.ArgumentMatchers.nullable;
|
||||
import static org.mockito.Mockito.doReturn;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.never;
|
||||
@@ -52,7 +53,6 @@ import org.alfresco.module.org_alfresco_module_rm.test.util.BaseUnitTest;
|
||||
import org.alfresco.repo.version.Version2Model;
|
||||
import org.alfresco.repo.version.VersionModel;
|
||||
import org.alfresco.repo.version.common.VersionImpl;
|
||||
import org.alfresco.service.cmr.model.FileInfo;
|
||||
import org.alfresco.service.cmr.repository.ContentReader;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
@@ -61,9 +61,11 @@ import org.alfresco.service.cmr.version.VersionType;
|
||||
import org.alfresco.service.namespace.NamespaceService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.InjectMocks;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.Spy;
|
||||
import org.mockito.junit.MockitoJUnitRunner;
|
||||
|
||||
/**
|
||||
* Recordable version service implementation unit test.
|
||||
@@ -71,6 +73,7 @@ import org.mockito.Spy;
|
||||
* @author Roy Wetherall
|
||||
* @since 2.3
|
||||
*/
|
||||
@RunWith(MockitoJUnitRunner.class)
|
||||
public class RecordableVersionServiceImplUnitTest extends BaseUnitTest
|
||||
{
|
||||
/** versioned content name */
|
||||
@@ -108,34 +111,23 @@ public class RecordableVersionServiceImplUnitTest extends BaseUnitTest
|
||||
recordableVersionService.initialise();
|
||||
|
||||
doReturn(generateChildAssociationRef(null, generateNodeRef(Version2Model.TYPE_QNAME_VERSION_HISTORY)))
|
||||
.when(mockedDbNodeService).createNode(any(NodeRef.class),
|
||||
any(QName.class),
|
||||
any(QName.class),
|
||||
.when(mockedDbNodeService).createNode(nullable(NodeRef.class),
|
||||
nullable(QName.class),
|
||||
nullable(QName.class),
|
||||
eq(Version2Model.TYPE_QNAME_VERSION_HISTORY),
|
||||
anyMap());
|
||||
doReturn(generateChildAssociationRef(null, generateNodeRef(TYPE_CONTENT)))
|
||||
.when(mockedDbNodeService).createNode(any(NodeRef.class),
|
||||
any(QName.class),
|
||||
any(QName.class),
|
||||
eq(TYPE_CONTENT),
|
||||
anyMap());
|
||||
nullable(Map.class));
|
||||
|
||||
doReturn(filePlan).when(mockedFilePlanService).getFilePlanBySiteId(FilePlanService.DEFAULT_RM_SITE_ID);
|
||||
doReturn(unfiledRecordContainer).when(mockedFilePlanService).getUnfiledContainer(any(NodeRef.class));
|
||||
|
||||
record = generateCmContent(CONTENT_NAME);
|
||||
FileInfo mockedFileInfo = mock(FileInfo.class);
|
||||
doReturn(record).when(mockedFileInfo).getNodeRef();
|
||||
doReturn(mockedFileInfo).when(mockedFileFolderService).copy(any(NodeRef.class),
|
||||
any(NodeRef.class),
|
||||
any(String.class));
|
||||
version = generateNodeRef(TYPE_CONTENT);
|
||||
doReturn(generateChildAssociationRef(null, version)).when(mockedDbNodeService).createNode(
|
||||
any(NodeRef.class),
|
||||
nullable(NodeRef.class),
|
||||
eq(Version2Model.CHILD_QNAME_VERSIONS),
|
||||
any(QName.class),
|
||||
nullable(QName.class),
|
||||
eq(TYPE_CONTENT),
|
||||
anyMap());
|
||||
nullable(Map.class));
|
||||
recordableVersionService.setDbNodeService(mockedDbNodeService);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -167,7 +159,6 @@ public class RecordableVersionServiceImplUnitTest extends BaseUnitTest
|
||||
{
|
||||
// setup given conditions
|
||||
doReturn(false).when(mockedNodeService).hasAspect(nodeRef, RecordableVersionModel.ASPECT_VERSIONABLE);
|
||||
doReturn(null).when(mockedNodeService).getProperty(nodeRef, RecordableVersionModel.PROP_RECORDABLE_VERSION_POLICY);
|
||||
versionProperties.put(VersionModel.PROP_VERSION_TYPE, VersionType.MINOR);
|
||||
|
||||
// when version is created
|
||||
@@ -357,7 +348,6 @@ public class RecordableVersionServiceImplUnitTest extends BaseUnitTest
|
||||
public void filePlanSpecifiedNoPolicy() throws Exception
|
||||
{
|
||||
// setup given conditions
|
||||
doReturn(true).when(mockedNodeService).hasAspect(nodeRef, RecordableVersionModel.ASPECT_VERSIONABLE);
|
||||
versionProperties.put(VersionModel.PROP_VERSION_TYPE, VersionType.MAJOR);
|
||||
versionProperties.put(RecordableVersionServiceImpl.KEY_RECORDABLE_VERSION, true);
|
||||
|
||||
@@ -376,7 +366,6 @@ public class RecordableVersionServiceImplUnitTest extends BaseUnitTest
|
||||
public void adHocRecordedVersionNoPolicy() throws Exception
|
||||
{
|
||||
// setup given conditions
|
||||
doReturn(true).when(mockedNodeService).hasAspect(nodeRef, RecordableVersionModel.ASPECT_VERSIONABLE);
|
||||
versionProperties.put(VersionModel.PROP_VERSION_TYPE, VersionType.MAJOR);
|
||||
versionProperties.put(RecordableVersionServiceImpl.KEY_RECORDABLE_VERSION, true);
|
||||
|
||||
@@ -391,8 +380,6 @@ public class RecordableVersionServiceImplUnitTest extends BaseUnitTest
|
||||
public void adHocRecordedVersionOverridePolicy() throws Exception
|
||||
{
|
||||
// setup given conditions
|
||||
doReturn(true).when(mockedNodeService).hasAspect(nodeRef, RecordableVersionModel.ASPECT_VERSIONABLE);
|
||||
doReturn(RecordableVersionPolicy.MAJOR_ONLY.toString()).when(mockedNodeService).getProperty(nodeRef, RecordableVersionModel.PROP_RECORDABLE_VERSION_POLICY);
|
||||
versionProperties.put(VersionModel.PROP_VERSION_TYPE, VersionType.MINOR);
|
||||
versionProperties.put(RecordableVersionServiceImpl.KEY_RECORDABLE_VERSION, true);
|
||||
|
||||
@@ -461,16 +448,15 @@ public class RecordableVersionServiceImplUnitTest extends BaseUnitTest
|
||||
// latest version is not recorded
|
||||
Version mockedVersion = mock(VersionImpl.class);
|
||||
NodeRef versionNodeRef = generateNodeRef();
|
||||
doReturn(Collections.emptyMap()).when(mockedVersion).getVersionProperties();
|
||||
doReturn(true).when(mockedNodeService).hasAspect(nodeRef, ContentModel.ASPECT_VERSIONABLE);
|
||||
|
||||
// version history
|
||||
NodeRef versionHistoryNodeRef = generateNodeRef();
|
||||
doReturn(versionHistoryNodeRef).when(mockedDbNodeService).getChildByName(any(NodeRef.class), eq(Version2Model.CHILD_QNAME_VERSION_HISTORIES), any(String.class));
|
||||
doReturn(versionHistoryNodeRef).when(mockedDbNodeService).getChildByName(nullable(NodeRef.class), eq(Version2Model.CHILD_QNAME_VERSION_HISTORIES), nullable(String.class));
|
||||
|
||||
// version number
|
||||
doReturn(mockedVersion).when(recordableVersionService).getCurrentVersion(nodeRef);
|
||||
doReturn(versionNodeRef).when(recordableVersionService).convertNodeRef(any(NodeRef.class));
|
||||
doReturn(versionNodeRef).when(recordableVersionService).convertNodeRef(nullable(NodeRef.class));
|
||||
makePrimaryParentOf(versionNodeRef, versionHistoryNodeRef, ContentModel.ASSOC_CONTAINS, QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "something-0"), mockedDbNodeService);
|
||||
|
||||
// created version
|
||||
@@ -478,36 +464,36 @@ public class RecordableVersionServiceImplUnitTest extends BaseUnitTest
|
||||
doReturn(generateChildAssociationRef(versionHistoryNodeRef, newVersionNodeRef)).when(mockedDbNodeService).createNode(
|
||||
eq(versionHistoryNodeRef),
|
||||
eq(Version2Model.CHILD_QNAME_VERSIONS),
|
||||
any(QName.class),
|
||||
any(QName.class),
|
||||
any(Map.class));
|
||||
nullable(QName.class),
|
||||
nullable(QName.class),
|
||||
nullable(Map.class));
|
||||
|
||||
// created record
|
||||
NodeRef newRecordNodeRef = generateNodeRef();
|
||||
doReturn(newRecordNodeRef).when(mockedRecordService).createRecordFromContent(
|
||||
eq(filePlan),
|
||||
any(String.class),
|
||||
any(QName.class),
|
||||
any(Map.class),
|
||||
any(ContentReader.class));
|
||||
eq(filePlan),
|
||||
nullable(String.class),
|
||||
nullable(QName.class),
|
||||
nullable(Map.class),
|
||||
nullable(ContentReader.class));
|
||||
|
||||
// create record from version
|
||||
recordableVersionService.createRecordFromLatestVersion(filePlan, nodeRef);
|
||||
|
||||
// verify that the version is converted to a recorded version
|
||||
verify(mockedRecordService, times(1)).createRecordFromContent(
|
||||
eq(filePlan),
|
||||
any(String.class),
|
||||
any(QName.class),
|
||||
any(Map.class),
|
||||
any(ContentReader.class));
|
||||
eq(filePlan),
|
||||
nullable(String.class),
|
||||
nullable(QName.class),
|
||||
any(Map.class),
|
||||
nullable(ContentReader.class));
|
||||
verify(mockedDbNodeService, times(1)).deleteNode(any(NodeRef.class));
|
||||
verify(mockedDbNodeService, times(1)).createNode(
|
||||
eq(versionHistoryNodeRef),
|
||||
eq(Version2Model.CHILD_QNAME_VERSIONS),
|
||||
any(QName.class),
|
||||
any(QName.class),
|
||||
any(Map.class));
|
||||
nullable(QName.class),
|
||||
nullable(QName.class),
|
||||
nullable(Map.class));
|
||||
verify(mockedNodeService, times(1)).addAspect(eq(newVersionNodeRef), eq(Version2Model.ASPECT_VERSION), any(Map.class));
|
||||
verify(mockedNodeService, times(1)).addAspect(
|
||||
newVersionNodeRef,
|
||||
@@ -605,20 +591,13 @@ public class RecordableVersionServiceImplUnitTest extends BaseUnitTest
|
||||
// set up version
|
||||
Version mockedVersion = mock(VersionImpl.class);
|
||||
NodeRef versionNodeRef = generateNodeRef();
|
||||
NodeRef versionRecordNodeRef = generateNodeRef();
|
||||
when(mockedVersion.getFrozenStateNodeRef())
|
||||
.thenReturn(versionNodeRef);
|
||||
when(mockedDbNodeService.exists(versionRecordNodeRef))
|
||||
.thenReturn(true);
|
||||
|
||||
|
||||
// indicate that the version doesn't have the aspect
|
||||
when(mockedDbNodeService.hasAspect(versionNodeRef, RecordableVersionModel.ASPECT_RECORDED_VERSION))
|
||||
.thenReturn(true);
|
||||
|
||||
// indicate that the associated version record exists
|
||||
when(mockedDbNodeService.getProperty(versionNodeRef, RecordableVersionModel.PROP_RECORD_NODE_REF))
|
||||
.thenReturn(versionRecordNodeRef);
|
||||
|
||||
// mark as destroyed
|
||||
recordableVersionService.destroyRecordedVersion(mockedVersion);
|
||||
|
||||
@@ -643,20 +622,13 @@ public class RecordableVersionServiceImplUnitTest extends BaseUnitTest
|
||||
// set up version
|
||||
Version mockedVersion = mock(VersionImpl.class);
|
||||
NodeRef versionNodeRef = generateNodeRef();
|
||||
NodeRef versionRecordNodeRef = generateNodeRef();
|
||||
when(mockedVersion.getFrozenStateNodeRef())
|
||||
.thenReturn(versionNodeRef);
|
||||
when(mockedDbNodeService.exists(versionRecordNodeRef))
|
||||
.thenReturn(false);
|
||||
|
||||
|
||||
// indicate that the version doesn't have the aspect
|
||||
when(mockedDbNodeService.hasAspect(versionNodeRef, RecordableVersionModel.ASPECT_RECORDED_VERSION))
|
||||
.thenReturn(true);
|
||||
|
||||
// indicate that the associated version record exists
|
||||
when(mockedDbNodeService.getProperty(versionNodeRef, RecordableVersionModel.PROP_RECORD_NODE_REF))
|
||||
.thenReturn(versionRecordNodeRef);
|
||||
|
||||
// mark as destroyed
|
||||
recordableVersionService.destroyRecordedVersion(mockedVersion);
|
||||
|
||||
|
@@ -33,10 +33,11 @@ import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.fail;
|
||||
import static org.mockito.Matchers.any;
|
||||
import static org.mockito.Matchers.anyBoolean;
|
||||
import static org.mockito.Matchers.anyLong;
|
||||
import static org.mockito.Matchers.eq;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.ArgumentMatchers.anyBoolean;
|
||||
import static org.mockito.ArgumentMatchers.anyLong;
|
||||
import static org.mockito.ArgumentMatchers.eq;
|
||||
import static org.mockito.ArgumentMatchers.nullable;
|
||||
import static org.mockito.Mockito.doAnswer;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.never;
|
||||
@@ -562,7 +563,7 @@ public class DynamicAuthoritiesGetUnitTest extends BaseWebScriptUnitTest impleme
|
||||
executeWebScript(parameters);
|
||||
|
||||
verify(contentStreamer, times(1)).streamContent(any(WebScriptRequest.class), any(WebScriptResponse.class),
|
||||
csvFileCaptor.capture(), any(Long.class), any(Boolean.class), any(String.class), any(Map.class));
|
||||
csvFileCaptor.capture(), nullable(Long.class), any(Boolean.class), any(String.class), any(Map.class));
|
||||
|
||||
File fileForDownload = csvFileCaptor.getValue();
|
||||
assertNotNull(fileForDownload);
|
||||
|
@@ -28,8 +28,9 @@
|
||||
package org.alfresco.rm.rest.api.impl;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.mockito.Matchers.any;
|
||||
import static org.mockito.Matchers.eq;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.ArgumentMatchers.eq;
|
||||
import static org.mockito.ArgumentMatchers.nullable;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.never;
|
||||
import static org.mockito.Mockito.times;
|
||||
@@ -41,7 +42,6 @@ import org.alfresco.module.org_alfresco_module_rm.dod5015.DOD5015Model;
|
||||
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.test.util.AlfMock;
|
||||
import org.alfresco.module.org_alfresco_module_rm.test.util.BaseUnitTest;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.rest.api.impl.SiteImportPackageHandler;
|
||||
import org.alfresco.rest.api.model.Site;
|
||||
import org.alfresco.rest.api.model.SiteUpdate;
|
||||
@@ -59,10 +59,11 @@ import org.alfresco.service.cmr.view.Location;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.ArgumentCaptor;
|
||||
import org.mockito.InjectMocks;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.MockitoAnnotations;
|
||||
import org.mockito.junit.MockitoJUnitRunner;
|
||||
|
||||
/**
|
||||
* Unit Test class for RMSitesImpl.
|
||||
@@ -71,6 +72,7 @@ import org.mockito.MockitoAnnotations;
|
||||
* @since 2.6
|
||||
*
|
||||
*/
|
||||
@RunWith(MockitoJUnitRunner.class)
|
||||
public class RMSitesImplUnitTest extends BaseUnitTest
|
||||
{
|
||||
private static final String RM_SITE_TITLE_AFTER_UPDATE = "Updated Title";
|
||||
@@ -86,8 +88,6 @@ public class RMSitesImplUnitTest extends BaseUnitTest
|
||||
@Mock
|
||||
private SiteService mockedSiteService;
|
||||
@Mock
|
||||
AuthenticationUtil mockAuthenticationUtil;
|
||||
@Mock
|
||||
private ImporterService mockedImporterService;
|
||||
@Mock
|
||||
private FavouritesService mockedFavouritesService;
|
||||
@@ -95,7 +95,6 @@ public class RMSitesImplUnitTest extends BaseUnitTest
|
||||
@Before
|
||||
public void before()
|
||||
{
|
||||
MockitoAnnotations.initMocks(this);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -138,7 +137,7 @@ public class RMSitesImplUnitTest extends BaseUnitTest
|
||||
|
||||
verify(mockedImporterService, times(1)).importView(any(SiteImportPackageHandler.class), any(Location.class), any(ImporterBinding.class), eq(null));
|
||||
verify(mockedSiteService, times(1)).createContainer(RM_SITE_ID, SiteService.DOCUMENT_LIBRARY, ContentModel.TYPE_FOLDER, null);
|
||||
verify(mockedFavouritesService, times(1)).addFavourite(any(String.class), any(NodeRef.class));
|
||||
verify(mockedFavouritesService, times(1)).addFavourite(nullable(String.class), any(NodeRef.class));
|
||||
|
||||
//verify returned values for RM site are the right ones
|
||||
assertEquals(RMSiteCompliance.STANDARD, createdRMSite.getCompliance());
|
||||
@@ -191,7 +190,7 @@ public class RMSitesImplUnitTest extends BaseUnitTest
|
||||
|
||||
verify(mockedImporterService, times(1)).importView(any(SiteImportPackageHandler.class), any(Location.class), any(ImporterBinding.class), eq(null));
|
||||
verify(mockedSiteService, times(1)).createContainer(RM_SITE_ID, SiteService.DOCUMENT_LIBRARY, ContentModel.TYPE_FOLDER, null);
|
||||
verify(mockedFavouritesService, times(1)).addFavourite(any(String.class), any(NodeRef.class));
|
||||
verify(mockedFavouritesService, times(1)).addFavourite(nullable(String.class), any(NodeRef.class));
|
||||
|
||||
//verify returned values for RM site are the right ones
|
||||
assertEquals(RMSiteCompliance.DOD5015, createdRMSite.getCompliance());
|
||||
@@ -253,13 +252,12 @@ public class RMSitesImplUnitTest extends BaseUnitTest
|
||||
when(mockedNodeService.getType(siteNodeRef)).thenReturn(RecordsManagementModel.TYPE_RM_SITE);
|
||||
|
||||
when(mockedSiteService.getSite(siteId)).thenReturn(mockedSiteInfo);
|
||||
when(mockedSiteService.getMembersRole(eq(siteId), any(String.class))).thenReturn(RM_SITE_MANAGER_ROLE);
|
||||
when(mockedSiteService.getMembersRole(eq(siteId), nullable(String.class))).thenReturn(RM_SITE_MANAGER_ROLE);
|
||||
|
||||
//mock UpdateSite
|
||||
SiteUpdate mockedSiteUpdate= mock(SiteUpdate.class);
|
||||
when(mockedSiteUpdate.getDescription()).thenReturn(RM_SITE_DESCRIPTION_AFTER_UPDATE);
|
||||
when(mockedSiteUpdate.getTitle()).thenReturn(RM_SITE_TITLE_AFTER_UPDATE);
|
||||
when(mockedSiteUpdate.getVisibility()).thenReturn(null);
|
||||
when(mockedSiteUpdate.wasSet(Site.TITLE)).thenReturn(true);
|
||||
when(mockedSiteUpdate.wasSet(Site.DESCRIPTION)).thenReturn(true);
|
||||
|
||||
@@ -309,7 +307,7 @@ public class RMSitesImplUnitTest extends BaseUnitTest
|
||||
when(mockedNodeService.getType(siteNodeRef)).thenReturn(RecordsManagementModel.TYPE_RM_SITE);
|
||||
|
||||
when(mockedSiteService.getSite(siteId)).thenReturn(mockedSiteInfo);
|
||||
when(mockedSiteService.getMembersRole(eq(siteId), any(String.class))).thenReturn(RM_SITE_MANAGER_ROLE);
|
||||
when(mockedSiteService.getMembersRole(eq(siteId), nullable(String.class))).thenReturn(RM_SITE_MANAGER_ROLE);
|
||||
|
||||
//STANDARD compliance
|
||||
RMSite rmSite = rmSitesImpl.getRMSite(siteId);
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-governance-services-community-repo-parent</artifactId>
|
||||
<version>11.82</version>
|
||||
<version>14.28-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<build>
|
||||
|
5
amps/module-info.java
Normal file
5
amps/module-info.java
Normal file
@@ -0,0 +1,5 @@
|
||||
module simple.lombok {
|
||||
requires static lombok;
|
||||
requires java.logging;
|
||||
|
||||
}
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>11.82</version>
|
||||
<version>14.28-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
@@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-amps</artifactId>
|
||||
<version>11.82</version>
|
||||
<version>14.28-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>11.82</version>
|
||||
<version>14.28-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>11.82</version>
|
||||
<version>14.28-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Data model classes
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2016 Alfresco Software Limited
|
||||
* Copyright (C) 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
|
||||
@@ -26,6 +26,7 @@
|
||||
package org.alfresco.repo.content;
|
||||
|
||||
import org.alfresco.api.AlfrescoPublicApi;
|
||||
import org.alfresco.service.Experimental;
|
||||
import org.alfresco.service.cmr.repository.ContentAccessor;
|
||||
import org.alfresco.service.cmr.repository.ContentIOException;
|
||||
import org.alfresco.service.cmr.repository.ContentReader;
|
||||
@@ -33,7 +34,9 @@ import org.alfresco.service.cmr.repository.ContentStreamListener;
|
||||
import org.alfresco.service.cmr.repository.ContentWriter;
|
||||
import org.alfresco.service.cmr.repository.DirectAccessUrl;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* Provides low-level retrieval of content
|
||||
@@ -239,28 +242,106 @@ public interface ContentStore
|
||||
*/
|
||||
public boolean delete(String contentUrl);
|
||||
|
||||
/**
|
||||
* Gets a presigned URL to directly access a binary content. It is up to the actual store
|
||||
* implementation if it can fulfil this request with an expiry time or not.
|
||||
*
|
||||
* @param contentUrl A content store URL
|
||||
* @param expiresAt An optional expiry date, so the direct access url would become invalid when the expiry date is reached
|
||||
* @return A direct access URL object for a binary content
|
||||
* @throws UnsupportedOperationException if the store is unable to provide the information
|
||||
*/
|
||||
default DirectAccessUrl getDirectAccessUrl(String contentUrl, Date expiresAt)
|
||||
{
|
||||
throw new UnsupportedOperationException(
|
||||
"Retrieving direct access URLs is not supported by this content store.");
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the store supports the retrieving of direct access URLs.
|
||||
*
|
||||
* @return true if direct access URLs retrieving is supported, false otherwise
|
||||
* @return {@code true} if direct access URLs retrieving is supported, {@code false} otherwise
|
||||
*/
|
||||
default boolean isDirectAccessSupported()
|
||||
default boolean isContentDirectUrlEnabled()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the store supports the retrieving of a direct access URL for the given node.
|
||||
*
|
||||
* @param contentUrl the {@code URL} of the content for which to request a direct access {@code URL}
|
||||
* @return {@code true} if direct access URLs retrieving is supported for the node, {@code false} otherwise
|
||||
*/
|
||||
default boolean isContentDirectUrlEnabled(String contentUrl)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a presigned URL to directly access the content. It is up to the actual store
|
||||
* implementation if it can fulfil this request with an expiry time or not.
|
||||
*
|
||||
* @param contentUrl A content store {@code URL}
|
||||
* @param attachment {@code true} if an attachment URL is requested, {@code false} for an embedded {@code URL}.
|
||||
* @param fileName File name of the content
|
||||
* @return A direct access {@code URL} object for the content
|
||||
* @throws UnsupportedOperationException if the store is unable to provide the information
|
||||
*/
|
||||
@Deprecated
|
||||
default DirectAccessUrl requestContentDirectUrl(String contentUrl, boolean attachment, String fileName)
|
||||
{
|
||||
return requestContentDirectUrl(contentUrl, attachment, fileName, null, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a presigned URL to directly access the content. It is up to the actual store
|
||||
* implementation if it can fulfil this request with an expiry time or not.
|
||||
*
|
||||
* @param contentUrl A content store {@code URL}
|
||||
* @param attachment {@code true} if an attachment URL is requested, {@code false} for an embedded {@code URL}.
|
||||
* @param fileName File name of the content
|
||||
* @return A direct access {@code URL} object for the content
|
||||
* @throws UnsupportedOperationException if the store is unable to provide the information
|
||||
*/
|
||||
default DirectAccessUrl requestContentDirectUrl(String contentUrl, boolean attachment, String fileName, String mimetype)
|
||||
{
|
||||
return requestContentDirectUrl(contentUrl, attachment, fileName, mimetype, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a presigned URL to directly access the content. It is up to the actual store
|
||||
* implementation if it can fulfil this request with an expiry time or not.
|
||||
*
|
||||
* @param contentUrl A content store {@code URL}
|
||||
* @param attachment {@code true} if an attachment URL is requested, {@code false} for an embedded {@code URL}.
|
||||
* @param fileName File name of the content
|
||||
* @param validFor The time at which the direct access {@code URL} will expire.
|
||||
* @return A direct access {@code URL} object for the content.
|
||||
* @throws UnsupportedOperationException if the store is unable to provide the information
|
||||
*/
|
||||
@Deprecated
|
||||
default DirectAccessUrl requestContentDirectUrl(String contentUrl, boolean attachment, String fileName, Long validFor)
|
||||
{
|
||||
return requestContentDirectUrl(contentUrl, attachment, fileName, null, validFor);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a presigned URL to directly access the content. It is up to the actual store
|
||||
* implementation if it can fulfil this request with an expiry time or not.
|
||||
*
|
||||
* @param contentUrl A content store {@code URL}
|
||||
* @param attachment {@code true} if an attachment URL is requested, {@code false} for an embedded {@code URL}.
|
||||
* @param fileName File name of the content
|
||||
* @param mimetype Mimetype of the content
|
||||
* @param validFor The time at which the direct access {@code URL} will expire.
|
||||
* @return A direct access {@code URL} object for the content.
|
||||
* @throws UnsupportedOperationException if the store is unable to provide the information
|
||||
*/
|
||||
default DirectAccessUrl requestContentDirectUrl(String contentUrl, boolean attachment, String fileName, String mimetype, Long validFor)
|
||||
{
|
||||
throw new UnsupportedOperationException(
|
||||
"Retrieving direct access URLs is not supported by this content store.");
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a key-value (String-String) collection of storage headers/properties with their respective values.
|
||||
* A particular Cloud Connector will fill in that data with Cloud Storage Provider generic data.
|
||||
* Map may be also filled in with entries consisting of pre-defined Alfresco keys of {@code ObjectStorageProps} and their values.
|
||||
* If empty Map is returned - no connector is present or connector is not supporting retrieval of the properties
|
||||
* or cannot determine the properties.
|
||||
*
|
||||
* @param contentUrl the URL of the content for which the storage properties are to be retrieved.
|
||||
* @return Returns a key-value (String-String) collection of storage headers/properties with their respective values.
|
||||
*/
|
||||
@Experimental
|
||||
default Map<String, String> getStorageProperties(String contentUrl)
|
||||
{
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* #%L
|
||||
* Alfresco Data model classes
|
||||
* %%
|
||||
* Copyright (C) 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. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
|
||||
package org.alfresco.repo.content;
|
||||
|
||||
import org.alfresco.service.Experimental;
|
||||
|
||||
/**
|
||||
* Enumeration with "header" values for Alfresco derived Storage Properties
|
||||
* Values of this enum should be used when adding Alfresco derived key-value pairs in Storage Properties map.
|
||||
* Subject to expand/change.
|
||||
*
|
||||
* @author mpichura
|
||||
*/
|
||||
@Experimental
|
||||
public enum ObjectStorageProps {
|
||||
/**
|
||||
* Object's content is archived and not immediately accessible.
|
||||
*/
|
||||
X_ALF_ARCHIVED("x-alf-archived"),
|
||||
/**
|
||||
* Object's content retrieval from archive is in progress
|
||||
*/
|
||||
X_ALF_ARCHIVE_RESTORE_IN_PROGRESS("x-alf-archive-restore-in-progress"),
|
||||
/**
|
||||
* Expiry date and time of object's content retrieved from archive.
|
||||
* Use YYYYMMDDThhmmssZ (ISO-8601) datetime format when using this value as key in Storage Properties map.
|
||||
*/
|
||||
X_ALF_ARCHIVE_RESTORE_EXPIRY("x-alf-archive-restore-expiry");
|
||||
|
||||
ObjectStorageProps(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
private final String value;
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
}
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Data model classes
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2016 Alfresco Software Limited
|
||||
* Copyright (C) 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
|
||||
|
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* #%L
|
||||
* Alfresco Data model classes
|
||||
* %%
|
||||
* Copyright (C) 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. 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.service;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* Annotation to mark a type/method/field as experimental.
|
||||
* <p>
|
||||
* If this annotation is present on an element it marks it as experimental and subject to change without further notice.
|
||||
* The element may even be deleted or renamed without any notice.
|
||||
* Experimental element may likely become a valid one (not experimental anymore) in future releases but there is no guarantee when
|
||||
* and if that happens.
|
||||
*
|
||||
* @author mpichura
|
||||
*/
|
||||
@Target({ElementType.METHOD, ElementType.FIELD, ElementType.TYPE})
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
@Documented
|
||||
public @interface Experimental {
|
||||
/**
|
||||
* Further description that can optionally be added to clarify possible future changes of annotated object.
|
||||
*
|
||||
* @return a String, the default is an empty String.
|
||||
*/
|
||||
String description() default "";
|
||||
|
||||
}
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Data model classes
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* Copyright (C) 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
|
||||
@@ -27,6 +27,7 @@ package org.alfresco.service.cmr.repository;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.Objects;
|
||||
|
||||
import org.alfresco.api.AlfrescoPublicApi;
|
||||
|
||||
@@ -36,7 +37,8 @@ public class DirectAccessUrl implements Serializable
|
||||
private static final long serialVersionUID = -881676208224414139L;
|
||||
|
||||
private String contentUrl;
|
||||
private Date expiresAt;
|
||||
private Date expiryTime;
|
||||
private boolean attachment;
|
||||
|
||||
public String getContentUrl()
|
||||
{
|
||||
@@ -48,13 +50,38 @@ public class DirectAccessUrl implements Serializable
|
||||
this.contentUrl = contentUrl;
|
||||
}
|
||||
|
||||
public Date getExpiresAt()
|
||||
public Date getExpiryTime()
|
||||
{
|
||||
return expiresAt;
|
||||
return expiryTime;
|
||||
}
|
||||
|
||||
public void setExpiresAt(Date expiresAt)
|
||||
public void setExpiryTime(Date expiryTime)
|
||||
{
|
||||
this.expiresAt = expiresAt;
|
||||
this.expiryTime = expiryTime;
|
||||
}
|
||||
|
||||
public boolean isAttachment()
|
||||
{
|
||||
return attachment;
|
||||
}
|
||||
|
||||
public void setAttachment(boolean attachment)
|
||||
{
|
||||
this.attachment = attachment;
|
||||
}
|
||||
|
||||
@Override public boolean equals(Object obj)
|
||||
{
|
||||
if (this == obj) return true;
|
||||
if (obj == null || getClass() != obj.getClass()) return false;
|
||||
|
||||
DirectAccessUrl that = (DirectAccessUrl) obj;
|
||||
return attachment == that.attachment && Objects.equals(contentUrl,
|
||||
that.contentUrl) && Objects.equals(expiryTime, that.expiryTime);
|
||||
}
|
||||
|
||||
@Override public int hashCode()
|
||||
{
|
||||
return Objects.hash(contentUrl, expiryTime, attachment);
|
||||
}
|
||||
}
|
||||
|
112
mmt/pom.xml
Normal file
112
mmt/pom.xml
Normal file
@@ -0,0 +1,112 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>alfresco-mmt</artifactId>
|
||||
<name>Alfresco Module Management Tool</name>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>14.28-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-repository</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>de.schlichtherle.truezip</groupId>
|
||||
<artifactId>truezip-driver-zip</artifactId>
|
||||
<version>${dependency.truezip.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>de.schlichtherle.truezip</groupId>
|
||||
<artifactId>truezip-file</artifactId>
|
||||
<version>${dependency.truezip.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-artifact</artifactId>
|
||||
<version>${dependency.maven-artifact.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>make-mmt</id>
|
||||
<goals>
|
||||
<goal>shade</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<transformers>
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
|
||||
<manifestEntries>
|
||||
<Main-Class>org.alfresco.repo.module.tool.ModuleManagementTool</Main-Class>
|
||||
</manifestEntries>
|
||||
</transformer>
|
||||
</transformers>
|
||||
<artifactSet>
|
||||
<includes>
|
||||
<include>de.schlichtherle.truezip:*</include>
|
||||
<include>org.alfresco:alfresco-core</include>
|
||||
<include>org.alfresco:alfresco-repository</include>
|
||||
<include>org.apache.commons:commons-compress</include>
|
||||
<include>org.safehaus.jug:jug</include>
|
||||
<include>org.alfresco.surf:spring-surf-core</include>
|
||||
<include>org.tukaani:xz</include>
|
||||
<include>org.apache.maven:maven-artifact</include>
|
||||
</includes>
|
||||
</artifactSet>
|
||||
<filters>
|
||||
<filter>
|
||||
<artifact>org.alfresco:alfresco-core</artifact>
|
||||
<includes>
|
||||
<include>org/alfresco/error/AlfrescoRuntimeException.class</include>
|
||||
<include>org/alfresco/util/Pair.class</include>
|
||||
<include>org/alfresco/util/EqualsHelper.class</include>
|
||||
<include>org/alfresco/util/VersionNumber.class</include>
|
||||
</includes>
|
||||
</filter>
|
||||
<filter>
|
||||
<artifact>org.apache.maven:maven-artifact</artifact>
|
||||
<includes>
|
||||
<include>org/apache/maven/artifact/versioning/**/*.class</include>
|
||||
</includes>
|
||||
</filter>
|
||||
<filter>
|
||||
<artifact>org.alfresco:alfresco-repository</artifact>
|
||||
<includes>
|
||||
<include>org/alfresco/repo/module/tool/default-file-mapping.properties</include>
|
||||
<include>org/alfresco/repo/module/**/*.class</include>
|
||||
<include>org/alfresco/service/cmr/module/**/*.class</include>
|
||||
</includes>
|
||||
</filter>
|
||||
<filter>
|
||||
<artifact>org.alfresco.surf:spring-surf-core</artifact>
|
||||
<includes>
|
||||
<include>org/springframework/extensions/surf/util/I18NUtil.class</include>
|
||||
<include>org/springframework/extensions/surf/util/ISO8601DateFormat.class</include>
|
||||
<include>org/springframework/extensions/surf/exception/PlatformRuntimeException.class</include>
|
||||
</includes>
|
||||
</filter>
|
||||
<filter>
|
||||
<!-- Duplicated file in truezip-driver-file, need to filter this one -->
|
||||
<artifact>de.schlichtherle.truezip:truezip-driver-zip</artifact>
|
||||
<excludes>
|
||||
<exclude>META-INF/services/de.schlichtherle.truezip.fs.spi.FsDriverService</exclude>
|
||||
</excludes>
|
||||
</filter>
|
||||
</filters>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
165
mmt/src/main/resources/LICENSE
Normal file
165
mmt/src/main/resources/LICENSE
Normal file
@@ -0,0 +1,165 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
|
||||
This version of the GNU Lesser General Public License incorporates
|
||||
the terms and conditions of version 3 of the GNU General Public
|
||||
License, supplemented by the additional permissions listed below.
|
||||
|
||||
0. Additional Definitions.
|
||||
|
||||
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
||||
General Public License.
|
||||
|
||||
"The Library" refers to a covered work governed by this License,
|
||||
other than an Application or a Combined Work as defined below.
|
||||
|
||||
An "Application" is any work that makes use of an interface provided
|
||||
by the Library, but which is not otherwise based on the Library.
|
||||
Defining a subclass of a class defined by the Library is deemed a mode
|
||||
of using an interface provided by the Library.
|
||||
|
||||
A "Combined Work" is a work produced by combining or linking an
|
||||
Application with the Library. The particular version of the Library
|
||||
with which the Combined Work was made is also called the "Linked
|
||||
Version".
|
||||
|
||||
The "Minimal Corresponding Source" for a Combined Work means the
|
||||
Corresponding Source for the Combined Work, excluding any source code
|
||||
for portions of the Combined Work that, considered in isolation, are
|
||||
based on the Application, and not on the Linked Version.
|
||||
|
||||
The "Corresponding Application Code" for a Combined Work means the
|
||||
object code and/or source code for the Application, including any data
|
||||
and utility programs needed for reproducing the Combined Work from the
|
||||
Application, but excluding the System Libraries of the Combined Work.
|
||||
|
||||
1. Exception to Section 3 of the GNU GPL.
|
||||
|
||||
You may convey a covered work under sections 3 and 4 of this License
|
||||
without being bound by section 3 of the GNU GPL.
|
||||
|
||||
2. Conveying Modified Versions.
|
||||
|
||||
If you modify a copy of the Library, and, in your modifications, a
|
||||
facility refers to a function or data to be supplied by an Application
|
||||
that uses the facility (other than as an argument passed when the
|
||||
facility is invoked), then you may convey a copy of the modified
|
||||
version:
|
||||
|
||||
a) under this License, provided that you make a good faith effort to
|
||||
ensure that, in the event an Application does not supply the
|
||||
function or data, the facility still operates, and performs
|
||||
whatever part of its purpose remains meaningful, or
|
||||
|
||||
b) under the GNU GPL, with none of the additional permissions of
|
||||
this License applicable to that copy.
|
||||
|
||||
3. Object Code Incorporating Material from Library Header Files.
|
||||
|
||||
The object code form of an Application may incorporate material from
|
||||
a header file that is part of the Library. You may convey such object
|
||||
code under terms of your choice, provided that, if the incorporated
|
||||
material is not limited to numerical parameters, data structure
|
||||
layouts and accessors, or small macros, inline functions and templates
|
||||
(ten or fewer lines in length), you do both of the following:
|
||||
|
||||
a) Give prominent notice with each copy of the object code that the
|
||||
Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the object code with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
4. Combined Works.
|
||||
|
||||
You may convey a Combined Work under terms of your choice that,
|
||||
taken together, effectively do not restrict modification of the
|
||||
portions of the Library contained in the Combined Work and reverse
|
||||
engineering for debugging such modifications, if you also do each of
|
||||
the following:
|
||||
|
||||
a) Give prominent notice with each copy of the Combined Work that
|
||||
the Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
c) For a Combined Work that displays copyright notices during
|
||||
execution, include the copyright notice for the Library among
|
||||
these notices, as well as a reference directing the user to the
|
||||
copies of the GNU GPL and this license document.
|
||||
|
||||
d) Do one of the following:
|
||||
|
||||
0) Convey the Minimal Corresponding Source under the terms of this
|
||||
License, and the Corresponding Application Code in a form
|
||||
suitable for, and under terms that permit, the user to
|
||||
recombine or relink the Application with a modified version of
|
||||
the Linked Version to produce a modified Combined Work, in the
|
||||
manner specified by section 6 of the GNU GPL for conveying
|
||||
Corresponding Source.
|
||||
|
||||
1) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (a) uses at run time
|
||||
a copy of the Library already present on the user's computer
|
||||
system, and (b) will operate properly with a modified version
|
||||
of the Library that is interface-compatible with the Linked
|
||||
Version.
|
||||
|
||||
e) Provide Installation Information, but only if you would otherwise
|
||||
be required to provide such information under section 6 of the
|
||||
GNU GPL, and only to the extent that such information is
|
||||
necessary to install and execute a modified version of the
|
||||
Combined Work produced by recombining or relinking the
|
||||
Application with a modified version of the Linked Version. (If
|
||||
you use option 4d0, the Installation Information must accompany
|
||||
the Minimal Corresponding Source and Corresponding Application
|
||||
Code. If you use option 4d1, you must provide the Installation
|
||||
Information in the manner specified by section 6 of the GNU GPL
|
||||
for conveying Corresponding Source.)
|
||||
|
||||
5. Combined Libraries.
|
||||
|
||||
You may place library facilities that are a work based on the
|
||||
Library side by side in a single library together with other library
|
||||
facilities that are not Applications and are not covered by this
|
||||
License, and convey such a combined library under terms of your
|
||||
choice, if you do both of the following:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work based
|
||||
on the Library, uncombined with any other library facilities,
|
||||
conveyed under the terms of this License.
|
||||
|
||||
b) Give prominent notice with the combined library that part of it
|
||||
is a work based on the Library, and explaining where to find the
|
||||
accompanying uncombined form of the same work.
|
||||
|
||||
6. Revised Versions of the GNU Lesser General Public License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions
|
||||
of the GNU Lesser General Public License from time to time. Such new
|
||||
versions will be similar in spirit to the present version, but may
|
||||
differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Library as you received it specifies that a certain numbered version
|
||||
of the GNU Lesser General Public License "or any later version"
|
||||
applies to it, you have the option of following the terms and
|
||||
conditions either of that published version or of any later version
|
||||
published by the Free Software Foundation. If the Library as you
|
||||
received it does not specify a version number of the GNU Lesser
|
||||
General Public License, you may choose any version of the GNU Lesser
|
||||
General Public License ever published by the Free Software Foundation.
|
||||
|
||||
If the Library as you received it specifies that a proxy can decide
|
||||
whether future versions of the GNU Lesser General Public License shall
|
||||
apply, that proxy's public statement of acceptance of any version is
|
||||
permanent authorization for you to choose that version for the
|
||||
Library.
|
@@ -9,6 +9,6 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||
<version>11.82</version>
|
||||
<version>14.28-SNAPSHOT</version>
|
||||
</parent>
|
||||
</project>
|
||||
|
54
packaging/distribution/src/main/resources/licenses/3rd-party/BSDlike-JDOM.txt
vendored
Normal file
54
packaging/distribution/src/main/resources/licenses/3rd-party/BSDlike-JDOM.txt
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
/*--
|
||||
|
||||
Copyright (C) 2000-2012 Jason Hunter & Brett McLaughlin.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions, and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions, and the disclaimer that follows
|
||||
these conditions in the documentation and/or other materials
|
||||
provided with the distribution.
|
||||
|
||||
3. The name "JDOM" must not be used to endorse or promote products
|
||||
derived from this software without prior written permission. For
|
||||
written permission, please contact <request_AT_jdom_DOT_org>.
|
||||
|
||||
4. Products derived from this software may not be called "JDOM", nor
|
||||
may "JDOM" appear in their name, without prior written permission
|
||||
from the JDOM Project Management <request_AT_jdom_DOT_org>.
|
||||
|
||||
In addition, we request (but do not require) that you include in the
|
||||
end-user documentation provided with the redistribution and/or in the
|
||||
software itself an acknowledgement equivalent to the following:
|
||||
"This product includes software developed by the
|
||||
JDOM Project (http://www.jdom.org/)."
|
||||
Alternatively, the acknowledgment may be graphical using the logos
|
||||
available at http://www.jdom.org/images/logos.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
|
||||
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE JDOM AUTHORS OR THE PROJECT
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
|
||||
USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGE.
|
||||
|
||||
This software consists of voluntary contributions made by many
|
||||
individuals on behalf of the JDOM Project and was originally
|
||||
created by Jason Hunter <jhunter_AT_jdom_DOT_org> and
|
||||
Brett McLaughlin <brett_AT_jdom_DOT_org>. For more information
|
||||
on the JDOM Project, please see <http://www.jdom.org/>.
|
||||
|
||||
*/
|
||||
|
46
packaging/distribution/src/main/resources/licenses/3rd-party/BSDlike-XPP3.txt
vendored
Normal file
46
packaging/distribution/src/main/resources/licenses/3rd-party/BSDlike-XPP3.txt
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
Indiana University Extreme! Lab Software License
|
||||
|
||||
Version 1.1.1
|
||||
|
||||
Copyright (c) 2002 Extreme! Lab, Indiana University. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the distribution.
|
||||
|
||||
3. The end-user documentation included with the redistribution, if any,
|
||||
must include the following acknowledgment:
|
||||
|
||||
"This product includes software developed by the Indiana University
|
||||
Extreme! Lab (http://www.extreme.indiana.edu/)."
|
||||
|
||||
Alternately, this acknowledgment may appear in the software itself,
|
||||
if and wherever such third-party acknowledgments normally appear.
|
||||
|
||||
4. The names "Indiana Univeristy" and "Indiana Univeristy Extreme! Lab"
|
||||
must not be used to endorse or promote products derived from this
|
||||
software without prior written permission. For written permission,
|
||||
please contact http://www.extreme.indiana.edu/.
|
||||
|
||||
5. Products derived from this software may not use "Indiana Univeristy"
|
||||
name nor may "Indiana Univeristy" appear in their name, without prior
|
||||
written permission of the Indiana University.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
|
||||
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL THE AUTHORS, COPYRIGHT HOLDERS OR ITS CONTRIBUTORS
|
||||
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
@@ -1,6 +1,6 @@
|
||||
# Fetch image based on Tomcat 9.0, Java 11 and Centos 8
|
||||
# More infos about this image: https://github.com/Alfresco/alfresco-docker-base-tomcat
|
||||
FROM alfresco/alfresco-base-tomcat:9.0.45-java-11-centos-8
|
||||
FROM alfresco/alfresco-base-tomcat:9.0.52-java-11-centos-7
|
||||
|
||||
# Set default docker_context.
|
||||
ARG resource_path=target
|
||||
@@ -65,12 +65,12 @@ RUN sed -i -e "s_log4j.appender.File.File\=alfresco.log_log4j.appender.File.File
|
||||
|
||||
# fontconfig is required by Activiti worflow diagram generator
|
||||
# installing pinned dependencies as well
|
||||
RUN yum install -y fontconfig-2.13.1-3.el8 \
|
||||
dejavu-fonts-common-2.35-7.el8 \
|
||||
fontpackages-filesystem-1.44-22.el8 \
|
||||
freetype-2.9.1-4.el8_3.1 \
|
||||
libpng-1.6.34-5.el8 \
|
||||
dejavu-sans-fonts-2.35-7.el8 && \
|
||||
RUN yum install -y fontconfig-2.13.0-4.3.el7 \
|
||||
dejavu-fonts-common-2.33-6.el7 \
|
||||
fontpackages-filesystem-1.44-8.el7 \
|
||||
freetype-2.8-14.el7_9.1 \
|
||||
libpng-1.5.13-8.el7 \
|
||||
dejavu-sans-fonts-2.33-6.el7 && \
|
||||
yum clean all
|
||||
|
||||
# The standard configuration is to have all Tomcat files owned by root with group GROUPNAME and whilst owner has read/write privileges,
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||
<version>11.82</version>
|
||||
<version>14.28-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
@@ -71,6 +71,7 @@
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-mmt</artifactId>
|
||||
<type>jar</type>
|
||||
<version>${project.version}</version>
|
||||
<overWrite>false</overWrite>
|
||||
<outputDirectory>${project.build.directory}/alfresco-mmt</outputDirectory>
|
||||
</artifactItem>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>11.82</version>
|
||||
<version>14.28-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
@@ -1,4 +1,4 @@
|
||||
TRANSFORMERS_TAG=2.5.0
|
||||
SOLR6_TAG=2.0.2-RC1
|
||||
POSTGRES_TAG=13.1
|
||||
TRANSFORMERS_TAG=2.5.3
|
||||
SOLR6_TAG=2.0.2
|
||||
POSTGRES_TAG=13.3
|
||||
ACTIVEMQ_TAG=5.16.1
|
||||
|
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||
<version>11.82</version>
|
||||
<version>14.28-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>11.82</version>
|
||||
<version>14.28-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<developers>
|
||||
|
@@ -90,7 +90,7 @@ public class CancelCheckOutTests extends CmisTest
|
||||
.cancelCheckOut();
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REGRESSION, TestGroup.CMIS})
|
||||
@Test(groups = { TestGroup.NOT_SUPPORTED_ON_SINGLE_PIPELINE, TestGroup.REGRESSION, TestGroup.CMIS})
|
||||
@TestRail(section = {"cmis-api"}, executionType= ExecutionType.REGRESSION,
|
||||
description = "Verify that cancel check out on document created with Versioning State CHECKED OUT deletes the document")
|
||||
public void cancelCheckOutOnDocWithVersioningStateCheckedOut() throws Exception
|
||||
|
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>11.82</version>
|
||||
<version>14.28-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<developers>
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user