mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-09-10 14:11:58 +00:00
Compare commits
70 Commits
23.1.0.155
...
23.1.0.169
Author | SHA1 | Date | |
---|---|---|---|
|
57da82028f | ||
|
61cf8a7273 | ||
|
7684a74dcc | ||
|
4a49c29b3c | ||
|
693f8cd5c9 | ||
|
083bd3ce35 | ||
|
aef7febbf5 | ||
|
db1644dbb2 | ||
|
b66f9f604b | ||
|
b423a7ae96 | ||
|
114cec4987 | ||
|
a480370459 | ||
|
22cc54cc03 | ||
|
af26f07cf3 | ||
|
0e2ac5168c | ||
|
2ed631d3c2 | ||
|
4a02e33a28 | ||
|
fc7fe40709 | ||
|
89b3ba6c74 | ||
|
8a086f9312 | ||
|
3bcba75c39 | ||
|
bdda3f94f3 | ||
|
e97868c8c3 | ||
|
fea4f7f901 | ||
|
3fd3b128be | ||
|
d79d864cbb | ||
|
cb4dde6035 | ||
|
3215bc50c6 | ||
|
70430ea96c | ||
|
e8ae90b310 | ||
|
303b524158 | ||
|
afa48404c7 | ||
|
8af5c38caa | ||
|
6f4f3baae2 | ||
|
95d6fce43f | ||
|
d7722e4f25 | ||
|
6a87008665 | ||
|
6d14548119 | ||
|
67c4751676 | ||
|
d4a60a1d24 | ||
|
4388a75924 | ||
|
5982ec7172 | ||
|
7f26658eba | ||
|
88273f3073 | ||
|
7218864a44 | ||
|
133dd2b1c1 | ||
|
ade270743e | ||
|
59b50f0c67 | ||
|
8837c15a67 | ||
|
bac818baf2 | ||
|
2f6c845865 | ||
|
347627d0fd | ||
|
a495dae1db | ||
|
a07da7308f | ||
|
8b472e89f5 | ||
|
a3aaaedb0e | ||
|
044d07af86 | ||
|
110ccd5574 | ||
|
8fbe444266 | ||
|
5ef0bbb840 | ||
|
ba5720b494 | ||
|
866adc16f3 | ||
|
577788a8c6 | ||
|
6b02b4dc05 | ||
|
fc847ac7a5 | ||
|
25e8f0c6f8 | ||
|
499cf08ecd | ||
|
f0c191d7ca | ||
|
a1faf97fc5 | ||
|
d372ff6f5e |
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@@ -76,7 +76,7 @@ jobs:
|
||||
!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
|
||||
- uses: Alfresco/ya-pmd-scan@v1.0.0
|
||||
with:
|
||||
fail-on-new-issues: "false"
|
||||
|
||||
|
@@ -3,14 +3,12 @@ Thanks for your interest in contributing to this project!
|
||||
|
||||
The following is a set of guidelines for contributing to this library. Most of them will make the life of the reviewer easier and therefore decrease the time required for the patch be included in the next version.
|
||||
|
||||
Because this project forms a part of Alfresco Content Services, the guidelines are hosted in the [Alfresco Social Community](http://community.alfresco.com/community/ecm) where they can be referenced from multiple projects.
|
||||
|
||||
Read an [overview on how this project is goverened](https://community.alfresco.com/docs/DOC-6385-project-overview-repository).
|
||||
Because this project forms a part of Alfresco Content Services, the guidelines are hosted in the [Alfresco Social Community](https://hub.alfresco.com/t5/alfresco-content-services-ecm/ct-p/ECM-software) where they can be referenced from multiple projects.
|
||||
|
||||
You can report an issue in the ALF project of the [Alfresco issue tracker](http://issues.alfresco.com).
|
||||
|
||||
Read [instructions for a good issue report](https://community.alfresco.com/docs/DOC-6263-reporting-an-issue).
|
||||
Read [instructions for a good issue report](https://hub.alfresco.com/t5/alfresco-content-services-hub/reporting-an-issue/ba-p/289727).
|
||||
|
||||
Read [instructions for making a contribution](https://community.alfresco.com/docs/DOC-6269-submitting-contributions).
|
||||
Read [instructions for making a contribution](https://hub.alfresco.com/t5/alfresco-content-services-hub/alfresco-contribution-agreement/ba-p/293276).
|
||||
|
||||
Please follow [the coding standards](https://community.alfresco.com/docs/DOC-4658-coding-standards).
|
||||
Please follow [the coding standards](https://hub.alfresco.com/t5/alfresco-content-services-hub/coding-standards-for-alfresco-content-services/ba-p/290457).
|
||||
|
@@ -26,7 +26,7 @@ Repository is a library packaged as a jar file which contains the following:
|
||||
|
||||
Remote API is a library packaged as a jar file which contains the following:
|
||||
* REST API framework
|
||||
* WebScript implementations including [V1 REST APIs](https://community.alfresco.com/community/ecm/blog/2017/05/02/v1-rest-api-10-things-you-should-know)
|
||||
* WebScript implementations including [V1 REST APIs](https://hub.alfresco.com/t5/alfresco-content-services-blog/v1-rest-api-10-things-you-should-know/ba-p/287692)
|
||||
* [OpenCMIS](https://chemistry.apache.org/java/opencmis.html) implementations
|
||||
|
||||
#### Artifacts
|
||||
@@ -94,4 +94,4 @@ The enterprise projects which extend the `alfresco-community-repo` use the same
|
||||
artifact version number.
|
||||
|
||||
### Contributing guide
|
||||
Please use [this guide](CONTRIBUTING.md) to make a contribution to the project.
|
||||
Please use [this guide](CONTRIBUTING.md) to make a contribution to the project.
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-amps</artifactId>
|
||||
<version>23.1.0.155</version>
|
||||
<version>23.1.0.169</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-governance-services-community-parent</artifactId>
|
||||
<version>23.1.0.155</version>
|
||||
<version>23.1.0.169</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-governance-services-automation-community-repo</artifactId>
|
||||
<version>23.1.0.155</version>
|
||||
<version>23.1.0.169</version>
|
||||
</parent>
|
||||
|
||||
<build>
|
||||
@@ -82,7 +82,7 @@
|
||||
<dependency>
|
||||
<groupId>com.github.docker-java</groupId>
|
||||
<artifactId>docker-java</artifactId>
|
||||
<version>3.3.0</version>
|
||||
<version>3.3.2</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-governance-services-community-parent</artifactId>
|
||||
<version>23.1.0.155</version>
|
||||
<version>23.1.0.169</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
@@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-governance-services-community-repo-parent</artifactId>
|
||||
<version>23.1.0.155</version>
|
||||
<version>23.1.0.169</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-governance-services-community-repo-parent</artifactId>
|
||||
<version>23.1.0.155</version>
|
||||
<version>23.1.0.169</version>
|
||||
</parent>
|
||||
|
||||
<build>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>23.1.0.155</version>
|
||||
<version>23.1.0.169</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
@@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-amps</artifactId>
|
||||
<version>23.1.0.155</version>
|
||||
<version>23.1.0.169</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>23.1.0.155</version>
|
||||
<version>23.1.0.169</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>23.1.0.155</version>
|
||||
<version>23.1.0.169</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
@@ -201,6 +201,11 @@ public class SearchParameters implements BasicSearchParameters
|
||||
|
||||
private String timezone;
|
||||
|
||||
/**
|
||||
* Configure the limit to track the total hits on search results
|
||||
*/
|
||||
private int trackTotalHits;
|
||||
|
||||
/**
|
||||
* Default constructor
|
||||
*/
|
||||
@@ -251,6 +256,7 @@ public class SearchParameters implements BasicSearchParameters
|
||||
sp.stats = this.stats;
|
||||
sp.ranges = this.ranges;
|
||||
sp.timezone = this.timezone;
|
||||
sp.trackTotalHits = this.trackTotalHits;
|
||||
return sp;
|
||||
}
|
||||
|
||||
@@ -1641,6 +1647,21 @@ public class SearchParameters implements BasicSearchParameters
|
||||
{
|
||||
this.includeMetadata = includeMetadata;
|
||||
}
|
||||
|
||||
|
||||
public int getTrackTotalHits()
|
||||
{
|
||||
return trackTotalHits;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a maximum value for the report of total hits. The reported number of hits will never exceed this limit even
|
||||
* if more are found. If unset, the engine’s default tracking limit is applied. To remove any limit, set to -1.
|
||||
*
|
||||
* @param trackTotalHits int
|
||||
*/
|
||||
public void setTrackTotalHits(int trackTotalHits)
|
||||
{
|
||||
this.trackTotalHits = trackTotalHits;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>23.1.0.155</version>
|
||||
<version>23.1.0.169</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
@@ -9,6 +9,6 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||
<version>23.1.0.155</version>
|
||||
<version>23.1.0.169</version>
|
||||
</parent>
|
||||
</project>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||
<version>23.1.0.155</version>
|
||||
<version>23.1.0.169</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>23.1.0.155</version>
|
||||
<version>23.1.0.169</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||
<version>23.1.0.155</version>
|
||||
<version>23.1.0.169</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>23.1.0.155</version>
|
||||
<version>23.1.0.169</version>
|
||||
</parent>
|
||||
|
||||
<organization>
|
||||
|
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>23.1.0.155</version>
|
||||
<version>23.1.0.169</version>
|
||||
</parent>
|
||||
|
||||
<developers>
|
||||
|
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>23.1.0.155</version>
|
||||
<version>23.1.0.169</version>
|
||||
</parent>
|
||||
|
||||
<developers>
|
||||
|
@@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>23.1.0.155</version>
|
||||
<version>23.1.0.169</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
@@ -171,14 +171,14 @@
|
||||
<dependency>
|
||||
<groupId>org.codehaus.groovy</groupId>
|
||||
<artifactId>groovy</artifactId>
|
||||
<version>3.0.17</version>
|
||||
<version>3.0.18</version>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/org.codehaus.groovy/groovy-json-->
|
||||
<dependency>
|
||||
<groupId>org.codehaus.groovy</groupId>
|
||||
<artifactId>groovy-json</artifactId>
|
||||
<version>3.0.17</version>
|
||||
<version>3.0.18</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
@@ -25,6 +25,8 @@
|
||||
*/
|
||||
package org.alfresco.rest.model;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import org.alfresco.rest.core.IRestModel;
|
||||
@@ -43,6 +45,7 @@ public class RestPersonFavoritesModel extends TestModel implements IRestModel<Re
|
||||
|
||||
private String targetGuid;
|
||||
private String createdAt;
|
||||
private List<String> allowableOperations;
|
||||
|
||||
private RestTargetModel target;
|
||||
|
||||
@@ -86,4 +89,12 @@ public class RestPersonFavoritesModel extends TestModel implements IRestModel<Re
|
||||
{
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public List<String> getAllowableOperations() {
|
||||
return allowableOperations;
|
||||
}
|
||||
|
||||
public void setAllowableOperations(List<String> allowableOperations) {
|
||||
this.allowableOperations = allowableOperations;
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,82 @@
|
||||
/*-
|
||||
* #%L
|
||||
* alfresco-tas-restapi
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2023 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
package org.alfresco.rest.search;
|
||||
|
||||
import org.alfresco.rest.core.IRestModel;
|
||||
import org.alfresco.utility.model.TestModel;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
public class RestRequestLimitsModel extends TestModel implements IRestModel<RestRequestLimitsModel>
|
||||
{
|
||||
@JsonProperty
|
||||
RestRequestLimitsModel model;
|
||||
|
||||
private Integer permissionEvaluationTime;
|
||||
private Integer permissionEvaluationCount;
|
||||
private Integer trackTotalHitsLimit;
|
||||
|
||||
@Override
|
||||
public RestRequestLimitsModel onModel()
|
||||
{
|
||||
return model;
|
||||
}
|
||||
|
||||
public RestRequestLimitsModel(Integer permissionEvaluationTime, Integer permissionEvaluationCount,
|
||||
Integer trackTotalHitsLimit)
|
||||
{
|
||||
super();
|
||||
this.permissionEvaluationTime = permissionEvaluationTime;
|
||||
this.permissionEvaluationCount = permissionEvaluationCount;
|
||||
this.trackTotalHitsLimit = trackTotalHitsLimit;
|
||||
}
|
||||
|
||||
public Integer getPermissionEvaluationTime()
|
||||
{
|
||||
return permissionEvaluationTime;
|
||||
}
|
||||
public void setPermissionEvaluationTime(Integer permissionEvaluationTime)
|
||||
{
|
||||
this.permissionEvaluationTime = permissionEvaluationTime;
|
||||
}
|
||||
public Integer getPermissionEvaluationCount()
|
||||
{
|
||||
return permissionEvaluationCount;
|
||||
}
|
||||
public void setPermissionEvaluationCount(Integer permissionEvaluationCount)
|
||||
{
|
||||
this.permissionEvaluationCount = permissionEvaluationCount;
|
||||
}
|
||||
public Integer getTrackTotalHitsLimit()
|
||||
{
|
||||
return trackTotalHitsLimit;
|
||||
}
|
||||
public void setTrackTotalHitsLimit(Integer trackTotalHitsLimit)
|
||||
{
|
||||
this.trackTotalHitsLimit = trackTotalHitsLimit;
|
||||
}
|
||||
}
|
||||
|
@@ -101,6 +101,8 @@ public class SearchNodeModel extends TestModel implements IRestModel<SearchNodeM
|
||||
|
||||
private String location;
|
||||
|
||||
private Boolean isFavorite;
|
||||
|
||||
public Map<String, Object> getAssociation()
|
||||
{
|
||||
return association;
|
||||
@@ -326,5 +328,12 @@ public class SearchNodeModel extends TestModel implements IRestModel<SearchNodeM
|
||||
{
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
|
||||
public Boolean isFavorite() {
|
||||
return isFavorite;
|
||||
}
|
||||
|
||||
public void setIsFavorite(Boolean favorite) {
|
||||
isFavorite = favorite;
|
||||
}
|
||||
}
|
||||
|
@@ -79,6 +79,7 @@ public class SearchRequest extends TestModel
|
||||
List<SortClause> sort;
|
||||
RestRequestDefaultsModel defaults;
|
||||
List<RestRequestTemplatesModel> templates;
|
||||
RestRequestLimitsModel limits;
|
||||
|
||||
public SearchRequest()
|
||||
{
|
||||
@@ -302,4 +303,15 @@ public class SearchRequest extends TestModel
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public RestRequestLimitsModel getLimits()
|
||||
{
|
||||
return limits;
|
||||
}
|
||||
|
||||
public void setLimits(RestRequestLimitsModel limits)
|
||||
{
|
||||
this.limits = limits;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -21,6 +21,7 @@ import org.testng.annotations.Test;
|
||||
|
||||
public class GetFavoritesTests extends RestTest
|
||||
{
|
||||
private static final String ALLOWABLE_OPERATIONS = "allowableOperations";
|
||||
private UserModel adminUserModel, userModel;
|
||||
private SiteModel firstSiteModel;
|
||||
private SiteModel secondSiteModel;
|
||||
@@ -551,4 +552,17 @@ public class GetFavoritesTests extends RestTest
|
||||
.field("id").is(thirdSiteModel.getId()).and()
|
||||
.field("title").is(thirdSiteModel.getTitle());
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION, description = "Verify if get favorites response returns allowableOperations object when requested")
|
||||
public void checkResponseForGetFavoritesWithAllowableOperations()
|
||||
{
|
||||
RestPersonFavoritesModelsCollection adminFavorites =
|
||||
restClient.authenticateUser(adminUserModel).withCoreAPI().usingAuthUser().include(ALLOWABLE_OPERATIONS).getFavorites();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
|
||||
adminFavorites.getEntries().stream()
|
||||
.map(RestPersonFavoritesModel::onModel)
|
||||
.forEach(m -> m.assertThat().field(ALLOWABLE_OPERATIONS).isNotEmpty());
|
||||
}
|
||||
}
|
||||
|
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>23.1.0.155</version>
|
||||
<version>23.1.0.169</version>
|
||||
</parent>
|
||||
|
||||
<developers>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||
<version>23.1.0.155</version>
|
||||
<version>23.1.0.169</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
@@ -136,7 +136,7 @@
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>buildnumber-maven-plugin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<version>3.2.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>validate</phase>
|
||||
|
@@ -388,12 +388,6 @@
|
||||
<load-on-startup>8</load-on-startup>
|
||||
</servlet>
|
||||
|
||||
<servlet>
|
||||
<servlet-name>cmistck</servlet-name>
|
||||
<servlet-class>org.apache.chemistry.opencmis.tck.runner.WebRunnerServlet</servlet-class>
|
||||
<load-on-startup>8</load-on-startup>
|
||||
</servlet>
|
||||
|
||||
<servlet>
|
||||
<servlet-name>publicapiServlet</servlet-name>
|
||||
<servlet-class>org.alfresco.rest.api.PublicApiWebScriptServlet</servlet-class>
|
||||
@@ -469,14 +463,6 @@
|
||||
<servlet-name>publicapiServlet</servlet-name>
|
||||
<url-pattern>/api/*</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
<!-- The CMIS TCK is deactivated by default. -->
|
||||
<!-- CMISTCK
|
||||
<servlet-mapping>
|
||||
<servlet-name>cmistck</servlet-name>
|
||||
<url-pattern>/cmistck</url-pattern>
|
||||
</servlet-mapping>
|
||||
CMISTCK -->
|
||||
|
||||
<!-- Enterprise servlet-mapping placeholder -->
|
||||
|
||||
|
70
pom.xml
70
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>23.1.0.155</version>
|
||||
<version>23.1.0.169</version>
|
||||
<packaging>pom</packaging>
|
||||
<name>Alfresco Community Repo Parent</name>
|
||||
|
||||
@@ -54,21 +54,22 @@
|
||||
<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.acs-event-model.version>0.0.23</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.1</dependency.jackson.version>
|
||||
<dependency.jackson.version>2.15.2</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.44</dependency.webscripts.version>
|
||||
<dependency.webscripts.version>8.45</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>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.commons-io.version>2.13.0</dependency.commons-io.version>
|
||||
<dependency.gson.version>2.8.9</dependency.gson.version>
|
||||
<dependency.guava.version>32.1.1-jre</dependency.guava.version>
|
||||
<dependency.httpclient.version>4.5.13</dependency.httpclient.version>
|
||||
<dependency.httpcore.version>4.4.16</dependency.httpcore.version>
|
||||
<dependency.commons-httpclient.version>3.1-HTTPCLIENT-1265</dependency.commons-httpclient.version>
|
||||
@@ -76,23 +77,21 @@
|
||||
<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.groovy.version>3.0.18</dependency.groovy.version>
|
||||
<dependency.tika.version>2.4.1</dependency.tika.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>
|
||||
<dependency.jboss.logging.version>3.5.0.Final</dependency.jboss.logging.version>
|
||||
<dependency.camel.version>3.20.2</dependency.camel.version> <!-- when bumping this version, please keep track/sync with included netty.io dependencies -->
|
||||
<dependency.netty.version>4.1.87.Final</dependency.netty.version> <!-- must be in sync with camels transitive dependencies, e.g.: netty-common -->
|
||||
<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.camel.version>3.21.0</dependency.camel.version> <!-- when bumping this version, please keep track/sync with included netty.io dependencies -->
|
||||
<dependency.netty.version>4.1.95.Final</dependency.netty.version> <!-- must be in sync with camels transitive dependencies, e.g.: netty-common -->
|
||||
<dependency.activemq.version>5.17.4</dependency.activemq.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.66</dependency.swagger-parser.version>
|
||||
<dependency.swagger-parser.version>1.0.67</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>
|
||||
@@ -107,10 +106,10 @@
|
||||
<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.11</dependency.json-smart.version>
|
||||
<dependency.json-smart.version>2.5.0</dependency.json-smart.version>
|
||||
<dependency.jakarta-rpc-api.version>1.1.4</dependency.jakarta-rpc-api.version>
|
||||
|
||||
<alfresco.googledrive.version>3.4.1</alfresco.googledrive.version>
|
||||
<alfresco.googledrive.version>3.4.2-A4</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 -->
|
||||
|
||||
@@ -123,9 +122,9 @@
|
||||
<dependency.mariadb.version>2.7.4</dependency.mariadb.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-email.version>1.24</dependency.tas-email.version>
|
||||
<dependency.tas-webdav.version>1.20</dependency.tas-webdav.version>
|
||||
<dependency.tas-ftp.version>1.18</dependency.tas-ftp.version>
|
||||
<dependency.tas-dataprep.version>2.6</dependency.tas-dataprep.version>
|
||||
|
||||
<!-- AGS properties shared between community and enterprise -->
|
||||
@@ -149,7 +148,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>23.1.0.155</tag>
|
||||
<tag>23.1.0.169</tag>
|
||||
</scm>
|
||||
|
||||
<distributionManagement>
|
||||
@@ -359,7 +358,7 @@
|
||||
<dependency>
|
||||
<groupId>commons-codec</groupId>
|
||||
<artifactId>commons-codec</artifactId>
|
||||
<version>1.15</version>
|
||||
<version>1.16.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-lang</groupId>
|
||||
@@ -634,7 +633,7 @@
|
||||
<dependency>
|
||||
<groupId>com.github.junrar</groupId>
|
||||
<artifactId>junrar</artifactId>
|
||||
<version>7.5.4</version>
|
||||
<version>7.5.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.fge</groupId>
|
||||
@@ -771,6 +770,11 @@
|
||||
<artifactId>gson</artifactId>
|
||||
<version>${dependency.gson.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>${dependency.guava.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.camel</groupId>
|
||||
<artifactId>camel-core</artifactId>
|
||||
@@ -845,17 +849,6 @@
|
||||
<artifactId>camel-mock</artifactId>
|
||||
<version>${dependency.camel.version}</version>
|
||||
</dependency>
|
||||
<!-- Netty non-transitive dependencies declared for depending projects usage in conjunction with Camel's other transitive netty dependencies -->
|
||||
<dependency>
|
||||
<groupId>io.netty</groupId>
|
||||
<artifactId>netty-handler-proxy</artifactId>
|
||||
<version>${dependency.netty.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.netty</groupId>
|
||||
<artifactId>netty-tcnative-classes</artifactId>
|
||||
<version>${dependency.netty-tcnative.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.taglibs</groupId>
|
||||
@@ -886,7 +879,7 @@
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.18.26</version>
|
||||
<version>1.18.28</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@@ -900,6 +893,15 @@
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.netty</groupId>
|
||||
<artifactId>netty-bom</artifactId>
|
||||
<version>${dependency.netty.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.security</groupId>
|
||||
<artifactId>spring-security-bom</artifactId>
|
||||
@@ -955,7 +957,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<version>3.5.0</version>
|
||||
<version>3.6.0</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
@@ -1006,7 +1008,7 @@
|
||||
<plugin>
|
||||
<groupId>org.codehaus.cargo</groupId>
|
||||
<artifactId>cargo-maven3-plugin</artifactId>
|
||||
<version>1.10.7</version>
|
||||
<version>1.10.8</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
@@ -1017,4 +1019,4 @@
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
</project>
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>23.1.0.155</version>
|
||||
<version>23.1.0.169</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
@@ -102,18 +102,30 @@ public interface DeletedNodes
|
||||
CollectionWithPagingInfo<Rendition> getRenditions(String archivedId, Parameters parameters);
|
||||
|
||||
/**
|
||||
* Gets a presigned URL to directly access content.
|
||||
* Gets a presigned URL to directly access content.
|
||||
*
|
||||
* @param archivedId The node id for which to obtain the direct access {@code URL}
|
||||
* @param renditionId The rendition id for which to obtain the direct access {@code URL}
|
||||
* @param attachment {@code true} if an attachment {@code URL} is requested, {@code false} for an embedded {@code URL}, {@code true} by default.
|
||||
* @return A direct access {@code URL} object for the content.
|
||||
*/
|
||||
* @param archivedId The node id for which to obtain the direct access {@code URL}
|
||||
* @param renditionId The rendition id for which to obtain the direct access {@code URL}
|
||||
* @param attachment {@code true} if an attachment {@code URL} is requested, {@code false} for an embedded {@code URL}, {@code true} by default.
|
||||
* @return A direct access {@code URL} object for the content.
|
||||
*/
|
||||
default DirectAccessUrl requestContentDirectUrl(String archivedId, String renditionId, boolean attachment)
|
||||
{
|
||||
return requestContentDirectUrl(archivedId, renditionId, attachment, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param archivedId The node id for which to obtain the direct access {@code URL}
|
||||
* @param renditionId The rendition id for which to obtain the direct access {@code URL}
|
||||
* @param attachment {@code true} if an attachment {@code URL} is requested, {@code false} for an embedded {@code URL}, {@code true} by default.
|
||||
* @param validFor The time at which the direct access {@code URL} will expire.
|
||||
* @return A direct access {@code URL} object for the content.
|
||||
*/
|
||||
default DirectAccessUrl requestContentDirectUrl(String archivedId, String renditionId, boolean attachment, Long validFor)
|
||||
{
|
||||
return requestContentDirectUrl(archivedId, renditionId, attachment, validFor, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a presigned URL to directly access content.
|
||||
*
|
||||
@@ -121,8 +133,9 @@ public interface DeletedNodes
|
||||
* @param renditionId The rendition id for which to obtain the direct access {@code URL}
|
||||
* @param attachment {@code true} if an attachment {@code URL} is requested, {@code false} for an embedded {@code URL}, {@code true} by default.
|
||||
* @param validFor The time at which the direct access {@code URL} will expire.
|
||||
* @param fileName Optional overide for file name
|
||||
* @return A direct access {@code URL} object for the content.
|
||||
*/
|
||||
DirectAccessUrl requestContentDirectUrl(String archivedId, String renditionId, boolean attachment, Long validFor);
|
||||
DirectAccessUrl requestContentDirectUrl(String archivedId, String renditionId, boolean attachment, Long validFor, String fileName);
|
||||
|
||||
}
|
||||
|
@@ -63,4 +63,10 @@ public class DirectAccessUrlHelper
|
||||
}
|
||||
return attachment;
|
||||
}
|
||||
|
||||
|
||||
public String getFileName(DirectAccessUrlRequest directAccessUrlRequest)
|
||||
{
|
||||
return directAccessUrlRequest != null ? directAccessUrlRequest.getFileName() : null;
|
||||
}
|
||||
}
|
||||
|
@@ -323,7 +323,20 @@ public interface Nodes
|
||||
* @param validFor The time at which the direct access {@code URL} will expire.
|
||||
* @return A direct access {@code URL} object for the content.
|
||||
*/
|
||||
DirectAccessUrl requestContentDirectUrl(NodeRef nodeRef, boolean attachment, Long validFor);
|
||||
default DirectAccessUrl requestContentDirectUrl(NodeRef nodeRef, boolean attachment, Long validFor)
|
||||
{
|
||||
return requestContentDirectUrl(nodeRef, attachment, validFor, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a presigned URL to directly access content.
|
||||
* @param nodeRef The node reference for which to obtain the direct access {@code URL}
|
||||
* @param attachment {@code true} if an attachment {@code URL} is requested, {@code false} for an embedded {@code URL}.
|
||||
* @param validFor The time at which the direct access {@code URL} will expire.
|
||||
* @param fileName Optional name for the file when downloaded
|
||||
* @return A direct access {@code URL} object for the content.
|
||||
*/
|
||||
DirectAccessUrl requestContentDirectUrl(NodeRef nodeRef, boolean attachment, Long validFor, String fileName);
|
||||
|
||||
/**
|
||||
* Convert from node properties (map of QName to Serializable) retrieved from
|
||||
|
@@ -251,7 +251,6 @@ public interface Renditions
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a presigned URL to directly access content.
|
||||
* @param nodeRef the node reference for which to obtain the direct access {@code URL}
|
||||
* @param versionId the version id (aka version label)
|
||||
* @param renditionId the rendition id
|
||||
@@ -259,6 +258,21 @@ public interface Renditions
|
||||
* @param validFor the time at which the direct access {@code URL} will expire
|
||||
* @return a direct access {@code URL} object for the content.
|
||||
*/
|
||||
DirectAccessUrl requestContentDirectUrl(NodeRef nodeRef, String versionId, String renditionId, boolean attachment, Long validFor);
|
||||
default DirectAccessUrl requestContentDirectUrl(NodeRef nodeRef, String versionId, String renditionId, boolean attachment, Long validFor)
|
||||
{
|
||||
return requestContentDirectUrl(nodeRef, versionId, renditionId, attachment, validFor, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a presigned URL to directly access content.
|
||||
* @param nodeRef the node reference for which to obtain the direct access {@code URL}
|
||||
* @param versionId the version id (aka version label)
|
||||
* @param renditionId the rendition id
|
||||
* @param attachment {@code true} if an attachment {@code URL} is requested, {@code false} for an embedded {@code URL}
|
||||
* @param validFor the time at which the direct access {@code URL} will expire
|
||||
* @param fileName optional name for the file when downloaded
|
||||
* @return a direct access {@code URL} object for the content.
|
||||
*/
|
||||
DirectAccessUrl requestContentDirectUrl(NodeRef nodeRef, String versionId, String renditionId, boolean attachment, Long validFor, String fileName);
|
||||
}
|
||||
|
||||
|
@@ -250,18 +250,18 @@ public class DeletedNodesImpl implements DeletedNodes, RecognizedParamsExtractor
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public DirectAccessUrl requestContentDirectUrl(String originalNodeId, String renditionId, boolean attachment, Long validFor)
|
||||
public DirectAccessUrl requestContentDirectUrl(String originalNodeId, String renditionId, boolean attachment, Long validFor, String fileName)
|
||||
{
|
||||
//First check the node is valid and has been archived.
|
||||
NodeRef validatedNodeRef = nodes.validateNode(StoreRef.STORE_REF_ARCHIVE_SPACESSTORE, originalNodeId);
|
||||
|
||||
if (renditionId != null)
|
||||
{
|
||||
return renditions.requestContentDirectUrl(validatedNodeRef, null, renditionId, attachment, validFor);
|
||||
return renditions.requestContentDirectUrl(validatedNodeRef, null, renditionId, attachment, validFor, fileName);
|
||||
}
|
||||
else
|
||||
{
|
||||
return nodes.requestContentDirectUrl(validatedNodeRef, attachment, validFor);
|
||||
return nodes.requestContentDirectUrl(validatedNodeRef, attachment, validFor, fileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -25,13 +25,14 @@
|
||||
*/
|
||||
package org.alfresco.rest.api.impl;
|
||||
|
||||
import static org.alfresco.rest.api.Nodes.PARAM_INCLUDE_ALLOWABLEOPERATIONS;
|
||||
|
||||
import java.util.AbstractList;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
@@ -76,6 +77,7 @@ import org.alfresco.service.cmr.site.SiteService;
|
||||
import org.alfresco.service.namespace.NamespaceService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.util.Pair;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
@@ -89,7 +91,9 @@ public class FavouritesImpl implements Favourites
|
||||
{
|
||||
private static final Log logger = LogFactory.getLog(FavouritesImpl.class);
|
||||
|
||||
private People people;
|
||||
private static final List<String> ALLOWED_INCLUDES = List.of(PARAM_INCLUDE_PROPERTIES, PARAM_INCLUDE_ALLOWABLEOPERATIONS);
|
||||
|
||||
private People people;
|
||||
private Sites sites;
|
||||
private Nodes nodes;
|
||||
private FavouritesService favouritesService;
|
||||
@@ -175,18 +179,23 @@ public class FavouritesImpl implements Favourites
|
||||
fav.setTarget(target);
|
||||
|
||||
// REPO-1147 allow retrieving additional properties
|
||||
if (parameters.getInclude().contains(PARAM_INCLUDE_PROPERTIES))
|
||||
final List<String> paramsInclude = parameters.getInclude();
|
||||
if (!Collections.disjoint(paramsInclude, ALLOWED_INCLUDES))
|
||||
{
|
||||
List<String> includeProperties = new LinkedList<>();
|
||||
includeProperties.add(PARAM_INCLUDE_PROPERTIES);
|
||||
final List<String> includes = ALLOWED_INCLUDES.stream().filter(a -> paramsInclude.contains(a)).collect(Collectors.toList());
|
||||
// get node representation with only properties included
|
||||
Node node = nodes.getFolderOrDocument(personFavourite.getNodeRef(), null, null, includeProperties, null);
|
||||
Node node = nodes.getFolderOrDocument(personFavourite.getNodeRef(), null, null, includes, null);
|
||||
// Create a map from node properties excluding properties already in this Favorite
|
||||
Map<String, Object> filteredNodeProperties = filterProps(node.getProperties(), EXCLUDED_PROPS);
|
||||
if(filteredNodeProperties.size() > 0)
|
||||
if(filteredNodeProperties.size() > 0 && paramsInclude.contains(PARAM_INCLUDE_PROPERTIES))
|
||||
{
|
||||
fav.setProperties(filteredNodeProperties);
|
||||
}
|
||||
final List<String> allowableOperations = node.getAllowableOperations();
|
||||
if (CollectionUtils.isNotEmpty(allowableOperations) && paramsInclude.contains(PARAM_INCLUDE_ALLOWABLEOPERATIONS))
|
||||
{
|
||||
fav.setAllowableOperations(allowableOperations);
|
||||
}
|
||||
}
|
||||
|
||||
return fav;
|
||||
|
@@ -3443,9 +3443,9 @@ public class NodesImpl implements Nodes
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public DirectAccessUrl requestContentDirectUrl(NodeRef nodeRef, boolean attachment, Long validFor)
|
||||
public DirectAccessUrl requestContentDirectUrl(NodeRef nodeRef, boolean attachment, Long validFor, String fileName)
|
||||
{
|
||||
DirectAccessUrl directAccessUrl = contentService.requestContentDirectUrl(nodeRef, ContentModel.PROP_CONTENT, attachment, validFor);
|
||||
DirectAccessUrl directAccessUrl = contentService.requestContentDirectUrl(nodeRef, ContentModel.PROP_CONTENT, attachment, validFor, fileName);
|
||||
if (directAccessUrl == null)
|
||||
{
|
||||
throw new DisabledServiceException("Direct access url isn't available.");
|
||||
|
@@ -512,7 +512,7 @@ public class RenditionsImpl implements Renditions, ResourceLoaderAware
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public DirectAccessUrl requestContentDirectUrl(NodeRef nodeRef, String versionId, String renditionId, boolean attachment, Long validFor)
|
||||
public DirectAccessUrl requestContentDirectUrl(NodeRef nodeRef, String versionId, String renditionId, boolean attachment, Long validFor, String fileName)
|
||||
{
|
||||
final NodeRef validatedNodeRef = validateNode(nodeRef.getStoreRef(), nodeRef.getId(), versionId, null);
|
||||
NodeRef renditionNodeRef = getRenditionByName(validatedNodeRef, renditionId, null);
|
||||
@@ -522,7 +522,7 @@ public class RenditionsImpl implements Renditions, ResourceLoaderAware
|
||||
throw new NotFoundException("The rendition with id: " + renditionId + " was not found.");
|
||||
}
|
||||
|
||||
return nodes.requestContentDirectUrl(renditionNodeRef, attachment, validFor);
|
||||
return nodes.requestContentDirectUrl(renditionNodeRef, attachment, validFor, fileName);
|
||||
}
|
||||
|
||||
private BinaryResource getContentImpl(NodeRef nodeRef, String renditionId, Parameters parameters)
|
||||
|
@@ -33,6 +33,7 @@ package org.alfresco.rest.api.model;
|
||||
public class DirectAccessUrlRequest
|
||||
{
|
||||
private Boolean attachment;
|
||||
private String fileName;
|
||||
|
||||
public Boolean isAttachment()
|
||||
{
|
||||
@@ -43,4 +44,14 @@ public class DirectAccessUrlRequest
|
||||
{
|
||||
this.attachment = attachment;
|
||||
}
|
||||
|
||||
public String getFileName()
|
||||
{
|
||||
return fileName;
|
||||
}
|
||||
|
||||
public void setFileName(String fileName)
|
||||
{
|
||||
this.fileName = fileName;
|
||||
}
|
||||
}
|
||||
|
@@ -26,6 +26,7 @@
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.rest.framework.resource.UniqueId;
|
||||
@@ -42,6 +43,7 @@ public class Favourite
|
||||
private Date createdAt;
|
||||
private Target target;
|
||||
private Map<String, Object> properties;
|
||||
private List<String> allowableOperations;
|
||||
|
||||
public Date getCreatedAt()
|
||||
{
|
||||
@@ -84,10 +86,18 @@ public class Favourite
|
||||
this.properties = properties;
|
||||
}
|
||||
|
||||
public List<String> getAllowableOperations() {
|
||||
return allowableOperations;
|
||||
}
|
||||
|
||||
public void setAllowableOperations(List<String> allowableOperations) {
|
||||
this.allowableOperations = allowableOperations;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "Favourite [targetGuid=" + targetGuid
|
||||
+ ", createdAt=" + createdAt + ", target=" + target + ", properties=" + properties + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -137,12 +137,13 @@ public class NodeRenditionsRelation implements RelationshipResourceAction.Read<R
|
||||
{
|
||||
boolean attachment = directAccessUrlHelper.getAttachment(directAccessUrlRequest);
|
||||
Long validFor = directAccessUrlHelper.getDefaultExpiryTimeInSec();
|
||||
String fileName = directAccessUrlHelper.getFileName(directAccessUrlRequest);
|
||||
NodeRef nodeRef = new NodeRef(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, nodeId);
|
||||
|
||||
DirectAccessUrl directAccessUrl;
|
||||
try
|
||||
{
|
||||
directAccessUrl = renditions.requestContentDirectUrl(nodeRef, null, renditionId, attachment, validFor);
|
||||
directAccessUrl = renditions.requestContentDirectUrl(nodeRef, null, renditionId, attachment, validFor, fileName);
|
||||
}
|
||||
catch (DirectAccessUrlDisabledException ex)
|
||||
{
|
||||
|
@@ -149,13 +149,14 @@ public class NodeVersionRenditionsRelation implements RelationshipResourceAction
|
||||
{
|
||||
boolean attachment = directAccessUrlHelper.getAttachment(directAccessUrlRequest);
|
||||
Long validFor = directAccessUrlHelper.getDefaultExpiryTimeInSec();
|
||||
String fileName = directAccessUrlHelper.getFileName(directAccessUrlRequest);
|
||||
NodeRef nodeRef = new NodeRef(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, nodeId);
|
||||
String renditionId = parameters.getRelationship2Id();
|
||||
|
||||
DirectAccessUrl directAccessUrl;
|
||||
try
|
||||
{
|
||||
directAccessUrl = renditions.requestContentDirectUrl(nodeRef, versionId, renditionId, attachment, validFor);
|
||||
directAccessUrl = renditions.requestContentDirectUrl(nodeRef, versionId, renditionId, attachment, validFor, fileName);
|
||||
}
|
||||
catch (DirectAccessUrlDisabledException ex)
|
||||
{
|
||||
|
@@ -311,6 +311,7 @@ public class NodeVersionsRelation extends AbstractNodeRelation implements
|
||||
{
|
||||
boolean attachment = directAccessUrlHelper.getAttachment(directAccessUrlRequest);
|
||||
Long validFor = directAccessUrlHelper.getDefaultExpiryTimeInSec();
|
||||
String fileName = directAccessUrlHelper.getFileName(directAccessUrlRequest);
|
||||
Version version = findVersion(nodeId, versionId);
|
||||
if (version != null)
|
||||
{
|
||||
@@ -319,7 +320,7 @@ public class NodeVersionsRelation extends AbstractNodeRelation implements
|
||||
DirectAccessUrl directAccessUrl;
|
||||
try
|
||||
{
|
||||
directAccessUrl = nodes.requestContentDirectUrl(versionNodeRef, attachment, validFor);
|
||||
directAccessUrl = nodes.requestContentDirectUrl(versionNodeRef, attachment, validFor, fileName);
|
||||
}
|
||||
catch (DirectAccessUrlDisabledException ex)
|
||||
{
|
||||
|
@@ -211,12 +211,13 @@ public class NodesEntityResource implements
|
||||
{
|
||||
boolean attachment = directAccessUrlHelper.getAttachment(directAccessUrlRequest);
|
||||
Long validFor = directAccessUrlHelper.getDefaultExpiryTimeInSec();
|
||||
String fileName = directAccessUrlHelper.getFileName(directAccessUrlRequest);
|
||||
NodeRef nodeRef = nodes.validateNode(nodeId);
|
||||
|
||||
DirectAccessUrl directAccessUrl;
|
||||
try
|
||||
{
|
||||
directAccessUrl = nodes.requestContentDirectUrl(nodeRef, attachment, validFor);
|
||||
directAccessUrl = nodes.requestContentDirectUrl(nodeRef, attachment, validFor, fileName);
|
||||
}
|
||||
catch (DirectAccessUrlDisabledException ex)
|
||||
{
|
||||
|
@@ -31,6 +31,7 @@ import static java.util.stream.Collectors.toList;
|
||||
import static org.alfresco.rest.api.Nodes.PARAM_INCLUDE_ALLOWABLEOPERATIONS;
|
||||
import static org.alfresco.rest.api.Nodes.PARAM_INCLUDE_ASPECTNAMES;
|
||||
import static org.alfresco.rest.api.Nodes.PARAM_INCLUDE_ASSOCIATION;
|
||||
import static org.alfresco.rest.api.Nodes.PARAM_INCLUDE_ISFAVORITE;
|
||||
import static org.alfresco.rest.api.Nodes.PARAM_INCLUDE_ISLINK;
|
||||
import static org.alfresco.rest.api.Nodes.PARAM_INCLUDE_ISLOCKED;
|
||||
import static org.alfresco.rest.api.Nodes.PARAM_INCLUDE_PATH;
|
||||
@@ -96,10 +97,9 @@ import java.util.stream.Collectors;
|
||||
*/
|
||||
public class SearchMapper
|
||||
{
|
||||
public static final List<String> PERMITTED_INCLUDES
|
||||
= Arrays.asList(PARAM_INCLUDE_ALLOWABLEOPERATIONS,PARAM_INCLUDE_ASPECTNAMES,
|
||||
PARAM_INCLUDE_ISLINK, PARAM_INCLUDE_PATH, PARAM_INCLUDE_PROPERTIES,
|
||||
PARAM_INCLUDE_ASSOCIATION, PARAM_INCLUDE_ISLOCKED, PARAM_INCLUDE_PERMISSIONS);
|
||||
public static final List<String> PERMITTED_INCLUDES = Arrays.asList(PARAM_INCLUDE_ALLOWABLEOPERATIONS,PARAM_INCLUDE_ASPECTNAMES,
|
||||
PARAM_INCLUDE_ISLINK, PARAM_INCLUDE_PATH, PARAM_INCLUDE_PROPERTIES, PARAM_INCLUDE_ASSOCIATION,
|
||||
PARAM_INCLUDE_ISLOCKED, PARAM_INCLUDE_PERMISSIONS, PARAM_INCLUDE_ISFAVORITE);
|
||||
|
||||
public static final String CMIS = "cmis";
|
||||
public static final String LUCENE = "lucene";
|
||||
@@ -823,6 +823,11 @@ public class SearchMapper
|
||||
sp.setLimitBy(LimitBy.NUMBER_OF_PERMISSION_EVALUATIONS);
|
||||
sp.setMaxPermissionCheckTimeMillis(limits.getPermissionEvaluationTime());
|
||||
}
|
||||
|
||||
if(limits.getTrackTotalHitsLimit() != null)
|
||||
{
|
||||
sp.setTrackTotalHits(limits.getTrackTotalHitsLimit());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -37,13 +37,16 @@ public class Limits
|
||||
|
||||
private final Integer permissionEvaluationTime;
|
||||
private final Integer permissionEvaluationCount;
|
||||
private final Integer trackTotalHitsLimit;
|
||||
|
||||
@JsonCreator
|
||||
public Limits(@JsonProperty("permissionEvaluationTime") Integer permissionEvaluationTime,
|
||||
@JsonProperty("permissionEvaluationCount") Integer permissionEvaluationCount)
|
||||
@JsonProperty("permissionEvaluationCount") Integer permissionEvaluationCount,
|
||||
@JsonProperty("trackTotalHitsLimit") Integer trackTotalHitsLimit)
|
||||
{
|
||||
this.permissionEvaluationTime = permissionEvaluationTime;
|
||||
this.permissionEvaluationCount = permissionEvaluationCount;
|
||||
this.trackTotalHitsLimit = trackTotalHitsLimit;
|
||||
}
|
||||
|
||||
public Integer getPermissionEvaluationTime()
|
||||
@@ -55,4 +58,9 @@ public class Limits
|
||||
{
|
||||
return permissionEvaluationCount;
|
||||
}
|
||||
|
||||
public Integer getTrackTotalHitsLimit()
|
||||
{
|
||||
return trackTotalHitsLimit;
|
||||
}
|
||||
}
|
||||
|
@@ -109,10 +109,11 @@ public class TrashcanEntityResource implements
|
||||
{
|
||||
boolean attachment = directAccessUrlHelper.getAttachment(directAccessUrlRequest);
|
||||
Long validFor = directAccessUrlHelper.getDefaultExpiryTimeInSec();
|
||||
String fileName = directAccessUrlHelper.getFileName(directAccessUrlRequest);
|
||||
DirectAccessUrl directAccessUrl;
|
||||
try
|
||||
{
|
||||
directAccessUrl = deletedNodes.requestContentDirectUrl(originalNodeId, null, attachment, validFor);
|
||||
directAccessUrl = deletedNodes.requestContentDirectUrl(originalNodeId, null, attachment, validFor, fileName);
|
||||
}
|
||||
catch (DirectAccessUrlDisabledException ex)
|
||||
{
|
||||
|
@@ -98,10 +98,11 @@ public class TrashcanRenditionsRelation
|
||||
{
|
||||
boolean attachment = directAccessUrlHelper.getAttachment(directAccessUrlRequest);
|
||||
Long validFor = directAccessUrlHelper.getDefaultExpiryTimeInSec();
|
||||
String fileName = directAccessUrlHelper.getFileName(directAccessUrlRequest);
|
||||
DirectAccessUrl directAccessUrl;
|
||||
try
|
||||
{
|
||||
directAccessUrl = deletedNodes.requestContentDirectUrl(originalNodeId, renditionId, attachment, validFor);
|
||||
directAccessUrl = deletedNodes.requestContentDirectUrl(originalNodeId, renditionId, attachment, validFor, fileName);
|
||||
}
|
||||
catch (DirectAccessUrlDisabledException ex)
|
||||
{
|
||||
|
@@ -32,6 +32,7 @@ import static junit.framework.TestCase.fail;
|
||||
import static org.alfresco.rest.api.Nodes.PARAM_INCLUDE_ALLOWABLEOPERATIONS;
|
||||
import static org.alfresco.rest.api.Nodes.PARAM_INCLUDE_ASPECTNAMES;
|
||||
import static org.alfresco.rest.api.Nodes.PARAM_INCLUDE_ASSOCIATION;
|
||||
import static org.alfresco.rest.api.Nodes.PARAM_INCLUDE_ISFAVORITE;
|
||||
import static org.alfresco.rest.api.Nodes.PARAM_INCLUDE_ISLINK;
|
||||
import static org.alfresco.rest.api.Nodes.PARAM_INCLUDE_ISLOCKED;
|
||||
import static org.alfresco.rest.api.Nodes.PARAM_INCLUDE_PATH;
|
||||
@@ -300,7 +301,7 @@ public class SearchMapperTests
|
||||
{
|
||||
searchMapper.validateInclude(Arrays.asList(PARAM_INCLUDE_ALLOWABLEOPERATIONS,PARAM_INCLUDE_ASPECTNAMES,
|
||||
PARAM_INCLUDE_ISLINK, PARAM_INCLUDE_PATH, PARAM_INCLUDE_PROPERTIES,
|
||||
PARAM_INCLUDE_ASSOCIATION, PARAM_INCLUDE_ISLOCKED, PARAM_INCLUDE_PERMISSIONS));
|
||||
PARAM_INCLUDE_ASSOCIATION, PARAM_INCLUDE_ISLOCKED, PARAM_INCLUDE_PERMISSIONS, PARAM_INCLUDE_ISFAVORITE));
|
||||
}
|
||||
|
||||
|
||||
@@ -745,33 +746,56 @@ public class SearchMapperTests
|
||||
}
|
||||
|
||||
@Test
|
||||
public void fromLimits() throws Exception
|
||||
public void fromLimits_setNull() throws Exception
|
||||
{
|
||||
SearchParameters searchParameters = new SearchParameters();
|
||||
searchMapper.setDefaults(searchParameters);
|
||||
|
||||
//Doesn't error
|
||||
searchMapper.fromLimits(searchParameters, null);
|
||||
assertEquals(500, searchParameters.getLimit());
|
||||
assertEquals(LimitBy.UNLIMITED, searchParameters.getLimitBy());
|
||||
assertEquals("LimitBy default value should be unlimited", LimitBy.UNLIMITED, searchParameters.getLimitBy());
|
||||
assertEquals("Limit default value should be 500", 500, searchParameters.getLimit());
|
||||
}
|
||||
|
||||
searchMapper.fromLimits(searchParameters, new Limits(null, null));
|
||||
assertEquals(LimitBy.UNLIMITED, searchParameters.getLimitBy());
|
||||
assertEquals(500, searchParameters.getLimit());
|
||||
|
||||
searchMapper.fromLimits(searchParameters, new Limits(null, 34));
|
||||
assertEquals(LimitBy.NUMBER_OF_PERMISSION_EVALUATIONS, searchParameters.getLimitBy());
|
||||
assertEquals(34, searchParameters.getMaxPermissionChecks());
|
||||
assertEquals(-1, searchParameters.getLimit());
|
||||
assertEquals(-1, searchParameters.getMaxPermissionCheckTimeMillis());
|
||||
|
||||
searchParameters = new SearchParameters();
|
||||
@Test
|
||||
public void fromLimits_setAllLimitsAsNull() throws Exception
|
||||
{
|
||||
SearchParameters searchParameters = new SearchParameters();
|
||||
searchMapper.setDefaults(searchParameters);
|
||||
searchMapper.fromLimits(searchParameters, new Limits(1000, null));
|
||||
searchMapper.fromLimits(searchParameters, new Limits(null, null, null));
|
||||
assertEquals("LimitBy default value should be unlimited", LimitBy.UNLIMITED, searchParameters.getLimitBy());
|
||||
assertEquals("Limit default value should be 500", 500, searchParameters.getLimit());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void fromLimits_setPermissionEvaluationCount() throws Exception
|
||||
{
|
||||
SearchParameters searchParameters = new SearchParameters();
|
||||
searchMapper.setDefaults(searchParameters);
|
||||
searchMapper.fromLimits(searchParameters, new Limits(null, 34, null));
|
||||
assertEquals(LimitBy.NUMBER_OF_PERMISSION_EVALUATIONS, searchParameters.getLimitBy());
|
||||
assertEquals(1000, searchParameters.getMaxPermissionCheckTimeMillis());
|
||||
assertEquals(-1, searchParameters.getLimit());
|
||||
assertEquals(-1, searchParameters.getMaxPermissionChecks());
|
||||
assertEquals("MaxPermissionChecks should be set", 34, searchParameters.getMaxPermissionChecks());
|
||||
assertEquals("Limit should be -1", -1, searchParameters.getLimit());
|
||||
assertEquals("MaxPermissionCheckTimeMillis should be -1", -1, searchParameters.getMaxPermissionCheckTimeMillis());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void fromLimits_setPermissionEvaluationTime() throws Exception
|
||||
{
|
||||
SearchParameters searchParameters = new SearchParameters();
|
||||
searchMapper.setDefaults(searchParameters);
|
||||
searchMapper.fromLimits(searchParameters, new Limits(1000, null, null));
|
||||
assertEquals(LimitBy.NUMBER_OF_PERMISSION_EVALUATIONS, searchParameters.getLimitBy());
|
||||
assertEquals("MaxPermissionCheckTimeMillis should be set", 1000, searchParameters.getMaxPermissionCheckTimeMillis());
|
||||
assertEquals("Limit should be -1", -1, searchParameters.getLimit());
|
||||
assertEquals("MaxPermissionChecks should be -1", -1, searchParameters.getMaxPermissionChecks());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void fromLimits_setTrackTotalHitsLimit() throws Exception
|
||||
{
|
||||
SearchParameters searchParameters = new SearchParameters();
|
||||
searchMapper.setDefaults(searchParameters);
|
||||
searchMapper.fromLimits(searchParameters, new Limits(null, null, 10));
|
||||
assertEquals("TrackTotalHits should be set", 10, searchParameters.getTrackTotalHits());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>23.1.0.155</version>
|
||||
<version>23.1.0.169</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
@@ -44,6 +44,7 @@ import java.util.zip.ZipException;
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.model.ApplicationModel;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.action.ActionServiceImpl;
|
||||
import org.alfresco.repo.action.ParameterDefinitionImpl;
|
||||
import org.alfresco.repo.content.MimetypeMap;
|
||||
import org.alfresco.repo.importer.ACPImportPackageHandler;
|
||||
@@ -65,6 +66,8 @@ import org.alfresco.util.TempFileProvider;
|
||||
import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
|
||||
import org.apache.commons.compress.archivers.zip.ZipFile;
|
||||
import org.apache.commons.compress.utils.InputStreamStatistics;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
/**
|
||||
* Importer action executor
|
||||
@@ -73,6 +76,7 @@ import org.apache.commons.compress.utils.InputStreamStatistics;
|
||||
*/
|
||||
public class ImporterActionExecuter extends ActionExecuterAbstractBase
|
||||
{
|
||||
private static Log logger = LogFactory.getLog(ImporterActionExecuter.class);
|
||||
public static final String NAME = "import";
|
||||
public static final String PARAM_ENCODING = "encoding";
|
||||
public static final String PARAM_DESTINATION_FOLDER = "destination";
|
||||
@@ -242,17 +246,21 @@ public class ImporterActionExecuter extends ActionExecuterAbstractBase
|
||||
// http://bugs.sun.com/bugdatabase/view_bug.do;:WuuT?bug_id=4820807
|
||||
// We also try to use the extra encoding information if present
|
||||
String encoding = (String) ruleAction.getParameterValue(PARAM_ENCODING);
|
||||
logger.info("Encoding before: "+encoding);
|
||||
if (encoding == null)
|
||||
{
|
||||
logger.info("Encoding is null ");
|
||||
encoding = "Cp437";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (encoding.equalsIgnoreCase("default"))
|
||||
{
|
||||
encoding = null;
|
||||
logger.info("Encoding is default ");
|
||||
encoding = "Cp437";
|
||||
}
|
||||
}
|
||||
logger.info("Encoding after: "+encoding);
|
||||
zipFile = new ZipFile(tempFile, encoding, true);
|
||||
// build a temp dir name based on the ID of the noderef we are importing
|
||||
// also use the long life temp folder as large ZIP files can take a while
|
||||
|
@@ -65,6 +65,7 @@ import org.alfresco.service.cmr.usage.ContentQuotaException;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.util.EqualsHelper;
|
||||
import org.alfresco.util.TempFileProvider;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.beans.BeansException;
|
||||
@@ -627,7 +628,7 @@ public class ContentServiceImpl implements ContentService, ApplicationContextAwa
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public DirectAccessUrl requestContentDirectUrl(NodeRef nodeRef, QName propertyQName, boolean attachment, Long validFor)
|
||||
public DirectAccessUrl requestContentDirectUrl(NodeRef nodeRef, QName propertyQName, boolean attachment, Long validFor, String fileNameOverride)
|
||||
{
|
||||
if (!systemWideDirectUrlConfig.isEnabled())
|
||||
{
|
||||
@@ -643,7 +644,7 @@ public class ContentServiceImpl implements ContentService, ApplicationContextAwa
|
||||
|
||||
String contentUrl = contentData.getContentUrl();
|
||||
String contentMimetype = contentData.getMimetype();
|
||||
String fileName = getFileName(nodeRef);
|
||||
String fileName = StringUtils.isEmpty(fileNameOverride) ? getFileName(nodeRef) : fileNameOverride;
|
||||
|
||||
validFor = adjustValidFor(validFor);
|
||||
attachment = adjustAttachment(nodeRef, contentMimetype, attachment);
|
||||
|
@@ -368,7 +368,10 @@ public class DocumentLinkServiceImpl implements DocumentLinkService, NodeService
|
||||
public void beforeDeleteLinkNode(NodeRef linkNodeRef)
|
||||
{
|
||||
final NodeRef nodeRef = getLinkDestination(linkNodeRef);
|
||||
|
||||
if (nodeRef == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
List<Long> nodeRefLinks = getNodeLinksIds(nodeRef);
|
||||
|
||||
long linkNodeId = (Long) nodeService.getProperty(linkNodeRef, ContentModel.PROP_NODE_DBID);
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Repository
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2022 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2023 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
@@ -26,8 +26,8 @@
|
||||
|
||||
package org.alfresco.repo.virtual.bundle;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Serializable;
|
||||
import java.io.UncheckedIOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
@@ -910,7 +910,7 @@ public class VirtualNodeServiceExtension extends VirtualSpringBeanExtension<Node
|
||||
|
||||
return result;
|
||||
}
|
||||
catch (IOException e)
|
||||
catch (UncheckedIOException e)
|
||||
{
|
||||
throw new VirtualizationException(e);
|
||||
}
|
||||
@@ -968,7 +968,7 @@ public class VirtualNodeServiceExtension extends VirtualSpringBeanExtension<Node
|
||||
}
|
||||
writer.putContent(text);
|
||||
}
|
||||
catch (IOException e)
|
||||
catch (UncheckedIOException e)
|
||||
{
|
||||
throw new ActualEnvironmentException(e);
|
||||
}
|
||||
|
@@ -245,7 +245,25 @@ public interface ContentService
|
||||
* @throws UnsupportedOperationException if the store is unable to provide the information.
|
||||
*/
|
||||
@Auditable(parameters = {"nodeRef", "propertyQName", "validFor"})
|
||||
DirectAccessUrl requestContentDirectUrl(NodeRef nodeRef, QName propertyQName, boolean attachment, Long validFor);
|
||||
default DirectAccessUrl requestContentDirectUrl(NodeRef nodeRef, QName propertyQName, boolean attachment, Long validFor)
|
||||
{
|
||||
return requestContentDirectUrl(nodeRef, propertyQName, attachment, validFor, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a presigned URL to directly access the content. It is up to the actual store
|
||||
* implementation if it can fulfil this request with an expiry time or not.
|
||||
*
|
||||
* @param nodeRef Node ref for which to obtain the direct access {@code URL}.
|
||||
* @param propertyQName the name of the property, which must be of type <b>content</b>
|
||||
* @param attachment {@code true} if an attachment URL is requested, {@code false} for an embedded {@code URL}.
|
||||
* @param validFor The time at which the direct access {@code URL} will expire.
|
||||
* @param fileName Optional name for the file when downloaded
|
||||
* @return A direct access {@code URL} object for the content.
|
||||
* @throws UnsupportedOperationException if the store is unable to provide the information.
|
||||
*/
|
||||
@Auditable(parameters = {"nodeRef", "propertyQName", "validFor"})
|
||||
DirectAccessUrl requestContentDirectUrl(NodeRef nodeRef, QName propertyQName, boolean attachment, Long validFor, String fileName);
|
||||
|
||||
/**
|
||||
* Gets a key-value (String-String) collection of storage headers/properties with their respective values for a specific node reference.
|
||||
|
@@ -72,7 +72,8 @@ public class ContentServiceImplUnitTest
|
||||
|
||||
private static final NodeRef NODE_REF = new NodeRef("content://Node/Ref");
|
||||
public static final String SOME_CONTENT_URL = "someContentUrl";
|
||||
private static final NodeRef NODE_REF_2 = new NodeRef("content://Node/Ref2");;
|
||||
private static final NodeRef NODE_REF_2 = new NodeRef("content://Node/Ref2");
|
||||
public static final String SOME_FILE_NAME = "someFilename";
|
||||
|
||||
private static final String X_AMZ_HEADER_1 = "x-amz-header1";
|
||||
private static final String VALUE_1 = "value1";
|
||||
@@ -103,7 +104,7 @@ public class ContentServiceImplUnitTest
|
||||
when(mockNodeService.getProperty(NODE_REF, ContentModel.PROP_CONTENT)).thenReturn(mockContentData);
|
||||
when(mockContentData.getContentUrl()).thenReturn(SOME_CONTENT_URL);
|
||||
when(mockContentData.getMimetype()).thenReturn("someMimetype");
|
||||
when(mockNodeService.getProperty(NODE_REF, ContentModel.PROP_NAME)).thenReturn("someFilename");
|
||||
when(mockNodeService.getProperty(NODE_REF, ContentModel.PROP_NAME)).thenReturn(SOME_FILE_NAME);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -162,6 +163,40 @@ public class ContentServiceImplUnitTest
|
||||
verify(mockContentStore, times(1)).requestContentDirectUrl(anyString(), eq(true), anyString(), anyString(), anyLong());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRequestContentDirectUrl_StoreRequestContentDirectUrlIsCalledWithFileNameOverride()
|
||||
{
|
||||
final String fileNameOverride = "fileNameOverride.txt";
|
||||
setupSystemWideDirectAccessConfig(ENABLED);
|
||||
when(mockContentStore.isContentDirectUrlEnabled()).thenReturn(ENABLED);
|
||||
|
||||
DirectAccessUrl directAccessUrl = contentService.requestContentDirectUrl(NODE_REF, PROP_CONTENT_QNAME, true, 20L, fileNameOverride);
|
||||
assertNull(directAccessUrl);
|
||||
verify(mockContentStore, times(1)).requestContentDirectUrl(anyString(), eq(true), eq(fileNameOverride), anyString(), anyLong());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRequestContentDirectUrl_StoreRequestContentDirectUrlIsCalledWithNodeNamePropertyWhenFileNameOverrideIsNull()
|
||||
{
|
||||
setupSystemWideDirectAccessConfig(ENABLED);
|
||||
when(mockContentStore.isContentDirectUrlEnabled()).thenReturn(ENABLED);
|
||||
|
||||
DirectAccessUrl directAccessUrl = contentService.requestContentDirectUrl(NODE_REF, PROP_CONTENT_QNAME, true, 20L, null);
|
||||
assertNull(directAccessUrl);
|
||||
verify(mockContentStore, times(1)).requestContentDirectUrl(anyString(), eq(true), eq(SOME_FILE_NAME), anyString(), anyLong());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRequestContentDirectUrl_StoreRequestContentDirectUrlIsCalledWithNodeNamePropertyWhenFileNameOverrideIsEmpty()
|
||||
{
|
||||
setupSystemWideDirectAccessConfig(ENABLED);
|
||||
when(mockContentStore.isContentDirectUrlEnabled()).thenReturn(ENABLED);
|
||||
|
||||
DirectAccessUrl directAccessUrl = contentService.requestContentDirectUrl(NODE_REF, PROP_CONTENT_QNAME, true, 20L, "");
|
||||
assertNull(directAccessUrl);
|
||||
verify(mockContentStore, times(1)).requestContentDirectUrl(anyString(), eq(true), eq(SOME_FILE_NAME), anyString(), anyLong());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldReturnStoragePropertiesWhenTheyExist()
|
||||
{
|
||||
|
Reference in New Issue
Block a user