Compare commits

..

2 Commits

Author SHA1 Message Date
Praveen Singh
3ffe06391b testing failure test cases 2023-07-12 19:09:00 +05:30
Praveen Singh
92ff7151d8 APPS[2000] Data Dictionary folder deletion behaviour should be consistent 2023-07-12 13:30:51 +05:30
54 changed files with 118 additions and 272 deletions

View File

@@ -76,7 +76,7 @@ jobs:
!contains(github.event.head_commit.message, '[skip tests]') &&
!contains(github.event.head_commit.message, '[force]')
steps:
- uses: Alfresco/ya-pmd-scan@v1.0.0
- uses: Alfresco/alfresco-build-tools/.github/actions/pmd@v2.5.0
with:
fail-on-new-issues: "false"

View File

@@ -3,12 +3,14 @@ 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](https://hub.alfresco.com/t5/alfresco-content-services-ecm/ct-p/ECM-software) where they can be referenced from multiple projects.
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).
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://hub.alfresco.com/t5/alfresco-content-services-hub/reporting-an-issue/ba-p/289727).
Read [instructions for a good issue report](https://community.alfresco.com/docs/DOC-6263-reporting-an-issue).
Read [instructions for making a contribution](https://hub.alfresco.com/t5/alfresco-content-services-hub/alfresco-contribution-agreement/ba-p/293276).
Read [instructions for making a contribution](https://community.alfresco.com/docs/DOC-6269-submitting-contributions).
Please follow [the coding standards](https://hub.alfresco.com/t5/alfresco-content-services-hub/coding-standards-for-alfresco-content-services/ba-p/290457).
Please follow [the coding standards](https://community.alfresco.com/docs/DOC-4658-coding-standards).

View File

@@ -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://hub.alfresco.com/t5/alfresco-content-services-blog/v1-rest-api-10-things-you-should-know/ba-p/287692)
* WebScript implementations including [V1 REST APIs](https://community.alfresco.com/community/ecm/blog/2017/05/02/v1-rest-api-10-things-you-should-know)
* [OpenCMIS](https://chemistry.apache.org/java/opencmis.html) implementations
#### 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.

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-amps</artifactId>
<version>23.1.0.169</version>
<version>23.1.0.163-SNAPSHOT</version>
</parent>
<modules>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-governance-services-community-parent</artifactId>
<version>23.1.0.169</version>
<version>23.1.0.163-SNAPSHOT</version>
</parent>
<modules>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-governance-services-automation-community-repo</artifactId>
<version>23.1.0.169</version>
<version>23.1.0.163-SNAPSHOT</version>
</parent>
<build>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-governance-services-community-parent</artifactId>
<version>23.1.0.169</version>
<version>23.1.0.163-SNAPSHOT</version>
</parent>
<modules>

View File

@@ -8,7 +8,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-governance-services-community-repo-parent</artifactId>
<version>23.1.0.169</version>
<version>23.1.0.163-SNAPSHOT</version>
</parent>
<properties>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-governance-services-community-repo-parent</artifactId>
<version>23.1.0.169</version>
<version>23.1.0.163-SNAPSHOT</version>
</parent>
<build>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>23.1.0.169</version>
<version>23.1.0.163-SNAPSHOT</version>
</parent>
<modules>

View File

@@ -8,7 +8,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-amps</artifactId>
<version>23.1.0.169</version>
<version>23.1.0.163-SNAPSHOT</version>
</parent>
<properties>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>23.1.0.169</version>
<version>23.1.0.163-SNAPSHOT</version>
</parent>
<dependencies>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>23.1.0.169</version>
<version>23.1.0.163-SNAPSHOT</version>
</parent>
<properties>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>23.1.0.169</version>
<version>23.1.0.163-SNAPSHOT</version>
</parent>
<dependencies>

View File

@@ -9,6 +9,6 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-packaging</artifactId>
<version>23.1.0.169</version>
<version>23.1.0.163-SNAPSHOT</version>
</parent>
</project>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-packaging</artifactId>
<version>23.1.0.169</version>
<version>23.1.0.163-SNAPSHOT</version>
</parent>
<properties>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>23.1.0.169</version>
<version>23.1.0.163-SNAPSHOT</version>
</parent>
<modules>

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-packaging</artifactId>
<version>23.1.0.169</version>
<version>23.1.0.163-SNAPSHOT</version>
</parent>
<modules>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-tests</artifactId>
<version>23.1.0.169</version>
<version>23.1.0.163-SNAPSHOT</version>
</parent>
<organization>

View File

@@ -9,7 +9,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-tests</artifactId>
<version>23.1.0.169</version>
<version>23.1.0.163-SNAPSHOT</version>
</parent>
<developers>

View File

@@ -9,7 +9,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-tests</artifactId>
<version>23.1.0.169</version>
<version>23.1.0.163-SNAPSHOT</version>
</parent>
<developers>

View File

@@ -8,7 +8,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-tests</artifactId>
<version>23.1.0.169</version>
<version>23.1.0.163-SNAPSHOT</version>
</parent>
<properties>

View File

@@ -25,8 +25,6 @@
*/
package org.alfresco.rest.model;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
@@ -45,7 +43,6 @@ public class RestPersonFavoritesModel extends TestModel implements IRestModel<Re
private String targetGuid;
private String createdAt;
private List<String> allowableOperations;
private RestTargetModel target;
@@ -89,12 +86,4 @@ 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;
}
}

View File

@@ -101,8 +101,6 @@ public class SearchNodeModel extends TestModel implements IRestModel<SearchNodeM
private String location;
private Boolean isFavorite;
public Map<String, Object> getAssociation()
{
return association;
@@ -328,12 +326,5 @@ public class SearchNodeModel extends TestModel implements IRestModel<SearchNodeM
{
this.location = location;
}
public Boolean isFavorite() {
return isFavorite;
}
public void setIsFavorite(Boolean favorite) {
isFavorite = favorite;
}
}

View File

@@ -21,7 +21,6 @@ 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;
@@ -552,17 +551,4 @@ 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());
}
}

View File

@@ -9,7 +9,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-tests</artifactId>
<version>23.1.0.169</version>
<version>23.1.0.163-SNAPSHOT</version>
</parent>
<developers>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-packaging</artifactId>
<version>23.1.0.169</version>
<version>23.1.0.163-SNAPSHOT</version>
</parent>
<properties>
@@ -136,7 +136,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<version>3.2.0</version>
<version>3.1.0</version>
<executions>
<execution>
<phase>validate</phase>

View File

@@ -388,6 +388,12 @@
<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>
@@ -463,6 +469,14 @@
<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 -->

46
pom.xml
View File

@@ -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.169</version>
<version>23.1.0.163-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Alfresco Community Repo Parent</name>
@@ -58,7 +58,7 @@
<dependency.spring.version>5.3.27</dependency.spring.version>
<dependency.antlr.version>3.5.3</dependency.antlr.version>
<dependency.jackson.version>2.15.2</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.45</dependency.webscripts.version>
@@ -67,7 +67,7 @@
<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.13.0</dependency.commons-io.version>
<dependency.commons-io.version>2.11.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>
@@ -84,8 +84,10 @@
<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.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.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.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>
@@ -109,7 +111,7 @@
<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.2-A4</alfresco.googledrive.version>
<alfresco.googledrive.version>3.4.2-A2</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 -->
@@ -122,8 +124,8 @@
<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.24</dependency.tas-email.version>
<dependency.tas-webdav.version>1.20</dependency.tas-webdav.version>
<dependency.tas-email.version>1.23</dependency.tas-email.version>
<dependency.tas-webdav.version>1.18</dependency.tas-webdav.version>
<dependency.tas-ftp.version>1.18</dependency.tas-ftp.version>
<dependency.tas-dataprep.version>2.6</dependency.tas-dataprep.version>
@@ -148,7 +150,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.169</tag>
<tag>HEAD</tag>
</scm>
<distributionManagement>
@@ -633,7 +635,7 @@
<dependency>
<groupId>com.github.junrar</groupId>
<artifactId>junrar</artifactId>
<version>7.5.5</version>
<version>7.5.4</version>
</dependency>
<dependency>
<groupId>com.github.fge</groupId>
@@ -849,6 +851,17 @@
<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>
@@ -893,15 +906,6 @@
</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>
@@ -957,7 +961,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.6.0</version>
<version>3.5.0</version>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
@@ -1019,4 +1023,4 @@
</plugin>
</plugins>
</build>
</project>
</project>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>23.1.0.169</version>
<version>23.1.0.163-SNAPSHOT</version>
</parent>
<dependencies>

View File

@@ -102,30 +102,18 @@ 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.
*
@@ -133,9 +121,8 @@ 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, String fileName);
DirectAccessUrl requestContentDirectUrl(String archivedId, String renditionId, boolean attachment, Long validFor);
}

View File

@@ -63,10 +63,4 @@ public class DirectAccessUrlHelper
}
return attachment;
}
public String getFileName(DirectAccessUrlRequest directAccessUrlRequest)
{
return directAccessUrlRequest != null ? directAccessUrlRequest.getFileName() : null;
}
}

View File

@@ -323,20 +323,7 @@ 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.
*/
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);
DirectAccessUrl requestContentDirectUrl(NodeRef nodeRef, boolean attachment, Long validFor);
/**
* Convert from node properties (map of QName to Serializable) retrieved from

View File

@@ -250,19 +250,6 @@ public interface Renditions
return requestContentDirectUrl(nodeRef, versionId, renditionId, attachment, null);
}
/**
* @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
* @return a direct access {@code URL} object for the content.
*/
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}
@@ -270,9 +257,8 @@ public interface Renditions
* @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);
DirectAccessUrl requestContentDirectUrl(NodeRef nodeRef, String versionId, String renditionId, boolean attachment, Long validFor);
}

View File

@@ -250,18 +250,18 @@ public class DeletedNodesImpl implements DeletedNodes, RecognizedParamsExtractor
* {@inheritDoc}
*/
@Override
public DirectAccessUrl requestContentDirectUrl(String originalNodeId, String renditionId, boolean attachment, Long validFor, String fileName)
public DirectAccessUrl requestContentDirectUrl(String originalNodeId, String renditionId, boolean attachment, Long validFor)
{
//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, fileName);
return renditions.requestContentDirectUrl(validatedNodeRef, null, renditionId, attachment, validFor);
}
else
{
return nodes.requestContentDirectUrl(validatedNodeRef, attachment, validFor, fileName);
return nodes.requestContentDirectUrl(validatedNodeRef, attachment, validFor);
}
}
}

View File

@@ -25,14 +25,13 @@
*/
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;
@@ -77,7 +76,6 @@ 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;
@@ -91,9 +89,7 @@ public class FavouritesImpl implements Favourites
{
private static final Log logger = LogFactory.getLog(FavouritesImpl.class);
private static final List<String> ALLOWED_INCLUDES = List.of(PARAM_INCLUDE_PROPERTIES, PARAM_INCLUDE_ALLOWABLEOPERATIONS);
private People people;
private People people;
private Sites sites;
private Nodes nodes;
private FavouritesService favouritesService;
@@ -179,23 +175,18 @@ public class FavouritesImpl implements Favourites
fav.setTarget(target);
// REPO-1147 allow retrieving additional properties
final List<String> paramsInclude = parameters.getInclude();
if (!Collections.disjoint(paramsInclude, ALLOWED_INCLUDES))
if (parameters.getInclude().contains(PARAM_INCLUDE_PROPERTIES))
{
final List<String> includes = ALLOWED_INCLUDES.stream().filter(a -> paramsInclude.contains(a)).collect(Collectors.toList());
List<String> includeProperties = new LinkedList<>();
includeProperties.add(PARAM_INCLUDE_PROPERTIES);
// get node representation with only properties included
Node node = nodes.getFolderOrDocument(personFavourite.getNodeRef(), null, null, includes, null);
Node node = nodes.getFolderOrDocument(personFavourite.getNodeRef(), null, null, includeProperties, 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 && paramsInclude.contains(PARAM_INCLUDE_PROPERTIES))
if(filteredNodeProperties.size() > 0)
{
fav.setProperties(filteredNodeProperties);
}
final List<String> allowableOperations = node.getAllowableOperations();
if (CollectionUtils.isNotEmpty(allowableOperations) && paramsInclude.contains(PARAM_INCLUDE_ALLOWABLEOPERATIONS))
{
fav.setAllowableOperations(allowableOperations);
}
}
return fav;

View File

@@ -3443,9 +3443,9 @@ public class NodesImpl implements Nodes
* {@inheritDoc}
*/
@Override
public DirectAccessUrl requestContentDirectUrl(NodeRef nodeRef, boolean attachment, Long validFor, String fileName)
public DirectAccessUrl requestContentDirectUrl(NodeRef nodeRef, boolean attachment, Long validFor)
{
DirectAccessUrl directAccessUrl = contentService.requestContentDirectUrl(nodeRef, ContentModel.PROP_CONTENT, attachment, validFor, fileName);
DirectAccessUrl directAccessUrl = contentService.requestContentDirectUrl(nodeRef, ContentModel.PROP_CONTENT, attachment, validFor);
if (directAccessUrl == null)
{
throw new DisabledServiceException("Direct access url isn't available.");

View File

@@ -512,7 +512,7 @@ public class RenditionsImpl implements Renditions, ResourceLoaderAware
/**
* {@inheritDoc}
*/
public DirectAccessUrl requestContentDirectUrl(NodeRef nodeRef, String versionId, String renditionId, boolean attachment, Long validFor, String fileName)
public DirectAccessUrl requestContentDirectUrl(NodeRef nodeRef, String versionId, String renditionId, boolean attachment, Long validFor)
{
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, fileName);
return nodes.requestContentDirectUrl(renditionNodeRef, attachment, validFor);
}
private BinaryResource getContentImpl(NodeRef nodeRef, String renditionId, Parameters parameters)

View File

@@ -33,7 +33,6 @@ package org.alfresco.rest.api.model;
public class DirectAccessUrlRequest
{
private Boolean attachment;
private String fileName;
public Boolean isAttachment()
{
@@ -44,14 +43,4 @@ public class DirectAccessUrlRequest
{
this.attachment = attachment;
}
public String getFileName()
{
return fileName;
}
public void setFileName(String fileName)
{
this.fileName = fileName;
}
}

View File

@@ -26,7 +26,6 @@
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;
@@ -43,7 +42,6 @@ public class Favourite
private Date createdAt;
private Target target;
private Map<String, Object> properties;
private List<String> allowableOperations;
public Date getCreatedAt()
{
@@ -86,18 +84,10 @@ 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 + "]";
}
}
}

View File

@@ -137,13 +137,12 @@ 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, fileName);
directAccessUrl = renditions.requestContentDirectUrl(nodeRef, null, renditionId, attachment, validFor);
}
catch (DirectAccessUrlDisabledException ex)
{

View File

@@ -149,14 +149,13 @@ 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, fileName);
directAccessUrl = renditions.requestContentDirectUrl(nodeRef, versionId, renditionId, attachment, validFor);
}
catch (DirectAccessUrlDisabledException ex)
{

View File

@@ -311,7 +311,6 @@ 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)
{
@@ -320,7 +319,7 @@ public class NodeVersionsRelation extends AbstractNodeRelation implements
DirectAccessUrl directAccessUrl;
try
{
directAccessUrl = nodes.requestContentDirectUrl(versionNodeRef, attachment, validFor, fileName);
directAccessUrl = nodes.requestContentDirectUrl(versionNodeRef, attachment, validFor);
}
catch (DirectAccessUrlDisabledException ex)
{

View File

@@ -211,13 +211,12 @@ 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, fileName);
directAccessUrl = nodes.requestContentDirectUrl(nodeRef, attachment, validFor);
}
catch (DirectAccessUrlDisabledException ex)
{

View File

@@ -31,7 +31,6 @@ 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;
@@ -97,9 +96,10 @@ 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, PARAM_INCLUDE_ISFAVORITE);
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 String CMIS = "cmis";
public static final String LUCENE = "lucene";

View File

@@ -109,11 +109,10 @@ 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, fileName);
directAccessUrl = deletedNodes.requestContentDirectUrl(originalNodeId, null, attachment, validFor);
}
catch (DirectAccessUrlDisabledException ex)
{

View File

@@ -98,11 +98,10 @@ 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, fileName);
directAccessUrl = deletedNodes.requestContentDirectUrl(originalNodeId, renditionId, attachment, validFor);
}
catch (DirectAccessUrlDisabledException ex)
{

View File

@@ -32,7 +32,6 @@ 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;
@@ -301,7 +300,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_ISFAVORITE));
PARAM_INCLUDE_ASSOCIATION, PARAM_INCLUDE_ISLOCKED, PARAM_INCLUDE_PERMISSIONS));
}

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>23.1.0.169</version>
<version>23.1.0.163-SNAPSHOT</version>
</parent>
<dependencies>

View File

@@ -65,7 +65,6 @@ 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;
@@ -628,7 +627,7 @@ public class ContentServiceImpl implements ContentService, ApplicationContextAwa
* {@inheritDoc}
*/
@Override
public DirectAccessUrl requestContentDirectUrl(NodeRef nodeRef, QName propertyQName, boolean attachment, Long validFor, String fileNameOverride)
public DirectAccessUrl requestContentDirectUrl(NodeRef nodeRef, QName propertyQName, boolean attachment, Long validFor)
{
if (!systemWideDirectUrlConfig.isEnabled())
{
@@ -644,7 +643,7 @@ public class ContentServiceImpl implements ContentService, ApplicationContextAwa
String contentUrl = contentData.getContentUrl();
String contentMimetype = contentData.getMimetype();
String fileName = StringUtils.isEmpty(fileNameOverride) ? getFileName(nodeRef) : fileNameOverride;
String fileName = getFileName(nodeRef);
validFor = adjustValidFor(validFor);
attachment = adjustAttachment(nodeRef, contentMimetype, attachment);

View File

@@ -368,10 +368,7 @@ 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);

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2023 Alfresco Software Limited
* Copyright (C) 2005 - 2022 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 (UncheckedIOException e)
catch (IOException e)
{
throw new VirtualizationException(e);
}
@@ -968,7 +968,7 @@ public class VirtualNodeServiceExtension extends VirtualSpringBeanExtension<Node
}
writer.putContent(text);
}
catch (UncheckedIOException e)
catch (IOException e)
{
throw new ActualEnvironmentException(e);
}

View File

@@ -245,25 +245,7 @@ public interface ContentService
* @throws UnsupportedOperationException if the store is unable to provide the information.
*/
@Auditable(parameters = {"nodeRef", "propertyQName", "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);
DirectAccessUrl requestContentDirectUrl(NodeRef nodeRef, QName propertyQName, boolean attachment, Long validFor);
/**
* Gets a key-value (String-String) collection of storage headers/properties with their respective values for a specific node reference.

View File

@@ -72,8 +72,7 @@ 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");
public static final String SOME_FILE_NAME = "someFilename";
private static final NodeRef NODE_REF_2 = new NodeRef("content://Node/Ref2");;
private static final String X_AMZ_HEADER_1 = "x-amz-header1";
private static final String VALUE_1 = "value1";
@@ -104,7 +103,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(SOME_FILE_NAME);
when(mockNodeService.getProperty(NODE_REF, ContentModel.PROP_NAME)).thenReturn("someFilename");
}
@Test
@@ -163,40 +162,6 @@ 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()
{