mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-29 15:21:53 +00:00
Compare commits
401 Commits
23.3.12.1
...
fix/update
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
af8106bbe4 | ||
|
|
011a98f9a7 | ||
|
|
0b5211f7a9 | ||
|
|
1ad97022a2 | ||
|
|
567405dc1c | ||
|
|
8d6973a132 | ||
|
|
629c874bc8 | ||
|
|
19ec861873 | ||
|
|
7f8dd30305 | ||
|
|
40c7b5fd9f | ||
|
|
3f6a1c6880 | ||
|
|
b3f2cb95c8 | ||
|
|
d694959587 | ||
|
|
56aae78015 | ||
|
|
edba5b8754 | ||
|
|
5f8879feb7 | ||
|
|
ca575bc47e | ||
|
|
4fcb962a3c | ||
|
|
5397d88f4a | ||
|
|
448e49d8bb | ||
|
|
b825b5f18e | ||
|
|
24541a9512 | ||
|
|
2f6d097e16 | ||
|
|
7b074e1ee2 | ||
|
|
1bc5c94ace | ||
|
|
ba68efec67 | ||
|
|
bfcca88e63 | ||
|
|
9d704df3c0 | ||
|
|
73d46c1702 | ||
|
|
261dcc93bd | ||
|
|
2fa44f407c | ||
|
|
8e0377d586 | ||
|
|
925a2bb6b9 | ||
|
|
4eafb13ba6 | ||
|
|
f731c9734c | ||
|
|
e0a3b843f2 | ||
|
|
2889b1a8a3 | ||
|
|
22aa1f2725 | ||
|
|
77ab7d83fe | ||
|
|
a8faa94d15 | ||
|
|
baafbbbeb2 | ||
|
|
ed061f2287 | ||
|
|
6e435e1a8c | ||
|
|
05f6b90df8 | ||
|
|
0550dcd4f7 | ||
|
|
e137c91152 | ||
|
|
5a1c8334c8 | ||
|
|
c7bbb1f74b | ||
|
|
49a34c4fe3 | ||
|
|
70af2ea3ad | ||
|
|
ab6c5feba7 | ||
|
|
cb3cbb553a | ||
|
|
9470c27f3d | ||
|
|
edf263c43f | ||
|
|
69bb9a308a | ||
|
|
853d1bdc1b | ||
|
|
f7d1bbcec3 | ||
|
|
731d580f7e | ||
|
|
ad4126ffea | ||
|
|
933aced67c | ||
|
|
de0ba15a91 | ||
|
|
00c36251d4 | ||
|
|
ea9ce0c0c2 | ||
|
|
37231e50a2 | ||
|
|
26d8c7dcbe | ||
|
|
6ea97033d3 | ||
|
|
cd0b2ffd24 | ||
|
|
a14cbacb68 | ||
|
|
fc0b9863d4 | ||
|
|
29dc42d445 | ||
|
|
39da968d76 | ||
|
|
6a4fecd46e | ||
|
|
e083d4fcc2 | ||
|
|
53e8a06a6e | ||
|
|
c80e1fa94b | ||
|
|
675c6f7aa1 | ||
|
|
44d67847da | ||
|
|
d405043c5d | ||
|
|
da50f6271c | ||
|
|
a5e713c176 | ||
|
|
2dcd2788b2 | ||
|
|
6b738342c1 | ||
|
|
ba5f5418ab | ||
|
|
ee8f3bec18 | ||
|
|
39395af528 | ||
|
|
e6f9d88779 | ||
|
|
70f70c6ed3 | ||
|
|
15045f9612 | ||
|
|
c50c7c6a7e | ||
|
|
60199141f5 | ||
|
|
b5e023950d | ||
|
|
d4591acf2c | ||
|
|
f34f2849dd | ||
|
|
52f2be49f3 | ||
|
|
748be1f4a0 | ||
|
|
52f1af2da6 | ||
|
|
626a97ff45 | ||
|
|
4a91132226 | ||
|
|
b6fb8725ce | ||
|
|
5fc0d9edde | ||
|
|
44d394b1a0 | ||
|
|
c1d62cca4d | ||
|
|
24ae4ce57c | ||
|
|
b8f2ec252d | ||
|
|
ae721c86f6 | ||
|
|
aacef0c949 | ||
|
|
e4edceda75 | ||
|
|
09ec6688c6 | ||
|
|
14025f00de | ||
|
|
22c5a5e134 | ||
|
|
154cad1ff8 | ||
|
|
7749b89e2b | ||
|
|
bbb45e667b | ||
|
|
a5f01e0d94 | ||
|
|
0c6d455ec4 | ||
|
|
5e86f5163e | ||
|
|
4981be1564 | ||
|
|
9a30fbb75a | ||
|
|
9c86fdb8b5 | ||
|
|
c52f74832d | ||
|
|
70dd7642f4 | ||
|
|
0cf3eec834 | ||
|
|
dfd855440d | ||
|
|
88d46884c4 | ||
|
|
e6444a1c7a | ||
|
|
e215038230 | ||
|
|
a5f8034725 | ||
|
|
c7dd659268 | ||
|
|
ffae77169e | ||
|
|
3bcfaf256e | ||
|
|
0e8d56d7b2 | ||
|
|
ef9e8d574f | ||
|
|
a17712b501 | ||
|
|
fce6d1d7eb | ||
|
|
867af27a96 | ||
|
|
3de74456ae | ||
|
|
919880e363 | ||
|
|
e6ac2875b9 | ||
|
|
4250167a28 | ||
|
|
312463b5e0 | ||
|
|
c09f5f7cb0 | ||
|
|
6284e9724e | ||
|
|
dcf391faea | ||
|
|
475f345909 | ||
|
|
f42e033e40 | ||
|
|
546f37eded | ||
|
|
a35673d44f | ||
|
|
25e9bdbdb6 | ||
|
|
33ab26e52b | ||
|
|
7e35abfdc8 | ||
|
|
634e591264 | ||
|
|
86f66c86da | ||
|
|
2904535d40 | ||
|
|
e99905efbd | ||
|
|
ce65de0f10 | ||
|
|
29b19d4245 | ||
|
|
4eea43bddf | ||
|
|
4c9282790a | ||
|
|
39a74e42b6 | ||
|
|
a298c0dcb9 | ||
|
|
9ee56a5d08 | ||
|
|
6b80a2c39c | ||
|
|
f6569edde1 | ||
|
|
5ab9aa8cf2 | ||
|
|
8a171d09b5 | ||
|
|
3e423a1543 | ||
|
|
6351782c1d | ||
|
|
4c92868efb | ||
|
|
2cca9ea11b | ||
|
|
e12001e4d1 | ||
|
|
a57607f728 | ||
|
|
a79af2cac0 | ||
|
|
be807c5b19 | ||
|
|
ae03e7076e | ||
|
|
26e394c398 | ||
|
|
200aa95784 | ||
|
|
4eeabb3dbd | ||
|
|
227bbe4fd8 | ||
|
|
1461a04a3d | ||
|
|
52008dc139 | ||
|
|
f2a10052e4 | ||
|
|
add64e0cb6 | ||
|
|
14511e2621 | ||
|
|
42e0c93121 | ||
|
|
715bc273ee | ||
|
|
812541870e | ||
|
|
9aa5051826 | ||
|
|
54580b4aeb | ||
|
|
2b1b6091a3 | ||
|
|
74a147ab3f | ||
|
|
07f0595f5a | ||
|
|
e3422ea6a5 | ||
|
|
f4103c242f | ||
|
|
34fb5e9dd9 | ||
|
|
f6cf0670c1 | ||
|
|
c7bd036030 | ||
|
|
b20c573040 | ||
|
|
6568885c10 | ||
|
|
31237135c5 | ||
|
|
d528ed1e97 | ||
|
|
bb207340fd | ||
|
|
314e1aeb64 | ||
|
|
9846f7b04f | ||
|
|
6e442e93b8 | ||
|
|
fb3c57aab4 | ||
|
|
093b3281fb | ||
|
|
3b027c6c36 | ||
|
|
f193309e4c | ||
|
|
7668849a59 | ||
|
|
1350e68c29 | ||
|
|
ea63cf76e5 | ||
|
|
674fa8d7e0 | ||
|
|
60a31112ea | ||
|
|
67d8807529 | ||
|
|
dda1fd6ea3 | ||
|
|
7a937f1e51 | ||
|
|
187e9138da | ||
|
|
b8c9605ae6 | ||
|
|
8a1d8dba94 | ||
|
|
b2c87aa22d | ||
|
|
3748482f51 | ||
|
|
1f558e4c58 | ||
|
|
a7d31b9811 | ||
|
|
42cc7f16c2 | ||
|
|
c0ca7cc27f | ||
|
|
27962726b4 | ||
|
|
aeebd3dcc6 | ||
|
|
dde8dc90e6 | ||
|
|
aa1ec3cf35 | ||
|
|
30ce0a1f01 | ||
|
|
291684f3d8 | ||
|
|
0fed714674 | ||
|
|
f2752929ce | ||
|
|
cf66b63817 | ||
|
|
e387ae39cc | ||
|
|
e3483507d0 | ||
|
|
55c6eacf95 | ||
|
|
2ff97bfe83 | ||
|
|
88874ef191 | ||
|
|
74af4484da | ||
|
|
c24812dc20 | ||
|
|
0e78b61f4c | ||
|
|
97353e1ee9 | ||
|
|
024ad00229 | ||
|
|
c2da1838da | ||
|
|
93d4e603ed | ||
|
|
4197d9d5c7 | ||
|
|
a323e56a5a | ||
|
|
6f2100e072 | ||
|
|
a2dcb0ebd7 | ||
|
|
ef2019d844 | ||
|
|
a5adc32d79 | ||
|
|
a5f8e80bcc | ||
|
|
de3dfc1265 | ||
|
|
487dc56e3c | ||
|
|
fd4e630f0f | ||
|
|
008b33efbd | ||
|
|
f3e0c43f3b | ||
|
|
9f6ef99ef5 | ||
|
|
5e9d7f39d3 | ||
|
|
0f6950a72e | ||
|
|
87bba8e381 | ||
|
|
837fb0cccd | ||
|
|
0b511e0b55 | ||
|
|
67aa6ac5fc | ||
|
|
6805ce85c8 | ||
|
|
b00e11cb6f | ||
|
|
3d9b58ea76 | ||
|
|
02254b2ac4 | ||
|
|
7df8281358 | ||
|
|
3f2a143343 | ||
|
|
c8bfc18f83 | ||
|
|
8b3bd59d73 | ||
|
|
a6e915371f | ||
|
|
f5f1106506 | ||
|
|
5b0c31154e | ||
|
|
70a90c3870 | ||
|
|
a10ab896df | ||
|
|
5bc0c3975b | ||
|
|
6e20330424 | ||
|
|
1c1c9704a1 | ||
|
|
b7642b5813 | ||
|
|
69583721da | ||
|
|
d17c11b8ad | ||
|
|
57daaa24da | ||
|
|
da96fd52ca | ||
|
|
0fd088fc59 | ||
|
|
dea78f5d30 | ||
|
|
aa02febb3f | ||
|
|
84e1c90745 | ||
|
|
7ce2349edc | ||
|
|
6d02269164 | ||
|
|
ba323979ff | ||
|
|
b1cf324289 | ||
|
|
acb34b7861 | ||
|
|
ab1cce1fec | ||
|
|
7550799a26 | ||
|
|
6238485d2b | ||
|
|
8059ccad53 | ||
|
|
3896979b6c | ||
|
|
98a978a4d1 | ||
|
|
cb333d1c20 | ||
|
|
ee1d33cb41 | ||
|
|
1e16f74292 | ||
|
|
8d72d662a0 | ||
|
|
f346992500 | ||
|
|
5399fed53b | ||
|
|
1766ac749d | ||
|
|
5b31b22840 | ||
|
|
b4c18c9902 | ||
|
|
7491ba5156 | ||
|
|
57d8f4bab7 | ||
|
|
6c0b29ec3d | ||
|
|
91adfe22d7 | ||
|
|
40036caae4 | ||
|
|
5a0aadb425 | ||
|
|
d4a8ef2442 | ||
|
|
5555ee6871 | ||
|
|
1ba62b2a4c | ||
|
|
8abf1c3d36 | ||
|
|
22b6131f93 | ||
|
|
8a731dce40 | ||
|
|
a18861a4f6 | ||
|
|
87f31c5a3a | ||
|
|
ef878fe20f | ||
|
|
168aae1a3d | ||
|
|
ed706aa5d3 | ||
|
|
fe5a1d8436 | ||
|
|
54d122ccc1 | ||
|
|
945fe52df9 | ||
|
|
f1d9203430 | ||
|
|
1dc0720582 | ||
|
|
8dcc19cc63 | ||
|
|
d4883af0d0 | ||
|
|
4cb220de66 | ||
|
|
97bcd725ee | ||
|
|
38259f9b39 | ||
|
|
9b1f0d78a5 | ||
|
|
95d7dbc5fc | ||
|
|
920366d287 | ||
|
|
14e26c46fc | ||
|
|
c934f556cd | ||
|
|
73901303c5 | ||
|
|
bbb22a79eb | ||
|
|
099b072a47 | ||
|
|
0bf3c078cf | ||
|
|
9b45f75b48 | ||
|
|
52914459ea | ||
|
|
446b08aa03 | ||
|
|
08fbc569fe | ||
|
|
a8f50416a3 | ||
|
|
c5122ddca0 | ||
|
|
1d93bcbb0d | ||
|
|
c34f9af62d | ||
|
|
112875fbfd | ||
|
|
2d21456342 | ||
|
|
0363cab870 | ||
|
|
1f708ad712 | ||
|
|
475894525d | ||
|
|
58bad96724 | ||
|
|
02486a432a | ||
|
|
6de21cca78 | ||
|
|
185f7ebeb6 | ||
|
|
1b55aa9691 | ||
|
|
51aa490439 | ||
|
|
4cf2e76430 | ||
|
|
9e34ae3df8 | ||
|
|
6a4f82deae | ||
|
|
0e3173a573 | ||
|
|
2744561346 | ||
|
|
9b8ae96c2e | ||
|
|
adb8913b56 | ||
|
|
02237bd280 | ||
|
|
78001ed22c | ||
|
|
a568aeda17 | ||
|
|
f890e9f995 | ||
|
|
0ddeac79bb | ||
|
|
67ca73820b | ||
|
|
1df8702e16 | ||
|
|
12c4481ac2 | ||
|
|
0f572ec21a | ||
|
|
9c121743d9 | ||
|
|
c754eaeb93 | ||
|
|
b9e76970f9 | ||
|
|
0a46ec0ab2 | ||
|
|
ce39a66934 | ||
|
|
d098508e53 | ||
|
|
738a77301a | ||
|
|
be0ea5b247 | ||
|
|
d33dc8e1d4 | ||
|
|
d72b8c411a | ||
|
|
01c347673d | ||
|
|
dcc6f23548 | ||
|
|
22c94284ec | ||
|
|
9f1956b632 | ||
|
|
740bce8c80 | ||
|
|
801b526b4a | ||
|
|
fde025ad88 | ||
|
|
ba61253c94 | ||
|
|
bf5032675f | ||
|
|
cce8ef50ef |
198
.github/workflows/ci.yml
vendored
198
.github/workflows/ci.yml
vendored
@@ -41,18 +41,17 @@ jobs:
|
||||
!contains(github.event.head_commit.message, '[skip tests]') &&
|
||||
!contains(github.event.head_commit.message, '[force')
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.16.0
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.2.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.2.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.2.0
|
||||
- id: changed-files
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/github-list-changes@v6.1.0
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/github-list-changes@v8.2.0
|
||||
with:
|
||||
write-list-to-env: true
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/pre-commit@v6.1.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/pre-commit@v8.2.0
|
||||
- name: "Init"
|
||||
run: bash ./scripts/ci/init.sh
|
||||
- name: "Prepare maven cache and check compilation"
|
||||
@@ -70,12 +69,12 @@ jobs:
|
||||
!contains(github.event.head_commit.message, '[force')
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.2.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.2.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.2.0
|
||||
- name: "Init"
|
||||
run: bash ./scripts/ci/init.sh
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/veracode@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/veracode@v8.2.0
|
||||
continue-on-error: true
|
||||
with:
|
||||
srcclr-api-token: ${{ secrets.SRCCLR_API_TOKEN }}
|
||||
@@ -93,10 +92,10 @@ jobs:
|
||||
!contains(github.event.head_commit.message, '[force')
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/github-download-file@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.2.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.2.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.2.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/github-download-file@v8.2.0
|
||||
with:
|
||||
token: ${{ secrets.BOT_GITHUB_TOKEN }}
|
||||
repository: "Alfresco/veracode-baseline-archive"
|
||||
@@ -107,12 +106,16 @@ jobs:
|
||||
run: |
|
||||
bash ./scripts/ci/init.sh
|
||||
bash ./scripts/ci/build.sh
|
||||
- name: "Remove excluded files"
|
||||
run: |
|
||||
mkdir temp-dir-for-sast
|
||||
bash ./scripts/ci/remove-sast-exclusions.sh ./packaging/war/target/alfresco.war temp-dir-for-sast/reduced.war
|
||||
- name: "Run SAST Scan"
|
||||
uses: veracode/Veracode-pipeline-scan-action@v1.0.16
|
||||
with:
|
||||
vid: ${{ secrets.VERACODE_API_ID }}
|
||||
vkey: ${{ secrets.VERACODE_API_KEY }}
|
||||
file: "packaging/war/target/alfresco.war"
|
||||
file: "temp-dir-for-sast/reduced.war"
|
||||
fail_build: true
|
||||
project_name: alfresco-community-repo
|
||||
issue_details: true
|
||||
@@ -130,6 +133,8 @@ jobs:
|
||||
with:
|
||||
name: Veracode Pipeline-Scan Results (Human Readable)
|
||||
path: readable_output.zip
|
||||
- name: "Remove temporary directory"
|
||||
run: rm -rfv temp-dir-for-sast
|
||||
- name: "Clean Maven cache"
|
||||
run: bash ./scripts/ci/cleanup_cache.sh
|
||||
|
||||
@@ -143,10 +148,10 @@ jobs:
|
||||
!contains(github.event.head_commit.message, '[skip tests]') &&
|
||||
!contains(github.event.head_commit.message, '[force]')
|
||||
steps:
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.16.0
|
||||
- uses: Alfresco/ya-pmd-scan@v4.0.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.2.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.2.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.2.0
|
||||
- uses: Alfresco/ya-pmd-scan@v4.1.0
|
||||
with:
|
||||
classpath-build-command: "mvn test-compile -ntp -Pags -pl \"-:alfresco-community-repo-docker\""
|
||||
|
||||
@@ -176,14 +181,14 @@ jobs:
|
||||
testAttributes: "-Dtest=AllMmtUnitTestSuite"
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.2.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.2.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.2.0
|
||||
- name: "Init"
|
||||
run: bash ./scripts/ci/init.sh
|
||||
- name: "Prepare Report Portal"
|
||||
if: github.ref_name == 'master'
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-prepare@v8.16.0
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-prepare@v8.2.0
|
||||
id: rp-prepare
|
||||
with:
|
||||
rp-launch-prefix: ${{ env.RP_LAUNCH_PREFIX }} - ${{ matrix.testModule }}
|
||||
@@ -214,7 +219,7 @@ jobs:
|
||||
continue-on-error: true
|
||||
- name: "Summarize Report Portal"
|
||||
if: github.ref_name == 'master'
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-summarize@v8.16.0
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-summarize@v8.2.0
|
||||
id: rp-summarize
|
||||
with:
|
||||
tests-outcome: ${{ steps.run-tests.outcome }}
|
||||
@@ -256,9 +261,9 @@ jobs:
|
||||
REQUIRES_INSTALLED_ARTIFACTS: true
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.2.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.2.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.2.0
|
||||
- name: "Build"
|
||||
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
|
||||
run: |
|
||||
@@ -267,10 +272,11 @@ jobs:
|
||||
- name: "Set transformers tag"
|
||||
run: echo "TRANSFORMERS_TAG=$(mvn help:evaluate -Dexpression=dependency.alfresco-transform-core.version -q -DforceStdout)" >> $GITHUB_ENV
|
||||
- name: "Set up the environment"
|
||||
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
|
||||
run: docker compose -f ./scripts/ci/docker-compose/docker-compose.yaml --profile ${{ matrix.compose-profile }} up -d
|
||||
- name: "Prepare Report Portal"
|
||||
if: github.ref_name == 'master'
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-prepare@v8.16.0
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-prepare@v8.2.0
|
||||
id: rp-prepare
|
||||
with:
|
||||
rp-launch-prefix: ${{ env.RP_LAUNCH_PREFIX }} - ${{ matrix.testSuite }}
|
||||
@@ -301,7 +307,7 @@ jobs:
|
||||
continue-on-error: true
|
||||
- name: "Summarize Report Portal"
|
||||
if: github.ref_name == 'master'
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-summarize@v8.16.0
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-summarize@v8.2.0
|
||||
id: rp-summarize
|
||||
with:
|
||||
tests-outcome: ${{ steps.run-tests.outcome }}
|
||||
@@ -334,9 +340,9 @@ jobs:
|
||||
version: ['10.2.18', '10.4', '10.5']
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.2.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.2.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.2.0
|
||||
- name: "Init"
|
||||
run: bash ./scripts/ci/init.sh
|
||||
- name: Run MariaDB ${{ matrix.version }} database
|
||||
@@ -345,7 +351,7 @@ jobs:
|
||||
MARIADB_VERSION: ${{ matrix.version }}
|
||||
- name: "Prepare Report Portal"
|
||||
if: github.ref_name == 'master'
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-prepare@v8.16.0
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-prepare@v8.2.0
|
||||
id: rp-prepare
|
||||
with:
|
||||
rp-launch-prefix: ${{ env.RP_LAUNCH_PREFIX }} - ${{ matrix.version }}
|
||||
@@ -376,7 +382,7 @@ jobs:
|
||||
continue-on-error: true
|
||||
- name: "Summarize Report Portal"
|
||||
if: github.ref_name == 'master'
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-summarize@v8.16.0
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-summarize@v8.2.0
|
||||
id: rp-summarize
|
||||
with:
|
||||
tests-outcome: ${{ steps.run-tests.outcome }}
|
||||
@@ -405,9 +411,9 @@ jobs:
|
||||
!contains(github.event.head_commit.message, '[force')
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.2.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.2.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.2.0
|
||||
- name: "Init"
|
||||
run: bash ./scripts/ci/init.sh
|
||||
- name: "Run MariaDB 10.6 database"
|
||||
@@ -416,7 +422,7 @@ jobs:
|
||||
MARIADB_VERSION: 10.6
|
||||
- name: "Prepare Report Portal"
|
||||
if: github.ref_name == 'master'
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-prepare@v8.16.0
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-prepare@v8.2.0
|
||||
id: rp-prepare
|
||||
with:
|
||||
rp-launch-prefix: ${{ env.RP_LAUNCH_PREFIX }}
|
||||
@@ -447,7 +453,7 @@ jobs:
|
||||
continue-on-error: true
|
||||
- name: "Summarize Report Portal"
|
||||
if: github.ref_name == 'master'
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-summarize@v8.16.0
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-summarize@v8.2.0
|
||||
id: rp-summarize
|
||||
with:
|
||||
tests-outcome: ${{ steps.run-tests.outcome }}
|
||||
@@ -476,9 +482,9 @@ jobs:
|
||||
!contains(github.event.head_commit.message, '[force')
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.2.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.2.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.2.0
|
||||
- name: "Init"
|
||||
run: bash ./scripts/ci/init.sh
|
||||
- name: "Run MySQL 8 database"
|
||||
@@ -487,7 +493,7 @@ jobs:
|
||||
MYSQL_VERSION: 8
|
||||
- name: "Prepare Report Portal"
|
||||
if: github.ref_name == 'master'
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-prepare@v8.16.0
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-prepare@v8.2.0
|
||||
id: rp-prepare
|
||||
with:
|
||||
rp-launch-prefix: ${{ env.RP_LAUNCH_PREFIX }}
|
||||
@@ -518,7 +524,7 @@ jobs:
|
||||
continue-on-error: true
|
||||
- name: "Summarize Report Portal"
|
||||
if: github.ref_name == 'master'
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-summarize@v8.16.0
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-summarize@v8.2.0
|
||||
id: rp-summarize
|
||||
with:
|
||||
tests-outcome: ${{ steps.run-tests.outcome }}
|
||||
@@ -546,9 +552,9 @@ jobs:
|
||||
!contains(github.event.head_commit.message, '[force')
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.2.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.2.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.2.0
|
||||
- name: "Init"
|
||||
run: bash ./scripts/ci/init.sh
|
||||
- name: "Run PostgreSQL 13.12 database"
|
||||
@@ -557,7 +563,7 @@ jobs:
|
||||
POSTGRES_VERSION: 13.12
|
||||
- name: "Prepare Report Portal"
|
||||
if: github.ref_name == 'master'
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-prepare@v8.16.0
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-prepare@v8.2.0
|
||||
id: rp-prepare
|
||||
with:
|
||||
rp-launch-prefix: ${{ env.RP_LAUNCH_PREFIX }}
|
||||
@@ -588,7 +594,7 @@ jobs:
|
||||
continue-on-error: true
|
||||
- name: "Summarize Report Portal"
|
||||
if: github.ref_name == 'master'
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-summarize@v8.16.0
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-summarize@v8.2.0
|
||||
id: rp-summarize
|
||||
with:
|
||||
tests-outcome: ${{ steps.run-tests.outcome }}
|
||||
@@ -616,9 +622,9 @@ jobs:
|
||||
!contains(github.event.head_commit.message, '[force')
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.2.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.2.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.2.0
|
||||
- name: "Init"
|
||||
run: bash ./scripts/ci/init.sh
|
||||
- name: "Run PostgreSQL 14.9 database"
|
||||
@@ -627,7 +633,7 @@ jobs:
|
||||
POSTGRES_VERSION: 14.9
|
||||
- name: "Prepare Report Portal"
|
||||
if: github.ref_name == 'master'
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-prepare@v8.16.0
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-prepare@v8.2.0
|
||||
id: rp-prepare
|
||||
with:
|
||||
rp-launch-prefix: ${{ env.RP_LAUNCH_PREFIX }}
|
||||
@@ -658,7 +664,7 @@ jobs:
|
||||
continue-on-error: true
|
||||
- name: "Summarize Report Portal"
|
||||
if: github.ref_name == 'master'
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-summarize@v8.16.0
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-summarize@v8.2.0
|
||||
id: rp-summarize
|
||||
with:
|
||||
tests-outcome: ${{ steps.run-tests.outcome }}
|
||||
@@ -686,9 +692,9 @@ jobs:
|
||||
!contains(github.event.head_commit.message, '[force')
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.2.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.2.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.2.0
|
||||
- name: "Init"
|
||||
run: bash ./scripts/ci/init.sh
|
||||
- name: "Run PostgreSQL 15.4 database"
|
||||
@@ -697,7 +703,7 @@ jobs:
|
||||
POSTGRES_VERSION: 15.4
|
||||
- name: "Prepare Report Portal"
|
||||
if: github.ref_name == 'master'
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-prepare@v8.16.0
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-prepare@v8.2.0
|
||||
id: rp-prepare
|
||||
with:
|
||||
rp-launch-prefix: ${{ env.RP_LAUNCH_PREFIX }}
|
||||
@@ -728,7 +734,7 @@ jobs:
|
||||
continue-on-error: true
|
||||
- name: "Summarize Report Portal"
|
||||
if: github.ref_name == 'master'
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-summarize@v8.16.0
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-summarize@v8.2.0
|
||||
id: rp-summarize
|
||||
with:
|
||||
tests-outcome: ${{ steps.run-tests.outcome }}
|
||||
@@ -754,16 +760,16 @@ jobs:
|
||||
!contains(github.event.head_commit.message, '[force')
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.2.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.2.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.2.0
|
||||
- name: "Init"
|
||||
run: bash ./scripts/ci/init.sh
|
||||
- name: "Run ActiveMQ"
|
||||
run: docker compose -f ./scripts/ci/docker-compose/docker-compose.yaml --profile activemq up -d
|
||||
- name: "Prepare Report Portal"
|
||||
if: github.ref_name == 'master'
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-prepare@v8.16.0
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-prepare@v8.2.0
|
||||
id: rp-prepare
|
||||
with:
|
||||
rp-launch-prefix: ${{ env.RP_LAUNCH_PREFIX }}
|
||||
@@ -794,7 +800,7 @@ jobs:
|
||||
continue-on-error: true
|
||||
- name: "Summarize Report Portal"
|
||||
if: github.ref_name == 'master'
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-summarize@v8.16.0
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-summarize@v8.2.0
|
||||
id: rp-summarize
|
||||
with:
|
||||
tests-outcome: ${{ steps.run-tests.outcome }}
|
||||
@@ -854,9 +860,9 @@ jobs:
|
||||
mvn-options: '-Dencryption.ssl.keystore.location=${CI_WORKSPACE}/keystores/alfresco/alfresco.keystore -Dencryption.ssl.truststore.location=${CI_WORKSPACE}/keystores/alfresco/alfresco.truststore'
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.2.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.2.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.2.0
|
||||
- name: "Init"
|
||||
run: bash ./scripts/ci/init.sh
|
||||
- name: "Set transformers tag"
|
||||
@@ -875,10 +881,11 @@ jobs:
|
||||
echo "HOSTNAME_VERIFICATION_DISABLED=false" >> "$GITHUB_ENV"
|
||||
fi
|
||||
- name: "Set up the environment"
|
||||
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
|
||||
run: docker compose -f ./scripts/ci/docker-compose/docker-compose.yaml --profile ${{ matrix.compose-profile }} up -d
|
||||
- name: "Prepare Report Portal"
|
||||
if: github.ref_name == 'master'
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-prepare@v8.16.0
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-prepare@v8.2.0
|
||||
id: rp-prepare
|
||||
with:
|
||||
rp-launch-prefix: ${{ env.RP_LAUNCH_PREFIX }} - ${{ matrix.testSuite }} ${{ matrix.idp }}
|
||||
@@ -909,7 +916,7 @@ jobs:
|
||||
continue-on-error: true
|
||||
- name: "Summarize Report Portal"
|
||||
if: github.ref_name == 'master'
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-summarize@v8.16.0
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-summarize@v8.2.0
|
||||
id: rp-summarize
|
||||
with:
|
||||
tests-outcome: ${{ steps.run-tests.outcome }}
|
||||
@@ -967,15 +974,16 @@ jobs:
|
||||
REQUIRES_LOCAL_IMAGES: true
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.2.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.2.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.2.0
|
||||
- name: "Build"
|
||||
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
|
||||
run: |
|
||||
bash ./scripts/ci/init.sh
|
||||
bash ./scripts/ci/build.sh
|
||||
- name: "Set up the environment"
|
||||
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
|
||||
run: |
|
||||
${{ env.TAS_SCRIPTS }}/start-compose.sh ${{ env.TAS_ENVIRONMENT }}/docker-compose-minimal+transforms.yml
|
||||
${{ env.TAS_SCRIPTS }}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco"
|
||||
@@ -984,7 +992,7 @@ jobs:
|
||||
run: mvn install -pl :alfresco-community-repo-integration-test -am -DskipTests -Pall-tas-tests
|
||||
- name: "Prepare Report Portal"
|
||||
if: github.ref_name == 'master'
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-prepare@v8.16.0
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-prepare@v8.2.0
|
||||
id: rp-prepare
|
||||
with:
|
||||
rp-launch-prefix: ${{ env.RP_LAUNCH_PREFIX }} - ${{ matrix.test-name }}
|
||||
@@ -1022,7 +1030,7 @@ jobs:
|
||||
continue-on-error: true
|
||||
- name: "Summarize Report Portal"
|
||||
if: github.ref_name == 'master'
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-summarize@v8.16.0
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-summarize@v8.2.0
|
||||
id: rp-summarize
|
||||
with:
|
||||
tests-outcome: ${{ steps.tests.outcome }}
|
||||
@@ -1048,16 +1056,16 @@ jobs:
|
||||
!contains(github.event.head_commit.message, '[force')
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.2.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.2.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.2.0
|
||||
- name: "Init"
|
||||
run: bash ./scripts/ci/init.sh
|
||||
- name: "Run Postgres 15.4 database"
|
||||
run: docker compose -f ./scripts/ci/docker-compose/docker-compose.yaml --profile postgres up -d
|
||||
- name: "Prepare Report Portal"
|
||||
if: github.ref_name == 'master'
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-prepare@v8.16.0
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-prepare@v8.2.0
|
||||
id: rp-prepare
|
||||
with:
|
||||
rp-launch-prefix: ${{ env.RP_LAUNCH_PREFIX }}
|
||||
@@ -1088,7 +1096,7 @@ jobs:
|
||||
continue-on-error: true
|
||||
- name: "Summarize Report Portal"
|
||||
if: github.ref_name == 'master'
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-summarize@v8.16.0
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-summarize@v8.2.0
|
||||
id: rp-summarize
|
||||
with:
|
||||
tests-outcome: ${{ steps.run-tests.outcome }}
|
||||
@@ -1122,9 +1130,9 @@ jobs:
|
||||
REQUIRES_INSTALLED_ARTIFACTS: true
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.2.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.2.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.2.0
|
||||
- name: "Build"
|
||||
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
|
||||
run: |
|
||||
@@ -1132,7 +1140,7 @@ jobs:
|
||||
bash ./scripts/ci/build.sh
|
||||
- name: "Prepare Report Portal"
|
||||
if: github.ref_name == 'master'
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-prepare@v8.16.0
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-prepare@v8.2.0
|
||||
id: rp-prepare
|
||||
with:
|
||||
rp-launch-prefix: ${{ env.RP_LAUNCH_PREFIX }} 0${{ matrix.part }} - (PostgreSQL) ${{ matrix.test-name }}
|
||||
@@ -1168,9 +1176,9 @@ jobs:
|
||||
REQUIRES_INSTALLED_ARTIFACTS: true
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.2.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.2.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.2.0
|
||||
- name: "Build"
|
||||
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
|
||||
run: |
|
||||
@@ -1178,7 +1186,7 @@ jobs:
|
||||
bash ./scripts/ci/build.sh
|
||||
- name: "Prepare Report Portal"
|
||||
if: github.ref_name == 'master'
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-prepare@v8.16.0
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-prepare@v8.2.0
|
||||
id: rp-prepare
|
||||
with:
|
||||
rp-launch-prefix: ${{ env.RP_LAUNCH_PREFIX }} 0${{ matrix.part }} - (MySQL) ${{ matrix.test-name }}
|
||||
@@ -1210,9 +1218,9 @@ jobs:
|
||||
REQUIRES_LOCAL_IMAGES: true
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.2.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.2.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.2.0
|
||||
- name: "Build"
|
||||
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
|
||||
run: |
|
||||
@@ -1226,7 +1234,7 @@ jobs:
|
||||
mvn -B install -pl :alfresco-governance-services-automation-community-rest-api -am -Pags -Pall-tas-tests -DskipTests
|
||||
- name: "Prepare Report Portal"
|
||||
if: github.ref_name == 'master'
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-prepare@v8.16.0
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-prepare@v8.2.0
|
||||
id: rp-prepare
|
||||
with:
|
||||
rp-launch-prefix: ${{ env.RP_LAUNCH_PREFIX }}
|
||||
@@ -1258,7 +1266,7 @@ jobs:
|
||||
continue-on-error: true
|
||||
- name: "Summarize Report Portal"
|
||||
if: github.ref_name == 'master'
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-summarize@v8.16.0
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/reportportal-summarize@v8.2.0
|
||||
id: rp-summarize
|
||||
with:
|
||||
tests-outcome: ${{ steps.run-tests.outcome }}
|
||||
@@ -1300,9 +1308,9 @@ jobs:
|
||||
!contains(github.event.head_commit.message, '[force]')
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.2.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.2.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.2.0
|
||||
- name: "Build"
|
||||
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
|
||||
run: |
|
||||
|
||||
16
.github/workflows/master_release.yml
vendored
16
.github/workflows/master_release.yml
vendored
@@ -34,12 +34,12 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
persist-credentials: false
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.2.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.2.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.2.0
|
||||
- name: "Init"
|
||||
run: bash ./scripts/ci/init.sh
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/configure-git-author@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/configure-git-author@v8.2.0
|
||||
with:
|
||||
username: ${{ env.GIT_USERNAME }}
|
||||
email: ${{ env.GIT_EMAIL }}
|
||||
@@ -63,12 +63,12 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
persist-credentials: false
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.2.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.2.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.2.0
|
||||
- name: "Init"
|
||||
run: bash ./scripts/ci/init.sh
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/configure-git-author@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/configure-git-author@v8.2.0
|
||||
with:
|
||||
username: ${{ env.GIT_USERNAME }}
|
||||
email: ${{ env.GIT_EMAIL }}
|
||||
|
||||
@@ -133,21 +133,21 @@
|
||||
"filename": ".github/workflows/ci.yml",
|
||||
"hashed_secret": "b86dc2f033a63f2b7b9e7d270ab806d2910d7572",
|
||||
"is_verified": false,
|
||||
"line_number": 293
|
||||
"line_number": 299
|
||||
},
|
||||
{
|
||||
"type": "Secret Keyword",
|
||||
"filename": ".github/workflows/ci.yml",
|
||||
"hashed_secret": "1bfb0e20f886150ba59b853bcd49dea893e00966",
|
||||
"is_verified": false,
|
||||
"line_number": 368
|
||||
"line_number": 374
|
||||
},
|
||||
{
|
||||
"type": "Secret Keyword",
|
||||
"filename": ".github/workflows/ci.yml",
|
||||
"hashed_secret": "128f14373ccfaff49e3664045d3a11b50cbb7b39",
|
||||
"is_verified": false,
|
||||
"line_number": 901
|
||||
"line_number": 908
|
||||
}
|
||||
],
|
||||
".github/workflows/master_release.yml": [
|
||||
@@ -731,7 +731,7 @@
|
||||
"filename": "remote-api/src/test/java/org/alfresco/rest/api/tests/AbstractBaseApiTest.java",
|
||||
"hashed_secret": "d033e22ae348aeb5660fc2140aec35850c4da997",
|
||||
"is_verified": false,
|
||||
"line_number": 120,
|
||||
"line_number": 111,
|
||||
"is_secret": false
|
||||
}
|
||||
],
|
||||
@@ -1539,7 +1539,7 @@
|
||||
"filename": "repository/src/test/java/org/alfresco/repo/rendition2/AbstractRenditionIntegrationTest.java",
|
||||
"hashed_secret": "5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8",
|
||||
"is_verified": false,
|
||||
"line_number": 130,
|
||||
"line_number": 127,
|
||||
"is_secret": false
|
||||
}
|
||||
],
|
||||
@@ -1599,7 +1599,7 @@
|
||||
"filename": "repository/src/test/java/org/alfresco/repo/security/authentication/identityservice/IdentityServiceFacadeFactoryBeanTest.java",
|
||||
"hashed_secret": "c4b66dbe168ad1d2b19119494a0da063801bc3bb",
|
||||
"is_verified": false,
|
||||
"line_number": 83,
|
||||
"line_number": 82,
|
||||
"is_secret": false
|
||||
},
|
||||
{
|
||||
@@ -1607,7 +1607,7 @@
|
||||
"filename": "repository/src/test/java/org/alfresco/repo/security/authentication/identityservice/IdentityServiceFacadeFactoryBeanTest.java",
|
||||
"hashed_secret": "c5aad1895e1dcff195992938f1bcc9954d575ac9",
|
||||
"is_verified": false,
|
||||
"line_number": 92,
|
||||
"line_number": 91,
|
||||
"is_secret": false
|
||||
}
|
||||
],
|
||||
@@ -1627,7 +1627,7 @@
|
||||
"filename": "repository/src/test/java/org/alfresco/repo/security/authentication/identityservice/SpringBasedIdentityServiceFacadeUnitTest.java",
|
||||
"hashed_secret": "5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8",
|
||||
"is_verified": false,
|
||||
"line_number": 46,
|
||||
"line_number": 47,
|
||||
"is_secret": false
|
||||
}
|
||||
],
|
||||
@@ -1888,5 +1888,5 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"generated_at": "2025-03-31T12:42:09Z"
|
||||
"generated_at": "2025-01-07T10:56:22Z"
|
||||
}
|
||||
@@ -126,4 +126,3 @@ Please use [**this guide**](CONTRIBUTING.md) to make a contribution to the proje
|
||||
|
||||
- [Alfresco Content Services Documentation](https://docs.alfresco.com/content-services/latest/)
|
||||
- [Alfresco Platform](https://www.hyland.com/en/products/alfresco-platform)
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-amps</artifactId>
|
||||
<version>23.3.12.1</version>
|
||||
<version>25.1.0.21-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-governance-services-community-parent</artifactId>
|
||||
<version>23.3.12.1</version>
|
||||
<version>25.1.0.21-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-governance-services-automation-community-repo</artifactId>
|
||||
<version>23.3.12.1</version>
|
||||
<version>25.1.0.21-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<build>
|
||||
@@ -98,7 +98,7 @@
|
||||
<dependency>
|
||||
<groupId>com.github.docker-java</groupId>
|
||||
<artifactId>docker-java</artifactId>
|
||||
<version>3.3.6</version>
|
||||
<version>3.4.0</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.bouncycastle</groupId>
|
||||
|
||||
@@ -134,16 +134,6 @@ public class AddToHoldsBulkV1Tests extends BaseRMRestTest
|
||||
.until(() -> getRestAPIFactory().getSearchAPI(null).search(searchRequest).getPagination()
|
||||
.getTotalItems() == NUMBER_OF_FILES);
|
||||
|
||||
RestRequestQueryModel ancestorReq = getContentFromFolderAndAllSubfoldersQuery(rootFolder.getNodeRefWithoutVersion());
|
||||
SearchRequest ancestorSearchRequest = new SearchRequest();
|
||||
ancestorSearchRequest.setQuery(ancestorReq);
|
||||
|
||||
STEP("Wait until paths are indexed.");
|
||||
// to improve stability on CI - seems that sometimes during big load we need to wait longer for the condition
|
||||
await().atMost(120, TimeUnit.SECONDS)
|
||||
.until(() -> getRestAPIFactory().getSearchAPI(null).search(ancestorSearchRequest).getPagination()
|
||||
.getTotalItems() == NUMBER_OF_FILES);
|
||||
|
||||
holdBulkOperation = HoldBulkOperation.builder()
|
||||
.query(queryReq)
|
||||
.op(HoldBulkOperationType.ADD).build();
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-governance-services-community-parent</artifactId>
|
||||
<version>23.3.12.1</version>
|
||||
<version>25.1.0.21-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
SOLR6_TAG=2.0.11
|
||||
SOLR6_TAG=2.0.13
|
||||
POSTGRES_TAG=15.4
|
||||
ACTIVEMQ_TAG=5.18.3-jre17-rockylinux8
|
||||
|
||||
@@ -119,11 +119,6 @@ rm.patch.v35.holdNewChildAssocPatch.batchSize=1000
|
||||
rm.haspermissionmap.read=Read
|
||||
rm.haspermissionmap.write=WriteProperties,AddChildren,ReadContent
|
||||
|
||||
# Extended Permissions
|
||||
# Enable matching the given username with the correct casing username when retrieving an IPR group.
|
||||
# Only needs to be used if there are owners that don't have the username in the correct casing.
|
||||
rm.extendedSecurity.enableUsernameNormalization=false
|
||||
|
||||
#
|
||||
# Extended auto-version behaviour. If true and other auto-version properties are satisfied, then
|
||||
# a document will be auto-versioned when its type is changed.
|
||||
|
||||
@@ -611,7 +611,6 @@
|
||||
<property name="authorityService" ref="authorityService"/>
|
||||
<property name="permissionService" ref="permissionService"/>
|
||||
<property name="transactionService" ref="transactionService"/>
|
||||
<property name="enableUsernameNormalization" value="${rm.extendedSecurity.enableUsernameNormalization}" />
|
||||
</bean>
|
||||
|
||||
<bean id="ExtendedSecurityService" class="org.springframework.aop.framework.ProxyFactoryBean">
|
||||
|
||||
@@ -35,4 +35,3 @@
|
||||
}
|
||||
</#escape>
|
||||
</#macro>
|
||||
|
||||
|
||||
@@ -219,4 +219,3 @@ function getRecordFolder(recordFolder, parentPath)
|
||||
|
||||
// Start webscript
|
||||
main();
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-governance-services-community-repo-parent</artifactId>
|
||||
<version>23.3.12.1</version>
|
||||
<version>25.1.0.21-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
||||
@@ -30,8 +30,7 @@ package org.alfresco.module.org_alfresco_module_dod5015.caveat;
|
||||
/**
|
||||
* Compatibility Implementation.
|
||||
* <p>
|
||||
* Used as a compatibility implementation when migrating from V1.0 to V2.0. RMCustom model still references
|
||||
* this class implementation, but package has been changed.
|
||||
* Used as a compatibility implementation when migrating from V1.0 to V2.0. RMCustom model still references this class implementation, but package has been changed.
|
||||
*
|
||||
* @author Roy Wetherall
|
||||
*/
|
||||
|
||||
@@ -27,9 +27,10 @@
|
||||
|
||||
package org.alfresco.module.org_alfresco_module_rm;
|
||||
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
|
||||
import org.alfresco.service.namespace.QName;
|
||||
|
||||
/**
|
||||
* @deprecated as of 2.1 see {@link org.alfresco.module.org_alfresco_module_rm.admin.CannotApplyConstraintMetadataException}
|
||||
*/
|
||||
|
||||
@@ -27,9 +27,10 @@
|
||||
|
||||
package org.alfresco.module.org_alfresco_module_rm;
|
||||
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
|
||||
import org.alfresco.service.namespace.QName;
|
||||
|
||||
/**
|
||||
* @deprecated as of 2.1 see {@link org.alfresco.module.org_alfresco_module_rm.admin.InvalidCustomAspectMetadataException}
|
||||
*/
|
||||
|
||||
@@ -31,7 +31,7 @@ package org.alfresco.module.org_alfresco_module_rm;
|
||||
* @deprecated as of 2.1 see {@link org.alfresco.module.org_alfresco_module_rm.admin.RecordsManagementAdminService}
|
||||
*/
|
||||
public interface RecordsManagementAdminService
|
||||
extends org.alfresco.module.org_alfresco_module_rm.admin.RecordsManagementAdminService
|
||||
extends org.alfresco.module.org_alfresco_module_rm.admin.RecordsManagementAdminService
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -53,10 +53,10 @@ import org.alfresco.service.namespace.QName;
|
||||
* @deprecated as of 2.2
|
||||
*/
|
||||
public class RecordsManagementServiceImpl extends ServiceBaseImpl
|
||||
implements RecordsManagementService,
|
||||
RecordsManagementModel
|
||||
implements RecordsManagementService,
|
||||
RecordsManagementModel
|
||||
{
|
||||
/** Store that the RM roots are contained within */
|
||||
/** Store that the RM roots are contained within */
|
||||
@SuppressWarnings("unused")
|
||||
@Deprecated
|
||||
private StoreRef defaultStoreRef = StoreRef.STORE_REF_WORKSPACE_SPACESSTORE;
|
||||
@@ -67,7 +67,8 @@ public class RecordsManagementServiceImpl extends ServiceBaseImpl
|
||||
/**
|
||||
* Set the service registry service
|
||||
*
|
||||
* @param serviceRegistry service registry
|
||||
* @param serviceRegistry
|
||||
* service registry
|
||||
*/
|
||||
public void setRecordsManagementServiceRegistry(RecordsManagementServiceRegistry serviceRegistry)
|
||||
{
|
||||
@@ -78,7 +79,9 @@ public class RecordsManagementServiceImpl extends ServiceBaseImpl
|
||||
|
||||
/**
|
||||
* Sets the default RM store reference
|
||||
* @param defaultStoreRef store reference
|
||||
*
|
||||
* @param defaultStoreRef
|
||||
* store reference
|
||||
*/
|
||||
@Deprecated
|
||||
public void setDefaultStoreRef(StoreRef defaultStoreRef)
|
||||
@@ -91,7 +94,7 @@ public class RecordsManagementServiceImpl extends ServiceBaseImpl
|
||||
*/
|
||||
private FilePlanService getFilePlanService()
|
||||
{
|
||||
return serviceRegistry.getFilePlanService();
|
||||
return serviceRegistry.getFilePlanService();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -425,7 +428,7 @@ public class RecordsManagementServiceImpl extends ServiceBaseImpl
|
||||
* @deprecated As of 2.2, see {@link RecordFolderService#createRecordFolder(NodeRef, String, Map)}
|
||||
*/
|
||||
@Override
|
||||
public NodeRef createRecordFolder(NodeRef parent, String name, Map<QName, Serializable> properties)
|
||||
public NodeRef createRecordFolder(NodeRef parent, String name, Map<QName, Serializable> properties)
|
||||
{
|
||||
return getRecordFolderService().createRecordFolder(parent, name, properties);
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ import java.util.Map;
|
||||
|
||||
for (Map.Entry<String, List<String>> entry : source.entrySet())
|
||||
{
|
||||
List<String>values = entry.getValue();
|
||||
List<String> values = entry.getValue();
|
||||
for (String value : values)
|
||||
{
|
||||
String authority = entry.getKey();
|
||||
@@ -54,7 +54,7 @@ import java.util.Map;
|
||||
{
|
||||
// already exists
|
||||
List<String> list = pivot.get(value);
|
||||
list.add(authority );
|
||||
list.add(authority);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -65,7 +65,8 @@ public interface RMCaveatConfigComponent
|
||||
/**
|
||||
* Get RM constraint list
|
||||
*
|
||||
* @param listName the name of the RMConstraintList
|
||||
* @param listName
|
||||
* the name of the RMConstraintList
|
||||
*/
|
||||
RMConstraintInfo getRMConstraint(String listName);
|
||||
|
||||
@@ -82,12 +83,12 @@ public interface RMCaveatConfigComponent
|
||||
/**
|
||||
* Update RM constraint values for given authority
|
||||
*/
|
||||
void updateRMConstraintListAuthority(String listName, String authorityName, List<String>values);
|
||||
void updateRMConstraintListAuthority(String listName, String authorityName, List<String> values);
|
||||
|
||||
/**
|
||||
* Update RM constraint authorities for given value
|
||||
*/
|
||||
void updateRMConstraintListValue(String listName, String valueName, List<String>authorities);
|
||||
void updateRMConstraintListValue(String listName, String valueName, List<String> authorities);
|
||||
|
||||
/**
|
||||
* Remove RM constraint value (all authorities)
|
||||
@@ -102,12 +103,14 @@ public interface RMCaveatConfigComponent
|
||||
/**
|
||||
* Delete RM Constraint
|
||||
*
|
||||
* @param listName the name of the RMConstraintList
|
||||
* @param listName
|
||||
* the name of the RMConstraintList
|
||||
*/
|
||||
void deleteRMConstraint(String listName);
|
||||
|
||||
/**
|
||||
* Get the details of a caveat list
|
||||
*
|
||||
* @param listName
|
||||
* @return
|
||||
*/
|
||||
|
||||
@@ -45,6 +45,11 @@ import java.util.concurrent.locks.ReadWriteLock;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||
|
||||
import net.sf.acegisecurity.AccessDeniedException;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.caveat.RMListOfValuesConstraint.MatchLogic;
|
||||
@@ -77,10 +82,6 @@ import org.alfresco.service.cmr.security.PersonService;
|
||||
import org.alfresco.service.namespace.NamespaceService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.util.JSONtoFmModel;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
/**
|
||||
* RM Caveat Config component impl
|
||||
@@ -89,9 +90,9 @@ import org.json.JSONObject;
|
||||
*/
|
||||
@BehaviourBean(defaultType = "rma:caveatConfig")
|
||||
public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnContentUpdatePolicy,
|
||||
NodeServicePolicies.BeforeDeleteNodePolicy,
|
||||
NodeServicePolicies.OnCreateNodePolicy,
|
||||
RMCaveatConfigComponent
|
||||
NodeServicePolicies.BeforeDeleteNodePolicy,
|
||||
NodeServicePolicies.OnCreateNodePolicy,
|
||||
RMCaveatConfigComponent
|
||||
{
|
||||
private static Log logger = LogFactory.getLog(RMCaveatConfigComponentImpl.class);
|
||||
|
||||
@@ -122,12 +123,7 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
|
||||
private Lock readLock = lock.readLock();
|
||||
private Lock writeLock = lock.writeLock();
|
||||
|
||||
/*
|
||||
* Caveat Config (Shared) config
|
||||
* first string is property name
|
||||
* second string is authority name (user or group full name)
|
||||
* third string is list of values of property
|
||||
*/
|
||||
/* Caveat Config (Shared) config first string is property name second string is authority name (user or group full name) third string is list of values of property */
|
||||
private SimpleCache<String, Map<String, List<String>>> caveatConfig;
|
||||
|
||||
public void setCaveatConfig(SimpleCache<String, Map<String, List<String>>> caveatConfig)
|
||||
@@ -194,7 +190,7 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
|
||||
|
||||
if (logger.isInfoEnabled())
|
||||
{
|
||||
logger.info("Caveat aspects configured "+caveatAspectQNames);
|
||||
logger.info("Caveat aspects configured " + caveatAspectQNames);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -211,7 +207,7 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
|
||||
|
||||
if (logger.isInfoEnabled())
|
||||
{
|
||||
logger.info("Caveat models configured "+caveatModelQNames);
|
||||
logger.info("Caveat models configured " + caveatModelQNames);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -227,20 +223,17 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.repo.content.ContentServicePolicies.OnContentUpdatePolicy#onContentUpdate(org.alfresco.service.cmr.repository.NodeRef, boolean)
|
||||
* RM-2770 - this method has to be fired on transaction commit to be able to validate the content when the content store is encrypted
|
||||
* @see org.alfresco.repo.content.ContentServicePolicies.OnContentUpdatePolicy#onContentUpdate(org.alfresco.service.cmr.repository.NodeRef, boolean) RM-2770 - this method has to be fired on transaction commit to be able to validate the content when the content store is encrypted
|
||||
*/
|
||||
@Override
|
||||
@Behaviour
|
||||
(
|
||||
@Behaviour(
|
||||
kind = BehaviourKind.CLASS,
|
||||
notificationFrequency = NotificationFrequency.TRANSACTION_COMMIT
|
||||
)
|
||||
notificationFrequency = NotificationFrequency.TRANSACTION_COMMIT)
|
||||
public void onContentUpdate(NodeRef nodeRef, boolean newContent)
|
||||
{
|
||||
if (logger.isInfoEnabled())
|
||||
{
|
||||
logger.info("onContentUpdate: "+nodeRef+", "+newContent);
|
||||
logger.info("onContentUpdate: " + nodeRef + ", " + newContent);
|
||||
}
|
||||
|
||||
validateAndReset(nodeRef);
|
||||
@@ -255,7 +248,7 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
|
||||
{
|
||||
if (logger.isInfoEnabled())
|
||||
{
|
||||
logger.info("beforeDeleteNode: "+nodeRef);
|
||||
logger.info("beforeDeleteNode: " + nodeRef);
|
||||
}
|
||||
|
||||
validateAndReset(nodeRef);
|
||||
@@ -270,7 +263,7 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
|
||||
{
|
||||
if (logger.isInfoEnabled())
|
||||
{
|
||||
logger.info("onCreateNode: "+childAssocRef);
|
||||
logger.info("onCreateNode: " + childAssocRef);
|
||||
}
|
||||
|
||||
validateAndReset(childAssocRef.getChildRef());
|
||||
@@ -279,8 +272,9 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
|
||||
/**
|
||||
* Validate the caveat config and optionally update the cache.
|
||||
*
|
||||
* @param nodeRef The nodeRef of the config
|
||||
*/
|
||||
* @param nodeRef
|
||||
* The nodeRef of the config
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
protected void validateAndReset(NodeRef nodeRef)
|
||||
{
|
||||
@@ -294,9 +288,9 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
|
||||
if (caveatConfigData != null)
|
||||
{
|
||||
NodeRef existing = getCaveatConfigNode();
|
||||
if ((existing != null && (! existing.equals(nodeRef))))
|
||||
if ((existing != null && (!existing.equals(nodeRef))))
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Cannot create more than one caveat config (existing="+existing+", new="+nodeRef+")");
|
||||
throw new AlfrescoRuntimeException("Cannot create more than one caveat config (existing=" + existing + ", new=" + nodeRef + ")");
|
||||
}
|
||||
|
||||
try
|
||||
@@ -321,7 +315,7 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
|
||||
|
||||
if (logger.isTraceEnabled())
|
||||
{
|
||||
logger.trace("validateAndReset: models to check "+models);
|
||||
logger.trace("validateAndReset: models to check " + models);
|
||||
}
|
||||
|
||||
for (QName model : models)
|
||||
@@ -338,7 +332,7 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
|
||||
{
|
||||
if (logger.isTraceEnabled())
|
||||
{
|
||||
logger.trace("validateAndReset: properties to check "+props);
|
||||
logger.trace("validateAndReset: properties to check " + props);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -361,12 +355,12 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
|
||||
}
|
||||
}
|
||||
|
||||
if (! prefixFound)
|
||||
if (!prefixFound)
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Unexpected prefix: "+ conPrefix + " (" + conStr +") expected one of "+expectedPrefixes+")");
|
||||
throw new AlfrescoRuntimeException("Unexpected prefix: " + conPrefix + " (" + conStr + ") expected one of " + expectedPrefixes + ")");
|
||||
}
|
||||
|
||||
Map<String, List<String>> caveatMap = (Map<String, List<String>>)conEntry.getValue();
|
||||
Map<String, List<String>> caveatMap = (Map<String, List<String>>) conEntry.getValue();
|
||||
|
||||
List<String> allowedValues = null;
|
||||
@SuppressWarnings("unused")
|
||||
@@ -381,15 +375,14 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
|
||||
final Constraint con = conDef.getConstraint();
|
||||
if (con instanceof RMListOfValuesConstraint)
|
||||
{
|
||||
String conName = ((RMListOfValuesConstraint)con).getShortName();
|
||||
String conName = ((RMListOfValuesConstraint) con).getShortName();
|
||||
if (conName.equals(conStr))
|
||||
{
|
||||
// note: assumes only one caveat/LOV against a given property
|
||||
allowedValues = AuthenticationUtil.runAs(new RunAsWork<List<String>>()
|
||||
{
|
||||
allowedValues = AuthenticationUtil.runAs(new RunAsWork<List<String>>() {
|
||||
public List<String> doWork()
|
||||
{
|
||||
return ((RMListOfValuesConstraint)con).getAllowedValues();
|
||||
return ((RMListOfValuesConstraint) con).getAllowedValues();
|
||||
}
|
||||
}, AuthenticationUtil.getSystemUserName());
|
||||
|
||||
@@ -404,7 +397,7 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
|
||||
{
|
||||
if (logger.isInfoEnabled())
|
||||
{
|
||||
logger.info("Processing constraint: "+conQName);
|
||||
logger.info("Processing constraint: " + conQName);
|
||||
}
|
||||
|
||||
for (Map.Entry<String, List<String>> caveatEntry : caveatMap.entrySet())
|
||||
@@ -413,20 +406,20 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
|
||||
List<String> caveatList = caveatEntry.getValue();
|
||||
|
||||
// validate authority (user or group) - note: groups are configured with fullname (ie. GROUP_xxx)
|
||||
if ((! authorityService.authorityExists(authorityName) && ! personService.personExists(authorityName)))
|
||||
if ((!authorityService.authorityExists(authorityName) && !personService.personExists(authorityName)))
|
||||
{
|
||||
// TODO - review warnings (& I18N)
|
||||
String msg = "User/group does not exist: "+authorityName+" (constraint="+conStr+")";
|
||||
String msg = "User/group does not exist: " + authorityName + " (constraint=" + conStr + ")";
|
||||
logger.warn(msg);
|
||||
}
|
||||
|
||||
// validate caveat list
|
||||
for (String value : caveatList)
|
||||
{
|
||||
if (! allowedValues.contains(value))
|
||||
if (!allowedValues.contains(value))
|
||||
{
|
||||
// TODO - review warnings (& add I18N)
|
||||
String msg = "Invalid value in list: "+value+" (authority="+authorityName+", constraint="+conStr+")";
|
||||
String msg = "Invalid value in list: " + value + " (authority=" + authorityName + ", constraint=" + conStr + ")";
|
||||
logger.warn(msg);
|
||||
}
|
||||
}
|
||||
@@ -444,7 +437,7 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
|
||||
for (Map.Entry<String, Object> conEntry : caveatConfigMap.entrySet())
|
||||
{
|
||||
String conStr = conEntry.getKey();
|
||||
Map<String, List<String>> caveatMap = (Map<String, List<String>>)conEntry.getValue();
|
||||
Map<String, List<String>> caveatMap = (Map<String, List<String>>) conEntry.getValue();
|
||||
|
||||
Map<String, List<String>> cacheValue = caveatConfig.get(conStr);
|
||||
if (cacheValue == null || !cacheValue.equals(caveatMap))
|
||||
@@ -461,7 +454,7 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
|
||||
}
|
||||
catch (JSONException e)
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Invalid caveat config syntax: "+e);
|
||||
throw new AlfrescoRuntimeException("Invalid caveat config syntax: " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -473,7 +466,6 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
|
||||
return nodeService.getChildByName(rootNode, RecordsManagementModel.ASSOC_CAVEAT_CONFIG, CAVEAT_CONFIG_NAME);
|
||||
}
|
||||
|
||||
|
||||
public NodeRef updateOrCreateCaveatConfig(InputStream is)
|
||||
{
|
||||
NodeRef caveatConfig = getOrCreateCaveatConfig();
|
||||
@@ -523,9 +515,9 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
|
||||
|
||||
// Create caveat config
|
||||
caveatConfig = nodeService.createNode(rootNode,
|
||||
RecordsManagementModel.ASSOC_CAVEAT_CONFIG,
|
||||
QName.createQName(RecordsManagementModel.RM_URI, CAVEAT_CONFIG_NAME),
|
||||
RecordsManagementModel.TYPE_CAVEAT_CONFIG).getChildRef();
|
||||
RecordsManagementModel.ASSOC_CAVEAT_CONFIG,
|
||||
QName.createQName(RecordsManagementModel.RM_URI, CAVEAT_CONFIG_NAME),
|
||||
RecordsManagementModel.TYPE_CAVEAT_CONFIG).getChildRef();
|
||||
|
||||
nodeService.setProperty(caveatConfig, ContentModel.PROP_NAME, CAVEAT_CONFIG_NAME);
|
||||
}
|
||||
@@ -569,7 +561,7 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
|
||||
|
||||
private List<String> getRMAllowedValues(String userName, Set<String> userGroupFullNames, String constraintName)
|
||||
{
|
||||
Set<String>allowedValues = new HashSet<>();
|
||||
Set<String> allowedValues = new HashSet<>();
|
||||
|
||||
// note: userName and userGroupNames must not be null
|
||||
Map<String, List<String>> caveatConstraintDef = null;
|
||||
@@ -586,22 +578,22 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
|
||||
if (caveatConstraintDef != null)
|
||||
{
|
||||
List<String> direct = caveatConstraintDef.get(userName);
|
||||
if(direct != null)
|
||||
if (direct != null)
|
||||
{
|
||||
allowedValues.addAll(direct);
|
||||
}
|
||||
|
||||
for (String group : userGroupFullNames)
|
||||
for (String group : userGroupFullNames)
|
||||
{
|
||||
List<String> values = caveatConstraintDef.get(group);
|
||||
if(values != null)
|
||||
if (values != null)
|
||||
{
|
||||
allowedValues.addAll(values);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
List<String>ret = new ArrayList<>();
|
||||
List<String> ret = new ArrayList<>();
|
||||
ret.addAll(allowedValues);
|
||||
return Collections.unmodifiableList(ret);
|
||||
}
|
||||
@@ -617,7 +609,7 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
|
||||
{
|
||||
try
|
||||
{
|
||||
if ((! nodeService.exists(nodeRef)) || (caveatAspectQNames.size() == 0))
|
||||
if ((!nodeService.exists(nodeRef)) || (caveatAspectQNames.size() == 0))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -632,7 +624,7 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
|
||||
}
|
||||
}
|
||||
|
||||
if (! found)
|
||||
if (!found)
|
||||
{
|
||||
// no caveat aspect
|
||||
return true;
|
||||
@@ -658,7 +650,7 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
|
||||
Constraint con = conDef.getConstraint();
|
||||
if (con instanceof RMListOfValuesConstraint)
|
||||
{
|
||||
RMListOfValuesConstraint rmCon = ((RMListOfValuesConstraint)con);
|
||||
RMListOfValuesConstraint rmCon = ((RMListOfValuesConstraint) con);
|
||||
String conName = rmCon.getShortName();
|
||||
MatchLogic matchLogic = rmCon.getMatchLogicEnum();
|
||||
Map<String, List<String>> caveatConstraintDef = caveatConfig.get(conName);
|
||||
@@ -676,18 +668,18 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
|
||||
if (val instanceof String)
|
||||
{
|
||||
propValues = new ArrayList<>(1);
|
||||
propValues.add((String)val);
|
||||
propValues.add((String) val);
|
||||
}
|
||||
else if (val instanceof List)
|
||||
{
|
||||
propValues = (List<String>)val;
|
||||
propValues = (List<String>) val;
|
||||
}
|
||||
|
||||
if (propValues != null && !isAllowed(propValues, allowedValues, matchLogic))
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("Veto access: caveat="+conName+", userName="+userName+", nodeRef="+nodeRef+", propName="+propName+", propValues="+propValues+", allowedValues="+allowedValues);
|
||||
logger.debug("Veto access: caveat=" + conName + ", userName=" + userName + ", nodeRef=" + nodeRef + ", propName=" + propName + ", propValues=" + propValues + ", allowedValues=" + allowedValues);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -714,11 +706,11 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
|
||||
// check user/group values match all values on node
|
||||
for (String propValue : propValues)
|
||||
{
|
||||
if (! userGroupValues.contains(propValue))
|
||||
if (!userGroupValues.contains(propValue))
|
||||
{
|
||||
if (logger.isTraceEnabled())
|
||||
{
|
||||
logger.trace("Not allowed: "+propValues+", "+userGroupValues+", "+matchLogic);
|
||||
logger.trace("Not allowed: " + propValues + ", " + userGroupValues + ", " + matchLogic);
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -740,23 +732,25 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
|
||||
|
||||
if (logger.isTraceEnabled())
|
||||
{
|
||||
logger.trace("Not allowed: "+propValues+", "+userGroupValues+", "+matchLogic);
|
||||
logger.trace("Not allowed: " + propValues + ", " + userGroupValues + ", " + matchLogic);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
logger.error("Unexpected match logic type: "+matchLogic);
|
||||
logger.error("Unexpected match logic type: " + matchLogic);
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a single value to an authority in a list. The existing values of the list remain.
|
||||
* Add a single value to an authority in a list. The existing values of the list remain.
|
||||
*
|
||||
* @param listName the name of the RMConstraintList
|
||||
* @param listName
|
||||
* the name of the RMConstraintList
|
||||
* @param authorityName
|
||||
* @param value
|
||||
* @throws AlfrescoRuntimeException if either the list or the authority do not already exist.
|
||||
* @throws AlfrescoRuntimeException
|
||||
* if either the list or the authority do not already exist.
|
||||
*/
|
||||
public void addRMConstraintListValue(String listName, String authorityName, String value)
|
||||
{
|
||||
@@ -765,9 +759,9 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
|
||||
{
|
||||
readLock.lock();
|
||||
members = caveatConfig.get(listName);
|
||||
if(members == null)
|
||||
if (members == null)
|
||||
{
|
||||
throw new AlfrescoRuntimeException("unable to add to list, list not defined:"+ listName);
|
||||
throw new AlfrescoRuntimeException("unable to add to list, list not defined:" + listName);
|
||||
}
|
||||
|
||||
try
|
||||
@@ -776,15 +770,15 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
|
||||
writeLock.lock();
|
||||
// check again
|
||||
members = caveatConfig.get(listName);
|
||||
if(members == null)
|
||||
if (members == null)
|
||||
{
|
||||
throw new AlfrescoRuntimeException("unable to add to list, list not defined:"+ listName);
|
||||
throw new AlfrescoRuntimeException("unable to add to list, list not defined:" + listName);
|
||||
}
|
||||
|
||||
List<String> values = members.get(authorityName);
|
||||
if(values == null)
|
||||
if (values == null)
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Unable to add to authority in list. Authority not member listName: "+ listName + " authorityName:" +authorityName);
|
||||
throw new AlfrescoRuntimeException("Unable to add to authority in list. Authority not member listName: " + listName + " authorityName:" + authorityName);
|
||||
}
|
||||
values.add(value);
|
||||
|
||||
@@ -806,6 +800,7 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
|
||||
|
||||
/**
|
||||
* Get the member details of the specified list
|
||||
*
|
||||
* @param listName
|
||||
* @return the details of the specified list
|
||||
*/
|
||||
@@ -837,23 +832,23 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace the values for an authority in a list.
|
||||
* The existing values are removed.
|
||||
* Replace the values for an authority in a list. The existing values are removed.
|
||||
*
|
||||
* If the authority does not already exist in the list, it will be added
|
||||
*
|
||||
* @param listName the name of the RMConstraintList
|
||||
* @param listName
|
||||
* the name of the RMConstraintList
|
||||
* @param authorityName
|
||||
* @param values
|
||||
*/
|
||||
public void updateRMConstraintListAuthority(String listName, String authorityName, List<String>values)
|
||||
public void updateRMConstraintListAuthority(String listName, String authorityName, List<String> values)
|
||||
{
|
||||
Map<String, List<String>> members = null;
|
||||
try
|
||||
{
|
||||
writeLock.lock();
|
||||
members = caveatConfig.get(listName);
|
||||
if(members == null)
|
||||
if (members == null)
|
||||
{
|
||||
// Create the new list, with the authority name
|
||||
Map<String, List<String>> constraint = new HashMap<>(0);
|
||||
@@ -881,7 +876,7 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
|
||||
* @param valueName
|
||||
* @param authorities
|
||||
*/
|
||||
public void updateRMConstraintListValue(String listName, String valueName, List<String>authorities)
|
||||
public void updateRMConstraintListValue(String listName, String valueName, List<String> authorities)
|
||||
{
|
||||
|
||||
Map<String, List<String>> members = caveatConfig.get(listName);
|
||||
@@ -889,7 +884,7 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
|
||||
{
|
||||
writeLock.lock();
|
||||
|
||||
if(members == null)
|
||||
if (members == null)
|
||||
{
|
||||
// Members List does not exist
|
||||
Map<String, List<String>> emptyConstraint = new HashMap<>(0);
|
||||
@@ -903,21 +898,21 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
|
||||
|
||||
// remove all authorities which have this value
|
||||
List<String> existingAuthorities = pivot.get(valueName);
|
||||
if(existingAuthorities != null)
|
||||
if (existingAuthorities != null)
|
||||
{
|
||||
for(String authority : existingAuthorities)
|
||||
for (String authority : existingAuthorities)
|
||||
{
|
||||
List<String> vals = members.get(authority);
|
||||
vals.remove(valueName);
|
||||
}
|
||||
}
|
||||
// add the new authorities for this value
|
||||
for(String authority : authorities)
|
||||
for (String authority : authorities)
|
||||
{
|
||||
List<String> vals = members.get(authority);
|
||||
if(vals == null)
|
||||
if (vals == null)
|
||||
{
|
||||
vals= new ArrayList<>();
|
||||
vals = new ArrayList<>();
|
||||
members.put(authority, vals);
|
||||
}
|
||||
vals.add(valueName);
|
||||
@@ -955,9 +950,9 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
|
||||
|
||||
// remove all authorities which have this value
|
||||
List<String> existingAuthorities = pivot.get(valueName);
|
||||
if(existingAuthorities != null)
|
||||
if (existingAuthorities != null)
|
||||
{
|
||||
for(String authority : existingAuthorities)
|
||||
for (String authority : existingAuthorities)
|
||||
{
|
||||
List<String> vals = members.get(authority);
|
||||
vals.remove(valueName);
|
||||
@@ -984,7 +979,8 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
|
||||
/**
|
||||
* Remove an authority from a list
|
||||
*
|
||||
* @param listName the name of the RMConstraintList
|
||||
* @param listName
|
||||
* the name of the RMConstraintList
|
||||
* @param authorityName
|
||||
*/
|
||||
public void removeRMConstraintListAuthority(String listName, String authorityName)
|
||||
@@ -994,7 +990,7 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
|
||||
{
|
||||
writeLock.lock();
|
||||
members = caveatConfig.get(listName);
|
||||
if(members != null)
|
||||
if (members != null)
|
||||
{
|
||||
members.remove(listName);
|
||||
}
|
||||
@@ -1007,10 +1003,11 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
|
||||
{
|
||||
writeLock.unlock();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param config the configuration to convert
|
||||
* @param config
|
||||
* the configuration to convert
|
||||
* @return a String containing the JSON representation of the configuration.
|
||||
*/
|
||||
private String convertToJSONString(SimpleCache<String, Map<String, List<String>>> config)
|
||||
@@ -1070,24 +1067,24 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
|
||||
|
||||
/**
|
||||
* Get an RMConstraintInfo
|
||||
*
|
||||
* @param listQName
|
||||
* @return the constraint or null if it does not exist
|
||||
*/
|
||||
public RMConstraintInfo getRMConstraint(QName listQName)
|
||||
{
|
||||
ConstraintDefinition dictionaryDef = dictionaryService.getConstraint(listQName);
|
||||
if(dictionaryDef != null)
|
||||
if (dictionaryDef != null)
|
||||
{
|
||||
Constraint con = dictionaryDef.getConstraint();
|
||||
if (con instanceof RMListOfValuesConstraint)
|
||||
{
|
||||
final RMListOfValuesConstraint def = (RMListOfValuesConstraint)con;
|
||||
final RMListOfValuesConstraint def = (RMListOfValuesConstraint) con;
|
||||
|
||||
RMConstraintInfo info = new RMConstraintInfo();
|
||||
info.setName(listQName.toPrefixString());
|
||||
info.setTitle(con.getTitle());
|
||||
List<String> allowedValues = AuthenticationUtil.runAs(new RunAsWork<List<String>>()
|
||||
{
|
||||
List<String> allowedValues = AuthenticationUtil.runAs(new RunAsWork<List<String>>() {
|
||||
public List<String> doWork()
|
||||
{
|
||||
return def.getAllowedValues();
|
||||
|
||||
@@ -42,6 +42,7 @@ public interface RMCaveatConfigService
|
||||
|
||||
/**
|
||||
* Get allowed values for given caveat list (for current user)
|
||||
*
|
||||
* @param constraintName
|
||||
* @return
|
||||
*/
|
||||
@@ -55,18 +56,15 @@ public interface RMCaveatConfigService
|
||||
*/
|
||||
boolean hasAccess(NodeRef nodeRef);
|
||||
|
||||
/*
|
||||
* Get a single RM constraint
|
||||
*/
|
||||
/* Get a single RM constraint */
|
||||
RMConstraintInfo getRMConstraint(String listName);
|
||||
|
||||
/*
|
||||
* Get the names of all the caveat lists
|
||||
*/
|
||||
/* Get the names of all the caveat lists */
|
||||
Set<RMConstraintInfo> getAllRMConstraints();
|
||||
|
||||
/**
|
||||
* Get the details of a caveat list
|
||||
*
|
||||
* @param listName
|
||||
* @return
|
||||
*/
|
||||
@@ -80,79 +78,90 @@ public interface RMCaveatConfigService
|
||||
|
||||
/**
|
||||
* add RM constraint list
|
||||
* @param listName the name of the RMConstraintList
|
||||
*
|
||||
* @param listName
|
||||
* the name of the RMConstraintList
|
||||
* @param listTitle
|
||||
*/
|
||||
RMConstraintInfo addRMConstraint(String listName, String listTitle, String[] allowedValues);
|
||||
|
||||
/**
|
||||
* update RM constraint list allowed values
|
||||
* @param listName the name of the RMConstraintList - can not be changed
|
||||
*
|
||||
* @param listName
|
||||
* the name of the RMConstraintList - can not be changed
|
||||
* @param allowedValues
|
||||
*/
|
||||
RMConstraintInfo updateRMConstraintAllowedValues(String listName, String[] allowedValues);
|
||||
|
||||
/**
|
||||
* update RM constraint Title
|
||||
* @param listName the name of the RMConstraintList - can not be changed
|
||||
* @param newTitle the new value for the title constraint
|
||||
*
|
||||
* @param listName
|
||||
* the name of the RMConstraintList - can not be changed
|
||||
* @param newTitle
|
||||
* the new value for the title constraint
|
||||
*/
|
||||
RMConstraintInfo updateRMConstraintTitle(String listName, String newTitle);
|
||||
|
||||
|
||||
/**
|
||||
* delete RM Constraint
|
||||
*
|
||||
* @param listName the name of the RMConstraintList
|
||||
* @param listName
|
||||
* the name of the RMConstraintList
|
||||
*/
|
||||
void deleteRMConstraint(String listName);
|
||||
|
||||
/**
|
||||
* Add a single value to an authority in a list. The existing values of the list remain.
|
||||
* Add a single value to an authority in a list. The existing values of the list remain.
|
||||
*
|
||||
* @param listName the name of the RMConstraintList
|
||||
* @param listName
|
||||
* the name of the RMConstraintList
|
||||
* @param authorityName
|
||||
* @param value
|
||||
* @throws AlfrescoRuntimeException if either the list or the authority do not already exist.
|
||||
* @throws AlfrescoRuntimeException
|
||||
* if either the list or the authority do not already exist.
|
||||
*/
|
||||
void addRMConstraintListValue(String listName, String authorityName, String value);
|
||||
|
||||
/**
|
||||
* Replace the values for an authority in a list.
|
||||
* The existing values are removed.
|
||||
* Replace the values for an authority in a list. The existing values are removed.
|
||||
*
|
||||
* If the authority does not already exist in the list, it will be added
|
||||
*
|
||||
* @param listName the name of the RMConstraintList
|
||||
* @param listName
|
||||
* the name of the RMConstraintList
|
||||
* @param authorityName
|
||||
* @param values
|
||||
*/
|
||||
void updateRMConstraintListAuthority(String listName, String authorityName, List<String>values);
|
||||
void updateRMConstraintListAuthority(String listName, String authorityName, List<String> values);
|
||||
|
||||
/**
|
||||
* Remove an authority from a list
|
||||
*
|
||||
* @param listName the name of the RMConstraintList
|
||||
* @param listName
|
||||
* the name of the RMConstraintList
|
||||
* @param authorityName
|
||||
*/
|
||||
void removeRMConstraintListAuthority(String listName, String authorityName);
|
||||
|
||||
/**
|
||||
* Replace the values for an authority in a list.
|
||||
* The existing values are removed.
|
||||
* Replace the values for an authority in a list. The existing values are removed.
|
||||
*
|
||||
* If the authority does not already exist in the list, it will be added
|
||||
*
|
||||
* @param listName the name of the RMConstraintList
|
||||
* @param listName
|
||||
* the name of the RMConstraintList
|
||||
* @param value
|
||||
* @param authorities
|
||||
*/
|
||||
void updateRMConstraintListValue(String listName, String value, List<String>authorities);
|
||||
void updateRMConstraintListValue(String listName, String value, List<String> authorities);
|
||||
|
||||
/**
|
||||
* Remove an authority from a list
|
||||
*
|
||||
* @param listName the name of the RMConstraintList
|
||||
* @param listName
|
||||
* the name of the RMConstraintList
|
||||
* @param valueName
|
||||
*/
|
||||
void removeRMConstraintListValue(String listName, String valueName);
|
||||
|
||||
@@ -36,6 +36,9 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.module.org_alfresco_module_rm.admin.RecordsManagementAdminService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.caveat.RMListOfValuesConstraint.MatchLogic;
|
||||
@@ -48,8 +51,6 @@ import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.namespace.NamespaceService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
/**
|
||||
* RM Caveat Config Service impl
|
||||
@@ -66,7 +67,6 @@ public class RMCaveatConfigServiceImpl implements RMCaveatConfigService
|
||||
private RMCaveatConfigComponent rmCaveatConfigComponent;
|
||||
private RecordsManagementAdminService recordsManagementAdminService;
|
||||
|
||||
|
||||
public void setNamespaceService(NamespaceService namespaceService)
|
||||
{
|
||||
this.namespaceService = namespaceService;
|
||||
@@ -131,7 +131,9 @@ public class RMCaveatConfigServiceImpl implements RMCaveatConfigService
|
||||
|
||||
/**
|
||||
* add RM constraint list
|
||||
* @param listName the name of the RMConstraintList
|
||||
*
|
||||
* @param listName
|
||||
* the name of the RMConstraintList
|
||||
*/
|
||||
public RMConstraintInfo addRMConstraint(String listName, String title, String[] values)
|
||||
{
|
||||
@@ -150,8 +152,8 @@ public class RMCaveatConfigServiceImpl implements RMCaveatConfigService
|
||||
listName = sb.toString();
|
||||
}
|
||||
|
||||
List<String>allowedValues = new ArrayList<>();
|
||||
for(String value : values)
|
||||
List<String> allowedValues = new ArrayList<>();
|
||||
for (String value : values)
|
||||
{
|
||||
allowedValues.add(value);
|
||||
}
|
||||
@@ -185,7 +187,8 @@ public class RMCaveatConfigServiceImpl implements RMCaveatConfigService
|
||||
/**
|
||||
* delete RM Constraint List
|
||||
*
|
||||
* @param listName the name of the RMConstraintList
|
||||
* @param listName
|
||||
* the name of the RMConstraintList
|
||||
*/
|
||||
public void deleteRMConstraint(String listName)
|
||||
{
|
||||
@@ -197,12 +200,14 @@ public class RMCaveatConfigServiceImpl implements RMCaveatConfigService
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a single value to an authority in a list. The existing values of the list remain.
|
||||
* Add a single value to an authority in a list. The existing values of the list remain.
|
||||
*
|
||||
* @param listName the name of the RMConstraintList
|
||||
* @param listName
|
||||
* the name of the RMConstraintList
|
||||
* @param authorityName
|
||||
* @param value
|
||||
* @throws AlfrescoRuntimeException if either the list or the authority do not already exist.
|
||||
* @throws AlfrescoRuntimeException
|
||||
* if either the list or the authority do not already exist.
|
||||
*/
|
||||
public void addRMConstraintListValue(String listName, String authorityName, String value)
|
||||
{
|
||||
@@ -211,6 +216,7 @@ public class RMCaveatConfigServiceImpl implements RMCaveatConfigService
|
||||
|
||||
/**
|
||||
* Get the details of the specified list
|
||||
*
|
||||
* @param listName
|
||||
* @return the details of the specified list
|
||||
*/
|
||||
@@ -220,16 +226,16 @@ public class RMCaveatConfigServiceImpl implements RMCaveatConfigService
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace the values for an authority in a list.
|
||||
* The existing values are removed.
|
||||
* Replace the values for an authority in a list. The existing values are removed.
|
||||
*
|
||||
* If the authority does not already exist in the list, it will be added
|
||||
*
|
||||
* @param listName the name of the RMConstraintList
|
||||
* @param listName
|
||||
* the name of the RMConstraintList
|
||||
* @param authorityName
|
||||
* @param values
|
||||
*/
|
||||
public void updateRMConstraintListAuthority(String listName, String authorityName, List<String>values)
|
||||
public void updateRMConstraintListAuthority(String listName, String authorityName, List<String> values)
|
||||
{
|
||||
rmCaveatConfigComponent.updateRMConstraintListAuthority(listName, authorityName, values);
|
||||
}
|
||||
@@ -241,7 +247,7 @@ public class RMCaveatConfigServiceImpl implements RMCaveatConfigService
|
||||
* @param valueName
|
||||
* @param authorities
|
||||
*/
|
||||
public void updateRMConstraintListValue(String listName, String valueName, List<String>authorities)
|
||||
public void updateRMConstraintListValue(String listName, String valueName, List<String> authorities)
|
||||
{
|
||||
rmCaveatConfigComponent.updateRMConstraintListValue(listName, valueName, authorities);
|
||||
}
|
||||
@@ -249,7 +255,8 @@ public class RMCaveatConfigServiceImpl implements RMCaveatConfigService
|
||||
/**
|
||||
* Remove an authority from a list
|
||||
*
|
||||
* @param listName the name of the RMConstraintList
|
||||
* @param listName
|
||||
* the name of the RMConstraintList
|
||||
* @param authorityName
|
||||
*/
|
||||
public void removeRMConstraintListAuthority(String listName, String authorityName)
|
||||
@@ -270,19 +277,18 @@ public class RMCaveatConfigServiceImpl implements RMCaveatConfigService
|
||||
defs.addAll(recordsManagementAdminService.getCustomConstraintDefinitions(caveatModelQName));
|
||||
}
|
||||
|
||||
for(ConstraintDefinition dictionaryDef : defs)
|
||||
for (ConstraintDefinition dictionaryDef : defs)
|
||||
{
|
||||
Constraint con = dictionaryDef.getConstraint();
|
||||
if (con instanceof RMListOfValuesConstraint)
|
||||
{
|
||||
final RMListOfValuesConstraint def = (RMListOfValuesConstraint)con;
|
||||
final RMListOfValuesConstraint def = (RMListOfValuesConstraint) con;
|
||||
RMConstraintInfo i = new RMConstraintInfo();
|
||||
i.setName(def.getShortName());
|
||||
i.setTitle(def.getTitle());
|
||||
|
||||
// note: assumes only one caveat/LOV against a given property
|
||||
List<String> allowedValues = AuthenticationUtil.runAs(new RunAsWork<List<String>>()
|
||||
{
|
||||
List<String> allowedValues = AuthenticationUtil.runAs(new RunAsWork<List<String>>() {
|
||||
public List<String> doWork()
|
||||
{
|
||||
return def.getAllowedValues();
|
||||
@@ -301,24 +307,24 @@ public class RMCaveatConfigServiceImpl implements RMCaveatConfigService
|
||||
|
||||
/**
|
||||
* Get an RMConstraintInfo
|
||||
*
|
||||
* @param listQName
|
||||
* @return the constraint or null if it does not exist
|
||||
*/
|
||||
public RMConstraintInfo getRMConstraint(QName listQName)
|
||||
{
|
||||
ConstraintDefinition dictionaryDef = dictionaryService.getConstraint(listQName);
|
||||
if(dictionaryDef != null)
|
||||
if (dictionaryDef != null)
|
||||
{
|
||||
Constraint con = dictionaryDef.getConstraint();
|
||||
if (con instanceof RMListOfValuesConstraint)
|
||||
{
|
||||
final RMListOfValuesConstraint def = (RMListOfValuesConstraint)con;
|
||||
final RMListOfValuesConstraint def = (RMListOfValuesConstraint) con;
|
||||
|
||||
RMConstraintInfo info = new RMConstraintInfo();
|
||||
info.setName(listQName.toPrefixString());
|
||||
info.setTitle(con.getTitle());
|
||||
List<String> allowedValues = AuthenticationUtil.runAs(new RunAsWork<List<String>>()
|
||||
{
|
||||
List<String> allowedValues = AuthenticationUtil.runAs(new RunAsWork<List<String>>() {
|
||||
public List<String> doWork()
|
||||
{
|
||||
return def.getAllowedValues();
|
||||
@@ -348,18 +354,20 @@ public class RMCaveatConfigServiceImpl implements RMCaveatConfigService
|
||||
/**
|
||||
* Update The allowed values for an RM Constraint.
|
||||
*
|
||||
* @param listName The name of the list.
|
||||
* @param allowedValues the new alowed values
|
||||
* @param listName
|
||||
* The name of the list.
|
||||
* @param allowedValues
|
||||
* the new alowed values
|
||||
*
|
||||
*/
|
||||
public RMConstraintInfo updateRMConstraintAllowedValues(String listName, String[] allowedValues)
|
||||
{
|
||||
QName listQName = QName.createQName(listName, namespaceService);
|
||||
|
||||
if(allowedValues != null)
|
||||
if (allowedValues != null)
|
||||
{
|
||||
List<String>allowedValueList = new ArrayList<>();
|
||||
for(String value : allowedValues)
|
||||
List<String> allowedValueList = new ArrayList<>();
|
||||
for (String value : allowedValues)
|
||||
{
|
||||
allowedValueList.add(value);
|
||||
}
|
||||
@@ -368,21 +376,20 @@ public class RMCaveatConfigServiceImpl implements RMCaveatConfigService
|
||||
Constraint con = dictionaryDef.getConstraint();
|
||||
if (con instanceof RMListOfValuesConstraint)
|
||||
{
|
||||
final RMListOfValuesConstraint def = (RMListOfValuesConstraint)con;
|
||||
List<String> oldAllowedValues = AuthenticationUtil.runAs(new RunAsWork<List<String>>()
|
||||
{
|
||||
final RMListOfValuesConstraint def = (RMListOfValuesConstraint) con;
|
||||
List<String> oldAllowedValues = AuthenticationUtil.runAs(new RunAsWork<List<String>>() {
|
||||
public List<String> doWork()
|
||||
{
|
||||
return def.getAllowedValues();
|
||||
return def.getAllowedValues();
|
||||
}
|
||||
}, AuthenticationUtil.getSystemUserName());
|
||||
|
||||
/**
|
||||
* Deal with any additions
|
||||
*/
|
||||
for(String newValue : allowedValueList)
|
||||
for (String newValue : allowedValueList)
|
||||
{
|
||||
if(!oldAllowedValues.contains(newValue) && logger.isDebugEnabled())
|
||||
if (!oldAllowedValues.contains(newValue) && logger.isDebugEnabled())
|
||||
{
|
||||
// This is an addition
|
||||
logger.debug("value added to list:" + listQName + ":" + newValue);
|
||||
@@ -392,12 +399,12 @@ public class RMCaveatConfigServiceImpl implements RMCaveatConfigService
|
||||
/**
|
||||
* Deal with any deletions
|
||||
*/
|
||||
for(String oldValue : oldAllowedValues)
|
||||
for (String oldValue : oldAllowedValues)
|
||||
{
|
||||
if(!allowedValueList.contains(oldValue))
|
||||
if (!allowedValueList.contains(oldValue))
|
||||
{
|
||||
// This is a deletion
|
||||
if(logger.isDebugEnabled())
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("value removed from list:" + listQName + ":" + oldValue);
|
||||
}
|
||||
@@ -417,7 +424,7 @@ public class RMCaveatConfigServiceImpl implements RMCaveatConfigService
|
||||
*/
|
||||
public void removeRMConstraintListValue(String listName, String valueName)
|
||||
{
|
||||
//TODO need to update the rm constraint definition
|
||||
// TODO need to update the rm constraint definition
|
||||
// recordsManagementAdminService.
|
||||
|
||||
rmCaveatConfigComponent.removeRMConstraintListValue(listName, valueName);
|
||||
|
||||
@@ -40,30 +40,37 @@ public class RMConstraintInfo
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setTitle(String title)
|
||||
{
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getTitle()
|
||||
{
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setCaseSensitive(boolean caseSensitive)
|
||||
{
|
||||
this.caseSensitive = caseSensitive;
|
||||
}
|
||||
|
||||
public boolean isCaseSensitive()
|
||||
{
|
||||
return caseSensitive;
|
||||
}
|
||||
|
||||
public void setAllowedValues(String[] values)
|
||||
{
|
||||
this.allowedValues = values.clone();
|
||||
}
|
||||
|
||||
public String[] getAllowedValues()
|
||||
{
|
||||
return allowedValues;
|
||||
|
||||
@@ -33,18 +33,18 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
|
||||
import org.alfresco.repo.dictionary.constraint.ListOfValuesConstraint;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.service.cmr.dictionary.ConstraintException;
|
||||
import org.alfresco.service.cmr.i18n.MessageLookup;
|
||||
import org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter;
|
||||
import org.alfresco.service.cmr.repository.datatype.TypeConversionException;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
|
||||
/**
|
||||
* RM Constraint implementation that ensures the value is one of a constrained
|
||||
* <i>list of values</i>. By default, this constraint is case-sensitive.
|
||||
* RM Constraint implementation that ensures the value is one of a constrained <i>list of values</i>. By default, this constraint is case-sensitive.
|
||||
*
|
||||
* @see #setAllowedValues(List)
|
||||
* @see #setCaseSensitive(boolean)
|
||||
@@ -63,7 +63,7 @@ public class RMListOfValuesConstraint extends ListOfValuesConstraint
|
||||
{
|
||||
// closed marking - all values must match
|
||||
AND,
|
||||
// open marking - at least one value must match
|
||||
// open marking - at least one value must match
|
||||
OR
|
||||
}
|
||||
|
||||
@@ -75,17 +75,16 @@ public class RMListOfValuesConstraint extends ListOfValuesConstraint
|
||||
RMListOfValuesConstraint.caveatConfigService = caveatConfigService;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder(80);
|
||||
sb.append("RMListOfValuesConstraint")
|
||||
.append("[allowedValues=").append(getAllowedValues())
|
||||
.append(", caseSensitive=").append(isCaseSensitive())
|
||||
.append(", sorted=").append(isSorted())
|
||||
.append(", matchLogic=").append(getMatchLogic())
|
||||
.append("]");
|
||||
.append("[allowedValues=").append(getAllowedValues())
|
||||
.append(", caseSensitive=").append(isCaseSensitive())
|
||||
.append(", sorted=").append(isSorted())
|
||||
.append(", matchLogic=").append(getMatchLogic())
|
||||
.append("]");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@@ -98,8 +97,7 @@ public class RMListOfValuesConstraint extends ListOfValuesConstraint
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the allowed values. Note that these are <tt>String</tt> instances, but may
|
||||
* represent non-<tt>String</tt> values. It is up to the caller to distinguish.
|
||||
* Get the allowed values. Note that these are <tt>String</tt> instances, but may represent non-<tt>String</tt> values. It is up to the caller to distinguish.
|
||||
*
|
||||
* @return Returns the values allowed
|
||||
*/
|
||||
@@ -107,7 +105,7 @@ public class RMListOfValuesConstraint extends ListOfValuesConstraint
|
||||
public List<String> getRawAllowedValues()
|
||||
{
|
||||
String runAsUser = AuthenticationUtil.getRunAsUser();
|
||||
if ((runAsUser != null) && (! runAsUser.equals(AuthenticationUtil.getSystemUserName())) && (caveatConfigService != null))
|
||||
if ((runAsUser != null) && (!runAsUser.equals(AuthenticationUtil.getSystemUserName())) && (caveatConfigService != null))
|
||||
{
|
||||
// get allowed values for current user
|
||||
List<String> allowedForUser = caveatConfigService.getRMAllowedValues(getShortName());
|
||||
@@ -148,7 +146,7 @@ public class RMListOfValuesConstraint extends ListOfValuesConstraint
|
||||
private List<String> getAllowedValuesUpper()
|
||||
{
|
||||
String runAsUser = AuthenticationUtil.getRunAsUser();
|
||||
if ((runAsUser != null) && (! runAsUser.equals(AuthenticationUtil.getSystemUserName())) && (caveatConfigService != null))
|
||||
if ((runAsUser != null) && (!runAsUser.equals(AuthenticationUtil.getSystemUserName())) && (caveatConfigService != null))
|
||||
{
|
||||
// get allowed values for current user
|
||||
List<String> allowedForUser = caveatConfigService.getRMAllowedValues(getType());
|
||||
@@ -169,12 +167,14 @@ public class RMListOfValuesConstraint extends ListOfValuesConstraint
|
||||
return this.allowedValuesUpper;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the values that are allowed by the constraint.
|
||||
*
|
||||
* @param allowedValues a list of allowed values
|
||||
* @param allowedValues
|
||||
* a list of allowed values
|
||||
*/
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
@Override
|
||||
public void setAllowedValues(List allowedValues)
|
||||
{
|
||||
|
||||
@@ -29,7 +29,6 @@ package org.alfresco.module.org_alfresco_module_rm.caveat;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
public class ScriptAuthority implements Serializable
|
||||
{
|
||||
/**
|
||||
@@ -43,18 +42,20 @@ public class ScriptAuthority implements Serializable
|
||||
{
|
||||
this.authorityName = authorityName;
|
||||
}
|
||||
|
||||
public String getAuthorityName()
|
||||
{
|
||||
return authorityName;
|
||||
}
|
||||
|
||||
public void setAuthorityTitle(String authorityName)
|
||||
{
|
||||
this.authorityTitle = authorityName;
|
||||
}
|
||||
|
||||
public String getAuthorityTitle()
|
||||
{
|
||||
return authorityTitle;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -35,14 +35,15 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.alfresco.service.cmr.security.AuthorityService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import org.alfresco.service.cmr.security.AuthorityService;
|
||||
|
||||
public class ScriptConstraint implements Serializable
|
||||
{
|
||||
/**
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
@@ -64,10 +65,12 @@ public class ScriptConstraint implements Serializable
|
||||
{
|
||||
info.setTitle(title);
|
||||
}
|
||||
|
||||
public String getTitle()
|
||||
{
|
||||
return info.getTitle();
|
||||
}
|
||||
|
||||
public void setName(String name)
|
||||
{
|
||||
info.setName(name);
|
||||
@@ -90,22 +93,22 @@ public class ScriptConstraint implements Serializable
|
||||
|
||||
public ScriptConstraintAuthority[] getAuthorities()
|
||||
{
|
||||
Map<String, List<String>> values = rmCaveatconfigService.getListDetails(info.getName());
|
||||
Map<String, List<String>> values = rmCaveatconfigService.getListDetails(info.getName());
|
||||
|
||||
if (values == null)
|
||||
{
|
||||
return new ScriptConstraintAuthority[0];
|
||||
}
|
||||
if (values == null)
|
||||
{
|
||||
return new ScriptConstraintAuthority[0];
|
||||
}
|
||||
|
||||
ArrayList<ScriptConstraintAuthority> constraints = new ArrayList<>(values.size());
|
||||
ArrayList<ScriptConstraintAuthority> constraints = new ArrayList<>(values.size());
|
||||
for (Map.Entry<String, List<String>> entry : values.entrySet())
|
||||
{
|
||||
ScriptConstraintAuthority constraint = new ScriptConstraintAuthority();
|
||||
constraint.setAuthorityName(entry.getKey());
|
||||
constraint.setValues(entry.getValue());
|
||||
constraints.add(constraint);
|
||||
}
|
||||
return constraints.toArray(new ScriptConstraintAuthority[constraints.size()]);
|
||||
{
|
||||
ScriptConstraintAuthority constraint = new ScriptConstraintAuthority();
|
||||
constraint.setAuthorityName(entry.getKey());
|
||||
constraint.setValues(entry.getValue());
|
||||
constraints.add(constraint);
|
||||
}
|
||||
return constraints.toArray(new ScriptConstraintAuthority[constraints.size()]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -114,7 +117,7 @@ public class ScriptConstraint implements Serializable
|
||||
public void updateTitle(String newTitle)
|
||||
{
|
||||
info.setTitle(newTitle);
|
||||
rmCaveatconfigService.updateRMConstraintTitle(info.getName(), newTitle) ;
|
||||
rmCaveatconfigService.updateRMConstraintTitle(info.getName(), newTitle);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -128,18 +131,19 @@ public class ScriptConstraint implements Serializable
|
||||
|
||||
/**
|
||||
* Update a value
|
||||
*
|
||||
* @param bodge
|
||||
*/
|
||||
public void updateValues(JSONArray bodge) throws Exception
|
||||
{
|
||||
for(int i = 0; i < bodge.length(); i++)
|
||||
for (int i = 0; i < bodge.length(); i++)
|
||||
{
|
||||
|
||||
JSONObject obj = bodge.getJSONObject(i);
|
||||
String value = obj.getString("value");
|
||||
JSONArray authorities = obj.getJSONArray("authorities");
|
||||
List<String> aList = new ArrayList<>();
|
||||
for(int j = 0; j < authorities.length();j++)
|
||||
for (int j = 0; j < authorities.length(); j++)
|
||||
{
|
||||
aList.add(authorities.getString(j));
|
||||
}
|
||||
@@ -149,6 +153,7 @@ public class ScriptConstraint implements Serializable
|
||||
|
||||
/**
|
||||
* Update a value
|
||||
*
|
||||
* @param value
|
||||
* @param authorities
|
||||
*/
|
||||
@@ -160,25 +165,27 @@ public class ScriptConstraint implements Serializable
|
||||
|
||||
/**
|
||||
* Cascade delete an authority
|
||||
*
|
||||
* @param authority
|
||||
*/
|
||||
public void deleteAuthority(String authority)
|
||||
{
|
||||
//Do nothing
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
/**
|
||||
* Cascade delete a value
|
||||
*
|
||||
* @param value
|
||||
*/
|
||||
public void deleteValue(String value)
|
||||
{
|
||||
//Do nothing
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get a single value
|
||||
*
|
||||
* @param value
|
||||
* @return
|
||||
*/
|
||||
@@ -186,9 +193,9 @@ public class ScriptConstraint implements Serializable
|
||||
{
|
||||
ScriptConstraintValue[] values = getValues();
|
||||
|
||||
for(ScriptConstraintValue val : values)
|
||||
for (ScriptConstraintValue val : values)
|
||||
{
|
||||
if(val.getValueName().equalsIgnoreCase(value))
|
||||
if (val.getValueName().equalsIgnoreCase(value))
|
||||
{
|
||||
return val;
|
||||
}
|
||||
@@ -212,39 +219,39 @@ public class ScriptConstraint implements Serializable
|
||||
ArrayList<ScriptConstraintValue> constraints = new ArrayList<>(pivot.size());
|
||||
for (Map.Entry<String, List<String>> entry : pivot.entrySet())
|
||||
{
|
||||
ScriptConstraintValue constraint = new ScriptConstraintValue();
|
||||
constraint.setValueName(entry.getKey());
|
||||
constraint.setValueTitle(entry.getKey());
|
||||
ScriptConstraintValue constraint = new ScriptConstraintValue();
|
||||
constraint.setValueName(entry.getKey());
|
||||
constraint.setValueTitle(entry.getKey());
|
||||
|
||||
List<String> authorities = entry.getValue();
|
||||
List<ScriptAuthority> sauth = new ArrayList<>();
|
||||
for(String authority : authorities)
|
||||
{
|
||||
ScriptAuthority a = new ScriptAuthority();
|
||||
a.setAuthorityName(authority);
|
||||
List<ScriptAuthority> sauth = new ArrayList<>();
|
||||
for (String authority : authorities)
|
||||
{
|
||||
ScriptAuthority a = new ScriptAuthority();
|
||||
a.setAuthorityName(authority);
|
||||
|
||||
String displayName = authorityService.getAuthorityDisplayName(authority);
|
||||
if(StringUtils.isNotBlank(displayName))
|
||||
{
|
||||
a.setAuthorityTitle(displayName);
|
||||
}
|
||||
else
|
||||
{
|
||||
a.setAuthorityTitle(authority);
|
||||
}
|
||||
sauth.add(a);
|
||||
}
|
||||
constraint.setAuthorities(sauth);
|
||||
constraints.add(constraint);
|
||||
String displayName = authorityService.getAuthorityDisplayName(authority);
|
||||
if (StringUtils.isNotBlank(displayName))
|
||||
{
|
||||
a.setAuthorityTitle(displayName);
|
||||
}
|
||||
else
|
||||
{
|
||||
a.setAuthorityTitle(authority);
|
||||
}
|
||||
sauth.add(a);
|
||||
}
|
||||
constraint.setAuthorities(sauth);
|
||||
constraints.add(constraint);
|
||||
}
|
||||
|
||||
/**
|
||||
* Now go through and add any "empty" values
|
||||
*/
|
||||
Set<String> values = pivot.keySet();
|
||||
for(String value : info.getAllowedValues())
|
||||
for (String value : info.getAllowedValues())
|
||||
{
|
||||
if(!values.contains(value))
|
||||
if (!values.contains(value))
|
||||
{
|
||||
ScriptConstraintValue constraint = new ScriptConstraintValue();
|
||||
constraint.setValueName(value);
|
||||
|
||||
@@ -37,20 +37,23 @@ public class ScriptConstraintAuthority implements Serializable
|
||||
*/
|
||||
private static final long serialVersionUID = -4659454215122271811L;
|
||||
private String authorityName;
|
||||
private List<String>values;
|
||||
private List<String> values;
|
||||
|
||||
public void setValues(List<String> values)
|
||||
{
|
||||
this.values = values;
|
||||
}
|
||||
|
||||
public List<String> getValues()
|
||||
{
|
||||
return values;
|
||||
}
|
||||
|
||||
public void setAuthorityName(String authorityName)
|
||||
{
|
||||
this.authorityName = authorityName;
|
||||
}
|
||||
|
||||
public String getAuthorityName()
|
||||
{
|
||||
return authorityName;
|
||||
|
||||
@@ -37,28 +37,33 @@ public class ScriptConstraintValue implements Serializable
|
||||
*/
|
||||
private static final long serialVersionUID = -4659454215122271811L;
|
||||
private String value;
|
||||
private List<ScriptAuthority>authorities;
|
||||
private List<ScriptAuthority> authorities;
|
||||
|
||||
public void setAuthorities(List<ScriptAuthority> values)
|
||||
{
|
||||
this.authorities = values;
|
||||
}
|
||||
|
||||
public List<ScriptAuthority> getAuthorities()
|
||||
{
|
||||
return authorities;
|
||||
}
|
||||
|
||||
public void setValueName(String authorityName)
|
||||
{
|
||||
this.value = authorityName;
|
||||
}
|
||||
|
||||
public String getValueName()
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValueTitle(String authorityName)
|
||||
{
|
||||
this.value = authorityName;
|
||||
}
|
||||
|
||||
public String getValueTitle()
|
||||
{
|
||||
return value;
|
||||
|
||||
@@ -66,12 +66,12 @@ public class ScriptRMCaveatConfigService extends BaseScopableProcessorExtension
|
||||
|
||||
public ScriptConstraint getConstraint(String listName)
|
||||
{
|
||||
//TODO Temporary conversion
|
||||
// TODO Temporary conversion
|
||||
String xxx = listName.replace("_", ":");
|
||||
|
||||
RMConstraintInfo info = caveatConfigService.getRMConstraint(xxx);
|
||||
|
||||
if(info != null)
|
||||
if (info != null)
|
||||
{
|
||||
return new ScriptConstraint(info, caveatConfigService, getAuthorityService());
|
||||
}
|
||||
@@ -81,12 +81,12 @@ public class ScriptRMCaveatConfigService extends BaseScopableProcessorExtension
|
||||
|
||||
public ScriptConstraint[] getAllConstraints()
|
||||
{
|
||||
return getConstraints(true);
|
||||
return getConstraints(true);
|
||||
}
|
||||
|
||||
public ScriptConstraint[] getConstraintsWithoutEmptyList()
|
||||
{
|
||||
return getConstraints(false);
|
||||
return getConstraints(false);
|
||||
}
|
||||
|
||||
private ScriptConstraint[] getConstraints(boolean includeEmptyList)
|
||||
@@ -94,19 +94,19 @@ public class ScriptRMCaveatConfigService extends BaseScopableProcessorExtension
|
||||
Set<RMConstraintInfo> values = caveatConfigService.getAllRMConstraints();
|
||||
|
||||
List<ScriptConstraint> vals = new ArrayList<>(values.size());
|
||||
for(RMConstraintInfo value : values)
|
||||
for (RMConstraintInfo value : values)
|
||||
{
|
||||
ScriptConstraint c = new ScriptConstraint(value, caveatConfigService, getAuthorityService());
|
||||
if (includeEmptyList)
|
||||
{
|
||||
vals.add(c);
|
||||
vals.add(c);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (c.getValues().length > 0)
|
||||
{
|
||||
vals.add(c);
|
||||
}
|
||||
if (c.getValues().length > 0)
|
||||
{
|
||||
vals.add(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,44 +115,43 @@ public class ScriptRMCaveatConfigService extends BaseScopableProcessorExtension
|
||||
|
||||
/**
|
||||
* Delete list
|
||||
*
|
||||
* @param listName
|
||||
|
||||
*
|
||||
*/
|
||||
public void deleteConstraintList(String listName)
|
||||
{
|
||||
//TODO Temporary conversion
|
||||
// TODO Temporary conversion
|
||||
String xxx = listName.replace("_", ":");
|
||||
caveatConfigService.deleteRMConstraint(xxx);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Update value
|
||||
*/
|
||||
public void updateConstraintValues(String listName, String authorityName, String[]values)
|
||||
public void updateConstraintValues(String listName, String authorityName, String[] values)
|
||||
{
|
||||
List<String> vals = new ArrayList<>();
|
||||
caveatConfigService.updateRMConstraintListAuthority(listName, authorityName, vals);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete the constraint values. i.e remove an authority from a constraint list
|
||||
* Delete the constraint values. i.e remove an authority from a constraint list
|
||||
*/
|
||||
public void deleteRMConstraintListAuthority(String listName, String authorityName)
|
||||
{
|
||||
//TODO Temporary conversion
|
||||
// TODO Temporary conversion
|
||||
String xxx = listName.replace("_", ":");
|
||||
|
||||
caveatConfigService.removeRMConstraintListAuthority(xxx, authorityName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete the constraint values. i.e remove a value from a constraint list
|
||||
* Delete the constraint values. i.e remove a value from a constraint list
|
||||
*/
|
||||
public void deleteRMConstraintListValue(String listName, String valueName)
|
||||
{
|
||||
//TODO Temporary conversion
|
||||
// TODO Temporary conversion
|
||||
String xxx = listName.replace("_", ":");
|
||||
|
||||
caveatConfigService.removeRMConstraintListValue(xxx, valueName);
|
||||
@@ -161,8 +160,8 @@ public class ScriptRMCaveatConfigService extends BaseScopableProcessorExtension
|
||||
|
||||
public ScriptConstraint createConstraint(String listName, String title, String[] allowedValues)
|
||||
{
|
||||
//TODO Temporary conversion
|
||||
if(listName != null)
|
||||
// TODO Temporary conversion
|
||||
if (listName != null)
|
||||
{
|
||||
listName = listName.replace("_", ":");
|
||||
}
|
||||
|
||||
@@ -41,7 +41,8 @@ public interface DeprecatedExtendedSecurityService
|
||||
/**
|
||||
* Gets the set of authorities that are extended readers for the given node.
|
||||
*
|
||||
* @param nodeRef node reference
|
||||
* @param nodeRef
|
||||
* node reference
|
||||
* @return {@link Set}<{@link String}> set of extended readers
|
||||
*
|
||||
* @deprecated as of 2.5, use {@link ExtendedSecurityService#getReaders(NodeRef)}
|
||||
@@ -51,8 +52,9 @@ public interface DeprecatedExtendedSecurityService
|
||||
/**
|
||||
* Get the set of authorities that are extended writers for the given node.
|
||||
*
|
||||
* @param nodeRef node reference
|
||||
* @return {@link Set}<{@link String}> set of extended writers
|
||||
* @param nodeRef
|
||||
* node reference
|
||||
* @return {@link Set}<{@link String}> set of extended writers
|
||||
*
|
||||
* @deprecated as of 2.5, use {@link ExtendedSecurityService#getWriters(NodeRef)}
|
||||
*/
|
||||
@@ -63,9 +65,12 @@ public interface DeprecatedExtendedSecurityService
|
||||
*
|
||||
* As of, 2.5 this method no longer applies the extended security to parents.
|
||||
*
|
||||
* @param nodeRef node reference
|
||||
* @param readers set of authorities to add extended read permissions
|
||||
* @param writers set of authorities to add extended write permissions
|
||||
* @param nodeRef
|
||||
* node reference
|
||||
* @param readers
|
||||
* set of authorities to add extended read permissions
|
||||
* @param writers
|
||||
* set of authorities to add extended write permissions
|
||||
*
|
||||
* @deprecated as of 2.5, use {@link ExtendedSecurityService#set(NodeRef, Set, Set)}
|
||||
*/
|
||||
@@ -75,74 +80,85 @@ public interface DeprecatedExtendedSecurityService
|
||||
/**
|
||||
* Add extended security for the specified authorities to a node.
|
||||
* <p>
|
||||
* If specified, the read and write extended permissions are applied to all parents up to the file plan as
|
||||
* extended read. This ensures parental read, but not parental write.
|
||||
* If specified, the read and write extended permissions are applied to all parents up to the file plan as extended read. This ensures parental read, but not parental write.
|
||||
*
|
||||
* @param nodeRef node reference
|
||||
* @param readers set of authorities to add extended read permissions
|
||||
* @param writers set of authorities to add extended write permissions
|
||||
* @param applyToParents true if extended security applied to parents (read only) false otherwise.
|
||||
* @param nodeRef
|
||||
* node reference
|
||||
* @param readers
|
||||
* set of authorities to add extended read permissions
|
||||
* @param writers
|
||||
* set of authorities to add extended write permissions
|
||||
* @param applyToParents
|
||||
* true if extended security applied to parents (read only) false otherwise.
|
||||
*
|
||||
* @deprecated as of 2.5, because extended security is no longer applied to parents. Note that calling this method will
|
||||
* only apply the extended security to the node and the applyToParents parameter value will be ignored.
|
||||
* @deprecated as of 2.5, because extended security is no longer applied to parents. Note that calling this method will only apply the extended security to the node and the applyToParents parameter value will be ignored.
|
||||
*
|
||||
* @see ExtendedSecurityService#set(NodeRef, Set, Set)
|
||||
*/
|
||||
@Deprecated void addExtendedSecurity(NodeRef nodeRef, Set<String> readers, Set<String> writers, boolean applyToParents);
|
||||
@Deprecated
|
||||
void addExtendedSecurity(NodeRef nodeRef, Set<String> readers, Set<String> writers, boolean applyToParents);
|
||||
|
||||
/**
|
||||
* Remove all extended readers and writers from the given node reference.
|
||||
*
|
||||
* @param nodeRef node reference
|
||||
* @param nodeRef
|
||||
* node reference
|
||||
*
|
||||
* @deprecated as of 2.5, see {@link ExtendedSecurityService#remove(NodeRef)}
|
||||
*/
|
||||
@Deprecated void removeAllExtendedSecurity(NodeRef nodeRef);
|
||||
@Deprecated
|
||||
void removeAllExtendedSecurity(NodeRef nodeRef);
|
||||
|
||||
/**
|
||||
* Remove the extended security for the specified authorities from a node.
|
||||
*
|
||||
* @param nodeRef node reference
|
||||
* @param readers set of authorities to remove as extended readers
|
||||
* @param writers set of authorities to remove as extended writers
|
||||
* @param nodeRef
|
||||
* node reference
|
||||
* @param readers
|
||||
* set of authorities to remove as extended readers
|
||||
* @param writers
|
||||
* set of authorities to remove as extended writers
|
||||
*
|
||||
* @deprecated as of 2.5, because partial removal of readers and writers from node or parents is no longer supported.
|
||||
* Note that calling this method will now remove all extended security from the node and never applied to parents.
|
||||
* @deprecated as of 2.5, because partial removal of readers and writers from node or parents is no longer supported. Note that calling this method will now remove all extended security from the node and never applied to parents.
|
||||
*
|
||||
* @see {@link ExtendedSecurityService#remove(NodeRef)}
|
||||
*/
|
||||
@Deprecated void removeExtendedSecurity(NodeRef nodeRef, Set<String> readers, Set<String> writers);
|
||||
@Deprecated
|
||||
void removeExtendedSecurity(NodeRef nodeRef, Set<String> readers, Set<String> writers);
|
||||
|
||||
/**
|
||||
* Remove the extended security for the specified authorities from a node.
|
||||
* <p>
|
||||
* If specified, extended security will also be removed from the parent hierarchy.(read only). Note that
|
||||
* extended security is records as a reference count, so security will only be utterly removed from the parent
|
||||
* hierarchy if all references to the authority are removed.
|
||||
* If specified, extended security will also be removed from the parent hierarchy.(read only). Note that extended security is records as a reference count, so security will only be utterly removed from the parent hierarchy if all references to the authority are removed.
|
||||
*
|
||||
* @param nodeRef node reference
|
||||
* @param readers set of authorities to remove as extended readers
|
||||
* @param writers set of authorities to remove as extedned writers
|
||||
* @param applyToParents true if removal of extended security is applied to parent hierarchy (read only), false
|
||||
* otherwise
|
||||
* @param nodeRef
|
||||
* node reference
|
||||
* @param readers
|
||||
* set of authorities to remove as extended readers
|
||||
* @param writers
|
||||
* set of authorities to remove as extedned writers
|
||||
* @param applyToParents
|
||||
* true if removal of extended security is applied to parent hierarchy (read only), false otherwise
|
||||
*
|
||||
* @deprecated as of 2.5, because partial removal of readers and writers from node or parents is no longer supported.
|
||||
* Note that calling this method will now remove all extended security from the node and never applied to parents.
|
||||
* @deprecated as of 2.5, because partial removal of readers and writers from node or parents is no longer supported. Note that calling this method will now remove all extended security from the node and never applied to parents.
|
||||
*
|
||||
* @see {@link ExtendedSecurityService#remove(NodeRef)}
|
||||
*/
|
||||
@Deprecated void removeExtendedSecurity(NodeRef nodeRef, Set<String> readers, Set<String> writers, boolean applyToParents);
|
||||
@Deprecated
|
||||
void removeExtendedSecurity(NodeRef nodeRef, Set<String> readers, Set<String> writers, boolean applyToParents);
|
||||
|
||||
/**
|
||||
* Remove all extended readers and writers from the given node reference.
|
||||
*
|
||||
* @param nodeRef node reference
|
||||
* @param applyToParents if true then apply removal to parent hierarchy (read only) false otherwise.
|
||||
* @param nodeRef
|
||||
* node reference
|
||||
* @param applyToParents
|
||||
* if true then apply removal to parent hierarchy (read only) false otherwise.
|
||||
*
|
||||
* @deprecated as of 2.5, because partial removal of readers and writers from node or parents is no longer supported.
|
||||
* Note that calling this method will now remove all extended security from the node and never applied to parents.
|
||||
* @deprecated as of 2.5, because partial removal of readers and writers from node or parents is no longer supported. Note that calling this method will now remove all extended security from the node and never applied to parents.
|
||||
*
|
||||
* @see {@link ExtendedSecurityService#remove(NodeRef)}
|
||||
*/
|
||||
@Deprecated void removeAllExtendedSecurity(NodeRef nodeRef, boolean applyToParents);
|
||||
@Deprecated
|
||||
void removeAllExtendedSecurity(NodeRef nodeRef, boolean applyToParents);
|
||||
}
|
||||
|
||||
@@ -62,23 +62,23 @@ public class ExtendedReaderDynamicAuthority extends ExtendedSecurityBaseDynamicA
|
||||
@Override
|
||||
public Set<PermissionReference> requiredFor()
|
||||
{
|
||||
if (requiredFor == null)
|
||||
{
|
||||
requiredFor = Collections.singleton(getModelDAO().getPermissionReference(null, RMPermissionModel.READ_RECORDS));
|
||||
}
|
||||
if (requiredFor == null)
|
||||
{
|
||||
requiredFor = Collections.singleton(getModelDAO().getPermissionReference(null, RMPermissionModel.READ_RECORDS));
|
||||
}
|
||||
|
||||
return requiredFor;
|
||||
return requiredFor;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.security.ExtendedSecurityBaseDynamicAuthority#getAuthorites(org.alfresco.service.cmr.repository.NodeRef)
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
protected Set<String> getAuthorites(NodeRef nodeRef)
|
||||
protected Set<String> getAuthorites(NodeRef nodeRef)
|
||||
{
|
||||
Set<String> result = null;
|
||||
|
||||
Map<String, Integer> readerMap = (Map<String, Integer>)getNodeService().getProperty(nodeRef, PROP_READERS);
|
||||
Map<String, Integer> readerMap = (Map<String, Integer>) getNodeService().getProperty(nodeRef, PROP_READERS);
|
||||
if (readerMap != null)
|
||||
{
|
||||
result = readerMap.keySet();
|
||||
@@ -93,6 +93,6 @@ public class ExtendedReaderDynamicAuthority extends ExtendedSecurityBaseDynamicA
|
||||
@Override
|
||||
protected String getTransactionCacheName()
|
||||
{
|
||||
return "rm.extendedreaderdynamicauthority";
|
||||
return "rm.extendedreaderdynamicauthority";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,9 @@ package org.alfresco.module.org_alfresco_module_rm.security;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextAware;
|
||||
|
||||
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
|
||||
import org.alfresco.repo.security.permissions.DynamicAuthority;
|
||||
import org.alfresco.repo.security.permissions.PermissionReference;
|
||||
@@ -39,8 +42,6 @@ import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.cmr.security.AuthorityService;
|
||||
import org.alfresco.util.Pair;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextAware;
|
||||
|
||||
/**
|
||||
* Extended readers dynamic authority implementation.
|
||||
@@ -50,8 +51,8 @@ import org.springframework.context.ApplicationContextAware;
|
||||
*/
|
||||
@Deprecated
|
||||
public abstract class ExtendedSecurityBaseDynamicAuthority implements DynamicAuthority,
|
||||
RecordsManagementModel,
|
||||
ApplicationContextAware
|
||||
RecordsManagementModel,
|
||||
ApplicationContextAware
|
||||
{
|
||||
/** Authority service */
|
||||
private AuthorityService authorityService;
|
||||
@@ -72,58 +73,58 @@ public abstract class ExtendedSecurityBaseDynamicAuthority implements DynamicAut
|
||||
protected Set<PermissionReference> requiredFor;
|
||||
|
||||
// NOTE: we get the services directly from the application context in this way to avoid
|
||||
// cyclic relationships and issues when loading the application context
|
||||
// cyclic relationships and issues when loading the application context
|
||||
|
||||
/**
|
||||
* @return authority service
|
||||
* @return authority service
|
||||
*/
|
||||
protected AuthorityService getAuthorityService()
|
||||
{
|
||||
if (authorityService == null)
|
||||
{
|
||||
authorityService = (AuthorityService)applicationContext.getBean("authorityService");
|
||||
authorityService = (AuthorityService) applicationContext.getBean("authorityService");
|
||||
}
|
||||
return authorityService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return extended security service
|
||||
* @return extended security service
|
||||
*/
|
||||
protected ExtendedSecurityService getExtendedSecurityService()
|
||||
{
|
||||
if (extendedSecurityService == null)
|
||||
{
|
||||
extendedSecurityService = (ExtendedSecurityService)applicationContext.getBean("extendedSecurityService");
|
||||
extendedSecurityService = (ExtendedSecurityService) applicationContext.getBean("extendedSecurityService");
|
||||
}
|
||||
return extendedSecurityService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return node service
|
||||
* @return node service
|
||||
*/
|
||||
protected NodeService getNodeService()
|
||||
{
|
||||
if (nodeService == null)
|
||||
{
|
||||
nodeService = (NodeService)applicationContext.getBean("dbNodeService");
|
||||
nodeService = (NodeService) applicationContext.getBean("dbNodeService");
|
||||
}
|
||||
return nodeService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return model DAO
|
||||
* @return model DAO
|
||||
*/
|
||||
protected ModelDAO getModelDAO()
|
||||
{
|
||||
if (modelDAO == null)
|
||||
{
|
||||
modelDAO = (ModelDAO)applicationContext.getBean("permissionsModelDAO");
|
||||
}
|
||||
return modelDAO;
|
||||
if (modelDAO == null)
|
||||
{
|
||||
modelDAO = (ModelDAO) applicationContext.getBean("permissionsModelDAO");
|
||||
}
|
||||
return modelDAO;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return String transaction cache name
|
||||
* @return String transaction cache name
|
||||
*/
|
||||
protected abstract String getTransactionCacheName();
|
||||
|
||||
@@ -137,8 +138,7 @@ public abstract class ExtendedSecurityBaseDynamicAuthority implements DynamicAut
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a list of the authorities from the extended security aspect that this dynamic
|
||||
* authority is checking against.
|
||||
* Gets a list of the authorities from the extended security aspect that this dynamic authority is checking against.
|
||||
*
|
||||
* @param nodeRef
|
||||
* @return
|
||||
@@ -162,29 +162,29 @@ public abstract class ExtendedSecurityBaseDynamicAuthority implements DynamicAut
|
||||
}
|
||||
else
|
||||
{
|
||||
if (getNodeService().hasAspect(nodeRef, ASPECT_EXTENDED_SECURITY))
|
||||
{
|
||||
Set<String> authorities = getAuthorites(nodeRef);
|
||||
if (authorities != null)
|
||||
{
|
||||
// check for everyone or the user
|
||||
if (authorities.contains("GROUP_EVEYONE") ||
|
||||
authorities.contains(userName))
|
||||
{
|
||||
result = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// determine whether any of the users groups are in the extended security
|
||||
Set<String> contained = getAuthorityService().getAuthoritiesForUser(userName);
|
||||
authorities.retainAll(contained);
|
||||
result = (authorities.size() != 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (getNodeService().hasAspect(nodeRef, ASPECT_EXTENDED_SECURITY))
|
||||
{
|
||||
Set<String> authorities = getAuthorites(nodeRef);
|
||||
if (authorities != null)
|
||||
{
|
||||
// check for everyone or the user
|
||||
if (authorities.contains("GROUP_EVEYONE") ||
|
||||
authorities.contains(userName))
|
||||
{
|
||||
result = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// determine whether any of the users groups are in the extended security
|
||||
Set<String> contained = getAuthorityService().getAuthoritiesForUser(userName);
|
||||
authorities.retainAll(contained);
|
||||
result = (authorities.size() != 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// cache result
|
||||
transactionCache.put(key, result);
|
||||
// cache result
|
||||
transactionCache.put(key, result);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
@@ -63,27 +63,27 @@ public class ExtendedWriterDynamicAuthority extends ExtendedSecurityBaseDynamicA
|
||||
@Override
|
||||
public Set<PermissionReference> requiredFor()
|
||||
{
|
||||
if (requiredFor == null)
|
||||
{
|
||||
requiredFor = new HashSet<>(3);
|
||||
Collections.addAll(requiredFor,
|
||||
getModelDAO().getPermissionReference(null, RMPermissionModel.READ_RECORDS),
|
||||
getModelDAO().getPermissionReference(null, RMPermissionModel.FILING),
|
||||
getModelDAO().getPermissionReference(null, RMPermissionModel.FILE_RECORDS));
|
||||
}
|
||||
if (requiredFor == null)
|
||||
{
|
||||
requiredFor = new HashSet<>(3);
|
||||
Collections.addAll(requiredFor,
|
||||
getModelDAO().getPermissionReference(null, RMPermissionModel.READ_RECORDS),
|
||||
getModelDAO().getPermissionReference(null, RMPermissionModel.FILING),
|
||||
getModelDAO().getPermissionReference(null, RMPermissionModel.FILE_RECORDS));
|
||||
}
|
||||
|
||||
return requiredFor;
|
||||
return requiredFor;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.security.ExtendedSecurityBaseDynamicAuthority#getAuthorites(org.alfresco.service.cmr.repository.NodeRef)
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
protected Set<String> getAuthorites(NodeRef nodeRef)
|
||||
protected Set<String> getAuthorites(NodeRef nodeRef)
|
||||
{
|
||||
Set<String> result = null;
|
||||
Set<String> result = null;
|
||||
|
||||
Map<String, Integer> map = (Map<String, Integer>)getNodeService().getProperty(nodeRef, PROP_WRITERS);
|
||||
Map<String, Integer> map = (Map<String, Integer>) getNodeService().getProperty(nodeRef, PROP_WRITERS);
|
||||
if (map != null)
|
||||
{
|
||||
result = map.keySet();
|
||||
@@ -98,6 +98,6 @@ public class ExtendedWriterDynamicAuthority extends ExtendedSecurityBaseDynamicA
|
||||
@Override
|
||||
protected String getTransactionCacheName()
|
||||
{
|
||||
return "rm.extendedwriterdynamicauthority";
|
||||
return "rm.extendedwriterdynamicauthority";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
|
||||
public interface FilePlanAuthenticationService
|
||||
{
|
||||
/**
|
||||
* @return rm admin user name
|
||||
* @return rm admin user name
|
||||
*
|
||||
* @deprecated as of 2.2, use {@link AuthenticationUtil#getAdminUserName()}
|
||||
*/
|
||||
@@ -49,14 +49,16 @@ public interface FilePlanAuthenticationService
|
||||
/**
|
||||
* Run provided work as the global rm admin user.
|
||||
*
|
||||
* @param <R> return type
|
||||
* @param runAsWork work to execute as the rm admin user
|
||||
* @return R result of work execution
|
||||
* @param <R>
|
||||
* return type
|
||||
* @param runAsWork
|
||||
* work to execute as the rm admin user
|
||||
* @return R result of work execution
|
||||
*
|
||||
* @deprecated as of 2.2, use
|
||||
*
|
||||
*
|
||||
* {@link AuthenticationUtil#runAs(RunAsWork, String)}
|
||||
* {@link AuthenticationUtil#runAs(RunAsWork, String)}
|
||||
*/
|
||||
<R> R runAsRmAdmin(RunAsWork<R> runAsWork);
|
||||
}
|
||||
|
||||
@@ -47,7 +47,8 @@ public interface RecordsManagementSecurityService
|
||||
/**
|
||||
* Creates the initial set of default roles for a root records management node
|
||||
*
|
||||
* @param rmRootNode root node
|
||||
* @param rmRootNode
|
||||
* root node
|
||||
*
|
||||
* @deprecated As of release 2.1, operation no longer supported
|
||||
*/
|
||||
@@ -55,11 +56,11 @@ public interface RecordsManagementSecurityService
|
||||
void bootstrapDefaultRoles(NodeRef rmRootNode);
|
||||
|
||||
/**
|
||||
* Returns the name of the container group for all roles of a specified file
|
||||
* plan.
|
||||
* Returns the name of the container group for all roles of a specified file plan.
|
||||
*
|
||||
* @param filePlan file plan node reference
|
||||
* @return String group name
|
||||
* @param filePlan
|
||||
* file plan node reference
|
||||
* @return String group name
|
||||
*
|
||||
* @deprecated As of release 2.1, replaced by {@link FilePlanRoleService#getAllRolesContainerGroup(NodeRef)}
|
||||
*/
|
||||
@@ -69,8 +70,9 @@ public interface RecordsManagementSecurityService
|
||||
/**
|
||||
* Get all the available roles for the given records management root node
|
||||
*
|
||||
* @param rmRootNode root node
|
||||
* @return {@link Set}<{@link Role}> all roles for a given root node
|
||||
* @param rmRootNode
|
||||
* root node
|
||||
* @return {@link Set}<{@link Role}> all roles for a given root node
|
||||
*
|
||||
* @deprecated As of release 2.1, replaced by {@link FilePlanRoleService#getRoles(NodeRef)}
|
||||
*/
|
||||
@@ -103,6 +105,7 @@ public interface RecordsManagementSecurityService
|
||||
|
||||
/**
|
||||
* Indicate whether a role exists for a given records management root node
|
||||
*
|
||||
* @param rmRootNode
|
||||
* @param role
|
||||
* @return
|
||||
@@ -115,8 +118,10 @@ public interface RecordsManagementSecurityService
|
||||
/**
|
||||
* Determines whether the given user has the RM Admin role
|
||||
*
|
||||
* @param rmRootNode RM root node
|
||||
* @param user user name to check
|
||||
* @param rmRootNode
|
||||
* RM root node
|
||||
* @param user
|
||||
* user name to check
|
||||
* @return true if the user has the RM Admin role, false otherwise
|
||||
*
|
||||
* @deprecated As of release 2.1, replaced by {@link FilePlanRoleService#hasRMAdminRole(NodeRef, String)}
|
||||
@@ -176,12 +181,14 @@ public interface RecordsManagementSecurityService
|
||||
void assignRoleToAuthority(NodeRef rmRootNode, String role, String authorityName);
|
||||
|
||||
/**
|
||||
* Sets a permission on a RM object. Assumes allow is true. Cascades permission down to record folder.
|
||||
* Cascades ReadRecord up to file plan.
|
||||
* Sets a permission on a RM object. Assumes allow is true. Cascades permission down to record folder. Cascades ReadRecord up to file plan.
|
||||
*
|
||||
* @param nodeRef node reference
|
||||
* @param authority authority
|
||||
* @param permission permission
|
||||
* @param nodeRef
|
||||
* node reference
|
||||
* @param authority
|
||||
* authority
|
||||
* @param permission
|
||||
* permission
|
||||
*
|
||||
* @deprecated As of release 2.1, replaced by {@link FilePlanPermissionService#setPermission(NodeRef, String, String)}
|
||||
*/
|
||||
@@ -189,11 +196,14 @@ public interface RecordsManagementSecurityService
|
||||
void setPermission(NodeRef nodeRef, String authority, String permission);
|
||||
|
||||
/**
|
||||
* Deletes a permission from a RM object. Cascades removal down to record folder.
|
||||
* Deletes a permission from a RM object. Cascades removal down to record folder.
|
||||
*
|
||||
* @param nodeRef node reference
|
||||
* @param authority authority
|
||||
* @param permission permission
|
||||
* @param nodeRef
|
||||
* node reference
|
||||
* @param authority
|
||||
* authority
|
||||
* @param permission
|
||||
* permission
|
||||
*
|
||||
* @deprecated As of release 2.1, replaced by {@link FilePlanPermissionService#deletePermission(NodeRef, String, String)}
|
||||
*/
|
||||
@@ -201,15 +211,15 @@ public interface RecordsManagementSecurityService
|
||||
void deletePermission(NodeRef nodeRef, String authority, String permission);
|
||||
|
||||
/**
|
||||
* @return {@link Set}<{@link QName}> protected aspect names
|
||||
* @return {@link Set}<{@link QName}> protected aspect names
|
||||
* @deprecated As of release 2.1, replaced by {@link ModelSecurityService#getProtectedAspects}
|
||||
*/
|
||||
@Deprecated
|
||||
Set<QName> getProtectedAspects();
|
||||
|
||||
/**
|
||||
* @return {@link Set}<{@link QName}> protected properties
|
||||
* @deprecated As of release 2.1, replaced by {@link ModelSecurityService#getProtectedProperties}
|
||||
* @return {@link Set}<{@link QName}> protected properties
|
||||
* @deprecated As of release 2.1, replaced by {@link ModelSecurityService#getProtectedProperties}
|
||||
*/
|
||||
Set<QName> getProtectedProperties();
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ import org.alfresco.service.namespace.QName;
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public class RecordsManagementSecurityServiceImpl implements RecordsManagementSecurityService,
|
||||
RecordsManagementModel
|
||||
RecordsManagementModel
|
||||
{
|
||||
/** Model security service */
|
||||
private ModelSecurityService modelSecurityService;
|
||||
@@ -55,7 +55,8 @@ public class RecordsManagementSecurityServiceImpl implements RecordsManagementSe
|
||||
private FilePlanPermissionService filePlanPermissionService;
|
||||
|
||||
/**
|
||||
* @param modelSecurityService model security service
|
||||
* @param modelSecurityService
|
||||
* model security service
|
||||
*/
|
||||
public void setModelSecurityService(ModelSecurityService modelSecurityService)
|
||||
{
|
||||
@@ -63,7 +64,8 @@ public class RecordsManagementSecurityServiceImpl implements RecordsManagementSe
|
||||
}
|
||||
|
||||
/**
|
||||
* @param filePlanRoleService file plan role service
|
||||
* @param filePlanRoleService
|
||||
* file plan role service
|
||||
*/
|
||||
public void setFilePlanRoleService(FilePlanRoleService filePlanRoleService)
|
||||
{
|
||||
@@ -71,7 +73,8 @@ public class RecordsManagementSecurityServiceImpl implements RecordsManagementSe
|
||||
}
|
||||
|
||||
/**
|
||||
* @param filePlanPermissionService file plan permission service
|
||||
* @param filePlanPermissionService
|
||||
* file plan permission service
|
||||
*/
|
||||
public void setFilePlanPermissionService(FilePlanPermissionService filePlanPermissionService)
|
||||
{
|
||||
|
||||
@@ -27,12 +27,13 @@
|
||||
|
||||
package org.alfresco.module.org_alfresco_module_rm.action;
|
||||
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextAware;
|
||||
|
||||
import org.alfresco.module.org_alfresco_module_rm.audit.RecordsManagementAuditService;
|
||||
import org.alfresco.repo.action.executer.ActionExecuterAbstractBase;
|
||||
import org.alfresco.service.cmr.action.Action;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextAware;
|
||||
|
||||
/**
|
||||
* Auditable action executer abstract base
|
||||
@@ -79,7 +80,8 @@ public abstract class AuditableActionExecuterAbstractBase extends ActionExecuter
|
||||
}
|
||||
|
||||
/**
|
||||
* @param auditable true if auditable, false otherwise
|
||||
* @param auditable
|
||||
* true if auditable, false otherwise
|
||||
*/
|
||||
public void setAuditable(boolean auditable)
|
||||
{
|
||||
@@ -87,7 +89,8 @@ public abstract class AuditableActionExecuterAbstractBase extends ActionExecuter
|
||||
}
|
||||
|
||||
/**
|
||||
* @param auditedImmediately true if to be audited immediately, false to be audited after transaction commits
|
||||
* @param auditedImmediately
|
||||
* true if to be audited immediately, false to be audited after transaction commits
|
||||
*/
|
||||
public void setAuditedImmediately(boolean auditedImmediately)
|
||||
{
|
||||
@@ -104,7 +107,7 @@ public abstract class AuditableActionExecuterAbstractBase extends ActionExecuter
|
||||
}
|
||||
|
||||
/**
|
||||
* @return records management audit service
|
||||
* @return records management audit service
|
||||
*/
|
||||
private RecordsManagementAuditService getAuditService()
|
||||
{
|
||||
@@ -142,7 +145,7 @@ public abstract class AuditableActionExecuterAbstractBase extends ActionExecuter
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#execute(org.alfresco.service.cmr.action.Action, org.alfresco.service.cmr.repository.NodeRef)
|
||||
*/
|
||||
@Override
|
||||
|
||||
@@ -34,7 +34,7 @@ import org.alfresco.service.cmr.repository.NodeRef;
|
||||
/**
|
||||
* Extension to action implementation hierarchy to insert parameter substitution processing.
|
||||
*
|
||||
* NOTE: this should eventually be pushed into the core.
|
||||
* NOTE: this should eventually be pushed into the core.
|
||||
*
|
||||
* @author Roy Wetherall
|
||||
* @since 2.1
|
||||
@@ -64,7 +64,8 @@ public abstract class PropertySubActionExecuterAbstractBase extends AuditableAct
|
||||
}
|
||||
|
||||
/**
|
||||
* @param parameterProcessorComponent parameter processor component
|
||||
* @param parameterProcessorComponent
|
||||
* parameter processor component
|
||||
*/
|
||||
public void setParameterProcessorComponent(ParameterProcessorComponent parameterProcessorComponent)
|
||||
{
|
||||
@@ -72,7 +73,8 @@ public abstract class PropertySubActionExecuterAbstractBase extends AuditableAct
|
||||
}
|
||||
|
||||
/**
|
||||
* @param allowParameterSubstitutions true if property subs allowed, false otherwise
|
||||
* @param allowParameterSubstitutions
|
||||
* true if property subs allowed, false otherwise
|
||||
*/
|
||||
public void setAllowParameterSubstitutions(boolean allowParameterSubstitutions)
|
||||
{
|
||||
@@ -85,10 +87,10 @@ public abstract class PropertySubActionExecuterAbstractBase extends AuditableAct
|
||||
@Override
|
||||
public void execute(Action action, NodeRef actionedUponNodeRef)
|
||||
{
|
||||
// do the property subs (if any exist)
|
||||
// do the property subs (if any exist)
|
||||
if (isAllowParameterSubstitutions())
|
||||
{
|
||||
getParameterProcessorComponent().process(action, getActionDefinition(), actionedUponNodeRef);
|
||||
getParameterProcessorComponent().process(action, getActionDefinition(), actionedUponNodeRef);
|
||||
}
|
||||
|
||||
super.execute(action, actionedUponNodeRef);
|
||||
|
||||
@@ -35,6 +35,10 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.springframework.beans.factory.BeanNameAware;
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import org.alfresco.module.org_alfresco_module_rm.admin.RecordsManagementAdminService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.audit.RecordsManagementAuditService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionService;
|
||||
@@ -61,19 +65,16 @@ import org.alfresco.service.cmr.security.OwnableService;
|
||||
import org.alfresco.service.namespace.NamespaceService;
|
||||
import org.alfresco.service.transaction.TransactionService;
|
||||
import org.alfresco.util.PropertyCheck;
|
||||
import org.springframework.beans.factory.BeanNameAware;
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* Records management action executer base class
|
||||
*
|
||||
* @author Roy Wetherall
|
||||
*/
|
||||
public abstract class RMActionExecuterAbstractBase extends PropertySubActionExecuterAbstractBase
|
||||
implements RecordsManagementAction,
|
||||
RecordsManagementModel,
|
||||
BeanNameAware
|
||||
public abstract class RMActionExecuterAbstractBase extends PropertySubActionExecuterAbstractBase
|
||||
implements RecordsManagementAction,
|
||||
RecordsManagementModel,
|
||||
BeanNameAware
|
||||
{
|
||||
/** Namespace service */
|
||||
private NamespaceService namespaceService;
|
||||
@@ -148,7 +149,8 @@ public abstract class RMActionExecuterAbstractBase extends PropertySubActionExe
|
||||
/**
|
||||
* Set the transaction service
|
||||
*
|
||||
* @param transactionService The transaction service
|
||||
* @param transactionService
|
||||
* The transaction service
|
||||
*/
|
||||
public void setTransactionService(TransactionService transactionService)
|
||||
{
|
||||
@@ -168,7 +170,8 @@ public abstract class RMActionExecuterAbstractBase extends PropertySubActionExe
|
||||
/**
|
||||
* Set the namespace service
|
||||
*
|
||||
* @param namespaceService The namespace service
|
||||
* @param namespaceService
|
||||
* The namespace service
|
||||
*/
|
||||
public void setNamespaceService(NamespaceService namespaceService)
|
||||
{
|
||||
@@ -188,7 +191,8 @@ public abstract class RMActionExecuterAbstractBase extends PropertySubActionExe
|
||||
/**
|
||||
* Set the node service
|
||||
*
|
||||
* @param nodeService The node service
|
||||
* @param nodeService
|
||||
* The node service
|
||||
*/
|
||||
public void setNodeService(NodeService nodeService)
|
||||
{
|
||||
@@ -208,7 +212,8 @@ public abstract class RMActionExecuterAbstractBase extends PropertySubActionExe
|
||||
/**
|
||||
* Set the dictionary service
|
||||
*
|
||||
* @param dictionaryService The dictionary service
|
||||
* @param dictionaryService
|
||||
* The dictionary service
|
||||
*/
|
||||
public void setDictionaryService(DictionaryService dictionaryService)
|
||||
{
|
||||
@@ -228,7 +233,8 @@ public abstract class RMActionExecuterAbstractBase extends PropertySubActionExe
|
||||
/**
|
||||
* Set the content service
|
||||
*
|
||||
* @param contentService The content service
|
||||
* @param contentService
|
||||
* The content service
|
||||
*/
|
||||
public void setContentService(ContentService contentService)
|
||||
{
|
||||
@@ -248,7 +254,8 @@ public abstract class RMActionExecuterAbstractBase extends PropertySubActionExe
|
||||
/**
|
||||
* Set action service
|
||||
*
|
||||
* @param actionService The action service
|
||||
* @param actionService
|
||||
* The action service
|
||||
*/
|
||||
public void setActionService(ActionService actionService)
|
||||
{
|
||||
@@ -268,7 +275,8 @@ public abstract class RMActionExecuterAbstractBase extends PropertySubActionExe
|
||||
/**
|
||||
* Set the audit service that action details will be sent to
|
||||
*
|
||||
* @param recordsManagementAuditService The audit service that action details will be sent to
|
||||
* @param recordsManagementAuditService
|
||||
* The audit service that action details will be sent to
|
||||
*/
|
||||
public void setRecordsManagementAuditService(RecordsManagementAuditService recordsManagementAuditService)
|
||||
{
|
||||
@@ -288,7 +296,8 @@ public abstract class RMActionExecuterAbstractBase extends PropertySubActionExe
|
||||
/**
|
||||
* Set records management service
|
||||
*
|
||||
* @param recordsManagementActionService The records management service
|
||||
* @param recordsManagementActionService
|
||||
* The records management service
|
||||
*/
|
||||
public void setRecordsManagementActionService(RecordsManagementActionService recordsManagementActionService)
|
||||
{
|
||||
@@ -308,7 +317,8 @@ public abstract class RMActionExecuterAbstractBase extends PropertySubActionExe
|
||||
/**
|
||||
* Set the disposition service
|
||||
*
|
||||
* @param dispositionService The disposition service
|
||||
* @param dispositionService
|
||||
* The disposition service
|
||||
*/
|
||||
public void setDispositionService(DispositionService dispositionService)
|
||||
{
|
||||
@@ -328,7 +338,8 @@ public abstract class RMActionExecuterAbstractBase extends PropertySubActionExe
|
||||
/**
|
||||
* Sets the vital record service
|
||||
*
|
||||
* @param vitalRecordService vital record service
|
||||
* @param vitalRecordService
|
||||
* vital record service
|
||||
*/
|
||||
public void setVitalRecordService(VitalRecordService vitalRecordService)
|
||||
{
|
||||
@@ -348,7 +359,8 @@ public abstract class RMActionExecuterAbstractBase extends PropertySubActionExe
|
||||
/**
|
||||
* Set the records management event service
|
||||
*
|
||||
* @param recordsManagementEventService The records management event service
|
||||
* @param recordsManagementEventService
|
||||
* The records management event service
|
||||
*/
|
||||
public void setRecordsManagementEventService(RecordsManagementEventService recordsManagementEventService)
|
||||
{
|
||||
@@ -368,7 +380,8 @@ public abstract class RMActionExecuterAbstractBase extends PropertySubActionExe
|
||||
/**
|
||||
* Set the ownable service
|
||||
*
|
||||
* @param ownableService The ownable service
|
||||
* @param ownableService
|
||||
* The ownable service
|
||||
*/
|
||||
public void setOwnableService(OwnableService ownableService)
|
||||
{
|
||||
@@ -388,7 +401,8 @@ public abstract class RMActionExecuterAbstractBase extends PropertySubActionExe
|
||||
/**
|
||||
* Set freeze service
|
||||
*
|
||||
* @param freezeService freeze service
|
||||
* @param freezeService
|
||||
* freeze service
|
||||
*/
|
||||
public void setFreezeService(FreezeService freezeService)
|
||||
{
|
||||
@@ -408,7 +422,8 @@ public abstract class RMActionExecuterAbstractBase extends PropertySubActionExe
|
||||
/**
|
||||
* Set record service
|
||||
*
|
||||
* @param recordService record service
|
||||
* @param recordService
|
||||
* record service
|
||||
*/
|
||||
public void setRecordService(RecordService recordService)
|
||||
{
|
||||
@@ -428,7 +443,8 @@ public abstract class RMActionExecuterAbstractBase extends PropertySubActionExe
|
||||
/**
|
||||
* Sets the records management admin service
|
||||
*
|
||||
* @param recordsManagementAdminService records management admin service
|
||||
* @param recordsManagementAdminService
|
||||
* records management admin service
|
||||
*/
|
||||
public void setRecordsManagementAdminService(RecordsManagementAdminService recordsManagementAdminService)
|
||||
{
|
||||
@@ -448,7 +464,8 @@ public abstract class RMActionExecuterAbstractBase extends PropertySubActionExe
|
||||
/**
|
||||
* Sets the model security service
|
||||
*
|
||||
* @param modelSecurityService model security service
|
||||
* @param modelSecurityService
|
||||
* model security service
|
||||
*/
|
||||
public void setModelSecurityService(ModelSecurityService modelSecurityService)
|
||||
{
|
||||
@@ -468,7 +485,8 @@ public abstract class RMActionExecuterAbstractBase extends PropertySubActionExe
|
||||
/**
|
||||
* Sets the record folder service
|
||||
*
|
||||
* @param recordFolderService record folder service
|
||||
* @param recordFolderService
|
||||
* record folder service
|
||||
*/
|
||||
public void setRecordFolderService(RecordFolderService recordFolderService)
|
||||
{
|
||||
@@ -488,7 +506,8 @@ public abstract class RMActionExecuterAbstractBase extends PropertySubActionExe
|
||||
/**
|
||||
* Sets the hold service
|
||||
*
|
||||
* @param holdService hold service
|
||||
* @param holdService
|
||||
* hold service
|
||||
*/
|
||||
public void setHoldService(HoldService holdService)
|
||||
{
|
||||
@@ -508,7 +527,8 @@ public abstract class RMActionExecuterAbstractBase extends PropertySubActionExe
|
||||
/**
|
||||
* Sets the identifier service
|
||||
*
|
||||
* @param identifierService the identifier service
|
||||
* @param identifierService
|
||||
* the identifier service
|
||||
*/
|
||||
public void setIdentifierService(IdentifierService identifierService)
|
||||
{
|
||||
@@ -518,11 +538,12 @@ public abstract class RMActionExecuterAbstractBase extends PropertySubActionExe
|
||||
/**
|
||||
* Sets the applicable kinds
|
||||
*
|
||||
* @param applicableKinds kinds that this action is applicable for
|
||||
* @param applicableKinds
|
||||
* kinds that this action is applicable for
|
||||
*/
|
||||
public void setApplicableKinds(String[] applicableKinds)
|
||||
{
|
||||
for(String kind : applicableKinds)
|
||||
for (String kind : applicableKinds)
|
||||
{
|
||||
this.applicableKinds.add(FilePlanComponentKind.valueOf(kind));
|
||||
}
|
||||
@@ -544,7 +565,7 @@ public abstract class RMActionExecuterAbstractBase extends PropertySubActionExe
|
||||
public ActionDefinition getActionDefinition()
|
||||
{
|
||||
ActionDefinition actionDefinition = super.getActionDefinition();
|
||||
((RecordsManagementActionDefinitionImpl)this.actionDefinition).setApplicableKinds(applicableKinds);
|
||||
((RecordsManagementActionDefinitionImpl) this.actionDefinition).setApplicableKinds(applicableKinds);
|
||||
return actionDefinition;
|
||||
}
|
||||
|
||||
@@ -554,7 +575,7 @@ public abstract class RMActionExecuterAbstractBase extends PropertySubActionExe
|
||||
@Override
|
||||
public RecordsManagementActionDefinition getRecordsManagementActionDefinition()
|
||||
{
|
||||
return (RecordsManagementActionDefinition)getActionDefinition();
|
||||
return (RecordsManagementActionDefinition) getActionDefinition();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -582,7 +603,7 @@ public abstract class RMActionExecuterAbstractBase extends PropertySubActionExe
|
||||
/**
|
||||
* Indicates whether this records management action is public or not
|
||||
*
|
||||
* @return boolean true if public, false otherwise
|
||||
* @return boolean true if public, false otherwise
|
||||
*/
|
||||
@Override
|
||||
public boolean isPublicAction()
|
||||
@@ -678,8 +699,10 @@ public abstract class RMActionExecuterAbstractBase extends PropertySubActionExe
|
||||
/**
|
||||
* Function to pad a string with zero '0' characters to the required length
|
||||
*
|
||||
* @param s String to pad with leading zero '0' characters
|
||||
* @param len Length to pad to
|
||||
* @param s
|
||||
* String to pad with leading zero '0' characters
|
||||
* @param len
|
||||
* Length to pad to
|
||||
*
|
||||
* @return padded string or the original if already at >= len characters
|
||||
*
|
||||
@@ -688,7 +711,7 @@ public abstract class RMActionExecuterAbstractBase extends PropertySubActionExe
|
||||
@Deprecated
|
||||
protected String padString(String s, int len)
|
||||
{
|
||||
return leftPad(s, len);
|
||||
return leftPad(s, len);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -30,6 +30,8 @@ package org.alfresco.module.org_alfresco_module_rm.action;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionSchedule;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
@@ -38,7 +40,6 @@ import org.alfresco.service.cmr.action.ParameterDefinition;
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.namespace.RegexQNamePattern;
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
|
||||
/**
|
||||
* @author Roy Wetherall
|
||||
@@ -81,8 +82,7 @@ public abstract class RMDispositionActionExecuterAbstractBase extends RMActionEx
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether we should validate the next disposition action is the action we are
|
||||
* trying to execute.
|
||||
* Indicates whether we should validate the next disposition action is the action we are trying to execute.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@@ -103,21 +103,20 @@ public abstract class RMDispositionActionExecuterAbstractBase extends RMActionEx
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(org.alfresco.service.cmr.action.Action,
|
||||
* org.alfresco.service.cmr.repository.NodeRef)
|
||||
* @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(org.alfresco.service.cmr.action.Action, org.alfresco.service.cmr.repository.NodeRef)
|
||||
*/
|
||||
@Override
|
||||
protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
|
||||
{
|
||||
NodeRef nextDispositionActionNodeRef = getNextDispostionAction(actionedUponNodeRef);
|
||||
NodeRef nextDispositionActionNodeRef = getNextDispostionAction(actionedUponNodeRef);
|
||||
|
||||
// determine whether we should be raising errors during state checking or not
|
||||
boolean checkError = true;
|
||||
Boolean checkErrorValue = (Boolean)action.getParameterValue(PARAM_NO_ERROR_CHECK);
|
||||
if (checkErrorValue != null)
|
||||
{
|
||||
checkError = checkErrorValue.booleanValue();
|
||||
}
|
||||
boolean checkError = true;
|
||||
Boolean checkErrorValue = (Boolean) action.getParameterValue(PARAM_NO_ERROR_CHECK);
|
||||
if (checkErrorValue != null)
|
||||
{
|
||||
checkError = checkErrorValue.booleanValue();
|
||||
}
|
||||
|
||||
// Check the validity of the action (is it the next action, are we dealing with the correct type of object for
|
||||
// the disposition level?
|
||||
@@ -144,7 +143,7 @@ public abstract class RMDispositionActionExecuterAbstractBase extends RMActionEx
|
||||
executeRecordLevelDisposition(action, actionedUponNodeRef);
|
||||
|
||||
if (getNodeService().exists(nextDispositionActionNodeRef) &&
|
||||
getSetDispositionActionComplete())
|
||||
getSetDispositionActionComplete())
|
||||
{
|
||||
getNodeService().setProperty(nextDispositionActionNodeRef, PROP_DISPOSITION_ACTION_COMPLETED_AT, new Date());
|
||||
getNodeService().setProperty(nextDispositionActionNodeRef, PROP_DISPOSITION_ACTION_COMPLETED_BY, AuthenticationUtil.getRunAsUser());
|
||||
@@ -174,7 +173,7 @@ public abstract class RMDispositionActionExecuterAbstractBase extends RMActionEx
|
||||
|
||||
// Indicate that the disposition action is compelte
|
||||
if (getNodeService().exists(nextDispositionActionNodeRef) &&
|
||||
getSetDispositionActionComplete())
|
||||
getSetDispositionActionComplete())
|
||||
{
|
||||
getNodeService().setProperty(nextDispositionActionNodeRef, PROP_DISPOSITION_ACTION_COMPLETED_AT, new Date());
|
||||
getNodeService().setProperty(nextDispositionActionNodeRef, PROP_DISPOSITION_ACTION_COMPLETED_BY, AuthenticationUtil.getRunAsUser());
|
||||
|
||||
@@ -44,43 +44,44 @@ public interface RecordsManagementAction
|
||||
/**
|
||||
* Get the name of the action
|
||||
*
|
||||
* @return String action name
|
||||
* @return String action name
|
||||
*/
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* Get the label of the action
|
||||
*
|
||||
* @return String action label
|
||||
* @return String action label
|
||||
*/
|
||||
String getLabel();
|
||||
|
||||
/**
|
||||
* Get the description of the action
|
||||
*
|
||||
* @return String action description
|
||||
* @return String action description
|
||||
*/
|
||||
String getDescription();
|
||||
|
||||
/**
|
||||
* Indicates whether this is a disposition action or not
|
||||
*
|
||||
* @return boolean true if a disposition action, false otherwise
|
||||
* @return boolean true if a disposition action, false otherwise
|
||||
*/
|
||||
boolean isDispositionAction();
|
||||
|
||||
/**
|
||||
* Execution of the action
|
||||
*
|
||||
* @param filePlanComponent file plan component the action is executed upon
|
||||
* @param parameters action parameters
|
||||
* @param filePlanComponent
|
||||
* file plan component the action is executed upon
|
||||
* @param parameters
|
||||
* action parameters
|
||||
* @return The result of the executed action
|
||||
*/
|
||||
RecordsManagementActionResult execute(NodeRef filePlanComponent, Map<String, Serializable> parameters);
|
||||
|
||||
/**
|
||||
* Some admin-related rmActions execute against a target nodeRef which is not provided
|
||||
* by the calling code, but is instead an implementation detail of the action.
|
||||
* Some admin-related rmActions execute against a target nodeRef which is not provided by the calling code, but is instead an implementation detail of the action.
|
||||
*
|
||||
* @return the target nodeRef
|
||||
*/
|
||||
|
||||
@@ -41,21 +41,21 @@ public interface RecordsManagementActionCondition
|
||||
/**
|
||||
* Get the name of the action condition
|
||||
*
|
||||
* @return String action condition name
|
||||
* @return String action condition name
|
||||
*/
|
||||
String getBeanName();
|
||||
|
||||
/**
|
||||
* Get the label of the action condition
|
||||
*
|
||||
* @return String action condition label
|
||||
* @return String action condition label
|
||||
*/
|
||||
String getLabel();
|
||||
|
||||
/**
|
||||
* Get the description of the action condition
|
||||
*
|
||||
* @return String action condition description
|
||||
* @return String action condition description
|
||||
*/
|
||||
String getDescription();
|
||||
|
||||
|
||||
@@ -40,5 +40,4 @@ import org.alfresco.service.cmr.action.ActionConditionDefinition;
|
||||
*/
|
||||
@AlfrescoPublicApi
|
||||
public interface RecordsManagementActionConditionDefinition extends ActionConditionDefinition
|
||||
{
|
||||
}
|
||||
{}
|
||||
|
||||
@@ -36,7 +36,7 @@ import org.alfresco.repo.action.ActionConditionDefinitionImpl;
|
||||
* @since 2.1
|
||||
*/
|
||||
public class RecordsManagementActionConditionDefinitionImpl extends ActionConditionDefinitionImpl
|
||||
implements RecordsManagementActionConditionDefinition
|
||||
implements RecordsManagementActionConditionDefinition
|
||||
{
|
||||
/** Serial Version UID */
|
||||
private static final long serialVersionUID = -7599279732731533610L;
|
||||
@@ -44,7 +44,8 @@ public class RecordsManagementActionConditionDefinitionImpl extends ActionCondit
|
||||
/**
|
||||
* Default constructor.
|
||||
*
|
||||
* @param name name of the condition
|
||||
* @param name
|
||||
* name of the condition
|
||||
*/
|
||||
public RecordsManagementActionConditionDefinitionImpl(String name)
|
||||
{
|
||||
|
||||
@@ -29,6 +29,8 @@ package org.alfresco.module.org_alfresco_module_rm.action;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.BeanNameAware;
|
||||
|
||||
import org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanService;
|
||||
import org.alfresco.repo.action.evaluator.ActionConditionEvaluatorAbstractBase;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
@@ -37,7 +39,6 @@ import org.alfresco.repo.transaction.RetryingTransactionHelper;
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
|
||||
import org.alfresco.service.cmr.action.ActionConditionDefinition;
|
||||
import org.alfresco.service.cmr.action.ParameterDefinition;
|
||||
import org.springframework.beans.factory.BeanNameAware;
|
||||
|
||||
/**
|
||||
* Records management action condition evaluator abstract base implementation.
|
||||
@@ -46,8 +47,8 @@ import org.springframework.beans.factory.BeanNameAware;
|
||||
* @since 2.1
|
||||
*/
|
||||
public abstract class RecordsManagementActionConditionEvaluatorAbstractBase extends ActionConditionEvaluatorAbstractBase
|
||||
implements RecordsManagementActionCondition,
|
||||
BeanNameAware
|
||||
implements RecordsManagementActionCondition,
|
||||
BeanNameAware
|
||||
{
|
||||
/** records management action service */
|
||||
private RecordsManagementActionService recordsManagementActionService;
|
||||
@@ -80,7 +81,8 @@ public abstract class RecordsManagementActionConditionEvaluatorAbstractBase exte
|
||||
}
|
||||
|
||||
/**
|
||||
* @param recordsManagementActionService records management action service
|
||||
* @param recordsManagementActionService
|
||||
* records management action service
|
||||
*/
|
||||
public void setRecordsManagementActionService(RecordsManagementActionService recordsManagementActionService)
|
||||
{
|
||||
@@ -88,15 +90,17 @@ public abstract class RecordsManagementActionConditionEvaluatorAbstractBase exte
|
||||
}
|
||||
|
||||
/**
|
||||
* @param filePlanService file plan service
|
||||
* @param filePlanService
|
||||
* file plan service
|
||||
*/
|
||||
public void setFilePlanService(FilePlanService filePlanService)
|
||||
{
|
||||
this.filePlanService = filePlanService;
|
||||
}
|
||||
this.filePlanService = filePlanService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param retryingTransactionHelper retrying transaction helper
|
||||
* @param retryingTransactionHelper
|
||||
* retrying transaction helper
|
||||
*/
|
||||
public void setRetryingTransactionHelper(RetryingTransactionHelper retryingTransactionHelper)
|
||||
{
|
||||
@@ -112,12 +116,10 @@ public abstract class RecordsManagementActionConditionEvaluatorAbstractBase exte
|
||||
// override to prevent condition being registered with the core action service
|
||||
|
||||
// run the following code as System
|
||||
AuthenticationUtil.runAs(new RunAsWork<Object>()
|
||||
{
|
||||
AuthenticationUtil.runAs(new RunAsWork<Object>() {
|
||||
public Object doWork()
|
||||
{
|
||||
RetryingTransactionCallback<Void> callback = new RetryingTransactionCallback<Void>()
|
||||
{
|
||||
RetryingTransactionCallback<Void> callback = new RetryingTransactionCallback<Void>() {
|
||||
public Void execute()
|
||||
{
|
||||
getRecordsManagementActionService().register(RecordsManagementActionConditionEvaluatorAbstractBase.this);
|
||||
@@ -176,8 +178,7 @@ public abstract class RecordsManagementActionConditionEvaluatorAbstractBase exte
|
||||
/**
|
||||
* @see org.alfresco.repo.action.evaluator.ActionConditionEvaluatorAbstractBase#getActionConditionDefintion()
|
||||
*
|
||||
* TODO base class should provide "createActionDefinition" method that can be over-ridden like the ActionExecuter
|
||||
* base class to prevent duplication of code and a cleaner extension.
|
||||
* TODO base class should provide "createActionDefinition" method that can be over-ridden like the ActionExecuter base class to prevent duplication of code and a cleaner extension.
|
||||
*/
|
||||
@Override
|
||||
public ActionConditionDefinition getActionConditionDefintion()
|
||||
@@ -185,11 +186,11 @@ public abstract class RecordsManagementActionConditionEvaluatorAbstractBase exte
|
||||
if (this.actionConditionDefinition == null)
|
||||
{
|
||||
this.actionConditionDefinition = new RecordsManagementActionConditionDefinitionImpl(beanName);
|
||||
((RecordsManagementActionConditionDefinitionImpl)actionConditionDefinition).setTitleKey(getTitleKey());
|
||||
((RecordsManagementActionConditionDefinitionImpl)actionConditionDefinition).setDescriptionKey(getDescriptionKey());
|
||||
((RecordsManagementActionConditionDefinitionImpl)actionConditionDefinition).setAdhocPropertiesAllowed(getAdhocPropertiesAllowed());
|
||||
((RecordsManagementActionConditionDefinitionImpl)actionConditionDefinition).setConditionEvaluator(beanName);
|
||||
((RecordsManagementActionConditionDefinitionImpl)actionConditionDefinition).setLocalizedParameterDefinitions(getLocalizedParameterDefinitions());
|
||||
((RecordsManagementActionConditionDefinitionImpl) actionConditionDefinition).setTitleKey(getTitleKey());
|
||||
((RecordsManagementActionConditionDefinitionImpl) actionConditionDefinition).setDescriptionKey(getDescriptionKey());
|
||||
((RecordsManagementActionConditionDefinitionImpl) actionConditionDefinition).setAdhocPropertiesAllowed(getAdhocPropertiesAllowed());
|
||||
((RecordsManagementActionConditionDefinitionImpl) actionConditionDefinition).setConditionEvaluator(beanName);
|
||||
((RecordsManagementActionConditionDefinitionImpl) actionConditionDefinition).setLocalizedParameterDefinitions(getLocalizedParameterDefinitions());
|
||||
}
|
||||
return this.actionConditionDefinition;
|
||||
}
|
||||
@@ -218,7 +219,7 @@ public abstract class RecordsManagementActionConditionEvaluatorAbstractBase exte
|
||||
@Override
|
||||
public RecordsManagementActionConditionDefinition getRecordsManagementActionConditionDefinition()
|
||||
{
|
||||
return (RecordsManagementActionConditionDefinition)getActionConditionDefintion();
|
||||
return (RecordsManagementActionConditionDefinition) getActionConditionDefintion();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ import org.alfresco.service.cmr.action.ActionDefinition;
|
||||
public interface RecordsManagementActionDefinition extends ActionDefinition
|
||||
{
|
||||
/**
|
||||
* @return list of applicable file plan component kinds
|
||||
* @return list of applicable file plan component kinds
|
||||
*/
|
||||
Set<FilePlanComponentKind> getApplicableKinds();
|
||||
}
|
||||
|
||||
@@ -49,7 +49,8 @@ public class RecordsManagementActionDefinitionImpl extends ActionDefinitionImpl
|
||||
/**
|
||||
* Default constructor.
|
||||
*
|
||||
* @param name action definition name
|
||||
* @param name
|
||||
* action definition name
|
||||
*/
|
||||
public RecordsManagementActionDefinitionImpl(String name)
|
||||
{
|
||||
@@ -57,7 +58,8 @@ public class RecordsManagementActionDefinitionImpl extends ActionDefinitionImpl
|
||||
}
|
||||
|
||||
/**
|
||||
* @param applicableKinds applicable kinds
|
||||
* @param applicableKinds
|
||||
* applicable kinds
|
||||
*/
|
||||
public void setApplicableKinds(Set<FilePlanComponentKind> applicableKinds)
|
||||
{
|
||||
|
||||
@@ -43,7 +43,8 @@ public class RecordsManagementActionResult
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param value result value
|
||||
* @param value
|
||||
* result value
|
||||
*/
|
||||
public RecordsManagementActionResult(Object value)
|
||||
{
|
||||
@@ -51,7 +52,7 @@ public class RecordsManagementActionResult
|
||||
}
|
||||
|
||||
/**
|
||||
* @return result value
|
||||
* @return result value
|
||||
*/
|
||||
public Object getValue()
|
||||
{
|
||||
|
||||
@@ -34,7 +34,6 @@ import java.util.Map;
|
||||
import org.alfresco.api.AlfrescoPublicApi;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
|
||||
|
||||
/**
|
||||
* Records management action service interface
|
||||
*
|
||||
@@ -51,7 +50,7 @@ public interface RecordsManagementActionService
|
||||
List<RecordsManagementAction> getRecordsManagementActions();
|
||||
|
||||
/**
|
||||
* Get a list of the available records management action conditions
|
||||
* Get a list of the available records management action conditions
|
||||
*
|
||||
* @return List of records management action conditions
|
||||
* @since 2.1
|
||||
@@ -59,8 +58,7 @@ public interface RecordsManagementActionService
|
||||
List<RecordsManagementActionCondition> getRecordsManagementActionConditions();
|
||||
|
||||
/**
|
||||
* Get a list of the available disposition actions. A disposition action is a records
|
||||
* management action that can be used when defining disposition instructions.
|
||||
* Get a list of the available disposition actions. A disposition action is a records management action that can be used when defining disposition instructions.
|
||||
*
|
||||
* @return List of disposition actions
|
||||
*/
|
||||
@@ -69,7 +67,8 @@ public interface RecordsManagementActionService
|
||||
/**
|
||||
* Gets the named records management action
|
||||
*
|
||||
* @param name The name of the RM action to retrieve
|
||||
* @param name
|
||||
* The name of the RM action to retrieve
|
||||
* @return The RecordsManagementAction or null if it doesn't exist
|
||||
*/
|
||||
RecordsManagementAction getRecordsManagementAction(String name);
|
||||
@@ -77,7 +76,8 @@ public interface RecordsManagementActionService
|
||||
/**
|
||||
* Gets the named disposition action
|
||||
*
|
||||
* @param name The name of the disposition action to retrieve
|
||||
* @param name
|
||||
* The name of the disposition action to retrieve
|
||||
* @return The RecordsManagementAction or null if it doesn't exist
|
||||
*/
|
||||
RecordsManagementAction getDispositionAction(String name);
|
||||
@@ -85,8 +85,10 @@ public interface RecordsManagementActionService
|
||||
/**
|
||||
* Execute a records management action
|
||||
*
|
||||
* @param nodeRef node reference to a rm container, rm folder or record
|
||||
* @param name action name
|
||||
* @param nodeRef
|
||||
* node reference to a rm container, rm folder or record
|
||||
* @param name
|
||||
* action name
|
||||
* @return The result of executed records management action
|
||||
*/
|
||||
RecordsManagementActionResult executeRecordsManagementAction(NodeRef nodeRef, String name);
|
||||
@@ -94,8 +96,10 @@ public interface RecordsManagementActionService
|
||||
/**
|
||||
* Execute a records management action against several nodes
|
||||
*
|
||||
* @param nodeRefs node references to rm containers, rm folders or records
|
||||
* @param name action name
|
||||
* @param nodeRefs
|
||||
* node references to rm containers, rm folders or records
|
||||
* @param name
|
||||
* action name
|
||||
* @return The result of executed records management action against several nodes
|
||||
*/
|
||||
Map<NodeRef, RecordsManagementActionResult> executeRecordsManagementAction(List<NodeRef> nodeRefs, String name);
|
||||
@@ -103,9 +107,12 @@ public interface RecordsManagementActionService
|
||||
/**
|
||||
* Execute a records management action
|
||||
*
|
||||
* @param nodeRef node reference to a rm container, rm folder or record
|
||||
* @param name action name
|
||||
* @param parameters action parameters
|
||||
* @param nodeRef
|
||||
* node reference to a rm container, rm folder or record
|
||||
* @param name
|
||||
* action name
|
||||
* @param parameters
|
||||
* action parameters
|
||||
* @return The result of executed records management action
|
||||
*/
|
||||
RecordsManagementActionResult executeRecordsManagementAction(NodeRef nodeRef, String name, Map<String, Serializable> parameters);
|
||||
@@ -113,19 +120,23 @@ public interface RecordsManagementActionService
|
||||
/**
|
||||
* Execute a records management action against several nodes
|
||||
*
|
||||
* @param nodeRefs node references to rm containers, rm folders or records
|
||||
* @param name action name
|
||||
* @param parameters action parameters
|
||||
* @param nodeRefs
|
||||
* node references to rm containers, rm folders or records
|
||||
* @param name
|
||||
* action name
|
||||
* @param parameters
|
||||
* action parameters
|
||||
* @return The result of executed records management action against several nodes
|
||||
*/
|
||||
Map<NodeRef, RecordsManagementActionResult> executeRecordsManagementAction(List<NodeRef> nodeRefs, String name, Map<String, Serializable> parameters);
|
||||
|
||||
/**
|
||||
* Execute a records management action. The nodeRef against which the action is to be
|
||||
* executed must be provided by the RecordsManagementAction implementation.
|
||||
* Execute a records management action. The nodeRef against which the action is to be executed must be provided by the RecordsManagementAction implementation.
|
||||
*
|
||||
* @param name action name
|
||||
* @param parameters action parameters
|
||||
* @param name
|
||||
* action name
|
||||
* @param parameters
|
||||
* action parameters
|
||||
* @return The result of executed records management action
|
||||
*/
|
||||
RecordsManagementActionResult executeRecordsManagementAction(String name, Map<String, Serializable> parameters);
|
||||
@@ -133,14 +144,16 @@ public interface RecordsManagementActionService
|
||||
/**
|
||||
* Register records management action
|
||||
*
|
||||
* @param rmAction records management action
|
||||
* @param rmAction
|
||||
* records management action
|
||||
*/
|
||||
void register(RecordsManagementAction rmAction);
|
||||
|
||||
/**
|
||||
* Register records management condition
|
||||
*
|
||||
* @param rmCondition records management condition
|
||||
* @param rmCondition
|
||||
* records management condition
|
||||
* @since 2.1
|
||||
*/
|
||||
void register(RecordsManagementActionCondition rmCondition);
|
||||
|
||||
@@ -36,6 +36,8 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
|
||||
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;
|
||||
@@ -46,7 +48,6 @@ 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.springframework.extensions.surf.util.I18NUtil;
|
||||
|
||||
/**
|
||||
* Records Management Action Service Implementation
|
||||
@@ -104,7 +105,8 @@ public class RecordsManagementActionServiceImpl implements RecordsManagementActi
|
||||
}
|
||||
|
||||
/**
|
||||
* @param freezeService freeze service
|
||||
* @param freezeService
|
||||
* freeze service
|
||||
*/
|
||||
public void setFreezeService(FreezeService freezeService)
|
||||
{
|
||||
@@ -119,7 +121,8 @@ public class RecordsManagementActionServiceImpl implements RecordsManagementActi
|
||||
/**
|
||||
* Set the policy component
|
||||
*
|
||||
* @param policyComponent policy component
|
||||
* @param policyComponent
|
||||
* policy component
|
||||
*/
|
||||
public void setPolicyComponent(PolicyComponent policyComponent)
|
||||
{
|
||||
@@ -129,7 +132,8 @@ public class RecordsManagementActionServiceImpl implements RecordsManagementActi
|
||||
/**
|
||||
* Set the node service
|
||||
*
|
||||
* @param nodeService node service
|
||||
* @param nodeService
|
||||
* node service
|
||||
*/
|
||||
public void setNodeService(NodeService nodeService)
|
||||
{
|
||||
@@ -173,9 +177,12 @@ public class RecordsManagementActionServiceImpl implements RecordsManagementActi
|
||||
/**
|
||||
* Invoke beforeRMActionExecution policy
|
||||
*
|
||||
* @param nodeRef node reference
|
||||
* @param name action name
|
||||
* @param parameters action parameters
|
||||
* @param nodeRef
|
||||
* node reference
|
||||
* @param name
|
||||
* action name
|
||||
* @param parameters
|
||||
* action parameters
|
||||
*/
|
||||
protected void invokeBeforeRMActionExecution(NodeRef nodeRef, String name, Map<String, Serializable> parameters)
|
||||
{
|
||||
@@ -189,9 +196,12 @@ public class RecordsManagementActionServiceImpl implements RecordsManagementActi
|
||||
/**
|
||||
* Invoke onRMActionExecution policy
|
||||
*
|
||||
* @param nodeRef node reference
|
||||
* @param name action name
|
||||
* @param parameters action parameters
|
||||
* @param nodeRef
|
||||
* node reference
|
||||
* @param name
|
||||
* action name
|
||||
* @param parameters
|
||||
* action parameters
|
||||
*/
|
||||
protected void invokeOnRMActionExecution(NodeRef nodeRef, String name, Map<String, Serializable> parameters)
|
||||
{
|
||||
@@ -226,7 +236,8 @@ public class RecordsManagementActionServiceImpl implements RecordsManagementActi
|
||||
/**
|
||||
* Gets the disposition actions for the given node
|
||||
*
|
||||
* @param nodeRef The node reference
|
||||
* @param nodeRef
|
||||
* The node reference
|
||||
* @return List of records management action
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
|
||||
@@ -30,17 +30,18 @@ package org.alfresco.module.org_alfresco_module_rm.action;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.quartz.Job;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
|
||||
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.cmr.repository.StoreRef;
|
||||
import org.alfresco.service.cmr.search.ResultSet;
|
||||
import org.alfresco.service.cmr.search.SearchService;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.quartz.Job;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
|
||||
/**
|
||||
* Scheduled disposition job.
|
||||
@@ -59,80 +60,78 @@ public class ScheduledDispositionJob implements Job
|
||||
*/
|
||||
public void execute(JobExecutionContext context) throws JobExecutionException
|
||||
{
|
||||
RecordsManagementActionService rmActionService
|
||||
= (RecordsManagementActionService)context.getJobDetail().getJobDataMap().get("recordsManagementActionService");
|
||||
NodeService nodeService = (NodeService)context.getJobDetail().getJobDataMap().get("nodeService");
|
||||
RecordsManagementActionService rmActionService = (RecordsManagementActionService) context.getJobDetail().getJobDataMap().get("recordsManagementActionService");
|
||||
NodeService nodeService = (NodeService) context.getJobDetail().getJobDataMap().get("nodeService");
|
||||
|
||||
// Calculate the date range used in the query
|
||||
Calendar cal = Calendar.getInstance();
|
||||
String year = String.valueOf(cal.get(Calendar.YEAR));
|
||||
String month = String.valueOf(cal.get(Calendar.MONTH) + 1);
|
||||
String dayOfMonth = String.valueOf(cal.get(Calendar.DAY_OF_MONTH));
|
||||
|
||||
// Calculate the date range used in the query
|
||||
Calendar cal = Calendar.getInstance();
|
||||
String year = String.valueOf(cal.get(Calendar.YEAR));
|
||||
String month = String.valueOf(cal.get(Calendar.MONTH) + 1);
|
||||
String dayOfMonth = String.valueOf(cal.get(Calendar.DAY_OF_MONTH));
|
||||
// TODO These pad() calls are in RMActionExecuterAbstractBase. I've copied them
|
||||
// here as I have no access to that class.
|
||||
|
||||
//TODO These pad() calls are in RMActionExecuterAbstractBase. I've copied them
|
||||
// here as I have no access to that class.
|
||||
final String currentDate = padString(year, 2) + "-" + padString(month, 2) +
|
||||
"-" + padString(dayOfMonth, 2) + "T00:00:00.00Z";
|
||||
|
||||
final String currentDate = padString(year, 2) + "-" + padString(month, 2) +
|
||||
"-" + padString(dayOfMonth, 2) + "T00:00:00.00Z";
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
StringBuilder msg = new StringBuilder();
|
||||
msg.append("Executing ")
|
||||
.append(this.getClass().getSimpleName())
|
||||
.append(" with currentDate ")
|
||||
.append(currentDate);
|
||||
logger.debug(msg.toString());
|
||||
}
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
StringBuilder msg = new StringBuilder();
|
||||
msg.append("Executing ")
|
||||
.append(this.getClass().getSimpleName())
|
||||
.append(" with currentDate ")
|
||||
.append(currentDate);
|
||||
logger.debug(msg.toString());
|
||||
}
|
||||
// TODO Copied the 1970 start date from the old RM JavaScript impl.
|
||||
String dateRange = "[\"1970-01-01T00:00:00.00Z\" TO \"" + currentDate + "\"]";
|
||||
|
||||
//TODO Copied the 1970 start date from the old RM JavaScript impl.
|
||||
String dateRange = "[\"1970-01-01T00:00:00.00Z\" TO \"" + currentDate + "\"]";
|
||||
// Execute the query and process the results
|
||||
String query = "+ASPECT:\"rma:record\" +ASPECT:\"rma:dispositionSchedule\" +@rma\\:dispositionAsOf:" + dateRange;
|
||||
|
||||
// Execute the query and process the results
|
||||
String query = "+ASPECT:\"rma:record\" +ASPECT:\"rma:dispositionSchedule\" +@rma\\:dispositionAsOf:" + dateRange;
|
||||
SearchService search = (SearchService) context.getJobDetail().getJobDataMap().get("searchService");
|
||||
ResultSet results = search.query(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, SearchService.LANGUAGE_FTS_ALFRESCO, query);
|
||||
|
||||
SearchService search = (SearchService)context.getJobDetail().getJobDataMap().get("searchService");
|
||||
ResultSet results = search.query(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, SearchService.LANGUAGE_FTS_ALFRESCO, query);
|
||||
List<NodeRef> resultNodes = results.getNodeRefs();
|
||||
results.close();
|
||||
|
||||
List<NodeRef> resultNodes = results.getNodeRefs();
|
||||
results.close();
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
StringBuilder msg = new StringBuilder();
|
||||
msg.append("Found ")
|
||||
.append(resultNodes.size())
|
||||
.append(" records eligible for disposition.");
|
||||
logger.debug(msg.toString());
|
||||
}
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
StringBuilder msg = new StringBuilder();
|
||||
msg.append("Found ")
|
||||
.append(resultNodes.size())
|
||||
.append(" records eligible for disposition.");
|
||||
logger.debug(msg.toString());
|
||||
}
|
||||
for (NodeRef node : resultNodes)
|
||||
{
|
||||
String dispActionName = (String) nodeService.getProperty(node, RecordsManagementModel.PROP_DISPOSITION_ACTION_NAME);
|
||||
|
||||
for (NodeRef node : resultNodes )
|
||||
{
|
||||
String dispActionName = (String)nodeService.getProperty(node, RecordsManagementModel.PROP_DISPOSITION_ACTION_NAME);
|
||||
// Only automatically execute "cutoff" actions.
|
||||
// destroy and transfer and anything else should be manual for now
|
||||
if (dispActionName != null && dispActionName.equalsIgnoreCase("cutoff"))
|
||||
{
|
||||
rmActionService.executeRecordsManagementAction(node, dispActionName);
|
||||
|
||||
// Only automatically execute "cutoff" actions.
|
||||
// destroy and transfer and anything else should be manual for now
|
||||
if (dispActionName != null && dispActionName.equalsIgnoreCase("cutoff"))
|
||||
{
|
||||
rmActionService.executeRecordsManagementAction(node, dispActionName);
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("Performing " + dispActionName + " dispoition action on disposable item " + node.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("Performing " + dispActionName + " dispoition action on disposable item " + node.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//TODO This has been pasted out of RMActionExecuterAbstractBase. To be relocated.
|
||||
// TODO This has been pasted out of RMActionExecuterAbstractBase. To be relocated.
|
||||
private String padString(String s, int len)
|
||||
{
|
||||
String result = s;
|
||||
for (int i=0; i<(len - s.length()); i++)
|
||||
for (int i = 0; i < (len - s.length()); i++)
|
||||
{
|
||||
result = "0" + result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,8 @@ public class CustomParameterConstraint extends BaseParameterConstraint
|
||||
/**
|
||||
* Sets the parameter values
|
||||
*
|
||||
* @param parameterValues The parameter values
|
||||
* @param parameterValues
|
||||
* The parameter values
|
||||
*/
|
||||
public void setParameterValues(List<String> parameterValues)
|
||||
{
|
||||
|
||||
@@ -68,5 +68,4 @@ public class DispositionActionParameterConstraint extends BaseParameterConstrain
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -71,5 +71,4 @@ public class ManualEventParameterConstraint extends BaseParameterConstraint
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -64,7 +64,8 @@ public class RecordTypeParameterConstraint extends BaseParameterConstraint
|
||||
private FilePlanService filePlanService;
|
||||
|
||||
/**
|
||||
* @param recordService record service
|
||||
* @param recordService
|
||||
* record service
|
||||
*/
|
||||
public void setRecordService(RecordService recordService)
|
||||
{
|
||||
@@ -72,7 +73,8 @@ public class RecordTypeParameterConstraint extends BaseParameterConstraint
|
||||
}
|
||||
|
||||
/**
|
||||
* @param dictionaryService dictionary service
|
||||
* @param dictionaryService
|
||||
* dictionary service
|
||||
*/
|
||||
public void setDictionaryService(DictionaryService dictionaryService)
|
||||
{
|
||||
@@ -80,7 +82,8 @@ public class RecordTypeParameterConstraint extends BaseParameterConstraint
|
||||
}
|
||||
|
||||
/**
|
||||
* @param filePlanService file plan service
|
||||
* @param filePlanService
|
||||
* file plan service
|
||||
*/
|
||||
public void setFilePlanService(FilePlanService filePlanService)
|
||||
{
|
||||
@@ -92,8 +95,7 @@ public class RecordTypeParameterConstraint extends BaseParameterConstraint
|
||||
*/
|
||||
protected Map<String, String> getAllowableValuesImpl()
|
||||
{
|
||||
return AuthenticationUtil.runAsSystem(new RunAsWork<Map<String, String>>()
|
||||
{
|
||||
return AuthenticationUtil.runAsSystem(new RunAsWork<Map<String, String>>() {
|
||||
@SuppressWarnings("unchecked")
|
||||
public Map<String, String> doWork()
|
||||
{
|
||||
@@ -101,7 +103,7 @@ public class RecordTypeParameterConstraint extends BaseParameterConstraint
|
||||
|
||||
// get the file plan
|
||||
// TODO we will likely have to re-implement as a custom control so that context of the file
|
||||
// plan can be correctly determined when setting the rule up
|
||||
// plan can be correctly determined when setting the rule up
|
||||
NodeRef filePlan = filePlanService.getFilePlanBySiteId(FilePlanService.DEFAULT_RM_SITE_ID);
|
||||
|
||||
if (filePlan != null)
|
||||
|
||||
@@ -47,12 +47,12 @@ import org.alfresco.service.cmr.repository.NodeService;
|
||||
/**
|
||||
* Creates a new record from an existing content object.
|
||||
*
|
||||
* Note: This is a 'normal' dm action, rather than a records management action.
|
||||
* Note: This is a 'normal' dm action, rather than a records management action.
|
||||
*
|
||||
* @author Roy Wetherall
|
||||
*/
|
||||
public class CreateRecordAction extends AuditableActionExecuterAbstractBase
|
||||
implements RecordsManagementModel
|
||||
implements RecordsManagementModel
|
||||
{
|
||||
/** Action name */
|
||||
public static final String NAME = "create-record";
|
||||
@@ -81,7 +81,8 @@ public class CreateRecordAction extends AuditableActionExecuterAbstractBase
|
||||
private RecordService recordService;
|
||||
|
||||
/**
|
||||
* @param nodeService node service
|
||||
* @param nodeService
|
||||
* node service
|
||||
*/
|
||||
public void setNodeService(NodeService nodeService)
|
||||
{
|
||||
@@ -89,7 +90,8 @@ public class CreateRecordAction extends AuditableActionExecuterAbstractBase
|
||||
}
|
||||
|
||||
/**
|
||||
* @param filePlanService file plan service
|
||||
* @param filePlanService
|
||||
* file plan service
|
||||
*/
|
||||
public void setFilePlanService(FilePlanService filePlanService)
|
||||
{
|
||||
@@ -97,16 +99,17 @@ public class CreateRecordAction extends AuditableActionExecuterAbstractBase
|
||||
}
|
||||
|
||||
/**
|
||||
* @param authenticationUtil authentication util
|
||||
* @param authenticationUtil
|
||||
* authentication util
|
||||
*/
|
||||
public void setAuthenticationUtil(AuthenticationUtil authenticationUtil)
|
||||
{
|
||||
this.authenticationUtil = authenticationUtil;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param recordService record service
|
||||
* @param recordService
|
||||
* record service
|
||||
*/
|
||||
public void setRecordService(RecordService recordService)
|
||||
{
|
||||
@@ -157,8 +160,8 @@ public class CreateRecordAction extends AuditableActionExecuterAbstractBase
|
||||
@Override
|
||||
protected void addParameterDefinitions(List<ParameterDefinition> params)
|
||||
{
|
||||
// NOTE: commented out for now so that it doesn't appear in the UI ... enable later when multi-file plan support is added
|
||||
//params.add(new ParameterDefinitionImpl(PARAM_FILE_PLAN, DataTypeDefinition.NODE_REF, false, getParamDisplayLabel(PARAM_FILE_PLAN)));
|
||||
// NOTE: commented out for now so that it doesn't appear in the UI ... enable later when multi-file plan support is added
|
||||
// params.add(new ParameterDefinitionImpl(PARAM_FILE_PLAN, DataTypeDefinition.NODE_REF, false, getParamDisplayLabel(PARAM_FILE_PLAN)));
|
||||
params.add(new ParameterDefinitionImpl(PARAM_PATH, DataTypeDefinition.TEXT, false, getParamDisplayLabel(PARAM_PATH)));
|
||||
params.add(new ParameterDefinitionImpl(PARAM_HIDE_RECORD, DataTypeDefinition.BOOLEAN, false, getParamDisplayLabel(PARAM_HIDE_RECORD)));
|
||||
}
|
||||
|
||||
@@ -31,6 +31,10 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.action.AuditableActionExecuterAbstractBase;
|
||||
@@ -50,19 +54,16 @@ import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||
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;
|
||||
|
||||
/**
|
||||
* Creates a new record from the 'current' document version.
|
||||
*
|
||||
* Note: This is a 'normal' dm action, rather than a records management action.
|
||||
* Note: This is a 'normal' dm action, rather than a records management action.
|
||||
*
|
||||
* @author Roy Wetherall
|
||||
*/
|
||||
public class DeclareAsVersionRecordAction extends AuditableActionExecuterAbstractBase
|
||||
implements RecordsManagementModel
|
||||
implements RecordsManagementModel
|
||||
{
|
||||
/** Logger */
|
||||
private static Log logger = LogFactory.getLog(DeclareAsVersionRecordAction.class);
|
||||
@@ -104,7 +105,8 @@ public class DeclareAsVersionRecordAction extends AuditableActionExecuterAbstrac
|
||||
private CapabilityService capabilityService;
|
||||
|
||||
/**
|
||||
* @param nodeService node service
|
||||
* @param nodeService
|
||||
* node service
|
||||
*/
|
||||
public void setNodeService(NodeService nodeService)
|
||||
{
|
||||
@@ -112,7 +114,8 @@ public class DeclareAsVersionRecordAction extends AuditableActionExecuterAbstrac
|
||||
}
|
||||
|
||||
/**
|
||||
* @param filePlanService file plan service
|
||||
* @param filePlanService
|
||||
* file plan service
|
||||
*/
|
||||
public void setFilePlanService(FilePlanService filePlanService)
|
||||
{
|
||||
@@ -120,7 +123,8 @@ public class DeclareAsVersionRecordAction extends AuditableActionExecuterAbstrac
|
||||
}
|
||||
|
||||
/**
|
||||
* @param dictionaryService dictionary service
|
||||
* @param dictionaryService
|
||||
* dictionary service
|
||||
*/
|
||||
public void setDictionaryService(DictionaryService dictionaryService)
|
||||
{
|
||||
@@ -128,7 +132,8 @@ public class DeclareAsVersionRecordAction extends AuditableActionExecuterAbstrac
|
||||
}
|
||||
|
||||
/**
|
||||
* @param recordableVersionService recordable version service
|
||||
* @param recordableVersionService
|
||||
* recordable version service
|
||||
*/
|
||||
public void setRecordableVersionService(RecordableVersionService recordableVersionService)
|
||||
{
|
||||
@@ -136,7 +141,8 @@ public class DeclareAsVersionRecordAction extends AuditableActionExecuterAbstrac
|
||||
}
|
||||
|
||||
/**
|
||||
* @param authenticationUtil authentication util
|
||||
* @param authenticationUtil
|
||||
* authentication util
|
||||
*/
|
||||
public void setAuthenticationUtil(AuthenticationUtil authenticationUtil)
|
||||
{
|
||||
@@ -144,7 +150,8 @@ public class DeclareAsVersionRecordAction extends AuditableActionExecuterAbstrac
|
||||
}
|
||||
|
||||
/**
|
||||
* @param recordService record service
|
||||
* @param recordService
|
||||
* record service
|
||||
*/
|
||||
public void setRecordService(RecordService recordService)
|
||||
{
|
||||
@@ -152,7 +159,8 @@ public class DeclareAsVersionRecordAction extends AuditableActionExecuterAbstrac
|
||||
}
|
||||
|
||||
/**
|
||||
* @param capabilityService capability service
|
||||
* @param capabilityService
|
||||
* capability service
|
||||
*/
|
||||
public void setCapabilityService(CapabilityService capabilityService)
|
||||
{
|
||||
@@ -183,7 +191,7 @@ public class DeclareAsVersionRecordAction extends AuditableActionExecuterAbstrac
|
||||
}
|
||||
else if (isActionEligible(actionedUponNodeRef))
|
||||
{
|
||||
NodeRef filePlan = (NodeRef)action.getParameterValue(PARAM_FILE_PLAN);
|
||||
NodeRef filePlan = (NodeRef) action.getParameterValue(PARAM_FILE_PLAN);
|
||||
if (filePlan == null)
|
||||
{
|
||||
filePlan = RecordActionUtils.getDefaultFilePlan(authenticationUtil, filePlanService, NAME);
|
||||
@@ -235,12 +243,12 @@ public class DeclareAsVersionRecordAction extends AuditableActionExecuterAbstrac
|
||||
@Override
|
||||
protected void addParameterDefinitions(List<ParameterDefinition> params)
|
||||
{
|
||||
// NOTE: commented out for now so that it doesn't appear in the UI ... enable later when multi-file plan support is added
|
||||
//params.add(new ParameterDefinitionImpl(PARAM_FILE_PLAN, DataTypeDefinition.NODE_REF, false, getParamDisplayLabel(PARAM_FILE_PLAN)));
|
||||
// NOTE: commented out for now so that it doesn't appear in the UI ... enable later when multi-file plan support is added
|
||||
// params.add(new ParameterDefinitionImpl(PARAM_FILE_PLAN, DataTypeDefinition.NODE_REF, false, getParamDisplayLabel(PARAM_FILE_PLAN)));
|
||||
params.add(new ParameterDefinitionImpl(PARAM_PATH, DataTypeDefinition.TEXT, false, getParamDisplayLabel(PARAM_PATH)));
|
||||
}
|
||||
|
||||
/* Check aspects that stop declaring the version as record.*/
|
||||
/* Check aspects that stop declaring the version as record. */
|
||||
private boolean isActionEligible(NodeRef actionedUponNodeRef)
|
||||
{
|
||||
Map<QName, String> mappedAspects = new HashMap<>();
|
||||
|
||||
@@ -37,7 +37,7 @@ import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
|
||||
/**
|
||||
* Executes a JavaScript
|
||||
*
|
||||
* Note: This is a 'normal' dm action, rather than a records management action.
|
||||
* Note: This is a 'normal' dm action, rather than a records management action.
|
||||
*
|
||||
* @author Craig Tan
|
||||
*/
|
||||
|
||||
@@ -29,6 +29,9 @@ package org.alfresco.module.org_alfresco_module_rm.action.dm;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import org.alfresco.module.org_alfresco_module_rm.action.AuditableActionExecuterAbstractBase;
|
||||
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.record.InplaceRecordService;
|
||||
@@ -36,8 +39,6 @@ import org.alfresco.service.cmr.action.Action;
|
||||
import org.alfresco.service.cmr.action.ParameterDefinition;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
/**
|
||||
* Hides a record within a collaboration site.
|
||||
@@ -48,7 +49,7 @@ import org.apache.commons.logging.LogFactory;
|
||||
* @since 2.1
|
||||
*/
|
||||
public class HideRecordAction extends AuditableActionExecuterAbstractBase
|
||||
implements RecordsManagementModel
|
||||
implements RecordsManagementModel
|
||||
{
|
||||
|
||||
/** Logger */
|
||||
@@ -64,7 +65,8 @@ public class HideRecordAction extends AuditableActionExecuterAbstractBase
|
||||
private InplaceRecordService inplaceRecordService;
|
||||
|
||||
/**
|
||||
* @param nodeService node service
|
||||
* @param nodeService
|
||||
* node service
|
||||
*/
|
||||
public void setNodeService(NodeService nodeService)
|
||||
{
|
||||
@@ -72,7 +74,8 @@ public class HideRecordAction extends AuditableActionExecuterAbstractBase
|
||||
}
|
||||
|
||||
/**
|
||||
* @param inplaceRecordService inplace record service
|
||||
* @param inplaceRecordService
|
||||
* inplace record service
|
||||
*/
|
||||
public void setInplaceRecordService(InplaceRecordService inplaceRecordService)
|
||||
{
|
||||
|
||||
@@ -29,6 +29,10 @@ package org.alfresco.module.org_alfresco_module_rm.action.dm;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.module.org_alfresco_module_rm.action.AuditableActionExecuterAbstractBase;
|
||||
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
|
||||
@@ -37,13 +41,9 @@ import org.alfresco.service.cmr.action.Action;
|
||||
import org.alfresco.service.cmr.action.ParameterDefinition;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
/**
|
||||
* Moves a record within a collaboration site.
|
||||
* The record can be moved only within the collaboration site where it was declared.
|
||||
* Moves a record within a collaboration site. The record can be moved only within the collaboration site where it was declared.
|
||||
*
|
||||
* @author Tuna Aksoy
|
||||
* @since 2.3
|
||||
@@ -78,7 +78,8 @@ public class MoveDmRecordAction extends AuditableActionExecuterAbstractBase impl
|
||||
/**
|
||||
* Sets the node service
|
||||
*
|
||||
* @param nodeService Node service
|
||||
* @param nodeService
|
||||
* Node service
|
||||
*/
|
||||
public void setNodeService(NodeService nodeService)
|
||||
{
|
||||
@@ -98,7 +99,8 @@ public class MoveDmRecordAction extends AuditableActionExecuterAbstractBase impl
|
||||
/**
|
||||
* Sets the inplace record service
|
||||
*
|
||||
* @param inplaceRecordService Inplace record service
|
||||
* @param inplaceRecordService
|
||||
* Inplace record service
|
||||
*/
|
||||
public void setInplaceRecordService(InplaceRecordService inplaceRecordService)
|
||||
{
|
||||
@@ -126,7 +128,8 @@ public class MoveDmRecordAction extends AuditableActionExecuterAbstractBase impl
|
||||
/**
|
||||
* Helper method to get the target node reference from the action parameter
|
||||
*
|
||||
* @param action The action
|
||||
* @param action
|
||||
* The action
|
||||
* @return Node reference of the target
|
||||
*/
|
||||
private NodeRef getTargetNodeRef(Action action)
|
||||
|
||||
@@ -29,6 +29,10 @@ package org.alfresco.module.org_alfresco_module_rm.action.dm;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanService;
|
||||
@@ -37,9 +41,6 @@ import org.alfresco.module.org_alfresco_module_rm.util.AuthenticationUtil;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* Utility class containing helper methods for record
|
||||
@@ -54,8 +55,7 @@ public class RecordActionUtils
|
||||
|
||||
/** Private constructor to prevent instantiation. */
|
||||
private RecordActionUtils()
|
||||
{
|
||||
}
|
||||
{}
|
||||
|
||||
static class Services
|
||||
{
|
||||
@@ -89,8 +89,10 @@ public class RecordActionUtils
|
||||
/**
|
||||
* Helper method to get the target record folder node reference from the action path parameter
|
||||
*
|
||||
* @param filePlan The filePlan containing the path
|
||||
* @param pathParameter The path
|
||||
* @param filePlan
|
||||
* The filePlan containing the path
|
||||
* @param pathParameter
|
||||
* The path
|
||||
* @return The NodeRef of the resolved path
|
||||
*/
|
||||
static NodeRef resolvePath(Services services, NodeRef filePlan, final String pathParameter, String actionName)
|
||||
@@ -124,8 +126,10 @@ public class RecordActionUtils
|
||||
/**
|
||||
* Helper method to recursively get the next path element node reference from the action path parameter
|
||||
*
|
||||
* @param parent The parent of the path elements
|
||||
* @param pathElements The path elements still to be resolved
|
||||
* @param parent
|
||||
* The parent of the path elements
|
||||
* @param pathElements
|
||||
* The path elements still to be resolved
|
||||
* @return The NodeRef of the resolved path element
|
||||
*/
|
||||
static NodeRef resolvePath(NodeService nodeService, NodeRef parent, List<String> pathElements, String actionName)
|
||||
@@ -165,8 +169,7 @@ public class RecordActionUtils
|
||||
// if the file plan is still null, raise an exception
|
||||
if (filePlan == null)
|
||||
{
|
||||
final String logMessage =
|
||||
String.format("Unable to execute %s action, because the fileplan path could not be determined. Make sure at least one file plan has been created.", actionName);
|
||||
final String logMessage = String.format("Unable to execute %s action, because the fileplan path could not be determined. Make sure at least one file plan has been created.", actionName);
|
||||
LOGGER.debug(logMessage);
|
||||
throw new AlfrescoRuntimeException(logMessage);
|
||||
}
|
||||
|
||||
@@ -27,15 +27,18 @@
|
||||
|
||||
package org.alfresco.module.org_alfresco_module_rm.action.dm;
|
||||
|
||||
import static org.apache.commons.logging.LogFactory.getLog;
|
||||
|
||||
import static org.alfresco.model.ContentModel.ASPECT_VERSIONABLE;
|
||||
import static org.alfresco.model.ContentModel.TYPE_CONTENT;
|
||||
import static org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel.ASPECT_RECORD;
|
||||
import static org.alfresco.module.org_alfresco_module_rm.version.RecordableVersionModel.PROP_RECORDABLE_VERSION_POLICY;
|
||||
import static org.alfresco.service.cmr.dictionary.DataTypeDefinition.TEXT;
|
||||
import static org.apache.commons.logging.LogFactory.getLog;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
|
||||
import org.alfresco.module.org_alfresco_module_rm.version.RecordableVersionPolicy;
|
||||
import org.alfresco.repo.action.ParameterDefinitionImpl;
|
||||
import org.alfresco.repo.action.executer.ActionExecuterAbstractBase;
|
||||
@@ -45,7 +48,6 @@ import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||
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;
|
||||
|
||||
/**
|
||||
* Sets the recordable version config for a document within a collaboration site.
|
||||
@@ -85,7 +87,8 @@ public class RecordableVersionConfigAction extends ActionExecuterAbstractBase
|
||||
/**
|
||||
* Sets the node service
|
||||
*
|
||||
* @param nodeService The node service
|
||||
* @param nodeService
|
||||
* The node service
|
||||
*/
|
||||
public void setNodeService(NodeService nodeService)
|
||||
{
|
||||
@@ -135,7 +138,8 @@ public class RecordableVersionConfigAction extends ActionExecuterAbstractBase
|
||||
/**
|
||||
* Helper method to do checks on the actioned upon node reference
|
||||
*
|
||||
* @param actionedUponNodeRef The actioned upon node reference
|
||||
* @param actionedUponNodeRef
|
||||
* The actioned upon node reference
|
||||
* @return <code>true</code> if the actioned upon node reference passes the checks, <code>false</code> otherwise
|
||||
*/
|
||||
private boolean passedChecks(NodeRef actionedUponNodeRef)
|
||||
@@ -158,7 +162,7 @@ public class RecordableVersionConfigAction extends ActionExecuterAbstractBase
|
||||
passedChecks = false;
|
||||
if (LOGGER.isDebugEnabled())
|
||||
{
|
||||
String message = buildLogMessage(actionedUponNodeRef, "' because the type of the node '" + type.getLocalName() + "' is not supported.");
|
||||
String message = buildLogMessage(actionedUponNodeRef, "' because the type of the node '" + type.getLocalName() + "' is not supported.");
|
||||
LOGGER.debug(message);
|
||||
}
|
||||
}
|
||||
@@ -189,8 +193,10 @@ public class RecordableVersionConfigAction extends ActionExecuterAbstractBase
|
||||
/**
|
||||
* Helper method to construct log message
|
||||
*
|
||||
* @param actionedUponNodeRef The actioned upon node reference
|
||||
* @param messagePart The message which should be appended.
|
||||
* @param actionedUponNodeRef
|
||||
* The actioned upon node reference
|
||||
* @param messagePart
|
||||
* The message which should be appended.
|
||||
* @return The constructed log message
|
||||
*/
|
||||
private String buildLogMessage(NodeRef actionedUponNodeRef, String messagePart)
|
||||
|
||||
@@ -34,8 +34,7 @@ import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.util.ParameterCheck;
|
||||
|
||||
/**
|
||||
* Records management evaluator base implementation that delegates to a configured capability condition
|
||||
* implementation.
|
||||
* Records management evaluator base implementation that delegates to a configured capability condition implementation.
|
||||
*
|
||||
* @author Roy Wetherall
|
||||
* @since 2.1
|
||||
@@ -46,7 +45,8 @@ public class CapabilityConditionEvaluator extends RecordsManagementActionConditi
|
||||
private CapabilityCondition capabilityCondition;
|
||||
|
||||
/**
|
||||
* @param capabilityCondition capability condition
|
||||
* @param capabilityCondition
|
||||
* capability condition
|
||||
*/
|
||||
public void setCapabilityCondition(CapabilityCondition capabilityCondition)
|
||||
{
|
||||
|
||||
@@ -36,8 +36,7 @@ import org.alfresco.service.cmr.action.ParameterDefinition;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
|
||||
/**
|
||||
* Records management action condition who's implementation is delegated to an existing
|
||||
* action condition.
|
||||
* Records management action condition who's implementation is delegated to an existing action condition.
|
||||
* <p>
|
||||
* Useful for creating a RM version of an existing action condition implementation.
|
||||
*
|
||||
@@ -52,7 +51,8 @@ public class DelegateActionCondition extends RecordsManagementActionConditionEva
|
||||
/**
|
||||
* Sets the action condition evaluator
|
||||
*
|
||||
* @param actionConditionEvaluator The action condition evaluator
|
||||
* @param actionConditionEvaluator
|
||||
* The action condition evaluator
|
||||
*/
|
||||
public void setActionConditionEvaluator(ActionConditionEvaluator actionConditionEvaluator)
|
||||
{
|
||||
|
||||
@@ -41,8 +41,6 @@ import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Records management hasDispositionAction evaluator that evaluates whether the given node's disposition schedule has the specified disposition action.
|
||||
*
|
||||
@@ -65,7 +63,8 @@ public class HasDispositionActionEvaluator extends RecordsManagementActionCondit
|
||||
/**
|
||||
* Sets the disposition service
|
||||
*
|
||||
* @param dispositionService The disposition service
|
||||
* @param dispositionService
|
||||
* The disposition service
|
||||
*/
|
||||
public void setDispositionService(DispositionService dispositionService)
|
||||
{
|
||||
@@ -79,7 +78,6 @@ public class HasDispositionActionEvaluator extends RecordsManagementActionCondit
|
||||
String position = ((QName) actionCondition.getParameterValue(PARAM_DISPOSITION_ACTION_RELATIVE_POSITION)).getLocalName();
|
||||
String action = ((QName) actionCondition.getParameterValue(PARAM_DISPOSITION_ACTION)).getLocalName();
|
||||
|
||||
|
||||
if (dispositionService.isDisposableItem(actionedUponNodeRef))
|
||||
{
|
||||
|
||||
|
||||
@@ -38,8 +38,6 @@ import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Records management IsKind evaluator that evaluates according to the file plan
|
||||
* component kind passed in.
|
||||
@@ -67,9 +65,9 @@ public class IsKindEvaluator extends RecordsManagementActionConditionEvaluatorAb
|
||||
FilePlanComponentKind filePlanComponentKind = getFilePlanService().getFilePlanComponentKind(actionedUponNodeRef);
|
||||
|
||||
if (filePlanComponentKind != null &&
|
||||
filePlanComponentKind.toString().equals(kind))
|
||||
filePlanComponentKind.toString().equals(kind))
|
||||
{
|
||||
result = true;
|
||||
result = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -62,7 +62,8 @@ public class IsRecordTypeEvaluator extends RecordsManagementActionConditionEvalu
|
||||
/**
|
||||
* Sets the node service
|
||||
*
|
||||
* @param nodeService The node service
|
||||
* @param nodeService
|
||||
* The node service
|
||||
*/
|
||||
public void setNodeService(NodeService nodeService)
|
||||
{
|
||||
|
||||
@@ -29,6 +29,10 @@ package org.alfresco.module.org_alfresco_module_rm.action.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
|
||||
import org.alfresco.module.org_alfresco_module_rm.action.RMActionExecuterAbstractBase;
|
||||
import org.alfresco.repo.action.ParameterDefinitionImpl;
|
||||
import org.alfresco.service.cmr.action.Action;
|
||||
@@ -36,9 +40,6 @@ import org.alfresco.service.cmr.action.ParameterDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
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;
|
||||
|
||||
/**
|
||||
* Action to add types to a record
|
||||
@@ -64,8 +65,7 @@ public class AddRecordTypeAction extends RMActionExecuterAbstractBase
|
||||
public static final String NAME = "addRecordTypes";
|
||||
|
||||
/**
|
||||
* @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(org.alfresco.service.cmr.action.Action,
|
||||
* org.alfresco.service.cmr.repository.NodeRef)
|
||||
* @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(org.alfresco.service.cmr.action.Action, org.alfresco.service.cmr.repository.NodeRef)
|
||||
*/
|
||||
@Override
|
||||
protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
|
||||
@@ -84,14 +84,10 @@ public class AddRecordTypeAction extends RMActionExecuterAbstractBase
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method to check the actioned upon node reference to decide to execute the action
|
||||
* The preconditions are:
|
||||
* - The node must exist
|
||||
* - The node must not be frozen
|
||||
* - The node must be record
|
||||
* - The node must not be declared
|
||||
* Helper method to check the actioned upon node reference to decide to execute the action The preconditions are: - The node must exist - The node must not be frozen - The node must be record - The node must not be declared
|
||||
*
|
||||
* @param actionedUponNodeRef node reference
|
||||
* @param actionedUponNodeRef
|
||||
* node reference
|
||||
* @return Return true if the node reference passes all the preconditions for executing the action, false otherwise
|
||||
*/
|
||||
private boolean eligibleForAction(NodeRef actionedUponNodeRef)
|
||||
@@ -110,7 +106,8 @@ public class AddRecordTypeAction extends RMActionExecuterAbstractBase
|
||||
/**
|
||||
* Helper method to get the record types from the action
|
||||
*
|
||||
* @param action The action
|
||||
* @param action
|
||||
* The action
|
||||
* @return An array of record types
|
||||
*/
|
||||
private String[] getRecordTypes(Action action)
|
||||
|
||||
@@ -33,6 +33,10 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.module.org_alfresco_module_rm.action.RMActionExecuterAbstractBase;
|
||||
import org.alfresco.repo.action.ParameterDefinitionImpl;
|
||||
@@ -42,13 +46,9 @@ import org.alfresco.service.cmr.dictionary.AspectDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.PropertyDefinition;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
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;
|
||||
|
||||
/**
|
||||
* This class applies the aspect specified in the spring bean property customTypeAspect.
|
||||
* It is used to apply one of the 4 "custom type" aspects from the DOD 5015 model.
|
||||
* This class applies the aspect specified in the spring bean property customTypeAspect. It is used to apply one of the 4 "custom type" aspects from the DOD 5015 model.
|
||||
*
|
||||
* @author Neil McErlean
|
||||
*/
|
||||
@@ -106,9 +106,7 @@ public class ApplyCustomTypeAction extends RMActionExecuterAbstractBase
|
||||
}
|
||||
|
||||
/**
|
||||
* This method converts a Map of String, Serializable to a Map of QName, Serializable.
|
||||
* To do this, it assumes that each parameter name is a String representing a qname
|
||||
* of the form prefix:localName.
|
||||
* This method converts a Map of String, Serializable to a Map of QName, Serializable. To do this, it assumes that each parameter name is a String representing a qname of the form prefix:localName.
|
||||
*/
|
||||
private Map<QName, Serializable> getPropertyValues(Action action)
|
||||
{
|
||||
|
||||
@@ -35,6 +35,9 @@ import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import org.alfresco.module.org_alfresco_module_rm.action.RMActionExecuterAbstractBase;
|
||||
import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionAction;
|
||||
import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionActionDefinition;
|
||||
@@ -47,13 +50,9 @@ import org.alfresco.service.cmr.action.ParameterDefinition;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.Period;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
/**
|
||||
* Action to implement the consequences of a change to the value of the DispositionActionDefinition
|
||||
* properties. When these properties are changed on a disposition schedule, then any associated
|
||||
* disposition actions may need to be updated as a consequence.
|
||||
* Action to implement the consequences of a change to the value of the DispositionActionDefinition properties. When these properties are changed on a disposition schedule, then any associated disposition actions may need to be updated as a consequence.
|
||||
*
|
||||
* @author Neil McErlean
|
||||
*/
|
||||
@@ -73,8 +72,7 @@ public class BroadcastDispositionActionDefinitionUpdateAction extends RMActionEx
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(org.alfresco.service.cmr.action.Action,
|
||||
* org.alfresco.service.cmr.repository.NodeRef)
|
||||
* @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(org.alfresco.service.cmr.action.Action, org.alfresco.service.cmr.repository.NodeRef)
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
@@ -85,7 +83,7 @@ public class BroadcastDispositionActionDefinitionUpdateAction extends RMActionEx
|
||||
return;
|
||||
}
|
||||
|
||||
List<QName> changedProps = (List<QName>)action.getParameterValue(CHANGED_PROPERTIES);
|
||||
List<QName> changedProps = (List<QName>) action.getParameterValue(CHANGED_PROPERTIES);
|
||||
|
||||
// Navigate up the containment hierarchy to get the record category grandparent and schedule.
|
||||
NodeRef dispositionScheduleNode = getNodeService().getPrimaryParent(actionedUponNodeRef).getParentRef();
|
||||
@@ -120,7 +118,7 @@ public class BroadcastDispositionActionDefinitionUpdateAction extends RMActionEx
|
||||
// has been updated
|
||||
DispositionSchedule itemDs = getDispositionService().getDispositionSchedule(disposableItem);
|
||||
if (itemDs != null &&
|
||||
itemDs.getNodeRef().equals(ds.getNodeRef()))
|
||||
itemDs.getNodeRef().equals(ds.getNodeRef()))
|
||||
{
|
||||
if (getNodeService().hasAspect(disposableItem, ASPECT_DISPOSITION_LIFECYCLE))
|
||||
{
|
||||
@@ -141,7 +139,8 @@ public class BroadcastDispositionActionDefinitionUpdateAction extends RMActionEx
|
||||
/**
|
||||
* Manually update the rolled up search properties
|
||||
*
|
||||
* @param disposableItem disposable item
|
||||
* @param disposableItem
|
||||
* disposable item
|
||||
*/
|
||||
private void rollupSearchProperties(NodeRef disposableItem)
|
||||
{
|
||||
@@ -173,19 +172,21 @@ public class BroadcastDispositionActionDefinitionUpdateAction extends RMActionEx
|
||||
{
|
||||
list.add(event.getEventName());
|
||||
}
|
||||
props.put(PROP_RS_DISPOSITION_EVENTS, (Serializable)list);
|
||||
props.put(PROP_RS_DISPOSITION_EVENTS, (Serializable) list);
|
||||
|
||||
getNodeService().setProperties(disposableItem, props);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Processes all the changes applied to the given disposition
|
||||
* action definition node for the given record or folder node.
|
||||
* Processes all the changes applied to the given disposition action definition node for the given record or folder node.
|
||||
*
|
||||
* @param dispositionActionDef The disposition action definition node
|
||||
* @param changedProps The set of properties changed on the action definition
|
||||
* @param recordOrFolder The record or folder the changes potentially need to be applied to
|
||||
* @param dispositionActionDef
|
||||
* The disposition action definition node
|
||||
* @param changedProps
|
||||
* The set of properties changed on the action definition
|
||||
* @param recordOrFolder
|
||||
* The record or folder the changes potentially need to be applied to
|
||||
*/
|
||||
private void processActionDefinitionChanges(NodeRef dispositionActionDef, List<QName> changedProps, NodeRef recordOrFolder)
|
||||
{
|
||||
@@ -209,22 +210,23 @@ public class BroadcastDispositionActionDefinitionUpdateAction extends RMActionEx
|
||||
|
||||
if (changedProps.contains(PROP_DISPOSITION_ACTION_NAME))
|
||||
{
|
||||
String action = (String)getNodeService().getProperty(dispositionActionDef, PROP_DISPOSITION_ACTION_NAME);
|
||||
String action = (String) getNodeService().getProperty(dispositionActionDef, PROP_DISPOSITION_ACTION_NAME);
|
||||
getNodeService().setProperty(nextAction.getNodeRef(), PROP_DISPOSITION_ACTION, action);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines whether the disposition action definition (step) being
|
||||
* updated has any effect on the given next action
|
||||
* Determines whether the disposition action definition (step) being updated has any effect on the given next action
|
||||
*
|
||||
* @param dispositionActionDef The disposition action definition node
|
||||
* @param nextAction The next disposition action
|
||||
* @param dispositionActionDef
|
||||
* The disposition action definition node
|
||||
* @param nextAction
|
||||
* The next disposition action
|
||||
* @return true if the step change affects the next action
|
||||
*/
|
||||
private boolean doesChangedStepAffectNextAction(NodeRef dispositionActionDef,
|
||||
DispositionAction nextAction)
|
||||
DispositionAction nextAction)
|
||||
{
|
||||
boolean affectsNextAction = false;
|
||||
|
||||
@@ -243,11 +245,12 @@ public class BroadcastDispositionActionDefinitionUpdateAction extends RMActionEx
|
||||
}
|
||||
|
||||
/**
|
||||
* Persists any changes made to the period on the given disposition action
|
||||
* definition on the given next action.
|
||||
* Persists any changes made to the period on the given disposition action definition on the given next action.
|
||||
*
|
||||
* @param dispositionActionDef The disposition action definition node
|
||||
* @param nextAction The next disposition action
|
||||
* @param dispositionActionDef
|
||||
* The disposition action definition node
|
||||
* @param nextAction
|
||||
* The next disposition action
|
||||
*/
|
||||
protected void persistPeriodChanges(NodeRef dispositionActionDef, DispositionAction nextAction)
|
||||
{
|
||||
@@ -258,7 +261,7 @@ public class BroadcastDispositionActionDefinitionUpdateAction extends RMActionEx
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("Set disposition as of date for next action '" + nextAction.getName() +
|
||||
"' (" + nextAction.getNodeRef() + ") to: " + newAsOfDate);
|
||||
"' (" + nextAction.getNodeRef() + ") to: " + newAsOfDate);
|
||||
}
|
||||
|
||||
getNodeService().setProperty(nextAction.getNodeRef(), PROP_DISPOSITION_AS_OF, newAsOfDate);
|
||||
|
||||
@@ -44,8 +44,7 @@ public class CloseRecordFolderAction extends RMActionExecuterAbstractBase
|
||||
public static final String PARAM_CLOSE_PARENT = "closeParent";
|
||||
|
||||
/**
|
||||
* @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(org.alfresco.service.cmr.action.Action,
|
||||
* org.alfresco.service.cmr.repository.NodeRef)
|
||||
* @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(org.alfresco.service.cmr.action.Action, org.alfresco.service.cmr.repository.NodeRef)
|
||||
*/
|
||||
@Override
|
||||
protected void executeImpl(Action action, final NodeRef actionedUponNodeRef)
|
||||
@@ -53,8 +52,7 @@ public class CloseRecordFolderAction extends RMActionExecuterAbstractBase
|
||||
if (eligibleForAction(actionedUponNodeRef))
|
||||
{
|
||||
// do the work of creating the record as the system user
|
||||
AuthenticationUtil.runAsSystem(new RunAsWork<Void>()
|
||||
{
|
||||
AuthenticationUtil.runAsSystem(new RunAsWork<Void>() {
|
||||
@Override
|
||||
public Void doWork()
|
||||
{
|
||||
@@ -67,12 +65,10 @@ public class CloseRecordFolderAction extends RMActionExecuterAbstractBase
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method to check the actioned upon node reference to decide to execute the action
|
||||
* The preconditions are:
|
||||
* - The node must exist
|
||||
* - The node must not be frozen
|
||||
* Helper method to check the actioned upon node reference to decide to execute the action The preconditions are: - The node must exist - The node must not be frozen
|
||||
*
|
||||
* @param actionedUponNodeRef node reference
|
||||
* @param actionedUponNodeRef
|
||||
* node reference
|
||||
* @return Return true if the node reference passes all the preconditions for executing the action, false otherwise
|
||||
*/
|
||||
private boolean eligibleForAction(NodeRef actionedUponNodeRef)
|
||||
|
||||
@@ -50,7 +50,7 @@ public class CompleteEventAction extends RMActionExecuterAbstractBase
|
||||
public static final String NAME = "completeEvent";
|
||||
|
||||
/** action parameter names */
|
||||
public static final String PARAM_EVENT_NAME = "eventName";
|
||||
public static final String PARAM_EVENT_NAME = "eventName";
|
||||
public static final String PARAM_EVENT_COMPLETED_BY = "eventCompletedBy";
|
||||
public static final String PARAM_EVENT_COMPLETED_AT = "eventCompletedAt";
|
||||
|
||||
@@ -61,27 +61,26 @@ public class CompleteEventAction extends RMActionExecuterAbstractBase
|
||||
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
|
||||
{
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_EVENT_NAME,
|
||||
DataTypeDefinition.TEXT,
|
||||
true,
|
||||
getParamDisplayLabel(PARAM_EVENT_NAME),
|
||||
false,
|
||||
"rm-ac-manual-events"));
|
||||
DataTypeDefinition.TEXT,
|
||||
true,
|
||||
getParamDisplayLabel(PARAM_EVENT_NAME),
|
||||
false,
|
||||
"rm-ac-manual-events"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(org.alfresco.service.cmr.action.Action,
|
||||
* org.alfresco.service.cmr.repository.NodeRef)
|
||||
* @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(org.alfresco.service.cmr.action.Action, org.alfresco.service.cmr.repository.NodeRef)
|
||||
*/
|
||||
@Override
|
||||
protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
|
||||
{
|
||||
if (getNodeService().exists(actionedUponNodeRef) &&
|
||||
!getFreezeService().isFrozen(actionedUponNodeRef))
|
||||
!getFreezeService().isFrozen(actionedUponNodeRef))
|
||||
{
|
||||
/** get parameter values */
|
||||
String eventName = (String)action.getParameterValue(PARAM_EVENT_NAME);
|
||||
String eventCompletedBy = (String)action.getParameterValue(PARAM_EVENT_COMPLETED_BY);
|
||||
Date eventCompletedAt = (Date)action.getParameterValue(PARAM_EVENT_COMPLETED_AT);
|
||||
String eventName = (String) action.getParameterValue(PARAM_EVENT_NAME);
|
||||
String eventCompletedBy = (String) action.getParameterValue(PARAM_EVENT_COMPLETED_BY);
|
||||
Date eventCompletedAt = (Date) action.getParameterValue(PARAM_EVENT_COMPLETED_AT);
|
||||
|
||||
if (this.getNodeService().hasAspect(actionedUponNodeRef, ASPECT_DISPOSITION_LIFECYCLE))
|
||||
{
|
||||
|
||||
@@ -30,6 +30,10 @@ package org.alfresco.module.org_alfresco_module_rm.action.impl;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.action.RMActionExecuterAbstractBase;
|
||||
@@ -46,9 +50,6 @@ import org.alfresco.service.cmr.model.FileFolderService;
|
||||
import org.alfresco.service.cmr.model.FileNotFoundException;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* File To action implementation.
|
||||
@@ -93,7 +94,8 @@ public abstract class CopyMoveLinkFileToBaseAction extends RMActionExecuterAbstr
|
||||
/**
|
||||
* Sets the action mode
|
||||
*
|
||||
* @param mode Action mode
|
||||
* @param mode
|
||||
* Action mode
|
||||
*/
|
||||
protected void setMode(CopyMoveLinkFileToActionMode mode)
|
||||
{
|
||||
@@ -101,7 +103,8 @@ public abstract class CopyMoveLinkFileToBaseAction extends RMActionExecuterAbstr
|
||||
}
|
||||
|
||||
/**
|
||||
* @param fileFolderService file folder service
|
||||
* @param fileFolderService
|
||||
* file folder service
|
||||
*/
|
||||
public void setFileFolderService(FileFolderService fileFolderService)
|
||||
{
|
||||
@@ -109,7 +112,8 @@ public abstract class CopyMoveLinkFileToBaseAction extends RMActionExecuterAbstr
|
||||
}
|
||||
|
||||
/**
|
||||
* @param filePlanService file plan service
|
||||
* @param filePlanService
|
||||
* file plan service
|
||||
*/
|
||||
public void setFilePlanService(FilePlanService filePlanService)
|
||||
{
|
||||
@@ -149,7 +153,7 @@ public abstract class CopyMoveLinkFileToBaseAction extends RMActionExecuterAbstr
|
||||
}
|
||||
|
||||
// first look to see if the destination record folder has been specified
|
||||
NodeRef recordFolder = (NodeRef)action.getParameterValue(PARAM_DESTINATION_RECORD_FOLDER);
|
||||
NodeRef recordFolder = (NodeRef) action.getParameterValue(PARAM_DESTINATION_RECORD_FOLDER);
|
||||
if (recordFolder == null)
|
||||
{
|
||||
recordFolder = createOrResolvePath(action, actionedUponNodeRef, targetIsUnfiledRecords);
|
||||
@@ -159,8 +163,7 @@ public abstract class CopyMoveLinkFileToBaseAction extends RMActionExecuterAbstr
|
||||
validateActionPostPathResolution(actionedUponNodeRef, recordFolder, actionName, targetIsUnfiledRecords);
|
||||
|
||||
final NodeRef finalRecordFolder = recordFolder;
|
||||
AuthenticationUtil.runAsSystem(new RunAsWork<Void>()
|
||||
{
|
||||
AuthenticationUtil.runAsSystem(new RunAsWork<Void>() {
|
||||
@Override
|
||||
public Void doWork()
|
||||
{
|
||||
@@ -201,23 +204,23 @@ public abstract class CopyMoveLinkFileToBaseAction extends RMActionExecuterAbstr
|
||||
{
|
||||
// Check that the incoming parameters are valid prior to performing any action
|
||||
boolean okToProceed = false;
|
||||
if(getNodeService().exists(actionedUponNodeRef) && !getFreezeService().isFrozen(actionedUponNodeRef))
|
||||
if (getNodeService().exists(actionedUponNodeRef) && !getFreezeService().isFrozen(actionedUponNodeRef))
|
||||
{
|
||||
QName actionedUponType = getNodeService().getType(actionedUponNodeRef);
|
||||
if(ACTION_FILETO.equals(actionName))
|
||||
if (ACTION_FILETO.equals(actionName))
|
||||
{
|
||||
// file to action can only be performed on unfiled records
|
||||
okToProceed = !getRecordService().isFiled(actionedUponNodeRef) && getDictionaryService().isSubClass(actionedUponType, ContentModel.TYPE_CONTENT);
|
||||
if(!okToProceed && logger.isDebugEnabled())
|
||||
if (!okToProceed && logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("Unable to run " + actionName + " action on a node that isn't unfiled and a sub-class of content type");
|
||||
}
|
||||
}
|
||||
else if(ACTION_LINKTO.equals(actionName))
|
||||
else if (ACTION_LINKTO.equals(actionName))
|
||||
{
|
||||
// link to action can only be performed on filed records
|
||||
okToProceed = getRecordService().isFiled(actionedUponNodeRef) && getDictionaryService().isSubClass(actionedUponType, ContentModel.TYPE_CONTENT);
|
||||
if(!okToProceed && logger.isDebugEnabled())
|
||||
if (!okToProceed && logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("Unable to run " + actionName + " action on a node that isn't filed and a sub-class of content type");
|
||||
}
|
||||
@@ -246,21 +249,21 @@ public abstract class CopyMoveLinkFileToBaseAction extends RMActionExecuterAbstr
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Unable to run " + actionName + " action, because the destination record folder could not be determined.");
|
||||
}
|
||||
if(targetIsUnfiledRecords)
|
||||
if (targetIsUnfiledRecords)
|
||||
{
|
||||
QName targetFolderType = getNodeService().getType(target);
|
||||
if(!TYPE_UNFILED_RECORD_CONTAINER.equals(targetFolderType) && !TYPE_UNFILED_RECORD_FOLDER.equals(targetFolderType))
|
||||
if (!TYPE_UNFILED_RECORD_CONTAINER.equals(targetFolderType) && !TYPE_UNFILED_RECORD_FOLDER.equals(targetFolderType))
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Unable to run " + actionName + " action, because the destination record folder is an inappropriate type.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(getRecordFolderService().isRecordFolder(target) && !getDictionaryService().isSubClass(actionedUponType, ContentModel.TYPE_CONTENT) && (getRecordFolderService().isRecordFolder(actionedUponNodeRef) || filePlanService.isRecordCategory(actionedUponNodeRef)))
|
||||
if (getRecordFolderService().isRecordFolder(target) && !getDictionaryService().isSubClass(actionedUponType, ContentModel.TYPE_CONTENT) && (getRecordFolderService().isRecordFolder(actionedUponNodeRef) || filePlanService.isRecordCategory(actionedUponNodeRef)))
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Unable to run " + actionName + " action, because the destination record folder is an inappropriate type. A record folder cannot contain another folder or a category");
|
||||
}
|
||||
else if(filePlanService.isRecordCategory(target) && getDictionaryService().isSubClass(actionedUponType, ContentModel.TYPE_CONTENT))
|
||||
else if (filePlanService.isRecordCategory(target) && getDictionaryService().isSubClass(actionedUponType, ContentModel.TYPE_CONTENT))
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Unable to run " + actionName + " action, because the destination record folder is an inappropriate type. A record category cannot contain a record");
|
||||
}
|
||||
@@ -272,7 +275,8 @@ public abstract class CopyMoveLinkFileToBaseAction extends RMActionExecuterAbstr
|
||||
*
|
||||
* @param action
|
||||
* @param actionedUponNodeRef
|
||||
* @param targetisUnfiledRecords true is the target is in unfiled records
|
||||
* @param targetisUnfiledRecords
|
||||
* true is the target is in unfiled records
|
||||
* @return
|
||||
*/
|
||||
private NodeRef createOrResolvePath(final Action action, final NodeRef actionedUponNodeRef, final boolean targetisUnfiledRecords)
|
||||
@@ -282,19 +286,18 @@ public abstract class CopyMoveLinkFileToBaseAction extends RMActionExecuterAbstr
|
||||
NodeRef path = context;
|
||||
|
||||
// get the path we wish to resolve
|
||||
String pathParameter = (String)action.getParameterValue(PARAM_PATH);
|
||||
String pathParameter = (String) action.getParameterValue(PARAM_PATH);
|
||||
final String[] pathElementsArray = StringUtils.tokenizeToStringArray(pathParameter, "/", false, true);
|
||||
if((pathElementsArray != null) && (pathElementsArray.length > 0))
|
||||
if ((pathElementsArray != null) && (pathElementsArray.length > 0))
|
||||
{
|
||||
// get the create parameter
|
||||
Boolean createValue = (Boolean)action.getParameterValue(PARAM_CREATE_RECORD_PATH);
|
||||
Boolean createValue = (Boolean) action.getParameterValue(PARAM_CREATE_RECORD_PATH);
|
||||
final boolean create = createValue == null ? false : createValue.booleanValue();
|
||||
QName type = getNodeService().getType(actionedUponNodeRef);
|
||||
final boolean isRecord = getDictionaryService().isSubClass(type, ContentModel.TYPE_CONTENT);
|
||||
|
||||
// create or resolve the specified path
|
||||
path = getTransactionService().getRetryingTransactionHelper().doInTransaction(new RetryingTransactionHelper.RetryingTransactionCallback<NodeRef>()
|
||||
{
|
||||
path = getTransactionService().getRetryingTransactionHelper().doInTransaction(new RetryingTransactionHelper.RetryingTransactionCallback<NodeRef>() {
|
||||
public NodeRef execute() throws Throwable
|
||||
{
|
||||
return createOrResolvePath(action, context, actionedUponNodeRef, isRecord, Arrays.asList(pathElementsArray), targetisUnfiledRecords, create, false);
|
||||
@@ -307,14 +310,22 @@ public abstract class CopyMoveLinkFileToBaseAction extends RMActionExecuterAbstr
|
||||
/**
|
||||
* Create or resolve the specified path
|
||||
*
|
||||
* @param action Action to use for reporting if anything goes wrong
|
||||
* @param parent Parent of path to be created
|
||||
* @param actionedUponNodeRef The node subject to the file/move/copy action
|
||||
* @param isRecord true if node is a CONTENT SubType
|
||||
* @param pathElements The elements of the path to be created
|
||||
* @param targetisUnfiledRecords true if the target is within unfiled records
|
||||
* @param create true if the path should be creeated if it does not exist
|
||||
* @param creating true if we have already created the parent and therefore can skip the check to see if the next path element already exists
|
||||
* @param action
|
||||
* Action to use for reporting if anything goes wrong
|
||||
* @param parent
|
||||
* Parent of path to be created
|
||||
* @param actionedUponNodeRef
|
||||
* The node subject to the file/move/copy action
|
||||
* @param isRecord
|
||||
* true if node is a CONTENT SubType
|
||||
* @param pathElements
|
||||
* The elements of the path to be created
|
||||
* @param targetisUnfiledRecords
|
||||
* true if the target is within unfiled records
|
||||
* @param create
|
||||
* true if the path should be creeated if it does not exist
|
||||
* @param creating
|
||||
* true if we have already created the parent and therefore can skip the check to see if the next path element already exists
|
||||
* @return
|
||||
*/
|
||||
private NodeRef createOrResolvePath(Action action, NodeRef parent, NodeRef actionedUponNodeRef, boolean isRecord, List<String> pathElements, boolean targetisUnfiledRecords, boolean create, boolean creating)
|
||||
@@ -322,13 +333,13 @@ public abstract class CopyMoveLinkFileToBaseAction extends RMActionExecuterAbstr
|
||||
NodeRef nodeRef = null;
|
||||
String childName = pathElements.get(0);
|
||||
boolean lastPathElement = pathElements.size() == 1;
|
||||
if(!creating)
|
||||
if (!creating)
|
||||
{
|
||||
nodeRef = getChild(parent, childName);
|
||||
}
|
||||
if(nodeRef == null)
|
||||
if (nodeRef == null)
|
||||
{
|
||||
if(create)
|
||||
if (create)
|
||||
{
|
||||
creating = true;
|
||||
boolean lastAsFolder = lastPathElement && isRecord;
|
||||
@@ -342,14 +353,14 @@ public abstract class CopyMoveLinkFileToBaseAction extends RMActionExecuterAbstr
|
||||
else
|
||||
{
|
||||
QName nodeType = getNodeService().getType(nodeRef);
|
||||
if(nodeType.equals(RecordsManagementModel.TYPE_HOLD_CONTAINER) ||
|
||||
if (nodeType.equals(RecordsManagementModel.TYPE_HOLD_CONTAINER) ||
|
||||
nodeType.equals(RecordsManagementModel.TYPE_TRANSFER_CONTAINER) ||
|
||||
nodeType.equals(RecordsManagementModel.TYPE_UNFILED_RECORD_CONTAINER))
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Unable to execute " + action.getActionDefinitionName() + " action, because the destination path in invalid.");
|
||||
}
|
||||
}
|
||||
if(pathElements.size() > 1)
|
||||
if (pathElements.size() > 1)
|
||||
{
|
||||
nodeRef = createOrResolvePath(action, nodeRef, actionedUponNodeRef, isRecord, pathElements.subList(1, pathElements.size()), targetisUnfiledRecords, create, creating);
|
||||
}
|
||||
@@ -371,11 +382,16 @@ public abstract class CopyMoveLinkFileToBaseAction extends RMActionExecuterAbstr
|
||||
/**
|
||||
* Create the specified child of the specified parent
|
||||
*
|
||||
* @param action Action to use for reporting if anything goes wrong
|
||||
* @param parent Parent of the child to be created
|
||||
* @param childName The name of the child to be created
|
||||
* @param targetisUnfiledRecords true if the child is being created in the unfiled directory (determines type as unfiled container child)
|
||||
* @param lastAsFolder true if this is the last element of the pathe being created and it should be created as a folder. ignored if targetIsUnfiledRecords is true
|
||||
* @param action
|
||||
* Action to use for reporting if anything goes wrong
|
||||
* @param parent
|
||||
* Parent of the child to be created
|
||||
* @param childName
|
||||
* The name of the child to be created
|
||||
* @param targetisUnfiledRecords
|
||||
* true if the child is being created in the unfiled directory (determines type as unfiled container child)
|
||||
* @param lastAsFolder
|
||||
* true if this is the last element of the pathe being created and it should be created as a folder. ignored if targetIsUnfiledRecords is true
|
||||
* @return
|
||||
*/
|
||||
private NodeRef createChild(final Action action, final NodeRef parent, final String childName, final boolean targetisUnfiledRecords, final boolean lastAsFolder)
|
||||
@@ -420,11 +436,11 @@ public abstract class CopyMoveLinkFileToBaseAction extends RMActionExecuterAbstr
|
||||
private NodeRef getContext(Action action, NodeRef actionedUponNodeRef, boolean targetisUnfiledRecords)
|
||||
{
|
||||
NodeRef context = filePlanService.getFilePlan(actionedUponNodeRef);
|
||||
if(targetisUnfiledRecords && (context != null) && getNodeService().exists(context))
|
||||
if (targetisUnfiledRecords && (context != null) && getNodeService().exists(context))
|
||||
{
|
||||
context = filePlanService.getUnfiledContainer(context);
|
||||
}
|
||||
if((context == null) || (!getNodeService().exists(context)))
|
||||
if ((context == null) || (!getNodeService().exists(context)))
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Unable to execute " + action.getActionDefinitionName() + " action, because the path resolution context could not be determined.");
|
||||
}
|
||||
|
||||
@@ -27,12 +27,13 @@
|
||||
|
||||
package org.alfresco.module.org_alfresco_module_rm.action.impl;
|
||||
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.module.org_alfresco_module_rm.action.RMActionExecuterAbstractBase;
|
||||
import org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanService;
|
||||
import org.alfresco.service.cmr.action.Action;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
|
||||
/**
|
||||
* Create disposition schedule action
|
||||
@@ -48,12 +49,13 @@ public class CreateDispositionScheduleAction extends RMActionExecuterAbstractBas
|
||||
private FilePlanService filePlanService;
|
||||
|
||||
/**
|
||||
* @param filePlanService file plan service
|
||||
* @param filePlanService
|
||||
* file plan service
|
||||
*/
|
||||
public void setFilePlanService(FilePlanService filePlanService)
|
||||
{
|
||||
this.filePlanService = filePlanService;
|
||||
}
|
||||
this.filePlanService = filePlanService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(org.alfresco.service.cmr.action.Action, org.alfresco.service.cmr.repository.NodeRef)
|
||||
@@ -73,12 +75,10 @@ public class CreateDispositionScheduleAction extends RMActionExecuterAbstractBas
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method to check the actioned upon node reference to decide to execute the action
|
||||
* The preconditions are:
|
||||
* - The node must exist
|
||||
* - The node must not be a record category
|
||||
* Helper method to check the actioned upon node reference to decide to execute the action The preconditions are: - The node must exist - The node must not be a record category
|
||||
*
|
||||
* @param actionedUponNodeRef node reference
|
||||
* @param actionedUponNodeRef
|
||||
* node reference
|
||||
* @return Return true if the node reference passes all the preconditions for executing the action, false otherwise
|
||||
*/
|
||||
private boolean eligibleForAction(NodeRef actionedUponNodeRef)
|
||||
|
||||
@@ -48,7 +48,7 @@ public class CutOffAction extends RMDispositionActionExecuterAbstractBase
|
||||
@Override
|
||||
protected void executeRecordFolderLevelDisposition(Action action, NodeRef recordFolder)
|
||||
{
|
||||
if(checkUncutOffStatus(action, recordFolder))
|
||||
if (checkUncutOffStatus(action, recordFolder))
|
||||
{
|
||||
// Mark the folder as cut off
|
||||
getDispositionService().cutoffDisposableItem(recordFolder);
|
||||
@@ -61,7 +61,7 @@ public class CutOffAction extends RMDispositionActionExecuterAbstractBase
|
||||
@Override
|
||||
protected void executeRecordLevelDisposition(Action action, NodeRef record)
|
||||
{
|
||||
if(checkUncutOffStatus(action, record))
|
||||
if (checkUncutOffStatus(action, record))
|
||||
{
|
||||
// Mark the record as cut off
|
||||
getDispositionService().cutoffDisposableItem(record);
|
||||
@@ -69,20 +69,20 @@ public class CutOffAction extends RMDispositionActionExecuterAbstractBase
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the record or folder has been uncut off. If it has and this cut off action is an
|
||||
* automated disposition action then the cut off isn't run. If it has and this is a manual
|
||||
* cut off action then the uncut off aspect is removed prior to the uncut action.
|
||||
* Check if the record or folder has been uncut off. If it has and this cut off action is an automated disposition action then the cut off isn't run. If it has and this is a manual cut off action then the uncut off aspect is removed prior to the uncut action.
|
||||
*
|
||||
* @param action The cut off action
|
||||
* @param recordOrFolder The record or folder to be cut off
|
||||
* @param action
|
||||
* The cut off action
|
||||
* @param recordOrFolder
|
||||
* The record or folder to be cut off
|
||||
* @return True if the record or folder can be cut off
|
||||
*/
|
||||
private boolean checkUncutOffStatus(Action action, NodeRef recordOrFolder)
|
||||
{
|
||||
boolean okToCutOff = true;
|
||||
if(getNodeService().hasAspect(recordOrFolder, ASPECT_UNCUT_OFF))
|
||||
if (getNodeService().hasAspect(recordOrFolder, ASPECT_UNCUT_OFF))
|
||||
{
|
||||
if(action.getParameterValue(PARAM_NO_ERROR_CHECK) != null)
|
||||
if (action.getParameterValue(PARAM_NO_ERROR_CHECK) != null)
|
||||
{
|
||||
// this exception stops the cut off disposition schedule action taking place and because we're
|
||||
// running from the schedule (PARAM_NO_ERROR_CHECK is set) then the exception will not be reported
|
||||
@@ -95,4 +95,4 @@ public class CutOffAction extends RMDispositionActionExecuterAbstractBase
|
||||
}
|
||||
return okToCutOff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,7 +54,8 @@ public class DeclareRecordAction extends RMActionExecuterAbstractBase
|
||||
/**
|
||||
* Sets the record service
|
||||
*
|
||||
* @param recordService record service
|
||||
* @param recordService
|
||||
* record service
|
||||
*/
|
||||
public void setRecordService(RecordService recordService)
|
||||
{
|
||||
|
||||
@@ -45,14 +45,15 @@ import org.alfresco.service.cmr.repository.NodeRef;
|
||||
*/
|
||||
public class DelegateAction extends RMActionExecuterAbstractBase
|
||||
{
|
||||
/** Delegate action executer*/
|
||||
/** Delegate action executer */
|
||||
private ActionExecuter delegateActionExecuter;
|
||||
|
||||
/** should we check whether the node is frozen */
|
||||
private boolean checkFrozen = false;
|
||||
|
||||
/**
|
||||
* @param delegateActionExecuter delegate action executer
|
||||
* @param delegateActionExecuter
|
||||
* delegate action executer
|
||||
*/
|
||||
public void setDelegateAction(ActionExecuter delegateActionExecuter)
|
||||
{
|
||||
@@ -60,7 +61,8 @@ public class DelegateAction extends RMActionExecuterAbstractBase
|
||||
}
|
||||
|
||||
/**
|
||||
* @param checkFrozen true if we check whether the actioned upon node reference is frozen, false otherwise
|
||||
* @param checkFrozen
|
||||
* true if we check whether the actioned upon node reference is frozen, false otherwise
|
||||
*/
|
||||
public void setCheckFrozen(boolean checkFrozen)
|
||||
{
|
||||
@@ -74,12 +76,12 @@ public class DelegateAction extends RMActionExecuterAbstractBase
|
||||
protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
|
||||
{
|
||||
if (getNodeService().exists(actionedUponNodeRef) &&
|
||||
(!checkFrozen || !getFreezeService().isFrozen(actionedUponNodeRef)))
|
||||
(!checkFrozen || !getFreezeService().isFrozen(actionedUponNodeRef)))
|
||||
{
|
||||
// do the property subs (if any exist)
|
||||
if (isAllowParameterSubstitutions())
|
||||
{
|
||||
getParameterProcessorComponent().process(action, delegateActionExecuter.getActionDefinition(), actionedUponNodeRef);
|
||||
getParameterProcessorComponent().process(action, delegateActionExecuter.getActionDefinition(), actionedUponNodeRef);
|
||||
}
|
||||
|
||||
delegateActionExecuter.execute(action, actionedUponNodeRef);
|
||||
|
||||
@@ -56,7 +56,7 @@ public class DeleteHoldAction extends RMActionExecuterAbstractBase
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new AlfrescoRuntimeException(MSG_DELETE_NOT_HOLD_TYPE, new Object[]{ TYPE_HOLD.toString(), actionedUponNodeRef.toString() });
|
||||
throw new AlfrescoRuntimeException(MSG_DELETE_NOT_HOLD_TYPE, new Object[]{TYPE_HOLD.toString(), actionedUponNodeRef.toString()});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,6 +31,8 @@ import java.io.Serializable;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import org.alfresco.module.org_alfresco_module_rm.action.RMDispositionActionExecuterAbstractBase;
|
||||
import org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.content.ContentDestructionComponent;
|
||||
@@ -43,7 +45,6 @@ import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.security.AccessStatus;
|
||||
import org.alfresco.service.cmr.version.Version;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
/**
|
||||
* Destroy action.
|
||||
@@ -71,7 +72,8 @@ public class DestroyAction extends RMDispositionActionExecuterAbstractBase
|
||||
private boolean ghostingEnabled = true;
|
||||
|
||||
/**
|
||||
* @param contentDestructionComponent content destruction component
|
||||
* @param contentDestructionComponent
|
||||
* content destruction component
|
||||
*/
|
||||
public void setContentDestructionComponent(ContentDestructionComponent contentDestructionComponent)
|
||||
{
|
||||
@@ -79,7 +81,8 @@ public class DestroyAction extends RMDispositionActionExecuterAbstractBase
|
||||
}
|
||||
|
||||
/**
|
||||
* @param capabilityService capability service
|
||||
* @param capabilityService
|
||||
* capability service
|
||||
*/
|
||||
public void setCapabilityService(CapabilityService capabilityService)
|
||||
{
|
||||
@@ -87,7 +90,8 @@ public class DestroyAction extends RMDispositionActionExecuterAbstractBase
|
||||
}
|
||||
|
||||
/**
|
||||
* @param recordableVersionService recordable version service
|
||||
* @param recordableVersionService
|
||||
* recordable version service
|
||||
*/
|
||||
public void setRecordableVersionService(RecordableVersionService recordableVersionService)
|
||||
{
|
||||
@@ -95,7 +99,8 @@ public class DestroyAction extends RMDispositionActionExecuterAbstractBase
|
||||
}
|
||||
|
||||
/**
|
||||
* @param inplaceRecordService inplace record service
|
||||
* @param inplaceRecordService
|
||||
* inplace record service
|
||||
*/
|
||||
public void setInplaceRecordService(InplaceRecordService inplaceRecordService)
|
||||
{
|
||||
@@ -103,7 +108,8 @@ public class DestroyAction extends RMDispositionActionExecuterAbstractBase
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ghostingEnabled true if ghosting is enabled, false otherwise
|
||||
* @param ghostingEnabled
|
||||
* true if ghosting is enabled, false otherwise
|
||||
*/
|
||||
public void setGhostingEnabled(boolean ghostingEnabled)
|
||||
{
|
||||
@@ -198,8 +204,7 @@ public class DestroyAction extends RMDispositionActionExecuterAbstractBase
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if the ghost on destroy property is set against the
|
||||
* definition for the passed action on the specified node
|
||||
* Return true if the ghost on destroy property is set against the definition for the passed action on the specified node
|
||||
*
|
||||
* @param action
|
||||
* @param nodeRef
|
||||
|
||||
@@ -29,12 +29,13 @@ package org.alfresco.module.org_alfresco_module_rm.action.impl;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.module.org_alfresco_module_rm.action.RMActionExecuterAbstractBase;
|
||||
import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionAction;
|
||||
import org.alfresco.service.cmr.action.Action;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
|
||||
/**
|
||||
* Edit review as of date action.
|
||||
@@ -54,8 +55,7 @@ public class EditDispositionActionAsOfDateAction extends RMActionExecuterAbstrac
|
||||
public static final String PARAM_AS_OF_DATE = "asOfDate";
|
||||
|
||||
/**
|
||||
* @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(org.alfresco.service.cmr.action.Action,
|
||||
* org.alfresco.service.cmr.repository.NodeRef)
|
||||
* @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(org.alfresco.service.cmr.action.Action, org.alfresco.service.cmr.repository.NodeRef)
|
||||
*/
|
||||
@Override
|
||||
protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
|
||||
@@ -63,7 +63,7 @@ public class EditDispositionActionAsOfDateAction extends RMActionExecuterAbstrac
|
||||
if (this.getNodeService().hasAspect(actionedUponNodeRef, ASPECT_DISPOSITION_LIFECYCLE))
|
||||
{
|
||||
// Get the action parameter
|
||||
Date asOfDate = (Date)action.getParameterValue(PARAM_AS_OF_DATE);
|
||||
Date asOfDate = (Date) action.getParameterValue(PARAM_AS_OF_DATE);
|
||||
if (asOfDate == null)
|
||||
{
|
||||
throw new AlfrescoRuntimeException(I18NUtil.getMessage(MSG_VALID_DATE_DISP_ASOF));
|
||||
|
||||
@@ -27,12 +27,13 @@
|
||||
|
||||
package org.alfresco.module.org_alfresco_module_rm.action.impl;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.module.org_alfresco_module_rm.action.RMActionExecuterAbstractBase;
|
||||
import org.alfresco.service.cmr.action.Action;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
|
||||
/**
|
||||
* Edit freeze reason Action
|
||||
@@ -41,34 +42,34 @@ import org.springframework.extensions.surf.util.I18NUtil;
|
||||
*/
|
||||
public class EditHoldReasonAction extends RMActionExecuterAbstractBase
|
||||
{
|
||||
private static final String MSG_HOLD_EDIT_REASON_NONE = "rm.action.hold-edit-reason-none";
|
||||
private static final String MSG_HOLD_EDIT_TYPE = "rm.action.hold-edit-type";
|
||||
private static final String MSG_HOLD_EDIT_REASON_NONE = "rm.action.hold-edit-reason-none";
|
||||
private static final String MSG_HOLD_EDIT_TYPE = "rm.action.hold-edit-type";
|
||||
|
||||
/** Parameter names */
|
||||
public static final String PARAM_REASON = "reason";
|
||||
/** Parameter names */
|
||||
public static final String PARAM_REASON = "reason";
|
||||
|
||||
/**
|
||||
* @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(org.alfresco.service.cmr.action.Action, org.alfresco.service.cmr.repository.NodeRef)
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
|
||||
{
|
||||
if (getFreezeService().isHold(actionedUponNodeRef))
|
||||
{
|
||||
// Get the property values
|
||||
String reason = (String) action.getParameterValue(PARAM_REASON);
|
||||
if (StringUtils.isBlank(reason))
|
||||
{
|
||||
throw new AlfrescoRuntimeException(I18NUtil.getMessage(MSG_HOLD_EDIT_REASON_NONE));
|
||||
}
|
||||
/**
|
||||
* @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(org.alfresco.service.cmr.action.Action, org.alfresco.service.cmr.repository.NodeRef)
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
|
||||
{
|
||||
if (getFreezeService().isHold(actionedUponNodeRef))
|
||||
{
|
||||
// Get the property values
|
||||
String reason = (String) action.getParameterValue(PARAM_REASON);
|
||||
if (StringUtils.isBlank(reason))
|
||||
{
|
||||
throw new AlfrescoRuntimeException(I18NUtil.getMessage(MSG_HOLD_EDIT_REASON_NONE));
|
||||
}
|
||||
|
||||
// Update hold reason
|
||||
getFreezeService().updateReason(actionedUponNodeRef, reason);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new AlfrescoRuntimeException(I18NUtil.getMessage(MSG_HOLD_EDIT_TYPE, TYPE_HOLD.toString(), actionedUponNodeRef.toString()));
|
||||
}
|
||||
}
|
||||
// Update hold reason
|
||||
getFreezeService().updateReason(actionedUponNodeRef, reason);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new AlfrescoRuntimeException(I18NUtil.getMessage(MSG_HOLD_EDIT_TYPE, TYPE_HOLD.toString(), actionedUponNodeRef.toString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,11 +29,12 @@ package org.alfresco.module.org_alfresco_module_rm.action.impl;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.module.org_alfresco_module_rm.action.RMActionExecuterAbstractBase;
|
||||
import org.alfresco.service.cmr.action.Action;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -49,30 +50,29 @@ public class EditReviewAsOfDateAction extends RMActionExecuterAbstractBase
|
||||
|
||||
public static final String PARAM_AS_OF_DATE = "asOfDate";
|
||||
|
||||
/**
|
||||
* @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(org.alfresco.service.cmr.action.Action,
|
||||
* org.alfresco.service.cmr.repository.NodeRef)
|
||||
*/
|
||||
@Override
|
||||
protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
|
||||
{
|
||||
if (getRecordService().isRecord(actionedUponNodeRef) &&
|
||||
getNodeService().hasAspect(actionedUponNodeRef, ASPECT_VITAL_RECORD))
|
||||
{
|
||||
// Get the action parameter
|
||||
Date reviewAsOf = (Date)action.getParameterValue(PARAM_AS_OF_DATE);
|
||||
/**
|
||||
* @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(org.alfresco.service.cmr.action.Action, org.alfresco.service.cmr.repository.NodeRef)
|
||||
*/
|
||||
@Override
|
||||
protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
|
||||
{
|
||||
if (getRecordService().isRecord(actionedUponNodeRef) &&
|
||||
getNodeService().hasAspect(actionedUponNodeRef, ASPECT_VITAL_RECORD))
|
||||
{
|
||||
// Get the action parameter
|
||||
Date reviewAsOf = (Date) action.getParameterValue(PARAM_AS_OF_DATE);
|
||||
if (reviewAsOf == null)
|
||||
{
|
||||
throw new AlfrescoRuntimeException(I18NUtil.getMessage(MSG_SPECIFY_VALID_DATE));
|
||||
}
|
||||
|
||||
// Set the as of date
|
||||
this.getNodeService().setProperty(actionedUponNodeRef, PROP_REVIEW_AS_OF, reviewAsOf);
|
||||
// Set the as of date
|
||||
this.getNodeService().setProperty(actionedUponNodeRef, PROP_REVIEW_AS_OF, reviewAsOf);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new AlfrescoRuntimeException(I18NUtil.getMessage(MSG_REVIEW_DETAILS_ONLY));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new AlfrescoRuntimeException(I18NUtil.getMessage(MSG_REVIEW_DETAILS_ONLY));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,6 +27,9 @@
|
||||
|
||||
package org.alfresco.module.org_alfresco_module_rm.action.impl;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.action.RMActionExecuterAbstractBase;
|
||||
@@ -42,8 +45,6 @@ import org.alfresco.service.cmr.action.Action;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.security.AccessStatus;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
|
||||
/**
|
||||
* File report generic action.
|
||||
@@ -89,7 +90,8 @@ public class FileReportAction extends RMActionExecuterAbstractBase implements Re
|
||||
}
|
||||
|
||||
/**
|
||||
* @param reportService report service
|
||||
* @param reportService
|
||||
* report service
|
||||
*/
|
||||
public void setReportService(ReportService reportService)
|
||||
{
|
||||
@@ -97,7 +99,8 @@ public class FileReportAction extends RMActionExecuterAbstractBase implements Re
|
||||
}
|
||||
|
||||
/**
|
||||
* @param capabilityService capability service
|
||||
* @param capabilityService
|
||||
* capability service
|
||||
*/
|
||||
public void setCapabilityService(CapabilityService capabilityService)
|
||||
{
|
||||
@@ -105,8 +108,7 @@ public class FileReportAction extends RMActionExecuterAbstractBase implements Re
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(org.alfresco.service.cmr.action.Action,
|
||||
* org.alfresco.service.cmr.repository.NodeRef)
|
||||
* @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(org.alfresco.service.cmr.action.Action, org.alfresco.service.cmr.repository.NodeRef)
|
||||
*/
|
||||
@Override
|
||||
protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
|
||||
@@ -131,8 +133,7 @@ public class FileReportAction extends RMActionExecuterAbstractBase implements Re
|
||||
final Report report = getReportService().generateReport(reportType, actionedUponNodeRef, mimetype);
|
||||
|
||||
// file the report as system
|
||||
NodeRef filedReport = AuthenticationUtil.runAsSystem(new RunAsWork<NodeRef>()
|
||||
{
|
||||
NodeRef filedReport = AuthenticationUtil.runAsSystem(new RunAsWork<NodeRef>() {
|
||||
@Override
|
||||
public NodeRef doWork()
|
||||
{
|
||||
@@ -148,7 +149,8 @@ public class FileReportAction extends RMActionExecuterAbstractBase implements Re
|
||||
/**
|
||||
* Checks if the destination is frozen, closed, cut off or not. In case if it is an exception will be thrown.
|
||||
*
|
||||
* @param nodeRef The destination node reference for which the capability should be checked
|
||||
* @param nodeRef
|
||||
* The destination node reference for which the capability should be checked
|
||||
*/
|
||||
private void checkFilingPermissionOnlyCapability(NodeRef nodeRef)
|
||||
{
|
||||
@@ -159,25 +161,30 @@ public class FileReportAction extends RMActionExecuterAbstractBase implements Re
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the value of the given parameter. If the parameter has not been
|
||||
* passed from the UI an error will be thrown
|
||||
* Retrieves the value of the given parameter. If the parameter has not been passed from the UI an error will be thrown
|
||||
*
|
||||
* @param action The action
|
||||
* @param parameter The parameter for which the value should be retrieved
|
||||
* @param action
|
||||
* The action
|
||||
* @param parameter
|
||||
* The parameter for which the value should be retrieved
|
||||
* @return The value of the given parameter
|
||||
*/
|
||||
private String getParameterValue(Action action, String parameter)
|
||||
{
|
||||
String paramValue = (String) action.getParameterValue(parameter);
|
||||
if (StringUtils.isBlank(paramValue)) { throw new AlfrescoRuntimeException(I18NUtil.getMessage(
|
||||
MSG_PARAM_NOT_SUPPLIED, parameter)); }
|
||||
if (StringUtils.isBlank(paramValue))
|
||||
{
|
||||
throw new AlfrescoRuntimeException(I18NUtil.getMessage(
|
||||
MSG_PARAM_NOT_SUPPLIED, parameter));
|
||||
}
|
||||
return paramValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method for getting the destination.
|
||||
*
|
||||
* @param action The action
|
||||
* @param action
|
||||
* The action
|
||||
* @return The file plan node reference
|
||||
*/
|
||||
private NodeRef getDestination(Action action)
|
||||
@@ -189,7 +196,8 @@ public class FileReportAction extends RMActionExecuterAbstractBase implements Re
|
||||
/**
|
||||
* Helper method for getting the report type.
|
||||
*
|
||||
* @param action The action
|
||||
* @param action
|
||||
* The action
|
||||
* @return The report type
|
||||
*/
|
||||
private QName getReportType(Action action)
|
||||
|
||||
@@ -44,33 +44,34 @@ import org.alfresco.service.cmr.repository.NodeRef;
|
||||
*/
|
||||
public class FreezeAction extends RMActionExecuterAbstractBase
|
||||
{
|
||||
/** Parameter names */
|
||||
public static final String PARAM_REASON = "reason";
|
||||
/** Parameter names */
|
||||
public static final String PARAM_REASON = "reason";
|
||||
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.action.RMActionExecuterAbstractBase#addParameterDefinitions(java.util.List)
|
||||
*/
|
||||
@Override
|
||||
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
|
||||
{
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_REASON, DataTypeDefinition.TEXT, true, getParamDisplayLabel(PARAM_REASON)));
|
||||
}
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.action.RMActionExecuterAbstractBase#addParameterDefinitions(java.util.List)
|
||||
*/
|
||||
@Override
|
||||
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
|
||||
{
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_REASON, DataTypeDefinition.TEXT, true, getParamDisplayLabel(PARAM_REASON)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(org.alfresco.service.cmr.action.Action, org.alfresco.service.cmr.repository.NodeRef)
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
|
||||
{
|
||||
// NOTE: we can only freeze records and record folders so ignore everything else
|
||||
if (getNodeService().exists(actionedUponNodeRef) &&
|
||||
!getNodeService().hasAspect(actionedUponNodeRef, ContentModel.ASPECT_PENDING_DELETE) &&
|
||||
(getRecordService().isRecord(actionedUponNodeRef) ||
|
||||
getRecordFolderService().isRecordFolder(actionedUponNodeRef)) &&
|
||||
!getFreezeService().isFrozen(actionedUponNodeRef))
|
||||
{
|
||||
getFreezeService().freeze((String) action.getParameterValue(PARAM_REASON), actionedUponNodeRef);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(org.alfresco.service.cmr.action.Action, org.alfresco.service.cmr.repository.NodeRef)
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
|
||||
{
|
||||
// NOTE: we can only freeze records and record folders so ignore everything else
|
||||
if (getNodeService().exists(actionedUponNodeRef) &&
|
||||
!getNodeService().hasAspect(actionedUponNodeRef, ContentModel.ASPECT_PENDING_DELETE) &&
|
||||
(getRecordService().isRecord(actionedUponNodeRef) ||
|
||||
getRecordFolderService().isRecordFolder(actionedUponNodeRef))
|
||||
&&
|
||||
!getFreezeService().isFrozen(actionedUponNodeRef))
|
||||
{
|
||||
getFreezeService().freeze((String) action.getParameterValue(PARAM_REASON), actionedUponNodeRef);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,14 +27,15 @@
|
||||
|
||||
package org.alfresco.module.org_alfresco_module_rm.action.impl;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.action.RMActionExecuterAbstractBase;
|
||||
import org.alfresco.service.cmr.action.Action;
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
|
||||
/**
|
||||
* Action to re-open the records folder
|
||||
@@ -53,15 +54,14 @@ public class OpenRecordFolderAction extends RMActionExecuterAbstractBase
|
||||
public static final String PARAM_OPEN_PARENT = "openParent";
|
||||
|
||||
/**
|
||||
* @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(org.alfresco.service.cmr.action.Action,
|
||||
* org.alfresco.service.cmr.repository.NodeRef)
|
||||
* @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(org.alfresco.service.cmr.action.Action, org.alfresco.service.cmr.repository.NodeRef)
|
||||
*/
|
||||
@Override
|
||||
protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
|
||||
{
|
||||
if (getNodeService().exists(actionedUponNodeRef) &&
|
||||
!getFreezeService().isFrozen(actionedUponNodeRef) &&
|
||||
!(getDictionaryService().isSubClass(getNodeService().getType(actionedUponNodeRef), ContentModel.TYPE_CONTENT) && !getRecordService().isFiled(actionedUponNodeRef)))
|
||||
!getFreezeService().isFrozen(actionedUponNodeRef) &&
|
||||
!(getDictionaryService().isSubClass(getNodeService().getType(actionedUponNodeRef), ContentModel.TYPE_CONTENT) && !getRecordService().isFiled(actionedUponNodeRef)))
|
||||
{
|
||||
// TODO move re-open logic into a service method
|
||||
// TODO check that the user in question has the correct permission to re-open a records folder
|
||||
|
||||
@@ -57,9 +57,9 @@ public class RejectAction extends RMActionExecuterAbstractBase
|
||||
protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
|
||||
{
|
||||
if (getNodeService().exists(actionedUponNodeRef) &&
|
||||
!getNodeService().hasAspect(actionedUponNodeRef, ASPECT_DECLARED_RECORD) &&
|
||||
!getFreezeService().isFrozen(actionedUponNodeRef) &&
|
||||
getNodeService().getProperty(actionedUponNodeRef, PROP_RECORD_ORIGINATING_LOCATION) != null)
|
||||
!getNodeService().hasAspect(actionedUponNodeRef, ASPECT_DECLARED_RECORD) &&
|
||||
!getFreezeService().isFrozen(actionedUponNodeRef) &&
|
||||
getNodeService().getProperty(actionedUponNodeRef, PROP_RECORD_ORIGINATING_LOCATION) != null)
|
||||
{
|
||||
getRecordService().rejectRecord(actionedUponNodeRef, (String) action.getParameterValue(PARAM_REASON));
|
||||
}
|
||||
|
||||
@@ -27,11 +27,12 @@
|
||||
|
||||
package org.alfresco.module.org_alfresco_module_rm.action.impl;
|
||||
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.module.org_alfresco_module_rm.action.RMActionExecuterAbstractBase;
|
||||
import org.alfresco.service.cmr.action.Action;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
|
||||
/**
|
||||
* Relinquish Hold Action
|
||||
@@ -40,23 +41,23 @@ import org.springframework.extensions.surf.util.I18NUtil;
|
||||
*/
|
||||
public class RelinquishHoldAction extends RMActionExecuterAbstractBase
|
||||
{
|
||||
/** I18N */
|
||||
private static final String MSG_NOT_HOLD_TYPE = "rm.action.not-hold-type";
|
||||
/** I18N */
|
||||
private static final String MSG_NOT_HOLD_TYPE = "rm.action.not-hold-type";
|
||||
|
||||
/**
|
||||
* @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(org.alfresco.service.cmr.action.Action, org.alfresco.service.cmr.repository.NodeRef)
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
|
||||
{
|
||||
if (getFreezeService().isHold(actionedUponNodeRef))
|
||||
{
|
||||
getFreezeService().relinquish(actionedUponNodeRef);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new AlfrescoRuntimeException(I18NUtil.getMessage(MSG_NOT_HOLD_TYPE, TYPE_HOLD.toString(), actionedUponNodeRef.toString()));
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(org.alfresco.service.cmr.action.Action, org.alfresco.service.cmr.repository.NodeRef)
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
|
||||
{
|
||||
if (getFreezeService().isHold(actionedUponNodeRef))
|
||||
{
|
||||
getFreezeService().relinquish(actionedUponNodeRef);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new AlfrescoRuntimeException(I18NUtil.getMessage(MSG_NOT_HOLD_TYPE, TYPE_HOLD.toString(), actionedUponNodeRef.toString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,6 +33,10 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.action.RMActionExecuterAbstractBase;
|
||||
import org.alfresco.repo.action.ParameterDefinitionImpl;
|
||||
@@ -45,9 +49,6 @@ import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.workflow.WorkflowService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.workflow.RMWorkflowModel;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
/**
|
||||
* Request info action for starting a workflow to request more information for an undeclared record
|
||||
@@ -75,7 +76,8 @@ public class RequestInfoAction extends RMActionExecuterAbstractBase
|
||||
private WorkflowService workflowService;
|
||||
|
||||
/**
|
||||
* @param workflowService workflow service
|
||||
* @param workflowService
|
||||
* workflow service
|
||||
*/
|
||||
public void setWorkflowService(WorkflowService workflowService)
|
||||
{
|
||||
@@ -89,9 +91,9 @@ public class RequestInfoAction extends RMActionExecuterAbstractBase
|
||||
protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
|
||||
{
|
||||
if (getNodeService().exists(actionedUponNodeRef) &&
|
||||
!getNodeService().hasAspect(actionedUponNodeRef, ContentModel.ASPECT_PENDING_DELETE) &&
|
||||
getRecordService().isRecord(actionedUponNodeRef) &&
|
||||
!getRecordService().isDeclared(actionedUponNodeRef))
|
||||
!getNodeService().hasAspect(actionedUponNodeRef, ContentModel.ASPECT_PENDING_DELETE) &&
|
||||
getRecordService().isRecord(actionedUponNodeRef) &&
|
||||
!getRecordService().isDeclared(actionedUponNodeRef))
|
||||
{
|
||||
String workflowDefinitionId = workflowService.getDefinitionByName(REQUEST_INFO_WORKFLOW_DEFINITION_NAME).getId();
|
||||
Map<QName, Serializable> parameters = new HashMap<>();
|
||||
@@ -123,8 +125,10 @@ public class RequestInfoAction extends RMActionExecuterAbstractBase
|
||||
/**
|
||||
* Helper method for creating a workflow package to contain the actioned upon nodeRef
|
||||
*
|
||||
* @param action The request info action
|
||||
* @param actionedUponNodeRef The actioned upon nodeRef
|
||||
* @param action
|
||||
* The request info action
|
||||
* @param actionedUponNodeRef
|
||||
* The actioned upon nodeRef
|
||||
* @return Returns a workflow package containing the actioned upon nodeRef
|
||||
*/
|
||||
private NodeRef getWorkflowPackage(Action action, NodeRef actionedUponNodeRef)
|
||||
@@ -139,7 +143,8 @@ public class RequestInfoAction extends RMActionExecuterAbstractBase
|
||||
/**
|
||||
* Helper method for getting the assignees from the action
|
||||
*
|
||||
* @param action The request info action
|
||||
* @param action
|
||||
* The request info action
|
||||
* @return Returns a list of {@link NodeRef}s each representing the assignee
|
||||
*/
|
||||
private Serializable getAssignees(Action action)
|
||||
@@ -157,7 +162,8 @@ public class RequestInfoAction extends RMActionExecuterAbstractBase
|
||||
/**
|
||||
* Helper method for getting the requested information from the action
|
||||
*
|
||||
* @param action The request info action
|
||||
* @param action
|
||||
* The request info action
|
||||
* @return Returns the requested information
|
||||
*/
|
||||
private Serializable getRequestedInformation(Action action)
|
||||
@@ -168,7 +174,8 @@ public class RequestInfoAction extends RMActionExecuterAbstractBase
|
||||
/**
|
||||
* Helper method for getting the rule creator
|
||||
*
|
||||
* @param action The request info action
|
||||
* @param action
|
||||
* The request info action
|
||||
* @return Returns the rule creator
|
||||
*/
|
||||
private Serializable getRuleCreator(Action action)
|
||||
|
||||
@@ -38,7 +38,6 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import jakarta.mail.MessagingException;
|
||||
import jakarta.mail.Multipart;
|
||||
import jakarta.mail.Part;
|
||||
@@ -46,6 +45,11 @@ import jakarta.mail.internet.ContentType;
|
||||
import jakarta.mail.internet.MimeMessage;
|
||||
import jakarta.mail.internet.MimeUtility;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
import org.springframework.util.FileCopyUtils;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.model.ImapModel;
|
||||
@@ -63,10 +67,6 @@ 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;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
import org.springframework.util.FileCopyUtils;
|
||||
|
||||
/**
|
||||
* Split Email Action
|
||||
@@ -105,7 +105,8 @@ public class SplitEmailAction extends RMActionExecuterAbstractBase
|
||||
/**
|
||||
* Sets the relationship service instance
|
||||
*
|
||||
* @param relationshipService The relationship service instance
|
||||
* @param relationshipService
|
||||
* The relationship service instance
|
||||
*/
|
||||
public void setRelationshipService(RelationshipService relationshipService)
|
||||
{
|
||||
@@ -139,8 +140,7 @@ public class SplitEmailAction extends RMActionExecuterAbstractBase
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(org.alfresco.service.cmr.action.Action,
|
||||
* org.alfresco.service.cmr.repository.NodeRef)
|
||||
* @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(org.alfresco.service.cmr.action.Action, org.alfresco.service.cmr.repository.NodeRef)
|
||||
*/
|
||||
@Override
|
||||
protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
|
||||
@@ -163,7 +163,7 @@ public class SplitEmailAction extends RMActionExecuterAbstractBase
|
||||
* Check whether the email message has already been split - do nothing if it has already been split
|
||||
*/
|
||||
List<AssociationRef> refs = getNodeService().getTargetAssocs(actionedUponNodeRef, ImapModel.ASSOC_IMAP_ATTACHMENT);
|
||||
if(refs.size() > 0)
|
||||
if (refs.size() > 0)
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
@@ -183,7 +183,7 @@ public class SplitEmailAction extends RMActionExecuterAbstractBase
|
||||
Object content = mimeMessage.getContent();
|
||||
if (content instanceof Multipart)
|
||||
{
|
||||
Multipart multipart = (Multipart)content;
|
||||
Multipart multipart = (Multipart) content;
|
||||
|
||||
for (int i = 0, n = multipart.getCount(); i < n; i++)
|
||||
{
|
||||
@@ -199,7 +199,7 @@ public class SplitEmailAction extends RMActionExecuterAbstractBase
|
||||
{
|
||||
throw new AlfrescoRuntimeException(I18NUtil.getMessage(MSG_NO_READ_MIME_MESSAGE, e.toString()), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new AlfrescoRuntimeException(I18NUtil.getMessage(MSG_EMAIL_DECLARED, actionedUponNodeRef.toString()));
|
||||
@@ -213,8 +213,11 @@ public class SplitEmailAction extends RMActionExecuterAbstractBase
|
||||
|
||||
/**
|
||||
* Create attachment from Mime Message Part
|
||||
* @param messageNodeRef - the node ref of the mime message
|
||||
* @param parentNodeRef - the node ref of the parent folder
|
||||
*
|
||||
* @param messageNodeRef
|
||||
* - the node ref of the mime message
|
||||
* @param parentNodeRef
|
||||
* - the node ref of the parent folder
|
||||
* @param part
|
||||
* @throws MessagingException
|
||||
* @throws IOException
|
||||
@@ -235,8 +238,8 @@ public class SplitEmailAction extends RMActionExecuterAbstractBase
|
||||
}
|
||||
|
||||
Map<QName, Serializable> messageProperties = getNodeService().getProperties(messageNodeRef);
|
||||
String messageTitle = (String)messageProperties.get(ContentModel.PROP_NAME);
|
||||
if(messageTitle == null)
|
||||
String messageTitle = (String) messageProperties.get(ContentModel.PROP_NAME);
|
||||
if (messageTitle == null)
|
||||
{
|
||||
messageTitle = fileName;
|
||||
}
|
||||
@@ -255,10 +258,10 @@ public class SplitEmailAction extends RMActionExecuterAbstractBase
|
||||
* Create an attachment node in the same folder as the message
|
||||
*/
|
||||
ChildAssociationRef attachmentRef = getNodeService().createNode(parentNodeRef,
|
||||
ContentModel.ASSOC_CONTAINS,
|
||||
QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, fileName),
|
||||
ContentModel.TYPE_CONTENT,
|
||||
docProps);
|
||||
ContentModel.ASSOC_CONTAINS,
|
||||
QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, fileName),
|
||||
ContentModel.TYPE_CONTENT,
|
||||
docProps);
|
||||
|
||||
/**
|
||||
* Write the content into the new attachment node
|
||||
@@ -273,7 +276,6 @@ public class SplitEmailAction extends RMActionExecuterAbstractBase
|
||||
*/
|
||||
createRMReference(messageNodeRef, attachmentRef.getChildRef());
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -281,8 +283,7 @@ public class SplitEmailAction extends RMActionExecuterAbstractBase
|
||||
*/
|
||||
private void createRMReference(final NodeRef parentRef, final NodeRef childRef)
|
||||
{
|
||||
AuthenticationUtil.runAsSystem(new RunAsWork<Void>()
|
||||
{
|
||||
AuthenticationUtil.runAsSystem(new RunAsWork<Void>() {
|
||||
@Override
|
||||
public Void doWork()
|
||||
{
|
||||
|
||||
@@ -52,7 +52,8 @@ public class TransferAction extends RMDispositionActionExecuterAbstractBase
|
||||
/**
|
||||
* Indicates whether this transfer is an accession or not
|
||||
*
|
||||
* @param isAccession Is the transfer an accession or not
|
||||
* @param isAccession
|
||||
* Is the transfer an accession or not
|
||||
*/
|
||||
public void setIsAccession(boolean isAccession)
|
||||
{
|
||||
@@ -62,7 +63,8 @@ public class TransferAction extends RMDispositionActionExecuterAbstractBase
|
||||
/**
|
||||
* Sets the transfer service
|
||||
*
|
||||
* @param transferService transfer service
|
||||
* @param transferService
|
||||
* transfer service
|
||||
*/
|
||||
public void setTransferService(TransferService transferService)
|
||||
{
|
||||
@@ -101,8 +103,10 @@ public class TransferAction extends RMDispositionActionExecuterAbstractBase
|
||||
/**
|
||||
* Create the transfer node and link the disposition lifecycle node beneath it
|
||||
*
|
||||
* @param action action
|
||||
* @param dispositionLifeCycleNodeRef disposition lifecycle node
|
||||
* @param action
|
||||
* action
|
||||
* @param dispositionLifeCycleNodeRef
|
||||
* disposition lifecycle node
|
||||
*/
|
||||
private void doTransfer(Action action, NodeRef dispositionLifeCycleNodeRef)
|
||||
{
|
||||
|
||||
@@ -27,13 +27,14 @@
|
||||
|
||||
package org.alfresco.module.org_alfresco_module_rm.action.impl;
|
||||
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.module.org_alfresco_module_rm.action.RMActionExecuterAbstractBase;
|
||||
import org.alfresco.module.org_alfresco_module_rm.transfer.TransferService;
|
||||
import org.alfresco.service.cmr.action.Action;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
|
||||
/**
|
||||
* Transfer complete action
|
||||
@@ -60,7 +61,8 @@ public class TransferCompleteAction extends RMActionExecuterAbstractBase
|
||||
}
|
||||
|
||||
/**
|
||||
* @param transferService transfer service
|
||||
* @param transferService
|
||||
* transfer service
|
||||
*/
|
||||
public void setTransferService(TransferService transferService)
|
||||
{
|
||||
@@ -68,8 +70,7 @@ public class TransferCompleteAction extends RMActionExecuterAbstractBase
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(org.alfresco.service.cmr.action.Action,
|
||||
* org.alfresco.service.cmr.repository.NodeRef)
|
||||
* @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(org.alfresco.service.cmr.action.Action, org.alfresco.service.cmr.repository.NodeRef)
|
||||
*/
|
||||
@Override
|
||||
protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
|
||||
@@ -81,7 +82,8 @@ public class TransferCompleteAction extends RMActionExecuterAbstractBase
|
||||
/**
|
||||
* Checks if the actioned upon node reference is a sub class of transfer
|
||||
*
|
||||
* @param actionedUponNodeRef actioned upon node reference
|
||||
* @param actionedUponNodeRef
|
||||
* actioned upon node reference
|
||||
*/
|
||||
private void checkTransferSubClass(NodeRef actionedUponNodeRef)
|
||||
{
|
||||
|
||||
@@ -29,12 +29,13 @@ package org.alfresco.module.org_alfresco_module_rm.action.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.module.org_alfresco_module_rm.action.RMActionExecuterAbstractBase;
|
||||
import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionAction;
|
||||
import org.alfresco.service.cmr.action.Action;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
|
||||
/**
|
||||
* UnCutoff action implementation
|
||||
|
||||
@@ -27,13 +27,14 @@
|
||||
|
||||
package org.alfresco.module.org_alfresco_module_rm.action.impl;
|
||||
|
||||
import org.alfresco.module.org_alfresco_module_rm.action.RMActionExecuterAbstractBase;
|
||||
import org.alfresco.service.cmr.action.Action;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
|
||||
import org.alfresco.module.org_alfresco_module_rm.action.RMActionExecuterAbstractBase;
|
||||
import org.alfresco.service.cmr.action.Action;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
|
||||
/**
|
||||
* Undeclare record action
|
||||
*
|
||||
@@ -53,25 +54,25 @@ public class UndeclareRecordAction extends RMActionExecuterAbstractBase
|
||||
@Override
|
||||
protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
|
||||
{
|
||||
if (getNodeService().exists(actionedUponNodeRef))
|
||||
{
|
||||
if (getRecordService().isRecord(actionedUponNodeRef))
|
||||
{
|
||||
// repoen if already complete and not frozen
|
||||
if (getRecordService().isDeclared(actionedUponNodeRef) &&
|
||||
!getFreezeService().isFrozen(actionedUponNodeRef))
|
||||
{
|
||||
// Remove the declared aspect
|
||||
this.getNodeService().removeAspect(actionedUponNodeRef, ASPECT_DECLARED_RECORD);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (logger.isWarnEnabled())
|
||||
{
|
||||
logger.warn(I18NUtil.getMessage(MSG_RECORDS_ONLY_UNDECLARED));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (getNodeService().exists(actionedUponNodeRef))
|
||||
{
|
||||
if (getRecordService().isRecord(actionedUponNodeRef))
|
||||
{
|
||||
// repoen if already complete and not frozen
|
||||
if (getRecordService().isDeclared(actionedUponNodeRef) &&
|
||||
!getFreezeService().isFrozen(actionedUponNodeRef))
|
||||
{
|
||||
// Remove the declared aspect
|
||||
this.getNodeService().removeAspect(actionedUponNodeRef, ASPECT_DECLARED_RECORD);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (logger.isWarnEnabled())
|
||||
{
|
||||
logger.warn(I18NUtil.getMessage(MSG_RECORDS_ONLY_UNDECLARED));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ public class UndoEventAction extends RMActionExecuterAbstractBase
|
||||
@Override
|
||||
protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
|
||||
{
|
||||
String eventName = (String)action.getParameterValue(PARAM_EVENT_NAME);
|
||||
String eventName = (String) action.getParameterValue(PARAM_EVENT_NAME);
|
||||
|
||||
if (this.getNodeService().hasAspect(actionedUponNodeRef, ASPECT_DISPOSITION_LIFECYCLE))
|
||||
{
|
||||
|
||||
@@ -38,13 +38,13 @@ import org.alfresco.service.cmr.repository.NodeRef;
|
||||
*/
|
||||
public class UnfreezeAction extends RMActionExecuterAbstractBase
|
||||
{
|
||||
/**
|
||||
* @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(org.alfresco.service.cmr.action.Action, org.alfresco.service.cmr.repository.NodeRef)
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
|
||||
{
|
||||
getFreezeService().unFreeze(actionedUponNodeRef);
|
||||
}
|
||||
/**
|
||||
* @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(org.alfresco.service.cmr.action.Action, org.alfresco.service.cmr.repository.NodeRef)
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
|
||||
{
|
||||
getFreezeService().unFreeze(actionedUponNodeRef);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,11 +55,11 @@ public class UnlinkFromAction extends RMActionExecuterAbstractBase
|
||||
{
|
||||
// check that the actioned upon node reference exists and is of the correct type
|
||||
if (getNodeService().exists(actionedUponNodeRef) &&
|
||||
!getNodeService().hasAspect(actionedUponNodeRef, ContentModel.ASPECT_PENDING_DELETE) &&
|
||||
getRecordService().isRecord(actionedUponNodeRef))
|
||||
!getNodeService().hasAspect(actionedUponNodeRef, ContentModel.ASPECT_PENDING_DELETE) &&
|
||||
getRecordService().isRecord(actionedUponNodeRef))
|
||||
{
|
||||
// get the record folder we are unlinking from
|
||||
String recordFolderValue = (String)action.getParameterValue(PARAM_RECORD_FOLDER);
|
||||
String recordFolderValue = (String) action.getParameterValue(PARAM_RECORD_FOLDER);
|
||||
if (recordFolderValue == null || recordFolderValue.isEmpty())
|
||||
{
|
||||
// indicate that the record folder is mandatory
|
||||
|
||||
@@ -27,9 +27,10 @@
|
||||
|
||||
package org.alfresco.module.org_alfresco_module_rm.admin;
|
||||
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
|
||||
import org.alfresco.service.namespace.QName;
|
||||
|
||||
/**
|
||||
* Custom metadata exception.
|
||||
*
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user