mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-09-24 14:32:01 +00:00
Compare commits
497 Commits
ags-3.0.2
...
ags-3.2.0.
Author | SHA1 | Date | |
---|---|---|---|
|
7b396dc652 | ||
|
5b080cf308 | ||
|
c6a9ec43f5 | ||
|
0ea0565909 | ||
|
ff81afe125 | ||
|
2a014eefe0 | ||
|
4c9fe378c6 | ||
|
6d22541437 | ||
|
06a8df491c | ||
|
5b34dbd24f | ||
|
783dcc7710 | ||
|
7604b96b88 | ||
|
e78f159844 | ||
|
43268debd3 | ||
|
b2b0121d20 | ||
|
738fce1c37 | ||
|
1292cb495b | ||
|
098c80bd03 | ||
|
49f504ba93 | ||
|
d85d6227ce | ||
|
2790244142 | ||
|
2d0913df35 | ||
|
55602eb72c | ||
|
8f43d02bee | ||
|
1608781182 | ||
|
bd4c398205 | ||
|
bf7047745a | ||
|
6792522163 | ||
|
6c1808731b | ||
|
e6983ce90f | ||
|
5bae9d32a1 | ||
|
1e236e085f | ||
|
94bb04d7f8 | ||
|
bcac8974a4 | ||
|
25bb9c83f7 | ||
|
750e69f849 | ||
|
4b7b25893c | ||
|
1c30a04c5b | ||
|
6fd5e0197d | ||
|
cb068b9fd0 | ||
|
0e8255d59c | ||
|
e312e1128f | ||
|
d37ac2f955 | ||
|
d5b41e179f | ||
|
d25733fdb6 | ||
|
ea9f43d3d6 | ||
|
667859aa42 | ||
|
bfb19ee91e | ||
|
c820d3d2ca | ||
|
6f08a237b2 | ||
|
3407c560ba | ||
|
1dff0dbecd | ||
|
793603f6b1 | ||
|
9d606baf3c | ||
|
0db6218624 | ||
|
5290538d9d | ||
|
9a9965fdd0 | ||
|
ae99c53468 | ||
|
4017f9f101 | ||
|
9d9bdff348 | ||
|
02eec901b3 | ||
|
3cd9aaeef5 | ||
|
42a32d4422 | ||
|
5dc0d39287 | ||
|
3d5d01efb8 | ||
|
d7d68b10a6 | ||
|
7fe911dcdb | ||
|
88ffa3ccc0 | ||
|
5370b92eb8 | ||
|
1f81c867aa | ||
|
81aa1f2c5c | ||
|
07383d7e77 | ||
|
56a5da0154 | ||
|
763ba1b319 | ||
|
5f87a5cd92 | ||
|
78cfa3a879 | ||
|
c2e2536389 | ||
|
dc031c1317 | ||
|
0616a1070d | ||
|
8c16f9351f | ||
|
4461495d85 | ||
|
2cdfdf5037 | ||
|
43c29299d1 | ||
|
df16478e53 | ||
|
d50b552be6 | ||
|
067cae1cd2 | ||
|
c2a27f6370 | ||
|
756208affb | ||
|
26f664c68f | ||
|
3a6b3c994a | ||
|
7dd104c28e | ||
|
8d6c50f8d1 | ||
|
414be241a4 | ||
|
703f706afc | ||
|
c9fc6baeb8 | ||
|
066503b515 | ||
|
0a1cfa0d11 | ||
|
e3e3273ab0 | ||
|
d2c2f14270 | ||
|
8b14d81e1e | ||
|
25ef9dcb75 | ||
|
a2be7a29f9 | ||
|
4b1fec979a | ||
|
e59b169422 | ||
|
50f2457a52 | ||
|
0523ca1d5c | ||
|
48d8f66046 | ||
|
7a8273645d | ||
|
5183b6c389 | ||
|
cb4c0ef37f | ||
|
c369d53d7c | ||
|
28b1fc7d9c | ||
|
8787bd09e4 | ||
|
41d0404d4f | ||
|
b8963f75c8 | ||
|
3c957afdbe | ||
|
9588917c66 | ||
|
5334623e56 | ||
|
7e79c86baf | ||
|
bc2f13e0f7 | ||
|
f5cae4cbca | ||
|
720abc0ab5 | ||
|
262a9480f3 | ||
|
1f0c13438b | ||
|
9fd3d7f9d8 | ||
|
11396093b6 | ||
|
f5879bb7fb | ||
|
c087c888c6 | ||
|
15e6b5c107 | ||
|
d85ca33232 | ||
|
29fd680ced | ||
|
cc21d22bf4 | ||
|
5584f05cb0 | ||
|
9a3f52cc5b | ||
|
b80cbad7c6 | ||
|
fc9df152e5 | ||
|
c1b3decae4 | ||
|
44c35a454e | ||
|
995a771b51 | ||
|
af928d3c7d | ||
|
f4f18f1047 | ||
|
bb8d99c895 | ||
|
fa48983bb6 | ||
|
2fe6cdf602 | ||
|
a48cb2755c | ||
|
8e26f5aad5 | ||
|
1c539f9f05 | ||
|
211ebba2f2 | ||
|
d02b074670 | ||
|
bcefca962c | ||
|
184673cef1 | ||
|
ba9a192950 | ||
|
5e516a57b9 | ||
|
0a26da478b | ||
|
d79caf2466 | ||
|
18bd7d7fac | ||
|
35a76988a2 | ||
|
a03fce52d3 | ||
|
becbf296df | ||
|
903791e1db | ||
|
f169e79599 | ||
|
27496b81f1 | ||
|
577b2e1a72 | ||
|
7c5d8058d2 | ||
|
0e4501d27a | ||
|
0d85f2cadd | ||
|
1575124fd7 | ||
|
9cea6d9344 | ||
|
bee8d09bd4 | ||
|
40767c1b59 | ||
|
3e5b1bad95 | ||
|
6437f31749 | ||
|
5230a9e0e8 | ||
|
849252b125 | ||
|
5a24bf2f2b | ||
|
d0a6b5a739 | ||
|
36f5c76599 | ||
|
d990f30e8c | ||
|
296c78e7d5 | ||
|
ac4b8d4b9a | ||
|
3d4175078d | ||
|
b769ce2892 | ||
|
a5d245b5f6 | ||
|
d1d3bb91d9 | ||
|
3dfc01f716 | ||
|
c726d4616d | ||
|
f858d6d203 | ||
|
5e05737186 | ||
|
cc968e5aa8 | ||
|
54420ca212 | ||
|
b9a4df14f5 | ||
|
221a633c2a | ||
|
1d739008c2 | ||
|
9af13a5e51 | ||
|
a5722c31c4 | ||
|
4f03687e83 | ||
|
f972c54efb | ||
|
2af340c5d6 | ||
|
947b293c76 | ||
|
dff5b452d9 | ||
|
94936bc8a7 | ||
|
c3021ccfa1 | ||
|
ae64374c61 | ||
|
8fc0ca7e5a | ||
|
2f88cee847 | ||
|
d5278c4ec7 | ||
|
93084fac63 | ||
|
dded7766c7 | ||
|
5dae326ea0 | ||
|
3f0f3d5ddd | ||
|
1876c120d7 | ||
|
66706abac5 | ||
|
d8f75eaf59 | ||
|
ad7eec9700 | ||
|
0b3652b5a4 | ||
|
6bc8aa9f99 | ||
|
53f75085a5 | ||
|
0f0b0962b8 | ||
|
79c9244a14 | ||
|
8beb4d5e24 | ||
|
2fd1f661e2 | ||
|
c33a174b1a | ||
|
30d05f4f7a | ||
|
862e69da17 | ||
|
5348b963c3 | ||
|
a97bf04cff | ||
|
8c008a5b6d | ||
|
1df5a307c4 | ||
|
b2c0afd8d5 | ||
|
9a36a9e8d6 | ||
|
7c4d8e91ab | ||
|
bb970e33f5 | ||
|
820d1b2c0d | ||
|
9c13bf3ced | ||
|
2aeb78b57c | ||
|
f61992f047 | ||
|
512297c6a4 | ||
|
9c344bd97b | ||
|
557ce8b432 | ||
|
894dd69c74 | ||
|
ecf2f9bc21 | ||
|
5152c1c0ce | ||
|
35e9e20871 | ||
|
ff9a5f239b | ||
|
a6e413c52f | ||
|
aed94d26cf | ||
|
1e8dcd5e24 | ||
|
5551b6f89f | ||
|
9dc6a7a0ac | ||
|
807032334d | ||
|
075794981b | ||
|
8bedb94a5e | ||
|
0d0c1c4048 | ||
|
0b765199fe | ||
|
fc4f1b77c4 | ||
|
cd76665548 | ||
|
7a03c64ffd | ||
|
7471d4e537 | ||
|
ba70b24ce3 | ||
|
068fef7ac2 | ||
|
9238737f68 | ||
|
38feaef31d | ||
|
93175c24ae | ||
|
75b4bc5ca5 | ||
|
8daac2d403 | ||
|
b4bc91950b | ||
|
8a37916e3a | ||
|
d5d74d6899 | ||
|
c82d586479 | ||
|
86ad2dcd93 | ||
|
06b8001362 | ||
|
532747b0ad | ||
|
b907ff04cb | ||
|
40d01c2c44 | ||
|
41e1d9f880 | ||
|
dc38a2031b | ||
|
c142ab7699 | ||
|
365fddc247 | ||
|
7f73ad8227 | ||
|
76cb942556 | ||
|
54097b2fb5 | ||
|
ad620ba6b5 | ||
|
0e9a855182 | ||
|
e38904cb91 | ||
|
a002f1d1c5 | ||
|
01b4146582 | ||
|
35a1fd00e7 | ||
|
5afd26bad8 | ||
|
106f7c21b2 | ||
|
0ae39dc850 | ||
|
bb336d7758 | ||
|
ce7dd88301 | ||
|
11b76dcd8b | ||
|
f1cd87593c | ||
|
586e2eca87 | ||
|
f3fbd4ebdc | ||
|
791b4ceb3e | ||
|
6819516c58 | ||
|
36ba457cfa | ||
|
1419540456 | ||
|
afc24fa4a9 | ||
|
e8d1c82a21 | ||
|
77af43057a | ||
|
e078e0f6d1 | ||
|
62b7426b73 | ||
|
76c865e41a | ||
|
57452c43eb | ||
|
895dfe3be9 | ||
|
e0e2e94b21 | ||
|
dc2e6f9f57 | ||
|
0ab7a955ce | ||
|
210b554297 | ||
|
3cf3874db1 | ||
|
48469d8ce9 | ||
|
16ef2130a8 | ||
|
4f84727da0 | ||
|
ac4214b56c | ||
|
475f695d04 | ||
|
021804e79a | ||
|
122665284f | ||
|
0deb093287 | ||
|
ab114dd03a | ||
|
777a256a06 | ||
|
92ff5dd935 | ||
|
0b7f4c9ec5 | ||
|
2f22080d41 | ||
|
6bee296849 | ||
|
2b3522dd55 | ||
|
f54d71baf1 | ||
|
c1470c7c38 | ||
|
a1b7957c15 | ||
|
ef483a7f4b | ||
|
f27a0a39dc | ||
|
39c9ab7132 | ||
|
94abd407be | ||
|
3ef7ae2f82 | ||
|
d7f20f1a3f | ||
|
8aeaf91926 | ||
|
c47cd6f44e | ||
|
fd00d6c705 | ||
|
2bb72a4a59 | ||
|
284ea22322 | ||
|
498c93c724 | ||
|
b3bf912a78 | ||
|
8f49086a06 | ||
|
e0df3f4175 | ||
|
4684596b02 | ||
|
a2103168d8 | ||
|
ba3acb3eed | ||
|
e5ac7ad9b7 | ||
|
60f8a61599 | ||
|
bb1e01a6cc | ||
|
7e9147ceef | ||
|
20a61b49de | ||
|
929980e7c2 | ||
|
f6a2008b4d | ||
|
d1ccc66c3d | ||
|
2ba81c8736 | ||
|
b85d6cf378 | ||
|
5dcae9c608 | ||
|
3c341d85c5 | ||
|
525abf9f2e | ||
|
07360369b8 | ||
|
4fa230a322 | ||
|
0f71d6ee98 | ||
|
a15998b23f | ||
|
9c03ae75ad | ||
|
493821f1c2 | ||
|
ba729a0f2e | ||
|
a11feb9bfe | ||
|
2955a87244 | ||
|
e03c9ecab1 | ||
|
8515b9c2f8 | ||
|
f0fe989822 | ||
|
a000f99c04 | ||
|
8f9ca689df | ||
|
05c70ede63 | ||
|
07d4c451ca | ||
|
9f2336d487 | ||
|
709588ff42 | ||
|
bac70edcd1 | ||
|
d247e1e2bc | ||
|
7ed0e9f15c | ||
|
86f66dbd85 | ||
|
f7e8eb9def | ||
|
a37e56f1fc | ||
|
41f9acbede | ||
|
cff25869f8 | ||
|
665c579560 | ||
|
c99fa9b421 | ||
|
9f095aea8c | ||
|
790f2700e2 | ||
|
e19e3c8b35 | ||
|
9b2525e006 | ||
|
5a964b50cd | ||
|
6fa7d75f0a | ||
|
d396c87e29 | ||
|
943345ab78 | ||
|
86128a66b3 | ||
|
905a8996b5 | ||
|
2c30614e8c | ||
|
e8725860eb | ||
|
a54a80f6a6 | ||
|
78ed0e4404 | ||
|
0710c81b53 | ||
|
06cb843fac | ||
|
ba8cd73a10 | ||
|
d719f535db | ||
|
61e50fb10f | ||
|
f6d0b2fd05 | ||
|
d68070051d | ||
|
ecfb3fdca9 | ||
|
3cb127b620 | ||
|
29a7047db1 | ||
|
94454b1f6c | ||
|
f74303fc50 | ||
|
11a193bdbf | ||
|
15b5c167af | ||
|
ce60d3e89f | ||
|
72493a9a13 | ||
|
688628258d | ||
|
c17fc2ac6f | ||
|
3d91c28743 | ||
|
99bf4bba4a | ||
|
107ae75f35 | ||
|
1bee02b8df | ||
|
ce8522a2c1 | ||
|
2e5ce4c6a2 | ||
|
b6daa30fba | ||
|
400a61b7bc | ||
|
aa0a32b676 | ||
|
c697e37dfe | ||
|
9cbdb10e6a | ||
|
2d06a30243 | ||
|
02db9e2d52 | ||
|
166273ff0a | ||
|
aa04bbba90 | ||
|
9384a4e5aa | ||
|
d25c8762ca | ||
|
a8c7e8540e | ||
|
5c2c54a4cd | ||
|
3ab28bb2c2 | ||
|
a68fccd169 | ||
|
84699c994d | ||
|
d306574122 | ||
|
f77dc61b89 | ||
|
190f859464 | ||
|
9d1c3770c9 | ||
|
3ac143c283 | ||
|
abfc1fc999 | ||
|
8df3dbb151 | ||
|
0a72cf0c32 | ||
|
60a7f3282d | ||
|
95249c3c24 | ||
|
5afd385009 | ||
|
2b6dd1861c | ||
|
7c27ac4782 | ||
|
b860dd25c7 | ||
|
076910017e | ||
|
5b15100839 | ||
|
c9ae6b8d91 | ||
|
cb76ebed00 | ||
|
5e6555db50 | ||
|
3314a60b44 | ||
|
47ecd4eb64 | ||
|
7f2c73174a | ||
|
e7d32b93c1 | ||
|
53d0fb1cbd | ||
|
dd606fd941 | ||
|
901ed61933 | ||
|
c40c426797 | ||
|
81cf904d33 | ||
|
5141e97129 | ||
|
c6a45874fb | ||
|
3ee27eb72a | ||
|
77d73283a1 | ||
|
c68c814513 | ||
|
2898fbb8a4 | ||
|
3088f0a4a4 | ||
|
a057f799cf | ||
|
ff0a24a577 | ||
|
009ac8cf1c | ||
|
b8be1e375e | ||
|
c0fb76539b | ||
|
772ea923ce | ||
|
873470ec26 | ||
|
f8558c92ac | ||
|
673bf03972 | ||
|
c570793fa8 | ||
|
d16884a692 | ||
|
6c52e5891d | ||
|
b83b3e7631 | ||
|
168f24d140 | ||
|
f51fac42c4 | ||
|
e117e16b4e | ||
|
2ff92641dc | ||
|
f8a1697e34 |
68
.travis.settings.xml
Normal file
68
.travis.settings.xml
Normal file
@@ -0,0 +1,68 @@
|
||||
<settings>
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>alfresco-internal</id>
|
||||
<activation>
|
||||
<activeByDefault>true</activeByDefault>
|
||||
</activation>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>alfresco-internal</id>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
<name>Alfresco Internal Repository</name>
|
||||
<url>https://artifacts.alfresco.com/nexus/content/groups/internal</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>alfresco-internal</id>
|
||||
<name>Alfresco Internal Repository</name>
|
||||
<url>https://artifacts.alfresco.com/nexus/content/groups/internal</url>
|
||||
</pluginRepository>
|
||||
<pluginRepository>
|
||||
<id>alfresco-public</id>
|
||||
<name>Alfresco Public Repository</name>
|
||||
<url>https://artifacts.alfresco.com/nexus/content/groups/public</url>
|
||||
</pluginRepository>
|
||||
<pluginRepository>
|
||||
<id>alfresco-private</id>
|
||||
<name>Alfresco Private Repository</name>
|
||||
<url>https://artifacts.alfresco.com/nexus/content/groups/private</url>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
<servers>
|
||||
<server>
|
||||
<id>docker.io</id>
|
||||
<username>${env.DOCKERHUB_USERNAME}</username>
|
||||
<password>${env.DOCKERHUB_PASSWORD}</password>
|
||||
</server>
|
||||
<server>
|
||||
<id>quay.io</id>
|
||||
<username>${env.QUAY_USERNAME}</username>
|
||||
<password>${env.QUAY_PASSWORD}</password>
|
||||
</server>
|
||||
<server>
|
||||
<id>alfresco-internal</id>
|
||||
<username>${env.MAVEN_USERNAME}</username>
|
||||
<password>${env.MAVEN_PASSWORD}</password>
|
||||
</server>
|
||||
<server>
|
||||
<id>alfresco-private</id>
|
||||
<username>${env.MAVEN_USERNAME}</username>
|
||||
<password>${env.MAVEN_PASSWORD}</password>
|
||||
</server>
|
||||
<server>
|
||||
<id>alfresco-internal-snapshots</id>
|
||||
<username>${env.MAVEN_USERNAME}</username>
|
||||
<password>${env.MAVEN_PASSWORD}</password>
|
||||
</server>
|
||||
</servers>
|
||||
</settings>
|
129
.travis.yml
129
.travis.yml
@@ -1,6 +1,129 @@
|
||||
import:
|
||||
- source: travis-env-vars.yml
|
||||
os: linux
|
||||
dist: xenial
|
||||
language: java
|
||||
jdk:
|
||||
- openjdk11
|
||||
sudo: false
|
||||
install: true
|
||||
script: travis_wait 35 mvn -B clean verify -Dcommunity -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
|
||||
|
||||
services:
|
||||
- docker
|
||||
|
||||
branches:
|
||||
only:
|
||||
- /release\/V3.\d+.*/
|
||||
- /feature-3.\d+\/.*/
|
||||
- /merge-3.\d+\/.*/
|
||||
- /hotfix-3.\d+\/.*/
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.m2
|
||||
|
||||
# the cache can grow constantly
|
||||
before_cache:
|
||||
- rm -rf $HOME/.m2/repository/org/alfresco/alfresco-governance-services*
|
||||
|
||||
before_install:
|
||||
- "cp .travis.settings.xml $HOME/.m2/settings.xml"
|
||||
install: skip
|
||||
|
||||
stages:
|
||||
- name: Build AGS
|
||||
- name: Tests
|
||||
if: commit_message !~ /\[skip tests\]/
|
||||
- name: Security Scans
|
||||
- name: Release
|
||||
- name: Publish
|
||||
|
||||
jobs:
|
||||
include:
|
||||
- name: "Build AGS Community"
|
||||
stage: Build AGS
|
||||
before_script: source scripts/setUpMavenPhase.sh
|
||||
script:
|
||||
- travis_retry travis_wait 120 mvn -B -q clean ${MAVEN_PHASE} -P${BUILD_PROFILE} -Dimage.tag=${IMAGE_TAG} -Dskip.integrationtests=false -Dcommunity -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
|
||||
|
||||
- name: "Build AGS Enterprise"
|
||||
stage: Build AGS
|
||||
before_script: source scripts/setUpMavenPhase.sh
|
||||
install:
|
||||
- travis_retry travis_wait 60 mvn -B -q clean install $MVN_SKIP -f rm-community/pom.xml -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
|
||||
script:
|
||||
- travis_retry travis_wait 80 mvn -B -q ${MAVEN_PHASE} -P${BUILD_PROFILE} -Dimage.tag=${IMAGE_TAG} -Dskip.integrationtests=false -f rm-enterprise/pom.xml -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
|
||||
|
||||
- name: "Build AGS Benchmark"
|
||||
stage: Build AGS
|
||||
before_script: source scripts/setUpMavenPhase.sh
|
||||
install:
|
||||
- travis_retry travis_wait 80 mvn -B -q clean install $MVN_SKIP -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
|
||||
script:
|
||||
- travis_retry travis_wait 35 mvn -B -q ${MAVEN_PHASE} -Dskip.integrationtests=false -f rm-benchmark/pom.xml -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
|
||||
|
||||
- name: "Community Integrations Tests on MySQL"
|
||||
stage: Tests
|
||||
script:
|
||||
- echo "Community Integrations Tests on MySQL"
|
||||
- name: "Enterprise Integrations Tests on MySQL"
|
||||
stage: Tests
|
||||
script:
|
||||
- echo "Enterprise Integrations Tests on MySQL"
|
||||
- name: "Community Rest API Tests"
|
||||
stage: Tests
|
||||
before_install:
|
||||
- travis_retry travis_wait 90 mvn -B -q install $MVN_SKIP -PbuildDockerImage -pl :alfresco-governance-services-community-repo -am
|
||||
install:
|
||||
- bash scripts/startAlfresco.sh $COMMUNITY_REPO_PATH
|
||||
- bash scripts/waitForAlfrescoToStart.sh
|
||||
script:
|
||||
- echo "Community Rest API Tests"
|
||||
- name: "Enterprise Rest API Tests"
|
||||
stage: Tests
|
||||
before_install:
|
||||
- travis_retry travis_wait 90 mvn -B -q install $MVN_SKIP -PbuildDockerImage -pl :alfresco-governance-services-enterprise-repo -am
|
||||
install:
|
||||
- bash scripts/startAlfresco.sh $ENTERPRISE_REPO_PATH
|
||||
- bash scripts/waitForAlfrescoToStart.sh
|
||||
script:
|
||||
- echo "Enterprise Rest API Tests"
|
||||
- name: "Community UI Tests ..."
|
||||
stage: Tests
|
||||
before_install:
|
||||
- travis_retry travis_wait 90 mvn -B -q install $MVN_SKIP -PbuildDockerImage -pl :alfresco-governance-services-community-repo,:alfresco-governance-services-community-share -am
|
||||
install:
|
||||
- bash scripts/startAlfresco.sh $COMMUNITY_SHARE_PATH
|
||||
- bash scripts/waitForAlfrescoToStart.sh
|
||||
script:
|
||||
- echo "Community UI Tests ..."
|
||||
- name: "Enterprise UI Tests ..."
|
||||
stage: Tests
|
||||
before_install:
|
||||
- travis_retry travis_wait 90 mvn -B -q install $MVN_SKIP -PbuildDockerImage -pl :alfresco-governance-services-enterprise-repo,:alfresco-governance-services-enterprise-share -am
|
||||
install:
|
||||
- bash scripts/startAlfresco.sh $ENTERPRISE_SHARE_PATH
|
||||
- bash scripts/waitForAlfrescoToStart.sh
|
||||
script:
|
||||
- echo "Enterprise UI Tests ..."
|
||||
|
||||
- name: "Source Clear Scan (SCA)"
|
||||
stage: Security Scans
|
||||
script:
|
||||
- echo "Source Clear Scan (SCA)"
|
||||
- name: "Static Analysis (SAST)"
|
||||
stage: Security Scans
|
||||
script:
|
||||
- echo "Static Analysis (SAST)"
|
||||
|
||||
- name: "Community Release"
|
||||
stage: Release
|
||||
script:
|
||||
- echo "Community Release"
|
||||
- name: "Enterprise Release"
|
||||
stage: Release
|
||||
script:
|
||||
- echo "Enterprise Release"
|
||||
|
||||
- name: "Copy to S3 Release Bucket"
|
||||
stage: Publish
|
||||
script:
|
||||
- echo "Copy to S3 Release Bucket"
|
||||
|
@@ -4,20 +4,19 @@ For the details on the Records Management project see [here](https://community.a
|
||||
## Getting started
|
||||
What you need to get started:
|
||||
|
||||
* A [Jira](https://issues.alfresco.com/jira/projects/ALF/issues/?filter=allopenissues) account;
|
||||
|
||||
* A [GitHub](https://github.com/) account.
|
||||
|
||||
Useful but not necessary:
|
||||
|
||||
* An [Alfresco community](https://community.alfresco.com/) account - this is a good place to ask questions and find answers.
|
||||
|
||||
* A [Jira](https://issues.alfresco.com/jira/projects/RM/issues/?filter=allopenissues) account - Good place to look at what the team is working on;
|
||||
|
||||
## Making changes
|
||||
|
||||
We use Jira to track issues. If you are committing a fix for a raised issue please include the ticket number in both the merge requests and the git commit messages.
|
||||
For example a fix for the ticket [ALF-21953](https://issues.alfresco.com/jira/browse/ALF-21953) might have the git commit message: "ALF-21953 Updated to use super pom v9".
|
||||
We use GitHub's issues to track community contributions and issues. If you are committing a fix for a raised issue please reference the issue number in the pull request.
|
||||
|
||||
If you are adding in a new feature or bug fix please do so [here](https://issues.alfresco.com/jira/projects/ALF/issues/?filter=allopenissues). By raising a ticket in this project you will be agreeing to the Alfresco Contribution Agreement which can be found at the bottom of the 'Create Issue' form or alternatively attached to [this](https://community.alfresco.com/docs/DOC-7070-alfresco-contribution-agreement) page.
|
||||
If you are adding in a new feature or bug fix please raise an issue in the issues tab. By raising an issue in this project you will be agreeing to the Alfresco Contribution Agreement which can be found [here](https://community.alfresco.com/docs/DOC-7070-alfresco-contribution-agreement).
|
||||
|
||||
When you are ready to make a change you just need to fork the [records-management](https://github.com/Alfresco/records-management) repository and then make your changes into your copy of the code.
|
||||
|
||||
@@ -55,8 +54,6 @@ Occasionally we may have to revert a change after it has been accepted. This wil
|
||||
|
||||
[IDE settings for Eclipse and Intellij](https://github.com/Alfresco/records-management/tree/master/ide-config)
|
||||
|
||||
[Jira project for raising issues/features](https://issues.alfresco.com/jira/projects/ALF/issues/?filter=allopenissues)
|
||||
|
||||
[Jira project used by GS team](https://issues.alfresco.com/jira/projects/RM/issues)
|
||||
|
||||
[Records Management project details](https://community.alfresco.com/docs/DOC-6387-project-overview-records-management)
|
||||
|
295
pom.xml
295
pom.xml
@@ -2,10 +2,10 @@
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-rm</artifactId>
|
||||
<artifactId>alfresco-governance-services</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>3.0.2</version>
|
||||
<name>Alfresco Records Management</name>
|
||||
<version>3.2.0.3</version>
|
||||
<name>Alfresco Governance Services</name>
|
||||
|
||||
<url>http://www.alfresco.org/</url>
|
||||
<inceptionYear>2005</inceptionYear>
|
||||
@@ -15,10 +15,10 @@
|
||||
</organization>
|
||||
|
||||
<scm>
|
||||
<connection>scm:git:https://git.alfresco.com/records-management/records-management.git</connection>
|
||||
<developerConnection>scm:git:https://git.alfresco.com/records-management/records-management.git</developerConnection>
|
||||
<url>https://git.alfresco.com/records-management/records-management</url>
|
||||
<tag>V3.0.2</tag>
|
||||
<connection>scm:git:ssh://git@github.com/Alfresco/governance-services.git</connection>
|
||||
<developerConnection>scm:git:ssh://git@github.com/Alfresco/governance-services.git</developerConnection>
|
||||
<url>scm:git:ssh://git@github.com/Alfresco/governance-services.git</url>
|
||||
<tag>V3.2.0.3</tag>
|
||||
</scm>
|
||||
|
||||
<issueManagement>
|
||||
@@ -258,32 +258,26 @@
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>io.fabric8</groupId>
|
||||
<artifactId>fabric8-maven-plugin</artifactId>
|
||||
<version>${fabric8.maven.version}</version>
|
||||
<configuration>
|
||||
<images>
|
||||
<image>
|
||||
<name>${image.name}</name>
|
||||
<build>
|
||||
<dockerFileDir>${project.basedir}/</dockerFileDir>
|
||||
</build>
|
||||
</image>
|
||||
</images>
|
||||
</configuration>
|
||||
<artifactId>docker-maven-plugin</artifactId>
|
||||
<version>${fabric8.docker.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>build-image</id>
|
||||
<phase>install</phase>
|
||||
<goals>
|
||||
<goal>build</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>build-image-verify</id>
|
||||
<!-- This will still be executed if the tests are skipped. -->
|
||||
<phase>verify</phase>
|
||||
<goals>
|
||||
<goal>build</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<images>
|
||||
<image>
|
||||
<name>${image.name}</name>
|
||||
<build>
|
||||
<dockerFileDir>${project.basedir}/</dockerFileDir>
|
||||
</build>
|
||||
</image>
|
||||
</images>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
@@ -300,19 +294,8 @@
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>io.fabric8</groupId>
|
||||
<artifactId>fabric8-maven-plugin</artifactId>
|
||||
<version>${fabric8.maven.version}</version>
|
||||
<configuration>
|
||||
<images>
|
||||
<image>
|
||||
<name>${image.name}:${image.tag}</name>
|
||||
<registry>${image.registry}</registry>
|
||||
<build>
|
||||
<dockerFileDir>${project.basedir}/</dockerFileDir>
|
||||
</build>
|
||||
</image>
|
||||
</images>
|
||||
</configuration>
|
||||
<artifactId>docker-maven-plugin</artifactId>
|
||||
<version>${fabric8.docker.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>build-push-image</id>
|
||||
@@ -321,6 +304,17 @@
|
||||
<goal>build</goal>
|
||||
<goal>push</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<images>
|
||||
<image>
|
||||
<name>${image.name}:${image.tag}</name>
|
||||
<registry>${image.registry}</registry>
|
||||
<build>
|
||||
<dockerFileDir>${project.basedir}/</dockerFileDir>
|
||||
</build>
|
||||
</image>
|
||||
</images>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
@@ -338,25 +332,8 @@
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>io.fabric8</groupId>
|
||||
<artifactId>fabric8-maven-plugin</artifactId>
|
||||
<version>${fabric8.maven.version}</version>
|
||||
<configuration>
|
||||
<images>
|
||||
<image>
|
||||
<name>${image.name}:${image.tag}</name>
|
||||
<registry>${image.registry}</registry>
|
||||
<build>
|
||||
<dockerFileDir>${project.basedir}/</dockerFileDir>
|
||||
</build>
|
||||
</image>
|
||||
<image>
|
||||
<name>${image.name}:${image.tag}</name>
|
||||
<build>
|
||||
<dockerFileDir>${project.basedir}/</dockerFileDir>
|
||||
</build>
|
||||
</image>
|
||||
</images>
|
||||
</configuration>
|
||||
<artifactId>docker-maven-plugin</artifactId>
|
||||
<version>${fabric8.docker.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>build-push-image</id>
|
||||
@@ -365,6 +342,23 @@
|
||||
<goal>build</goal>
|
||||
<goal>push</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<images>
|
||||
<image>
|
||||
<name>${image.name}:${image.tag}</name>
|
||||
<registry>${image.registry}</registry>
|
||||
<build>
|
||||
<dockerFileDir>${project.basedir}/</dockerFileDir>
|
||||
</build>
|
||||
</image>
|
||||
<image>
|
||||
<name>${image.name}:${image.tag}</name>
|
||||
<build>
|
||||
<dockerFileDir>${project.basedir}/</dockerFileDir>
|
||||
</build>
|
||||
</image>
|
||||
</images>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
@@ -382,19 +376,8 @@
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>io.fabric8</groupId>
|
||||
<artifactId>fabric8-maven-plugin</artifactId>
|
||||
<version>${fabric8.maven.version}</version>
|
||||
<configuration>
|
||||
<images>
|
||||
<image>
|
||||
<name>${image.name}:${project.version}</name>
|
||||
<registry>${image.registry}</registry>
|
||||
<build>
|
||||
<dockerFileDir>${project.basedir}/</dockerFileDir>
|
||||
</build>
|
||||
</image>
|
||||
</images>
|
||||
</configuration>
|
||||
<artifactId>docker-maven-plugin</artifactId>
|
||||
<version>${fabric8.docker.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>build-push-image</id>
|
||||
@@ -403,6 +386,17 @@
|
||||
<goal>build</goal>
|
||||
<goal>push</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<images>
|
||||
<image>
|
||||
<name>${image.name}:${project.version}</name>
|
||||
<registry>${image.registry}</registry>
|
||||
<build>
|
||||
<dockerFileDir>${project.basedir}/</dockerFileDir>
|
||||
</build>
|
||||
</image>
|
||||
</images>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
@@ -420,25 +414,8 @@
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>io.fabric8</groupId>
|
||||
<artifactId>fabric8-maven-plugin</artifactId>
|
||||
<version>${fabric8.maven.version}</version>
|
||||
<configuration>
|
||||
<images>
|
||||
<image>
|
||||
<name>${image.name}:${project.version}</name>
|
||||
<registry>${image.registry}</registry>
|
||||
<build>
|
||||
<dockerFileDir>${project.basedir}/</dockerFileDir>
|
||||
</build>
|
||||
</image>
|
||||
<image>
|
||||
<name>${image.name}:${project.version}</name>
|
||||
<build>
|
||||
<dockerFileDir>${project.basedir}/</dockerFileDir>
|
||||
</build>
|
||||
</image>
|
||||
</images>
|
||||
</configuration>
|
||||
<artifactId>docker-maven-plugin</artifactId>
|
||||
<version>${fabric8.docker.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>build-push-image</id>
|
||||
@@ -447,6 +424,94 @@
|
||||
<goal>build</goal>
|
||||
<goal>push</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<images>
|
||||
<image>
|
||||
<name>${image.name}:${project.version}</name>
|
||||
<registry>${image.registry}</registry>
|
||||
<build>
|
||||
<dockerFileDir>${project.basedir}/</dockerFileDir>
|
||||
</build>
|
||||
</image>
|
||||
<image>
|
||||
<name>${image.name}:${project.version}</name>
|
||||
<build>
|
||||
<dockerFileDir>${project.basedir}/</dockerFileDir>
|
||||
</build>
|
||||
</image>
|
||||
</images>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
</build>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>start-db</id>
|
||||
<activation>
|
||||
<property>
|
||||
<name>skip.integrationtests</name>
|
||||
<value>false</value>
|
||||
</property>
|
||||
</activation>
|
||||
<build>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>io.fabric8</groupId>
|
||||
<artifactId>docker-maven-plugin</artifactId>
|
||||
<version>${fabric8.docker.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>start</id>
|
||||
<phase>pre-integration-test</phase>
|
||||
<goals>
|
||||
<goal>stop</goal>
|
||||
<goal>start</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<images>
|
||||
<image>
|
||||
<alias>test-database</alias>
|
||||
<name>postgres:${postgres.version}</name>
|
||||
<run>
|
||||
<ports>
|
||||
<port>${database.port}:${postgresql.port}</port>
|
||||
</ports>
|
||||
<env>
|
||||
<POSTGRES_PASSWORD>${alfresco.db.password}</POSTGRES_PASSWORD>
|
||||
<POSTGRES_USER>${alfresco.db.username}</POSTGRES_USER>
|
||||
<POSTGRES_DB>${alfresco.test.db.name}</POSTGRES_DB>
|
||||
</env>
|
||||
<cmd>
|
||||
<shell>-c max_connections=300</shell>
|
||||
</cmd>
|
||||
<wait>
|
||||
<log>database system is ready to accept connections</log>
|
||||
<time>20000</time>
|
||||
</wait>
|
||||
</run>
|
||||
</image>
|
||||
<image>
|
||||
<name>alfresco/alfresco-activemq:${activemq.version}</name>
|
||||
<run>
|
||||
<ports>
|
||||
<port>${activemq.port1}:${activemq.port1}</port>
|
||||
<port>${activemq.port2}:${activemq.port2}</port>
|
||||
</ports>
|
||||
</run>
|
||||
</image>
|
||||
</images>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>stop</id>
|
||||
<phase>post-integration-test</phase>
|
||||
<goals>
|
||||
<goal>stop</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
@@ -467,29 +532,38 @@
|
||||
<alfresco.db.username>alfresco</alfresco.db.username>
|
||||
<alfresco.groupId>org.alfresco</alfresco.groupId>
|
||||
<alfresco.share.artifactId>share</alfresco.share.artifactId>
|
||||
<alfresco-spring-webscripts.version>6.20</alfresco-spring-webscripts.version>
|
||||
<api.explorer.version>6.0.7-ga</api.explorer.version>
|
||||
<alfresco-spring-webscripts.version>7.8</alfresco-spring-webscripts.version>
|
||||
<api.explorer.version>6.1.0</api.explorer.version>
|
||||
<!-- Set this here and override it in the community and enterprise modules. -->
|
||||
<alfresco.version>0.0</alfresco.version>
|
||||
|
||||
<skip.integrationtests>true</skip.integrationtests>
|
||||
<postgres.version>9.4.12</postgres.version>
|
||||
<activemq.version>5.15.6</activemq.version>
|
||||
<activemq.port1>61616</activemq.port1>
|
||||
<activemq.port2>5672</activemq.port2>
|
||||
|
||||
<share.client.contextPath>/share</share.client.contextPath>
|
||||
|
||||
<maven.javadoc.version>3.1.0</maven.javadoc.version>
|
||||
<maven.javadoc.skip>true</maven.javadoc.skip>
|
||||
<maven.war.plugin.version>2.6</maven.war.plugin.version>
|
||||
<maven.war.plugin.version>3.2.2</maven.war.plugin.version>
|
||||
<maven.alfresco.includeDependencies>false</maven.alfresco.includeDependencies>
|
||||
<maven.build.sourceVersion>1.8</maven.build.sourceVersion>
|
||||
<maven.build.testSourceVersion>1.8</maven.build.testSourceVersion>
|
||||
<java.version>11</java.version>
|
||||
<maven.compiler.source>${java.version}</maven.compiler.source>
|
||||
<maven.compiler.target>${java.version}</maven.compiler.target>
|
||||
<testJavaVersion>${java.version}</testJavaVersion>
|
||||
<maven.buildhelper.version>1.9.1</maven.buildhelper.version>
|
||||
<maven.compiler.version>3.8.0</maven.compiler.version>
|
||||
<maven.enforcer.plugin>3.0.0-M2</maven.enforcer.plugin>
|
||||
<maven.resources.version>3.1.0</maven.resources.version>
|
||||
<maven.tomcat.port>8080</maven.tomcat.port>
|
||||
|
||||
<jackson.version>2.9.8</jackson.version>
|
||||
<jackson.version>2.9.9</jackson.version>
|
||||
<jackson-databind.version>2.9.9.3</jackson-databind.version>
|
||||
<fabric8.docker.version>0.25.0</fabric8.docker.version>
|
||||
<mockito.version>1.10.19</mockito.version>
|
||||
<postgresql.version>42.2.5</postgresql.version>
|
||||
<postgresql.version>42.2.6</postgresql.version>
|
||||
<postgresql.port>5432</postgresql.port>
|
||||
<mysql.version>5.1.40</mysql.version>
|
||||
<mysql.port>3306</mysql.port>
|
||||
@@ -514,7 +588,6 @@
|
||||
<app.properties.test.include>**</app.properties.test.include>
|
||||
<app.properties.test.folder>src/test/properties/local</app.properties.test.folder>
|
||||
|
||||
<fabric8.maven.version>3.5.37</fabric8.maven.version>
|
||||
<image.name>imageNameNotSet</image.name>
|
||||
<image.tag>latest</image.tag>
|
||||
<image.registry>quay.io</image.registry>
|
||||
@@ -597,13 +670,17 @@
|
||||
<configuration>
|
||||
<rules>
|
||||
<requireJavaVersion>
|
||||
<version>[1.8.0,)</version>
|
||||
<version>[${java.version},)</version>
|
||||
</requireJavaVersion>
|
||||
</rules>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>build-helper-maven-plugin</artifactId>
|
||||
@@ -616,14 +693,14 @@
|
||||
<configuration>
|
||||
<regexPropertySettings>
|
||||
<regexPropertySetting>
|
||||
<name>rm.module.repo.version.min</name>
|
||||
<name>ags.module.repo.version.min</name>
|
||||
<value>${alfresco.version}</value>
|
||||
<regex>(\d+)\.(\d+).*</regex>
|
||||
<replacement>$1.$2</replacement>
|
||||
<failIfNoMatch>false</failIfNoMatch>
|
||||
</regexPropertySetting>
|
||||
<regexPropertySetting>
|
||||
<name>rm.module.version</name>
|
||||
<name>ags.module.version</name>
|
||||
<value>${project.version}</value>
|
||||
<regex>([0-9\.]*[0-9]).*</regex>
|
||||
<replacement>$1</replacement>
|
||||
@@ -832,8 +909,8 @@
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>${maven.compiler.version}</version>
|
||||
<configuration>
|
||||
<source>${maven.build.sourceVersion}</source>
|
||||
<target>${maven.build.sourceVersion}</target>
|
||||
<source>${maven.compiler.source}</source>
|
||||
<target>${maven.compiler.target}</target>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
@@ -843,8 +920,8 @@
|
||||
<goal>testCompile</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<source>${maven.build.testSourceVersion}</source>
|
||||
<target>${maven.build.testSourceVersion}</target>
|
||||
<source>${testJavaVersion}</source>
|
||||
<target>${testJavaVersion}</target>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
@@ -939,7 +1016,7 @@
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<configuration>
|
||||
<doclint>none</doclint>
|
||||
<source>8</source>
|
||||
<source>${java.version}</source>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
@@ -1040,6 +1117,12 @@
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
<version>${maven.war.plugin.version}</version>
|
||||
<dependencies>
|
||||
<!-- Needed when creating the community and enterprise rest api wars -->
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-compress</artifactId>
|
||||
<version>1.18</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.alfresco.maven.plugin</groupId>
|
||||
<artifactId>alfresco-maven-plugin</artifactId>
|
||||
|
@@ -1,14 +1,14 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>alfresco-rm-automation</artifactId>
|
||||
<name>Alfresco Records Management Automation</name>
|
||||
<artifactId>alfresco-governance-services-automation</artifactId>
|
||||
<name>Alfresco Governance Services Automation</name>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-rm</artifactId>
|
||||
<version>3.0.2</version>
|
||||
<artifactId>alfresco-governance-services</artifactId>
|
||||
<version>3.2.0.3</version>
|
||||
</parent>
|
||||
|
||||
<licenses>
|
||||
@@ -24,8 +24,6 @@
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>1.8</maven.compiler.source>
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
<suiteXmlFile>testng.xml</suiteXmlFile>
|
||||
<skip.automationtests>true</skip.automationtests>
|
||||
</properties>
|
||||
@@ -131,7 +129,7 @@
|
||||
</build>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>apply-rm-community</id>
|
||||
<id>apply-ags-community</id>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
@@ -147,13 +145,13 @@
|
||||
<artifactItems>
|
||||
<artifactItem>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-rm-community-share</artifactId>
|
||||
<artifactId>alfresco-governance-services-community-share</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<type>amp</type>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-rm-community-repo</artifactId>
|
||||
<artifactId>alfresco-governance-services-community-repo</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<type>amp</type>
|
||||
</artifactItem>
|
||||
@@ -178,7 +176,7 @@
|
||||
<configuration>
|
||||
<backup>true</backup>
|
||||
<ampLocation>
|
||||
${project.build.directory}/amps/alfresco-rm-community-repo-${project.version}.amp
|
||||
${project.build.directory}/amps/alfresco-governance-services-community-repo-${project.version}.amp
|
||||
</ampLocation>
|
||||
<warLocation>${project.build.directory}/alf-installation/tomcat/webapps/alfresco.war
|
||||
</warLocation>
|
||||
@@ -193,7 +191,7 @@
|
||||
<configuration>
|
||||
<backup>true</backup>
|
||||
<ampLocation>
|
||||
${project.build.directory}/amps/alfresco-rm-community-share-${project.version}.amp
|
||||
${project.build.directory}/amps/alfresco-governance-services-community-share-${project.version}.amp
|
||||
</ampLocation>
|
||||
<warLocation>${project.build.directory}/alf-installation/tomcat/webapps/share.war
|
||||
</warLocation>
|
||||
@@ -205,7 +203,7 @@
|
||||
</build>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>apply-rm-enterprise</id>
|
||||
<id>apply-ags-enterprise</id>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
@@ -221,13 +219,13 @@
|
||||
<artifactItems>
|
||||
<artifactItem>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>${alfresco.rm.share}</artifactId>
|
||||
<artifactId>${ags.share}</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<type>amp</type>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>${alfresco.rm.repo}</artifactId>
|
||||
<artifactId>${ags.repo}</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<type>amp</type>
|
||||
</artifactItem>
|
||||
@@ -251,7 +249,7 @@
|
||||
<phase>process-test-resources</phase>
|
||||
<configuration>
|
||||
<backup>true</backup>
|
||||
<ampLocation>${project.build.directory}/amps/${alfresco.rm.repo}-${project.version}.amp</ampLocation>
|
||||
<ampLocation>${project.build.directory}/amps/${ags.repo}-${project.version}.amp</ampLocation>
|
||||
<warLocation>${project.build.directory}/alf-installation/tomcat/webapps/alfresco.war</warLocation>
|
||||
</configuration>
|
||||
</execution>
|
||||
@@ -263,7 +261,7 @@
|
||||
<phase>process-test-resources</phase>
|
||||
<configuration>
|
||||
<backup>true</backup>
|
||||
<ampLocation>${project.build.directory}/amps/${alfresco.rm.share}-${project.version}.amp</ampLocation>
|
||||
<ampLocation>${project.build.directory}/amps/${ags.share}-${project.version}.amp</ampLocation>
|
||||
<warLocation>${project.build.directory}/alf-installation/tomcat/webapps/share.war</warLocation>
|
||||
</configuration>
|
||||
</execution>
|
||||
|
@@ -2,22 +2,22 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>alfresco-rm-automation-community-rest-api</artifactId>
|
||||
<name>Alfresco Records Management Automation Community REST API</name>
|
||||
<artifactId>alfresco-governance-services-automation-community-rest-api</artifactId>
|
||||
<name>Alfresco Governance Services Automation Community REST API</name>
|
||||
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-rm-automation</artifactId>
|
||||
<version>3.0.2</version>
|
||||
<artifactId>alfresco-governance-services-automation</artifactId>
|
||||
<version>3.2.0.3</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<maven.build.sourceVersion>1.8</maven.build.sourceVersion>
|
||||
<maven.javadoc.skip>false</maven.javadoc.skip>
|
||||
<alfresco.rm.share>alfresco-rm-community-share</alfresco.rm.share>
|
||||
<alfresco.rm.repo>alfresco-rm-community-repo</alfresco.rm.repo>
|
||||
<tas.restapi.version>6.0.0.3</tas.restapi.version>
|
||||
<ags.share>alfresco-governance-services-community-share</ags.share>
|
||||
<ags.repo>alfresco-governance-services-community-repo</ags.repo>
|
||||
<tas.restapi.version>6.0.1.2</tas.restapi.version>
|
||||
<fluent.json.version>2.0.0</fluent.json.version>
|
||||
<jackson.databind.version>2.7.7</jackson.databind.version>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
@@ -46,16 +46,34 @@
|
||||
</build>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-log4j12</artifactId>
|
||||
<version>1.7.26</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.alfresco.tas</groupId>
|
||||
<artifactId>restapi-test</artifactId>
|
||||
<version>${tas.restapi.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.alfresco.tas</groupId>
|
||||
<artifactId>restapi-test</artifactId>
|
||||
<version>${tas.restapi.version}</version>
|
||||
<type>test-jar</type>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
@@ -79,5 +97,15 @@
|
||||
<artifactId>commons-collections4</artifactId>
|
||||
<version>4.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.docker-java</groupId>
|
||||
<artifactId>docker-java</artifactId>
|
||||
<version>3.0.14</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
<version>${jackson.databind.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
@@ -56,4 +56,7 @@ public class RMRestProperties extends RestProperties
|
||||
|
||||
@Value ("${rest.rmPath}")
|
||||
private String restRmPath;
|
||||
|
||||
@Value ("${docker.host}")
|
||||
private String dockerHost;
|
||||
}
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
@@ -26,7 +26,7 @@
|
||||
*/
|
||||
package org.alfresco.rest.core;
|
||||
|
||||
import com.jayway.restassured.builder.RequestSpecBuilder;
|
||||
import io.restassured.builder.RequestSpecBuilder;
|
||||
|
||||
import org.alfresco.rest.exception.EmptyJsonResponseException;
|
||||
import org.alfresco.rest.model.RestErrorModel;
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
@@ -34,6 +34,7 @@ import org.alfresco.rest.requests.Node;
|
||||
import org.alfresco.rest.requests.coreAPI.RestCoreAPI;
|
||||
import org.alfresco.rest.requests.search.SearchAPI;
|
||||
import org.alfresco.rest.rm.community.requests.gscore.GSCoreAPI;
|
||||
import org.alfresco.rest.rm.community.requests.gscore.api.ActionsExecutionAPI;
|
||||
import org.alfresco.rest.rm.community.requests.gscore.api.FilePlanAPI;
|
||||
import org.alfresco.rest.rm.community.requests.gscore.api.FilesAPI;
|
||||
import org.alfresco.rest.rm.community.requests.gscore.api.RMSiteAPI;
|
||||
@@ -225,4 +226,14 @@ public class RestAPIFactory
|
||||
{
|
||||
return getGSCoreAPI(userModel).usingUnfiledRecordFolder();
|
||||
}
|
||||
|
||||
public ActionsExecutionAPI getActionsAPI(UserModel userModel)
|
||||
{
|
||||
return getGSCoreAPI(userModel).usingActionsExecutionsAPI();
|
||||
}
|
||||
|
||||
public ActionsExecutionAPI getActionsAPI()
|
||||
{
|
||||
return getGSCoreAPI(null).usingActionsExecutionsAPI();
|
||||
}
|
||||
}
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
@@ -26,12 +26,18 @@
|
||||
*/
|
||||
package org.alfresco.rest.core.v0;
|
||||
|
||||
import javax.json.Json;
|
||||
import javax.json.JsonReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.format.DateTimeFormatterBuilder;
|
||||
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.http.HttpEntity;
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.ParseException;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -76,4 +82,40 @@ public class APIUtils
|
||||
LOGGER.info("Response body:\n{}", source);
|
||||
return new JSONObject(source);
|
||||
}
|
||||
|
||||
/**
|
||||
* Util method to extract the message string from the HTTP response
|
||||
*
|
||||
* @param httpResponse http response
|
||||
* @return error message from the http response
|
||||
*/
|
||||
public static String extractErrorMessageFromHttpResponse(HttpResponse httpResponse)
|
||||
{
|
||||
final HttpEntity entity = httpResponse.getEntity();
|
||||
JsonReader reader = null;
|
||||
try
|
||||
{
|
||||
final InputStream responseStream = entity.getContent();
|
||||
reader = Json.createReader(responseStream);
|
||||
return reader.readObject().getString("message");
|
||||
}
|
||||
catch (JSONException error)
|
||||
{
|
||||
|
||||
LOGGER.error("Converting message body to JSON failed. Body: {}", httpResponse, error);
|
||||
}
|
||||
catch (ParseException | IOException error)
|
||||
{
|
||||
|
||||
LOGGER.error("Parsing message body failed.", error);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (reader != null)
|
||||
{
|
||||
reader.close();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
@@ -81,7 +81,7 @@ public abstract class BaseAPI
|
||||
protected static final String UPDATE_METADATA_API = "{0}node/{1}/formprocessor";
|
||||
protected static final String ACTIONS_API = "{0}actionQueue";
|
||||
protected static final String RM_ACTIONS_API = "{0}rma/actions/ExecutionQueue";
|
||||
protected static final String RM_SITE_ID = "rm";
|
||||
public static final String RM_SITE_ID = "rm";
|
||||
protected static final String SHARE_ACTION_API = "{0}internal/shared/share/workspace/SpacesStore/{1}";
|
||||
private static final String SLINGSHOT_PREFIX = "alfresco/s/slingshot/";
|
||||
|
||||
@@ -702,6 +702,7 @@ public abstract class BaseAPI
|
||||
public enum RM_ACTIONS
|
||||
{
|
||||
EDIT_DISPOSITION_DATE("editDispositionActionAsOfDate"),
|
||||
END_RETENTION("retain"),
|
||||
CUT_OFF("cutoff"),
|
||||
UNDO_CUT_OFF("undoCutoff"),
|
||||
TRANSFER("transfer"),
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
@@ -36,4 +36,10 @@ public class FilePlanComponentAspects
|
||||
{
|
||||
// aspect present on completed records
|
||||
public static final String ASPECTS_COMPLETED_RECORD = "rma:declaredRecord";
|
||||
|
||||
// aspect present on record folders/categories with vital records
|
||||
public static final String ASPECTS_VITAL_RECORD_DEFINITION= "rma:vitalRecordDefinition";
|
||||
|
||||
// aspect present on vital records
|
||||
public static final String ASPECTS_VITAL_RECORD = "rma:vitalRecord";
|
||||
}
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
@@ -82,6 +82,7 @@ public class FilePlanComponentFields
|
||||
public static final String PROPERTIES_CLASSIFICATION = "sc:classification";
|
||||
public static final String PROPERTIES_DATE_FILED = "rma:dateFiled";
|
||||
public static final String PROPERTIES_ORIGINAL_NAME = "rma:origionalName";
|
||||
public static final String PROPERTIES_REVIEW_AS_OF = "rma:reviewAsOf";
|
||||
|
||||
/** Electronic record properties */
|
||||
public static final String PROPERTIES_VERSION_TYPE = "cm:versionType";
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -0,0 +1,56 @@
|
||||
/*-
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
* -
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
* -
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
* -
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
package org.alfresco.rest.rm.community.model.hold;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.alfresco.utility.model.TestModel;
|
||||
|
||||
/**
|
||||
* POJO for hold entry
|
||||
*
|
||||
* @author Rodica Sutu
|
||||
* @since 3.2
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@JsonIgnoreProperties (ignoreUnknown = true)
|
||||
public class HoldEntry extends TestModel
|
||||
{
|
||||
@JsonProperty (required = true)
|
||||
private String name;
|
||||
|
||||
@JsonProperty (required = true)
|
||||
private String nodeRef;
|
||||
}
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
@@ -60,7 +60,11 @@ import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanCo
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_RECORD_SEARCH_DISPOSITION_PERIOD;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_RECORD_SEARCH_DISPOSITION_PERIOD_EXPRESSION;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_RECORD_SEARCH_HAS_DISPOSITION_SCHEDULE;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_RECORD_SEARCH_VITAL_RECORD_REVIEW_PERIOD;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_RECORD_SEARCH_VITAL_RECORD_REVIEW_PERIOD_EXPRESSION;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_RESOLUTION_UNIT;
|
||||
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_REVIEW_AS_OF;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_ROOT_NODE_REF;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_SHELF;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_SOFTWARE;
|
||||
@@ -77,14 +81,13 @@ import java.util.List;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import org.alfresco.rest.rm.community.model.common.Owner;
|
||||
import org.alfresco.utility.model.TestModel;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.alfresco.rest.rm.community.model.common.Owner;
|
||||
import org.alfresco.utility.model.TestModel;
|
||||
|
||||
/**
|
||||
* POJO for record properties
|
||||
@@ -237,4 +240,13 @@ public class RecordProperties extends TestModel
|
||||
|
||||
@JsonProperty (PROPERTIES_RECORD_SEARCH_DISPOSITION_INSTRUCTIONS)
|
||||
private String recordSearchDispositionInstructions;
|
||||
|
||||
@JsonProperty (PROPERTIES_RECORD_SEARCH_VITAL_RECORD_REVIEW_PERIOD)
|
||||
private String recordSearchVitalRecordReviewPeriod;
|
||||
|
||||
@JsonProperty (PROPERTIES_RECORD_SEARCH_VITAL_RECORD_REVIEW_PERIOD_EXPRESSION)
|
||||
private String recordSearchVitalRecordReviewPeriodExpression;
|
||||
|
||||
@JsonProperty(PROPERTIES_REVIEW_AS_OF)
|
||||
private Date reviewAsOf;
|
||||
}
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
@@ -33,6 +33,10 @@ import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanCo
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_IS_CLOSED;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_LOCATION;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_OWNER;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields
|
||||
.PROPERTIES_RECORD_SEARCH_DISPOSITION_AUTHORITY;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields
|
||||
.PROPERTIES_RECORD_SEARCH_DISPOSITION_INSTRUCTIONS;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_RECORD_SEARCH_HAS_DISPOSITION_SCHEDULE;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_RECORD_SEARCH_VITAL_RECORD_REVIEW_PERIOD;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_RECORD_SEARCH_VITAL_RECORD_REVIEW_PERIOD_EXPRESSION;
|
||||
@@ -120,4 +124,11 @@ public class RecordFolderProperties extends TestModel
|
||||
|
||||
@JsonProperty (PROPERTIES_RECORD_SEARCH_VITAL_RECORD_REVIEW_PERIOD_EXPRESSION)
|
||||
private String recordSearchVitalRecordReviewPeriodExpression;
|
||||
|
||||
@JsonProperty (PROPERTIES_RECORD_SEARCH_DISPOSITION_AUTHORITY)
|
||||
private String recordSearchDispositionAuthority;
|
||||
|
||||
@JsonProperty (PROPERTIES_RECORD_SEARCH_DISPOSITION_INSTRUCTIONS)
|
||||
private String recordSearchDispositionInstructions;
|
||||
|
||||
}
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
@@ -45,7 +45,7 @@ public class RuleDefinition
|
||||
private String contentTitle;
|
||||
private String contentDescription;
|
||||
private String rejectReason;
|
||||
private List<ActionsOnRule> actions;
|
||||
private List<String> actions;
|
||||
|
||||
/**
|
||||
* Creates a new object of type Rule Definition
|
||||
@@ -189,15 +189,15 @@ public class RuleDefinition
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public List<ActionsOnRule> getActions()
|
||||
public List<String> getActions()
|
||||
{
|
||||
return actions;
|
||||
}
|
||||
|
||||
public RuleDefinition actions(List<ActionsOnRule> actions)
|
||||
public RuleDefinition actions(List<String> actions)
|
||||
{
|
||||
this.actions = actions;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
@@ -29,6 +29,7 @@ package org.alfresco.rest.rm.community.model.unfiledcontainer;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_IDENTIFIER;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_ROOT_NODE_REF;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import org.alfresco.utility.model.TestModel;
|
||||
@@ -50,6 +51,7 @@ import lombok.NoArgsConstructor;
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@JsonIgnoreProperties (ignoreUnknown = true)
|
||||
public class UnfiledContainerProperties extends TestModel
|
||||
{
|
||||
/*************************/
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
@@ -41,14 +41,14 @@ import lombok.Setter;
|
||||
* @author Tuna Aksoy
|
||||
* @since 2.6
|
||||
*/
|
||||
public abstract class RMModelRequest extends ModelRequest<RMModelRequest>
|
||||
public abstract class RMModelRequest<Request> extends ModelRequest<Request>
|
||||
{
|
||||
@Getter (value = PROTECTED)
|
||||
@Setter (value = PRIVATE)
|
||||
private RMRestWrapper rmRestWrapper;
|
||||
|
||||
/**
|
||||
* @param restWrapper
|
||||
* @param rmRestWrapper
|
||||
*/
|
||||
public RMModelRequest(RMRestWrapper rmRestWrapper)
|
||||
{
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
@@ -29,10 +29,11 @@ package org.alfresco.rest.rm.community.requests.gscore;
|
||||
import static java.lang.Integer.parseInt;
|
||||
import static java.lang.String.format;
|
||||
|
||||
import com.jayway.restassured.RestAssured;
|
||||
import io.restassured.RestAssured;
|
||||
|
||||
import org.alfresco.rest.core.RMRestProperties;
|
||||
import org.alfresco.rest.core.RMRestWrapper;
|
||||
import org.alfresco.rest.rm.community.requests.gscore.api.ActionsExecutionAPI;
|
||||
import org.alfresco.rest.rm.community.requests.RMModelRequest;
|
||||
import org.alfresco.rest.rm.community.requests.gscore.api.FilePlanAPI;
|
||||
import org.alfresco.rest.rm.community.requests.gscore.api.FilesAPI;
|
||||
@@ -179,4 +180,14 @@ public class GSCoreAPI extends RMModelRequest
|
||||
{
|
||||
return new RMUserAPI(getRmRestWrapper());
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides DSL for ActionExecution API
|
||||
*
|
||||
* @return {@link ActionsExecutionAPI}
|
||||
*/
|
||||
public ActionsExecutionAPI usingActionsExecutionsAPI()
|
||||
{
|
||||
return new ActionsExecutionAPI(getRmRestWrapper());
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
* -
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
* -
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
* -
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
package org.alfresco.rest.rm.community.requests.gscore.api;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
import org.alfresco.rest.core.RMRestWrapper;
|
||||
import org.alfresco.rest.rm.community.model.rules.ActionsOnRule;
|
||||
import org.alfresco.rest.rm.community.requests.RMModelRequest;
|
||||
import org.alfresco.utility.model.RepoTestModel;
|
||||
import org.json.JSONObject;
|
||||
|
||||
/**
|
||||
* Produces processed results from Core Actions API calls
|
||||
*
|
||||
* @author Claudia Agache
|
||||
* @since 3.1
|
||||
*/
|
||||
public class ActionsExecutionAPI extends RMModelRequest
|
||||
{
|
||||
/**
|
||||
* @param rmRestWrapper RM REST Wrapper
|
||||
*/
|
||||
public ActionsExecutionAPI(RMRestWrapper rmRestWrapper)
|
||||
{
|
||||
super(rmRestWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* Declares and files a document as record to a record folder using v1 actions api
|
||||
*
|
||||
* @param targetNode the node on which the action is executed
|
||||
* @param destinationPath the path to the record folder
|
||||
* @throws Exception
|
||||
*/
|
||||
public JSONObject declareAndFile(RepoTestModel targetNode, String destinationPath) throws Exception
|
||||
{
|
||||
return getRmRestWrapper().withCoreAPI().usingActions()
|
||||
.executeAction(ActionsOnRule.DECLARE_AS_RECORD.getActionValue(), targetNode,
|
||||
ImmutableMap.of("path", destinationPath));
|
||||
}
|
||||
|
||||
/**
|
||||
* Declares a document as record using v1 actions api
|
||||
*
|
||||
* @param targetNode the node on which the action is executed
|
||||
* @throws Exception
|
||||
*/
|
||||
public JSONObject declareAsRecord(RepoTestModel targetNode) throws Exception
|
||||
{
|
||||
return getRmRestWrapper().withCoreAPI().usingActions()
|
||||
.executeAction(ActionsOnRule.DECLARE_AS_RECORD.getActionValue(), targetNode);
|
||||
}
|
||||
}
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
@@ -54,7 +54,7 @@ public class FilePlanAPI extends RMModelRequest
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param restWrapper
|
||||
* @param rmRestWrapper RM REST Wrapper
|
||||
*/
|
||||
public FilePlanAPI(RMRestWrapper rmRestWrapper)
|
||||
{
|
||||
@@ -77,7 +77,7 @@ public class FilePlanAPI extends RMModelRequest
|
||||
* @param filePlanId The identifier of a file plan
|
||||
* @param parameters The URL parameters to add
|
||||
* @return The {@link FilePlan} for the given {@code filePlanId}
|
||||
* @throws Exception for the following cases:
|
||||
* @throws RuntimeException for the following cases:
|
||||
* <ul>
|
||||
* <li>{@code filePlanId} is not a valid format</li>
|
||||
* <li>authentication fails</li>
|
||||
@@ -113,7 +113,7 @@ public class FilePlanAPI extends RMModelRequest
|
||||
* @param filePlanId The identifier of a file plan
|
||||
* @param parameters The URL parameters to add
|
||||
* @return The {@link RecordCategoryCollection} for the given {@code filePlanId}
|
||||
* @throws Exception for the following cases:
|
||||
* @throws RuntimeException for the following cases:
|
||||
* <ul>
|
||||
* <li>authentication fails</li>
|
||||
* <li>current user does not have permission to read {@code filePlanId}</li>
|
||||
@@ -177,7 +177,7 @@ public class FilePlanAPI extends RMModelRequest
|
||||
/**
|
||||
* see {@link #updateFilePlan(FilePlan, String, String)
|
||||
*/
|
||||
public FilePlan updateFilePlan(FilePlan filePlanModel, String filePlanId) throws Exception
|
||||
public FilePlan updateFilePlan(FilePlan filePlanModel, String filePlanId)
|
||||
{
|
||||
mandatoryObject("filePlanModel", filePlanModel);
|
||||
mandatoryString("filePlanId", filePlanId);
|
||||
@@ -191,7 +191,7 @@ public class FilePlanAPI extends RMModelRequest
|
||||
* @param filePlanModel The file plan model which holds the information
|
||||
* @param filePlanId The identifier of the file plan
|
||||
* @param parameters The URL parameters to add
|
||||
* @throws Exception for the following cases:
|
||||
* @throws RuntimeException for the following cases:
|
||||
* <ul>
|
||||
* <li>the update request is invalid or {@code filePlanId} is not a valid format or {@code filePlanModel} is invalid</li>
|
||||
* <li>authentication fails</li>
|
||||
@@ -200,7 +200,7 @@ public class FilePlanAPI extends RMModelRequest
|
||||
* <li>model integrity exception, including file name with invalid characters</li>
|
||||
* </ul>
|
||||
*/
|
||||
public FilePlan updateFilePlan(FilePlan filePlanModel, String filePlanId, String parameters) throws Exception
|
||||
public FilePlan updateFilePlan(FilePlan filePlanModel, String filePlanId, String parameters)
|
||||
{
|
||||
mandatoryObject("filePlanModel", filePlanModel);
|
||||
mandatoryString("filePlanId", filePlanId);
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
@@ -41,10 +41,12 @@ import org.alfresco.rest.rm.community.requests.RMModelRequest;
|
||||
* @author Kristijan Conkas
|
||||
* @since 2.6
|
||||
*/
|
||||
public class FilesAPI extends RMModelRequest
|
||||
public class FilesAPI extends RMModelRequest<FilesAPI>
|
||||
{
|
||||
public static final String PARENT_ID_PARAM = "parentId";
|
||||
|
||||
/**
|
||||
* @param rmRestWrapper
|
||||
* @param rmRestWrapper RM REST Wrapper
|
||||
*/
|
||||
public FilesAPI(RMRestWrapper rmRestWrapper)
|
||||
{
|
||||
@@ -55,11 +57,10 @@ public class FilesAPI extends RMModelRequest
|
||||
* Declare file as record
|
||||
*
|
||||
* @param fileId The Id of a file to declare as record
|
||||
* @param parameters Request parameters, refer to API documentation for more details
|
||||
* @return The {@link Record} for created record
|
||||
* @throws Exception for malformed JSON responses
|
||||
* @throws RuntimeException for malformed JSON responses
|
||||
*/
|
||||
public Record declareAsRecord(String fileId, String parameters) throws Exception
|
||||
public Record declareAsRecord(String fileId)
|
||||
{
|
||||
mandatoryString("fileId", fileId);
|
||||
|
||||
@@ -67,22 +68,8 @@ public class FilesAPI extends RMModelRequest
|
||||
POST,
|
||||
"/files/{fileId}/declare?{parameters}",
|
||||
fileId,
|
||||
parameters
|
||||
getRmRestWrapper().getParameters()
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* A no-parameter version of {@link FilesAPI#declareAsRecord}
|
||||
*
|
||||
* @param fileId The Id of a file to declare as record
|
||||
* @return The {@link Record} for created record
|
||||
* @throws Exception for malformed JSON responses
|
||||
*/
|
||||
public Record declareAsRecord(String fileId) throws Exception
|
||||
{
|
||||
mandatoryString("fileId", fileId);
|
||||
|
||||
return declareAsRecord(fileId, EMPTY);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
@@ -62,7 +62,7 @@ public class RMSiteAPI extends RMModelRequest
|
||||
* Get the RM site
|
||||
*
|
||||
* @return The {@link RMSite} for the given file plan component id
|
||||
* @throws Exception for the following cases:
|
||||
* @throws RuntimeException for the following cases:
|
||||
* <ul>
|
||||
* <li>Api Response code 400 Invalid parameter: GET request is supported only for the RM site</li>
|
||||
* <li>Api Response code 401 If authentication failed</li>
|
||||
@@ -70,7 +70,7 @@ public class RMSiteAPI extends RMModelRequest
|
||||
* <li>Api Response code default Unexpected error</li>
|
||||
* </ul>
|
||||
*/
|
||||
public RMSite getSite() throws Exception
|
||||
public RMSite getSite()
|
||||
{
|
||||
return getRmRestWrapper().processModel(RMSite.class, simpleRequest(
|
||||
GET,
|
||||
@@ -83,7 +83,7 @@ public class RMSiteAPI extends RMModelRequest
|
||||
*
|
||||
* @param rmSite The properties of the rm site to be created
|
||||
* @return The {@link RMSite} with the given properties
|
||||
* @throws Exception for the following cases:
|
||||
* @throws RuntimeException for the following cases:
|
||||
* <ul>
|
||||
* <li>Api Response code 400 Invalid parameter: title, or description exceed the maximum length; or siteBodyCreate invalid</li>
|
||||
* <li>Api Response code 401 If authentication failed</
|
||||
@@ -91,7 +91,7 @@ public class RMSiteAPI extends RMModelRequest
|
||||
* <li>Api Response code default Unexpected error</li>
|
||||
* </ul>
|
||||
*/
|
||||
public RMSite createRMSite(RMSite rmSiteModel) throws Exception
|
||||
public RMSite createRMSite(RMSite rmSiteModel)
|
||||
{
|
||||
mandatoryObject("rmSiteModel", rmSiteModel);
|
||||
|
||||
@@ -104,7 +104,7 @@ public class RMSiteAPI extends RMModelRequest
|
||||
|
||||
/**
|
||||
* Delete RM site
|
||||
* @throws Exception for the following cases:
|
||||
* @throws RuntimeException for the following cases:
|
||||
* <ul>
|
||||
* <li>Api Response code 400 Invalid parameter: DELETE request is supported only for the RM site</li>
|
||||
* <li>Api Response code 401 If authentication failed</
|
||||
@@ -113,7 +113,7 @@ public class RMSiteAPI extends RMModelRequest
|
||||
* <li>Api Response code default Unexpected error</li>
|
||||
* </ul>
|
||||
*/
|
||||
public void deleteRMSite() throws Exception
|
||||
public void deleteRMSite()
|
||||
{
|
||||
getRmRestWrapper().processEmptyModel(simpleRequest(
|
||||
DELETE,
|
||||
@@ -126,7 +126,7 @@ public class RMSiteAPI extends RMModelRequest
|
||||
*
|
||||
* @param rmSiteProperties The properties to be updated
|
||||
* @return The updated {@link RMSite}
|
||||
* @throws Exception for the following cases:
|
||||
* @throws RuntimeException for the following cases:
|
||||
* <ul>
|
||||
* <li>Api Response code 400 the update request is invalid {@code rmSiteModel} is invalid</li>
|
||||
* <li>Api Response code 401 If authentication fails</li>
|
||||
@@ -135,7 +135,7 @@ public class RMSiteAPI extends RMModelRequest
|
||||
* <li>Api Response code default Unexpected error,model integrity exception</li>
|
||||
* </ul>
|
||||
*/
|
||||
public RMSite updateRMSite(RMSite rmSiteModel) throws Exception
|
||||
public RMSite updateRMSite(RMSite rmSiteModel)
|
||||
{
|
||||
mandatoryObject("rmSiteProperties", rmSiteModel);
|
||||
|
||||
@@ -150,7 +150,7 @@ public class RMSiteAPI extends RMModelRequest
|
||||
* Checks if the RM site exists or not
|
||||
*
|
||||
* @return <code>true</code> if the RM site exists, <code>false</code> otherwise
|
||||
* @throws Exception for the following cases:
|
||||
* @throws RuntimeException for the following cases:
|
||||
* <ul>
|
||||
* <li>Api Response code 400 Invalid parameter: GET request is supported only for the RM site</li>
|
||||
* <li>Api Response code 401 If authentication failed</li>
|
||||
@@ -158,7 +158,7 @@ public class RMSiteAPI extends RMModelRequest
|
||||
* <li>Api Response code default Unexpected error</li>
|
||||
* </ul>
|
||||
*/
|
||||
public boolean existsRMSite() throws Exception
|
||||
public boolean existsRMSite()
|
||||
{
|
||||
getSite();
|
||||
return getRmRestWrapper().getStatusCode().equals(OK.toString());
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
@@ -26,17 +26,17 @@
|
||||
*/
|
||||
package org.alfresco.rest.rm.community.requests.gscore.api;
|
||||
|
||||
import static com.jayway.restassured.RestAssured.basic;
|
||||
import static com.jayway.restassured.RestAssured.given;
|
||||
|
||||
import static org.jglue.fluentjson.JsonBuilderFactory.buildObject;
|
||||
import static org.springframework.http.HttpStatus.OK;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import com.jayway.restassured.builder.RequestSpecBuilder;
|
||||
import com.jayway.restassured.http.ContentType;
|
||||
import com.jayway.restassured.response.Response;
|
||||
import com.jayway.restassured.specification.RequestSpecification;
|
||||
|
||||
import io.restassured.builder.RequestSpecBuilder;
|
||||
import io.restassured.http.ContentType;
|
||||
import io.restassured.response.Response;
|
||||
import io.restassured.specification.RequestSpecification;
|
||||
import static io.restassured.RestAssured.basic;
|
||||
import static io.restassured.RestAssured.given;
|
||||
|
||||
import org.alfresco.dataprep.AlfrescoHttpClient;
|
||||
import org.alfresco.dataprep.AlfrescoHttpClientFactory;
|
||||
@@ -59,7 +59,7 @@ import org.alfresco.utility.model.UserModel;
|
||||
public class RMUserAPI extends RMModelRequest
|
||||
{
|
||||
/**
|
||||
* @param rmRestWrapper
|
||||
* @param rmRestWrapper RM REST Wrapper
|
||||
*/
|
||||
public RMUserAPI(RMRestWrapper rmRestWrapper)
|
||||
{
|
||||
@@ -87,6 +87,7 @@ public class RMUserAPI extends RMModelRequest
|
||||
*
|
||||
* @param userName User's username
|
||||
* @param userRole User's RM role, one of {@link UserRoles} roles
|
||||
* @throws RuntimeException for failed requests
|
||||
*/
|
||||
public void assignRoleToUser(String userName, String userRole)
|
||||
{
|
||||
@@ -131,7 +132,7 @@ public class RMUserAPI extends RMModelRequest
|
||||
JsonObject bodyJson = buildObject()
|
||||
.addArray("permissions")
|
||||
.addObject()
|
||||
.add("authority", (user != null ? user.getUsername() : null))
|
||||
.add("authority", user.getUsername())
|
||||
.add("role", permission.permissionId)
|
||||
.end()
|
||||
.getJson();
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
@@ -54,7 +54,7 @@ public class RecordCategoryAPI extends RMModelRequest
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param restWrapper
|
||||
* @param rmRestWrapper RM REST Wrapper
|
||||
*/
|
||||
public RecordCategoryAPI(RMRestWrapper rmRestWrapper)
|
||||
{
|
||||
@@ -65,7 +65,7 @@ public class RecordCategoryAPI extends RMModelRequest
|
||||
* Deletes a record category.
|
||||
*
|
||||
* @param recordCategoryId The identifier of a record category
|
||||
* @throws Exception for the following cases:
|
||||
* @throws RuntimeException for the following cases:
|
||||
* <ul>
|
||||
* <li>{@code recordCategoryId} is not a valid format</li>
|
||||
* <li>authentication fails</li>
|
||||
@@ -101,7 +101,7 @@ public class RecordCategoryAPI extends RMModelRequest
|
||||
* @param recordCategoryId The identifier of a record category
|
||||
* @param parameters The URL parameters to add
|
||||
* @return The {@link RecordCategory} for the given {@code recordCategoryId}
|
||||
* @throws Exception for the following cases:
|
||||
* @throws RuntimeException for the following cases:
|
||||
* <ul>
|
||||
* <li>{@code recordCategoryId} is not a valid format</li>
|
||||
* <li>authentication fails</li>
|
||||
@@ -124,7 +124,7 @@ public class RecordCategoryAPI extends RMModelRequest
|
||||
/**
|
||||
* see {@link #updateRecordCategory(RecordCategory, String, String)
|
||||
*/
|
||||
public RecordCategory updateRecordCategory(RecordCategory recordCategoryModel, String recordCategoryId) throws Exception
|
||||
public RecordCategory updateRecordCategory(RecordCategory recordCategoryModel, String recordCategoryId)
|
||||
{
|
||||
mandatoryObject("recordCategoryModel", recordCategoryModel);
|
||||
mandatoryString("recordCategoryId", recordCategoryId);
|
||||
@@ -139,7 +139,7 @@ public class RecordCategoryAPI extends RMModelRequest
|
||||
* @param recordCategoryId The identifier of a record category
|
||||
* @param parameters The URL parameters to add
|
||||
* @param returns The updated {@link RecordCategory}
|
||||
* @throws Exception for the following cases:
|
||||
* @throws RuntimeException for the following cases:
|
||||
* <ul>
|
||||
* <li>the update request is invalid or {@code recordCategoryId} is not a valid format or {@code recordCategoryModel} is invalid</li>
|
||||
* <li>authentication fails</li>
|
||||
@@ -149,7 +149,7 @@ public class RecordCategoryAPI extends RMModelRequest
|
||||
* <li>model integrity exception, including file name with invalid characters</li>
|
||||
* </ul>
|
||||
*/
|
||||
public RecordCategory updateRecordCategory(RecordCategory recordCategoryModel, String recordCategoryId, String parameters) throws Exception
|
||||
public RecordCategory updateRecordCategory(RecordCategory recordCategoryModel, String recordCategoryId, String parameters)
|
||||
{
|
||||
mandatoryObject("recordCategoryModel", recordCategoryModel);
|
||||
mandatoryString("recordCategoryId", recordCategoryId);
|
||||
@@ -179,7 +179,7 @@ public class RecordCategoryAPI extends RMModelRequest
|
||||
* @param recordCategoryId The identifier of a record category
|
||||
* @param parameters The URL parameters to add
|
||||
* @return The {@link RecordCategoryChildCollection} for the given {@code recordCategoryId}
|
||||
* @throws Exception for the following cases:
|
||||
* @throws RuntimeException for the following cases:
|
||||
* <ul>
|
||||
* <li>authentication fails</li>
|
||||
* <li>current user does not have permission to read {@code recordCategoryId}</li>
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
@@ -45,8 +45,8 @@ import java.util.Iterator;
|
||||
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.jayway.restassured.builder.RequestSpecBuilder;
|
||||
import com.jayway.restassured.http.ContentType;
|
||||
import io.restassured.builder.RequestSpecBuilder;
|
||||
import io.restassured.http.ContentType;
|
||||
|
||||
import org.alfresco.rest.core.RMRestWrapper;
|
||||
import org.alfresco.rest.rm.community.model.record.Record;
|
||||
@@ -66,7 +66,7 @@ public class RecordFolderAPI extends RMModelRequest
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param restWrapper
|
||||
* @param rmRestWrapper RM REST Wrapper
|
||||
*/
|
||||
public RecordFolderAPI(RMRestWrapper rmRestWrapper)
|
||||
{
|
||||
@@ -77,7 +77,7 @@ public class RecordFolderAPI extends RMModelRequest
|
||||
* Deletes a record folder.
|
||||
*
|
||||
* @param recordFolderId The identifier of a record folder
|
||||
* @throws Exception for the following cases:
|
||||
* @throws RuntimeException for the following cases:
|
||||
* <ul>
|
||||
* <li>{@code recordFolderId} is not a valid format</li>
|
||||
* <li>authentication fails</li>
|
||||
@@ -113,7 +113,7 @@ public class RecordFolderAPI extends RMModelRequest
|
||||
* @param recordFolderId The identifier of a record folder
|
||||
* @param parameters The URL parameters to add
|
||||
* @return The {@link RecordFolder} for the given {@code recordFolderId}
|
||||
* @throws Exception for the following cases:
|
||||
* @throws RuntimeException for the following cases:
|
||||
* <ul>
|
||||
* <li>{@code recordFolderId} is not a valid format</li>
|
||||
* <li>authentication fails</li>
|
||||
@@ -136,7 +136,7 @@ public class RecordFolderAPI extends RMModelRequest
|
||||
/**
|
||||
* see {@link #updateRecordFolder(RecordFolder, String, String)
|
||||
*/
|
||||
public RecordFolder updateRecordFolder(RecordFolder recordFolderModel, String recordFolderId) throws Exception
|
||||
public RecordFolder updateRecordFolder(RecordFolder recordFolderModel, String recordFolderId)
|
||||
{
|
||||
mandatoryObject("recordFolderModel", recordFolderModel);
|
||||
mandatoryString("recordFolderId", recordFolderId);
|
||||
@@ -151,7 +151,7 @@ public class RecordFolderAPI extends RMModelRequest
|
||||
* @param recordFolderId The identifier of a record folder
|
||||
* @param parameters The URL parameters to add
|
||||
* @param returns The updated {@link RecordFolder}
|
||||
* @throws Exception for the following cases:
|
||||
* @throws RuntimeException for the following cases:
|
||||
* <ul>
|
||||
* <li>the update request is invalid or {@code recordFolderId} is not a valid format or {@code recordFolderModel} is invalid</li>
|
||||
* <li>authentication fails</li>
|
||||
@@ -161,7 +161,7 @@ public class RecordFolderAPI extends RMModelRequest
|
||||
* <li>model integrity exception, including file name with invalid characters</li>
|
||||
* </ul>
|
||||
*/
|
||||
public RecordFolder updateRecordFolder(RecordFolder recordFolderModel, String recordFolderId, String parameters) throws Exception
|
||||
public RecordFolder updateRecordFolder(RecordFolder recordFolderModel, String recordFolderId, String parameters)
|
||||
{
|
||||
mandatoryObject("recordFolderModel", recordFolderModel);
|
||||
mandatoryString("recordFolderId", recordFolderId);
|
||||
@@ -191,7 +191,7 @@ public class RecordFolderAPI extends RMModelRequest
|
||||
* @param recordFolderId The identifier of a record folder
|
||||
* @param parameters The URL parameters to add
|
||||
* @return The {@link RecordFolderCollection} for the given {@code recordFolderId}
|
||||
* @throws Exception for the following cases:
|
||||
* @throws RuntimeException for the following cases:
|
||||
* <ul>
|
||||
* <li>authentication fails</li>
|
||||
* <li>current user does not have permission to read {@code recordFolderId}</li>
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
@@ -37,13 +37,14 @@ import static org.springframework.http.HttpMethod.GET;
|
||||
import static org.springframework.http.HttpMethod.POST;
|
||||
import static org.springframework.http.HttpMethod.PUT;
|
||||
|
||||
import com.jayway.restassured.response.ResponseBody;
|
||||
|
||||
import org.alfresco.rest.core.RMRestWrapper;
|
||||
import org.alfresco.rest.rm.community.model.record.Record;
|
||||
import org.alfresco.rest.rm.community.model.record.RecordBodyFile;
|
||||
import org.alfresco.rest.rm.community.requests.RMModelRequest;
|
||||
|
||||
import io.restassured.response.ResponseBody;
|
||||
|
||||
/**
|
||||
* Records REST API Wrapper
|
||||
*
|
||||
@@ -53,7 +54,7 @@ import org.alfresco.rest.rm.community.requests.RMModelRequest;
|
||||
public class RecordsAPI extends RMModelRequest
|
||||
{
|
||||
/**
|
||||
* @param rmRestWrapper
|
||||
* @param rmRestWrapper RM REST Wrapper
|
||||
*/
|
||||
public RecordsAPI(RMRestWrapper rmRestWrapper)
|
||||
{
|
||||
@@ -65,7 +66,7 @@ public class RecordsAPI extends RMModelRequest
|
||||
*
|
||||
* @param recordId The id of the electronic record
|
||||
* @return {@link ResponseBody} representing content for the given record id
|
||||
* @throws Exception for the following cases:
|
||||
* @throws RuntimeException for the following cases:
|
||||
* <ul>
|
||||
* <li>{@code recordId} has no content</li>
|
||||
* <li> {@code recordId} is not a valid format, or is not a record</li>
|
||||
@@ -73,7 +74,7 @@ public class RecordsAPI extends RMModelRequest
|
||||
* <li>{@code recordId} does not exist</li>
|
||||
* </ul>
|
||||
*/
|
||||
public ResponseBody<?> getRecordContent(String recordId) throws Exception
|
||||
public ResponseBody<?> getRecordContent(String recordId)
|
||||
{
|
||||
mandatoryString("recordId", recordId);
|
||||
|
||||
@@ -89,7 +90,7 @@ public class RecordsAPI extends RMModelRequest
|
||||
* @param recordBodyFile The properties where to file the record
|
||||
* @param recordId The id of the record to file
|
||||
* @return The {@link Record} with the given properties
|
||||
* @throws Exception for the following cases:
|
||||
* @throws RuntimeException for the following cases:
|
||||
* <ul>
|
||||
* <li>Invalid parameter: {@code recordBodyFile} is not a valid format,{@code recordId} is not a record</li>
|
||||
* <li>authentication fails</li>
|
||||
@@ -100,7 +101,7 @@ public class RecordsAPI extends RMModelRequest
|
||||
* </ul>
|
||||
*
|
||||
*/
|
||||
public Record fileRecord(RecordBodyFile recordBodyFile, String recordId) throws Exception
|
||||
public Record fileRecord(RecordBodyFile recordBodyFile, String recordId)
|
||||
{
|
||||
mandatoryObject("recordBodyFile", recordBodyFile);
|
||||
mandatoryString("recordId", recordId);
|
||||
@@ -114,7 +115,7 @@ public class RecordsAPI extends RMModelRequest
|
||||
* @param recordBodyFile The properties where to file the record
|
||||
* @param recordId The id of the record to file
|
||||
* @return The {@link Record} with the given properties
|
||||
* @throws Exception for the following cases:
|
||||
* @throws RuntimeException for the following cases:
|
||||
* <ul>
|
||||
* <li>Invalid parameter: {@code recordBodyFile} is not a valid format,{@code recordId} is not a record</li>
|
||||
* <li>authentication fails</li>
|
||||
@@ -125,7 +126,7 @@ public class RecordsAPI extends RMModelRequest
|
||||
* </ul>
|
||||
*
|
||||
*/
|
||||
public Record fileRecord(RecordBodyFile recordBodyFile, String recordId, String parameters) throws Exception
|
||||
public Record fileRecord(RecordBodyFile recordBodyFile, String recordId, String parameters)
|
||||
{
|
||||
mandatoryObject("requestBodyFile", recordBodyFile);
|
||||
mandatoryString("recordId", recordId);
|
||||
@@ -142,7 +143,7 @@ public class RecordsAPI extends RMModelRequest
|
||||
/**
|
||||
* see {@link #completeRecord(String, String)
|
||||
*/
|
||||
public Record completeRecord(String recordId) throws Exception
|
||||
public Record completeRecord(String recordId)
|
||||
{
|
||||
mandatoryString("recordId", recordId);
|
||||
|
||||
@@ -154,7 +155,7 @@ public class RecordsAPI extends RMModelRequest
|
||||
*
|
||||
* @param recordId The id of the record to complete
|
||||
* @return The completed {@link Record} with the given properties
|
||||
* @throws Exception for the following cases:
|
||||
* @throws RuntimeException for the following cases:
|
||||
* <ul>
|
||||
* <li>Invalid parameter: {@code recordId} is not a record</li>
|
||||
* <li>authentication fails</li>
|
||||
@@ -164,7 +165,7 @@ public class RecordsAPI extends RMModelRequest
|
||||
* <li>model integrity exception: the record has missing meta-data</li>
|
||||
* </ul>
|
||||
*/
|
||||
public Record completeRecord(String recordId, String parameters) throws Exception
|
||||
public Record completeRecord(String recordId, String parameters)
|
||||
{
|
||||
mandatoryString("recordId", recordId);
|
||||
|
||||
@@ -179,7 +180,7 @@ public class RecordsAPI extends RMModelRequest
|
||||
* Deletes a record.
|
||||
*
|
||||
* @param recordId The identifier of a record
|
||||
* @throws Exception for the following cases:
|
||||
* @throws RuntimeException for the following cases:
|
||||
* <ul>
|
||||
* <li>{@code recordId} is not a valid format</li>
|
||||
* <li>authentication fails</li>
|
||||
@@ -215,7 +216,7 @@ public class RecordsAPI extends RMModelRequest
|
||||
* @param recordId The identifier of a record
|
||||
* @param parameters The URL parameters to add
|
||||
* @return The {@link Record} for the given {@code recordId}
|
||||
* @throws Exception for the following cases:
|
||||
* @throws RuntimeException for the following cases:
|
||||
* <ul>
|
||||
* <li>{@code recordId} is not a valid format</li>
|
||||
* <li>authentication fails</li>
|
||||
@@ -238,7 +239,7 @@ public class RecordsAPI extends RMModelRequest
|
||||
/**
|
||||
* see {@link #updateRecord(Record, String, String)
|
||||
*/
|
||||
public Record updateRecord(Record recordModel, String recordId) throws Exception
|
||||
public Record updateRecord(Record recordModel, String recordId)
|
||||
{
|
||||
mandatoryObject("recordModel", recordModel);
|
||||
mandatoryString("recordId", recordId);
|
||||
@@ -253,7 +254,7 @@ public class RecordsAPI extends RMModelRequest
|
||||
* @param recordId The identifier of a record
|
||||
* @param parameters The URL parameters to add
|
||||
* @return The updated {@link Record}
|
||||
* @throws Exception for the following cases:
|
||||
* @throws RuntimeException for the following cases:
|
||||
* <ul>
|
||||
* <li>the update request is invalid or {@code recordId} is not a valid format or {@code recordModel} is invalid</li>
|
||||
* <li>authentication fails</li>
|
||||
@@ -263,7 +264,7 @@ public class RecordsAPI extends RMModelRequest
|
||||
* <li>model integrity exception, including file name with invalid characters</li>
|
||||
* </ul>
|
||||
*/
|
||||
public Record updateRecord(Record recordModel, String recordId, String parameters) throws Exception
|
||||
public Record updateRecord(Record recordModel, String recordId, String parameters)
|
||||
{
|
||||
mandatoryObject("recordModel", recordModel);
|
||||
mandatoryString("recordId", recordId);
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
@@ -46,7 +46,7 @@ import org.alfresco.rest.rm.community.requests.RMModelRequest;
|
||||
public class TransferAPI extends RMModelRequest
|
||||
{
|
||||
/**
|
||||
* @param rmRestWrapper
|
||||
* @param rmRestWrapper RM REST Wrapper
|
||||
*/
|
||||
public TransferAPI(RMRestWrapper rmRestWrapper)
|
||||
{
|
||||
@@ -69,7 +69,7 @@ public class TransferAPI extends RMModelRequest
|
||||
* @param transferId The identifier of a transfer
|
||||
* @param parameters The URL parameters to add
|
||||
* @return The {@link Transfer} for the given {@code transferId}
|
||||
* @throws Exception for the following cases:
|
||||
* @throws RuntimeException for the following cases:
|
||||
* <ul>
|
||||
* <li>{@code transferId} is not a valid format</li>
|
||||
* <li>authentication fails</li>
|
||||
@@ -104,7 +104,7 @@ public class TransferAPI extends RMModelRequest
|
||||
* @param transferId The identifier of a transfer
|
||||
* @param parameters The URL parameters to add
|
||||
* @return The {@link TransferChildCollection} for the given {@code transferId}
|
||||
* @throws Exception for the following cases:
|
||||
* @throws RuntimeException for the following cases:
|
||||
* <ul>
|
||||
* <li>authentication fails</li>
|
||||
* <li>current user does not have permission to read {@code transferId}</li>
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
@@ -50,7 +50,7 @@ import org.alfresco.rest.rm.community.requests.RMModelRequest;
|
||||
public class TransferContainerAPI extends RMModelRequest
|
||||
{
|
||||
/**
|
||||
* @param rmRestWrapper
|
||||
* @param rmRestWrapper RM REST Wrapper
|
||||
*/
|
||||
public TransferContainerAPI(RMRestWrapper rmRestWrapper)
|
||||
{
|
||||
@@ -73,7 +73,7 @@ public class TransferContainerAPI extends RMModelRequest
|
||||
* @param transferContainerId The identifier of a transfer container
|
||||
* @param parameters The URL parameters to add
|
||||
* @return The {@link TransferContainer} for the given {@code transferContainerId}
|
||||
* @throws Exception for the following cases:
|
||||
* @throws RuntimeException for the following cases:
|
||||
* <ul>
|
||||
* <li>{@code transferContainerId} is not a valid format</li>
|
||||
* <li>authentication fails</li>
|
||||
@@ -96,7 +96,7 @@ public class TransferContainerAPI extends RMModelRequest
|
||||
/**
|
||||
* see {@link #updateTransferContainer(TransferContainer, String, String)
|
||||
*/
|
||||
public TransferContainer updateTransferContainer(TransferContainer transferContainerModel, String transferContainerId) throws Exception
|
||||
public TransferContainer updateTransferContainer(TransferContainer transferContainerModel, String transferContainerId)
|
||||
{
|
||||
mandatoryObject("transferContainerModel", transferContainerModel);
|
||||
mandatoryString("transferContainerId", transferContainerId);
|
||||
@@ -111,7 +111,7 @@ public class TransferContainerAPI extends RMModelRequest
|
||||
* @param transferContainerId The identifier of a transfer container
|
||||
* @param parameters The URL parameters to add
|
||||
* @param returns The updated {@link TransferContainer}
|
||||
* @throws Exception for the following cases:
|
||||
* @throws RuntimeException for the following cases:
|
||||
* <ul>
|
||||
* <li>the update request is invalid or {@code transferContainerId} is not a valid format or {@code transferContainerModel} is invalid</li>
|
||||
* <li>authentication fails</li>
|
||||
@@ -121,7 +121,7 @@ public class TransferContainerAPI extends RMModelRequest
|
||||
* <li>model integrity exception, including transfer container name with invalid characters</li>
|
||||
* </ul>
|
||||
*/
|
||||
public TransferContainer updateTransferContainer(TransferContainer transferContainerModel, String transferContainerId, String parameters) throws Exception
|
||||
public TransferContainer updateTransferContainer(TransferContainer transferContainerModel, String transferContainerId, String parameters)
|
||||
{
|
||||
mandatoryObject("transferContainerModel", transferContainerModel);
|
||||
mandatoryString("transferContainerId", transferContainerId);
|
||||
@@ -151,7 +151,7 @@ public class TransferContainerAPI extends RMModelRequest
|
||||
* @param transferContainerId The identifier of a transfer container
|
||||
* @param parameters The URL parameters to add
|
||||
* @return The {@link TransferCollection} for the given {@code transferContainerId}
|
||||
* @throws Exception for the following cases:
|
||||
* @throws RuntimeException for the following cases:
|
||||
* <ul>
|
||||
* <li>authentication fails</li>
|
||||
* <li>current user does not have permission to read {@code transferContainerId}</li>
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
@@ -39,12 +39,14 @@ import static org.springframework.http.HttpMethod.PUT;
|
||||
import static org.testng.Assert.fail;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Iterator;
|
||||
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.jayway.restassured.builder.RequestSpecBuilder;
|
||||
import com.jayway.restassured.http.ContentType;
|
||||
|
||||
import io.restassured.builder.RequestSpecBuilder;
|
||||
import io.restassured.http.ContentType;
|
||||
|
||||
import org.alfresco.rest.core.RMRestWrapper;
|
||||
import org.alfresco.rest.rm.community.model.unfiledcontainer.UnfiledContainer;
|
||||
@@ -63,7 +65,7 @@ import org.alfresco.rest.rm.community.util.UnfiledContainerChildMixin;
|
||||
public class UnfiledContainerAPI extends RMModelRequest
|
||||
{
|
||||
/**
|
||||
* @param rmRestWrapper
|
||||
* @param rmRestWrapper RM REST Wrapper
|
||||
*/
|
||||
public UnfiledContainerAPI(RMRestWrapper rmRestWrapper)
|
||||
{
|
||||
@@ -86,7 +88,7 @@ public class UnfiledContainerAPI extends RMModelRequest
|
||||
* @param unfiledContainerId The identifier of a unfiled record container
|
||||
* @param parameters The URL parameters to add
|
||||
* @return The {@link UnfiledContainer} for the given {@code unfiledContainerId}
|
||||
* @throws Exception for the following cases:
|
||||
* @throws RuntimeException for the following cases:
|
||||
* <ul>
|
||||
* <li>{@code unfiledContainerId} is not a valid format</li>
|
||||
* <li>authentication fails</li>
|
||||
@@ -122,7 +124,7 @@ public class UnfiledContainerAPI extends RMModelRequest
|
||||
* @param unfiledContainerId The identifier of an unfiled records container
|
||||
* @param parameters The URL parameters to add
|
||||
* @return The {@link UnfiledContainerChildCollection} for the given {@code unfiledContainerId}
|
||||
* @throws Exception for the following cases:
|
||||
* @throws RuntimeException for the following cases:
|
||||
* <ul>
|
||||
* <li>authentication fails</li>
|
||||
* <li>current user does not have permission to read {@code unfiledContainerId}</li>
|
||||
@@ -144,7 +146,7 @@ public class UnfiledContainerAPI extends RMModelRequest
|
||||
/**
|
||||
* see {@link #createUnfiledContainerChild(UnfiledContainerChild, String, String)}
|
||||
*/
|
||||
public UnfiledContainerChild createUnfiledContainerChild(UnfiledContainerChild unfiledContainerChildModel, String unfiledContainerId) throws Exception
|
||||
public UnfiledContainerChild createUnfiledContainerChild(UnfiledContainerChild unfiledContainerChildModel, String unfiledContainerId)
|
||||
{
|
||||
mandatoryObject("unfiledContainerChildModel", unfiledContainerChildModel);
|
||||
mandatoryString("unfiledContainerId", unfiledContainerId);
|
||||
@@ -159,7 +161,7 @@ public class UnfiledContainerAPI extends RMModelRequest
|
||||
* @param unfiledContainerId The identifier of an unfiled container
|
||||
* @param parameters The URL parameters to add
|
||||
* @return The created {@link UnfiledContainerChild}
|
||||
* @throws Exception for the following cases:
|
||||
* @throws RuntimeException for the following cases:
|
||||
* <ul>
|
||||
* <li>{@code unfiledContainerId} is not a valid format or {@code unfiledContainerChildModel} is invalid</li>
|
||||
* <li>authentication fails</li>
|
||||
@@ -169,7 +171,7 @@ public class UnfiledContainerAPI extends RMModelRequest
|
||||
* <li>model integrity exception, including node name with invalid characters</li>
|
||||
* </ul>
|
||||
*/
|
||||
public UnfiledContainerChild createUnfiledContainerChild(UnfiledContainerChild unfiledContainerChildModel, String unfiledContainerId, String parameters) throws Exception
|
||||
public UnfiledContainerChild createUnfiledContainerChild(UnfiledContainerChild unfiledContainerChildModel, String unfiledContainerId, String parameters)
|
||||
{
|
||||
mandatoryObject("unfiledContainerChildModel", unfiledContainerChildModel);
|
||||
mandatoryString("unfiledContainerId", unfiledContainerId);
|
||||
@@ -190,9 +192,9 @@ public class UnfiledContainerAPI extends RMModelRequest
|
||||
* @param unfiledContainerChildContent {@link File} pointing to the content of the electronic record to be created
|
||||
* @param unfiledContainerId The identifier of a unfiled container
|
||||
* @return newly created {@link UnfiledContainerChild}
|
||||
* @throws Exception for invalid recordModel JSON strings
|
||||
* @throws RuntimeException for invalid recordModel JSON strings
|
||||
*/
|
||||
public UnfiledContainerChild uploadRecord(UnfiledContainerChild unfiledContainerChildModel, String unfiledContainerId, File unfiledContainerChildContent) throws Exception
|
||||
public UnfiledContainerChild uploadRecord(UnfiledContainerChild unfiledContainerChildModel, String unfiledContainerId, File unfiledContainerChildContent)
|
||||
{
|
||||
mandatoryObject("unfiledContainerChildModel", unfiledContainerChildModel);
|
||||
mandatoryObject("unfiledContainerChildContent", unfiledContainerChildContent);
|
||||
@@ -208,7 +210,15 @@ public class UnfiledContainerAPI extends RMModelRequest
|
||||
* to the request.
|
||||
*/
|
||||
RequestSpecBuilder builder = getRmRestWrapper().configureRequestSpec();
|
||||
JsonNode root = new ObjectMapper().readTree(toJson(unfiledContainerChildModel, UnfiledContainerChild.class, UnfiledContainerChildMixin.class));
|
||||
JsonNode root;
|
||||
try
|
||||
{
|
||||
root = new ObjectMapper().readTree(toJson(unfiledContainerChildModel, UnfiledContainerChild.class, UnfiledContainerChildMixin.class));
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
throw new RuntimeException("Failed to convert model to JSON.", e);
|
||||
}
|
||||
// add request fields
|
||||
Iterator<String> fieldNames = root.fieldNames();
|
||||
while (fieldNames.hasNext())
|
||||
@@ -225,7 +235,7 @@ public class UnfiledContainerAPI extends RMModelRequest
|
||||
/**
|
||||
* see {@link #updateUnfiledContainer(UnfiledContainer, String, String)
|
||||
*/
|
||||
public UnfiledContainer updateUnfiledContainer(UnfiledContainer unfiledContainerModel, String unfiledContainerId) throws Exception
|
||||
public UnfiledContainer updateUnfiledContainer(UnfiledContainer unfiledContainerModel, String unfiledContainerId)
|
||||
{
|
||||
mandatoryObject("unfiledContainerModel", unfiledContainerModel);
|
||||
mandatoryString("unfiledContainerId", unfiledContainerId);
|
||||
@@ -240,7 +250,7 @@ public class UnfiledContainerAPI extends RMModelRequest
|
||||
* @param unfiledContainerId The identifier of an unfiled record container
|
||||
* @param parameters The URL parameters to add
|
||||
* @param returns The updated {@link UnfiledContainer}
|
||||
* @throws Exception for the following cases:
|
||||
* @throws RuntimeException for the following cases:
|
||||
* <ul>
|
||||
* <li>the update request is invalid or {@code unfiledContainerId} is not a valid format or {@code unfiledContainerModel} is invalid</li>
|
||||
* <li>authentication fails</li>
|
||||
@@ -250,7 +260,7 @@ public class UnfiledContainerAPI extends RMModelRequest
|
||||
* <li>model integrity exception, including file name with invalid characters</li>
|
||||
* </ul>
|
||||
*/
|
||||
public UnfiledContainer updateUnfiledContainer(UnfiledContainer unfiledContainerModel, String unfiledContainerId, String parameters) throws Exception
|
||||
public UnfiledContainer updateUnfiledContainer(UnfiledContainer unfiledContainerModel, String unfiledContainerId, String parameters)
|
||||
{
|
||||
mandatoryObject("unfiledContainerModel", unfiledContainerModel);
|
||||
mandatoryString("unfiledContainerId", unfiledContainerId);
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
@@ -40,12 +40,13 @@ import static org.springframework.http.HttpMethod.PUT;
|
||||
import static org.testng.Assert.fail;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Iterator;
|
||||
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.jayway.restassured.builder.RequestSpecBuilder;
|
||||
import com.jayway.restassured.http.ContentType;
|
||||
import io.restassured.builder.RequestSpecBuilder;
|
||||
import io.restassured.http.ContentType;
|
||||
|
||||
import org.alfresco.rest.core.RMRestWrapper;
|
||||
import org.alfresco.rest.rm.community.model.unfiledcontainer.UnfiledContainerChild;
|
||||
@@ -63,7 +64,7 @@ import org.alfresco.rest.rm.community.util.UnfiledContainerChildMixin;
|
||||
public class UnfiledRecordFolderAPI extends RMModelRequest
|
||||
{
|
||||
/**
|
||||
* @param rmRestWrapper
|
||||
* @param rmRestWrapper RM REST Wrapper
|
||||
*/
|
||||
public UnfiledRecordFolderAPI(RMRestWrapper rmRestWrapper)
|
||||
{
|
||||
@@ -86,7 +87,7 @@ public class UnfiledRecordFolderAPI extends RMModelRequest
|
||||
* @param unfiledRecordFolderId The identifier of a unfiled record folder
|
||||
* @param parameters The URL parameters to add
|
||||
* @return The {@link UnfiledRecordFolder} for the given {@code unfiledRecordFolderId}
|
||||
* @throws Exception for the following cases:
|
||||
* @throws RuntimeException for the following cases:
|
||||
* <ul>
|
||||
* <li>{@code unfiledRecordFolderId} is not a valid format</li>
|
||||
* <li>authentication fails</li>
|
||||
@@ -122,7 +123,7 @@ public class UnfiledRecordFolderAPI extends RMModelRequest
|
||||
* @param unfiledRecordFolderId The identifier of an unfiled records folder
|
||||
* @param parameters The URL parameters to add
|
||||
* @return The {@link UnfiledRecordFolderChildCollection} for the given {@code unfiledRecordFolderId}
|
||||
* @throws Exception for the following cases:
|
||||
* @throws RuntimeException for the following cases:
|
||||
* <ul>
|
||||
* <li>authentication fails</li>
|
||||
* <li>current user does not have permission to read {@code unfiledRecordFolderId}</li>
|
||||
@@ -144,7 +145,7 @@ public class UnfiledRecordFolderAPI extends RMModelRequest
|
||||
/**
|
||||
* see {@link #createUnfiledRecordFolderChild(UnfiledContainerChild, String, String)}
|
||||
*/
|
||||
public UnfiledContainerChild createUnfiledRecordFolderChild(UnfiledContainerChild unfiledRecordFolderChildModel, String unfiledRecordFolderId) throws Exception
|
||||
public UnfiledContainerChild createUnfiledRecordFolderChild(UnfiledContainerChild unfiledRecordFolderChildModel, String unfiledRecordFolderId)
|
||||
{
|
||||
mandatoryObject("unfiledRecordFolderChildModel", unfiledRecordFolderChildModel);
|
||||
mandatoryString("unfiledRecordFolderId", unfiledRecordFolderId);
|
||||
@@ -159,7 +160,7 @@ public class UnfiledRecordFolderAPI extends RMModelRequest
|
||||
* @param unfiledRecordFolderId The identifier of an unfiled folder
|
||||
* @param parameters The URL parameters to add
|
||||
* @return The created {@link UnfiledRecordFolderChild}
|
||||
* @throws Exception for the following cases:
|
||||
* @throws RuntimeException for the following cases:
|
||||
* <ul>
|
||||
* <li>{@code unfiledRecordFolderId} is not a valid format or {@code unfiledRecordFolderChildModel} is invalid</li>
|
||||
* <li>authentication fails</li>
|
||||
@@ -169,7 +170,7 @@ public class UnfiledRecordFolderAPI extends RMModelRequest
|
||||
* <li>model integrity exception, including node name with invalid characters</li>
|
||||
* </ul>
|
||||
*/
|
||||
public UnfiledContainerChild createUnfiledRecordFolderChild(UnfiledContainerChild unfiledRecordFolderChildModel, String unfiledRecordFolderId, String parameters) throws Exception
|
||||
public UnfiledContainerChild createUnfiledRecordFolderChild(UnfiledContainerChild unfiledRecordFolderChildModel, String unfiledRecordFolderId, String parameters)
|
||||
{
|
||||
mandatoryObject("unfiledRecordFolderChildModel", unfiledRecordFolderChildModel);
|
||||
mandatoryString("unfiledRecordFolderId", unfiledRecordFolderId);
|
||||
@@ -190,9 +191,9 @@ public class UnfiledRecordFolderAPI extends RMModelRequest
|
||||
* @param unfiledRecordFolderChildContent {@link File} pointing to the content of the electronic record to be created
|
||||
* @param unfiledRecordFolderId The identifier of a unfiled record folder
|
||||
* @return newly created {@link UnfiledContainerChild}
|
||||
* @throws Exception for invalid recordModel JSON strings
|
||||
* @throws RuntimeException for invalid recordModel JSON strings
|
||||
*/
|
||||
public UnfiledContainerChild uploadRecord(UnfiledContainerChild unfiledRecordFolderChildModel, String unfiledRecordFolderId, File unfiledRecordFolderChildContent) throws Exception
|
||||
public UnfiledContainerChild uploadRecord(UnfiledContainerChild unfiledRecordFolderChildModel, String unfiledRecordFolderId, File unfiledRecordFolderChildContent)
|
||||
{
|
||||
mandatoryObject("unfiledRecordFolderChildModel", unfiledRecordFolderChildModel);
|
||||
mandatoryObject("unfiledRecordFolderChildContent", unfiledRecordFolderChildContent);
|
||||
@@ -208,7 +209,15 @@ public class UnfiledRecordFolderAPI extends RMModelRequest
|
||||
* to the request.
|
||||
*/
|
||||
RequestSpecBuilder builder = getRmRestWrapper().configureRequestSpec();
|
||||
JsonNode root = new ObjectMapper().readTree(toJson(unfiledRecordFolderChildModel, UnfiledContainerChild.class, UnfiledContainerChildMixin.class));
|
||||
JsonNode root;
|
||||
try
|
||||
{
|
||||
root = new ObjectMapper().readTree(toJson(unfiledRecordFolderChildModel, UnfiledContainerChild.class, UnfiledContainerChildMixin.class));
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
throw new RuntimeException("Failed to convert model to JSON.", e);
|
||||
}
|
||||
// add request fields
|
||||
Iterator<String> fieldNames = root.fieldNames();
|
||||
while (fieldNames.hasNext())
|
||||
@@ -225,7 +234,7 @@ public class UnfiledRecordFolderAPI extends RMModelRequest
|
||||
/**
|
||||
* see {@link #updateUnfiledRecordFolder(UnfiledRecordFolder, String, String)
|
||||
*/
|
||||
public UnfiledRecordFolder updateUnfiledRecordFolder(UnfiledRecordFolder unfiledRecordFolderModel, String unfiledRecordFolderId) throws Exception
|
||||
public UnfiledRecordFolder updateUnfiledRecordFolder(UnfiledRecordFolder unfiledRecordFolderModel, String unfiledRecordFolderId)
|
||||
{
|
||||
mandatoryObject("unfiledRecordFolderModel", unfiledRecordFolderModel);
|
||||
mandatoryString("unfiledRecordFolderId", unfiledRecordFolderId);
|
||||
@@ -240,7 +249,7 @@ public class UnfiledRecordFolderAPI extends RMModelRequest
|
||||
* @param unfiledRecordFolderId The identifier of an unfiled record folder
|
||||
* @param parameters The URL parameters to add
|
||||
* @param returns The updated {@link UnfiledRecordFolder}
|
||||
* @throws Exception for the following cases:
|
||||
* @throws RuntimeException for the following cases:
|
||||
* <ul>
|
||||
* <li>the update request is invalid or {@code unfiledRecordFolderId} is not a valid format or {@code unfiledRecordFolderModel} is invalid</li>
|
||||
* <li>authentication fails</li>
|
||||
@@ -250,7 +259,7 @@ public class UnfiledRecordFolderAPI extends RMModelRequest
|
||||
* <li>model integrity exception, including file name with invalid characters</li>
|
||||
* </ul>
|
||||
*/
|
||||
public UnfiledRecordFolder updateUnfiledRecordFolder(UnfiledRecordFolder unfiledRecordFolderModel, String unfiledRecordFolderId, String parameters) throws Exception
|
||||
public UnfiledRecordFolder updateUnfiledRecordFolder(UnfiledRecordFolder unfiledRecordFolderModel, String unfiledRecordFolderId, String parameters)
|
||||
{
|
||||
mandatoryObject("unfiledRecordFolderModel", unfiledRecordFolderModel);
|
||||
mandatoryString("unfiledRecordFolderId", unfiledRecordFolderId);
|
||||
@@ -268,7 +277,7 @@ public class UnfiledRecordFolderAPI extends RMModelRequest
|
||||
* Deletes an unfiled record folder.
|
||||
*
|
||||
* @param unfiledRecordFolderId The identifier of a unfiled record folder
|
||||
* @throws Exception for the following cases:
|
||||
* @throws RuntimeException for the following cases:
|
||||
* <ul>
|
||||
* <li>{@code unfiledRecordFolderId} is not a valid format</li>
|
||||
* <li>authentication fails</li>
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -0,0 +1,142 @@
|
||||
/*
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
* -
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
* -
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
* -
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
|
||||
package org.alfresco.rest.rm.community.util;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import com.github.dockerjava.api.DockerClient;
|
||||
import com.github.dockerjava.api.command.LogContainerCmd;
|
||||
import com.github.dockerjava.api.model.Container;
|
||||
import com.github.dockerjava.api.model.Frame;
|
||||
import com.github.dockerjava.core.DockerClientBuilder;
|
||||
import com.github.dockerjava.core.command.LogContainerResultCallback;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.apache.commons.lang.SystemUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* Helper class for interaction with docker containers
|
||||
*
|
||||
* @author Claudia Agache
|
||||
* @since 3.1
|
||||
*/
|
||||
@Service
|
||||
public class DockerHelper
|
||||
{
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(DockerHelper.class);
|
||||
private static final String REPO_IMAGE_NAME = "repository";
|
||||
@Getter
|
||||
@Setter
|
||||
private DockerClient dockerClient;
|
||||
|
||||
@Autowired
|
||||
public DockerHelper(@Value ("${docker.host}") String dockerHost)
|
||||
{
|
||||
if (SystemUtils.IS_OS_WINDOWS)
|
||||
{
|
||||
this.dockerClient = DockerClientBuilder.getInstance(dockerHost).build();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.dockerClient = DockerClientBuilder.getInstance().build();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method for returning logs of docker container
|
||||
*
|
||||
* @param containerId - ID of the container
|
||||
* @return list of strings, where every string is log line
|
||||
*/
|
||||
private List<String> getDockerLogs(String containerId)
|
||||
{
|
||||
final List<String> logs = new ArrayList<>();
|
||||
// get the logs since current time - 10 seconds
|
||||
final int timeStamp = (int) (System.currentTimeMillis() / 1000) - 10;
|
||||
|
||||
final LogContainerCmd logContainerCmd = getDockerClient().logContainerCmd(containerId);
|
||||
logContainerCmd.withStdOut(true)
|
||||
.withStdErr(true)
|
||||
.withSince(timeStamp) // UNIX timestamp to filter logs. Output log-entries since that timestamp.
|
||||
.withTimestamps(true); //print timestamps for every log line
|
||||
|
||||
try
|
||||
{
|
||||
logContainerCmd.exec(new LogContainerResultCallback()
|
||||
{
|
||||
@Override
|
||||
public void onNext(Frame item)
|
||||
{
|
||||
logs.add(item.toString());
|
||||
}
|
||||
}).awaitCompletion();
|
||||
}
|
||||
catch (InterruptedException e)
|
||||
{
|
||||
Thread.currentThread().interrupt(); // set interrupt flag
|
||||
LOGGER.error("Failed to retrieve logs of container " + containerId, e);
|
||||
}
|
||||
|
||||
return logs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the alfresco container logs
|
||||
*
|
||||
* @return list of strings, where every string is log line
|
||||
*/
|
||||
public List<String> getAlfrescoLogs()
|
||||
{
|
||||
final Optional<Container> alfrescoContainer = findContainerByImageName(REPO_IMAGE_NAME);
|
||||
return (alfrescoContainer.isPresent()) ? getDockerLogs(alfrescoContainer.get().getId()) : Collections.emptyList();
|
||||
}
|
||||
|
||||
/**
|
||||
* Method for finding a docker container after the image name
|
||||
*
|
||||
* @param imageName - the name of the image used by container
|
||||
* @return the container
|
||||
*/
|
||||
private Optional<Container> findContainerByImageName(String imageName)
|
||||
{
|
||||
final List<Container> containers = getDockerClient().listContainersCmd().withShowAll(true).exec();
|
||||
|
||||
return containers.stream()
|
||||
.filter(container -> container.getImage().contains(imageName))
|
||||
.findFirst();
|
||||
}
|
||||
}
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -0,0 +1,327 @@
|
||||
/*-
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
* -
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
* -
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
* -
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
package org.alfresco.rest.v0;
|
||||
|
||||
import static org.alfresco.rest.core.v0.APIUtils.convertHTTPResponseToJSON;
|
||||
import static org.apache.http.HttpStatus.SC_OK;
|
||||
import static org.testng.AssertJUnit.assertNotNull;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.alfresco.rest.core.v0.APIUtils;
|
||||
import org.alfresco.rest.core.v0.BaseAPI;
|
||||
import org.alfresco.rest.rm.community.model.hold.HoldEntry;
|
||||
import org.alfresco.rest.rm.community.util.PojoUtility;
|
||||
import org.alfresco.utility.Utility;
|
||||
import org.apache.chemistry.opencmis.client.api.CmisObject;
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.ParseException;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* Methods to make API requests using v0 API for generalized holds
|
||||
*
|
||||
* @author Rodica Sutu
|
||||
* @since 3.2
|
||||
*/
|
||||
@Component
|
||||
public class HoldsAPI extends BaseAPI
|
||||
{
|
||||
public static final String HOLDS_CONTAINER = "Holds";
|
||||
/**
|
||||
* The URI to create a hold
|
||||
*/
|
||||
private static final String CREATE_HOLDS_API = "{0}type/rma:hold/formprocessor";
|
||||
|
||||
/**
|
||||
* The URI to add items to hold or to remove items from hold
|
||||
*/
|
||||
private static final String RM_HOLDS_API = "{0}rma/holds";
|
||||
|
||||
/**
|
||||
* The URI to get holds.
|
||||
*/
|
||||
private static final String GET_RM_HOLDS = RM_HOLDS_API + "?{1}";
|
||||
|
||||
/**
|
||||
* Util method to create a hold
|
||||
*
|
||||
* @param user the user creating the hold
|
||||
* @param password the user's password
|
||||
* @param holdName the hold name
|
||||
* @param reason hold reason
|
||||
* @param description hold description
|
||||
* @return The HTTP response (or null if no POST call was needed).
|
||||
*/
|
||||
public HttpResponse createHold(String user, String password,
|
||||
String holdName, String reason, String description)
|
||||
{
|
||||
// if the hold already exists don't try to create it again
|
||||
final String fullHoldPath = Utility.buildPath(getFilePlanPath(), HOLDS_CONTAINER) + holdName;
|
||||
final CmisObject hold = getObjectByPath(user, password, fullHoldPath);
|
||||
if (hold != null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
// retrieve the Holds container nodeRef
|
||||
final String parentNodeRef = getItemNodeRef(user, password, "/" + HOLDS_CONTAINER);
|
||||
|
||||
final JSONObject requestParams = new JSONObject();
|
||||
requestParams.put("alf_destination", getNodeRefSpacesStore() + parentNodeRef);
|
||||
requestParams.put("prop_cm_name", holdName);
|
||||
requestParams.put("prop_cm_description", description);
|
||||
requestParams.put("prop_rma_holdReason", reason);
|
||||
|
||||
// Make the POST request and throw an assertion error if it fails.
|
||||
final HttpResponse httpResponse = doPostJsonRequest(user, password, SC_OK, requestParams, CREATE_HOLDS_API);
|
||||
assertNotNull("Expected object to have been created at " + fullHoldPath,
|
||||
getObjectByPath(user, password, fullHoldPath));
|
||||
return httpResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a hold and get the node ref of the hold from the response body
|
||||
*
|
||||
* @param user the user creating the hold
|
||||
* @param password the user's password
|
||||
* @param holdName the hold name to be created
|
||||
* @param reason reason of the hold to be created
|
||||
* @param description hold description
|
||||
* @return node ref of the hold created
|
||||
*/
|
||||
public String createHoldAndGetNodeRef(String user, String password,
|
||||
String holdName, String reason, String description)
|
||||
{
|
||||
final HttpResponse httpResponse = createHold(user, password, holdName, reason, description);
|
||||
|
||||
try
|
||||
{
|
||||
return convertHTTPResponseToJSON(httpResponse).getString("persistedObject")
|
||||
.replace(NODE_REF_WORKSPACE_SPACES_STORE, "");
|
||||
}
|
||||
catch(JSONException error)
|
||||
{
|
||||
LOGGER.error("Converting message body to JSON failed. Body: {}", httpResponse, error);
|
||||
}
|
||||
catch(ParseException error)
|
||||
{
|
||||
LOGGER.error("Parsing message body failed.", error);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes hold
|
||||
*
|
||||
* @param username user's username
|
||||
* @param password its password
|
||||
* @param holdName the hold name
|
||||
* @throws AssertionError if the deletion was unsuccessful.
|
||||
*/
|
||||
public void deleteHold( String username, String password, String holdName)
|
||||
{
|
||||
deleteItem(username, password, String.format("/%s/%s", HOLDS_CONTAINER, holdName));
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds item(content/record/record folder) to the hold
|
||||
*
|
||||
* @param user the user who adds the item to the hold
|
||||
* @param password the user's password
|
||||
* @param itemNodeRef the nodeRef of the item to be added to hold
|
||||
* @param holdName the hold name
|
||||
* @return The HTTP response
|
||||
*/
|
||||
public HttpResponse addItemToHold(String user, String password, String itemNodeRef, String holdName)
|
||||
{
|
||||
return addItemsToHolds(user, password, Collections.singletonList(itemNodeRef), Collections.singletonList(holdName));
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a list of items (content/record/record folder) to a list of holds
|
||||
*
|
||||
* @param user the user who adds the items to the holds
|
||||
* @param password the user's password
|
||||
* @param itemNodeRefs the list of items nodeRefs to be added to holds
|
||||
* @param holdNames the list of holds
|
||||
* @return The HTTP response
|
||||
*/
|
||||
public HttpResponse addItemsToHolds(String user, String password, List<String> itemNodeRefs, List<String> holdNames)
|
||||
{
|
||||
return addItemsToHolds(user, password, SC_OK, itemNodeRefs, holdNames);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a list of items (content/record/record folder) to a list of holds
|
||||
*
|
||||
* @param user the user who adds the items to the holds
|
||||
* @param password the user's password
|
||||
* @param itemNodeRefs the list of items nodeRefs to be added to holds
|
||||
* @param holdNames the list of holds
|
||||
* @return The HTTP response
|
||||
*/
|
||||
public HttpResponse addItemsToHolds(String user, String password, int expectedStatus, List<String> itemNodeRefs,
|
||||
List<String> holdNames)
|
||||
{
|
||||
final JSONObject requestParams = addOrRemoveToFromHoldJsonObject(user, password, itemNodeRefs, holdNames);
|
||||
return doPostJsonRequest(user, password, expectedStatus, requestParams, RM_HOLDS_API);
|
||||
}
|
||||
|
||||
/**
|
||||
* Util method to add item(content/record/record folder) to the hold and get the error message
|
||||
*
|
||||
* @param user the user who adds the item to the hold
|
||||
* @param password the user's password
|
||||
* @param itemNodeRef the nodeRef of the item to be added to hold
|
||||
* @param holdName the hold name
|
||||
* @return The error message
|
||||
*/
|
||||
public String addToHoldAndGetMessage(String user, String password, int expectedStatus, String itemNodeRef, String
|
||||
holdName)
|
||||
{
|
||||
final HttpResponse httpResponse = addItemsToHolds(user, password, expectedStatus, Collections.singletonList(itemNodeRef),
|
||||
Collections.singletonList(holdName));
|
||||
return APIUtils.extractErrorMessageFromHttpResponse(httpResponse);
|
||||
}
|
||||
|
||||
/**
|
||||
* Util method to create the request body used when adding items to holds or when removing items from holds
|
||||
*
|
||||
* @param user user to create the request body for add/remove an item to/from hold
|
||||
* @param password the user's password
|
||||
* @param items list of items node refs to be added to holds
|
||||
* @param holdNames list of hold names for add/remove items
|
||||
* @return JSONObject fo
|
||||
*/
|
||||
private JSONObject addOrRemoveToFromHoldJsonObject(String user, String password, List<String> items, List<String> holdNames)
|
||||
{
|
||||
final JSONArray nodeRefs = new JSONArray();
|
||||
items.forEach(itemNodeRef -> nodeRefs.put(getNodeRefSpacesStore() + itemNodeRef));
|
||||
final List<String> holdNodeRefs = holdNames.stream().map(hold ->
|
||||
getNodeRefSpacesStore() + getItemNodeRef(user, password, String.format("/%s/%s", HOLDS_CONTAINER, hold)))
|
||||
.collect(Collectors.toList());
|
||||
final JSONArray holds = new JSONArray();
|
||||
holdNodeRefs.forEach(holds::put);
|
||||
final JSONObject requestParams = new JSONObject();
|
||||
requestParams.put("nodeRefs", nodeRefs);
|
||||
requestParams.put("holds", holds);
|
||||
return requestParams;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove item(content/record/record folder) from hold
|
||||
*
|
||||
* @param user the user who removes the item from the hold
|
||||
* @param password the user's password
|
||||
* @param itemNodeRef the nodeRef of the item to be removed from hold
|
||||
* @param holdName the hold name
|
||||
* @return The HTTP response
|
||||
*/
|
||||
public HttpResponse removeItemFromHold(String user, String password, String itemNodeRef, String holdName)
|
||||
{
|
||||
return removeItemsFromHolds(user, password, Collections.singletonList(itemNodeRef), Collections.singletonList(holdName));
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a list of items (content/record/record folder) from a list of holds
|
||||
*
|
||||
* @param user the user who removes the item from the hold
|
||||
* @param password the user's password
|
||||
* @param itemNodeRefs the list of items nodeRefs to be removed from hold
|
||||
* @param holdNames the list of hold names
|
||||
* @return The HTTP response
|
||||
*/
|
||||
public HttpResponse removeItemsFromHolds(String user, String password, List<String> itemNodeRefs, List<String> holdNames)
|
||||
{
|
||||
return removeItemsFromHolds(user, password, SC_OK, itemNodeRefs, holdNames);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a list of items (content/record/record folder) from a list of holds
|
||||
*
|
||||
* @param user the user who removes the item from the hold
|
||||
* @param password the user's password
|
||||
* @param expectedStatus https status code expected
|
||||
* @param itemNodeRefs the list of items nodeRefs to be removed from hold
|
||||
* @param holdNames the list of hold names
|
||||
* @return The HTTP response
|
||||
*/
|
||||
public HttpResponse removeItemsFromHolds(String user, String password, int expectedStatus, List<String> itemNodeRefs,
|
||||
List<String> holdNames)
|
||||
{
|
||||
final JSONObject requestParams = addOrRemoveToFromHoldJsonObject(user, password, itemNodeRefs, holdNames);
|
||||
return doPutJsonRequest(user, password, expectedStatus, requestParams, RM_HOLDS_API);
|
||||
}
|
||||
|
||||
/**
|
||||
* Util method to remove item(content/record/record folder) from hold and get the error message
|
||||
*
|
||||
* @param user the user who removes the item from hold
|
||||
* @param password the user's password
|
||||
* @param itemNodeRef the nodeRef of the item to be removed from hold
|
||||
* @param holdName the hold name
|
||||
* @return The error message
|
||||
*/
|
||||
public String removeFromHoldAndGetMessage(String user, String password, int expectedStatus, String itemNodeRef, String
|
||||
holdName)
|
||||
{
|
||||
final HttpResponse httpResponse = removeItemsFromHolds(user, password, expectedStatus, Collections.singletonList(itemNodeRef),
|
||||
Collections.singletonList(holdName));
|
||||
return APIUtils.extractErrorMessageFromHttpResponse(httpResponse);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the list of the available holds which have the item node reference if includedInHold parameter is true,
|
||||
* otherwise a list of hold node references will be retrieved which do not include the given node reference.
|
||||
*
|
||||
* @param user The username of the user to use.
|
||||
* @param password The password of the user.
|
||||
* @param itemNodeRef The item node reference
|
||||
* @param includedInHold True to retrieve the holds which have the item node reference
|
||||
* @param fileOnly True if only files should be return
|
||||
* @return return a list of hold entries
|
||||
*/
|
||||
public List<HoldEntry> getHolds(String user, String password, final String itemNodeRef,
|
||||
final Boolean includedInHold, final Boolean fileOnly)
|
||||
{
|
||||
final String parameters = (itemNodeRef != null ? "itemNodeRef=" + NODE_REF_WORKSPACE_SPACES_STORE + itemNodeRef : "")
|
||||
+ (includedInHold != null ? "&includedInHold=" + includedInHold : "")
|
||||
+ (fileOnly != null ? "&fileOnly=" + fileOnly : "");
|
||||
|
||||
final JSONArray holdEntries = doGetRequest(user, password,
|
||||
MessageFormat.format(GET_RM_HOLDS, "{0}", parameters)).getJSONObject("data").getJSONArray("holds");
|
||||
|
||||
return PojoUtility.jsonToObject(holdEntries, HoldEntry.class);
|
||||
}
|
||||
}
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
@@ -30,7 +30,7 @@ import static org.alfresco.dataprep.AlfrescoHttpClient.MIME_TYPE_JSON;
|
||||
import static org.alfresco.rest.core.v0.APIUtils.ISO_INSTANT_FORMATTER;
|
||||
import static org.apache.http.HttpStatus.SC_OK;
|
||||
import static org.testng.AssertJUnit.assertEquals;
|
||||
import static org.testng.AssertJUnit.assertNotNull;
|
||||
import static org.testng.AssertJUnit.assertFalse;
|
||||
import static org.testng.AssertJUnit.assertTrue;
|
||||
import static org.testng.AssertJUnit.fail;
|
||||
|
||||
@@ -47,7 +47,6 @@ import org.alfresco.dataprep.AlfrescoHttpClientFactory;
|
||||
import org.alfresco.dataprep.UserService;
|
||||
import org.alfresco.rest.core.v0.BaseAPI;
|
||||
import org.alfresco.rest.core.v0.RMEvents;
|
||||
import org.alfresco.utility.Utility;
|
||||
import org.apache.chemistry.opencmis.client.api.CmisObject;
|
||||
import org.apache.commons.httpclient.HttpStatus;
|
||||
import org.apache.http.HttpResponse;
|
||||
@@ -73,8 +72,6 @@ import org.springframework.stereotype.Component;
|
||||
@Component
|
||||
public class RMRolesAndActionsAPI extends BaseAPI
|
||||
{
|
||||
public static final String HOLDS_CONTAINER = "Holds";
|
||||
|
||||
/** The URI to view the configured roles and capabilities. */
|
||||
private static final String RM_ROLES = "{0}rma/admin/rmroles";
|
||||
/** The URI for REST requests about a particular configured role. */
|
||||
@@ -84,9 +81,6 @@ public class RMRolesAndActionsAPI extends BaseAPI
|
||||
// logger
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(RMRolesAndActionsAPI.class);
|
||||
private static final String MOVE_ACTIONS_API = "action/rm-move-to/site/rm/documentLibrary/{0}";
|
||||
private static final String CREATE_HOLDS_API = "{0}type/rma:hold/formprocessor";
|
||||
/** The URI to add items to hold.*/
|
||||
private static final String RM_HOLDS_API = "{0}rma/holds";
|
||||
|
||||
/** http client factory */
|
||||
@Autowired
|
||||
@@ -106,8 +100,8 @@ public class RMRolesAndActionsAPI extends BaseAPI
|
||||
public Set<String> getConfiguredRoles(String adminUser, String adminPassword)
|
||||
{
|
||||
// Using "is=true" includes the in-place readers and writers.
|
||||
final JSONObject jsonObject = doGetRequest(adminUser, adminPassword, RM_ROLES + "?is=true").getJSONObject
|
||||
("data");
|
||||
final JSONObject jsonObject = doGetRequest(adminUser, adminPassword, RM_ROLES + "?is=true").getJSONObject(
|
||||
"data");
|
||||
return jsonObject.toMap().keySet();
|
||||
}
|
||||
|
||||
@@ -121,12 +115,31 @@ public class RMRolesAndActionsAPI extends BaseAPI
|
||||
*/
|
||||
public Set<String> getCapabilitiesForRole(String adminUser, String adminPassword, String role)
|
||||
{
|
||||
final JSONObject jsonObject = doGetRequest(adminUser, adminPassword, RM_ROLES + "?is=true").getJSONObject
|
||||
("data");
|
||||
final JSONObject jsonObject = doGetRequest(adminUser, adminPassword, RM_ROLES + "?is=true").getJSONObject(
|
||||
"data");
|
||||
assertTrue("Could not find role '" + role + "' in " + jsonObject.keySet(), jsonObject.has(role));
|
||||
return jsonObject.getJSONObject(role).getJSONObject("capabilities").keySet();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the body for PUT/POST Roles API requests
|
||||
*
|
||||
* @param roleName the role name
|
||||
* @param roleDisplayLabel a human-readable label for the role
|
||||
* @param capabilities a list of capabilities for the role
|
||||
* @return
|
||||
*/
|
||||
private JSONObject roleRequestBody(String roleName, String roleDisplayLabel, Set<String> capabilities)
|
||||
{
|
||||
final JSONObject requestBody = new JSONObject();
|
||||
requestBody.put("name", roleName);
|
||||
requestBody.put("displayLabel", roleDisplayLabel);
|
||||
final JSONArray capabilitiesArray = new JSONArray();
|
||||
capabilities.forEach(capabilitiesArray::put);
|
||||
requestBody.put("capabilities", capabilitiesArray);
|
||||
return requestBody;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new RM role.
|
||||
*
|
||||
@@ -138,13 +151,8 @@ public class RMRolesAndActionsAPI extends BaseAPI
|
||||
*/
|
||||
public void createRole(String adminUser, String adminPassword, String roleName, String roleDisplayLabel, Set<String> capabilities)
|
||||
{
|
||||
final JSONObject requestBody = new JSONObject();
|
||||
requestBody.put("name", roleName);
|
||||
requestBody.put("displayLabel", roleDisplayLabel);
|
||||
final JSONArray capabilitiesArray = new JSONArray();
|
||||
capabilities.forEach(capabilitiesArray::put);
|
||||
requestBody.put("capabilities", capabilitiesArray);
|
||||
doPostJsonRequest(adminUser, adminPassword, HttpStatus.SC_OK, requestBody, RM_ROLES);
|
||||
doPostJsonRequest(adminUser, adminPassword, HttpStatus.SC_OK, roleRequestBody(roleName, roleDisplayLabel, capabilities),
|
||||
RM_ROLES);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -158,13 +166,8 @@ public class RMRolesAndActionsAPI extends BaseAPI
|
||||
*/
|
||||
public void updateRole(String adminUser, String adminPassword, String roleName, String roleDisplayLabel, Set<String> capabilities)
|
||||
{
|
||||
final JSONObject requestBody = new JSONObject();
|
||||
requestBody.put("name", roleName);
|
||||
requestBody.put("displayLabel", roleDisplayLabel);
|
||||
final JSONArray capabilitiesArray = new JSONArray();
|
||||
capabilities.forEach(capabilitiesArray::put);
|
||||
requestBody.put("capabilities", capabilitiesArray);
|
||||
doPutJsonRequest(adminUser, adminPassword, HttpStatus.SC_OK, requestBody, RM_ROLES_ROLE, roleName);
|
||||
doPutJsonRequest(adminUser, adminPassword, HttpStatus.SC_OK, roleRequestBody(roleName, roleDisplayLabel, capabilities),
|
||||
RM_ROLES_ROLE, roleName);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -177,8 +180,8 @@ public class RMRolesAndActionsAPI extends BaseAPI
|
||||
public void deleteRole(String adminUser, String adminPassword, String roleName)
|
||||
{
|
||||
doDeleteRequest(adminUser, adminPassword, MessageFormat.format(RM_ROLES_ROLE, "{0}", roleName));
|
||||
final boolean success = !getConfiguredRoles(adminUser, adminPassword).contains(roleName);
|
||||
assertTrue("Failed to delete role " + roleName + " with " + adminUser, success);
|
||||
assertFalse("Failed to delete role " + roleName + " with " + adminUser,
|
||||
getConfiguredRoles(adminUser, adminPassword).contains(roleName));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -277,7 +280,7 @@ public class RMRolesAndActionsAPI extends BaseAPI
|
||||
}
|
||||
catch (JSONException | IOException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
LOGGER.error(e.toString());
|
||||
}
|
||||
finally
|
||||
{
|
||||
@@ -315,16 +318,40 @@ public class RMRolesAndActionsAPI extends BaseAPI
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform an action on the record folder
|
||||
* Perform an action on the given content
|
||||
*
|
||||
* @param user the user executing the action
|
||||
* @param password the user's password
|
||||
* @param contentName the content name
|
||||
* @return The HTTP response.
|
||||
*/
|
||||
public HttpResponse executeAction(String user, String password, String contentName, RM_ACTIONS rm_action)
|
||||
public HttpResponse executeAction(String user, String password, String contentName, RM_ACTIONS action)
|
||||
{
|
||||
return executeAction(user, password, contentName, rm_action, null);
|
||||
return executeAction(user, password, contentName, action, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the body for Actions API requests
|
||||
*
|
||||
* @param user the user executing the action
|
||||
* @param password the user's password
|
||||
* @param contentName the content on which the action is executed
|
||||
* @param action the action executed
|
||||
* @param actionsParams the request parameters
|
||||
* @return the JSONObject created
|
||||
*/
|
||||
private JSONObject actionsRequestBody(String user, String password, String contentName, RM_ACTIONS action,
|
||||
JSONObject actionsParams)
|
||||
{
|
||||
final String recNodeRef = getNodeRefSpacesStore() + contentService.getNodeRef(user, password, RM_SITE_ID, contentName);
|
||||
final JSONObject requestParams = new JSONObject();
|
||||
requestParams.put("name", action.getAction());
|
||||
requestParams.put("nodeRef", recNodeRef);
|
||||
if (actionsParams != null)
|
||||
{
|
||||
requestParams.put("params", actionsParams);
|
||||
}
|
||||
return requestParams;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -338,19 +365,12 @@ public class RMRolesAndActionsAPI extends BaseAPI
|
||||
*/
|
||||
public HttpResponse executeAction(String user, String password, String contentName, RM_ACTIONS action, ZonedDateTime date)
|
||||
{
|
||||
String recNodeRef = getNodeRefSpacesStore() + contentService.getNodeRef(user, password, RM_SITE_ID, contentName);
|
||||
JSONObject requestParams = new JSONObject();
|
||||
requestParams.put("name", action.getAction());
|
||||
requestParams.put("nodeRef", recNodeRef);
|
||||
final JSONObject actionParams = new JSONObject();
|
||||
if (date != null)
|
||||
{
|
||||
String thisMoment = date.format(ISO_INSTANT_FORMATTER);
|
||||
requestParams.put("params", new JSONObject()
|
||||
.put("asOfDate", new JSONObject()
|
||||
.put("iso8601", thisMoment)
|
||||
)
|
||||
);
|
||||
actionParams.put("asOfDate", new JSONObject().put("iso8601", ISO_INSTANT_FORMATTER.format(date)));
|
||||
}
|
||||
final JSONObject requestParams = actionsRequestBody(user, password, contentName, action, actionParams);
|
||||
return doPostJsonRequest(user, password, SC_OK, requestParams, RM_ACTIONS_API);
|
||||
}
|
||||
|
||||
@@ -366,20 +386,14 @@ public class RMRolesAndActionsAPI extends BaseAPI
|
||||
*/
|
||||
public HttpResponse completeEvent(String user, String password, String nodeName, RMEvents event, Instant date)
|
||||
{
|
||||
String recNodeRef = getNodeRefSpacesStore() + contentService.getNodeRef(user, password, RM_SITE_ID, nodeName);
|
||||
JSONObject requestParams = new JSONObject();
|
||||
requestParams.put("name", RM_ACTIONS.COMPLETE_EVENT.getAction());
|
||||
requestParams.put("nodeRef", recNodeRef);
|
||||
date = (date != null) ? date : Instant.now();
|
||||
String formattedDate = ISO_INSTANT_FORMATTER.format(date);
|
||||
requestParams.put("params", new JSONObject()
|
||||
.put("eventName", event.getEventName())
|
||||
.put("eventCompletedBy", user)
|
||||
.put("eventCompletedAt", new JSONObject()
|
||||
.put("iso8601", formattedDate)
|
||||
)
|
||||
);
|
||||
|
||||
final JSONObject actionParams = new JSONObject().put("eventName", event.getEventName())
|
||||
.put("eventCompletedBy", user)
|
||||
.put("eventCompletedAt", new JSONObject()
|
||||
.put("iso8601", ISO_INSTANT_FORMATTER.format(date))
|
||||
);
|
||||
final JSONObject requestParams = actionsRequestBody(user, password, nodeName, RM_ACTIONS.COMPLETE_EVENT,
|
||||
actionParams);
|
||||
return doPostJsonRequest(user, password, SC_OK, requestParams, RM_ACTIONS_API);
|
||||
}
|
||||
|
||||
@@ -394,13 +408,8 @@ public class RMRolesAndActionsAPI extends BaseAPI
|
||||
*/
|
||||
public HttpResponse undoEvent(String user, String password, String contentName, RMEvents event)
|
||||
{
|
||||
String recNodeRef = getNodeRefSpacesStore() + contentService.getNodeRef(user, password, RM_SITE_ID, contentName);
|
||||
JSONObject requestParams = new JSONObject();
|
||||
requestParams.put("name", RM_ACTIONS.UNDO_EVENT.getAction());
|
||||
requestParams.put("nodeRef", recNodeRef);
|
||||
requestParams.put("params", new JSONObject()
|
||||
.put("eventName", event.getEventName()));
|
||||
|
||||
final JSONObject requestParams = actionsRequestBody(user, password, contentName, RM_ACTIONS.UNDO_EVENT,
|
||||
new JSONObject().put("eventName", event.getEventName()));
|
||||
return doPostJsonRequest(user, password, SC_OK, requestParams, RM_ACTIONS_API);
|
||||
}
|
||||
|
||||
@@ -419,82 +428,10 @@ public class RMRolesAndActionsAPI extends BaseAPI
|
||||
{
|
||||
item.delete();
|
||||
}
|
||||
boolean success = !(contentService.getFolderObject(contentService.getCMISSession(username, password), siteId, containerName).getChildren().getHasMoreItems());
|
||||
assertTrue("Not all items were deleted from " + containerName, success);
|
||||
assertFalse("Not all items were deleted from " + containerName,
|
||||
contentService.getFolderObject(contentService.getCMISSession(username, password), siteId, containerName).getChildren().getHasMoreItems());
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes hold
|
||||
*
|
||||
* @param username user's username
|
||||
* @param password its password
|
||||
* @param holdName the hold name
|
||||
* @throws AssertionError if the deletion was unsuccessful.
|
||||
*/
|
||||
public void deleteHold(String username, String password, String holdName)
|
||||
{
|
||||
deleteItem(username, password, "/Holds/" + holdName);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Util method to create a hold
|
||||
*
|
||||
* @param user the user creating the category
|
||||
* @param password the user's password
|
||||
* @param holdName the hold name
|
||||
* @param reason hold reason
|
||||
* @param description hold description
|
||||
* @return The HTTP response (or null if no POST call was needed).
|
||||
*/
|
||||
public HttpResponse createHold(String user, String password, String holdName, String reason, String description)
|
||||
{
|
||||
// if the hold already exists don't try to create it again
|
||||
final String holdsContainerPath = Utility.buildPath(getFilePlanPath(), HOLDS_CONTAINER);
|
||||
final String fullHoldPath = holdsContainerPath + holdName;
|
||||
final CmisObject hold = getObjectByPath(user, password, fullHoldPath);
|
||||
if (hold != null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
// retrieve the Holds container nodeRef
|
||||
final String parentNodeRef = getItemNodeRef(user, password, "/Holds");
|
||||
|
||||
final JSONObject requestParams = new JSONObject();
|
||||
requestParams.put("alf_destination", getNodeRefSpacesStore() + parentNodeRef);
|
||||
requestParams.put("prop_cm_name", holdName);
|
||||
requestParams.put("prop_cm_description", description);
|
||||
requestParams.put("prop_rma_holdReason", reason);
|
||||
|
||||
// Make the POST request and throw an assertion error if it fails.
|
||||
final HttpResponse httpResponse = doPostJsonRequest(user, password, SC_OK, requestParams, CREATE_HOLDS_API);
|
||||
assertNotNull("Expected object to have been created at " + fullHoldPath,
|
||||
getObjectByPath(user, password, fullHoldPath));
|
||||
return httpResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds item (record/ record folder) to the hold
|
||||
*
|
||||
* @param user the user who adds the item to the hold
|
||||
* @param password the user's password
|
||||
* @param itemNodeRef the nodeRef of the item to be added to hold
|
||||
* @param holdName the hold name
|
||||
* @return The HTTP response
|
||||
*/
|
||||
public HttpResponse addItemToHold(String user, String password, String itemNodeRef, String holdName)
|
||||
{
|
||||
final JSONArray nodeRefs = new JSONArray().put(getNodeRefSpacesStore() + itemNodeRef);
|
||||
final String holdNodeRef = getItemNodeRef(user, password, String.format("/%s/%s", HOLDS_CONTAINER, holdName));
|
||||
final JSONArray holds = new JSONArray().put(getNodeRefSpacesStore() + holdNodeRef);
|
||||
final JSONObject requestParams = new JSONObject();
|
||||
requestParams.put("nodeRefs", nodeRefs);
|
||||
requestParams.put("holds", holds);
|
||||
|
||||
return doPostJsonRequest(user, password, SC_OK, requestParams, RM_HOLDS_API);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Updates metadata, can be used on records, folders and categories
|
||||
*
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
@@ -38,7 +38,6 @@ import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.alfresco.rest.core.v0.BaseAPI;
|
||||
import org.alfresco.rest.rm.community.model.rules.ActionsOnRule;
|
||||
import org.alfresco.rest.rm.community.model.rules.RuleDefinition;
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.json.JSONArray;
|
||||
@@ -251,10 +250,10 @@ public class RulesAPI extends BaseAPI
|
||||
{
|
||||
List<JSONObject> ruleActionsList = new ArrayList<>();
|
||||
|
||||
for (ActionsOnRule ruleAction : ruleProperties.getActions())
|
||||
for (String ruleAction : ruleProperties.getActions())
|
||||
{
|
||||
JSONObject ruleActionObj = new JSONObject();
|
||||
ruleActionObj.put("actionDefinitionName", ruleAction.getActionValue());
|
||||
ruleActionObj.put("actionDefinitionName", ruleAction);
|
||||
JSONObject parameters = new JSONObject();
|
||||
if (ruleProperties.getPath() != null)
|
||||
{
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
@@ -241,7 +241,6 @@ public class SearchAPI extends BaseAPI
|
||||
* Helper method to extract list of names from search result.
|
||||
*
|
||||
* @param searchResult
|
||||
* @param getProperties
|
||||
* @return
|
||||
*/
|
||||
private List<String> getItemNames(JSONObject searchResult)
|
||||
@@ -253,7 +252,8 @@ public class SearchAPI extends BaseAPI
|
||||
* Helper method to extract list of property values from search result for the given nodeRef.
|
||||
*
|
||||
* @param searchResult
|
||||
* @param getProperties
|
||||
* @param nodeRef
|
||||
* @param propertyName
|
||||
* @return
|
||||
*/
|
||||
private String getItemProperty(JSONObject searchResult, String nodeRef, String propertyName)
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user