mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-09-10 14:11:58 +00:00
Compare commits
16 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
fcb41bf09a | ||
|
828ef95c05 | ||
|
ea816900ad | ||
|
a03db31230 | ||
|
131a26ccb0 | ||
|
e87bd7bebc | ||
|
a51c670c86 | ||
|
cc62f3db2b | ||
|
e011b6859f | ||
|
c0dd692d40 | ||
|
8d62acea78 | ||
|
6da02d6ad6 | ||
|
0707fb7ac5 | ||
|
4e850d4620 | ||
|
a1da5d9859 | ||
|
179b5db3a9 |
18
.travis.yml
18
.travis.yml
@@ -55,7 +55,7 @@ jobs:
|
||||
before_script:
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.3 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.3
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.6
|
||||
script: travis_wait 20 mvn -B test -pl repository -Dtest=AppContext01TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
|
||||
- name: "Repository - AppContext02TestSuite"
|
||||
@@ -70,7 +70,7 @@ jobs:
|
||||
before_script:
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.3 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.3
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.6
|
||||
script: travis_wait 20 mvn -B test -pl repository -Dtest=AppContext03TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
|
||||
- name: "Repository - AppContext04TestSuite"
|
||||
@@ -78,7 +78,7 @@ jobs:
|
||||
before_script:
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.3 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.3
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.6
|
||||
script: travis_wait 20 mvn -B test -pl repository -Dtest=AppContext04TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
|
||||
- name: "Repository - AppContext05TestSuite"
|
||||
@@ -97,7 +97,7 @@ jobs:
|
||||
before_script:
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.3 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.3
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.6
|
||||
script: travis_wait 20 mvn -B test -pl repository -Dtest=AppContext06TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
|
||||
- name: "Repository - AppContextExtraTestSuite"
|
||||
@@ -105,7 +105,7 @@ jobs:
|
||||
before_script:
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.3 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.3
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.6
|
||||
script: travis_wait 20 mvn -B test -pl repository -Dtest=AppContextExtraTestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
|
||||
- name: "Repository - MiscContextTestSuite"
|
||||
@@ -113,7 +113,7 @@ jobs:
|
||||
before_script:
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.3 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.3
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.6
|
||||
script: travis_wait 20 mvn -B test -pl repository -Dtest=MiscContextTestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
|
||||
- name: "Repository - SearchTestSuite"
|
||||
@@ -234,7 +234,7 @@ jobs:
|
||||
before_script:
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.3 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.3
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.6
|
||||
script: travis_wait 20 mvn -B test -pl remote-api -Dtest=AppContext02TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
|
||||
- name: "Remote-api - AppContext03TestSuite"
|
||||
@@ -242,7 +242,7 @@ jobs:
|
||||
before_script:
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.3 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.3
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.6
|
||||
script: travis_wait 20 mvn -B test -pl remote-api -Dtest=AppContext03TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
|
||||
- name: "Remote-api - AppContext04TestSuite"
|
||||
@@ -250,7 +250,7 @@ jobs:
|
||||
before_script:
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.3 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.3
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.5.6
|
||||
script: travis_wait 20 mvn -B test -pl remote-api -Dtest=AppContext04TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
|
||||
- name: "Remote-api - AppContextExtraTestSuite"
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-amps</artifactId>
|
||||
<version>12.18</version>
|
||||
<version>12.23</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-governance-services-community-parent</artifactId>
|
||||
<version>12.18</version>
|
||||
<version>12.23</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-governance-services-automation-community-repo</artifactId>
|
||||
<version>12.18</version>
|
||||
<version>12.23</version>
|
||||
</parent>
|
||||
|
||||
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-governance-services-community-parent</artifactId>
|
||||
<version>12.18</version>
|
||||
<version>12.23</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
@@ -1,4 +1,4 @@
|
||||
TRANSFORMERS_TAG=2.5.3
|
||||
SOLR6_TAG=2.0.2-RC1
|
||||
TRANSFORMERS_TAG=2.5.6
|
||||
SOLR6_TAG=2.0.2
|
||||
POSTGRES_TAG=13.3
|
||||
ACTIVEMQ_TAG=5.16.1
|
||||
|
@@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-governance-services-community-repo-parent</artifactId>
|
||||
<version>12.18</version>
|
||||
<version>12.23</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-governance-services-community-repo-parent</artifactId>
|
||||
<version>12.18</version>
|
||||
<version>12.23</version>
|
||||
</parent>
|
||||
|
||||
<build>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>12.18</version>
|
||||
<version>12.23</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
@@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-amps</artifactId>
|
||||
<version>12.18</version>
|
||||
<version>12.23</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>12.18</version>
|
||||
<version>12.23</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>12.18</version>
|
||||
<version>12.23</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
@@ -9,6 +9,6 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||
<version>12.18</version>
|
||||
<version>12.23</version>
|
||||
</parent>
|
||||
</project>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||
<version>12.18</version>
|
||||
<version>12.23</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>12.18</version>
|
||||
<version>12.23</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
@@ -1,4 +1,4 @@
|
||||
TRANSFORMERS_TAG=2.5.3
|
||||
TRANSFORMERS_TAG=2.5.6
|
||||
SOLR6_TAG=2.0.2
|
||||
POSTGRES_TAG=13.3
|
||||
ACTIVEMQ_TAG=5.16.1
|
||||
|
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||
<version>12.18</version>
|
||||
<version>12.23</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>12.18</version>
|
||||
<version>12.23</version>
|
||||
</parent>
|
||||
|
||||
<developers>
|
||||
|
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>12.18</version>
|
||||
<version>12.23</version>
|
||||
</parent>
|
||||
|
||||
<developers>
|
||||
|
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>12.18</version>
|
||||
<version>12.23</version>
|
||||
</parent>
|
||||
|
||||
<developers>
|
||||
|
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>12.18</version>
|
||||
<version>12.23</version>
|
||||
</parent>
|
||||
|
||||
<developers>
|
||||
|
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>12.18</version>
|
||||
<version>12.23</version>
|
||||
</parent>
|
||||
|
||||
<developers>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||
<version>12.18</version>
|
||||
<version>12.23</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
13
pom.xml
13
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>12.18</version>
|
||||
<version>12.23</version>
|
||||
<packaging>pom</packaging>
|
||||
<name>Alfresco Community Repo Parent</name>
|
||||
|
||||
@@ -91,6 +91,7 @@
|
||||
<dependency.swagger-ui.version>3.38.0</dependency.swagger-ui.version>
|
||||
<dependency.swagger-parser.version>1.0.52</dependency.swagger-parser.version>
|
||||
<dependency.maven-filtering.version>3.1.1</dependency.maven-filtering.version>
|
||||
<dependency.jdom2.version>2.0.6.1</dependency.jdom2.version>
|
||||
|
||||
<dependency.jakarta-jaxb-api.version>2.3.3</dependency.jakarta-jaxb-api.version>
|
||||
<dependency.jakarta-ws-api.version>2.3.3</dependency.jakarta-ws-api.version>
|
||||
@@ -105,7 +106,7 @@
|
||||
|
||||
<alfresco.googledrive.version>3.2.1.3</alfresco.googledrive.version>
|
||||
<alfresco.aos-module.version>1.4.0.1</alfresco.aos-module.version>
|
||||
<alfresco.api-explorer.version>7.1.1-A2</alfresco.api-explorer.version> <!-- Also in alfresco-enterprise-share -->
|
||||
<alfresco.api-explorer.version>7.1.1</alfresco.api-explorer.version> <!-- Also in alfresco-enterprise-share -->
|
||||
<alfresco.maven-plugin.version>2.2.0</alfresco.maven-plugin.version>
|
||||
|
||||
<dependency.postgresql.version>42.2.20</dependency.postgresql.version>
|
||||
@@ -142,7 +143,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>12.18</tag>
|
||||
<tag>12.23</tag>
|
||||
</scm>
|
||||
|
||||
<distributionManagement>
|
||||
@@ -651,6 +652,12 @@
|
||||
<artifactId>commons-csv</artifactId>
|
||||
<version>1.9.0</version>
|
||||
</dependency>
|
||||
<!-- upgrade dependency from TIKA -->
|
||||
<dependency>
|
||||
<groupId>org.jdom</groupId>
|
||||
<artifactId>jdom2</artifactId>
|
||||
<version>${dependency.jdom2.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.postgresql</groupId>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>12.18</version>
|
||||
<version>12.23</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Remote API
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2021 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
|
||||
@@ -147,6 +147,25 @@ public interface Renditions
|
||||
void createRenditions(NodeRef nodeRef, String versionId, List<Rendition> renditions, Parameters parameters)
|
||||
throws NotFoundException, ConstraintViolatedException;
|
||||
|
||||
/**
|
||||
* Delete the rendition node.
|
||||
*
|
||||
* @param nodeRef the source nodeRef, ie. live node
|
||||
* @param renditionId the rendition id
|
||||
* @param parameters the {@link Parameters} object to get the parameters passed into the request
|
||||
*/
|
||||
void deleteRendition(NodeRef nodeRef, String renditionId, Parameters parameters);
|
||||
|
||||
/**
|
||||
* Delete the rendition node.
|
||||
*
|
||||
* @param nodeRef the source nodeRef, ie. live node
|
||||
* @param versionId the version id (aka version label)
|
||||
* @param renditionId the rendition id
|
||||
* @param parameters the {@link Parameters} object to get the parameters passed into the request
|
||||
*/
|
||||
void deleteRendition(NodeRef nodeRef, String versionId, String renditionId, Parameters parameters);
|
||||
|
||||
/**
|
||||
* Downloads rendition.
|
||||
*
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Remote API
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2021 Alfresco Software LimitedP
|
||||
* Copyright (C) 2005 - 2022 Alfresco Software LimitedP
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
@@ -444,6 +444,31 @@ public class RenditionsImpl implements Renditions, ResourceLoaderAware
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteRendition(NodeRef nodeRef, String renditionId, Parameters parameters)
|
||||
{
|
||||
deleteRendition(nodeRef, null, renditionId, parameters);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteRendition(NodeRef nodeRef, String versionId, String renditionId, Parameters parameters)
|
||||
{
|
||||
if (!renditionService2.isEnabled())
|
||||
{
|
||||
throw new DisabledServiceException("Rendition generation has been disabled.");
|
||||
}
|
||||
|
||||
final NodeRef validatedNodeRef = validateNode(nodeRef.getStoreRef(), nodeRef.getId(), versionId, parameters);
|
||||
NodeRef renditionNodeRef = getRenditionByName(validatedNodeRef, renditionId, parameters);
|
||||
|
||||
if (renditionNodeRef == null)
|
||||
{
|
||||
throw new NotFoundException(renditionId + " is not registered.");
|
||||
}
|
||||
|
||||
renditionService2.clearRenditionContentDataInTransaction(renditionNodeRef);
|
||||
}
|
||||
|
||||
private String getName(Rendition rendition)
|
||||
{
|
||||
String renditionName = rendition.getId();
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Remote API
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2021 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
|
||||
@@ -65,6 +65,7 @@ public class NodeRenditionsRelation implements RelationshipResourceAction.Read<R
|
||||
RelationshipResourceAction.ReadById<Rendition>,
|
||||
RelationshipResourceAction.Create<Rendition>,
|
||||
RelationshipResourceBinaryAction.Read,
|
||||
RelationshipResourceAction.Delete,
|
||||
InitializingBean
|
||||
{
|
||||
|
||||
@@ -110,6 +111,14 @@ public class NodeRenditionsRelation implements RelationshipResourceAction.Read<R
|
||||
return null;
|
||||
}
|
||||
|
||||
@WebApiDescription(title = "Delete rendition")
|
||||
@Override
|
||||
public void delete(String nodeId, String renditionId, Parameters parameters)
|
||||
{
|
||||
NodeRef nodeRef = new NodeRef(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, nodeId);
|
||||
renditions.deleteRendition(nodeRef, renditionId, parameters);
|
||||
}
|
||||
|
||||
@WebApiDescription(title = "Download rendition", description = "Download rendition")
|
||||
@BinaryProperties({ "content" })
|
||||
@Override
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Remote API
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2021 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
|
||||
@@ -48,10 +48,11 @@ import org.springframework.extensions.webscripts.Status;
|
||||
*
|
||||
* Node version renditions
|
||||
*
|
||||
* - GET /nodes/{nodeId}/versions/{versionId}/renditions
|
||||
* - POST /nodes/{nodeId}/versions/{versionId}/renditions
|
||||
* - GET /nodes/{nodeId}/versions/{versionId}/renditions/{renditionId}
|
||||
* - GET /nodes/{nodeId}/versions/{versionId}/renditions/{renditionId}/content
|
||||
* - GET /nodes/{nodeId}/versions/{versionId}/renditions
|
||||
* - POST /nodes/{nodeId}/versions/{versionId}/renditions
|
||||
* - GET /nodes/{nodeId}/versions/{versionId}/renditions/{renditionId}
|
||||
* - DELETE /nodes/{nodeId}/versions/{versionId}/renditions/{renditionId}
|
||||
* - GET /nodes/{nodeId}/versions/{versionId}/renditions/{renditionId}/content
|
||||
*
|
||||
* @author janv
|
||||
*/
|
||||
@@ -59,6 +60,7 @@ import org.springframework.extensions.webscripts.Status;
|
||||
public class NodeVersionRenditionsRelation implements RelationshipResourceAction.Read<Rendition>,
|
||||
RelationshipResourceAction.ReadById<Rendition>,
|
||||
RelationshipResourceAction.Create<Rendition>,
|
||||
RelationshipResourceAction.Delete,
|
||||
RelationshipResourceBinaryAction.Read,
|
||||
InitializingBean
|
||||
{
|
||||
@@ -115,4 +117,13 @@ public class NodeVersionRenditionsRelation implements RelationshipResourceAction
|
||||
return renditions.getContent(nodeRef, versionId, renditionId, parameters);
|
||||
}
|
||||
|
||||
@WebApiDescription(title = "Delete rendition")
|
||||
@Override
|
||||
public void delete(String nodeId, String versionId, Parameters parameters)
|
||||
{
|
||||
String renditionId = parameters.getRelationship2Id();
|
||||
|
||||
NodeRef nodeRef = new NodeRef(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, nodeId);
|
||||
renditions.deleteRendition(nodeRef, versionId, renditionId, parameters);
|
||||
}
|
||||
}
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Remote API
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2020 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
|
||||
@@ -188,6 +188,8 @@ public class Params implements Parameters
|
||||
builder.append(this.entityId);
|
||||
builder.append(", relationshipId=");
|
||||
builder.append(this.relationshipId);
|
||||
builder.append(", relationship2Id=");
|
||||
builder.append(this.relationship2Id);
|
||||
builder.append(", passedIn=");
|
||||
builder.append(this.passedIn);
|
||||
builder.append(", paging=");
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Remote API
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2020 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
|
||||
@@ -68,6 +68,7 @@ public class ResourceWebScriptDelete extends AbstractResourceWebScript implement
|
||||
final Map<String, String> resourceVars = locator.parseTemplateVars(req.getServiceMatch().getTemplateVars());
|
||||
final String entityId = resourceVars.get(ResourceLocator.ENTITY_ID);
|
||||
final String relationshipId = resourceVars.get(ResourceLocator.RELATIONSHIP_ID);
|
||||
final String relationship2Id = resourceVars.get(ResourceLocator.RELATIONSHIP2_ID);
|
||||
|
||||
final Params.RecognizedParams params = getRecognizedParams(req);
|
||||
|
||||
@@ -78,7 +79,15 @@ public class ResourceWebScriptDelete extends AbstractResourceWebScript implement
|
||||
return Params.valueOf(params, entityId, relationshipId, req);
|
||||
case RELATIONSHIP:
|
||||
// note: relationshipId can be null - when deleting a related set/collection
|
||||
return Params.valueOf(params, entityId, relationshipId, req);
|
||||
if (StringUtils.isNotBlank(relationship2Id))
|
||||
{
|
||||
return Params.valueOf(false, entityId, relationshipId, relationship2Id,
|
||||
null, null, null, params, null, req);
|
||||
}
|
||||
else
|
||||
{
|
||||
return Params.valueOf(params, entityId, relationshipId, req);
|
||||
}
|
||||
case PROPERTY:
|
||||
final String resourceName = resourceVars.get(ResourceLocator.RELATIONSHIP_RESOURCE);
|
||||
final String propertyName = resourceVars.get(ResourceLocator.PROPERTY);
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Remote API
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2021 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
|
||||
@@ -1035,6 +1035,16 @@ public abstract class AbstractBaseApiTest extends EnterpriseTestApi
|
||||
return URL_NODES + "/" + nodeId + "/" + URL_RENDITIONS;
|
||||
}
|
||||
|
||||
protected String getNodeRenditionIdUrl(String nodeId, String renditionID)
|
||||
{
|
||||
return URL_NODES + "/" + nodeId + "/" + URL_RENDITIONS + "/" + renditionID;
|
||||
}
|
||||
|
||||
protected String getNodeVersionRenditionIdUrl(String nodeId, String versionId, String renditionID)
|
||||
{
|
||||
return URL_NODES + "/" + nodeId + "/" + URL_VERSIONS + "/" + versionId + "/" + URL_RENDITIONS + "/" + renditionID;
|
||||
}
|
||||
|
||||
protected String getNodeVersionsUrl(String nodeId)
|
||||
{
|
||||
return URL_NODES + "/" + nodeId + "/" + URL_VERSIONS;
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Remote API
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2021 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
|
||||
@@ -6366,5 +6366,92 @@ public class NodeApiTest extends AbstractSingleNetworkSiteTest
|
||||
|
||||
HttpResponse dauResponse = post(getRequestContentDirectUrl(contentNodeId), null, null, null, null, 501);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRequestDeleteRendition() throws Exception
|
||||
{
|
||||
setRequestContext(networkOne.getId(), user1, null);
|
||||
|
||||
String myNodeId = getMyNodeId();
|
||||
|
||||
// Create multipart request - txt file
|
||||
String renditionName = "pdf";
|
||||
String fileName = "quick-1.txt";
|
||||
File file = getResourceFile(fileName);
|
||||
MultiPartRequest reqBody = MultiPartBuilder.create()
|
||||
.setFileData(new FileData(fileName, file))
|
||||
.setRenditions(Collections.singletonList(renditionName))
|
||||
.build();
|
||||
|
||||
//Upload file to user home node
|
||||
HttpResponse response = post(getNodeChildrenUrl(myNodeId), reqBody.getBody(), null, reqBody.getContentType(), 201);
|
||||
Document document = RestApiUtil.parseRestApiEntry(response.getJsonResponse(), Document.class);
|
||||
String contentNodeId = document.getId();
|
||||
|
||||
// wait and check that rendition is created ...
|
||||
Rendition rendition = waitAndGetRendition(contentNodeId, null, renditionName);
|
||||
assertNotNull(rendition);
|
||||
assertEquals(Rendition.RenditionStatus.CREATED, rendition.getStatus());
|
||||
|
||||
//clean rendition
|
||||
delete(getNodeRenditionIdUrl(contentNodeId, renditionName), null, null, null, null, 204);
|
||||
//retry to double-check deletion
|
||||
delete(getNodeRenditionIdUrl(contentNodeId, renditionName), null, null, null, null, 404);
|
||||
|
||||
//check if rendition was cleaned
|
||||
HttpResponse getResponse = getSingle(getNodeRenditionIdUrl(contentNodeId, renditionName), null, 200);
|
||||
Rendition renditionDeleted = RestApiUtil.parseRestApiEntry(getResponse.getJsonResponse(), Rendition.class);
|
||||
assertNotNull(renditionDeleted);
|
||||
assertEquals(Rendition.RenditionStatus.NOT_CREATED, renditionDeleted.getStatus());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRequestVersionDeleteRendition() throws Exception
|
||||
{
|
||||
setRequestContext(networkOne.getId(), user1, null);
|
||||
|
||||
String myNodeId = getMyNodeId();
|
||||
|
||||
// Create multipart request - txt file
|
||||
String renditionName = "pdf";
|
||||
String fileName = "quick-1.txt";
|
||||
File file = getResourceFile(fileName);
|
||||
MultiPartRequest reqBody = MultiPartBuilder.create()
|
||||
.setFileData(new FileData(fileName, file))
|
||||
.setRenditions(Collections.singletonList(renditionName))
|
||||
.build();
|
||||
|
||||
//Upload file to user home node
|
||||
HttpResponse response = post(getNodeChildrenUrl(myNodeId), reqBody.getBody(), null, reqBody.getContentType(), 201);
|
||||
Document document = RestApiUtil.parseRestApiEntry(response.getJsonResponse(), Document.class);
|
||||
String contentNodeId = document.getId();
|
||||
|
||||
//Update file to newer version
|
||||
String content = "The quick brown fox jumps over the lazy dog\n the lazy dog jumps over the quick brown fox";
|
||||
Map<String, String> params = new HashMap<>();
|
||||
params.put("comment", "my version ");
|
||||
|
||||
document = updateTextFile(contentNodeId, content, params);
|
||||
assertTrue(document.getAspectNames().contains("cm:versionable"));
|
||||
assertNotNull(document.getProperties());
|
||||
assertEquals("1.1", document.getProperties().get("cm:versionLabel"));
|
||||
|
||||
// create rendition for old version and check that rendition is created ...
|
||||
Rendition renditionUpdated = createAndGetRendition(contentNodeId, "1.0", renditionName);
|
||||
assertNotNull(renditionUpdated);
|
||||
assertEquals(Rendition.RenditionStatus.CREATED, renditionUpdated.getStatus());
|
||||
|
||||
//clean rendition
|
||||
delete(getNodeVersionRenditionIdUrl(contentNodeId, "1.0", renditionName), null, null, null, null, 204);
|
||||
//retry to double-check deletion
|
||||
delete(getNodeVersionRenditionIdUrl(contentNodeId, "1.0", renditionName), null, null, null, null, 404);
|
||||
|
||||
//check if rendition was cleaned
|
||||
HttpResponse getResponse = getSingle(getNodeVersionRenditionIdUrl(contentNodeId, "1.0", renditionName), null, 200);
|
||||
Rendition renditionDeleted = RestApiUtil.parseRestApiEntry(getResponse.getJsonResponse(), Rendition.class);
|
||||
assertNotNull(renditionDeleted);
|
||||
assertEquals(Rendition.RenditionStatus.NOT_CREATED, renditionDeleted.getStatus());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@@ -206,7 +206,7 @@ public class SharedLinkApiTest extends AbstractBaseApiTest
|
||||
assertEquals(d1Id, resp.getNodeId());
|
||||
assertEquals(fileName1, resp.getName());
|
||||
assertEquals("The quick brown fox jumps over the lazy dog", resp.getTitle());
|
||||
assertEquals("Gym class featuring a brown fox and lazy dog", resp.getDescription());
|
||||
assertEquals("Pangram, fox, dog, Gym class featuring a brown fox and lazy dog", resp.getDescription());
|
||||
|
||||
assertEquals(file1_MimeType, resp.getContent().getMimeType());
|
||||
assertEquals("Adobe PDF Document", resp.getContent().getMimeTypeName());
|
||||
@@ -247,7 +247,7 @@ public class SharedLinkApiTest extends AbstractBaseApiTest
|
||||
assertEquals(shared1Id, resp.getId());
|
||||
assertEquals(fileName1, resp.getName());
|
||||
assertEquals("The quick brown fox jumps over the lazy dog", resp.getTitle());
|
||||
assertEquals("Gym class featuring a brown fox and lazy dog", resp.getDescription());
|
||||
assertEquals("Pangram, fox, dog, Gym class featuring a brown fox and lazy dog", resp.getDescription());
|
||||
assertEquals(d1Id, resp.getNodeId());
|
||||
assertNull(resp.getAllowableOperations()); // include is ignored
|
||||
assertNull(resp.getAllowableOperationsOnTarget()); // include is ignored
|
||||
@@ -1321,7 +1321,7 @@ public class SharedLinkApiTest extends AbstractBaseApiTest
|
||||
|
||||
// Quick check that some extended info is present.
|
||||
assertEquals("The quick brown fox jumps over the lazy dog", sharedLink.getTitle());
|
||||
assertEquals("Gym class featuring a brown fox and lazy dog", sharedLink.getDescription());
|
||||
assertEquals("Pangram, fox, dog, Gym class featuring a brown fox and lazy dog", sharedLink.getDescription());
|
||||
});
|
||||
}
|
||||
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>12.18</version>
|
||||
<version>12.23</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Repository
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2018 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
|
||||
@@ -112,6 +112,14 @@ public interface RenditionService2
|
||||
@NotAuditable
|
||||
ChildAssociationRef getRenditionByName(NodeRef sourceNodeRef, String renditionName);
|
||||
|
||||
/**
|
||||
* This method clears source nodeRef rendition content and content hash code using supplied rendition name.
|
||||
*
|
||||
* @param renditionNode the rendition node
|
||||
*/
|
||||
@NotAuditable
|
||||
void clearRenditionContentDataInTransaction(NodeRef renditionNode);
|
||||
|
||||
/**
|
||||
* Indicates if renditions are enabled. Set using the {@code system.thumbnail.generate} value.
|
||||
*/
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Repository
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2021 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
|
||||
@@ -38,6 +38,7 @@ import org.alfresco.repo.transaction.RetryingTransactionHelper;
|
||||
import org.alfresco.repo.util.PostTxnCallbackScheduler;
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
import org.alfresco.service.cmr.repository.ContentData;
|
||||
import org.alfresco.service.cmr.repository.ContentReader;
|
||||
import org.alfresco.service.cmr.repository.ContentService;
|
||||
import org.alfresco.service.cmr.repository.ContentWriter;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
@@ -553,11 +554,21 @@ public class RenditionService2Impl implements RenditionService2, InitializingBea
|
||||
contentWriter.setEncoding(DEFAULT_ENCODING);
|
||||
ContentWriter renditionWriter = contentWriter;
|
||||
renditionWriter.putContent(transformInputStream);
|
||||
if (logger.isDebugEnabled())
|
||||
|
||||
ContentReader contentReader = renditionWriter.getReader();
|
||||
long sizeOfRendition = contentReader.getSize();
|
||||
if (sizeOfRendition > 0L)
|
||||
{
|
||||
logger.debug("Set rendition hashcode for " + renditionName);
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Set rendition hashcode for " + renditionName);
|
||||
}
|
||||
nodeService.setProperty(renditionNode, RenditionModel.PROP_RENDITION_CONTENT_HASH_CODE, transformContentHashCode);
|
||||
}
|
||||
else
|
||||
{
|
||||
logger.error("Transform was zero bytes for " + renditionName + " on " + sourceNodeRef);
|
||||
clearRenditionContentData(renditionNode);
|
||||
}
|
||||
nodeService.setProperty(renditionNode, RenditionModel.PROP_RENDITION_CONTENT_HASH_CODE, transformContentHashCode);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -892,6 +903,17 @@ public class RenditionService2Impl implements RenditionService2, InitializingBea
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearRenditionContentDataInTransaction(NodeRef renditionNode)
|
||||
{
|
||||
AuthenticationUtil.runAsSystem((AuthenticationUtil.RunAsWork<Void>) () ->
|
||||
transactionService.getRetryingTransactionHelper().doInTransaction(() ->
|
||||
{
|
||||
clearRenditionContentData(renditionNode);
|
||||
return null;
|
||||
}, false, true));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEnabled()
|
||||
{
|
||||
|
@@ -430,7 +430,7 @@ public class ActionServiceImpl2Test
|
||||
{
|
||||
public Void execute() throws Throwable
|
||||
{
|
||||
assertEquals("Gym class featuring a brown fox and lazy dog",
|
||||
assertEquals("Pangram, fox, dog, Gym class featuring a brown fox and lazy dog",
|
||||
nodeService.getProperty(testNode, ContentModel.PROP_DESCRIPTION));
|
||||
return null;
|
||||
}
|
||||
|
@@ -85,7 +85,7 @@ import java.util.Set;
|
||||
public class ContentMetadataExtracterTest extends BaseSpringTest
|
||||
{
|
||||
protected static final String QUICK_TITLE = "The quick brown fox jumps over the lazy dog";
|
||||
protected static final String QUICK_DESCRIPTION = "Gym class featuring a brown fox and lazy dog";
|
||||
protected static final String QUICK_DESCRIPTION = "Pangram, fox, dog, Gym class featuring a brown fox and lazy dog";
|
||||
protected static final String QUICK_CREATOR = "Nevin Nollop";
|
||||
|
||||
private NodeService nodeService;
|
||||
|
@@ -84,7 +84,7 @@ public abstract class AbstractMetadataExtracterTest extends TestCase
|
||||
protected ApplicationContext ctx;
|
||||
|
||||
public static final String QUICK_TITLE = "The quick brown fox jumps over the lazy dog";
|
||||
public static final String QUICK_DESCRIPTION = "Gym class featuring a brown fox and lazy dog";
|
||||
public static final String QUICK_DESCRIPTION = "Pangram, fox, dog, Gym class featuring a brown fox and lazy dog";
|
||||
public static final String QUICK_CREATOR = "Nevin Nollop";
|
||||
public static final String QUICK_CREATOR_EMAIL = "nevin.nollop@alfresco.com";
|
||||
public static final String QUICK_PREVIOUS_AUTHOR = "Derek Hulley";
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Repository
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2021 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
|
||||
@@ -28,6 +28,8 @@ package org.alfresco.repo.rendition2;
|
||||
import static org.alfresco.model.ContentModel.PROP_CONTENT;
|
||||
import static org.junit.Assert.assertNotEquals;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.InputStream;
|
||||
import java.util.List;
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
@@ -358,7 +360,25 @@ public class RenditionService2IntegrationTest extends AbstractRenditionIntegrati
|
||||
* </p>
|
||||
*/
|
||||
@Test
|
||||
public void testRenditionWithoutContentButWithContentHashCode()
|
||||
public void testRenditionWithNullContentButWithContentHashCode()
|
||||
{
|
||||
testRenditionWithoutContentButWithContentHashCode(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests if a rendition without content (but with contentHashCode) can be generated again.
|
||||
* <p>
|
||||
* If the rendition consumption receives a zero length InputStream, the contentHashCode should be cleaned from the
|
||||
* rendition node, allowing new requests to generate the rendition.
|
||||
* </p>
|
||||
*/
|
||||
@Test
|
||||
public void testRenditionWithZeroContentButWithContentHashCode()
|
||||
{
|
||||
testRenditionWithoutContentButWithContentHashCode(new ByteArrayInputStream(new byte[0]));
|
||||
}
|
||||
|
||||
private void testRenditionWithoutContentButWithContentHashCode(InputStream transformInputStream)
|
||||
{
|
||||
// Create a node with an actual rendition
|
||||
NodeRef sourceNodeRef = createSource(ADMIN, "quick.jpg");
|
||||
@@ -379,7 +399,7 @@ public class RenditionService2IntegrationTest extends AbstractRenditionIntegrati
|
||||
// This is explicitly called to prove that rendition hash code will be cleaned (as opposite to previous behavior)
|
||||
RenditionDefinition2 renditionDefinition = renditionDefinitionRegistry2.getRenditionDefinition(DOC_LIB);
|
||||
AuthenticationUtil.runAs(() -> {
|
||||
renditionService2.consume(sourceNodeRef, null, renditionDefinition, contentHashCode);
|
||||
renditionService2.consume(sourceNodeRef, transformInputStream, renditionDefinition, contentHashCode);
|
||||
return null;
|
||||
}, ADMIN);
|
||||
waitForRendition(ADMIN, sourceNodeRef, DOC_LIB, false);
|
||||
|
Reference in New Issue
Block a user