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>
|
||||
@@ -551,7 +551,7 @@ Admin.addEventListener(window, 'load', function() {
|
||||
Template for a full page view
|
||||
-->
|
||||
<div class="sticky-wrapper">
|
||||
|
||||
|
||||
<div class="header">
|
||||
<span><a href="${url.serviceContext}${DEFAULT_CONTROLLER!"/admin"}">${msg("admin-console.header")}</a></span><#if metadata??><span class="meta">${HOSTNAME}</span><span class="meta">${HOSTADDR}</span></#if>
|
||||
<div style="float:right"><a href="${msg("admin-console.help-link", docsEdition)}" target="_blank">${msg("admin-console.help")}</a></div>
|
||||
@@ -908,4 +908,4 @@ Admin.addEventListener(window, 'load', function() {
|
||||
<#macro button label description="" onclick="" style="" id="" class="" disabled="false">
|
||||
<input class="<#if class?has_content>${class?html}<#else>inline</#if>" <#if id?has_content>id="${id?html}"</#if> <#if style?has_content>style="${style?html}"</#if> type="button" value="${label?html}" onclick="${onclick?html}" <#if disabled="true">disabled="true"</#if> />
|
||||
<#if description?has_content><span class="description">${description?html}</span></#if>
|
||||
</#macro>
|
||||
</#macro>
|
||||
@@ -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
|
||||
@@ -93,17 +102,20 @@ public class RenditionsTest extends AbstractBaseApiTest
|
||||
* Private site of user one from network one
|
||||
*/
|
||||
private Site userOneN1Site;
|
||||
|
||||
|
||||
private final static long DELAY_IN_MS = 500;
|
||||
|
||||
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,14 +135,16 @@ 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
|
||||
public void testListNodeRenditions() throws Exception
|
||||
{
|
||||
setRequestContext(networkN1.getId(), userOneN1.getId(), null);
|
||||
|
||||
|
||||
// Create a folder within the site document's library
|
||||
String folderName = "folder" + System.currentTimeMillis();
|
||||
String folder_Id = addToDocumentLibrary(userOneN1Site, folderName, TYPE_CM_FOLDER, userOneN1.getId());
|
||||
@@ -263,14 +277,16 @@ 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
|
||||
public void testGetNodeRendition() throws Exception
|
||||
{
|
||||
setRequestContext(networkN1.getId(), userOneN1.getId(), null);
|
||||
|
||||
|
||||
// Create a folder within the site document's library
|
||||
String folderName = "folder" + System.currentTimeMillis();
|
||||
String folder_Id = addToDocumentLibrary(userOneN1Site, folderName, TYPE_CM_FOLDER, userOneN1.getId());
|
||||
@@ -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,14 +368,16 @@ 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
|
||||
public void testCreateRendition() throws Exception
|
||||
{
|
||||
setRequestContext(networkN1.getId(), userOneN1.getId(), null);
|
||||
|
||||
|
||||
// Create a folder within the site document's library
|
||||
String folderName = "folder" + System.currentTimeMillis();
|
||||
String folder_Id = addToDocumentLibrary(userOneN1Site, folderName, TYPE_CM_FOLDER, userOneN1.getId());
|
||||
@@ -411,24 +429,24 @@ 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);
|
||||
}
|
||||
|
||||
//
|
||||
// -ve Tests
|
||||
//
|
||||
|
||||
|
||||
// The rendition requested already exists
|
||||
response = post(getNodeRenditionsUrl(contentNodeId), toJsonAsString(new Rendition().setId("imgpreview")), 409);
|
||||
ExpectedErrorResponse errorResponse = RestApiUtil.parseErrorResponse(response.getJsonResponse());
|
||||
@@ -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()
|
||||
@@ -694,9 +700,9 @@ public class RenditionsTest extends AbstractBaseApiTest
|
||||
public void testCreateRenditionForNewVersion() throws Exception
|
||||
{
|
||||
String PROP_LTM = "cm:lastThumbnailModification";
|
||||
|
||||
|
||||
String RENDITION_NAME = "imgpreview";
|
||||
|
||||
|
||||
String userId = userOneN1.getId();
|
||||
setRequestContext(networkN1.getId(), userOneN1.getId(), null);
|
||||
|
||||
@@ -718,7 +724,7 @@ public class RenditionsTest extends AbstractBaseApiTest
|
||||
String contentNodeId = document1.getId();
|
||||
assertNotNull(document1.getProperties());
|
||||
assertNull(document1.getProperties().get(PROP_LTM));
|
||||
|
||||
|
||||
// pause briefly
|
||||
Thread.sleep(DELAY_IN_MS);
|
||||
|
||||
@@ -730,8 +736,8 @@ 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)
|
||||
|
||||
// Create and get 'imgpreview' rendition
|
||||
@@ -747,24 +753,24 @@ 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);
|
||||
|
||||
|
||||
// check node details ...
|
||||
params = Collections.singletonMap("include", "properties");
|
||||
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());
|
||||
|
||||
|
||||
assertNotEquals(document1b.getProperties().get(PROP_LTM), document1.getProperties().get(PROP_LTM));
|
||||
|
||||
|
||||
// upload another version of "quick.pdf" and check again
|
||||
|
||||
|
||||
fileName = "quick-2.pdf";
|
||||
file = getResourceFile(fileName);
|
||||
reqBody = MultiPartBuilder.create()
|
||||
@@ -781,9 +787,9 @@ 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
|
||||
assertNotEquals(renditionBytes1, response.getResponseAsBytes());
|
||||
|
||||
@@ -792,24 +798,26 @@ 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());
|
||||
|
||||
|
||||
// check last thumbnail modification property has changed ! (REPO-1644)
|
||||
assertNotEquals(document2b.getProperties().get(PROP_LTM), document1b.getProperties().get(PROP_LTM));
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
public void testDownloadRendition() throws Exception
|
||||
{
|
||||
setRequestContext(networkN1.getId(), userOneN1.getId(), null);
|
||||
|
||||
|
||||
// Create a folder within the site document's library
|
||||
String folderName = "folder" + System.currentTimeMillis();
|
||||
String folder_Id = addToDocumentLibrary(userOneN1Site, folderName, TYPE_CM_FOLDER, userOneN1.getId());
|
||||
@@ -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
|
||||
@@ -816,4 +819,4 @@ public class EventGenerator extends AbstractLifecycleBean implements Initializin
|
||||
return peerAssocs;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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()
|
||||
{
|
||||
@@ -63,4 +63,4 @@ public interface EventSender
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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>
|
||||
|
||||
@@ -1,489 +1,494 @@
|
||||
/*
|
||||
* #%L
|
||||
* Alfresco Repository
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2023 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
package org.alfresco.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;
|
||||
|
||||
/**
|
||||
* Integration tests that check transaction related functionality of {@link LockStore} implementations.
|
||||
*
|
||||
* @author Matt Ward
|
||||
*/
|
||||
public abstract class AbstractLockStoreTxTest<T extends LockStore>
|
||||
{
|
||||
/**
|
||||
* Instance of the Class Under Test.
|
||||
*/
|
||||
protected T lockStore;
|
||||
|
||||
protected static ApplicationContext ctx;
|
||||
protected static TransactionService transactionService;
|
||||
|
||||
/**
|
||||
* Concrete subclasses must implement this method to provide the tests with a LockStore instance.
|
||||
*
|
||||
* @return LockStore to test
|
||||
*/
|
||||
protected abstract T createLockStore();
|
||||
|
||||
@BeforeClass
|
||||
public static void setUpSpringContext()
|
||||
{
|
||||
ctx = ApplicationContextHelper.getApplicationContext();
|
||||
transactionService = (TransactionService) ctx.getBean("TransactionService");
|
||||
}
|
||||
|
||||
@Before
|
||||
public void setUpLockStore()
|
||||
{
|
||||
lockStore = createLockStore();
|
||||
}
|
||||
|
||||
/**
|
||||
* <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>
|
||||
* </ul>
|
||||
* Inner transaction should fail while outer succeeds
|
||||
*/
|
||||
@Test
|
||||
public void testRepeatableRead_01() throws Exception
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRepeatableReadsInTransaction() throws NotSupportedException, SystemException
|
||||
{
|
||||
final TransactionService txService = (TransactionService) ctx.getBean("TransactionService");
|
||||
UserTransaction txA = txService.getUserTransaction();
|
||||
|
||||
final NodeRef nodeRef = new NodeRef("workspace://SpacesStore/UUID-1");
|
||||
final NodeRef nodeRef2 = new NodeRef("workspace://SpacesStore/UUID-2");
|
||||
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);
|
||||
|
||||
Thread txB = new Thread("TxB") {
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
Object main = AbstractLockStoreTxTest.this;
|
||||
UserTransaction tx = txService.getUserTransaction();
|
||||
try
|
||||
{
|
||||
tx.begin();
|
||||
try
|
||||
{
|
||||
// txB read lock state
|
||||
LockState lockState = lockStore.get(nodeRef);
|
||||
assertEquals("jbloggs", lockState.getOwner());
|
||||
assertEquals(Lifetime.EPHEMERAL, lockState.getLifetime());
|
||||
|
||||
// Wait, while txA changes the lock state
|
||||
passControl(this, main);
|
||||
|
||||
// assert txB still sees state A
|
||||
lockState = lockStore.get(nodeRef);
|
||||
assertEquals("jbloggs", lockState.getOwner());
|
||||
|
||||
// Wait, while txA checks whether it can see lock for nodeRef2 (though it doesn't exist yet)
|
||||
passControl(this, main);
|
||||
|
||||
// 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));
|
||||
}
|
||||
finally
|
||||
{
|
||||
tx.rollback();
|
||||
}
|
||||
}
|
||||
catch (Throwable e)
|
||||
{
|
||||
throw new RuntimeException("Error in transaction B", e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
// Stop 'main' from waiting
|
||||
synchronized (main)
|
||||
{
|
||||
main.notifyAll();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
txA.begin();
|
||||
try
|
||||
{
|
||||
// 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();
|
||||
passControl(this, txB);
|
||||
|
||||
// txA set different lock state
|
||||
AuthenticationUtil.setFullyAuthenticatedUser("jbloggs"); // Current lock owner needed to change lock.
|
||||
final LockState lockState2 = LockState.createWithOwner(lockState1, "another");
|
||||
lockStore.set(nodeRef, lockState2);
|
||||
|
||||
// Wait while txB reads/checks the LockState again for nodeRef
|
||||
passControl(this, txB);
|
||||
|
||||
// Another update
|
||||
AuthenticationUtil.setFullyAuthenticatedUser("another"); // Current lock owner needed to change lock.
|
||||
final LockState lockState3 = LockState.createWithOwner(lockState2, "bsmith");
|
||||
lockStore.set(nodeRef, lockState3);
|
||||
// Check we can see the update.
|
||||
assertEquals("bsmith", lockStore.get(nodeRef).getOwner());
|
||||
|
||||
// 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)
|
||||
assertNull("nodeRef2 LockState", lockStore.get(nodeRef2));
|
||||
}
|
||||
finally
|
||||
{
|
||||
txA.rollback();
|
||||
}
|
||||
}
|
||||
|
||||
protected void passControl(Object from, Object to)
|
||||
{
|
||||
synchronized (to)
|
||||
{
|
||||
to.notifyAll();
|
||||
}
|
||||
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?
|
||||
from.wait(10000);
|
||||
}
|
||||
catch (InterruptedException error)
|
||||
{
|
||||
throw new RuntimeException(error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCannotSetLockWhenChangedByAnotherTx() throws NotSupportedException, SystemException
|
||||
{
|
||||
final TransactionService txService = (TransactionService) ctx.getBean("TransactionService");
|
||||
UserTransaction txA = txService.getUserTransaction();
|
||||
final NodeRef nodeRef = new NodeRef("workspace://SpacesStore/UUID-1");
|
||||
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);
|
||||
|
||||
Thread txB = new Thread("TxB") {
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
Object main = AbstractLockStoreTxTest.this;
|
||||
UserTransaction tx = txService.getUserTransaction();
|
||||
try
|
||||
{
|
||||
tx.begin();
|
||||
try
|
||||
{
|
||||
// txB read lock state
|
||||
LockState lockState = lockStore.get(nodeRef);
|
||||
assertEquals("jbloggs", lockState.getOwner());
|
||||
assertEquals(Lifetime.EPHEMERAL, lockState.getLifetime());
|
||||
|
||||
// Wait, while txA changes the lock state
|
||||
passControl(this, main);
|
||||
|
||||
try
|
||||
{
|
||||
// Attempt to change the lock state for a NodeRef should fail
|
||||
// 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));
|
||||
fail("Exception should have been thrown but was not.");
|
||||
}
|
||||
catch (ConcurrencyFailureException e)
|
||||
{
|
||||
// Good!
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
tx.rollback();
|
||||
}
|
||||
}
|
||||
catch (Throwable e)
|
||||
{
|
||||
throw new RuntimeException("Error in transaction B", e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
// Stop 'main' from waiting
|
||||
synchronized (main)
|
||||
{
|
||||
main.notifyAll();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
txA.begin();
|
||||
try
|
||||
{
|
||||
// txA set lock state 1
|
||||
lockStore.set(nodeRef, lockState1);
|
||||
|
||||
// Wait while txB reads and checks the LockState
|
||||
txB.setDaemon(true);
|
||||
txB.start();
|
||||
passControl(this, txB);
|
||||
|
||||
// txA set different lock state
|
||||
AuthenticationUtil.setFullyAuthenticatedUser("jbloggs"); // Current lock owner needed to change lock.
|
||||
final LockState lockState2 = LockState.createWithOwner(lockState1, "another");
|
||||
lockStore.set(nodeRef, lockState2);
|
||||
|
||||
// Wait while txB attempts to modify the lock info
|
||||
passControl(this, txB);
|
||||
|
||||
// Lock shouldn't have changed since this tx updated it.
|
||||
assertEquals(lockState2, lockStore.get(nodeRef));
|
||||
}
|
||||
finally
|
||||
{
|
||||
txA.rollback();
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCanChangeLockIfLatestValueIsHeldEvenIfAlreadyChangedByAnotherTx() throws NotSupportedException, SystemException
|
||||
{
|
||||
final TransactionService txService = (TransactionService) ctx.getBean("TransactionService");
|
||||
UserTransaction txA = txService.getUserTransaction();
|
||||
final NodeRef nodeRef = new NodeRef("workspace://SpacesStore/UUID-1");
|
||||
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);
|
||||
|
||||
final LockState lockState2 = LockState.createWithOwner(lockState1, "another");
|
||||
|
||||
Thread txB = new Thread("TxB") {
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
Object main = AbstractLockStoreTxTest.this;
|
||||
UserTransaction tx = txService.getUserTransaction();
|
||||
try
|
||||
{
|
||||
tx.begin();
|
||||
try
|
||||
{
|
||||
AuthenticationUtil.setFullyAuthenticatedUser("new-user");
|
||||
|
||||
// txB read lock state
|
||||
LockState readLockState = lockStore.get(nodeRef);
|
||||
assertEquals(lockState2, readLockState);
|
||||
|
||||
// Set new value, even though txA has already set new values
|
||||
// (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);
|
||||
lockStore.set(nodeRef, newUserLockState);
|
||||
|
||||
// Read
|
||||
assertEquals(newUserLockState, lockStore.get(nodeRef));
|
||||
}
|
||||
finally
|
||||
{
|
||||
tx.rollback();
|
||||
}
|
||||
}
|
||||
catch (Throwable e)
|
||||
{
|
||||
throw new RuntimeException("Error in transaction B", e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
// Stop 'main' from waiting
|
||||
synchronized (main)
|
||||
{
|
||||
main.notifyAll();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
txA.begin();
|
||||
try
|
||||
{
|
||||
AuthenticationUtil.setFullyAuthenticatedUser("jbloggs"); // Current lock owner needed to change lock.
|
||||
|
||||
// txA set lock state 1
|
||||
lockStore.set(nodeRef, lockState1);
|
||||
assertEquals(lockState1, lockStore.get(nodeRef));
|
||||
|
||||
// txA set different lock state
|
||||
lockStore.set(nodeRef, lockState2);
|
||||
assertEquals(lockState2, lockStore.get(nodeRef));
|
||||
|
||||
// Wait while txB modifies the lock info
|
||||
txB.setDaemon(true);
|
||||
txB.start();
|
||||
passControl(this, txB);
|
||||
|
||||
// This tx should still see the same state, though it has been changed by txB.
|
||||
assertEquals(lockState2, lockStore.get(nodeRef));
|
||||
}
|
||||
finally
|
||||
{
|
||||
txA.rollback();
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNotOnlyCurrentLockOwnerCanChangeInfo() throws NotSupportedException, SystemException
|
||||
{
|
||||
final TransactionService txService = (TransactionService) ctx.getBean("TransactionService");
|
||||
UserTransaction txA = txService.getUserTransaction();
|
||||
final NodeRef nodeRef = new NodeRef("workspace://SpacesStore/UUID-1");
|
||||
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);
|
||||
|
||||
txA.begin();
|
||||
try
|
||||
{
|
||||
AuthenticationUtil.setFullyAuthenticatedUser("jbloggs");
|
||||
|
||||
// Set initial lock state
|
||||
lockStore.set(nodeRef, lockState1);
|
||||
|
||||
// Set different lock state
|
||||
// Current lock owner is still authenticated (jbloggs)
|
||||
final LockState lockState2 = LockState.createWithOwner(lockState1, "csmith");
|
||||
lockStore.set(nodeRef, lockState2);
|
||||
|
||||
// Check update
|
||||
assertEquals(lockState2, lockStore.get(nodeRef));
|
||||
|
||||
// Incorrect lock owner - this shouldn't fail. See ACE-2181
|
||||
final LockState lockState3 = LockState.createWithOwner(lockState1, "dsmithers");
|
||||
|
||||
lockStore.set(nodeRef, lockState3);
|
||||
|
||||
// Check update.
|
||||
assertEquals(lockState3, lockStore.get(nodeRef));
|
||||
}
|
||||
finally
|
||||
{
|
||||
txA.rollback();
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testOtherUserCanChangeLockInfoOnceExpired() throws NotSupportedException, SystemException
|
||||
{
|
||||
final TransactionService txService = (TransactionService) ctx.getBean("TransactionService");
|
||||
UserTransaction txA = txService.getUserTransaction();
|
||||
final NodeRef nodeRef = new NodeRef("workspace://SpacesStore/UUID-1");
|
||||
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);
|
||||
|
||||
txA.begin();
|
||||
try
|
||||
{
|
||||
AuthenticationUtil.setFullyAuthenticatedUser("jbloggs");
|
||||
|
||||
// Set initial lock state
|
||||
lockStore.set(nodeRef, lockState1);
|
||||
|
||||
// Set different lock state
|
||||
AuthenticationUtil.setFullyAuthenticatedUser("csmith");
|
||||
Date expiresFuture = new Date(now.getTime() + 180000);
|
||||
final LockState lockState2 = LockState.createLock(nodeRef, LockType.WRITE_LOCK,
|
||||
"csmith", expiresFuture, Lifetime.EPHEMERAL, null);
|
||||
lockStore.set(nodeRef, lockState2);
|
||||
|
||||
// Updated, since lock had expired.
|
||||
assertEquals(lockState2, lockStore.get(nodeRef));
|
||||
|
||||
// Incorrect lock owner - this shouldn't fail
|
||||
// LockStore does not check for lock owning
|
||||
// and is owned by csmith.
|
||||
AuthenticationUtil.setFullyAuthenticatedUser("dsmithers");
|
||||
final LockState lockState3 = LockState.createWithOwner(lockState2, "dsmithers");
|
||||
|
||||
lockStore.set(nodeRef, lockState3);
|
||||
|
||||
// Check update.
|
||||
assertEquals(lockState3, lockStore.get(nodeRef));
|
||||
}
|
||||
finally
|
||||
{
|
||||
txA.rollback();
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
* #%L
|
||||
* Alfresco Repository
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2023 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
package org.alfresco.repo.lock.mem;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import jakarta.transaction.NotSupportedException;
|
||||
import jakarta.transaction.SystemException;
|
||||
import jakarta.transaction.UserTransaction;
|
||||
|
||||
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>
|
||||
{
|
||||
/**
|
||||
* Instance of the Class Under Test.
|
||||
*/
|
||||
protected T lockStore;
|
||||
|
||||
protected static ApplicationContext ctx;
|
||||
protected static TransactionService transactionService;
|
||||
|
||||
/**
|
||||
* Concrete subclasses must implement this method to provide the tests with a LockStore instance.
|
||||
*
|
||||
* @return LockStore to test
|
||||
*/
|
||||
protected abstract T createLockStore();
|
||||
|
||||
@BeforeClass
|
||||
public static void setUpSpringContext()
|
||||
{
|
||||
ctx = ApplicationContextHelper.getApplicationContext();
|
||||
transactionService = (TransactionService) ctx.getBean("TransactionService");
|
||||
}
|
||||
|
||||
@Before
|
||||
public void setUpLockStore()
|
||||
{
|
||||
lockStore = createLockStore();
|
||||
}
|
||||
|
||||
/**
|
||||
* <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>
|
||||
* </ul>
|
||||
* Inner transaction should fail while outer succeeds
|
||||
*/
|
||||
@Test
|
||||
public void testRepeatableRead_01() throws Exception
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRepeatableReadsInTransaction() throws NotSupportedException, SystemException
|
||||
{
|
||||
final TransactionService txService = (TransactionService) ctx.getBean("TransactionService");
|
||||
UserTransaction txA = txService.getUserTransaction();
|
||||
|
||||
final NodeRef nodeRef = new NodeRef("workspace://SpacesStore/UUID-1");
|
||||
final NodeRef nodeRef2 = new NodeRef("workspace://SpacesStore/UUID-2");
|
||||
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);
|
||||
|
||||
|
||||
Thread txB = new Thread("TxB")
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
Object main = AbstractLockStoreTxTest.this;
|
||||
UserTransaction tx = txService.getUserTransaction();
|
||||
try
|
||||
{
|
||||
tx.begin();
|
||||
try
|
||||
{
|
||||
// txB read lock state
|
||||
LockState lockState = lockStore.get(nodeRef);
|
||||
assertEquals("jbloggs", lockState.getOwner());
|
||||
assertEquals(Lifetime.EPHEMERAL, lockState.getLifetime());
|
||||
|
||||
// Wait, while txA changes the lock state
|
||||
passControl(this, main);
|
||||
|
||||
// assert txB still sees state A
|
||||
lockState = lockStore.get(nodeRef);
|
||||
assertEquals("jbloggs", lockState.getOwner());
|
||||
|
||||
// Wait, while txA checks whether it can see lock for nodeRef2 (though it doesn't exist yet)
|
||||
passControl(this, main);
|
||||
|
||||
// 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));
|
||||
}
|
||||
finally
|
||||
{
|
||||
tx.rollback();
|
||||
}
|
||||
}
|
||||
catch (Throwable e)
|
||||
{
|
||||
throw new RuntimeException("Error in transaction B", e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
// Stop 'main' from waiting
|
||||
synchronized(main)
|
||||
{
|
||||
main.notifyAll();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
txA.begin();
|
||||
try
|
||||
{
|
||||
// txA set lock state 1
|
||||
lockStore.set(nodeRef, lockState1);
|
||||
|
||||
// Wait while txB reads and checks the LockState
|
||||
txB.setDaemon(true);
|
||||
txB.start();
|
||||
passControl(this, txB);
|
||||
|
||||
// txA set different lock state
|
||||
AuthenticationUtil.setFullyAuthenticatedUser("jbloggs"); // Current lock owner needed to change lock.
|
||||
final LockState lockState2 = LockState.createWithOwner(lockState1, "another");
|
||||
lockStore.set(nodeRef, lockState2);
|
||||
|
||||
// Wait while txB reads/checks the LockState again for nodeRef
|
||||
passControl(this, txB);
|
||||
|
||||
// Another update
|
||||
AuthenticationUtil.setFullyAuthenticatedUser("another"); // Current lock owner needed to change lock.
|
||||
final LockState lockState3 = LockState.createWithOwner(lockState2, "bsmith");
|
||||
lockStore.set(nodeRef, lockState3);
|
||||
// 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
|
||||
assertNull("nodeRef2 LockState", lockStore.get(nodeRef2));
|
||||
}
|
||||
finally
|
||||
{
|
||||
txA.rollback();
|
||||
}
|
||||
}
|
||||
|
||||
protected void passControl(Object from, Object to)
|
||||
{
|
||||
synchronized(to)
|
||||
{
|
||||
to.notifyAll();
|
||||
}
|
||||
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?
|
||||
from.wait(10000);
|
||||
}
|
||||
catch (InterruptedException error)
|
||||
{
|
||||
throw new RuntimeException(error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCannotSetLockWhenChangedByAnotherTx() throws NotSupportedException, SystemException
|
||||
{
|
||||
final TransactionService txService = (TransactionService) ctx.getBean("TransactionService");
|
||||
UserTransaction txA = txService.getUserTransaction();
|
||||
final NodeRef nodeRef = new NodeRef("workspace://SpacesStore/UUID-1");
|
||||
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);
|
||||
|
||||
|
||||
Thread txB = new Thread("TxB")
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
Object main = AbstractLockStoreTxTest.this;
|
||||
UserTransaction tx = txService.getUserTransaction();
|
||||
try
|
||||
{
|
||||
tx.begin();
|
||||
try
|
||||
{
|
||||
// txB read lock state
|
||||
LockState lockState = lockStore.get(nodeRef);
|
||||
assertEquals("jbloggs", lockState.getOwner());
|
||||
assertEquals(Lifetime.EPHEMERAL, lockState.getLifetime());
|
||||
|
||||
// Wait, while txA changes the lock state
|
||||
passControl(this, main);
|
||||
|
||||
try
|
||||
{
|
||||
// Attempt to change the lock state for a NodeRef should fail
|
||||
// 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));
|
||||
fail("Exception should have been thrown but was not.");
|
||||
}
|
||||
catch (ConcurrencyFailureException e)
|
||||
{
|
||||
// Good!
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
tx.rollback();
|
||||
}
|
||||
}
|
||||
catch (Throwable e)
|
||||
{
|
||||
throw new RuntimeException("Error in transaction B", e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
// Stop 'main' from waiting
|
||||
synchronized(main)
|
||||
{
|
||||
main.notifyAll();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
txA.begin();
|
||||
try
|
||||
{
|
||||
// txA set lock state 1
|
||||
lockStore.set(nodeRef, lockState1);
|
||||
|
||||
// Wait while txB reads and checks the LockState
|
||||
txB.setDaemon(true);
|
||||
txB.start();
|
||||
passControl(this, txB);
|
||||
|
||||
// txA set different lock state
|
||||
AuthenticationUtil.setFullyAuthenticatedUser("jbloggs"); // Current lock owner needed to change lock.
|
||||
final LockState lockState2 = LockState.createWithOwner(lockState1, "another");
|
||||
lockStore.set(nodeRef, lockState2);
|
||||
|
||||
// Wait while txB attempts to modify the lock info
|
||||
passControl(this, txB);
|
||||
|
||||
// Lock shouldn't have changed since this tx updated it.
|
||||
assertEquals(lockState2, lockStore.get(nodeRef));
|
||||
}
|
||||
finally
|
||||
{
|
||||
txA.rollback();
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCanChangeLockIfLatestValueIsHeldEvenIfAlreadyChangedByAnotherTx() throws NotSupportedException, SystemException
|
||||
{
|
||||
final TransactionService txService = (TransactionService) ctx.getBean("TransactionService");
|
||||
UserTransaction txA = txService.getUserTransaction();
|
||||
final NodeRef nodeRef = new NodeRef("workspace://SpacesStore/UUID-1");
|
||||
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);
|
||||
|
||||
final LockState lockState2 = LockState.createWithOwner(lockState1, "another");
|
||||
|
||||
Thread txB = new Thread("TxB")
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
Object main = AbstractLockStoreTxTest.this;
|
||||
UserTransaction tx = txService.getUserTransaction();
|
||||
try
|
||||
{
|
||||
tx.begin();
|
||||
try
|
||||
{
|
||||
AuthenticationUtil.setFullyAuthenticatedUser("new-user");
|
||||
|
||||
// txB read lock state
|
||||
LockState readLockState = lockStore.get(nodeRef);
|
||||
assertEquals(lockState2, readLockState);
|
||||
|
||||
// Set new value, even though txA has already set new values
|
||||
// (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);
|
||||
lockStore.set(nodeRef, newUserLockState);
|
||||
|
||||
// Read
|
||||
assertEquals(newUserLockState, lockStore.get(nodeRef));
|
||||
}
|
||||
finally
|
||||
{
|
||||
tx.rollback();
|
||||
}
|
||||
}
|
||||
catch (Throwable e)
|
||||
{
|
||||
throw new RuntimeException("Error in transaction B", e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
// Stop 'main' from waiting
|
||||
synchronized(main)
|
||||
{
|
||||
main.notifyAll();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
txA.begin();
|
||||
try
|
||||
{
|
||||
AuthenticationUtil.setFullyAuthenticatedUser("jbloggs"); // Current lock owner needed to change lock.
|
||||
|
||||
// txA set lock state 1
|
||||
lockStore.set(nodeRef, lockState1);
|
||||
assertEquals(lockState1, lockStore.get(nodeRef));
|
||||
|
||||
// txA set different lock state
|
||||
lockStore.set(nodeRef, lockState2);
|
||||
assertEquals(lockState2, lockStore.get(nodeRef));
|
||||
|
||||
// Wait while txB modifies the lock info
|
||||
txB.setDaemon(true);
|
||||
txB.start();
|
||||
passControl(this, txB);
|
||||
|
||||
// This tx should still see the same state, though it has been changed by txB.
|
||||
assertEquals(lockState2, lockStore.get(nodeRef));
|
||||
}
|
||||
finally
|
||||
{
|
||||
txA.rollback();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testNotOnlyCurrentLockOwnerCanChangeInfo() throws NotSupportedException, SystemException
|
||||
{
|
||||
final TransactionService txService = (TransactionService) ctx.getBean("TransactionService");
|
||||
UserTransaction txA = txService.getUserTransaction();
|
||||
final NodeRef nodeRef = new NodeRef("workspace://SpacesStore/UUID-1");
|
||||
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);
|
||||
|
||||
txA.begin();
|
||||
try
|
||||
{
|
||||
AuthenticationUtil.setFullyAuthenticatedUser("jbloggs");
|
||||
|
||||
// Set initial lock state
|
||||
lockStore.set(nodeRef, lockState1);
|
||||
|
||||
// Set different lock state
|
||||
// Current lock owner is still authenticated (jbloggs)
|
||||
final LockState lockState2 = LockState.createWithOwner(lockState1, "csmith");
|
||||
lockStore.set(nodeRef, lockState2);
|
||||
|
||||
// Check update
|
||||
assertEquals(lockState2, lockStore.get(nodeRef));
|
||||
|
||||
// Incorrect lock owner - this shouldn't fail. See ACE-2181
|
||||
final LockState lockState3 = LockState.createWithOwner(lockState1, "dsmithers");
|
||||
|
||||
lockStore.set(nodeRef, lockState3);
|
||||
|
||||
// Check update.
|
||||
assertEquals(lockState3, lockStore.get(nodeRef));
|
||||
}
|
||||
finally
|
||||
{
|
||||
txA.rollback();
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testOtherUserCanChangeLockInfoOnceExpired() throws NotSupportedException, SystemException
|
||||
{
|
||||
final TransactionService txService = (TransactionService) ctx.getBean("TransactionService");
|
||||
UserTransaction txA = txService.getUserTransaction();
|
||||
final NodeRef nodeRef = new NodeRef("workspace://SpacesStore/UUID-1");
|
||||
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);
|
||||
|
||||
txA.begin();
|
||||
try
|
||||
{
|
||||
AuthenticationUtil.setFullyAuthenticatedUser("jbloggs");
|
||||
|
||||
// Set initial lock state
|
||||
lockStore.set(nodeRef, lockState1);
|
||||
|
||||
// Set different lock state
|
||||
AuthenticationUtil.setFullyAuthenticatedUser("csmith");
|
||||
Date expiresFuture = new Date(now.getTime() + 180000);
|
||||
final LockState lockState2 = LockState.createLock(nodeRef, LockType.WRITE_LOCK,
|
||||
"csmith", expiresFuture, Lifetime.EPHEMERAL, null);
|
||||
lockStore.set(nodeRef, lockState2);
|
||||
|
||||
// Updated, since lock had expired.
|
||||
assertEquals(lockState2, lockStore.get(nodeRef));
|
||||
|
||||
// Incorrect lock owner - this shouldn't fail
|
||||
// LockStore does not check for lock owning
|
||||
// and is owned by csmith.
|
||||
AuthenticationUtil.setFullyAuthenticatedUser("dsmithers");
|
||||
final LockState lockState3 = LockState.createWithOwner(lockState2, "dsmithers");
|
||||
|
||||
lockStore.set(nodeRef, lockState3);
|
||||
|
||||
// Check update.
|
||||
assertEquals(lockState3, lockStore.get(nodeRef));
|
||||
}
|
||||
finally
|
||||
{
|
||||
txA.rollback();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user