mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-09-10 14:11:58 +00:00
Compare commits
256 Commits
20.152
...
23.1.0.155
Author | SHA1 | Date | |
---|---|---|---|
|
095bf0e8d8 | ||
|
c23db31ca4 | ||
|
6cfcc8b207 | ||
|
20582dfcf9 | ||
|
fb6b1ef4ab | ||
|
7fc184ccf3 | ||
|
732d4e4733 | ||
|
bd94060fea | ||
|
d46ae1634f | ||
|
7bd31eca5f | ||
|
8938aaff09 | ||
|
18dadfe110 | ||
|
4e9fb76404 | ||
|
295c3ba58e | ||
|
195e0e927c | ||
|
b0adc1a6bb | ||
|
828c98d03f | ||
|
1d4c97cfb7 | ||
|
e0d5d0691f | ||
|
96942ceeb9 | ||
|
2d16c28859 | ||
|
51fe0275df | ||
|
4786a0fb0b | ||
|
3f91a6001f | ||
|
1f1b534a28 | ||
|
689e6a23fa | ||
|
562c83bb9c | ||
|
4ff91be9f4 | ||
|
f3190133c3 | ||
|
8325cd7c66 | ||
|
aeb931b018 | ||
|
6679a33412 | ||
|
aea504f911 | ||
|
fb235e1682 | ||
|
4065400dbd | ||
|
02aa423087 | ||
|
0dbd2fb3d0 | ||
|
c30c96de47 | ||
|
fa9ffbe71a | ||
|
826db75625 | ||
|
04df3385fd | ||
|
cc12b34c7f | ||
|
c110e2b76c | ||
|
3d1ef4883b | ||
|
afa2bbf325 | ||
|
1d665f4e50 | ||
|
6a527068dc | ||
|
a45c04679f | ||
|
bc6398c038 | ||
|
43f1100040 | ||
|
8bade25669 | ||
|
1e6e87f24a | ||
|
cac97dc1e7 | ||
|
3bcef29c30 | ||
|
fb98bb09f0 | ||
|
ad723a700a | ||
|
1bc5bed838 | ||
|
beaf83a008 | ||
|
8734eec068 | ||
|
1e506659d2 | ||
|
b834ab9245 | ||
|
402c0661e0 | ||
|
763f0932a0 | ||
|
0403fcde69 | ||
|
1866e64d07 | ||
|
47b793b922 | ||
|
8ebaf16a45 | ||
|
c3dcf8891e | ||
|
5cdb5f2922 | ||
|
2bac9bd9d1 | ||
|
fffef168d9 | ||
|
0f89c3ce8a | ||
|
497b197c12 | ||
|
2b8ea3bb50 | ||
|
5e7394a37d | ||
|
89329d7984 | ||
|
3f94b1632b | ||
|
d0f6867887 | ||
|
49c56e9a9d | ||
|
78b54e65c4 | ||
|
b93212f3bf | ||
|
636d63e34f | ||
|
ad934e511d | ||
|
16db159092 | ||
|
fd8e44e365 | ||
|
ed924094ff | ||
|
3181d2b8bf | ||
|
2891a3ba61 | ||
|
92f27bbcd7 | ||
|
80d4db2e81 | ||
|
6bd598fadf | ||
|
c1b4b30262 | ||
|
f0e5dcaa67 | ||
|
07c7342032 | ||
|
b0af817377 | ||
|
e8cf0f7d12 | ||
|
b8e621d3d9 | ||
|
a62db22ecb | ||
|
5fcee3ec55 | ||
|
8a6274b37e | ||
|
d279b3e3c3 | ||
|
da5505a21f | ||
|
e476334998 | ||
|
7990991453 | ||
|
9289fc7f89 | ||
|
20af2a5dd9 | ||
|
59069ae38f | ||
|
ea4eac5a77 | ||
|
83bc0dcee1 | ||
|
5af7a1e284 | ||
|
11333eb1e5 | ||
|
e901ffb751 | ||
|
7dbe25d754 | ||
|
1f764b446e | ||
|
4c256ab546 | ||
|
8fe2f5b251 | ||
|
841826fcdd | ||
|
1a98715d35 | ||
|
334126ec72 | ||
|
e02c334362 | ||
|
269cc165e0 | ||
|
b724203f5b | ||
|
5912726372 | ||
|
eb85205df1 | ||
|
88616a2c48 | ||
|
90e9764d63 | ||
|
50e91a40bc | ||
|
391ba106c4 | ||
|
46942b9e77 | ||
|
4ff76617a9 | ||
|
82c671c07a | ||
|
06ce348cdd | ||
|
099cbb614c | ||
|
0acc6d31ef | ||
|
a218cfa0ed | ||
|
e00959a089 | ||
|
a9ac83704b | ||
|
603f334c46 | ||
|
2de971dad3 | ||
|
31f347e42f | ||
|
e88b4e96ee | ||
|
6e408235f2 | ||
|
182211ee32 | ||
|
380b63d63b | ||
|
08312a5153 | ||
|
9dafa748af | ||
|
fec31aed1c | ||
|
92af01368b | ||
|
019b3d4de3 | ||
|
c2728a4239 | ||
|
9f68abcfda | ||
|
390e533107 | ||
|
a7e0491532 | ||
|
434e4d3dc3 | ||
|
c88d1802a1 | ||
|
490c87ec9a | ||
|
ae479351c2 | ||
|
44cf210b27 | ||
|
99a1c05c39 | ||
|
4f6786ee95 | ||
|
5d9dca1872 | ||
|
bf7f64add4 | ||
|
7d15862b69 | ||
|
2e8ec4c226 | ||
|
24752d0409 | ||
|
ff8804e7db | ||
|
02a62cb5f7 | ||
|
e1afe15055 | ||
|
0fcdf3b00b | ||
|
fa63cef4f7 | ||
|
27f41e11b3 | ||
|
affa20e996 | ||
|
0df9f562e6 | ||
|
9a3ec69b27 | ||
|
7126406bf3 | ||
|
edc43ed5b9 | ||
|
907aed826a | ||
|
eaa96607b9 | ||
|
0d5d9ff0b4 | ||
|
5266304805 | ||
|
63e77b6f86 | ||
|
9cf74e4dc4 | ||
|
4107a0fd0e | ||
|
8554fe0d74 | ||
|
2ed88cd1be | ||
|
8f4f4e938c | ||
|
dc76b15aa6 | ||
|
0109db978f | ||
|
6461629024 | ||
|
c35dbb0481 | ||
|
637523c2c8 | ||
|
f1a54895f6 | ||
|
7f6d9443e2 | ||
|
297d72c246 | ||
|
7208ad9b62 | ||
|
31ca2726a8 | ||
|
6f43286441 | ||
|
aec50a991f | ||
|
f62b937ded | ||
|
66d3d72f7c | ||
|
0b4b9fd47a | ||
|
2b955d21f9 | ||
|
6a853f3b92 | ||
|
c293ace4e0 | ||
|
86dfdd8df4 | ||
|
abd73e820c | ||
|
09bec28721 | ||
|
0d1a6c8a0a | ||
|
4b9c052f0d | ||
|
6fb0bb3042 | ||
|
78f3d58c46 | ||
|
1913258e84 | ||
|
d95e6c8e34 | ||
|
958d217339 | ||
|
4417e28412 | ||
|
58653cb523 | ||
|
7af935d43a | ||
|
f5d843446a | ||
|
817901e74e | ||
|
c492683113 | ||
|
e2305d053f | ||
|
749768457e | ||
|
118f2ecbab | ||
|
a4ac93df7a | ||
|
1e1fbe8207 | ||
|
e78f9ced98 | ||
|
72221c777d | ||
|
25f3f33594 | ||
|
f83328f7b0 | ||
|
a177f391db | ||
|
784557afcd | ||
|
8fb7b0d224 | ||
|
011ec9d7e6 | ||
|
3900f589d9 | ||
|
def7a0d432 | ||
|
7371c5d7ff | ||
|
90406cef03 | ||
|
862e6d5596 | ||
|
27be717df5 | ||
|
28ad071daf | ||
|
06cc5e3499 | ||
|
df8b36350d | ||
|
552abc9bd4 | ||
|
00cab8e6b5 | ||
|
6f4069790c | ||
|
146b59a4a8 | ||
|
2c3845bf9d | ||
|
dd05f3d338 | ||
|
c2338bdeb2 | ||
|
589e14a0b1 | ||
|
0f753c11c7 | ||
|
c8fea93298 | ||
|
d7f881ce0c | ||
|
b5fabb1290 | ||
|
653f733887 | ||
|
623782dc97 |
40
.github/workflows/ci.yml
vendored
40
.github/workflows/ci.yml
vendored
@@ -65,7 +65,21 @@ jobs:
|
||||
srcclr-api-token: ${{ secrets.SRCCLR_API_TOKEN }}
|
||||
- name: "Clean Maven cache"
|
||||
run: bash ./scripts/ci/cleanup_cache.sh
|
||||
|
||||
|
||||
pmd_scan:
|
||||
name: "PMD Scan"
|
||||
runs-on: ubuntu-latest
|
||||
needs: [prepare]
|
||||
if: >
|
||||
github.event_name == 'pull_request' &&
|
||||
!contains(github.event.head_commit.message, '[skip pmd]') &&
|
||||
!contains(github.event.head_commit.message, '[skip tests]') &&
|
||||
!contains(github.event.head_commit.message, '[force]')
|
||||
steps:
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/pmd@v2.5.0
|
||||
with:
|
||||
fail-on-new-issues: "false"
|
||||
|
||||
all_unit_tests_suite:
|
||||
name: "Core, Data-Model, Repository - AllUnitTestsSuite - Build and test"
|
||||
runs-on: ubuntu-latest
|
||||
@@ -547,3 +561,27 @@ jobs:
|
||||
aws s3 cp --acl private ./amps/ags/rm-automation/rm-automation-community-rest-api/target/reports/rm-automation-community-rest-api.log s3://ags-travis-artifacts/community/${{ github.run_number }}/AGS-Community-Rest-API-Tests/rm-automation-community-rest-api.log
|
||||
- name: "Clean Maven cache"
|
||||
run: bash ./scripts/ci/cleanup_cache.sh
|
||||
|
||||
ags_start_api_explorer:
|
||||
name: "Test Tomcat deployment of api explorer"
|
||||
runs-on: ubuntu-latest
|
||||
needs: [ prepare ]
|
||||
if: >
|
||||
(((github.ref_name == 'master' || startsWith(github.ref_name, 'release/') || github.event_name == 'pull_request' ) &&
|
||||
!contains(github.event.head_commit.message, '[skip ags]')) ||
|
||||
contains(github.event.head_commit.message, '[ags]')) &&
|
||||
!contains(github.event.head_commit.message, '[skip tests]') &&
|
||||
!contains(github.event.head_commit.message, '[force]')
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.33.0
|
||||
- name: "Build"
|
||||
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
|
||||
run: |
|
||||
bash ./scripts/ci/init.sh
|
||||
bash ./scripts/ci/build.sh
|
||||
- name: "Test Tomcat deployment"
|
||||
run: |
|
||||
mvn verify -Pags,start-api-explorer -DskipTests &
|
||||
${{ env.TAS_SCRIPTS }}/wait-for-alfresco-start.sh "http://localhost:8085/api-explorer"
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-amps</artifactId>
|
||||
<version>20.152</version>
|
||||
<version>23.1.0.155</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-governance-services-community-parent</artifactId>
|
||||
<version>20.152</version>
|
||||
<version>23.1.0.155</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-governance-services-automation-community-repo</artifactId>
|
||||
<version>20.152</version>
|
||||
<version>23.1.0.155</version>
|
||||
</parent>
|
||||
|
||||
<build>
|
||||
@@ -82,7 +82,7 @@
|
||||
<dependency>
|
||||
<groupId>com.github.docker-java</groupId>
|
||||
<artifactId>docker-java</artifactId>
|
||||
<version>3.2.13</version>
|
||||
<version>3.3.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
@@ -512,7 +512,12 @@ public abstract class BaseAPI
|
||||
try
|
||||
{
|
||||
HttpResponse httpResponse = doRequestJson(HttpPost.class, requestUrl, adminUser, adminPassword, requestParams);
|
||||
assertEquals("POST request to " + requestUrl + " was not successful.", expectedStatusCode, httpResponse.getStatusLine().getStatusCode());
|
||||
if (httpResponse.getStatusLine().getStatusCode() != expectedStatusCode)
|
||||
{
|
||||
// It's only possible to stream the response body once, so ensure we only do this if the test has failed.
|
||||
JSONObject responseJson = responseBodyToJson(httpResponse);
|
||||
assertEquals("POST request to " + requestUrl + " was not successful. Response: " + responseJson, expectedStatusCode, httpResponse.getStatusLine().getStatusCode());
|
||||
}
|
||||
return httpResponse;
|
||||
}
|
||||
catch (InstantiationException | IllegalAccessException error)
|
||||
@@ -521,6 +526,32 @@ public abstract class BaseAPI
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Try to convert the response body to a JSON object.
|
||||
*
|
||||
* @param response The response.
|
||||
* @return The JSON object or null if it was not possible to convert the response.
|
||||
*/
|
||||
private JSONObject responseBodyToJson(HttpResponse response)
|
||||
{
|
||||
try
|
||||
{
|
||||
try
|
||||
{
|
||||
return new JSONObject(EntityUtils.toString(response.getEntity()));
|
||||
}
|
||||
catch (JSONException error)
|
||||
{
|
||||
LOGGER.error("Converting message body to JSON failed. Body: {}", response.getEntity().getContent(), error);
|
||||
}
|
||||
}
|
||||
catch (ParseException | IOException error)
|
||||
{
|
||||
LOGGER.error("Parsing message body failed.", error);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method for handling generic HTTP requests
|
||||
* @param requestType request type (a subclass of {@link HttpRequestBase})
|
||||
@@ -558,18 +589,7 @@ public abstract class BaseAPI
|
||||
HttpResponse response = client.execute(adminUser, adminPassword, request);
|
||||
LOGGER.info("Response: {}", response.getStatusLine());
|
||||
|
||||
try
|
||||
{
|
||||
responseBody = new JSONObject(EntityUtils.toString(response.getEntity()));
|
||||
}
|
||||
catch (JSONException error)
|
||||
{
|
||||
LOGGER.error("Converting message body to JSON failed. Body: {}", responseBody, error);
|
||||
}
|
||||
catch (ParseException | IOException error)
|
||||
{
|
||||
LOGGER.error("Parsing message body failed.", error);
|
||||
}
|
||||
responseBody = responseBodyToJson(response);
|
||||
|
||||
switch (response.getStatusLine().getStatusCode())
|
||||
{
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-governance-services-community-parent</artifactId>
|
||||
<version>20.152</version>
|
||||
<version>23.1.0.155</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
@@ -1,3 +1,3 @@
|
||||
SOLR6_TAG=2.0.7-A5
|
||||
POSTGRES_TAG=14.4
|
||||
ACTIVEMQ_TAG=5.17.1-jre11-rockylinux8
|
||||
ACTIVEMQ_TAG=5.17.4-jre17-rockylinux8
|
||||
|
@@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-governance-services-community-repo-parent</artifactId>
|
||||
<version>20.152</version>
|
||||
<version>23.1.0.155</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
@@ -436,7 +436,7 @@
|
||||
</run>
|
||||
</image>
|
||||
<image>
|
||||
<name>alfresco/alfresco-activemq:${dependency.activemq.version}-jre11-rockylinux8</name>
|
||||
<name>alfresco/alfresco-activemq:${dependency.activemq.version}-jre17-rockylinux8</name>
|
||||
<run>
|
||||
<ports>
|
||||
<port>${activemq.port1}:${activemq.port1}</port>
|
||||
@@ -507,7 +507,7 @@
|
||||
</run>
|
||||
</image>
|
||||
<image>
|
||||
<name>alfresco/alfresco-activemq:${dependency.activemq.version}-jre11-rockylinux8</name>
|
||||
<name>alfresco/alfresco-activemq:${dependency.activemq.version}-jre17-rockylinux8</name>
|
||||
<run>
|
||||
<ports>
|
||||
<port>${activemq.port1}:${activemq.port1}</port>
|
||||
|
@@ -3,8 +3,8 @@
|
||||
#
|
||||
|
||||
# Version label
|
||||
version.major=7
|
||||
version.minor=4
|
||||
version.major=23
|
||||
version.minor=1
|
||||
version.revision=0
|
||||
version.label=
|
||||
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-governance-services-community-repo-parent</artifactId>
|
||||
<version>20.152</version>
|
||||
<version>23.1.0.155</version>
|
||||
</parent>
|
||||
|
||||
<build>
|
||||
@@ -36,24 +36,40 @@
|
||||
<id>start-api-explorer</id>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.tomcat.maven</groupId>
|
||||
<artifactId>tomcat7-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>run-war</id>
|
||||
<goals>
|
||||
<goal>run-war</goal>
|
||||
</goals>
|
||||
<phase>verify</phase>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<useSeparateTomcatClassLoader>true</useSeparateTomcatClassLoader>
|
||||
<path>/api-explorer</path>
|
||||
<port>8085</port>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.cargo</groupId>
|
||||
<artifactId>cargo-maven3-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>run-war</id>
|
||||
<phase>verify</phase>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<container>
|
||||
<containerId>tomcat9x</containerId>
|
||||
<type>embedded</type>
|
||||
<log>target/cargo.log</log>
|
||||
</container>
|
||||
<configuration>
|
||||
<properties>
|
||||
<cargo.servlet.port>8085</cargo.servlet.port>
|
||||
</properties>
|
||||
</configuration>
|
||||
<deployables>
|
||||
<deployable>
|
||||
<type>war</type>
|
||||
<properties>
|
||||
<context>/api-explorer</context>
|
||||
</properties>
|
||||
<pingURL>http://localhost:8085/api-explorer</pingURL>
|
||||
</deployable>
|
||||
</deployables>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>20.152</version>
|
||||
<version>23.1.0.155</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
@@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-amps</artifactId>
|
||||
<version>20.152</version>
|
||||
<version>23.1.0.155</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
@@ -23,6 +23,10 @@ function runAction(p_params)
|
||||
if (p_params.destNode.hasAspect("cm:lockable") && !p_params.destNode.hasAspect("trx:transferred"))
|
||||
{
|
||||
p_params.destNode.unlock();
|
||||
if(p_params.destNode.hasAspect("gd2:editingInGoogle"))
|
||||
{
|
||||
p_params.destNode.removeAspect("gd2:editingInGoogle");
|
||||
}
|
||||
}
|
||||
|
||||
var resultId = originalDoc.name,
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>20.152</version>
|
||||
<version>23.1.0.155</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>20.152</version>
|
||||
<version>23.1.0.155</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
@@ -119,7 +119,7 @@
|
||||
<dependency>
|
||||
<groupId>org.jibx</groupId>
|
||||
<artifactId>jibx-run</artifactId>
|
||||
<version>1.3.3</version>
|
||||
<version>1.4.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
@@ -134,7 +134,7 @@
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.woodstox</groupId>
|
||||
<artifactId>woodstox-core</artifactId>
|
||||
<version>6.4.0</version>
|
||||
<version>6.5.1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- the cxf libs were updated, see dependencyManagement section -->
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>20.152</version>
|
||||
<version>23.1.0.155</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
@@ -9,6 +9,6 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||
<version>20.152</version>
|
||||
<version>23.1.0.155</version>
|
||||
</parent>
|
||||
</project>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||
<version>20.152</version>
|
||||
<version>23.1.0.155</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>20.152</version>
|
||||
<version>23.1.0.155</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
@@ -1,3 +1,3 @@
|
||||
SOLR6_TAG=2.0.7-A5
|
||||
POSTGRES_TAG=14.4
|
||||
ACTIVEMQ_TAG=5.17.1-jre11-rockylinux8
|
||||
ACTIVEMQ_TAG=5.17.4-jre17-rockylinux8
|
||||
|
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||
<version>20.152</version>
|
||||
<version>23.1.0.155</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>20.152</version>
|
||||
<version>23.1.0.155</version>
|
||||
</parent>
|
||||
|
||||
<organization>
|
||||
@@ -16,12 +16,12 @@
|
||||
</organization>
|
||||
|
||||
<properties>
|
||||
<maven.build.sourceVersion>11</maven.build.sourceVersion>
|
||||
<maven.build.sourceVersion>17</maven.build.sourceVersion>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<chemistry-opencmis-commons-api>1.1.0</chemistry-opencmis-commons-api>
|
||||
<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
|
||||
<maven-release.version>2.5.3</maven-release.version>
|
||||
<java.version>11</java.version>
|
||||
<java.version>17</java.version>
|
||||
<suiteXmlFile>${project.basedir}/src/test/resources/cmis-suite.xml</suiteXmlFile>
|
||||
<cmis.binding />
|
||||
<cmis.basePath />
|
||||
@@ -58,12 +58,6 @@
|
||||
</profiles>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.jboss.resteasy</groupId>
|
||||
<artifactId>resteasy-jackson2-provider</artifactId>
|
||||
<version>4.7.1.Final</version>
|
||||
</dependency>
|
||||
|
||||
<!-- alfresco tester settings -->
|
||||
<dependency>
|
||||
<groupId>org.alfresco.tas</groupId>
|
||||
|
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>20.152</version>
|
||||
<version>23.1.0.155</version>
|
||||
</parent>
|
||||
|
||||
<developers>
|
||||
|
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>20.152</version>
|
||||
<version>23.1.0.155</version>
|
||||
</parent>
|
||||
|
||||
<developers>
|
||||
|
@@ -8,20 +8,19 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>20.152</version>
|
||||
<version>23.1.0.155</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<suiteXmlFile>${project.basedir}/src/test/resources/restapi-suite.xml</suiteXmlFile>
|
||||
<maven.build.sourceVersion>11</maven.build.sourceVersion>
|
||||
<maven.build.sourceVersion>17</maven.build.sourceVersion>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<rest.api.explorer.branch>master</rest.api.explorer.branch>
|
||||
<httpclient-osgi-version>4.5.6</httpclient-osgi-version>
|
||||
<org.glassfish.version>1.1.4</org.glassfish.version>
|
||||
<commons-lang3.version>3.12.0</commons-lang3.version>
|
||||
<scribejava-apis.version>8.3.1</scribejava-apis.version>
|
||||
<license-maven-plugin.version>2.0.1.alfresco-2</license-maven-plugin.version>
|
||||
<java.version>11</java.version>
|
||||
<scribejava-apis.version>8.3.3</scribejava-apis.version>
|
||||
<java.version>17</java.version>
|
||||
</properties>
|
||||
|
||||
<profiles>
|
||||
@@ -85,6 +84,13 @@
|
||||
<version>${commons-lang3.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.awaitility</groupId>
|
||||
<artifactId>awaitility</artifactId>
|
||||
<version>${dependency.awaitility.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- REST ASSURED -->
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
@@ -165,14 +171,14 @@
|
||||
<dependency>
|
||||
<groupId>org.codehaus.groovy</groupId>
|
||||
<artifactId>groovy</artifactId>
|
||||
<version>3.0.16</version>
|
||||
<version>3.0.17</version>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/org.codehaus.groovy/groovy-json-->
|
||||
<dependency>
|
||||
<groupId>org.codehaus.groovy</groupId>
|
||||
<artifactId>groovy-json</artifactId>
|
||||
<version>3.0.16</version>
|
||||
<version>3.0.17</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
@@ -0,0 +1,190 @@
|
||||
package org.alfresco.rest.search;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import org.alfresco.rest.core.IRestModel;
|
||||
import org.alfresco.utility.model.TestModel;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
/**
|
||||
* Generated by 'krystian' on '2023-06-12 18:46' from 'Alfresco Content Services REST API' swagger file
|
||||
* Generated from 'Alfresco Content Services REST API' swagger file
|
||||
* Base Path {@linkplain /alfresco/api/-default-/public/search/versions/1}
|
||||
*/
|
||||
public class RestRequestDefaultsModel extends TestModel implements IRestModel<RestRequestDefaultsModel>
|
||||
{
|
||||
@JsonProperty(value = "entry")
|
||||
RestRequestDefaultsModel model;
|
||||
|
||||
@Override
|
||||
public RestRequestDefaultsModel onModel()
|
||||
{
|
||||
return model;
|
||||
}
|
||||
|
||||
/**
|
||||
A list of query fields/properties used to expand TEXT: queries.
|
||||
The default is cm:content.
|
||||
You could include all content properties using d:content or list all individual content properties or types.
|
||||
As more terms are included the query size, complexity, memory impact and query time will increase.
|
||||
|
||||
*/
|
||||
|
||||
private List<String> textAttributes;
|
||||
/**
|
||||
The default way to combine query parts when AND or OR is not explicitly stated - includes ! - +
|
||||
one two three
|
||||
(one two three)
|
||||
|
||||
*/
|
||||
|
||||
private String defaultFTSOperator;
|
||||
/**
|
||||
The default way to combine query parts in field query groups when AND or OR is not explicitly stated - includes ! - +
|
||||
FIELD:(one two three)
|
||||
|
||||
*/
|
||||
|
||||
private String defaultFTSFieldOperator;
|
||||
/**
|
||||
The default name space to use if one is not provided
|
||||
*/
|
||||
|
||||
private String namespace;
|
||||
|
||||
private String defaultFieldName;
|
||||
|
||||
public List<String> getTextAttributes()
|
||||
{
|
||||
return this.textAttributes;
|
||||
}
|
||||
|
||||
public void setTextAttributes(List<String> textAttributes)
|
||||
{
|
||||
this.textAttributes = textAttributes;
|
||||
}
|
||||
|
||||
public String getDefaultFTSOperator()
|
||||
{
|
||||
return this.defaultFTSOperator;
|
||||
}
|
||||
|
||||
public void setDefaultFTSOperator(String defaultFTSOperator)
|
||||
{
|
||||
this.defaultFTSOperator = defaultFTSOperator;
|
||||
}
|
||||
|
||||
public String getDefaultFTSFieldOperator()
|
||||
{
|
||||
return this.defaultFTSFieldOperator;
|
||||
}
|
||||
|
||||
public void setDefaultFTSFieldOperator(String defaultFTSFieldOperator)
|
||||
{
|
||||
this.defaultFTSFieldOperator = defaultFTSFieldOperator;
|
||||
}
|
||||
|
||||
public String getNamespace()
|
||||
{
|
||||
return this.namespace;
|
||||
}
|
||||
|
||||
public void setNamespace(String namespace)
|
||||
{
|
||||
this.namespace = namespace;
|
||||
}
|
||||
|
||||
public String getDefaultFieldName()
|
||||
{
|
||||
return this.defaultFieldName;
|
||||
}
|
||||
|
||||
public void setDefaultFieldName(String defaultFieldName)
|
||||
{
|
||||
this.defaultFieldName = defaultFieldName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "RestRequestDefaultsModel{" + "textAttributes=" + textAttributes + ", defaultFTSOperator='" + defaultFTSOperator + '\'' + ", defaultFTSFieldOperator='"
|
||||
+ defaultFTSFieldOperator + '\'' + ", namespace='" + namespace + '\'' + ", defaultFieldName='" + defaultFieldName + '\'' + '}';
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o)
|
||||
{
|
||||
if (this == o)
|
||||
return true;
|
||||
if (o == null || getClass() != o.getClass())
|
||||
return false;
|
||||
RestRequestDefaultsModel that = (RestRequestDefaultsModel) o;
|
||||
return Objects.equals(textAttributes, that.textAttributes) && Objects.equals(defaultFTSOperator, that.defaultFTSOperator) && Objects.equals(
|
||||
defaultFTSFieldOperator, that.defaultFTSFieldOperator) && Objects.equals(namespace, that.namespace) && Objects.equals(defaultFieldName, that.defaultFieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
return Objects.hash(textAttributes, defaultFTSOperator, defaultFTSFieldOperator, namespace, defaultFieldName);
|
||||
}
|
||||
|
||||
public static Builder builder()
|
||||
{
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public static class Builder
|
||||
{
|
||||
private List<String> textAttributes;
|
||||
private String defaultFTSOperator;
|
||||
private String defaultFTSFieldOperator;
|
||||
private String namespace;
|
||||
private String defaultFieldName;
|
||||
|
||||
public Builder textAttributes(List<String> textAttributes)
|
||||
{
|
||||
this.textAttributes = textAttributes;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder defaultFTSOperator(String defaultFTSOperator)
|
||||
{
|
||||
this.defaultFTSOperator = defaultFTSOperator;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder defaultFTSFieldOperator(String defaultFTSFieldOperator)
|
||||
{
|
||||
this.defaultFTSFieldOperator = defaultFTSFieldOperator;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder namespace(String namespace)
|
||||
{
|
||||
this.namespace = namespace;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder defaultFieldName(String defaultFieldName)
|
||||
{
|
||||
this.defaultFieldName = defaultFieldName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public RestRequestDefaultsModel create()
|
||||
{
|
||||
RestRequestDefaultsModel defaults = new RestRequestDefaultsModel();
|
||||
defaults.setTextAttributes(this.textAttributes);
|
||||
defaults.setDefaultFTSOperator(this.defaultFTSOperator);
|
||||
defaults.setDefaultFTSFieldOperator(this.defaultFTSFieldOperator);
|
||||
defaults.setNamespace(this.namespace);
|
||||
defaults.setDefaultFieldName(this.defaultFieldName);
|
||||
|
||||
return defaults;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,105 @@
|
||||
package org.alfresco.rest.search;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import org.alfresco.rest.core.IRestModel;
|
||||
import org.alfresco.utility.model.TestModel;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
/**
|
||||
* Generated by 'krystian' on '2023-06-12 18:46' from 'Alfresco Content Services REST API' swagger file
|
||||
* Generated from 'Alfresco Content Services REST API' swagger file
|
||||
* Base Path {@linkplain /alfresco/api/-default-/public/search/versions/1}
|
||||
*/
|
||||
public class RestRequestTemplatesModel extends TestModel implements IRestModel<RestRequestTemplatesModel>
|
||||
{
|
||||
@JsonProperty(value = "entry")
|
||||
RestRequestTemplatesModel model;
|
||||
|
||||
@Override
|
||||
public RestRequestTemplatesModel onModel()
|
||||
{
|
||||
return model;
|
||||
}
|
||||
|
||||
private String name;
|
||||
|
||||
private String template;
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getTemplate()
|
||||
{
|
||||
return template;
|
||||
}
|
||||
|
||||
public void setTemplate(String template)
|
||||
{
|
||||
this.template = template;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "RestRequestTemplatesModel{" + "name='" + name + '\'' + ", template='" + template + '\'' + '}';
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o)
|
||||
{
|
||||
if (this == o)
|
||||
return true;
|
||||
if (o == null || getClass() != o.getClass())
|
||||
return false;
|
||||
RestRequestTemplatesModel that = (RestRequestTemplatesModel) o;
|
||||
return Objects.equals(name, that.name) && Objects.equals(template, that.template);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
return Objects.hash(name, template);
|
||||
}
|
||||
|
||||
public static Builder builder()
|
||||
{
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public static class Builder
|
||||
{
|
||||
private String name;
|
||||
private String template;
|
||||
|
||||
public Builder name(String name)
|
||||
{
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder template(String template)
|
||||
{
|
||||
this.template = template;
|
||||
return this;
|
||||
}
|
||||
|
||||
public RestRequestTemplatesModel create()
|
||||
{
|
||||
RestRequestTemplatesModel template = new RestRequestTemplatesModel();
|
||||
template.setName(this.name);
|
||||
template.setTemplate(this.template);
|
||||
|
||||
return template;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -43,14 +43,15 @@
|
||||
*/
|
||||
package org.alfresco.rest.search;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import org.alfresco.rest.model.RestRequestRangesModel;
|
||||
import org.alfresco.rest.model.RestRequestSpellcheckModel;
|
||||
import org.alfresco.utility.model.TestModel;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Search Query object.
|
||||
* @author msuzuki
|
||||
@@ -76,6 +77,8 @@ public class SearchRequest extends TestModel
|
||||
String facetFormat;
|
||||
List<String> include;
|
||||
List<SortClause> sort;
|
||||
RestRequestDefaultsModel defaults;
|
||||
List<RestRequestTemplatesModel> templates;
|
||||
|
||||
public SearchRequest()
|
||||
{
|
||||
@@ -255,6 +258,26 @@ public class SearchRequest extends TestModel
|
||||
this.fields = fields;
|
||||
}
|
||||
|
||||
public RestRequestDefaultsModel getDefaults()
|
||||
{
|
||||
return defaults;
|
||||
}
|
||||
|
||||
public void setDefaults(RestRequestDefaultsModel defaults)
|
||||
{
|
||||
this.defaults = defaults;
|
||||
}
|
||||
|
||||
public List<RestRequestTemplatesModel> getTemplates()
|
||||
{
|
||||
return templates;
|
||||
}
|
||||
|
||||
public void setTemplates(List<RestRequestTemplatesModel> templates)
|
||||
{
|
||||
this.templates = templates;
|
||||
}
|
||||
|
||||
public List<SortClause> getSort()
|
||||
{
|
||||
if (sort == null)
|
||||
|
@@ -1,5 +1,7 @@
|
||||
package org.alfresco.rest.renditions;
|
||||
|
||||
import java.time.Duration;
|
||||
import com.google.common.base.Predicates;
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.core.RestResponse;
|
||||
import org.alfresco.rest.model.RestNodeModel;
|
||||
@@ -8,6 +10,8 @@ import org.alfresco.utility.model.FileModel;
|
||||
import org.alfresco.utility.model.FolderModel;
|
||||
import org.alfresco.utility.model.SiteModel;
|
||||
import org.alfresco.utility.model.UserModel;
|
||||
import org.awaitility.Awaitility;
|
||||
import org.awaitility.Durations;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.testng.Assert;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
@@ -68,15 +72,23 @@ public abstract class RenditionIntegrationTests extends RestTest
|
||||
*/
|
||||
protected RestNodeModel uploadFile(String sourceFile) throws Exception
|
||||
{
|
||||
FolderModel folder = FolderModel.getRandomFolderModel();
|
||||
folder = dataContent.usingUser(user).usingSite(site).createFolder(folder);
|
||||
FolderModel folder = Awaitility
|
||||
.await()
|
||||
.atMost(Duration.ofSeconds(30))
|
||||
.pollInterval(Durations.ONE_SECOND)
|
||||
.ignoreExceptions()
|
||||
.until(() -> {
|
||||
FolderModel randomFolderModel = FolderModel.getRandomFolderModel();
|
||||
return dataContent.usingUser(user).usingSite(site).createFolder(randomFolderModel);
|
||||
}, Predicates.notNull());
|
||||
restClient.authenticateUser(user).configureRequestSpec()
|
||||
.addMultiPart("filedata", Utility.getResourceTestDataFile(sourceFile));
|
||||
.addMultiPart("filedata", Utility.getResourceTestDataFile(sourceFile));
|
||||
RestNodeModel fileNode = restClient.authenticateUser(user).withCoreAPI().usingNode(folder).createNode();
|
||||
|
||||
Assert.assertEquals(Integer.valueOf(restClient.getStatusCode()).intValue(), HttpStatus.CREATED.value(),
|
||||
"Failed to created a node for rendition tests using file " + sourceFile);
|
||||
"Failed to created a node for rendition tests using file " + sourceFile);
|
||||
|
||||
return fileNode;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -2,6 +2,7 @@ package org.alfresco.rest.tags;
|
||||
|
||||
import static org.alfresco.utility.data.RandomData.getRandomName;
|
||||
import static org.alfresco.utility.report.log.Step.STEP;
|
||||
import static org.springframework.http.HttpStatus.BAD_REQUEST;
|
||||
import static org.springframework.http.HttpStatus.OK;
|
||||
|
||||
import java.util.Set;
|
||||
@@ -88,7 +89,7 @@ public class GetTagsTests extends TagsDataPrep
|
||||
.withParams("include=count")
|
||||
.withCoreAPI()
|
||||
.getTags();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
restClient.assertStatusCodeIs(OK);
|
||||
|
||||
returnedCollection.getEntries().stream()
|
||||
.filter(e -> e.onModel().getTag().equals(folderTagValue) || e.onModel().getTag().equals(documentTagValue))
|
||||
@@ -105,14 +106,13 @@ public class GetTagsTests extends TagsDataPrep
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.REGRESSION })
|
||||
public void testGetTags_withOrderByCountDefaultOrderShouldBeAsc()
|
||||
{
|
||||
|
||||
STEP("Get tags and order results by count. Default sort order should be ascending");
|
||||
returnedCollection = restClient.authenticateUser(adminUserModel)
|
||||
.withParams("include=count&orderBy=count")
|
||||
.withCoreAPI()
|
||||
.getTags();
|
||||
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
restClient.assertStatusCodeIs(OK);
|
||||
returnedCollection.assertThat().entriesListIsSortedAscBy("count");
|
||||
}
|
||||
|
||||
@@ -122,14 +122,13 @@ public class GetTagsTests extends TagsDataPrep
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.REGRESSION })
|
||||
public void testGetTags_withOrderByCountAsc()
|
||||
{
|
||||
|
||||
STEP("Get tags and order results by count in ascending order");
|
||||
returnedCollection = restClient.authenticateUser(adminUserModel)
|
||||
.withParams("include=count&orderBy=count ASC")
|
||||
.withCoreAPI()
|
||||
.getTags();
|
||||
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
restClient.assertStatusCodeIs(OK);
|
||||
returnedCollection.assertThat().entriesListIsSortedAscBy("count");
|
||||
}
|
||||
|
||||
@@ -139,14 +138,13 @@ public class GetTagsTests extends TagsDataPrep
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.REGRESSION })
|
||||
public void testGetTags_withOrderByCountDesc()
|
||||
{
|
||||
|
||||
STEP("Get tags and order results by count in descending order");
|
||||
returnedCollection = restClient.authenticateUser(adminUserModel)
|
||||
.withParams("include=count&orderBy=count DESC")
|
||||
.withCoreAPI()
|
||||
.getTags();
|
||||
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
restClient.assertStatusCodeIs(OK);
|
||||
returnedCollection.assertThat().entriesListIsSortedDescBy("count");
|
||||
}
|
||||
|
||||
@@ -156,14 +154,13 @@ public class GetTagsTests extends TagsDataPrep
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.REGRESSION })
|
||||
public void testGetTags_withOrderByTagDefaultOrderShouldBeAsc()
|
||||
{
|
||||
|
||||
STEP("Get tags and order results by tag name. Default sort order should be ascending");
|
||||
returnedCollection = restClient.authenticateUser(adminUserModel)
|
||||
.withParams("orderBy=tag")
|
||||
.withCoreAPI()
|
||||
.getTags();
|
||||
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
restClient.assertStatusCodeIs(OK);
|
||||
returnedCollection.assertThat().entriesListIsSortedAscBy("tag");
|
||||
}
|
||||
|
||||
@@ -173,14 +170,13 @@ public class GetTagsTests extends TagsDataPrep
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.REGRESSION })
|
||||
public void testGetTags_withOrderByTagAsc()
|
||||
{
|
||||
|
||||
STEP("Get tags and order results by tag name in ascending order");
|
||||
returnedCollection = restClient.authenticateUser(adminUserModel)
|
||||
.withParams("orderBy=tag ASC")
|
||||
.withCoreAPI()
|
||||
.getTags();
|
||||
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
restClient.assertStatusCodeIs(OK);
|
||||
returnedCollection.assertThat().entriesListIsSortedAscBy("tag");
|
||||
}
|
||||
|
||||
@@ -190,17 +186,30 @@ public class GetTagsTests extends TagsDataPrep
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.REGRESSION })
|
||||
public void testGetTags_withOrderByTagDesc()
|
||||
{
|
||||
|
||||
STEP("Get tags and order results by tag name in descending order");
|
||||
returnedCollection = restClient.authenticateUser(adminUserModel)
|
||||
.withParams("orderBy=tag DESC")
|
||||
.withCoreAPI()
|
||||
.getTags();
|
||||
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
restClient.assertStatusCodeIs(OK);
|
||||
returnedCollection.assertThat().entriesListIsSortedDescBy("tag");
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensure that we get a 400 error when we request to order by count without also including the tag count.
|
||||
*/
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.REGRESSION })
|
||||
public void testGetTags_orderByCountWithoutIncludeCount()
|
||||
{
|
||||
restClient.authenticateUser(adminUserModel)
|
||||
.withParams("orderBy=count")
|
||||
.withCoreAPI()
|
||||
.getTags();
|
||||
|
||||
restClient.assertStatusCodeIs(BAD_REQUEST);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.TAGS }, executionType = ExecutionType.SANITY, description = "Failed authentication get tags call returns status code 401 with Manager role")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.SANITY })
|
||||
// @Bug(id="MNT-16904", description = "It fails only on environment with tenants")
|
||||
|
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>20.152</version>
|
||||
<version>23.1.0.155</version>
|
||||
</parent>
|
||||
|
||||
<developers>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||
<version>20.152</version>
|
||||
<version>23.1.0.155</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
@@ -30,10 +30,6 @@
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-trashcan-cleaner</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.alfresco.services</groupId>
|
||||
<artifactId>alfresco-messaging-repo</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>xalan</groupId>
|
||||
<artifactId>xalan</artifactId>
|
||||
@@ -140,7 +136,7 @@
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>buildnumber-maven-plugin</artifactId>
|
||||
<version>3.0.0</version>
|
||||
<version>3.1.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>validate</phase>
|
||||
|
101
pom.xml
101
pom.xml
@@ -2,7 +2,7 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>20.152</version>
|
||||
<version>23.1.0.155</version>
|
||||
<packaging>pom</packaging>
|
||||
<name>Alfresco Community Repo Parent</name>
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
<acs.version.major>7</acs.version.major>
|
||||
<acs.version.minor>4</acs.version.minor>
|
||||
<acs.version.major>23</acs.version.major>
|
||||
<acs.version.minor>1</acs.version.minor>
|
||||
<acs.version.revision>0</acs.version.revision>
|
||||
<acs.version.label />
|
||||
<amp.min.version>${acs.version.major}.0.0</amp.min.version>
|
||||
@@ -38,48 +38,47 @@
|
||||
<builder.name>entitled-builder</builder.name>
|
||||
<local.registry>127.0.0.1:5000</local.registry>
|
||||
|
||||
<java.version>11</java.version>
|
||||
<java.version>17</java.version>
|
||||
<maven.compiler.source>${java.version}</maven.compiler.source>
|
||||
<maven.compiler.target>${java.version}</maven.compiler.target>
|
||||
<maven.build.sourceVersion>${java.version}</maven.build.sourceVersion>
|
||||
|
||||
<dir.root>${project.build.directory}/alf_data</dir.root>
|
||||
|
||||
<dependency.alfresco-hb-data-sender.version>1.0.12</dependency.alfresco-hb-data-sender.version>
|
||||
<dependency.alfresco-trashcan-cleaner.version>2.4.1</dependency.alfresco-trashcan-cleaner.version>
|
||||
<dependency.alfresco-jlan.version>7.4</dependency.alfresco-jlan.version>
|
||||
<dependency.alfresco-hb-data-sender.version>1.1.1</dependency.alfresco-hb-data-sender.version>
|
||||
<dependency.alfresco-trashcan-cleaner.version>2.4.2</dependency.alfresco-trashcan-cleaner.version>
|
||||
<dependency.alfresco-jlan.version>7.5</dependency.alfresco-jlan.version>
|
||||
<dependency.alfresco-server-root.version>6.0.1</dependency.alfresco-server-root.version>
|
||||
<dependency.alfresco-messaging-repo.version>1.2.20</dependency.alfresco-messaging-repo.version>
|
||||
<dependency.activiti-engine.version>5.23.0</dependency.activiti-engine.version>
|
||||
<dependency.activiti.version>5.23.0</dependency.activiti.version>
|
||||
<dependency.alfresco-transform-service.version>2.1.0-A6</dependency.alfresco-transform-service.version>
|
||||
<dependency.alfresco-transform-core.version>3.1.0-A8</dependency.alfresco-transform-core.version>
|
||||
<dependency.alfresco-greenmail.version>6.5</dependency.alfresco-greenmail.version>
|
||||
<dependency.acs-event-model.version>0.0.18</dependency.acs-event-model.version>
|
||||
<dependency.alfresco-transform-service.version>3.0.0</dependency.alfresco-transform-service.version>
|
||||
<dependency.alfresco-transform-core.version>4.0.0</dependency.alfresco-transform-core.version>
|
||||
<dependency.alfresco-greenmail.version>6.9</dependency.alfresco-greenmail.version>
|
||||
<dependency.acs-event-model.version>0.0.22</dependency.acs-event-model.version>
|
||||
|
||||
<dependency.spring.version>5.3.27</dependency.spring.version>
|
||||
<dependency.antlr.version>3.5.3</dependency.antlr.version>
|
||||
<dependency.jackson.version>2.15.0-rc1</dependency.jackson.version>
|
||||
<dependency.jackson.version>2.15.1</dependency.jackson.version>
|
||||
<dependency.cxf.version>3.5.5</dependency.cxf.version>
|
||||
<dependency.opencmis.version>1.0.0</dependency.opencmis.version>
|
||||
<dependency.webscripts.version>8.40</dependency.webscripts.version>
|
||||
<dependency.webscripts.version>8.44</dependency.webscripts.version>
|
||||
<dependency.bouncycastle.version>1.70</dependency.bouncycastle.version>
|
||||
<dependency.mockito-core.version>4.9.0</dependency.mockito-core.version>
|
||||
<dependency.assertj.version>3.24.2</dependency.assertj.version>
|
||||
<dependency.org-json.version>20230227</dependency.org-json.version>
|
||||
<dependency.org-json.version>20230618</dependency.org-json.version>
|
||||
<dependency.commons-dbcp.version>2.9.0</dependency.commons-dbcp.version>
|
||||
<dependency.commons-io.version>2.11.0</dependency.commons-io.version>
|
||||
<dependency.gson.version>2.8.9</dependency.gson.version>
|
||||
<dependency.httpclient.version>4.5.13</dependency.httpclient.version>
|
||||
<dependency.httpcore.version>4.4.15</dependency.httpcore.version>
|
||||
<dependency.httpcore.version>4.4.16</dependency.httpcore.version>
|
||||
<dependency.commons-httpclient.version>3.1-HTTPCLIENT-1265</dependency.commons-httpclient.version>
|
||||
<dependency.xercesImpl.version>2.12.2</dependency.xercesImpl.version>
|
||||
<dependency.slf4j.version>2.0.3</dependency.slf4j.version>
|
||||
<dependency.log4j.version>2.19.0</dependency.log4j.version>
|
||||
<dependency.gytheio.version>0.18</dependency.gytheio.version>
|
||||
<dependency.groovy.version>3.0.16</dependency.groovy.version>
|
||||
<dependency.slf4j.version>2.0.7</dependency.slf4j.version>
|
||||
<dependency.log4j.version>2.20.0</dependency.log4j.version>
|
||||
<dependency.gytheio.version>0.20.0-A1</dependency.gytheio.version>
|
||||
<dependency.groovy.version>3.0.17</dependency.groovy.version>
|
||||
<dependency.tika.version>2.4.1</dependency.tika.version>
|
||||
<dependency.spring-security.version>5.8.2</dependency.spring-security.version>
|
||||
<dependency.spring-security.version>5.8.3</dependency.spring-security.version>
|
||||
<dependency.truezip.version>7.7.10</dependency.truezip.version>
|
||||
<dependency.poi.version>5.2.2</dependency.poi.version>
|
||||
<dependency.poi-ooxml-lite.version>5.2.3</dependency.poi-ooxml-lite.version>
|
||||
@@ -89,11 +88,11 @@
|
||||
<dependency.netty.qpid.version>4.1.82.Final</dependency.netty.qpid.version> <!-- must be in sync with camels transitive dependencies: native-unix-common/native-epoll/native-kqueue -->
|
||||
<dependency.netty-tcnative.version>2.0.56.Final</dependency.netty-tcnative.version> <!-- must be in sync with camels transitive dependencies -->
|
||||
<dependency.activemq.version>5.17.4</dependency.activemq.version>
|
||||
<dependency.apache-compress.version>1.22</dependency.apache-compress.version>
|
||||
<dependency.apache-compress.version>1.23.0</dependency.apache-compress.version>
|
||||
<dependency.apache.taglibs.version>1.2.5</dependency.apache.taglibs.version>
|
||||
<dependency.awaitility.version>4.2.0</dependency.awaitility.version>
|
||||
<dependency.swagger-ui.version>3.38.0</dependency.swagger-ui.version>
|
||||
<dependency.swagger-parser.version>1.0.63</dependency.swagger-parser.version>
|
||||
<dependency.swagger-parser.version>1.0.66</dependency.swagger-parser.version>
|
||||
<dependency.maven-filtering.version>3.1.1</dependency.maven-filtering.version>
|
||||
<dependency.maven-artifact.version>3.8.6</dependency.maven-artifact.version>
|
||||
<dependency.jdom2.version>2.0.6.1</dependency.jdom2.version>
|
||||
@@ -108,25 +107,25 @@
|
||||
<dependency.jakarta-mail-api.version>1.6.5</dependency.jakarta-mail-api.version>
|
||||
<dependency.jakarta-json-api.version>1.1.6</dependency.jakarta-json-api.version>
|
||||
<dependency.jakarta-json-path.version>2.8.0</dependency.jakarta-json-path.version>
|
||||
<dependency.json-smart.version>2.4.10</dependency.json-smart.version>
|
||||
<dependency.json-smart.version>2.4.11</dependency.json-smart.version>
|
||||
<dependency.jakarta-rpc-api.version>1.1.4</dependency.jakarta-rpc-api.version>
|
||||
|
||||
<alfresco.googledrive.version>3.4.0-A4</alfresco.googledrive.version>
|
||||
<alfresco.aos-module.version>1.6.0-A5</alfresco.aos-module.version>
|
||||
<alfresco.api-explorer.version>7.3.0</alfresco.api-explorer.version> <!-- Also in alfresco-enterprise-share -->
|
||||
<alfresco.googledrive.version>3.4.1</alfresco.googledrive.version>
|
||||
<alfresco.aos-module.version>1.6.1</alfresco.aos-module.version>
|
||||
<alfresco.api-explorer.version>23.1.0-A1</alfresco.api-explorer.version> <!-- Also in alfresco-enterprise-share -->
|
||||
|
||||
<alfresco.maven-plugin.version>2.2.0</alfresco.maven-plugin.version>
|
||||
<license-maven-plugin.version>2.0.1.alfresco-2</license-maven-plugin.version>
|
||||
<license-maven-plugin.version>2.0.1</license-maven-plugin.version>
|
||||
|
||||
<dependency.postgresql.version>42.5.2</dependency.postgresql.version>
|
||||
<dependency.postgresql.version>42.6.0</dependency.postgresql.version>
|
||||
<dependency.mysql.version>8.0.30</dependency.mysql.version>
|
||||
<dependency.mysql-image.version>8</dependency.mysql-image.version>
|
||||
<dependency.mariadb.version>2.7.4</dependency.mariadb.version>
|
||||
<dependency.tas-utility.version>4.0.0</dependency.tas-utility.version>
|
||||
<dependency.rest-assured.version>5.2.0</dependency.rest-assured.version>
|
||||
<dependency.tas-email.version>1.11</dependency.tas-email.version>
|
||||
<dependency.tas-webdav.version>1.7</dependency.tas-webdav.version>
|
||||
<dependency.tas-ftp.version>1.7</dependency.tas-ftp.version>
|
||||
<dependency.tas-utility.version>4.0.4</dependency.tas-utility.version>
|
||||
<dependency.rest-assured.version>5.3.1</dependency.rest-assured.version>
|
||||
<dependency.tas-email.version>1.21</dependency.tas-email.version>
|
||||
<dependency.tas-webdav.version>1.16</dependency.tas-webdav.version>
|
||||
<dependency.tas-ftp.version>1.17</dependency.tas-ftp.version>
|
||||
<dependency.tas-dataprep.version>2.6</dependency.tas-dataprep.version>
|
||||
|
||||
<!-- AGS properties shared between community and enterprise -->
|
||||
@@ -150,7 +149,7 @@
|
||||
<connection>scm:git:https://github.com/Alfresco/alfresco-community-repo.git</connection>
|
||||
<developerConnection>scm:git:https://github.com/Alfresco/alfresco-community-repo.git</developerConnection>
|
||||
<url>https://github.com/Alfresco/alfresco-community-repo</url>
|
||||
<tag>20.152</tag>
|
||||
<tag>23.1.0.155</tag>
|
||||
</scm>
|
||||
|
||||
<distributionManagement>
|
||||
@@ -297,17 +296,6 @@
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.alfresco.services</groupId>
|
||||
<artifactId>alfresco-messaging-repo</artifactId>
|
||||
<version>${dependency.alfresco-messaging-repo.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.apache.activemq</groupId>
|
||||
<artifactId>activemq-broker</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-server-root</artifactId>
|
||||
@@ -657,7 +645,7 @@
|
||||
<dependency>
|
||||
<groupId>org.jsoup</groupId>
|
||||
<artifactId>jsoup</artifactId>
|
||||
<version>1.15.3</version>
|
||||
<version>1.16.1</version>
|
||||
</dependency>
|
||||
<!-- upgrade dependency from TIKA -->
|
||||
<dependency>
|
||||
@@ -741,7 +729,7 @@
|
||||
<dependency>
|
||||
<groupId>joda-time</groupId>
|
||||
<artifactId>joda-time</artifactId>
|
||||
<version>2.12.1</version>
|
||||
<version>2.12.5</version>
|
||||
</dependency>
|
||||
|
||||
<!-- provided dependencies -->
|
||||
@@ -898,7 +886,7 @@
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.18.24</version>
|
||||
<version>1.18.26</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@@ -936,7 +924,7 @@
|
||||
<plugin>
|
||||
<groupId>io.fabric8</groupId>
|
||||
<artifactId>docker-maven-plugin</artifactId>
|
||||
<version>0.42.1</version>
|
||||
<version>0.43.0</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
@@ -957,21 +945,21 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>3.4.1</version>
|
||||
<version>3.5.0</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>3.3.0</version>
|
||||
<version>3.3.1</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<version>3.3.0</version>
|
||||
<version>3.5.0</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<version>3.4.2</version>
|
||||
<version>3.6.0</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.alfresco.maven.plugin</groupId>
|
||||
@@ -1015,6 +1003,11 @@
|
||||
<skipDeploy>true</skipDeploy>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.cargo</groupId>
|
||||
<artifactId>cargo-maven3-plugin</artifactId>
|
||||
<version>1.10.7</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
<plugins>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>20.152</version>
|
||||
<version>23.1.0.155</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
@@ -47,7 +47,7 @@
|
||||
<dependency>
|
||||
<groupId>org.apache.santuario</groupId>
|
||||
<artifactId>xmlsec</artifactId>
|
||||
<version>3.0.0</version>
|
||||
<version>3.0.2</version>
|
||||
</dependency>
|
||||
<!-- newer version, see REPO-3133 -->
|
||||
<dependency>
|
||||
@@ -130,7 +130,7 @@
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-server</artifactId>
|
||||
<version>10.0.11</version>
|
||||
<version>10.0.14</version>
|
||||
<scope>test</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
@@ -154,7 +154,7 @@
|
||||
<dependency>
|
||||
<groupId>org.alfresco.cmis.client</groupId>
|
||||
<artifactId>alfresco-opencmis-extension</artifactId>
|
||||
<version>2.1</version>
|
||||
<version>2.3</version>
|
||||
<scope>test</scope>
|
||||
<exclusions>
|
||||
<!-- Duplicates classes from jakarta.transaction:jakarta.transaction-api -->
|
||||
|
@@ -32,10 +32,8 @@ import java.util.List;
|
||||
|
||||
import org.alfresco.rest.api.model.Category;
|
||||
import org.alfresco.rest.framework.resource.parameters.Parameters;
|
||||
import org.alfresco.service.Experimental;
|
||||
import org.alfresco.service.cmr.repository.StoreRef;
|
||||
|
||||
@Experimental
|
||||
public interface Categories
|
||||
{
|
||||
Category getCategoryById(StoreRef storeRef, String id, Parameters parameters);
|
||||
|
@@ -32,7 +32,6 @@ import java.util.List;
|
||||
import org.alfresco.rest.api.model.Tag;
|
||||
import org.alfresco.rest.framework.resource.parameters.CollectionWithPagingInfo;
|
||||
import org.alfresco.rest.framework.resource.parameters.Parameters;
|
||||
import org.alfresco.service.Experimental;
|
||||
import org.alfresco.service.cmr.repository.StoreRef;
|
||||
|
||||
public interface Tags
|
||||
@@ -44,10 +43,8 @@ public interface Tags
|
||||
Tag changeTag(StoreRef storeRef, String tagId, Tag tag, Parameters parameters);
|
||||
CollectionWithPagingInfo<Tag> getTags(String nodeId, Parameters params);
|
||||
|
||||
@Experimental
|
||||
List<Tag> createTags(StoreRef storeRef, List<Tag> tags, Parameters parameters);
|
||||
|
||||
@Experimental
|
||||
default List<Tag> createTags(List<Tag> tags, Parameters parameters)
|
||||
{
|
||||
return createTags(STORE_REF_WORKSPACE_SPACESSTORE, tags, parameters);
|
||||
|
@@ -49,7 +49,6 @@ import org.alfresco.rest.framework.core.exceptions.InvalidArgumentException;
|
||||
import org.alfresco.rest.framework.core.exceptions.InvalidNodeTypeException;
|
||||
import org.alfresco.rest.framework.core.exceptions.PermissionDeniedException;
|
||||
import org.alfresco.rest.framework.resource.parameters.Parameters;
|
||||
import org.alfresco.service.Experimental;
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
@@ -65,7 +64,6 @@ import org.alfresco.util.TypeConstraint;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
@Experimental
|
||||
public class CategoriesImpl implements Categories
|
||||
{
|
||||
static final String INCLUDE_COUNT_PARAM = "count";
|
||||
|
@@ -36,8 +36,6 @@ import static org.alfresco.service.cmr.tagging.TaggingService.TAG_ROOT_NODE_REF;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -63,12 +61,9 @@ import org.alfresco.rest.framework.core.exceptions.UnsupportedResourceOperationE
|
||||
import org.alfresco.rest.framework.resource.parameters.CollectionWithPagingInfo;
|
||||
import org.alfresco.rest.framework.resource.parameters.Paging;
|
||||
import org.alfresco.rest.framework.resource.parameters.Parameters;
|
||||
import org.alfresco.rest.framework.resource.parameters.SortColumn;
|
||||
import org.alfresco.rest.framework.resource.parameters.where.Query;
|
||||
import org.alfresco.rest.framework.resource.parameters.where.QueryHelper;
|
||||
import org.alfresco.rest.framework.resource.parameters.where.QueryImpl;
|
||||
import org.alfresco.service.Experimental;
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.cmr.repository.StoreRef;
|
||||
@@ -86,40 +81,40 @@ import org.apache.commons.collections.CollectionUtils;
|
||||
*/
|
||||
public class TagsImpl implements Tags
|
||||
{
|
||||
public static final String PARAM_INCLUDE_COUNT = "count";
|
||||
private static final String PARAM_WHERE_TAG = "tag";
|
||||
static final String NOT_A_VALID_TAG = "An invalid parameter has been supplied";
|
||||
static final String NO_PERMISSION_TO_MANAGE_A_TAG = "Current user does not have permission to manage a tag";
|
||||
public static final String PARAM_INCLUDE_COUNT = "count";
|
||||
private static final String PARAM_WHERE_TAG = "tag";
|
||||
static final String NOT_A_VALID_TAG = "An invalid parameter has been supplied";
|
||||
static final String NO_PERMISSION_TO_MANAGE_A_TAG = "Current user does not have permission to manage a tag";
|
||||
|
||||
private Nodes nodes;
|
||||
private NodeService nodeService;
|
||||
private TaggingService taggingService;
|
||||
private TypeConstraint typeConstraint;
|
||||
private AuthorityService authorityService;
|
||||
private NodeService nodeService;
|
||||
private TaggingService taggingService;
|
||||
private TypeConstraint typeConstraint;
|
||||
private AuthorityService authorityService;
|
||||
|
||||
public void setTypeConstraint(TypeConstraint typeConstraint)
|
||||
{
|
||||
this.typeConstraint = typeConstraint;
|
||||
}
|
||||
|
||||
public void setNodes(Nodes nodes)
|
||||
public void setTypeConstraint(TypeConstraint typeConstraint)
|
||||
{
|
||||
this.nodes = nodes;
|
||||
}
|
||||
public void setNodeService(NodeService nodeService)
|
||||
{
|
||||
this.nodeService = nodeService;
|
||||
}
|
||||
|
||||
this.typeConstraint = typeConstraint;
|
||||
}
|
||||
|
||||
public void setNodes(Nodes nodes)
|
||||
{
|
||||
this.nodes = nodes;
|
||||
}
|
||||
public void setNodeService(NodeService nodeService)
|
||||
{
|
||||
this.nodeService = nodeService;
|
||||
}
|
||||
|
||||
public void setTaggingService(TaggingService taggingService)
|
||||
{
|
||||
this.taggingService = taggingService;
|
||||
}
|
||||
this.taggingService = taggingService;
|
||||
}
|
||||
|
||||
public void setAuthorityService(AuthorityService authorityService)
|
||||
{
|
||||
this.authorityService = authorityService;
|
||||
}
|
||||
public void setAuthorityService(AuthorityService authorityService)
|
||||
{
|
||||
this.authorityService = authorityService;
|
||||
}
|
||||
|
||||
public List<Tag> addTags(String nodeId, final List<Tag> tags, final Parameters parameters)
|
||||
{
|
||||
@@ -134,15 +129,15 @@ public class TagsImpl implements Tags
|
||||
{
|
||||
List<Pair<String, NodeRef>> tagNodeRefs = taggingService.addTags(nodeRef, tagValues);
|
||||
List<Tag> ret = new ArrayList<>(tags.size());
|
||||
List<Pair<String, Integer>> tagsCountPairList = taggingService.findTaggedNodesAndCountByTagName(nodeRef.getStoreRef());
|
||||
Map<String, Long> tagsCountMap = tagsCountPairList.stream().collect(Collectors.toMap(Pair::getFirst, pair -> Long.valueOf(pair.getSecond())));
|
||||
List<Pair<String, Integer>> tagsCountPairList = taggingService.findTaggedNodesAndCountByTagName(nodeRef.getStoreRef());
|
||||
Map<String, Long> tagsCountMap = tagsCountPairList.stream().collect(Collectors.toMap(Pair::getFirst, pair -> Long.valueOf(pair.getSecond())));
|
||||
for (Pair<String, NodeRef> pair : tagNodeRefs)
|
||||
{
|
||||
Tag createdTag = new Tag(pair.getSecond(), pair.getFirst());
|
||||
if (parameters.getInclude().contains(PARAM_INCLUDE_COUNT))
|
||||
{
|
||||
createdTag.setCount(Optional.ofNullable(tagsCountMap.get(createdTag.getTag())).orElse(0L) + 1);
|
||||
}
|
||||
Tag createdTag = new Tag(pair.getSecond(), pair.getFirst());
|
||||
if (parameters.getInclude().contains(PARAM_INCLUDE_COUNT))
|
||||
{
|
||||
createdTag.setCount(Optional.ofNullable(tagsCountMap.get(createdTag.getTag())).orElse(0L) + 1);
|
||||
}
|
||||
ret.add(createdTag);
|
||||
}
|
||||
return ret;
|
||||
@@ -152,109 +147,109 @@ public class TagsImpl implements Tags
|
||||
throw new InvalidArgumentException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void deleteTag(String nodeId, String tagId)
|
||||
{
|
||||
NodeRef nodeRef = nodes.validateNode(nodeId);
|
||||
getTag(STORE_REF_WORKSPACE_SPACESSTORE, tagId, null);
|
||||
NodeRef existingTagNodeRef = validateTag(tagId);
|
||||
String tagValue = taggingService.getTagName(existingTagNodeRef);
|
||||
taggingService.removeTag(nodeRef, tagValue);
|
||||
NodeRef nodeRef = nodes.validateNode(nodeId);
|
||||
getTag(STORE_REF_WORKSPACE_SPACESSTORE, tagId, null);
|
||||
NodeRef existingTagNodeRef = validateTag(tagId);
|
||||
String tagValue = taggingService.getTagName(existingTagNodeRef);
|
||||
taggingService.removeTag(nodeRef, tagValue);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteTagById(StoreRef storeRef, String tagId) {
|
||||
verifyAdminAuthority();
|
||||
public void deleteTagById(StoreRef storeRef, String tagId) {
|
||||
verifyAdminAuthority();
|
||||
|
||||
NodeRef tagNodeRef = validateTag(storeRef, tagId);
|
||||
String tagValue = taggingService.getTagName(tagNodeRef);
|
||||
taggingService.deleteTag(storeRef, tagValue);
|
||||
}
|
||||
NodeRef tagNodeRef = validateTag(storeRef, tagId);
|
||||
String tagValue = taggingService.getTagName(tagNodeRef);
|
||||
taggingService.deleteTag(storeRef, tagValue);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public CollectionWithPagingInfo<Tag> getTags(StoreRef storeRef, Parameters params)
|
||||
{
|
||||
Paging paging = params.getPaging();
|
||||
Pair<String, Boolean> sorting = !params.getSorting().isEmpty() ? new Pair<>(params.getSorting().get(0).column, params.getSorting().get(0).asc) : null;
|
||||
Map<Integer, Collection<String>> namesFilters = resolveTagNamesQuery(params.getQuery());
|
||||
Paging paging = params.getPaging();
|
||||
Pair<String, Boolean> sorting = !params.getSorting().isEmpty() ? new Pair<>(params.getSorting().get(0).column, params.getSorting().get(0).asc) : null;
|
||||
Map<Integer, Collection<String>> namesFilters = resolveTagNamesQuery(params.getQuery());
|
||||
|
||||
Map<NodeRef, Long> results = taggingService.getTags(storeRef, params.getInclude(), sorting, namesFilters.get(EQUALS), namesFilters.get(MATCHES));
|
||||
Map<NodeRef, Long> results = taggingService.getTags(storeRef, params.getInclude(), sorting, namesFilters.get(EQUALS), namesFilters.get(MATCHES));
|
||||
|
||||
List<Tag> tagsList = results.entrySet().stream().map(entry -> new Tag(entry.getKey(), (String)nodeService.getProperty(entry.getKey(), ContentModel.PROP_NAME))).collect(Collectors.toList());
|
||||
List<Tag> tagsList = results.entrySet().stream().map(entry -> new Tag(entry.getKey(), (String)nodeService.getProperty(entry.getKey(), ContentModel.PROP_NAME))).collect(Collectors.toList());
|
||||
|
||||
if (params.getInclude().contains(PARAM_INCLUDE_COUNT))
|
||||
{
|
||||
tagsList.forEach(tag -> tag.setCount(results.get(tag.getNodeRef())));
|
||||
}
|
||||
if (params.getInclude().contains(PARAM_INCLUDE_COUNT))
|
||||
{
|
||||
tagsList.forEach(tag -> tag.setCount(results.get(tag.getNodeRef())));
|
||||
}
|
||||
|
||||
ListBackedPagingResults listBackedPagingResults = new ListBackedPagingResults(tagsList, Util.getPagingRequest(params.getPaging()));
|
||||
ListBackedPagingResults listBackedPagingResults = new ListBackedPagingResults(tagsList, Util.getPagingRequest(params.getPaging()));
|
||||
|
||||
return CollectionWithPagingInfo.asPaged(paging, listBackedPagingResults.getPage(), listBackedPagingResults.hasMoreItems(), (Integer) listBackedPagingResults.getTotalResultCount().getFirst());
|
||||
return CollectionWithPagingInfo.asPaged(paging, listBackedPagingResults.getPage(), listBackedPagingResults.hasMoreItems(), (Integer) listBackedPagingResults.getTotalResultCount().getFirst());
|
||||
}
|
||||
|
||||
public NodeRef validateTag(String tagId)
|
||||
{
|
||||
NodeRef tagNodeRef = nodes.validateNode(tagId);
|
||||
return checkTagRootAsNodePrimaryParent(tagId, tagNodeRef);
|
||||
NodeRef tagNodeRef = nodes.validateNode(tagId);
|
||||
return checkTagRootAsNodePrimaryParent(tagId, tagNodeRef);
|
||||
}
|
||||
|
||||
public NodeRef validateTag(StoreRef storeRef, String tagId)
|
||||
{
|
||||
NodeRef tagNodeRef = nodes.validateNode(storeRef, tagId);
|
||||
return checkTagRootAsNodePrimaryParent(tagId, tagNodeRef);
|
||||
NodeRef tagNodeRef = nodes.validateNode(storeRef, tagId);
|
||||
return checkTagRootAsNodePrimaryParent(tagId, tagNodeRef);
|
||||
}
|
||||
|
||||
/**
|
||||
* Find the number of times the given tag is used (if requested).
|
||||
*
|
||||
* @param storeRef The store the tag is in.
|
||||
* @param tagName The name of the tag.
|
||||
* @param parameters The request parameters object containing the includes parameter.
|
||||
* @return The number of times the tag is applied, or null if "count" wasn't in the include parameter.
|
||||
*/
|
||||
private Long findCountIfRequested(StoreRef storeRef, String tagName, Parameters parameters)
|
||||
{
|
||||
Long count = null;
|
||||
if (parameters != null && parameters.getInclude() != null && parameters.getInclude().contains(PARAM_INCLUDE_COUNT))
|
||||
{
|
||||
count = taggingService.findCountByTagName(storeRef, tagName);
|
||||
}
|
||||
return count;
|
||||
}
|
||||
/**
|
||||
* Find the number of times the given tag is used (if requested).
|
||||
*
|
||||
* @param storeRef The store the tag is in.
|
||||
* @param tagName The name of the tag.
|
||||
* @param parameters The request parameters object containing the includes parameter.
|
||||
* @return The number of times the tag is applied, or null if "count" wasn't in the include parameter.
|
||||
*/
|
||||
private Long findCountIfRequested(StoreRef storeRef, String tagName, Parameters parameters)
|
||||
{
|
||||
Long count = null;
|
||||
if (parameters != null && parameters.getInclude() != null && parameters.getInclude().contains(PARAM_INCLUDE_COUNT))
|
||||
{
|
||||
count = taggingService.findCountByTagName(storeRef, tagName);
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Tag changeTag(StoreRef storeRef, String tagId, Tag tag, Parameters parameters)
|
||||
{
|
||||
try
|
||||
{
|
||||
NodeRef existingTagNodeRef = validateTag(storeRef, tagId);
|
||||
String existingTagName = taggingService.getTagName(existingTagNodeRef);
|
||||
Long count = findCountIfRequested(storeRef, existingTagName, parameters);
|
||||
String newTagName = tag.getTag();
|
||||
NodeRef newTagNodeRef = taggingService.changeTag(storeRef, existingTagName, newTagName);
|
||||
return Tag.builder().nodeRef(newTagNodeRef).tag(newTagName).count(count).create();
|
||||
}
|
||||
catch(NonExistentTagException e)
|
||||
{
|
||||
throw new NotFoundException(e.getMessage());
|
||||
}
|
||||
catch(TagExistsException e)
|
||||
{
|
||||
throw new ConstraintViolatedException(e.getMessage());
|
||||
}
|
||||
catch(TaggingException e)
|
||||
{
|
||||
throw new InvalidArgumentException(e.getMessage());
|
||||
}
|
||||
try
|
||||
{
|
||||
NodeRef existingTagNodeRef = validateTag(storeRef, tagId);
|
||||
String existingTagName = taggingService.getTagName(existingTagNodeRef);
|
||||
Long count = findCountIfRequested(storeRef, existingTagName, parameters);
|
||||
String newTagName = tag.getTag();
|
||||
NodeRef newTagNodeRef = taggingService.changeTag(storeRef, existingTagName, newTagName);
|
||||
return Tag.builder().nodeRef(newTagNodeRef).tag(newTagName).count(count).create();
|
||||
}
|
||||
catch(NonExistentTagException e)
|
||||
{
|
||||
throw new NotFoundException(e.getMessage());
|
||||
}
|
||||
catch(TagExistsException e)
|
||||
{
|
||||
throw new ConstraintViolatedException(e.getMessage());
|
||||
}
|
||||
catch(TaggingException e)
|
||||
{
|
||||
throw new InvalidArgumentException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public Tag getTag(StoreRef storeRef, String tagId, Parameters parameters)
|
||||
{
|
||||
NodeRef tagNodeRef = validateTag(storeRef, tagId);
|
||||
String tagName = taggingService.getTagName(tagNodeRef);
|
||||
Long count = findCountIfRequested(storeRef, tagName, parameters);
|
||||
return Tag.builder().nodeRef(tagNodeRef).tag(tagName).count(count).create();
|
||||
NodeRef tagNodeRef = validateTag(storeRef, tagId);
|
||||
String tagName = taggingService.getTagName(tagNodeRef);
|
||||
Long count = findCountIfRequested(storeRef, tagName, parameters);
|
||||
return Tag.builder().nodeRef(tagNodeRef).tag(tagName).count(count).create();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -273,80 +268,79 @@ public class TagsImpl implements Tags
|
||||
return CollectionWithPagingInfo.asPaged(params.getPaging(), tags, results.hasMoreItems(), (totalItems == null ? null : totalItems.intValue()));
|
||||
}
|
||||
|
||||
@Experimental
|
||||
@Override
|
||||
public List<Tag> createTags(final StoreRef storeRef, final List<Tag> tags, final Parameters parameters)
|
||||
{
|
||||
verifyAdminAuthority();
|
||||
final List<String> tagNames = Optional.ofNullable(tags).orElse(Collections.emptyList()).stream()
|
||||
.filter(Objects::nonNull)
|
||||
.map(Tag::getTag)
|
||||
.distinct()
|
||||
.collect(toList());
|
||||
@Override
|
||||
public List<Tag> createTags(final StoreRef storeRef, final List<Tag> tags, final Parameters parameters)
|
||||
{
|
||||
verifyAdminAuthority();
|
||||
final List<String> tagNames = Optional.ofNullable(tags).orElse(Collections.emptyList()).stream()
|
||||
.filter(Objects::nonNull)
|
||||
.map(Tag::getTag)
|
||||
.distinct()
|
||||
.collect(toList());
|
||||
|
||||
if (CollectionUtils.isEmpty(tagNames))
|
||||
{
|
||||
throw new InvalidArgumentException(NOT_A_VALID_TAG);
|
||||
}
|
||||
if (CollectionUtils.isEmpty(tagNames))
|
||||
{
|
||||
throw new InvalidArgumentException(NOT_A_VALID_TAG);
|
||||
}
|
||||
|
||||
return taggingService.createTags(storeRef, tagNames).stream()
|
||||
.map(pair -> Tag.builder().tag(pair.getFirst()).nodeRef(pair.getSecond()).create())
|
||||
.peek(tag -> {
|
||||
if (parameters.getInclude().contains(PARAM_INCLUDE_COUNT))
|
||||
{
|
||||
tag.setCount(0L);
|
||||
}
|
||||
}).collect(toList());
|
||||
}
|
||||
return taggingService.createTags(storeRef, tagNames).stream()
|
||||
.map(pair -> Tag.builder().tag(pair.getFirst()).nodeRef(pair.getSecond()).create())
|
||||
.peek(tag -> {
|
||||
if (parameters.getInclude().contains(PARAM_INCLUDE_COUNT))
|
||||
{
|
||||
tag.setCount(0L);
|
||||
}
|
||||
}).collect(toList());
|
||||
}
|
||||
|
||||
private void verifyAdminAuthority()
|
||||
{
|
||||
if (!authorityService.hasAdminAuthority())
|
||||
{
|
||||
throw new PermissionDeniedException(NO_PERMISSION_TO_MANAGE_A_TAG);
|
||||
}
|
||||
}
|
||||
private void verifyAdminAuthority()
|
||||
{
|
||||
if (!authorityService.hasAdminAuthority())
|
||||
{
|
||||
throw new PermissionDeniedException(NO_PERMISSION_TO_MANAGE_A_TAG);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method resolves where query looking for clauses: EQUALS, IN or MATCHES.
|
||||
* Expected values for EQUALS and IN will be merged under EQUALS clause.
|
||||
* @param namesQuery Where query with expected tag name(s).
|
||||
* @return Map of expected exact and alike tag names.
|
||||
*/
|
||||
private Map<Integer, Collection<String>> resolveTagNamesQuery(final Query namesQuery)
|
||||
{
|
||||
if (namesQuery == null || namesQuery == QueryImpl.EMPTY)
|
||||
{
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
/**
|
||||
* Method resolves where query looking for clauses: EQUALS, IN or MATCHES.
|
||||
* Expected values for EQUALS and IN will be merged under EQUALS clause.
|
||||
* @param namesQuery Where query with expected tag name(s).
|
||||
* @return Map of expected exact and alike tag names.
|
||||
*/
|
||||
private Map<Integer, Collection<String>> resolveTagNamesQuery(final Query namesQuery)
|
||||
{
|
||||
if (namesQuery == null || namesQuery == QueryImpl.EMPTY)
|
||||
{
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
|
||||
final Map<Integer, Collection<String>> properties = QueryHelper
|
||||
.resolve(namesQuery)
|
||||
.usingOrOperator()
|
||||
.withoutNegations()
|
||||
.getProperty(PARAM_WHERE_TAG)
|
||||
.getExpectedValuesForAnyOf(EQUALS, IN, MATCHES)
|
||||
.skipNegated();
|
||||
final Map<Integer, Collection<String>> properties = QueryHelper
|
||||
.resolve(namesQuery)
|
||||
.usingOrOperator()
|
||||
.withoutNegations()
|
||||
.getProperty(PARAM_WHERE_TAG)
|
||||
.getExpectedValuesForAnyOf(EQUALS, IN, MATCHES)
|
||||
.skipNegated();
|
||||
|
||||
return properties.entrySet().stream()
|
||||
.collect(Collectors.groupingBy((entry) -> {
|
||||
if (entry.getKey() == EQUALS || entry.getKey() == IN)
|
||||
{
|
||||
return EQUALS;
|
||||
}
|
||||
else
|
||||
{
|
||||
return MATCHES;
|
||||
}
|
||||
}, Collectors.flatMapping((entry) -> entry.getValue().stream().map(String::toLowerCase), Collectors.toCollection(HashSet::new))));
|
||||
}
|
||||
return properties.entrySet().stream()
|
||||
.collect(Collectors.groupingBy((entry) -> {
|
||||
if (entry.getKey() == EQUALS || entry.getKey() == IN)
|
||||
{
|
||||
return EQUALS;
|
||||
}
|
||||
else
|
||||
{
|
||||
return MATCHES;
|
||||
}
|
||||
}, Collectors.flatMapping((entry) -> entry.getValue().stream().map(String::toLowerCase), Collectors.toCollection(HashSet::new))));
|
||||
}
|
||||
|
||||
private NodeRef checkTagRootAsNodePrimaryParent(String tagId, NodeRef tagNodeRef)
|
||||
{
|
||||
if ( tagNodeRef == null || !nodeService.getPrimaryParent(tagNodeRef).getParentRef().equals(TAG_ROOT_NODE_REF))
|
||||
{
|
||||
throw new EntityNotFoundException(tagId);
|
||||
}
|
||||
return tagNodeRef;
|
||||
}
|
||||
private NodeRef checkTagRootAsNodePrimaryParent(String tagId, NodeRef tagNodeRef)
|
||||
{
|
||||
if ( tagNodeRef == null || !nodeService.getPrimaryParent(tagNodeRef).getParentRef().equals(TAG_ROOT_NODE_REF))
|
||||
{
|
||||
throw new EntityNotFoundException(tagId);
|
||||
}
|
||||
return tagNodeRef;
|
||||
}
|
||||
}
|
||||
|
@@ -93,7 +93,7 @@ public class FacetField
|
||||
|
||||
public String toFilterQuery(String value)
|
||||
{
|
||||
return field+":\""+value+"\"";
|
||||
return ("Null".equals(value)) ? "ISNULL:\"" + field + "\"" : field + ":\"" + value + "\"";
|
||||
}
|
||||
|
||||
public String getPrefix()
|
||||
|
@@ -36,7 +36,6 @@ import org.alfresco.rest.framework.resource.EntityResource;
|
||||
import org.alfresco.rest.framework.resource.actions.interfaces.EntityResourceAction;
|
||||
import org.alfresco.rest.framework.resource.parameters.CollectionWithPagingInfo;
|
||||
import org.alfresco.rest.framework.resource.parameters.Parameters;
|
||||
import org.alfresco.service.Experimental;
|
||||
import org.alfresco.service.cmr.repository.StoreRef;
|
||||
import org.alfresco.util.ParameterCheck;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
@@ -85,7 +84,6 @@ public class TagsEntityResource implements EntityResourceAction.Read<Tag>,
|
||||
/**
|
||||
* POST /tags
|
||||
*/
|
||||
@Experimental
|
||||
@WebApiDescription(
|
||||
title = "Create an orphan tag",
|
||||
description = "Creates a tag, which is not associated with any node",
|
||||
|
@@ -30,11 +30,9 @@ import org.alfresco.rest.api.categories.CategoriesEntityResourceTest;
|
||||
import org.alfresco.rest.api.categories.NodesCategoryLinksRelationTest;
|
||||
import org.alfresco.rest.api.categories.SubcategoriesRelationTest;
|
||||
import org.alfresco.rest.api.impl.CategoriesImplTest;
|
||||
import org.alfresco.service.Experimental;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.Suite;
|
||||
|
||||
@Experimental
|
||||
@RunWith(Suite.class)
|
||||
@Suite.SuiteClasses({
|
||||
CategoriesImplTest.class,
|
||||
|
@@ -27,11 +27,9 @@ package org.alfresco.rest.api;
|
||||
|
||||
import org.alfresco.rest.api.impl.TagsImplTest;
|
||||
import org.alfresco.rest.api.tags.TagsEntityResourceTest;
|
||||
import org.alfresco.service.Experimental;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.Suite;
|
||||
|
||||
@Experimental
|
||||
@RunWith(Suite.class)
|
||||
@Suite.SuiteClasses({
|
||||
TagsImplTest.class,
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>20.152</version>
|
||||
<version>23.1.0.155</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
@@ -126,7 +126,7 @@
|
||||
<dependency>
|
||||
<groupId>com.ibm.icu</groupId>
|
||||
<artifactId>icu4j</artifactId>
|
||||
<version>72.1</version>
|
||||
<version>73.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.googlecode.json-simple</groupId>
|
||||
@@ -375,20 +375,9 @@
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.woodstox</groupId>
|
||||
<artifactId>woodstox-core</artifactId>
|
||||
<version>6.4.0</version>
|
||||
<version>6.5.1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- GData -->
|
||||
<dependency>
|
||||
<groupId>com.google.gdata</groupId>
|
||||
<artifactId>gdata-core-1.0</artifactId>
|
||||
<version>1.47.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.gdata</groupId>
|
||||
<artifactId>gdata-media-1.0</artifactId>
|
||||
<version>1.47.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.security</groupId>
|
||||
<artifactId>spring-security-crypto</artifactId>
|
||||
@@ -747,7 +736,7 @@
|
||||
<dependency>
|
||||
<groupId>org.aspectj</groupId>
|
||||
<artifactId>aspectjrt</artifactId>
|
||||
<version>1.9.9.1</version>
|
||||
<version>1.9.19</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-net</groupId>
|
||||
|
@@ -244,7 +244,7 @@ public class ImporterActionExecuter extends ActionExecuterAbstractBase
|
||||
String encoding = (String) ruleAction.getParameterValue(PARAM_ENCODING);
|
||||
if (encoding == null)
|
||||
{
|
||||
encoding = "UTF-8";
|
||||
encoding = "Cp437";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -1,158 +0,0 @@
|
||||
/*
|
||||
* #%L
|
||||
* Alfresco Repository
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2016 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
package org.alfresco.repo.config.source;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.extensions.config.ConfigException;
|
||||
import org.springframework.extensions.config.source.UrlConfigSource;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.tenant.TenantService;
|
||||
import org.alfresco.service.cmr.repository.ContentReader;
|
||||
import org.alfresco.service.cmr.repository.ContentService;
|
||||
import org.alfresco.service.cmr.repository.InvalidStoreRefException;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.cmr.repository.StoreRef;
|
||||
import org.alfresco.service.cmr.search.SearchService;
|
||||
import org.alfresco.service.namespace.NamespaceService;
|
||||
|
||||
/**
|
||||
* ConfigSource that looks for a prefix to determine where to look for the config.</br>
|
||||
* Valid prefixes are:
|
||||
* <ul>
|
||||
* <li><b><storeProtocol>://<storeIdentifier></b> the location provided is a path to a repository file</li>
|
||||
* </ul>
|
||||
* as well as those defined in the core (UrlConfigSource)
|
||||
*
|
||||
* Example store URLs
|
||||
* <code>workspace://SpacesStore/${spaces.company_home.childname}/${spaces.dictionary.childname}/${spaces.webclient_extension.childname}/cm:web-client-config-custom.xml</code>
|
||||
* <code>workspace://SpacesStore/app:company_home/app:dictionary/app:webclient_extension/cm:web-client-config-custom.xml</code>
|
||||
*/
|
||||
public class RepoUrlConfigSource extends UrlConfigSource
|
||||
{
|
||||
private TenantService tenantService;
|
||||
private SearchService searchService;
|
||||
private ContentService contentService;
|
||||
private NamespaceService namespaceService;
|
||||
private NodeService nodeService;
|
||||
|
||||
|
||||
public void setTenantService(TenantService tenantService)
|
||||
{
|
||||
this.tenantService = tenantService;
|
||||
}
|
||||
|
||||
public void setSearchService(SearchService searchService)
|
||||
{
|
||||
this.searchService = searchService;
|
||||
}
|
||||
|
||||
public void setContentService(ContentService contentService)
|
||||
{
|
||||
this.contentService = contentService;
|
||||
}
|
||||
|
||||
public void setNamespaceService(NamespaceService namespaceService)
|
||||
{
|
||||
this.namespaceService = namespaceService;
|
||||
}
|
||||
|
||||
public void setNodeService(NodeService nodeService)
|
||||
{
|
||||
this.nodeService = nodeService;
|
||||
}
|
||||
|
||||
|
||||
public RepoUrlConfigSource(String sourceLocation)
|
||||
{
|
||||
super(sourceLocation);
|
||||
}
|
||||
|
||||
public RepoUrlConfigSource(List<String> sourceLocations)
|
||||
{
|
||||
super(sourceLocations);
|
||||
}
|
||||
|
||||
|
||||
public InputStream getInputStream(String sourceUrl)
|
||||
{
|
||||
// determine the config source
|
||||
try
|
||||
{
|
||||
return super.getInputStream(sourceUrl);
|
||||
}
|
||||
catch (ConfigException ce)
|
||||
{
|
||||
int idx = sourceUrl.indexOf(StoreRef.URI_FILLER);
|
||||
if (idx != -1)
|
||||
{
|
||||
// assume this is a repository location
|
||||
int idx2 = sourceUrl.indexOf("/", idx+3);
|
||||
|
||||
String store = sourceUrl.substring(0, idx2);
|
||||
String path = sourceUrl.substring(idx2);
|
||||
|
||||
StoreRef storeRef = tenantService.getName(new StoreRef(store));
|
||||
NodeRef rootNode = null;
|
||||
|
||||
try
|
||||
{
|
||||
rootNode = nodeService.getRootNode(storeRef);
|
||||
}
|
||||
catch (InvalidStoreRefException e)
|
||||
{
|
||||
throw ce;
|
||||
}
|
||||
|
||||
List<NodeRef> nodeRefs = searchService.selectNodes(rootNode, path, null, namespaceService, false);
|
||||
|
||||
if (nodeRefs.size() == 0)
|
||||
{
|
||||
// if none found, then simply skip
|
||||
return null;
|
||||
}
|
||||
else if (nodeRefs.size() > 1)
|
||||
{
|
||||
// unexpected
|
||||
throw new ConfigException("Found duplicate config sources in the repository " + sourceUrl);
|
||||
}
|
||||
|
||||
NodeRef nodeRef = nodeRefs.get(0);
|
||||
|
||||
ContentReader cr = contentService.getReader(nodeRef, ContentModel.PROP_CONTENT);
|
||||
|
||||
return cr.getContentInputStream();
|
||||
}
|
||||
else
|
||||
{
|
||||
// not a repository url
|
||||
throw ce;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -251,15 +251,16 @@ public class TransactionBehaviourQueue implements TransactionListener
|
||||
}
|
||||
catch (IllegalArgumentException e)
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Failed to execute transaction-level behaviour " + context.method + " in transaction " + AlfrescoTransactionSupport.getTransactionId(), e);
|
||||
throw new AlfrescoRuntimeException("Failed to execute transaction-level behaviour " + context.method + " in transaction " + AlfrescoTransactionSupport.getTransactionId() + " : " + e.getMessage(), e);
|
||||
}
|
||||
catch (IllegalAccessException e)
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Failed to execute transaction-level behaviour " + context.method + " in transaction " + AlfrescoTransactionSupport.getTransactionId(), e);
|
||||
throw new AlfrescoRuntimeException("Failed to execute transaction-level behaviour " + context.method + " in transaction " + AlfrescoTransactionSupport.getTransactionId() + " : " + e.getMessage(), e);
|
||||
}
|
||||
catch (InvocationTargetException e)
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Failed to execute transaction-level behaviour " + context.method + " in transaction " + AlfrescoTransactionSupport.getTransactionId(), e.getTargetException());
|
||||
String msg = e.getMessage() + (e.getTargetException() != null ? "(" + e.getTargetException().getMessage() + ")" : "");
|
||||
throw new AlfrescoRuntimeException("Failed to execute transaction-level behaviour " + context.method + " in transaction " + AlfrescoTransactionSupport.getTransactionId() + " : " + msg, e.getTargetException());
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -514,15 +514,11 @@ public class RenditionService2Impl implements RenditionService2, InitializingBea
|
||||
NodeRef renditionNode = getRenditionNode(sourceNodeRef, renditionName);
|
||||
boolean createRenditionNode = renditionNode == null;
|
||||
boolean sourceHasAspectRenditioned = nodeService.hasAspect(sourceNodeRef, RenditionModel.ASPECT_RENDITIONED);
|
||||
boolean sourceChanges = !sourceHasAspectRenditioned || createRenditionNode || transformInputStream == null;
|
||||
try
|
||||
{
|
||||
if (sourceChanges)
|
||||
{
|
||||
ruleService.disableRuleType(RuleType.UPDATE);
|
||||
behaviourFilter.disableBehaviour(sourceNodeRef, ContentModel.ASPECT_AUDITABLE);
|
||||
behaviourFilter.disableBehaviour(sourceNodeRef, ContentModel.ASPECT_VERSIONABLE);
|
||||
}
|
||||
ruleService.disableRuleType(RuleType.UPDATE);
|
||||
behaviourFilter.disableBehaviour(sourceNodeRef, ContentModel.ASPECT_AUDITABLE);
|
||||
behaviourFilter.disableBehaviour(sourceNodeRef, ContentModel.ASPECT_VERSIONABLE);
|
||||
|
||||
// If they do not exist create the rendition association and the rendition node.
|
||||
if (createRenditionNode)
|
||||
@@ -592,12 +588,9 @@ public class RenditionService2Impl implements RenditionService2, InitializingBea
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (sourceChanges)
|
||||
{
|
||||
behaviourFilter.enableBehaviour(sourceNodeRef, ContentModel.ASPECT_AUDITABLE);
|
||||
behaviourFilter.enableBehaviour(sourceNodeRef, ContentModel.ASPECT_VERSIONABLE);
|
||||
ruleService.enableRuleType(RuleType.UPDATE);
|
||||
}
|
||||
behaviourFilter.enableBehaviour(sourceNodeRef, ContentModel.ASPECT_AUDITABLE);
|
||||
behaviourFilter.enableBehaviour(sourceNodeRef, ContentModel.ASPECT_VERSIONABLE);
|
||||
ruleService.enableRuleType(RuleType.UPDATE);
|
||||
}
|
||||
return null;
|
||||
}, false, true));
|
||||
|
@@ -25,7 +25,6 @@
|
||||
*/
|
||||
package org.alfresco.repo.search.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
@@ -50,7 +49,6 @@ import org.alfresco.query.PagingResults;
|
||||
import org.alfresco.repo.search.IndexerAndSearcher;
|
||||
import org.alfresco.repo.search.IndexerException;
|
||||
import org.alfresco.repo.tenant.TenantService;
|
||||
import org.alfresco.service.Experimental;
|
||||
import org.alfresco.service.cmr.dictionary.AspectDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||
@@ -637,7 +635,6 @@ public abstract class AbstractCategoryServiceImpl implements CategoryService
|
||||
}
|
||||
|
||||
@Override
|
||||
@Experimental
|
||||
public Optional<NodeRef> getRootCategoryNodeRef(final StoreRef storeRef)
|
||||
{
|
||||
return getRootCategoryNodeRef(storeRef, ContentModel.ASPECT_GEN_CLASSIFIABLE);
|
||||
|
@@ -357,8 +357,13 @@ public class IdentityServiceFacadeFactoryBean implements FactoryBean<IdentitySer
|
||||
|
||||
private ClientRegistration.Builder createBuilder(OIDCProviderMetadata metadata)
|
||||
{
|
||||
final String authUri = Optional.of(metadata)
|
||||
.map(OIDCProviderMetadata::getAuthorizationEndpointURI)
|
||||
.map(URI::toASCIIString)
|
||||
.orElse(null);
|
||||
return ClientRegistration
|
||||
.withRegistrationId("ids")
|
||||
.authorizationUri(authUri)
|
||||
.tokenUri(metadata.getTokenEndpointURI().toASCIIString())
|
||||
.jwkSetUri(metadata.getJWKSetURI().toASCIIString())
|
||||
.issuerUri(config.getIssuerUrl())
|
||||
|
@@ -1605,8 +1605,6 @@ public class LDAPUserRegistry implements UserRegistry, LDAPNameResolver, Initial
|
||||
this.userSearchCtls = new SearchControls();
|
||||
this.userSearchCtls.setSearchScope(SearchControls.SUBTREE_SCOPE);
|
||||
this.userSearchCtls.setReturningAttributes(LDAPUserRegistry.this.userKeys.getFirst());
|
||||
// MNT-14001 fix, set search limit to ensure that server will not return more search results then provided by paged result control
|
||||
this.userSearchCtls.setCountLimit(LDAPUserRegistry.this.queryBatchSize > 0 ? LDAPUserRegistry.this.queryBatchSize : 0);
|
||||
|
||||
this.next = fetchNext();
|
||||
}
|
||||
|
@@ -65,7 +65,6 @@ import org.alfresco.repo.audit.AuditComponent;
|
||||
import org.alfresco.repo.coci.CheckOutCheckInServicePolicies.OnCheckOut;
|
||||
import org.alfresco.repo.copy.CopyServicePolicies.BeforeCopyPolicy;
|
||||
import org.alfresco.repo.copy.CopyServicePolicies.OnCopyCompletePolicy;
|
||||
import org.alfresco.repo.domain.query.QueryException;
|
||||
import org.alfresco.repo.event2.EventGenerator;
|
||||
import org.alfresco.repo.node.NodeServicePolicies.BeforeDeleteNodePolicy;
|
||||
import org.alfresco.repo.node.NodeServicePolicies.OnCreateNodePolicy;
|
||||
@@ -78,7 +77,6 @@ import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
|
||||
import org.alfresco.repo.transaction.AlfrescoTransactionSupport;
|
||||
import org.alfresco.repo.transaction.TransactionListener;
|
||||
import org.alfresco.service.Experimental;
|
||||
import org.alfresco.service.cmr.action.Action;
|
||||
import org.alfresco.service.cmr.action.ActionService;
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
@@ -126,7 +124,7 @@ public class TaggingServiceImpl implements TaggingService,
|
||||
|
||||
private static Log logger = LogFactory.getLog(TaggingServiceImpl.class);
|
||||
|
||||
private static Collator collator = Collator.getInstance();
|
||||
private static Collator collator = Collator.getInstance();
|
||||
|
||||
private NodeService nodeService;
|
||||
private NodeService nodeServiceInternal;
|
||||
@@ -502,8 +500,8 @@ public class TaggingServiceImpl implements TaggingService,
|
||||
{
|
||||
// Lower the case of the tag
|
||||
tag = tag.toLowerCase();
|
||||
|
||||
return getTagNodeRef(storeRef, tag, true);
|
||||
|
||||
return getTagNodeRef(storeRef, tag, true);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -532,33 +530,33 @@ public class TaggingServiceImpl implements TaggingService,
|
||||
|
||||
public NodeRef changeTag(StoreRef storeRef, String existingTag, String newTag)
|
||||
{
|
||||
if (existingTag == null)
|
||||
{
|
||||
throw new TaggingException("Existing tag cannot be null");
|
||||
}
|
||||
|
||||
if (newTag == null || StringUtils.isBlank(newTag))
|
||||
{
|
||||
throw new TaggingException("New tag cannot be blank");
|
||||
}
|
||||
if (existingTag == null)
|
||||
{
|
||||
throw new TaggingException("Existing tag cannot be null");
|
||||
}
|
||||
|
||||
existingTag = existingTag.toLowerCase();
|
||||
newTag = newTag.toLowerCase();
|
||||
if (newTag == null || StringUtils.isBlank(newTag))
|
||||
{
|
||||
throw new TaggingException("New tag cannot be blank");
|
||||
}
|
||||
|
||||
if (existingTag.equals(newTag))
|
||||
{
|
||||
throw new TaggingException("New and existing tags are the same");
|
||||
}
|
||||
|
||||
if (getTagNodeRef(storeRef, existingTag) == null)
|
||||
{
|
||||
throw new NonExistentTagException("Tag " + existingTag + " not found");
|
||||
}
|
||||
|
||||
if (getTagNodeRef(storeRef, newTag) != null)
|
||||
{
|
||||
throw new TagExistsException("Tag " + newTag + " already exists");
|
||||
}
|
||||
existingTag = existingTag.toLowerCase();
|
||||
newTag = newTag.toLowerCase();
|
||||
|
||||
if (existingTag.equals(newTag))
|
||||
{
|
||||
throw new TaggingException("New and existing tags are the same");
|
||||
}
|
||||
|
||||
if (getTagNodeRef(storeRef, existingTag) == null)
|
||||
{
|
||||
throw new NonExistentTagException("Tag " + existingTag + " not found");
|
||||
}
|
||||
|
||||
if (getTagNodeRef(storeRef, newTag) != null)
|
||||
{
|
||||
throw new TagExistsException("Tag " + newTag + " already exists");
|
||||
}
|
||||
|
||||
NodeRef tagNodeRef = getTagNodeRef(storeRef, existingTag);
|
||||
nodeService.setProperty(tagNodeRef, PROP_NAME, newTag);
|
||||
@@ -718,12 +716,12 @@ public class TaggingServiceImpl implements TaggingService,
|
||||
@SuppressWarnings("unchecked")
|
||||
public NodeRef addTag(final NodeRef nodeRef, final String tagName)
|
||||
{
|
||||
NodeRef newTagNodeRef = null;
|
||||
|
||||
if(tagName == null)
|
||||
{
|
||||
throw new IllegalArgumentException("Must provide a non-null tag");
|
||||
}
|
||||
NodeRef newTagNodeRef = null;
|
||||
|
||||
if(tagName == null)
|
||||
{
|
||||
throw new IllegalArgumentException("Must provide a non-null tag");
|
||||
}
|
||||
|
||||
updateTagBehaviour.disable();
|
||||
createTagBehaviour.disable();
|
||||
@@ -773,7 +771,7 @@ public class TaggingServiceImpl implements TaggingService,
|
||||
*/
|
||||
public List<Pair<String, NodeRef>> addTags(NodeRef nodeRef, List<String> tags)
|
||||
{
|
||||
List<Pair<String, NodeRef>> ret = new ArrayList<Pair<String, NodeRef>>();
|
||||
List<Pair<String, NodeRef>> ret = new ArrayList<Pair<String, NodeRef>>();
|
||||
for (String tag : tags)
|
||||
{
|
||||
NodeRef tagNodeRef = addTag(nodeRef, tag);
|
||||
@@ -894,36 +892,36 @@ public class TaggingServiceImpl implements TaggingService,
|
||||
int skipCount = pagingRequest.getSkipCount();
|
||||
int maxItems = pagingRequest.getMaxItems();
|
||||
int end = maxItems == Integer.MAX_VALUE ? totalItems : skipCount + maxItems;
|
||||
int size = (maxItems == Integer.MAX_VALUE ? totalItems : maxItems);
|
||||
int size = (maxItems == Integer.MAX_VALUE ? totalItems : maxItems);
|
||||
|
||||
final List<Pair<NodeRef, String>> sortedTags = new ArrayList<Pair<NodeRef, String>>(size);
|
||||
// grab all tags and sort (assume fairly low number of tags)
|
||||
for(NodeRef tagNode : currentTagNodes)
|
||||
{
|
||||
// grab all tags and sort (assume fairly low number of tags)
|
||||
for(NodeRef tagNode : currentTagNodes)
|
||||
{
|
||||
String tag = (String)this.nodeService.getProperty(tagNode, PROP_NAME);
|
||||
sortedTags.add(new Pair<NodeRef, String>(tagNode, tag));
|
||||
}
|
||||
}
|
||||
Collections.sort(sortedTags, new Comparator<Pair<NodeRef, String>>()
|
||||
{
|
||||
@Override
|
||||
public int compare(Pair<NodeRef, String> o1, Pair<NodeRef, String> o2)
|
||||
{
|
||||
String tag1 = o1.getSecond();
|
||||
String tag2 = o2.getSecond();
|
||||
return collator.compare(tag1, tag2);
|
||||
}
|
||||
});
|
||||
@Override
|
||||
public int compare(Pair<NodeRef, String> o1, Pair<NodeRef, String> o2)
|
||||
{
|
||||
String tag1 = o1.getSecond();
|
||||
String tag2 = o2.getSecond();
|
||||
return collator.compare(tag1, tag2);
|
||||
}
|
||||
});
|
||||
|
||||
final List<Pair<NodeRef, String>> result = new ArrayList<Pair<NodeRef, String>>(size);
|
||||
Iterator<Pair<NodeRef, String>> it = sortedTags.iterator();
|
||||
Iterator<Pair<NodeRef, String>> it = sortedTags.iterator();
|
||||
for(int count = 0; count < end && it.hasNext(); count++)
|
||||
{
|
||||
Pair<NodeRef, String> tagPair = it.next();
|
||||
Pair<NodeRef, String> tagPair = it.next();
|
||||
|
||||
if(count < skipCount)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if(count < skipCount)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
result.add(tagPair);
|
||||
}
|
||||
@@ -932,30 +930,30 @@ public class TaggingServiceImpl implements TaggingService,
|
||||
|
||||
return new PagingResults<Pair<NodeRef, String>>()
|
||||
{
|
||||
@Override
|
||||
public List<Pair<NodeRef, String>> getPage()
|
||||
{
|
||||
return result;
|
||||
}
|
||||
@Override
|
||||
public List<Pair<NodeRef, String>> getPage()
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasMoreItems()
|
||||
{
|
||||
return hasMoreItems;
|
||||
}
|
||||
@Override
|
||||
public boolean hasMoreItems()
|
||||
{
|
||||
return hasMoreItems;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pair<Integer, Integer> getTotalResultCount()
|
||||
{
|
||||
Integer total = Integer.valueOf(totalItems);
|
||||
return new Pair<Integer, Integer>(total, total);
|
||||
}
|
||||
@Override
|
||||
public Pair<Integer, Integer> getTotalResultCount()
|
||||
{
|
||||
Integer total = Integer.valueOf(totalItems);
|
||||
return new Pair<Integer, Integer>(total, total);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getQueryExecutionId()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public String getQueryExecutionId()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1028,7 +1026,7 @@ public class TaggingServiceImpl implements TaggingService,
|
||||
{
|
||||
if (tagsByCountMap.isEmpty())
|
||||
{
|
||||
throw new QueryException("Tag count should be included when ordering by count");
|
||||
throw new IllegalArgumentException("Tag count should be included when ordering by count");
|
||||
}
|
||||
|
||||
if (!sorting.getSecond())
|
||||
@@ -1289,15 +1287,15 @@ public class TaggingServiceImpl implements TaggingService,
|
||||
*/
|
||||
private void getTagScopes(final NodeRef nodeRef, List<NodeRef> tagScopes, boolean firstOnly)
|
||||
{
|
||||
Boolean hasAspect = AuthenticationUtil.runAs(new RunAsWork<Boolean>()
|
||||
{
|
||||
@Override
|
||||
public Boolean doWork() throws Exception
|
||||
{
|
||||
return new Boolean(nodeService.hasAspect(nodeRef, ContentModel.ASPECT_TAGSCOPE));
|
||||
}
|
||||
}, AuthenticationUtil.getSystemUserName());
|
||||
|
||||
Boolean hasAspect = AuthenticationUtil.runAs(new RunAsWork<Boolean>()
|
||||
{
|
||||
@Override
|
||||
public Boolean doWork() throws Exception
|
||||
{
|
||||
return new Boolean(nodeService.hasAspect(nodeRef, ContentModel.ASPECT_TAGSCOPE));
|
||||
}
|
||||
}, AuthenticationUtil.getSystemUserName());
|
||||
|
||||
if (Boolean.TRUE.equals(hasAspect) == true)
|
||||
{
|
||||
tagScopes.add(nodeRef);
|
||||
@@ -1308,23 +1306,23 @@ public class TaggingServiceImpl implements TaggingService,
|
||||
}
|
||||
|
||||
NodeRef parent = AuthenticationUtil.runAs(new RunAsWork<NodeRef>()
|
||||
{
|
||||
@Override
|
||||
public NodeRef doWork() throws Exception
|
||||
{
|
||||
NodeRef result = null;
|
||||
ChildAssociationRef assoc = nodeService.getPrimaryParent(nodeRef);
|
||||
if (assoc != null)
|
||||
{
|
||||
result = assoc.getParentRef();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}, AuthenticationUtil.getSystemUserName());
|
||||
{
|
||||
@Override
|
||||
public NodeRef doWork() throws Exception
|
||||
{
|
||||
NodeRef result = null;
|
||||
ChildAssociationRef assoc = nodeService.getPrimaryParent(nodeRef);
|
||||
if (assoc != null)
|
||||
{
|
||||
result = assoc.getParentRef();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}, AuthenticationUtil.getSystemUserName());
|
||||
|
||||
if (parent != null)
|
||||
{
|
||||
getTagScopes(parent, tagScopes, firstOnly);
|
||||
getTagScopes(parent, tagScopes, firstOnly);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1700,7 +1698,6 @@ public class TaggingServiceImpl implements TaggingService,
|
||||
}
|
||||
}
|
||||
|
||||
@Experimental
|
||||
@Override
|
||||
public List<Pair<String, NodeRef>> createTags(final StoreRef storeRef, final List<String> tagNames)
|
||||
{
|
||||
|
@@ -997,6 +997,20 @@ public class WorkflowServiceImpl implements WorkflowService
|
||||
public WorkflowTask updateTask(String taskId, Map<QName, Serializable> properties, Map<QName, List<NodeRef>> add,
|
||||
Map<QName, List<NodeRef>> remove)
|
||||
{
|
||||
if(properties.containsKey(WorkflowModel.PROP_STATUS)) {
|
||||
|
||||
LinkedList<String> validTaskStatus = new LinkedList<>();
|
||||
validTaskStatus.add("Not Yet Started");
|
||||
validTaskStatus.add("In Progress");
|
||||
validTaskStatus.add("On Hold");
|
||||
validTaskStatus.add("Cancelled");
|
||||
validTaskStatus.add("Completed");
|
||||
|
||||
if (!validTaskStatus.contains(properties.get(WorkflowModel.PROP_STATUS))) {
|
||||
throw new WorkflowException("Invalid Value is Passed for Task Status.");
|
||||
}
|
||||
}
|
||||
|
||||
String engineId = BPMEngineRegistry.getEngineId(taskId);
|
||||
TaskComponent component = getTaskComponent(engineId);
|
||||
// get the current assignee before updating the task
|
||||
|
@@ -35,7 +35,6 @@ import org.alfresco.query.EmptyPagingResults;
|
||||
import org.alfresco.query.PagingRequest;
|
||||
import org.alfresco.query.PagingResults;
|
||||
import org.alfresco.service.Auditable;
|
||||
import org.alfresco.service.Experimental;
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.StoreRef;
|
||||
@@ -283,7 +282,6 @@ public interface CategoryService
|
||||
*
|
||||
* @return NodeRef for category root node
|
||||
*/
|
||||
@Experimental
|
||||
@Auditable(parameters = {"storeRef"})
|
||||
default Optional<NodeRef> getRootCategoryNodeRef(final StoreRef storeRef)
|
||||
{
|
||||
|
@@ -35,7 +35,6 @@ import org.alfresco.query.EmptyPagingResults;
|
||||
import org.alfresco.query.PagingRequest;
|
||||
import org.alfresco.query.PagingResults;
|
||||
import org.alfresco.service.Auditable;
|
||||
import org.alfresco.service.Experimental;
|
||||
import org.alfresco.service.NotAuditable;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.StoreRef;
|
||||
@@ -368,7 +367,6 @@ public interface TaggingService
|
||||
* @return {@link List} of {@link Pair}s of tag names and node references.
|
||||
* @throws org.alfresco.service.cmr.repository.DuplicateChildNodeNameException if tag already exists.
|
||||
*/
|
||||
@Experimental
|
||||
@Auditable(parameters = {"tagNames"})
|
||||
default List<Pair<String, NodeRef>> createTags(StoreRef storeRef, List<String> tagNames)
|
||||
{
|
||||
|
@@ -25,27 +25,66 @@
|
||||
*/
|
||||
package org.alfresco.util.remote.server;
|
||||
|
||||
import org.springframework.remoting.rmi.RmiRegistryFactoryBean;
|
||||
import org.alfresco.util.remote.server.socket.HostConfigurableSocketFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.DisposableBean;
|
||||
import org.springframework.beans.factory.FactoryBean;
|
||||
|
||||
import java.rmi.RemoteException;
|
||||
import java.rmi.registry.LocateRegistry;
|
||||
import java.rmi.registry.Registry;
|
||||
import java.rmi.server.RMIClientSocketFactory;
|
||||
import java.rmi.server.RMIServerSocketFactory;
|
||||
import java.rmi.server.UnicastRemoteObject;
|
||||
|
||||
/**
|
||||
* This class controls the RMI connectivity via <code>alfresco.jmx.connector.enabled</code> property
|
||||
*
|
||||
* @author alex.mukha
|
||||
*/
|
||||
public class AlfrescoRmiRegistryFactoryBean extends RmiRegistryFactoryBean
|
||||
public class AlfrescoRmiRegistryFactoryBean implements FactoryBean<Registry>, DisposableBean
|
||||
{
|
||||
private static final String ERR_MSG_NOT_ENABLED = "The RMI registry factory is disabled.";
|
||||
private static final Logger LOG = LoggerFactory.getLogger(AlfrescoRmiRegistryFactoryBean.class);
|
||||
|
||||
private boolean enabled = true;
|
||||
private boolean created = false;
|
||||
|
||||
public void setEnabled(boolean enabled)
|
||||
{
|
||||
private final boolean enabled;
|
||||
|
||||
private final int port;
|
||||
|
||||
private final Registry registry;
|
||||
|
||||
public AlfrescoRmiRegistryFactoryBean(boolean enabled, int port, HostConfigurableSocketFactory socketFactory) throws Exception {
|
||||
this.enabled = enabled;
|
||||
this.port = port;
|
||||
if(this.enabled)
|
||||
{
|
||||
this.registry = initRegistry(socketFactory);
|
||||
}
|
||||
else {
|
||||
this.registry = null;
|
||||
}
|
||||
}
|
||||
|
||||
private Registry initRegistry(HostConfigurableSocketFactory socketFactory) throws RemoteException {
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("Looking for RMI registry at port '" + this.port + "', using custom socket factory");
|
||||
}
|
||||
Registry registry;
|
||||
synchronized (LocateRegistry.class) {
|
||||
try {
|
||||
// Retrieve existing registry.
|
||||
registry = LocateRegistry.getRegistry(null, this.port, socketFactory);
|
||||
testRegistry(this.registry);
|
||||
}
|
||||
catch (RemoteException ex) {
|
||||
LOG.trace("RMI registry access threw exception", ex);
|
||||
LOG.debug("Could not detect RMI registry - creating new one");
|
||||
// Assume no registry found -> create new one.
|
||||
this.created = true;
|
||||
registry = LocateRegistry.createRegistry(this.port, socketFactory, socketFactory);
|
||||
}
|
||||
}
|
||||
return registry;
|
||||
}
|
||||
|
||||
public boolean isEnabled()
|
||||
@@ -54,57 +93,34 @@ public class AlfrescoRmiRegistryFactoryBean extends RmiRegistryFactoryBean
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() throws Exception
|
||||
{
|
||||
if (enabled)
|
||||
{
|
||||
super.afterPropertiesSet();
|
||||
public void destroy() throws Exception {
|
||||
if (this.created) {
|
||||
LOG.debug("Unexporting RMI registry");
|
||||
UnicastRemoteObject.unexportObject(this.registry, true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Registry getRegistry(
|
||||
String registryHost,
|
||||
int registryPort,
|
||||
RMIClientSocketFactory clientSocketFactory,
|
||||
RMIServerSocketFactory serverSocketFactory) throws RemoteException
|
||||
{
|
||||
if(enabled)
|
||||
{
|
||||
return super.getRegistry(registryHost, registryPort, clientSocketFactory, serverSocketFactory);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new RemoteException(ERR_MSG_NOT_ENABLED);
|
||||
}
|
||||
public Registry getObject() throws Exception {
|
||||
return this.registry;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Registry getRegistry(
|
||||
int registryPort,
|
||||
RMIClientSocketFactory clientSocketFactory,
|
||||
RMIServerSocketFactory serverSocketFactory) throws RemoteException
|
||||
{
|
||||
if(enabled)
|
||||
{
|
||||
return super.getRegistry(registryPort, clientSocketFactory, serverSocketFactory);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new RemoteException(ERR_MSG_NOT_ENABLED);
|
||||
}
|
||||
public Class<?> getObjectType() {
|
||||
return (this.registry != null ? this.registry.getClass() : Registry.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Registry getRegistry(int registryPort) throws RemoteException
|
||||
public boolean isCreated()
|
||||
{
|
||||
if(enabled)
|
||||
{
|
||||
return super.getRegistry(registryPort);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new RemoteException(ERR_MSG_NOT_ENABLED);
|
||||
}
|
||||
return created;
|
||||
}
|
||||
|
||||
public int getPort() {
|
||||
return port;
|
||||
}
|
||||
|
||||
private void testRegistry(Registry registry) throws RemoteException
|
||||
{
|
||||
registry.list();
|
||||
}
|
||||
}
|
||||
|
@@ -75,6 +75,9 @@
|
||||
<property name="propertiesPersister">
|
||||
<bean class="org.alfresco.config.AlfrescoPropertiesPersister"/>
|
||||
</property>
|
||||
<property name="order">
|
||||
<value>9999999</value>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<!-- Expand global properties and version information in bean definitions -->
|
||||
@@ -101,6 +104,18 @@
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="default-properties-resolver" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
|
||||
<property name="ignoreUnresolvablePlaceholders">
|
||||
<value>true</value>
|
||||
</property>
|
||||
<property name="searchSystemEnvironment">
|
||||
<value>false</value>
|
||||
</property>
|
||||
<property name="order">
|
||||
<value>2147483647</value>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
|
||||
<!-- Load properties that must be shared between the -->
|
||||
<!-- Alfresco server and its remote clients. -->
|
||||
|
@@ -3,7 +3,7 @@
|
||||
repository.name=Main Repository
|
||||
|
||||
# Schema number
|
||||
version.schema=18000
|
||||
version.schema=19000
|
||||
|
||||
# Directory configuration
|
||||
|
||||
@@ -1349,7 +1349,7 @@ system.remove-alf_server-table-from-db.ignored=true
|
||||
allow.unsecure.callback.jsonp=false
|
||||
|
||||
# pre-configured allow list of media/mime types to allow inline instead of attachment (via Content-Disposition response header)
|
||||
content.nonAttach.mimetypes=application/pdf,image/jpeg,image/gif,image/png,image/tiff,image/bmp
|
||||
content.nonAttach.mimetypes=application/pdf,image/jpeg,image/gif,image/png,image/tiff,image/bmp,application/octet-stream
|
||||
|
||||
# Zip file compression ratio threshold as a percentage, above which the zip file will be considered a "zip bomb" and the
|
||||
# import extraction process cancelled.
|
||||
|
@@ -30,6 +30,7 @@ import static org.junit.Assert.assertNotEquals;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
@@ -419,6 +420,65 @@ public class RenditionService2IntegrationTest extends AbstractRenditionIntegrati
|
||||
assertTrue("New rendition content hash code was not generated", isValidRenditionContentHashCode(contentHashCode3));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testModifierAfterMultipleRenditionRequests() throws InterruptedException
|
||||
{
|
||||
String user1 = createRandomUser();
|
||||
String user2 = createRandomUser();
|
||||
List<NodeRef> nodes = new ArrayList<NodeRef>();
|
||||
|
||||
final int TOTAL_NODES = 10;
|
||||
|
||||
// Create nodes
|
||||
for (int i = 0; i < TOTAL_NODES; i++)
|
||||
{
|
||||
NodeRef n = createSource(user1, "quick.jpg");
|
||||
render(user1, n, DOC_LIB);
|
||||
nodes.add(n);
|
||||
}
|
||||
|
||||
// Ask rendition multiple times with 'user2'
|
||||
for (int j = 0; j < 10; j++)
|
||||
{
|
||||
for (int i = 0; i < TOTAL_NODES; i++)
|
||||
{
|
||||
render(user2, nodes.get(i), DOC_LIB);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < TOTAL_NODES; i++)
|
||||
{
|
||||
waitForRendition(user1, nodes.get(i), DOC_LIB, true);
|
||||
}
|
||||
|
||||
// Check the modifier is still user1
|
||||
assertEquals(TOTAL_NODES, countModifier(nodes, user1));
|
||||
}
|
||||
|
||||
private int countModifier(List<NodeRef> nodes, String user)
|
||||
{
|
||||
int count = 0;
|
||||
for (int i = 0; i < nodes.size(); i++)
|
||||
{
|
||||
count += compareModifier(nodes.get(i), user);
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
private int compareModifier(NodeRef nodeRef, String user)
|
||||
{
|
||||
int res = 0;
|
||||
if (nodeRef != null && user != null)
|
||||
{
|
||||
String modifier = nodeService.getProperty(nodeRef, ContentModel.PROP_MODIFIER).toString();
|
||||
if (user.equals(modifier))
|
||||
{
|
||||
res = 1;
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated can be removed when we remove the original RenditionService
|
||||
*/
|
||||
@@ -622,4 +682,4 @@ public class RenditionService2IntegrationTest extends AbstractRenditionIntegrati
|
||||
renditionService2.setEnabled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -34,7 +34,7 @@ services:
|
||||
ports:
|
||||
- "3307:3306"
|
||||
activemq:
|
||||
image: alfresco/alfresco-activemq:5.17.1-jre11-rockylinux8
|
||||
image: alfresco/alfresco-activemq:5.17.4-jre17-rockylinux8
|
||||
ports:
|
||||
- "5672:5672" # AMQP
|
||||
- "61616:61616" # OpenWire
|
@@ -20,7 +20,7 @@ services:
|
||||
- "5433:5432"
|
||||
activemq:
|
||||
profiles: ["default", "with-transform-core-aio", "activemq", "with-mtls-transform-core-aio"]
|
||||
image: alfresco/alfresco-activemq:5.17.1-jre11-rockylinux8
|
||||
image: alfresco/alfresco-activemq:5.17.4-jre17-rockylinux8
|
||||
ports:
|
||||
- "5672:5672" # AMQP
|
||||
- "61616:61616" # OpenWire
|
||||
|
@@ -35,10 +35,10 @@ git add pom.xml
|
||||
|
||||
if [[ "${COMMIT_MESSAGE}" =~ \[force[^\]]*\] ]]; then
|
||||
FORCE_TOKEN=$(echo "${COMMIT_MESSAGE}" | sed "s|^.*\(\[force[^]]*\]\).*$|\1|g")
|
||||
git commit --allow-empty -m "${FORCE_TOKEN} Update upstream version to ${VERSION}"
|
||||
git commit --allow-empty -m "${FORCE_TOKEN} Update community-repo version to ${VERSION}"
|
||||
git push
|
||||
elif git status --untracked-files=no --porcelain | grep -q '^' ; then
|
||||
git commit -m "Update upstream version to ${VERSION}"
|
||||
git commit -m "Update community-repo version to ${VERSION}"
|
||||
git push
|
||||
else
|
||||
echo "Dependencies are already up to date."
|
||||
|
Reference in New Issue
Block a user