mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-29 15:21:53 +00:00
Compare commits
28 Commits
25.1.1.1
...
fix/APPS-3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d1cb0f98c6 | ||
|
|
9877b8a9f1 | ||
|
|
ac74222562 | ||
|
|
6b959f8901 | ||
|
|
1fac054c08 | ||
|
|
eaf18d3b9d | ||
|
|
05195d84e7 | ||
|
|
2e2b41f879 | ||
|
|
cf0463a24d | ||
|
|
ed80663a07 | ||
|
|
31343c5177 | ||
|
|
f3492d16cf | ||
|
|
5fb5e19434 | ||
|
|
49d346a5c4 | ||
|
|
ae699b37d0 | ||
|
|
cc078037f7 | ||
|
|
9b7eb95463 | ||
|
|
5e560213bb | ||
|
|
a1d8aa7b48 | ||
|
|
b7e1daaac9 | ||
|
|
d70295a8de | ||
|
|
082770d73d | ||
|
|
2f81d382fd | ||
|
|
70438d4a51 | ||
|
|
91aaee9f78 | ||
|
|
d46162de7a | ||
|
|
ba0c9e471a | ||
|
|
40deb11173 |
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-amps</artifactId>
|
||||
<version>25.1.1.1</version>
|
||||
<version>25.1.0.68-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-governance-services-community-parent</artifactId>
|
||||
<version>25.1.1.1</version>
|
||||
<version>25.1.0.68-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-governance-services-automation-community-repo</artifactId>
|
||||
<version>25.1.1.1</version>
|
||||
<version>25.1.0.68-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<build>
|
||||
|
||||
@@ -23,7 +23,7 @@ Recorded content can be explicitly destroyed whilst maintaining the original nod
|
||||
* License: Alfresco Community
|
||||
* Issue Tracker Link: [JIRA RM](https://issues.alfresco.com/jira/projects/RM/summary)
|
||||
* Contribution Model: Alfresco Closed Source
|
||||
* Documentation: [docs.alfresco.com (Records Management)](https://support.hyland.com/r/Alfresco/Alfresco-Governance-Services-Community-Edition/23.4/Alfresco-Governance-Services-Community-Edition/Introduction)
|
||||
* Documentation: [docs.alfresco.com (Records Management)](http://docs.alfresco.com/rm2.4/concepts/welcome-rm.html)
|
||||
|
||||
***
|
||||
|
||||
|
||||
@@ -21,18 +21,18 @@ RM is split into two main parts - a repository integration and a Share integrati
|
||||
* [Community License](../LICENSE.txt)
|
||||
* [Enterprise License](../../rm-enterprise/LICENSE.txt) (this file will only be present in clones of the Enterprise repository)
|
||||
* [Issue Tracker Link](https://issues.alfresco.com/jira/projects/RM)
|
||||
* [Community Documentation Link](https://support.hyland.com/r/Alfresco/Alfresco-Governance-Services-Community-Edition/23.4/Alfresco-Governance-Services-Community-Edition/Introduction)
|
||||
* [Enterprise Documentation Link](https://support.hyland.com/r/Alfresco/Alfresco-Governance-Services/23.4/Alfresco-Governance-Services/Introduction)
|
||||
* [Community Documentation Link](http://docs.alfresco.com/rm-community/concepts/welcome-rm.html)
|
||||
* [Enterprise Documentation Link](http://docs.alfresco.com/rm/concepts/welcome-rm.html)
|
||||
* [Contribution Model](../../CONTRIBUTING.md)
|
||||
|
||||
***
|
||||
|
||||
### Prerequisite Knowledge
|
||||
An understanding of Alfresco Content Services is assumed. The following pages from the [developer documentation](https://support.hyland.com/r/Alfresco/Alfresco-Content-Services-Community-Edition/23.4/Alfresco-Content-Services-Community-Edition/Develop) give useful background information:
|
||||
An understanding of Alfresco Content Services is assumed. The following pages from the [developer documentation](http://docs.alfresco.com/5.2/concepts/dev-for-developers.html) give useful background information:
|
||||
|
||||
* [ACS Architecture](https://support.hyland.com/r/Alfresco/Alfresco-Content-Services/23.4/Alfresco-Content-Services/Develop/Software-Architecture)
|
||||
* [Platform Extensions](https://support.hyland.com/r/Alfresco/Alfresco-Content-Services/23.4/Alfresco-Content-Services/Develop/Extension-Points-Overview)
|
||||
* [Share Extensions](https://support.hyland.com/r/Alfresco/Alfresco-Content-Services/23.4/Alfresco-Content-Services/Develop/Share-UI-Extension-Points)
|
||||
* [ACS Architecture](http://docs.alfresco.com/5.2/concepts/dev-arch-overview.html)
|
||||
* [Platform Extensions](http://docs.alfresco.com/5.2/concepts/dev-platform-extensions.html)
|
||||
* [Share Extensions](http://docs.alfresco.com/5.2/concepts/dev-extensions-share.html)
|
||||
|
||||
***
|
||||
|
||||
@@ -44,12 +44,12 @@ The RM Share module communicates with the repository module via REST APIs. Inter
|
||||
* A DAO layer responsible for CRUD operations against the database.
|
||||
|
||||
#### REST API
|
||||
The REST API endpoints fall into two main types - v0 (Webscripts) and v1. The [v0 API](https://support.hyland.com/r/Alfresco/Alfresco-Content-Services/23.4/Alfresco-Content-Services/Develop/In-Process-Platform-Extension-Points/Web-Scripts) is older and not recommended for integrations. The [v1 API](https://support.hyland.com/r/Alfresco/Alfresco-Content-Services/23.4/Alfresco-Content-Services/Develop/REST-API-Guide) is newer but isn't yet feature complete. If you are running RM locally then the GS API Explorer will be available at [this link](http://localhost:8080/gs-api-explorer/).
|
||||
The REST API endpoints fall into two main types - v0 (Webscripts) and v1. The [v0 API](http://docs.alfresco.com/5.2/references/dev-extension-points-webscripts.html) is older and not recommended for integrations. The [v1 API](http://docs.alfresco.com/5.1/pra/1/topics/pra-welcome-aara.html) is newer but isn't yet feature complete. If you are running RM locally then the GS API Explorer will be available at [this link](http://localhost:8080/gs-api-explorer/).
|
||||
|
||||
Internally the GS v1 REST API is built on the [Alfresco v1 REST API framework](https://community.alfresco.com/community/ecm/blog/2016/10/11/v1-rest-api-part-1-introduction). It aims to be consistent with this in terms of behaviour and naming.
|
||||
|
||||
#### Java Public API
|
||||
The Java service layer is fronted by a [Java Public API](https://support.hyland.com/r/Alfresco/Alfresco-Content-Services/23.4/Alfresco-Content-Services/Develop/Reference/Java-Foundation-API), which we will ensure backward compatible with previous releases. Before we remove any methods there will first be a release containing that method deprecated to allow third party integrations to migrate to a new method. The Java Public API also includes a set of POJO objects which are needed to communicate with the services. It is easy to identify classes that are part of the Java Public API as they are annotated `@AlfrescoPublicApi`.
|
||||
The Java service layer is fronted by a [Java Public API](http://docs.alfresco.com/5.2/concepts/java-public-api-list.html), which we will ensure backward compatible with previous releases. Before we remove any methods there will first be a release containing that method deprecated to allow third party integrations to migrate to a new method. The Java Public API also includes a set of POJO objects which are needed to communicate with the services. It is easy to identify classes that are part of the Java Public API as they are annotated `@AlfrescoPublicApi`.
|
||||
|
||||
Each Java service will have at least four beans defined for it:
|
||||
|
||||
@@ -61,7 +61,7 @@ Each Java service will have at least four beans defined for it:
|
||||
#### DAOs
|
||||
The DAOs are not part of the Java Public API, but handle CRUD operations against RM stored data. We have some custom queries to improve performance for particularly heavy operations.
|
||||
|
||||
We use standard Alfresco [data modelling](https://support.hyland.com/r/Alfresco/Alfresco-Content-Services/23.4/Alfresco-Content-Services/Develop/In-Process-Platform-Extension-Points/Content-Model-Extension-Point) to store RM metadata. We extend the [Alfresco patching mechanism](https://support.hyland.com/r/Alfresco/Alfresco-Content-Services/23.4/Alfresco-Content-Services/Develop/In-Process-Platform-Extension-Points/Patches) to provide community and enterprise schema upgrades.
|
||||
We use standard Alfresco [data modelling](http://docs.alfresco.com/5.2/references/dev-extension-points-content-model.html) to store RM metadata. We extend the [Alfresco patching mechanism](http://docs.alfresco.com/5.2/references/dev-extension-points-patch.html) to provide community and enterprise schema upgrades.
|
||||
|
||||
***
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-governance-services-community-parent</artifactId>
|
||||
<version>25.1.1.1</version>
|
||||
<version>25.1.0.68-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
SOLR6_TAG=2.0.15
|
||||
SOLR6_TAG=2.0.15-A.1
|
||||
POSTGRES_TAG=16.6
|
||||
ACTIVEMQ_TAG=5.18.3-jre17-rockylinux8
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-governance-services-community-repo-parent</artifactId>
|
||||
<version>25.1.1.1</version>
|
||||
<version>25.1.0.68-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
# Version label
|
||||
version.major=25
|
||||
version.minor=1
|
||||
version.revision=1
|
||||
version.revision=0
|
||||
version.label=
|
||||
|
||||
# Edition label
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-governance-services-community-repo-parent</artifactId>
|
||||
<version>25.1.1.1</version>
|
||||
<version>25.1.0.68-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<build>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>25.1.1.1</version>
|
||||
<version>25.1.0.68-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-amps</artifactId>
|
||||
<version>25.1.1.1</version>
|
||||
<version>25.1.0.68-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>25.1.1.1</version>
|
||||
<version>25.1.0.68-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>25.1.1.1</version>
|
||||
<version>25.1.0.68-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>25.1.1.1</version>
|
||||
<version>25.1.0.68-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -9,6 +9,6 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||
<version>25.1.1.1</version>
|
||||
<version>25.1.0.68-SNAPSHOT</version>
|
||||
</parent>
|
||||
</project>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||
<version>25.1.1.1</version>
|
||||
<version>25.1.0.68-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>25.1.1.1</version>
|
||||
<version>25.1.0.68-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
SOLR6_TAG=2.0.15
|
||||
SOLR6_TAG=2.0.15-A.1
|
||||
POSTGRES_TAG=16.6
|
||||
ACTIVEMQ_TAG=5.18.3-jre17-rockylinux8
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||
<version>25.1.1.1</version>
|
||||
<version>25.1.0.68-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
## Synopsis
|
||||
|
||||
**TAS**( **T**est **A**utomation **S**ystem)- **CMIS** is the project that handles the automated tests related only to CMIS API integrated with Alfresco One [Alfresco CMIS API](https://support.hyland.com/r/Alfresco/Alfresco-Content-Services/23.4/Alfresco-Content-Services/Develop/Reference/CMIS-API).
|
||||
**TAS**( **T**est **A**utomation **S**ystem)- **CMIS** is the project that handles the automated tests related only to CMIS API integrated with Alfresco One [Alfresco CMIS API](http://docs.alfresco.com/5.1/pra/1/topics/cmis-welcome.html).
|
||||
|
||||
It is based on Apache Maven, compatible with major IDEs and is using also Spring capabilities for dependency injection.
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>25.1.1.1</version>
|
||||
<version>25.1.0.68-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<organization>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>25.1.1.1</version>
|
||||
<version>25.1.0.68-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<developers>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>25.1.1.1</version>
|
||||
<version>25.1.0.68-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<developers>
|
||||
|
||||
@@ -27,7 +27,7 @@ Back to [TAS Master Documentation](https://git.alfresco.com/tas/alfresco-tas-uti
|
||||
|
||||
## Synopsis
|
||||
|
||||
**TAS**( **T**est **A**utomation **S**ystem)- **RESTAPI** is the project that handles the automated tests related only to [Alfresco REST API](https://support.hyland.com/r/Alfresco/Alfresco-Content-Services/23.4/Alfresco-Content-Services/Develop/REST-API-Guide).
|
||||
**TAS**( **T**est **A**utomation **S**ystem)- **RESTAPI** is the project that handles the automated tests related only to [Alfresco REST API](http://docs.alfresco.com/5.1/pra/1/topics/pra-welcome.html).
|
||||
|
||||
It is based on Apache Maven, compatible with major IDEs and is using also Spring capabilities for dependency injection.
|
||||
|
||||
@@ -271,7 +271,7 @@ restClient.onResponse().assertThat().body("entry.modifiedBy.firstName", org.hamc
|
||||
|
||||
### How to generate models or check coverage
|
||||
|
||||
There are some simple generators that could parse [Swagger YAML](https://support.hyland.com/r/Alfresco/Alfresco-Content-Services/23.4/Alfresco-Content-Services/Develop/REST-API-Guide/Things-to-Know-Before-You-Start/The-API-Explorer-is-Your-Source-of-Truth) files and provide some usefull information to you like:
|
||||
There are some simple generators that could parse [Swagger YAML](http://docs.alfresco.com/community/concepts/alfresco-sdk-tutorials-using-rest-api-explorer.html) files and provide some usefull information to you like:
|
||||
|
||||
a) Show on screen the actual coverage of TAS vs requests that exists in each YAML file - defined in pom.xml)
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>25.1.1.1</version>
|
||||
<version>25.1.0.68-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>25.1.1.1</version>
|
||||
<version>25.1.0.68-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<developers>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||
<version>25.1.1.1</version>
|
||||
<version>25.1.0.68-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
||||
@@ -74,7 +74,7 @@ ModuleDetails shareServicesModule = moduleService.getModule("alfresco-share-serv
|
||||
<div class="index-list">
|
||||
<h4><%=descriptorService.getServerDescriptor().getEdition()%></h4>
|
||||
<p></p>
|
||||
<p><a href="https://support.hyland.com/p/alfresco">Online Documentation</a></p>
|
||||
<p><a href="http://docs.alfresco.com/">Online Documentation</a></p>
|
||||
<p></p>
|
||||
<%
|
||||
if (shareServicesModule != null && ModuleInstallState.INSTALLED.equals(shareServicesModule.getInstallState()))
|
||||
|
||||
14
pom.xml
14
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>25.1.1.1</version>
|
||||
<version>25.1.0.68-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
<name>Alfresco Community Repo Parent</name>
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<properties>
|
||||
<acs.version.major>25</acs.version.major>
|
||||
<acs.version.minor>1</acs.version.minor>
|
||||
<acs.version.revision>1</acs.version.revision>
|
||||
<acs.version.revision>0</acs.version.revision>
|
||||
<acs.version.label />
|
||||
<amp.min.version>${acs.version.major}.0.0</amp.min.version>
|
||||
|
||||
@@ -48,11 +48,11 @@
|
||||
<dependency.alfresco-hb-data-sender.version>1.1.1</dependency.alfresco-hb-data-sender.version>
|
||||
<dependency.alfresco-trashcan-cleaner.version>2.4.2</dependency.alfresco-trashcan-cleaner.version>
|
||||
<dependency.alfresco-jlan.version>7.5</dependency.alfresco-jlan.version>
|
||||
<dependency.alfresco-server-root.version>7.0.2</dependency.alfresco-server-root.version>
|
||||
<dependency.alfresco-server-root.version>7.0.1</dependency.alfresco-server-root.version>
|
||||
<dependency.activiti-engine.version>5.23.0</dependency.activiti-engine.version>
|
||||
<dependency.activiti.version>5.23.0</dependency.activiti.version>
|
||||
<dependency.alfresco-transform-core.version>5.1.7</dependency.alfresco-transform-core.version>
|
||||
<dependency.alfresco-transform-service.version>4.1.7</dependency.alfresco-transform-service.version>
|
||||
<dependency.alfresco-transform-core.version>5.1.7-A.4</dependency.alfresco-transform-core.version>
|
||||
<dependency.alfresco-transform-service.version>4.1.7-A.1</dependency.alfresco-transform-service.version>
|
||||
<dependency.alfresco-greenmail.version>7.1</dependency.alfresco-greenmail.version>
|
||||
<dependency.acs-event-model.version>1.0.2</dependency.acs-event-model.version>
|
||||
|
||||
@@ -115,7 +115,7 @@
|
||||
<dependency.json-smart.version>2.5.2</dependency.json-smart.version>
|
||||
<alfresco.googledrive.version>4.1.0</alfresco.googledrive.version>
|
||||
<alfresco.aos-module.version>3.2.0</alfresco.aos-module.version>
|
||||
<alfresco.api-explorer.version>25.1.0</alfresco.api-explorer.version> <!-- Also in alfresco-enterprise-share -->
|
||||
<alfresco.api-explorer.version>25.1.0-A1</alfresco.api-explorer.version> <!-- Also in alfresco-enterprise-share -->
|
||||
|
||||
<alfresco.maven-plugin.version>2.2.0</alfresco.maven-plugin.version>
|
||||
<license-maven-plugin.version>2.4.0</license-maven-plugin.version>
|
||||
@@ -155,7 +155,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>25.1.1.1</tag>
|
||||
<tag>HEAD</tag>
|
||||
</scm>
|
||||
|
||||
<distributionManagement>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>25.1.1.1</version>
|
||||
<version>25.1.0.68-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# I18N messages for the Repository Admin Console
|
||||
admin-console.header=Admin Console
|
||||
admin-console.help=Help
|
||||
admin-console.help-link=https://support.hyland.com/p/alfresco
|
||||
admin-console.help-link=http://docs.alfresco.com/{0}/concepts/ch-administering.html
|
||||
admin-console.success=Successfully saved values.
|
||||
|
||||
admin-console.host=Host
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# I18N messages for the Repository Admin Console
|
||||
admin-console.header=Konzole pro spr\u00e1vce
|
||||
admin-console.help=N\u00e1pov\u011bda
|
||||
admin-console.help-link=https://support.hyland.com/p/alfresco
|
||||
admin-console.help-link=http://docs.alfresco.com/{0}/concepts/ch-administering.html
|
||||
admin-console.success=Hodnoty byly \u00fasp\u011b\u0161n\u011b ulo\u017eeny.
|
||||
|
||||
admin-console.host=Hostitel
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# I18N messages for the Repository Admin Console
|
||||
admin-console.header=Administrationskonsol
|
||||
admin-console.help=Hj\u00e6lp
|
||||
admin-console.help-link=https://support.hyland.com/p/alfresco
|
||||
admin-console.help-link=http://docs.alfresco.com/{0}/concepts/ch-administering.html
|
||||
admin-console.success=V\u00e6rdierne blev gemt.
|
||||
|
||||
admin-console.host=V\u00e6rt
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# I18N messages for the Repository Admin Console
|
||||
admin-console.header=Administratorkonsole
|
||||
admin-console.help=Hilfe
|
||||
admin-console.help-link=https://support.hyland.com/p/alfresco
|
||||
admin-console.help-link=http://docs.alfresco.com/{0}/concepts/ch-administering.html
|
||||
admin-console.success=Erfolgreich gespeicherte Werte.
|
||||
|
||||
admin-console.host=Host
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# I18N messages for the Repository Admin Console
|
||||
admin-console.header=Consola de administraci\u00f3n
|
||||
admin-console.help=Ayuda
|
||||
admin-console.help-link=https://support.hyland.com/p/alfresco
|
||||
admin-console.help-link=http://docs.alfresco.com/{0}/concepts/ch-administering.html
|
||||
admin-console.success=Valores guardados correctamente.
|
||||
|
||||
admin-console.host=Host
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# I18N messages for the Repository Admin Console
|
||||
admin-console.header=Hallintakonsoli
|
||||
admin-console.help=Ohje
|
||||
admin-console.help-link=https://support.hyland.com/p/alfresco
|
||||
admin-console.help-link=http://docs.alfresco.com/{0}/concepts/ch-administering.html
|
||||
admin-console.success=Arvot tallennettiin.
|
||||
|
||||
admin-console.host=Is\u00e4nt\u00e4
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# I18N messages for the Repository Admin Console
|
||||
admin-console.header=Console d'administration
|
||||
admin-console.help=Aide
|
||||
admin-console.help-link=https://support.hyland.com/p/alfresco
|
||||
admin-console.help-link=http://docs.alfresco.com/{0}/concepts/ch-administering.html
|
||||
admin-console.success=Les valeurs ont bien \u00e9t\u00e9 enregistr\u00e9es.
|
||||
|
||||
admin-console.host=H\u00f4te
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# I18N messages for the Repository Admin Console
|
||||
admin-console.header=Console di amministrazione
|
||||
admin-console.help=Aiuto
|
||||
admin-console.help-link=https://support.hyland.com/p/alfresco
|
||||
admin-console.help-link=http://docs.alfresco.com/{0}/concepts/ch-administering.html
|
||||
admin-console.success=I valori sono stati salvati.
|
||||
|
||||
admin-console.host=Host
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# I18N messages for the Repository Admin Console
|
||||
admin-console.header=\u7ba1\u7406\u30b3\u30f3\u30bd\u30fc\u30eb
|
||||
admin-console.help=\u30d8\u30eb\u30d7
|
||||
admin-console.help-link=https://support.hyland.com/p/alfresco
|
||||
admin-console.help-link=http://docs.alfresco.com/{0}/concepts/ch-administering.html
|
||||
admin-console.success=\u5024\u3092\u6b63\u5e38\u306b\u4fdd\u5b58\u3057\u307e\u3057\u305f\u3002
|
||||
|
||||
admin-console.host=\u30db\u30b9\u30c8
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# I18N messages for the Repository Admin Console
|
||||
admin-console.header=Admin-konsoll
|
||||
admin-console.help=Hjelp
|
||||
admin-console.help-link=https://support.hyland.com/p/alfresco
|
||||
admin-console.help-link=http://docs.alfresco.com/{0}/concepts/ch-administering.html
|
||||
admin-console.success=Verdier som ble lagret.
|
||||
|
||||
admin-console.host=Vert
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# I18N messages for the Repository Admin Console
|
||||
admin-console.header=Beheerconsole
|
||||
admin-console.help=Help
|
||||
admin-console.help-link=https://support.hyland.com/p/alfresco
|
||||
admin-console.help-link=http://docs.alfresco.com/{0}/concepts/ch-administering.html
|
||||
admin-console.success=Waarden zijn opgeslagen.
|
||||
|
||||
admin-console.host=Host
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# I18N messages for the Repository Admin Console
|
||||
admin-console.header=Konsola administracyjna
|
||||
admin-console.help=Pomoc
|
||||
admin-console.help-link=https://support.hyland.com/p/alfresco
|
||||
admin-console.help-link=http://docs.alfresco.com/{0}/concepts/ch-administering.html
|
||||
admin-console.success=Warto\u015bci zosta\u0142y zapisane pomy\u015blnie.
|
||||
|
||||
admin-console.host=Host
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# I18N messages for the Repository Admin Console
|
||||
admin-console.header=Console de administra\u00e7\u00e3o
|
||||
admin-console.help=Ajuda
|
||||
admin-console.help-link=https://support.hyland.com/p/alfresco
|
||||
admin-console.help-link=http://docs.alfresco.com/{0}/concepts/ch-administering.html
|
||||
admin-console.success=Valores salvos com sucesso.
|
||||
|
||||
admin-console.host=Host
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# I18N messages for the Repository Admin Console
|
||||
admin-console.header=\u041a\u043e\u043d\u0441\u043e\u043b\u044c \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430
|
||||
admin-console.help=\u0421\u043f\u0440\u0430\u0432\u043a\u0430
|
||||
admin-console.help-link=https://support.hyland.com/p/alfresco
|
||||
admin-console.help-link=http://docs.alfresco.com/{0}/concepts/ch-administering.html
|
||||
admin-console.success=\u0423\u0441\u043f\u0435\u0448\u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f.
|
||||
|
||||
admin-console.host=\u0425\u043e\u0441\u0442
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# I18N messages for the Repository Admin Console
|
||||
admin-console.header=Admin-konsol
|
||||
admin-console.help=Hj\u00e4lp
|
||||
admin-console.help-link=https://support.hyland.com/p/alfresco
|
||||
admin-console.help-link=http://docs.alfresco.com/{0}/concepts/ch-administering.html
|
||||
admin-console.success=V\u00e4rden sparades.
|
||||
|
||||
admin-console.host=V\u00e4rd
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# I18N messages for the Repository Admin Console
|
||||
admin-console.header=\u7ba1\u7406\u63a7\u5236\u53f0
|
||||
admin-console.help=\u5e2e\u52a9
|
||||
admin-console.help-link=https://support.hyland.com/p/alfresco
|
||||
admin-console.help-link=http://docs.alfresco.com/{0}/concepts/ch-administering.html
|
||||
admin-console.success=\u5df2\u6210\u529f\u4fdd\u5b58\u7684\u503c\u3002
|
||||
|
||||
admin-console.host=\u4e3b\u673a
|
||||
|
||||
@@ -12,9 +12,9 @@
|
||||
<#macro page title readonly=false controller=DEFAULT_CONTROLLER!"/admin" params="" dialog=false>
|
||||
<#assign FORM_ID="admin-jmx-form" />
|
||||
<#if server.edition == "Community">
|
||||
<#assign docsEdition = "/Alfresco-Content-Services-Community-Edition/" + server.getVersionMajor() + "." + server.getVersionMinor() + "/Alfresco-Content-Services-Community-Edition" />
|
||||
<#assign docsEdition = "community" />
|
||||
<#elseif server.edition == "Enterprise" >
|
||||
<#assign docsEdition = "/Alfresco-Content-Services/" + server.getVersionMajor() + "." + server.getVersionMinor() + "/Alfresco-Content-Services" />
|
||||
<#assign docsEdition = server.getVersionMajor() + "." + server.getVersionMinor() />
|
||||
</#if>
|
||||
<#if metadata??>
|
||||
<#assign HOSTNAME>${msg("admin-console.host")}: ${metadata.hostname}</#assign>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Remote API
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2025 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,17 +26,38 @@
|
||||
|
||||
package org.alfresco.rest.api.tests;
|
||||
|
||||
import static org.alfresco.rest.api.tests.util.RestApiUtil.toJsonAsString;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import static org.alfresco.rest.api.tests.util.RestApiUtil.toJsonAsString;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import com.google.common.collect.Ordering;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.content.MimetypeMap;
|
||||
import org.alfresco.repo.content.transform.swf.SWFTransformationOptions;
|
||||
import org.alfresco.repo.rendition2.RenditionService2Impl;
|
||||
import org.alfresco.repo.rendition2.SynchronousTransformClient;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper;
|
||||
import org.alfresco.rest.api.model.Site;
|
||||
import org.alfresco.rest.api.nodes.NodesEntityResource;
|
||||
import org.alfresco.rest.api.tests.RepoService.TestNetwork;
|
||||
@@ -54,23 +75,11 @@ import org.alfresco.rest.api.tests.util.MultiPartBuilder.FileData;
|
||||
import org.alfresco.rest.api.tests.util.MultiPartBuilder.MultiPartRequest;
|
||||
import org.alfresco.rest.api.tests.util.RestApiUtil;
|
||||
import org.alfresco.service.cmr.repository.ContentService;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.StoreRef;
|
||||
import org.alfresco.service.cmr.site.SiteVisibility;
|
||||
import org.alfresco.service.cmr.thumbnail.ThumbnailService;
|
||||
import org.alfresco.util.TempFileProvider;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* V1 REST API tests for Renditions
|
||||
@@ -98,12 +107,15 @@ public class RenditionsTest extends AbstractBaseApiTest
|
||||
|
||||
protected static ContentService contentService;
|
||||
private static SynchronousTransformClient synchronousTransformClient;
|
||||
private RetryingTransactionHelper transactionHelper;
|
||||
|
||||
@Before
|
||||
public void setup() throws Exception
|
||||
{
|
||||
contentService = applicationContext.getBean("contentService", ContentService.class);
|
||||
synchronousTransformClient = applicationContext.getBean("synchronousTransformClient", SynchronousTransformClient.class);
|
||||
transactionHelper = (RetryingTransactionHelper) this.applicationContext
|
||||
.getBean("retryingTransactionHelper");
|
||||
networkN1 = repoService.createNetworkWithAlias("ping", true);
|
||||
networkN1.create();
|
||||
userOneN1 = networkN1.createUser();
|
||||
@@ -123,7 +135,9 @@ public class RenditionsTest extends AbstractBaseApiTest
|
||||
|
||||
/**
|
||||
* Tests get node renditions.
|
||||
* <p>GET:</p>
|
||||
* <p>
|
||||
* GET:
|
||||
* </p>
|
||||
* {@literal <host>:<port>/alfresco/api/<networkId>/public/alfresco/versions/1/nodes/<nodeId>/renditions}
|
||||
*/
|
||||
@Test
|
||||
@@ -263,7 +277,9 @@ public class RenditionsTest extends AbstractBaseApiTest
|
||||
|
||||
/**
|
||||
* Tests get node rendition.
|
||||
* <p>GET:</p>
|
||||
* <p>
|
||||
* GET:
|
||||
* </p>
|
||||
* {@literal <host>:<port>/alfresco/api/<networkId>/public/alfresco/versions/1/nodes/<nodeId>/renditions/<renditionId>}
|
||||
*/
|
||||
@Test
|
||||
@@ -331,8 +347,8 @@ public class RenditionsTest extends AbstractBaseApiTest
|
||||
String jpgFileName = "quick.jpg";
|
||||
File jpgFile = getResourceFile(fileName);
|
||||
reqBody = MultiPartBuilder.create()
|
||||
.setFileData(new FileData(jpgFileName, jpgFile))
|
||||
.build();
|
||||
.setFileData(new FileData(jpgFileName, jpgFile))
|
||||
.build();
|
||||
|
||||
// Upload quick.jpg file into 'folder'
|
||||
response = post(getNodeChildrenUrl(folder_Id), reqBody.getBody(), null, reqBody.getContentType(), 201);
|
||||
@@ -352,7 +368,9 @@ public class RenditionsTest extends AbstractBaseApiTest
|
||||
|
||||
/**
|
||||
* Tests create rendition.
|
||||
* <p>POST:</p>
|
||||
* <p>
|
||||
* POST:
|
||||
* </p>
|
||||
* {@literal <host>:<port>/alfresco/api/<networkId>/public/alfresco/versions/1/nodes/<nodeId>/renditions}
|
||||
*/
|
||||
@Test
|
||||
@@ -411,18 +429,18 @@ public class RenditionsTest extends AbstractBaseApiTest
|
||||
|
||||
if (areLocalTransformsAvailable())
|
||||
{
|
||||
// Create a node without any content
|
||||
String emptyContentNodeId = addToDocumentLibrary(userOneN1Site, "emptyDoc.txt", TYPE_CM_CONTENT, userOneN1.getId());
|
||||
post(getNodeRenditionsUrl(emptyContentNodeId), toJsonAsString(renditionRequest), 202);
|
||||
// Create a node without any content
|
||||
String emptyContentNodeId = addToDocumentLibrary(userOneN1Site, "emptyDoc.txt", TYPE_CM_CONTENT, userOneN1.getId());
|
||||
post(getNodeRenditionsUrl(emptyContentNodeId), toJsonAsString(renditionRequest), 202);
|
||||
|
||||
// Rendition for binary content
|
||||
String content = "The quick brown fox jumps over the lazy dog.";
|
||||
file = TempFileProvider.createTempFile(new ByteArrayInputStream(content.getBytes()), getClass().getSimpleName(), ".bin");
|
||||
multiPartBuilder = MultiPartBuilder.create().setFileData(new FileData("binaryFileName", file));
|
||||
reqBody = multiPartBuilder.build();
|
||||
response = post(getNodeChildrenUrl(folder_Id), reqBody.getBody(), null, reqBody.getContentType(), 201);
|
||||
Document binaryDocument = RestApiUtil.parseRestApiEntry(response.getJsonResponse(), Document.class);
|
||||
post(getNodeRenditionsUrl(binaryDocument.getId()), toJsonAsString(renditionRequest), 202);
|
||||
// Rendition for binary content
|
||||
String content = "The quick brown fox jumps over the lazy dog.";
|
||||
file = TempFileProvider.createTempFile(new ByteArrayInputStream(content.getBytes()), getClass().getSimpleName(), ".bin");
|
||||
multiPartBuilder = MultiPartBuilder.create().setFileData(new FileData("binaryFileName", file));
|
||||
reqBody = multiPartBuilder.build();
|
||||
response = post(getNodeChildrenUrl(folder_Id), reqBody.getBody(), null, reqBody.getContentType(), 201);
|
||||
Document binaryDocument = RestApiUtil.parseRestApiEntry(response.getJsonResponse(), Document.class);
|
||||
post(getNodeRenditionsUrl(binaryDocument.getId()), toJsonAsString(renditionRequest), 202);
|
||||
}
|
||||
|
||||
//
|
||||
@@ -563,7 +581,9 @@ public class RenditionsTest extends AbstractBaseApiTest
|
||||
/**
|
||||
* Tests create rendition when on upload/create of a file
|
||||
*
|
||||
* <p>POST:</p>
|
||||
* <p>
|
||||
* POST:
|
||||
* </p>
|
||||
* {@literal <host>:<port>/alfresco/api/<networkId>/public/alfresco/versions/1/nodes/<nodeId>/children}
|
||||
*/
|
||||
@Test
|
||||
@@ -619,25 +639,11 @@ public class RenditionsTest extends AbstractBaseApiTest
|
||||
assertRenditionCreatedWithWait(contentNodeId, renditionName);
|
||||
}
|
||||
|
||||
/* RA-834: commented-out since not currently applicable for empty file
|
||||
Document d1 = new Document();
|
||||
d1.setName("d1.txt");
|
||||
d1.setNodeType("cm:content");
|
||||
ContentInfo ci = new ContentInfo();
|
||||
ci.setMimeType(MimetypeMap.MIMETYPE_TEXT_PLAIN);
|
||||
d1.setContent(ci);
|
||||
|
||||
// create empty file including request to generate a thumbnail
|
||||
renditionName = "doclib";
|
||||
response = post(getNodeChildrenUrl(folder_Id), userId, toJsonAsStringNonNull(d1), "?renditions="+renditionName, 201);
|
||||
Document documentResp = RestApiUtil.parseRestApiEntry(response.getJsonResponse(), Document.class);
|
||||
String d1Id = documentResp.getId();
|
||||
|
||||
// wait and check that rendition is created ...
|
||||
rendition = waitAndGetRendition(userId, d1Id, renditionName);
|
||||
assertNotNull(rendition);
|
||||
assertEquals(RenditionStatus.CREATED, rendition.getStatus());
|
||||
*/
|
||||
/* RA-834: commented-out since not currently applicable for empty file Document d1 = new Document(); d1.setName("d1.txt"); d1.setNodeType("cm:content"); ContentInfo ci = new ContentInfo(); ci.setMimeType(MimetypeMap.MIMETYPE_TEXT_PLAIN); d1.setContent(ci);
|
||||
*
|
||||
* // create empty file including request to generate a thumbnail renditionName = "doclib"; response = post(getNodeChildrenUrl(folder_Id), userId, toJsonAsStringNonNull(d1), "?renditions="+renditionName, 201); Document documentResp = RestApiUtil.parseRestApiEntry(response.getJsonResponse(), Document.class); String d1Id = documentResp.getId();
|
||||
*
|
||||
* // wait and check that rendition is created ... rendition = waitAndGetRendition(userId, d1Id, renditionName); assertNotNull(rendition); assertEquals(RenditionStatus.CREATED, rendition.getStatus()); */
|
||||
|
||||
// Multiple renditions requested
|
||||
reqBody = MultiPartBuilder.create()
|
||||
@@ -730,7 +736,7 @@ public class RenditionsTest extends AbstractBaseApiTest
|
||||
|
||||
params = new HashMap<>();
|
||||
params.put("placeholder", "false");
|
||||
getSingle(getNodeRenditionsUrl(contentNodeId), (RENDITION_NAME+"/content"), params, 404);
|
||||
getSingle(getNodeRenditionsUrl(contentNodeId), (RENDITION_NAME + "/content"), params, 404);
|
||||
|
||||
// TODO add test to request creation of rendition as another user (that has read-only access on the content, not write)
|
||||
|
||||
@@ -747,7 +753,7 @@ public class RenditionsTest extends AbstractBaseApiTest
|
||||
|
||||
params = new HashMap<>();
|
||||
params.put("placeholder", "false");
|
||||
response = getSingle(getNodeRenditionsUrl(contentNodeId), (RENDITION_NAME+"/content"), params, 200);
|
||||
response = getSingle(getNodeRenditionsUrl(contentNodeId), (RENDITION_NAME + "/content"), params, 200);
|
||||
|
||||
byte[] renditionBytes1 = response.getResponseAsBytes();
|
||||
assertNotNull(renditionBytes1);
|
||||
@@ -757,7 +763,7 @@ public class RenditionsTest extends AbstractBaseApiTest
|
||||
response = getSingle(NodesEntityResource.class, contentNodeId, params, 200);
|
||||
Document document1b = RestApiUtil.parseRestApiEntry(response.getJsonResponse(), Document.class);
|
||||
|
||||
// assertEquals(document1b.getModifiedAt(), document1.getModifiedAt());
|
||||
// assertEquals(document1b.getModifiedAt(), document1.getModifiedAt());
|
||||
assertEquals(document1b.getModifiedByUser().getId(), document1.getModifiedByUser().getId());
|
||||
assertEquals(document1b.getModifiedByUser().getDisplayName(), document1.getModifiedByUser().getDisplayName());
|
||||
|
||||
@@ -781,7 +787,7 @@ public class RenditionsTest extends AbstractBaseApiTest
|
||||
|
||||
params = new HashMap<>();
|
||||
params.put("placeholder", "false");
|
||||
response = getSingle(getNodeRenditionsUrl(contentNodeId), (RENDITION_NAME+"/content"), params, 200);
|
||||
response = getSingle(getNodeRenditionsUrl(contentNodeId), (RENDITION_NAME + "/content"), params, 200);
|
||||
assertNotNull(response.getResponseAsBytes());
|
||||
|
||||
// check rendition binary has changed
|
||||
@@ -792,7 +798,7 @@ public class RenditionsTest extends AbstractBaseApiTest
|
||||
response = getSingle(NodesEntityResource.class, contentNodeId, params, 200);
|
||||
Document document2b = RestApiUtil.parseRestApiEntry(response.getJsonResponse(), Document.class);
|
||||
|
||||
// assertTrue(document2b.getModifiedAt().after(document1.getModifiedAt()));
|
||||
// assertTrue(document2b.getModifiedAt().after(document1.getModifiedAt()));
|
||||
assertEquals(document2b.getModifiedByUser().getId(), document1.getModifiedByUser().getId());
|
||||
assertEquals(document2b.getModifiedByUser().getDisplayName(), document1.getModifiedByUser().getDisplayName());
|
||||
|
||||
@@ -802,7 +808,9 @@ public class RenditionsTest extends AbstractBaseApiTest
|
||||
|
||||
/**
|
||||
* Tests download rendition.
|
||||
* <p>GET:</p>
|
||||
* <p>
|
||||
* GET:
|
||||
* </p>
|
||||
* {@literal <host>:<port>/alfresco/api/<networkId>/public/alfresco/versions/1/nodes/<nodeId>/renditions/<renditionId>/content}
|
||||
*/
|
||||
@Test
|
||||
@@ -818,7 +826,7 @@ public class RenditionsTest extends AbstractBaseApiTest
|
||||
String fileName = "quick.pdf";
|
||||
File file = getResourceFile(fileName);
|
||||
MultiPartBuilder multiPartBuilder = MultiPartBuilder.create()
|
||||
.setFileData(new FileData(fileName, file));
|
||||
.setFileData(new FileData(fileName, file));
|
||||
MultiPartRequest reqBody = multiPartBuilder.build();
|
||||
|
||||
// Upload quick.pdf file into 'folder'
|
||||
@@ -928,8 +936,8 @@ public class RenditionsTest extends AbstractBaseApiTest
|
||||
// the old fileName and setting overwrite field to true
|
||||
file = getResourceFile("quick-2.pdf");
|
||||
multiPartBuilder = MultiPartBuilder.create()
|
||||
.setFileData(new FileData(fileName, file))
|
||||
.setOverwrite(true);
|
||||
.setFileData(new FileData(fileName, file))
|
||||
.setOverwrite(true);
|
||||
reqBody = multiPartBuilder.build();
|
||||
|
||||
// Update quick.pdf
|
||||
@@ -937,7 +945,7 @@ public class RenditionsTest extends AbstractBaseApiTest
|
||||
|
||||
// The requested "If-Modified-Since" date is older than rendition modified date
|
||||
response = getSingleWithDelayRetry(getNodeRenditionsUrl(contentNodeId), "doclib/content", params, headers, MAX_RETRY,
|
||||
PAUSE_TIME, 200);
|
||||
PAUSE_TIME, 200);
|
||||
assertNotNull(response);
|
||||
responseHeaders = response.getHeaders();
|
||||
assertNotNull(responseHeaders);
|
||||
@@ -945,7 +953,7 @@ public class RenditionsTest extends AbstractBaseApiTest
|
||||
assertNotNull(newLastModifiedHeader);
|
||||
assertNotEquals(lastModifiedHeader, newLastModifiedHeader);
|
||||
|
||||
//-ve tests
|
||||
// -ve tests
|
||||
// nodeId in the path parameter does not represent a file
|
||||
getSingle(getNodeRenditionsUrl(folder_Id), "doclib/content", 400);
|
||||
|
||||
@@ -958,8 +966,8 @@ public class RenditionsTest extends AbstractBaseApiTest
|
||||
InputStream inputStream = new ByteArrayInputStream("The quick brown fox jumps over the lazy dog".getBytes());
|
||||
file = TempFileProvider.createTempFile(inputStream, "RenditionsTest-", ".abcdef");
|
||||
reqBody = MultiPartBuilder.create()
|
||||
.setFileData(new FileData(file.getName(), file))
|
||||
.build();
|
||||
.setFileData(new FileData(file.getName(), file))
|
||||
.build();
|
||||
// Upload temp file into 'folder'
|
||||
response = post(getNodeChildrenUrl(folder_Id), reqBody.getBody(), null, reqBody.getContentType(), 201);
|
||||
document = RestApiUtil.parseRestApiEntry(response.getJsonResponse(), Document.class);
|
||||
@@ -981,6 +989,72 @@ public class RenditionsTest extends AbstractBaseApiTest
|
||||
getSingle(getNodeRenditionsUrl(emptyContentNodeId), "doclib/content", params, 200);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test recreation of rendition2 aspect.
|
||||
* <p>
|
||||
* POST:
|
||||
* </p>
|
||||
* <p>
|
||||
* DELETE:
|
||||
* </p>
|
||||
* {@literal <host>:<port>/alfresco/api/<networkId>/public/alfresco/versions/1/nodes/<nodeId>/renditions} {@literal <host>:<port>/alfresco/api/<networkId>/public/alfresco/versions/1/nodes/<nodeId>/renditions/{renditionID}
|
||||
*/
|
||||
@Test
|
||||
public void testRecreationOfRendition2() throws Exception
|
||||
{
|
||||
setRequestContext(networkN1.getId(), userOneN1.getId(), null);
|
||||
|
||||
// Create a folder within the site document's library
|
||||
String folderName = "folder" + System.currentTimeMillis();
|
||||
String folderId = addToDocumentLibrary(userOneN1Site, folderName, TYPE_CM_FOLDER, userOneN1.getId());
|
||||
|
||||
// Create multipart request.
|
||||
String renditionName = "pdf";
|
||||
String fileName = "quick.pdf";
|
||||
File file = getResourceFile(fileName);
|
||||
MultiPartRequest reqBody = MultiPartBuilder.create()
|
||||
.setFileData(new FileData(fileName, file))
|
||||
.setRenditions(Collections.singletonList(renditionName))
|
||||
.build();
|
||||
|
||||
// Upload quick.pdf file into 'folder'
|
||||
HttpResponse response = post(getNodeChildrenUrl(folderId), 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());
|
||||
|
||||
Thread.sleep(DELAY_IN_MS);
|
||||
|
||||
delete(getNodeRenditionIdUrl(contentNodeId, renditionName), null, null, null, null, 204);
|
||||
// retry to double-check deletion
|
||||
delete(getNodeRenditionIdUrl(contentNodeId, renditionName), null, null, null, null, 404);
|
||||
|
||||
AuthenticationUtil.setFullyAuthenticatedUser(AuthenticationUtil.getAdminUserName());
|
||||
|
||||
ThumbnailService thumbnailService = applicationContext.getBean("thumbnailService", ThumbnailService.class);
|
||||
|
||||
SWFTransformationOptions swfTransformationOptions = new SWFTransformationOptions();
|
||||
swfTransformationOptions.setUse("pdf");
|
||||
|
||||
NodeRef thumbNode = transactionHelper
|
||||
.doInTransaction(
|
||||
() -> thumbnailService.createThumbnail(getFolderNodeRef(contentNodeId), ContentModel.PROP_CONTENT,
|
||||
MimetypeMap.MIMETYPE_PDF, swfTransformationOptions, "pdf"));
|
||||
|
||||
assertNotNull(thumbNode);
|
||||
assertNotEquals("Both, we are getting same rendition Id's", rendition.getId(), thumbNode.getId());
|
||||
|
||||
}
|
||||
|
||||
private NodeRef getFolderNodeRef(String folderId)
|
||||
{
|
||||
return new NodeRef(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, folderId);
|
||||
}
|
||||
|
||||
private String addToDocumentLibrary(Site testSite, String name, String nodeType, String userId) throws Exception
|
||||
{
|
||||
String parentId = getSiteContainerNodeId(testSite.getId(), "documentLibrary");
|
||||
|
||||
@@ -27,7 +27,7 @@ to integrate with a number of external Authentication providers including
|
||||
* https://github.com/Alfresco/alfresco-data-model/tree/master/src/main/java/org/alfresco/repo/security/authentication
|
||||
* License: LGPL
|
||||
* Issue Tracker Link: https://issues.alfresco.com/jira/issues/?jql=project%3DREPO
|
||||
* Documentation Link: https://support.hyland.com/r/Alfresco/Alfresco-Content-Services-Community-Edition/23.4/Alfresco-Content-Services-Community-Edition/Administer/Manage-Security/Authentication-and-sync
|
||||
* Documentation Link: http://docs.alfresco.com/5.2/concepts/auth-intro.html
|
||||
* Contribution Model: Alfresco Open Source
|
||||
***
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
* Source Code Link:m https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/
|
||||
* License: LGPL
|
||||
* Issue Tracker Link: https://issues.alfresco.com/jira/secure/RapidBoard.jspa?projectKey=REPO&useStoredSettings=true&rapidView=379
|
||||
* Documentation Link: https://support.hyland.com/r/Alfresco/Alfresco-Content-Services/23.4/Alfresco-Content-Services/Configure/Repository/About-Versioning
|
||||
* Documentation Link: http://docs.alfresco.com/5.1/concepts/versioning.html
|
||||
* Contribution Model: Alfresco publishes the source code and will review proposed patch requests
|
||||
***
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>25.1.1.1</version>
|
||||
<version>25.1.0.68-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -542,7 +542,10 @@ public class EventGenerator extends AbstractLifecycleBean implements Initializin
|
||||
@Override
|
||||
protected void onShutdown(ApplicationEvent applicationEvent)
|
||||
{
|
||||
// NOOP
|
||||
if (eventSender != null)
|
||||
{
|
||||
eventSender.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
protected class EventTransactionListener extends TransactionListenerAdapter
|
||||
|
||||
@@ -52,7 +52,7 @@ public interface EventSender
|
||||
}
|
||||
|
||||
/**
|
||||
* It's called when the bean instance is destroyed, allowing to perform cleanup operations.
|
||||
* It's called when the application context is closing, allowing {@link org.alfresco.repo.event2.EventGenerator} to perform cleanup operations.
|
||||
*/
|
||||
default void destroy()
|
||||
{
|
||||
|
||||
@@ -25,16 +25,15 @@
|
||||
*/
|
||||
package org.alfresco.repo.event2;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.Executor;
|
||||
import jakarta.annotation.Nonnull;
|
||||
|
||||
import org.alfresco.util.PropertyCheck;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.beans.factory.config.AbstractFactoryBean;
|
||||
import org.springframework.core.env.PropertyResolver;
|
||||
|
||||
import org.alfresco.util.PropertyCheck;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
public class EventSenderFactoryBean extends AbstractFactoryBean<EventSender>
|
||||
{
|
||||
@@ -52,7 +51,7 @@ public class EventSenderFactoryBean extends AbstractFactoryBean<EventSender>
|
||||
private boolean legacySkipQueueConfig;
|
||||
|
||||
public EventSenderFactoryBean(@Autowired PropertyResolver propertyResolver, Event2MessageProducer event2MessageProducer,
|
||||
Executor enqueueThreadPoolExecutor, Executor dequeueThreadPoolExecutor)
|
||||
Executor enqueueThreadPoolExecutor, Executor dequeueThreadPoolExecutor)
|
||||
{
|
||||
super();
|
||||
PropertyCheck.mandatory(this, "propertyResolver", propertyResolver);
|
||||
@@ -156,13 +155,4 @@ public class EventSenderFactoryBean extends AbstractFactoryBean<EventSender>
|
||||
{
|
||||
return event2MessageProducer;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void destroyInstance(EventSender eventSender)
|
||||
{
|
||||
if (eventSender != null)
|
||||
{
|
||||
eventSender.destroy();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -57,7 +57,7 @@ public class NodeSizeDetailsServiceImpl implements NodeSizeDetailsService, Initi
|
||||
{
|
||||
private static final Logger LOG = LoggerFactory.getLogger(NodeSizeDetailsServiceImpl.class);
|
||||
private static final String FIELD_FACET = "content.size";
|
||||
private static final String FACET_QUERY = "{!afts}content.size:[0 TO " + Integer.MAX_VALUE + "]";
|
||||
private static final String FACET_QUERY = "{!afts key='extra large'}content.size:[0 TO " + Integer.MAX_VALUE + "]";
|
||||
private SearchService searchService;
|
||||
private SimpleCache<Serializable, NodeSizeDetails> simpleCache;
|
||||
private TransactionService transactionService;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Repository
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2016 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2025 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
@@ -37,6 +37,10 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.model.RenditionModel;
|
||||
@@ -76,13 +80,9 @@ import org.alfresco.service.namespace.NamespaceException;
|
||||
import org.alfresco.service.namespace.NamespaceService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.util.GUID;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
|
||||
/**
|
||||
* This class adds some new behaviour to the standard ActionExecuterAbstractBase
|
||||
* in order to support the RenditionService.
|
||||
* This class adds some new behaviour to the standard ActionExecuterAbstractBase in order to support the RenditionService.
|
||||
*
|
||||
* @author Neil McErlean
|
||||
* @author Nick Smith
|
||||
@@ -112,28 +112,24 @@ public abstract class AbstractRenderingEngine extends ActionExecuterAbstractBase
|
||||
// for the two params
|
||||
|
||||
/**
|
||||
* This is the default default node type for renditions - used if no value
|
||||
* is injected from spring.
|
||||
* This is the default default node type for renditions - used if no value is injected from spring.
|
||||
*/
|
||||
private static final QName DEFAULT_DEFAULT_RENDITION_NODE_TYPE = ContentModel.TYPE_CONTENT;
|
||||
|
||||
/**
|
||||
* This is the default default property used to specify where rendition
|
||||
* content is stored - used if no value is injected from spring.
|
||||
* This is the default default property used to specify where rendition content is stored - used if no value is injected from spring.
|
||||
*/
|
||||
private static final QName DEFAULT_DEFAULT_RENDITION_CONTENT_PROP = RenditionService2Impl.DEFAULT_RENDITION_CONTENT_PROP;
|
||||
private static final String DEFAULT_MIMETYPE = RenditionService2Impl.DEFAULT_MIMETYPE;
|
||||
private static final String DEFAULT_ENCODING = RenditionService2Impl.DEFAULT_ENCODING;
|
||||
|
||||
/**
|
||||
* This is the default node type that is used when creating rendition
|
||||
* objects.
|
||||
* This is the default node type that is used when creating rendition objects.
|
||||
*/
|
||||
private QName defaultRenditionNodeType = DEFAULT_DEFAULT_RENDITION_NODE_TYPE;
|
||||
|
||||
/**
|
||||
* This is the default property that is used to store rendition objects'
|
||||
* content.
|
||||
* This is the default property that is used to store rendition objects' content.
|
||||
*/
|
||||
private QName defaultRenditionContentProp = DEFAULT_DEFAULT_RENDITION_CONTENT_PROP;
|
||||
|
||||
@@ -150,55 +146,39 @@ public abstract class AbstractRenderingEngine extends ActionExecuterAbstractBase
|
||||
|
||||
/* Parameter names common to all Rendering Actions */
|
||||
/**
|
||||
* This optional {@link String} parameter specifies the location of a
|
||||
* classpath resource which can be used as a placeholder while a rendition
|
||||
* is being generated. For example, this might be a simple icon to indicate
|
||||
* a rendition is not yet available. This is intended to be used in
|
||||
* conjunction with asynchronous generation of renditions.
|
||||
* This optional {@link String} parameter specifies the location of a classpath resource which can be used as a placeholder while a rendition is being generated. For example, this might be a simple icon to indicate a rendition is not yet available. This is intended to be used in conjunction with asynchronous generation of renditions.
|
||||
*/
|
||||
public static final String PARAM_PLACEHOLDER_RESOURCE_PATH = "placeHolderResourcePath";
|
||||
|
||||
/**
|
||||
* This optional {@link QName} parameter specifies which property the
|
||||
* Rendering Engine uses to read content from the source node in order to
|
||||
* create a rendition. By default this property will be cm:content.
|
||||
* This optional {@link QName} parameter specifies which property the Rendering Engine uses to read content from the source node in order to create a rendition. By default this property will be cm:content.
|
||||
*/
|
||||
public static final String PARAM_SOURCE_CONTENT_PROPERTY = "sourceContentProperty";
|
||||
|
||||
/**
|
||||
* This optional {@link QName} parameter specifies which property the
|
||||
* Rendering Engine uses to write content to the rendition node. By default
|
||||
* the property used is cm:content.
|
||||
* This optional {@link QName} parameter specifies which property the Rendering Engine uses to write content to the rendition node. By default the property used is cm:content.
|
||||
*/
|
||||
public static final String PARAM_TARGET_CONTENT_PROPERTY = "targetContentProperty";
|
||||
|
||||
/**
|
||||
* This optional {@link Boolean} flag property specifies whether a rendition
|
||||
* should be updated automatically if the source node changes. If set to
|
||||
* <code>true</code> then the rendition will be re-rendered any time any
|
||||
* property changes occur on the source node. This parameter defaults to
|
||||
* <code>false</code>.
|
||||
* This optional {@link Boolean} flag property specifies whether a rendition should be updated automatically if the source node changes. If set to <code>true</code> then the rendition will be re-rendered any time any property changes occur on the source node. This parameter defaults to <code>false</code>.
|
||||
*/
|
||||
public static final String PARAM_UPDATE_RENDITIONS_ON_ANY_PROPERTY_CHANGE = "update-renditions-on-any-property-change";
|
||||
|
||||
/**
|
||||
* This optional {@link String} parameter specifies what user permissions
|
||||
* are used when creating a rendition. By default the system user is used.
|
||||
* This optional {@link String} parameter specifies what user permissions are used when creating a rendition. By default the system user is used.
|
||||
*/
|
||||
public static final String PARAM_RUN_AS = "runAs";
|
||||
|
||||
// mime-type is not a common parameter on all Rendering Actions, but it is
|
||||
// common to many and is used in some common handling code in this class.
|
||||
/**
|
||||
* This optional {@link String} parameter specifies the mime type of the
|
||||
* rendition content. This defaults to the mime type of the source node
|
||||
* content.
|
||||
* This optional {@link String} parameter specifies the mime type of the rendition content. This defaults to the mime type of the source node content.
|
||||
*/
|
||||
public static final String PARAM_MIME_TYPE = "mime-type";
|
||||
|
||||
/**
|
||||
* This optional {@link String} paramter specifies the encoding used to
|
||||
* create the rendition content. The derfault encoding is UTF-8.
|
||||
* This optional {@link String} paramter specifies the encoding used to create the rendition content. The derfault encoding is UTF-8.
|
||||
*/
|
||||
public static final String PARAM_ENCODING = "encoding";
|
||||
|
||||
@@ -207,9 +187,7 @@ public abstract class AbstractRenderingEngine extends ActionExecuterAbstractBase
|
||||
*/
|
||||
private final static NodeLocator defaultNodeLocator = new SelfNodeLocator();
|
||||
|
||||
/*
|
||||
* Injected beans
|
||||
*/
|
||||
/* Injected beans */
|
||||
private RenditionLocationResolver renditionLocationResolver;
|
||||
protected NodeService nodeService;
|
||||
private RenditionService renditionService;
|
||||
@@ -232,7 +210,8 @@ public abstract class AbstractRenderingEngine extends ActionExecuterAbstractBase
|
||||
/**
|
||||
* Injects the renditionService bean.
|
||||
*
|
||||
* @param renditionService RenditionService
|
||||
* @param renditionService
|
||||
* RenditionService
|
||||
*/
|
||||
public void setRenditionService(RenditionService renditionService)
|
||||
{
|
||||
@@ -240,7 +219,8 @@ public abstract class AbstractRenderingEngine extends ActionExecuterAbstractBase
|
||||
}
|
||||
|
||||
/**
|
||||
* @param behaviourFilter policy behaviour filter
|
||||
* @param behaviourFilter
|
||||
* policy behaviour filter
|
||||
*/
|
||||
public void setBehaviourFilter(BehaviourFilter behaviourFilter)
|
||||
{
|
||||
@@ -261,9 +241,9 @@ public abstract class AbstractRenderingEngine extends ActionExecuterAbstractBase
|
||||
{
|
||||
this.publicAction = false;
|
||||
this.temporaryParentNodeLocator = temporaryParentNodeLocator != null ? temporaryParentNodeLocator
|
||||
: defaultNodeLocator;
|
||||
: defaultNodeLocator;
|
||||
this.temporaryRenditionLinkType = temporaryRenditionLinkType != null ? temporaryRenditionLinkType
|
||||
: RenditionModel.ASSOC_RENDITION;
|
||||
: RenditionModel.ASSOC_RENDITION;
|
||||
}
|
||||
|
||||
public AbstractRenderingEngine()
|
||||
@@ -271,12 +251,11 @@ public abstract class AbstractRenderingEngine extends ActionExecuterAbstractBase
|
||||
this(null, null);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Sets the default rendition-node type.
|
||||
*
|
||||
* @param type String
|
||||
* @param type
|
||||
* String
|
||||
*/
|
||||
public void setDefaultRenditionNodeType(String type)
|
||||
{
|
||||
@@ -304,8 +283,7 @@ public abstract class AbstractRenderingEngine extends ActionExecuterAbstractBase
|
||||
/**
|
||||
* This method returns the type of the default rendition node type.
|
||||
*
|
||||
* @return the QName representing the type of the default rendition node
|
||||
* type.
|
||||
* @return the QName representing the type of the default rendition node type.
|
||||
*/
|
||||
protected QName getDefaultRenditionNodeType()
|
||||
{
|
||||
@@ -325,7 +303,8 @@ public abstract class AbstractRenderingEngine extends ActionExecuterAbstractBase
|
||||
/**
|
||||
* Sets the default rendition content property.
|
||||
*
|
||||
* @param prop String
|
||||
* @param prop
|
||||
* String
|
||||
*/
|
||||
public void setDefaultRenditionContentProp(String prop)
|
||||
{
|
||||
@@ -351,11 +330,9 @@ public abstract class AbstractRenderingEngine extends ActionExecuterAbstractBase
|
||||
}
|
||||
|
||||
/**
|
||||
* This method returns the QName of the property that defines the location
|
||||
* of the rendition content. An example would be cm:content.
|
||||
* This method returns the QName of the property that defines the location of the rendition content. An example would be cm:content.
|
||||
*
|
||||
* @return the QName the property defining the location of the rendition
|
||||
* content.
|
||||
* @return the QName the property defining the location of the rendition content.
|
||||
*/
|
||||
protected QName getDefaultRenditionContentProp()
|
||||
{
|
||||
@@ -365,7 +342,8 @@ public abstract class AbstractRenderingEngine extends ActionExecuterAbstractBase
|
||||
/**
|
||||
* Set the content service
|
||||
*
|
||||
* @param contentService the content service
|
||||
* @param contentService
|
||||
* the content service
|
||||
*/
|
||||
public void setContentService(ContentService contentService)
|
||||
{
|
||||
@@ -391,7 +369,7 @@ public abstract class AbstractRenderingEngine extends ActionExecuterAbstractBase
|
||||
@Override
|
||||
protected void executeImpl(final Action action, final NodeRef sourceNode)
|
||||
{
|
||||
executeImpl( (RenditionDefinition)action, sourceNode );
|
||||
executeImpl((RenditionDefinition) action, sourceNode);
|
||||
}
|
||||
|
||||
protected void executeImpl(final RenditionDefinition renditionDef, final NodeRef sourceNode)
|
||||
@@ -448,8 +426,7 @@ public abstract class AbstractRenderingEngine extends ActionExecuterAbstractBase
|
||||
// permissions to create content under that node.
|
||||
// For that reason, we execute all rendition actions as system
|
||||
// by default.
|
||||
AuthenticationUtil.runAs(new AuthenticationUtil.RunAsWork<Void>()
|
||||
{
|
||||
AuthenticationUtil.runAs(new AuthenticationUtil.RunAsWork<Void>() {
|
||||
@Override
|
||||
public Void doWork() throws Exception
|
||||
{
|
||||
@@ -461,7 +438,7 @@ public abstract class AbstractRenderingEngine extends ActionExecuterAbstractBase
|
||||
if (isComponentRendition == false)
|
||||
{
|
||||
// Request that the rendition is initially created
|
||||
// as a child of the source node
|
||||
// as a child of the source node
|
||||
setTemporaryRenditionProperties(sourceNode, renditionDef);
|
||||
}
|
||||
|
||||
@@ -475,16 +452,17 @@ public abstract class AbstractRenderingEngine extends ActionExecuterAbstractBase
|
||||
tagSourceNodeAsRenditioned(renditionDef, sourceNode);
|
||||
|
||||
// Currently the rendition is on a temporary node, which may
|
||||
// have the wrong name on it, and for path based renditions is
|
||||
// in the wrong place
|
||||
// have the wrong name on it, and for path based renditions is
|
||||
// in the wrong place
|
||||
// So, have the correct node created, and switch everything to use it
|
||||
switchToFinalRenditionNode(renditionDef, sourceNode);
|
||||
}
|
||||
|
||||
// Grab a link to the rendition node - it's been saved as a parameter for us
|
||||
// (Wait until now to fetch in case it was moved)
|
||||
result = (ChildAssociationRef)renditionDef.getParameterValue(PARAM_RESULT);
|
||||
} catch (Throwable t)
|
||||
result = (ChildAssociationRef) renditionDef.getParameterValue(PARAM_RESULT);
|
||||
}
|
||||
catch (Throwable t)
|
||||
{
|
||||
notifyCallbackOfException(renditionDef, t);
|
||||
throwWrappedException(t);
|
||||
@@ -499,18 +477,16 @@ public abstract class AbstractRenderingEngine extends ActionExecuterAbstractBase
|
||||
}
|
||||
|
||||
/**
|
||||
* Is this a standalone rendition, or is it a sub-component of
|
||||
* a composite rendition?
|
||||
* This is false for standalone renditions, AND ALSO false for
|
||||
* the main part of a composite rendition.
|
||||
* This only returns true if we're currently processing a
|
||||
* component of a composite rendition.
|
||||
* @param action Action
|
||||
* Is this a standalone rendition, or is it a sub-component of a composite rendition? This is false for standalone renditions, AND ALSO false for the main part of a composite rendition. This only returns true if we're currently processing a component of a composite rendition.
|
||||
*
|
||||
* @param action
|
||||
* Action
|
||||
* @return boolean
|
||||
*/
|
||||
private boolean isComponentRendition(Action action) {
|
||||
private boolean isComponentRendition(Action action)
|
||||
{
|
||||
Serializable s = action.getParameterValue(PARAM_IS_COMPONENT_RENDITION);
|
||||
boolean result = s == null ? false : (Boolean)s;
|
||||
boolean result = s == null ? false : (Boolean) s;
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -520,8 +496,8 @@ public abstract class AbstractRenderingEngine extends ActionExecuterAbstractBase
|
||||
{
|
||||
StringBuilder msg = new StringBuilder();
|
||||
msg.append("Executing rendering engine; name:")
|
||||
.append(this.name).append(", class:")
|
||||
.append(this.getClass().getName());
|
||||
.append(this.name).append(", class:")
|
||||
.append(this.getClass().getName());
|
||||
logger.debug(msg.toString());
|
||||
}
|
||||
|
||||
@@ -532,8 +508,8 @@ public abstract class AbstractRenderingEngine extends ActionExecuterAbstractBase
|
||||
QName targetContentProp = getRenditionContentProperty(renditionDefinition);
|
||||
|
||||
RenderingContext context = new RenderingContext(sourceNode,
|
||||
renditionDefinition,
|
||||
targetContentProp);
|
||||
renditionDefinition,
|
||||
targetContentProp);
|
||||
render(context);
|
||||
// This is a workaround for the fact that actions don't have return
|
||||
// values.
|
||||
@@ -541,10 +517,7 @@ public abstract class AbstractRenderingEngine extends ActionExecuterAbstractBase
|
||||
}
|
||||
|
||||
/**
|
||||
* This method can be overridden by subclasses to provide checking of parameter
|
||||
* values.
|
||||
* If a parameter value is illegal or inappropriate, an exception
|
||||
* should be thrown.
|
||||
* This method can be overridden by subclasses to provide checking of parameter values. If a parameter value is illegal or inappropriate, an exception should be thrown.
|
||||
*/
|
||||
protected void checkParameterValues(Action action)
|
||||
{
|
||||
@@ -552,7 +525,8 @@ public abstract class AbstractRenderingEngine extends ActionExecuterAbstractBase
|
||||
}
|
||||
|
||||
/**
|
||||
* @param renditionDefinition RenditionDefinition
|
||||
* @param renditionDefinition
|
||||
* RenditionDefinition
|
||||
* @return QName
|
||||
*/
|
||||
protected QName getRenditionContentProperty(RenditionDefinition renditionDefinition)
|
||||
@@ -563,7 +537,8 @@ public abstract class AbstractRenderingEngine extends ActionExecuterAbstractBase
|
||||
protected abstract void render(RenderingContext context);
|
||||
|
||||
/**
|
||||
* @param actionedUponNodeRef NodeRef
|
||||
* @param actionedUponNodeRef
|
||||
* NodeRef
|
||||
*/
|
||||
protected void checkSourceNodeExists(NodeRef actionedUponNodeRef)
|
||||
{
|
||||
@@ -576,13 +551,14 @@ public abstract class AbstractRenderingEngine extends ActionExecuterAbstractBase
|
||||
}
|
||||
|
||||
/**
|
||||
* @param action Action
|
||||
* @param action
|
||||
* Action
|
||||
*/
|
||||
protected RenditionDefinition checkActionIsRenditionDefinition(Action action)
|
||||
{
|
||||
if (action instanceof RenditionDefinition)
|
||||
{
|
||||
return (RenditionDefinition)action;
|
||||
return (RenditionDefinition) action;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -593,7 +569,8 @@ public abstract class AbstractRenderingEngine extends ActionExecuterAbstractBase
|
||||
/**
|
||||
* If no rendition node type is specified, then the default is used
|
||||
*
|
||||
* @param renditionDefinition RenditionDefinition
|
||||
* @param renditionDefinition
|
||||
* RenditionDefinition
|
||||
* @return QName
|
||||
*/
|
||||
private QName getRenditionNodeType(RenditionDefinition renditionDefinition)
|
||||
@@ -608,13 +585,11 @@ public abstract class AbstractRenderingEngine extends ActionExecuterAbstractBase
|
||||
}
|
||||
|
||||
/**
|
||||
* This method gets the parameter definition display label from the properties file.
|
||||
* It looks first for a property whose key has a fixed rendition service-specific
|
||||
* prefix and if that gets null, it then delegates to the standard bean name-based
|
||||
* approach.
|
||||
* This method gets the parameter definition display label from the properties file. It looks first for a property whose key has a fixed rendition service-specific prefix and if that gets null, it then delegates to the standard bean name-based approach.
|
||||
*
|
||||
* @param paramName the name of the parameter
|
||||
* @return the display label of the parameter
|
||||
* @param paramName
|
||||
* the name of the parameter
|
||||
* @return the display label of the parameter
|
||||
*/
|
||||
@Override
|
||||
protected String getParamDisplayLabel(String paramName)
|
||||
@@ -649,19 +624,19 @@ public abstract class AbstractRenderingEngine extends ActionExecuterAbstractBase
|
||||
getParamDisplayLabel(PARAM_UPDATE_RENDITIONS_ON_ANY_PROPERTY_CHANGE)));
|
||||
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_RENDITION_NODETYPE, DataTypeDefinition.QNAME, false,
|
||||
getParamDisplayLabel(PARAM_RENDITION_NODETYPE)));
|
||||
getParamDisplayLabel(PARAM_RENDITION_NODETYPE)));
|
||||
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_PLACEHOLDER_RESOURCE_PATH, DataTypeDefinition.TEXT, false,
|
||||
getParamDisplayLabel(PARAM_PLACEHOLDER_RESOURCE_PATH)));
|
||||
getParamDisplayLabel(PARAM_PLACEHOLDER_RESOURCE_PATH)));
|
||||
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_SOURCE_CONTENT_PROPERTY, DataTypeDefinition.QNAME, false,
|
||||
getParamDisplayLabel(PARAM_SOURCE_CONTENT_PROPERTY)));
|
||||
getParamDisplayLabel(PARAM_SOURCE_CONTENT_PROPERTY)));
|
||||
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_TARGET_CONTENT_PROPERTY, DataTypeDefinition.QNAME, false,
|
||||
getParamDisplayLabel(PARAM_TARGET_CONTENT_PROPERTY)));
|
||||
getParamDisplayLabel(PARAM_TARGET_CONTENT_PROPERTY)));
|
||||
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_DESTINATION_PATH_TEMPLATE, DataTypeDefinition.TEXT, false,
|
||||
getParamDisplayLabel(PARAM_DESTINATION_PATH_TEMPLATE)));
|
||||
getParamDisplayLabel(PARAM_DESTINATION_PATH_TEMPLATE)));
|
||||
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_ORPHAN_EXISTING_RENDITION, DataTypeDefinition.BOOLEAN, false,
|
||||
getParamDisplayLabel(PARAM_ORPHAN_EXISTING_RENDITION)));
|
||||
@@ -712,14 +687,14 @@ public abstract class AbstractRenderingEngine extends ActionExecuterAbstractBase
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value for the named parameter. Checks the type of the parameter
|
||||
* is correct and throws a {@link RenditionServiceException} if it isn't.
|
||||
* Returns <code>null</code> if the parameter value is <code>null</code>
|
||||
* Gets the value for the named parameter. Checks the type of the parameter is correct and throws a {@link RenditionServiceException} if it isn't. Returns <code>null</code> if the parameter value is <code>null</code>
|
||||
*
|
||||
* @param paramName the name of the parameter being checked.
|
||||
* @param clazz the expected {@link Class} of the parameter value.
|
||||
* @param definition the {@link RenditionDefinition} containing the
|
||||
* parameters.
|
||||
* @param paramName
|
||||
* the name of the parameter being checked.
|
||||
* @param clazz
|
||||
* the expected {@link Class} of the parameter value.
|
||||
* @param definition
|
||||
* the {@link RenditionDefinition} containing the parameters.
|
||||
* @return the parameter value or <code>null</code>.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -730,13 +705,13 @@ public abstract class AbstractRenderingEngine extends ActionExecuterAbstractBase
|
||||
return null;
|
||||
else
|
||||
{
|
||||
if(clazz == null)
|
||||
if (clazz == null)
|
||||
throw new RenditionServiceException("The class must not be null!", new NullPointerException());
|
||||
Class<? extends Serializable> valueClass = value.getClass();
|
||||
if ( !clazz.isAssignableFrom(valueClass))
|
||||
if (!clazz.isAssignableFrom(valueClass))
|
||||
{
|
||||
throw new RenditionServiceException("The parameter: " + paramName + " must be of type: "
|
||||
+ clazz.getName() + "but was of type: " + valueClass.getName());
|
||||
+ clazz.getName() + "but was of type: " + valueClass.getName());
|
||||
}
|
||||
else
|
||||
return (T) value;
|
||||
@@ -744,21 +719,22 @@ public abstract class AbstractRenderingEngine extends ActionExecuterAbstractBase
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value for the named parameter. Checks the type of the parameter
|
||||
* is the same as the type of <code>defaultValue</code> and throws a
|
||||
* {@link RenditionServiceException} if it isn't. Returns
|
||||
* <code>defaultValue</code> if the parameter value is <code>null</code>
|
||||
* Gets the value for the named parameter. Checks the type of the parameter is the same as the type of <code>defaultValue</code> and throws a {@link RenditionServiceException} if it isn't. Returns <code>defaultValue</code> if the parameter value is <code>null</code>
|
||||
*
|
||||
* @param paramName String
|
||||
* @param defaultValue T
|
||||
* @param definition RenditionDefinition
|
||||
* @param <T> T
|
||||
* @param paramName
|
||||
* String
|
||||
* @param defaultValue
|
||||
* T
|
||||
* @param definition
|
||||
* RenditionDefinition
|
||||
* @param <T>
|
||||
* T
|
||||
* @return T
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <T> T getParamWithDefault(String paramName, T defaultValue, RenditionDefinition definition)
|
||||
{
|
||||
if(defaultValue == null)
|
||||
if (defaultValue == null)
|
||||
throw new RenditionServiceException("The defaultValue cannot be null!", new NullPointerException());
|
||||
Class<? extends T> clazz = (Class<? extends T>) defaultValue.getClass();
|
||||
T result = getCheckedParam(paramName, clazz, definition);
|
||||
@@ -776,13 +752,16 @@ public abstract class AbstractRenderingEngine extends ActionExecuterAbstractBase
|
||||
private ChildAssociationRef caNodeRef;
|
||||
|
||||
/**
|
||||
* @param sourceNode NodeRef
|
||||
* @param definition RenditionDefinition
|
||||
* @param renditionContentProperty QName
|
||||
* @param sourceNode
|
||||
* NodeRef
|
||||
* @param definition
|
||||
* RenditionDefinition
|
||||
* @param renditionContentProperty
|
||||
* QName
|
||||
*/
|
||||
public RenderingContext(NodeRef sourceNode,//
|
||||
RenditionDefinition definition,//
|
||||
QName renditionContentProperty)
|
||||
public RenderingContext(NodeRef sourceNode, //
|
||||
RenditionDefinition definition, //
|
||||
QName renditionContentProperty)
|
||||
{
|
||||
this.sourceNode = sourceNode;
|
||||
this.definition = definition;
|
||||
@@ -799,6 +778,7 @@ public abstract class AbstractRenderingEngine extends ActionExecuterAbstractBase
|
||||
|
||||
/**
|
||||
* Lazily instantiation of the ChildAssociationRef
|
||||
*
|
||||
* @return ChildAssociationRef
|
||||
*/
|
||||
public synchronized ChildAssociationRef getChildAssociationRef()
|
||||
@@ -870,7 +850,6 @@ public abstract class AbstractRenderingEngine extends ActionExecuterAbstractBase
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected void tagSourceNodeAsRenditioned(final RenditionDefinition renditionDef, final NodeRef actionedUponNodeRef)
|
||||
{
|
||||
// Adds the 'Renditioned' aspect to the source node if it
|
||||
@@ -896,7 +875,7 @@ public abstract class AbstractRenderingEngine extends ActionExecuterAbstractBase
|
||||
|
||||
protected void switchToFinalRenditionNode(final RenditionDefinition renditionDef, final NodeRef actionedUponNodeRef)
|
||||
{
|
||||
ChildAssociationRef tempRendAssoc = (ChildAssociationRef)renditionDef.getParameterValue(PARAM_RESULT);
|
||||
ChildAssociationRef tempRendAssoc = (ChildAssociationRef) renditionDef.getParameterValue(PARAM_RESULT);
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("Switching temporary rendition: " + tempRendAssoc);
|
||||
@@ -924,7 +903,8 @@ public abstract class AbstractRenderingEngine extends ActionExecuterAbstractBase
|
||||
if (t instanceof AlfrescoRuntimeException)
|
||||
{
|
||||
throw (AlfrescoRuntimeException) t;
|
||||
} else
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new RenditionServiceException(t.getMessage(), t);
|
||||
}
|
||||
@@ -944,11 +924,12 @@ public abstract class AbstractRenderingEngine extends ActionExecuterAbstractBase
|
||||
}
|
||||
|
||||
/**
|
||||
* This method sets the temporary rendition parent node and the rendition assocType on the
|
||||
* rendition definition.
|
||||
* This method sets the temporary rendition parent node and the rendition assocType on the rendition definition.
|
||||
*
|
||||
* @param sourceNode NodeRef
|
||||
* @param definition the rendition definition.
|
||||
* @param sourceNode
|
||||
* NodeRef
|
||||
* @param definition
|
||||
* the rendition definition.
|
||||
*/
|
||||
private void setTemporaryRenditionProperties(NodeRef sourceNode, RenditionDefinition definition)
|
||||
{
|
||||
@@ -962,22 +943,23 @@ public abstract class AbstractRenderingEngine extends ActionExecuterAbstractBase
|
||||
{
|
||||
StringBuilder msg = new StringBuilder();
|
||||
msg.append("Temporary rendition will have parent=").append(parent)
|
||||
.append(" and assoc-type=").append(temporaryRenditionLinkType);
|
||||
.append(" and assoc-type=").append(temporaryRenditionLinkType);
|
||||
logger.debug(msg.toString());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param sourceNode The node that has been rendered
|
||||
* @param tempRendition The relationship between the node and its rendition
|
||||
* @param renditionDefinition The definition of the rendition that has just been performed.
|
||||
* In the case of a composite rendition, this parameter refers
|
||||
* to that CompositeRendition and not to any of its component renditions.
|
||||
* @param sourceNode
|
||||
* The node that has been rendered
|
||||
* @param tempRendition
|
||||
* The relationship between the node and its rendition
|
||||
* @param renditionDefinition
|
||||
* The definition of the rendition that has just been performed. In the case of a composite rendition, this parameter refers to that CompositeRendition and not to any of its component renditions.
|
||||
* @return ChildAssociationRef
|
||||
*/
|
||||
private ChildAssociationRef createOrUpdateRendition(NodeRef sourceNode, ChildAssociationRef tempRendition,
|
||||
RenditionDefinition renditionDefinition)
|
||||
RenditionDefinition renditionDefinition)
|
||||
{
|
||||
NodeRef tempRenditionNode = tempRendition.getChildRef();
|
||||
RenditionLocation renditionLocation = resolveRenditionLocation(sourceNode, renditionDefinition, tempRenditionNode);
|
||||
@@ -1011,17 +993,37 @@ public abstract class AbstractRenderingEngine extends ActionExecuterAbstractBase
|
||||
if (renditionAssoc == null)
|
||||
{
|
||||
String msg = "A rendition of name: " + renditionQName + " should have been created for source node: "
|
||||
+ sourceNode;
|
||||
throw new RenditionServiceException(msg);
|
||||
+ sourceNode;
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug(msg);
|
||||
}
|
||||
// Check if the node has the applied renditioned aspect, and if it does,
|
||||
// remove the existing rendition node and assign the newly created rendition node.
|
||||
if (nodeService.hasAspect(sourceNode, RenditionModel.ASPECT_RENDITIONED))
|
||||
{
|
||||
List<ChildAssociationRef> renditions = nodeService.getChildAssocs(sourceNode, RenditionModel.ASSOC_RENDITION, renditionQName);
|
||||
if (!renditions.isEmpty())
|
||||
{
|
||||
ChildAssociationRef existingRendition = renditions.get(0);
|
||||
nodeService.removeChild(sourceNode, existingRendition.getChildRef());
|
||||
renditionAssoc = renditionNode;
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("Removing the existing rendition node that doesn't have contentData and "
|
||||
+ "assigning the newly created rendition node: " + renditionNode);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Return the link between the source and the new, final rendition
|
||||
return renditionAssoc;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method manages the <code>rn:rendition</code> aspects on the rendition node. It applies the
|
||||
* correct rendition aspect based on the rendition node's location and removes any out-of-date rendition
|
||||
* aspect.
|
||||
* This method manages the <code>rn:rendition</code> aspects on the rendition node. It applies the correct rendition aspect based on the rendition node's location and removes any out-of-date rendition aspect.
|
||||
*/
|
||||
private void manageRenditionAspects(NodeRef sourceNode, ChildAssociationRef renditionParentAssoc)
|
||||
{
|
||||
@@ -1046,7 +1048,8 @@ public abstract class AbstractRenderingEngine extends ActionExecuterAbstractBase
|
||||
// We remove the other aspect to cover the potential case where a
|
||||
// rendition
|
||||
// has been updated in a different location.
|
||||
} else
|
||||
}
|
||||
else
|
||||
{
|
||||
// Renditions stored underneath any node other than their source are
|
||||
// 'visible'.
|
||||
@@ -1064,21 +1067,23 @@ public abstract class AbstractRenderingEngine extends ActionExecuterAbstractBase
|
||||
}
|
||||
|
||||
/**
|
||||
* This method calculates the name for a rendition node. The following approaches are attempted in
|
||||
* the order given below.
|
||||
* This method calculates the name for a rendition node. The following approaches are attempted in the order given below.
|
||||
* <ol>
|
||||
* <li>If a name is defined in the {@link RenditionLocation} then that is used.</li>
|
||||
* <li>If the temporary rendition has a <code>cm:name</code> value, then that is used.</li>
|
||||
* <li>Otherwise use the rendition definition's rendition name.</li>
|
||||
* <li>If a name is defined in the {@link RenditionLocation} then that is used.</li>
|
||||
* <li>If the temporary rendition has a <code>cm:name</code> value, then that is used.</li>
|
||||
* <li>Otherwise use the rendition definition's rendition name.</li>
|
||||
* </ol>
|
||||
*
|
||||
* @param tempRenditionNode the temporary rendition node.
|
||||
* @param location a RenditionLocation struct.
|
||||
* @param renditionDefinition the rendition definition.
|
||||
* @param tempRenditionNode
|
||||
* the temporary rendition node.
|
||||
* @param location
|
||||
* a RenditionLocation struct.
|
||||
* @param renditionDefinition
|
||||
* the rendition definition.
|
||||
* @return the name for the rendition.
|
||||
*/
|
||||
private String getRenditionName(NodeRef tempRenditionNode, RenditionLocation location,
|
||||
RenditionDefinition renditionDefinition)
|
||||
RenditionDefinition renditionDefinition)
|
||||
{
|
||||
// If a location name is set then use it.
|
||||
String locName = location.getChildName();
|
||||
@@ -1097,22 +1102,22 @@ public abstract class AbstractRenderingEngine extends ActionExecuterAbstractBase
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a rendition definition, a source node and a temporary rendition node, this method uses a
|
||||
* {@link RenditionLocationResolver} to calculate the {@link RenditionLocation} of the rendition.
|
||||
* Given a rendition definition, a source node and a temporary rendition node, this method uses a {@link RenditionLocationResolver} to calculate the {@link RenditionLocation} of the rendition.
|
||||
*/
|
||||
protected RenditionLocation resolveRenditionLocation(NodeRef sourceNode, RenditionDefinition definition,
|
||||
NodeRef tempRendition)
|
||||
NodeRef tempRendition)
|
||||
{
|
||||
return renditionLocationResolver.getRenditionLocation(sourceNode, definition, tempRendition);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the <code>ExecutionSummary</code> for the given <code>renderingContext</code>
|
||||
* from the {@link ActionTrackingService}.
|
||||
* Gets the <code>ExecutionSummary</code> for the given <code>renderingContext</code> from the {@link ActionTrackingService}.
|
||||
* <p>
|
||||
* Note that multiple summaries of the same action instance are not currently supported.
|
||||
* @param renderingContext the rendering context
|
||||
* @return the found summary or null
|
||||
*
|
||||
* @param renderingContext
|
||||
* the rendering context
|
||||
* @return the found summary or null
|
||||
*/
|
||||
protected ExecutionSummary getExecutionSummary(RenderingContext renderingContext)
|
||||
{
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
system.err.property_not_set=Property ''{0}'' has not been set: {1} ({2})
|
||||
system.err.duplicate_name=Duplicate child name not allowed: {0}
|
||||
system.err.lucene_not_supported=The lucene search subsystem is not supported. Please see https://support.hyland.com/p/alfresco
|
||||
system.err.lucene_not_supported=The lucene search subsystem is not supported. Please see http://docs.alfresco.com/{0}/tasks/lucene-solr4-migration.html
|
||||
|
||||
# Bootstrap configuration check messages
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
system.err.property_not_set=Vlastnost ''{0}'' nebyla nastavena: {1} ({2})
|
||||
system.err.duplicate_name=Duplicitn\u00ed n\u00e1zvy pod\u0159\u00edzen\u00fdch objekt\u016f nejsou povoleny ({0})
|
||||
system.err.lucene_not_supported=Subsyst\u00e9m hled\u00e1n\u00ed Lucene nen\u00ed podporov\u00e1n. Viz https://support.hyland.com/p/alfresco
|
||||
system.err.lucene_not_supported=Subsyst\u00e9m hled\u00e1n\u00ed Lucene nen\u00ed podporov\u00e1n. Viz http://docs.alfresco.com/{0}/tasks/lucene-solr4-migration.html
|
||||
|
||||
# Bootstrap configuration check messages
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
system.err.property_not_set=Egenskaben ''{0}'' er ikke blevet indstillet: {1} ({2})
|
||||
system.err.duplicate_name=Duplikeret navn p\u00e5 underordnet er ikke tilladt: {0}
|
||||
system.err.lucene_not_supported=Lucene-s\u00f8geundersystemet underst\u00f8ttes ikke. Se https://support.hyland.com/p/alfresco
|
||||
system.err.lucene_not_supported=Lucene-s\u00f8geundersystemet underst\u00f8ttes ikke. Se http://docs.alfresco.com/{0}/tasks/lucene-solr4-migration.html
|
||||
|
||||
# Bootstrap configuration check messages
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
system.err.property_not_set=Property ''{0}'' has not been set: {1} ({2})
|
||||
system.err.duplicate_name=Duplicate child name not allowed: {0}
|
||||
system.err.lucene_not_supported=The lucene search subsystem is not supported. Please see https://support.hyland.com/p/alfresco
|
||||
system.err.lucene_not_supported=The lucene search subsystem is not supported. Please see http://docs.alfresco.com/{0}/tasks/lucene-solr4-migration.html
|
||||
|
||||
# Bootstrap configuration check messages
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
system.err.property_not_set=Property ''{0}'' has not been set: {1} ({2})
|
||||
system.err.duplicate_name=Duplicate child name not allowed: {0}
|
||||
system.err.lucene_not_supported=The lucene search subsystem is not supported. Please see https://support.hyland.com/p/alfresco
|
||||
system.err.lucene_not_supported=The lucene search subsystem is not supported. Please see http://docs.alfresco.com/{0}/tasks/lucene-solr4-migration.html
|
||||
|
||||
# Bootstrap configuration check messages
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
system.err.property_not_set=Ominaisuutta {0} ei ole m\u00e4\u00e4ritetty: {1} ({2})
|
||||
system.err.duplicate_name=P\u00e4\u00e4llekk\u00e4ist\u00e4 alatasonime\u00e4 ei sallita: {0}
|
||||
system.err.lucene_not_supported=Lucene-hakualij\u00e4rjestelm\u00e4\u00e4 ei tueta. Saat lis\u00e4tietoja osoitteesta https://support.hyland.com/p/alfresco
|
||||
system.err.lucene_not_supported=Lucene-hakualij\u00e4rjestelm\u00e4\u00e4 ei tueta. Saat lis\u00e4tietoja osoitteesta http://docs.alfresco.com/{0}/tasks/lucene-solr4-migration.html
|
||||
|
||||
# Bootstrap configuration check messages
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
system.err.property_not_set=Property ''{0}'' has not been set : {1} ({2})
|
||||
system.err.duplicate_name=Duplicate child name not allowed : {0}
|
||||
system.err.lucene_not_supported=The lucene search subsystem is not supported. Please see https://support.hyland.com/p/alfresco
|
||||
system.err.lucene_not_supported=The lucene search subsystem is not supported. Please see http://docs.alfresco.com/{0}/tasks/lucene-solr4-migration.html
|
||||
|
||||
# Bootstrap configuration check messages
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
system.err.property_not_set=Property ''{0}'' has not been set: {1} ({2})
|
||||
system.err.duplicate_name=Duplicate child name not allowed: {0}
|
||||
system.err.lucene_not_supported=The lucene search subsystem is not supported. Please see https://support.hyland.com/p/alfresco
|
||||
system.err.lucene_not_supported=The lucene search subsystem is not supported. Please see http://docs.alfresco.com/{0}/tasks/lucene-solr4-migration.html
|
||||
|
||||
# Bootstrap configuration check messages
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
system.err.property_not_set=Property ''{0}'' has not been set: {1} ({2})
|
||||
system.err.duplicate_name=Duplicate child name not allowed: {0}
|
||||
system.err.lucene_not_supported=The lucene search subsystem is not supported. Please see https://support.hyland.com/p/alfresco
|
||||
system.err.lucene_not_supported=The lucene search subsystem is not supported. Please see http://docs.alfresco.com/{0}/tasks/lucene-solr4-migration.html
|
||||
|
||||
# Bootstrap configuration check messages
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
system.err.property_not_set=Property ''{0}'' has not been set: {1} ({2})
|
||||
system.err.duplicate_name=Duplicate child name not allowed: {0}
|
||||
system.err.lucene_not_supported=The lucene search subsystem is not supported. Please see https://support.hyland.com/p/alfresco
|
||||
system.err.lucene_not_supported=The lucene search subsystem is not supported. Please see http://docs.alfresco.com/{0}/tasks/lucene-solr4-migration.html
|
||||
|
||||
# Bootstrap configuration check messages
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
system.err.property_not_set=Property ''{0}'' has not been set: {1} ({2})
|
||||
system.err.duplicate_name=Duplicate child name not allowed: {0}
|
||||
system.err.lucene_not_supported=The lucene search subsystem is not supported. Please see https://support.hyland.com/p/alfresco
|
||||
system.err.lucene_not_supported=The lucene search subsystem is not supported. Please see http://docs.alfresco.com/{0}/tasks/lucene-solr4-migration.html
|
||||
|
||||
# Bootstrap configuration check messages
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
system.err.property_not_set=Nie ustawiono w\u0142a\u015bciwo\u015bci ''{0}'': {1} ({2})
|
||||
system.err.duplicate_name=Zduplikowane nazwy element\u00f3w podrz\u0119dnych s\u0105 niedozwolone: {0}
|
||||
system.err.lucene_not_supported=Podsystem wyszukiwania Lucene nie jest obs\u0142ugiwany. Zobacz https://support.hyland.com/p/alfresco
|
||||
system.err.lucene_not_supported=Podsystem wyszukiwania Lucene nie jest obs\u0142ugiwany. Zobacz http://docs.alfresco.com/{0}/tasks/lucene-solr4-migration.html
|
||||
|
||||
# Bootstrap configuration check messages
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
system.err.property_not_set=Property ''{0}'' has not been set: {1} ({2})
|
||||
system.err.duplicate_name=Duplicate child name not allowed: {0}
|
||||
system.err.lucene_not_supported=The lucene search subsystem is not supported. Please see https://support.hyland.com/p/alfresco
|
||||
system.err.lucene_not_supported=The lucene search subsystem is not supported. Please see http://docs.alfresco.com/{0}/tasks/lucene-solr4-migration.html
|
||||
|
||||
# Bootstrap configuration check messages
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
system.err.property_not_set=Property ''{0}'' has not been set: {1} ({2})
|
||||
system.err.duplicate_name=Duplicate child name not allowed: {0}
|
||||
system.err.lucene_not_supported=The lucene search subsystem is not supported. Please see https://support.hyland.com/p/alfresco
|
||||
system.err.lucene_not_supported=The lucene search subsystem is not supported. Please see http://docs.alfresco.com/{0}/tasks/lucene-solr4-migration.html
|
||||
|
||||
# Bootstrap configuration check messages
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
system.err.property_not_set=Egenskap ''{0}'' har inte st\u00e4llts in: {1} ({2})
|
||||
system.err.duplicate_name=Dubbelt underordnat namn inte till\u00e5tet: {0}
|
||||
system.err.lucene_not_supported=Lucene-s\u00f6kundersystemet st\u00f6ds inte. Se https://support.hyland.com/p/alfresco
|
||||
system.err.lucene_not_supported=Lucene-s\u00f6kundersystemet st\u00f6ds inte. Se http://docs.alfresco.com/{0}/uppgifter/lucene-solr4-migration.html
|
||||
|
||||
# Bootstrap configuration check messages
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
system.err.property_not_set=Property ''{0}'' has not been set: {1} ({2})
|
||||
system.err.duplicate_name=Duplicate child name not allowed: {0}
|
||||
system.err.lucene_not_supported=The lucene search subsystem is not supported. Please see https://support.hyland.com/p/alfresco
|
||||
system.err.lucene_not_supported=The lucene search subsystem is not supported. Please see http://docs.alfresco.com/{0}/tasks/lucene-solr4-migration.html
|
||||
|
||||
# Bootstrap configuration check messages
|
||||
|
||||
|
||||
@@ -161,4 +161,5 @@
|
||||
<ref bean="ServiceRegistry"/>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
|
||||
@@ -171,4 +171,5 @@
|
||||
<value>urldecode</value>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
|
||||
@@ -25,30 +25,29 @@
|
||||
*/
|
||||
package org.alfresco.repo.lock.mem;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import jakarta.transaction.NotSupportedException;
|
||||
import jakarta.transaction.SystemException;
|
||||
import jakarta.transaction.UserTransaction;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.dao.ConcurrencyFailureException;
|
||||
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.service.cmr.lock.LockType;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.transaction.TransactionService;
|
||||
import org.alfresco.util.ApplicationContextHelper;
|
||||
import org.junit.Before;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.dao.ConcurrencyFailureException;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
/**
|
||||
* Integration tests that check transaction related functionality of {@link LockStore} implementations.
|
||||
*
|
||||
* @author Matt Ward
|
||||
*/
|
||||
public abstract class AbstractLockStoreTxTest<T extends LockStore>
|
||||
@@ -83,10 +82,10 @@ public abstract class AbstractLockStoreTxTest<T extends LockStore>
|
||||
|
||||
/**
|
||||
* <ul>
|
||||
* <li>Start outer txn</li>
|
||||
* <li>Modify lock in outer txn</li>
|
||||
* <li>Start inner txn</li>
|
||||
* <li>Modify lock in inner txn</li>
|
||||
* <li>Start outer txn</li>
|
||||
* <li>Modify lock in outer txn</li>
|
||||
* <li>Start inner txn</li>
|
||||
* <li>Modify lock in inner txn</li>
|
||||
* </ul>
|
||||
* Inner transaction should fail while outer succeeds
|
||||
*/
|
||||
@@ -107,9 +106,11 @@ public abstract class AbstractLockStoreTxTest<T extends LockStore>
|
||||
Date now = new Date();
|
||||
Date expires = new Date(now.getTime() + 180000);
|
||||
final LockState lockState1 = LockState.createLock(nodeRef, LockType.WRITE_LOCK,
|
||||
"jbloggs", expires, Lifetime.EPHEMERAL, null);
|
||||
"jbloggs", expires, Lifetime.EPHEMERAL, null);
|
||||
|
||||
Thread txB = new Thread("TxB") {
|
||||
|
||||
Thread txB = new Thread("TxB")
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
@@ -137,7 +138,7 @@ public abstract class AbstractLockStoreTxTest<T extends LockStore>
|
||||
|
||||
// txB sets a value, already seen as non-existent lock by txA
|
||||
lockStore.set(nodeRef2, LockState.createLock(nodeRef2, LockType.WRITE_LOCK,
|
||||
"csmith", null, Lifetime.EPHEMERAL, null));
|
||||
"csmith", null, Lifetime.EPHEMERAL, null));
|
||||
}
|
||||
finally
|
||||
{
|
||||
@@ -151,7 +152,7 @@ public abstract class AbstractLockStoreTxTest<T extends LockStore>
|
||||
finally
|
||||
{
|
||||
// Stop 'main' from waiting
|
||||
synchronized (main)
|
||||
synchronized(main)
|
||||
{
|
||||
main.notifyAll();
|
||||
}
|
||||
@@ -165,9 +166,6 @@ public abstract class AbstractLockStoreTxTest<T extends LockStore>
|
||||
// txA set lock state 1
|
||||
lockStore.set(nodeRef, lockState1);
|
||||
|
||||
// Perform a read, that we know will retrieve a null value (and null will be cached for this transaction)
|
||||
assertNull("nodeRef2 LockState", lockStore.get(nodeRef2));
|
||||
|
||||
// Wait while txB reads and checks the LockState
|
||||
txB.setDaemon(true);
|
||||
txB.start();
|
||||
@@ -188,10 +186,13 @@ public abstract class AbstractLockStoreTxTest<T extends LockStore>
|
||||
// Check we can see the update.
|
||||
assertEquals("bsmith", lockStore.get(nodeRef).getOwner());
|
||||
|
||||
// Perform a read, that we know will retrieve a null value
|
||||
assertNull("nodeRef2 LockState", lockStore.get(nodeRef2));
|
||||
|
||||
// Wait while txB populates the store with a value for nodeRef2
|
||||
passControl(this, txB);
|
||||
|
||||
// Perform the read again - update should not be visible in this transaction (was already cached)
|
||||
// Perform the read again - update should not be visible in this transaction
|
||||
assertNull("nodeRef2 LockState", lockStore.get(nodeRef2));
|
||||
}
|
||||
finally
|
||||
@@ -202,16 +203,16 @@ public abstract class AbstractLockStoreTxTest<T extends LockStore>
|
||||
|
||||
protected void passControl(Object from, Object to)
|
||||
{
|
||||
synchronized (to)
|
||||
synchronized(to)
|
||||
{
|
||||
to.notifyAll();
|
||||
}
|
||||
synchronized (from)
|
||||
synchronized(from)
|
||||
{
|
||||
try
|
||||
{
|
||||
// TODO: wait should be called in a loop with repeated wait condition check,
|
||||
// but what's the condition we're waiting on?
|
||||
// but what's the condition we're waiting on?
|
||||
from.wait(10000);
|
||||
}
|
||||
catch (InterruptedException error)
|
||||
@@ -230,9 +231,11 @@ public abstract class AbstractLockStoreTxTest<T extends LockStore>
|
||||
Date now = new Date();
|
||||
Date expires = new Date(now.getTime() + 180000);
|
||||
final LockState lockState1 = LockState.createLock(nodeRef, LockType.WRITE_LOCK,
|
||||
"jbloggs", expires, Lifetime.EPHEMERAL, null);
|
||||
"jbloggs", expires, Lifetime.EPHEMERAL, null);
|
||||
|
||||
Thread txB = new Thread("TxB") {
|
||||
|
||||
Thread txB = new Thread("TxB")
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
@@ -257,7 +260,7 @@ public abstract class AbstractLockStoreTxTest<T extends LockStore>
|
||||
// when it has been modified by another tx since this tx last inspected it.
|
||||
AuthenticationUtil.setFullyAuthenticatedUser("jbloggs"); // Current lock owner
|
||||
lockStore.set(nodeRef, LockState.createLock(nodeRef, LockType.WRITE_LOCK,
|
||||
"csmith", null, Lifetime.EPHEMERAL, null));
|
||||
"csmith", null, Lifetime.EPHEMERAL, null));
|
||||
fail("Exception should have been thrown but was not.");
|
||||
}
|
||||
catch (ConcurrencyFailureException e)
|
||||
@@ -277,7 +280,7 @@ public abstract class AbstractLockStoreTxTest<T extends LockStore>
|
||||
finally
|
||||
{
|
||||
// Stop 'main' from waiting
|
||||
synchronized (main)
|
||||
synchronized(main)
|
||||
{
|
||||
main.notifyAll();
|
||||
}
|
||||
@@ -322,11 +325,12 @@ public abstract class AbstractLockStoreTxTest<T extends LockStore>
|
||||
final Date now = new Date();
|
||||
Date expired = new Date(now.getTime() - 180000);
|
||||
final LockState lockState1 = LockState.createLock(nodeRef, LockType.WRITE_LOCK,
|
||||
"jbloggs", expired, Lifetime.EPHEMERAL, null);
|
||||
"jbloggs", expired, Lifetime.EPHEMERAL, null);
|
||||
|
||||
final LockState lockState2 = LockState.createWithOwner(lockState1, "another");
|
||||
|
||||
Thread txB = new Thread("TxB") {
|
||||
Thread txB = new Thread("TxB")
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
@@ -347,7 +351,7 @@ public abstract class AbstractLockStoreTxTest<T extends LockStore>
|
||||
// (but not since this tx's initial read)
|
||||
Date expiresFuture = new Date(now.getTime() + 180000);
|
||||
final LockState newUserLockState = LockState.createLock(nodeRef, LockType.WRITE_LOCK,
|
||||
"new-user", expiresFuture, Lifetime.EPHEMERAL, null);
|
||||
"new-user", expiresFuture, Lifetime.EPHEMERAL, null);
|
||||
lockStore.set(nodeRef, newUserLockState);
|
||||
|
||||
// Read
|
||||
@@ -365,7 +369,7 @@ public abstract class AbstractLockStoreTxTest<T extends LockStore>
|
||||
finally
|
||||
{
|
||||
// Stop 'main' from waiting
|
||||
synchronized (main)
|
||||
synchronized(main)
|
||||
{
|
||||
main.notifyAll();
|
||||
}
|
||||
@@ -400,6 +404,7 @@ public abstract class AbstractLockStoreTxTest<T extends LockStore>
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testNotOnlyCurrentLockOwnerCanChangeInfo() throws NotSupportedException, SystemException
|
||||
{
|
||||
@@ -409,7 +414,7 @@ public abstract class AbstractLockStoreTxTest<T extends LockStore>
|
||||
Date now = new Date();
|
||||
Date expires = new Date(now.getTime() + 180000);
|
||||
final LockState lockState1 = LockState.createLock(nodeRef, LockType.WRITE_LOCK,
|
||||
"jbloggs", expires, Lifetime.EPHEMERAL, null);
|
||||
"jbloggs", expires, Lifetime.EPHEMERAL, null);
|
||||
|
||||
txA.begin();
|
||||
try
|
||||
@@ -450,7 +455,7 @@ public abstract class AbstractLockStoreTxTest<T extends LockStore>
|
||||
Date now = new Date();
|
||||
Date expired = new Date(now.getTime() - 900);
|
||||
final LockState lockState1 = LockState.createLock(nodeRef, LockType.WRITE_LOCK,
|
||||
"jbloggs", expired, Lifetime.EPHEMERAL, null);
|
||||
"jbloggs", expired, Lifetime.EPHEMERAL, null);
|
||||
|
||||
txA.begin();
|
||||
try
|
||||
@@ -464,7 +469,7 @@ public abstract class AbstractLockStoreTxTest<T extends LockStore>
|
||||
AuthenticationUtil.setFullyAuthenticatedUser("csmith");
|
||||
Date expiresFuture = new Date(now.getTime() + 180000);
|
||||
final LockState lockState2 = LockState.createLock(nodeRef, LockType.WRITE_LOCK,
|
||||
"csmith", expiresFuture, Lifetime.EPHEMERAL, null);
|
||||
"csmith", expiresFuture, Lifetime.EPHEMERAL, null);
|
||||
lockStore.set(nodeRef, lockState2);
|
||||
|
||||
// Updated, since lock had expired.
|
||||
|
||||
Reference in New Issue
Block a user