Compare commits

..

71 Commits

Author SHA1 Message Date
alfresco-build
65f6d0ee45 [maven-release-plugin][skip ci] prepare release 23.3.0.97 2024-08-22 08:36:48 +00:00
rrajoria
275c42014e Bump AOS Version 3.1.0 2024-08-22 13:27:20 +05:30
alfresco-build
d0135e4b76 [maven-release-plugin][skip ci] prepare for next development iteration 2024-08-19 12:27:22 +00:00
alfresco-build
d405be6273 [maven-release-plugin][skip ci] prepare release 23.3.0.96 2024-08-19 12:27:20 +00:00
Paweł Rainer
b7862932e6 MNT-24126: add support for rendition service 2 (#2853) 2024-08-19 13:46:09 +02:00
alfresco-build
970bca464f [maven-release-plugin][skip ci] prepare for next development iteration 2024-08-18 00:07:10 +00:00
alfresco-build
f76d43eced [maven-release-plugin][skip ci] prepare release 23.3.0.95 2024-08-18 00:07:08 +00:00
Alfresco CI User
e07c452cf0 [force] Force release for 2024-08-18. 2024-08-18 00:04:14 +00:00
alfresco-build
64899ca358 [maven-release-plugin][skip ci] prepare for next development iteration 2024-08-13 08:28:39 +00:00
alfresco-build
de498664b6 [maven-release-plugin][skip ci] prepare release 23.3.0.94 2024-08-13 08:28:35 +00:00
Marcin Strankowski
46031feb52 [skip tests] Retry push 2024-08-13 10:24:15 +02:00
dependabot[bot]
a93686acd5 Bump org.postgresql:postgresql from 42.6.0 to 42.7.3 (#2512) 2024-08-13 07:29:49 +00:00
alfresco-build
aa86d07738 [maven-release-plugin][skip ci] prepare for next development iteration 2024-08-08 10:47:46 +00:00
alfresco-build
553a8aae1c [maven-release-plugin][skip ci] prepare release 23.3.0.93 2024-08-08 10:47:43 +00:00
rrajoria
f1bf73c269 Update AOS Alpha version 2024-08-08 13:38:53 +05:30
alfresco-build
64fa671f33 [maven-release-plugin][skip ci] prepare for next development iteration 2024-08-07 17:58:45 +00:00
alfresco-build
70c1da0213 [maven-release-plugin][skip ci] prepare release 23.3.0.92 2024-08-07 17:58:42 +00:00
Sara
283fffef00 ACS-8520 Bump t-core to 5.1.4-A3, ATS 4.1.4-A2 (#2843) 2024-08-07 18:09:42 +01:00
alfresco-build
e99e3d69ba [maven-release-plugin][skip ci] prepare for next development iteration 2024-08-07 10:57:05 +00:00
alfresco-build
f826b08b2b [maven-release-plugin][skip ci] prepare release 23.3.0.91 2024-08-07 10:57:03 +00:00
Damian Ujma
3bd57adeef ACS-8370 Switch to new tags for tomcat base images in Dockerfiles (#2841)
* ACS-8370 Switch to new tags for tomcat base images in Dockerfiles

* ACS-8370 Update fontconfig package

* ACS-8370 Update tomcat image SHA
2024-08-07 12:15:29 +02:00
alfresco-build
a4f8b8d4b9 [maven-release-plugin][skip ci] prepare for next development iteration 2024-08-06 07:36:20 +00:00
alfresco-build
6363c9e17a [maven-release-plugin][skip ci] prepare release 23.3.0.90 2024-08-06 07:36:18 +00:00
dependabot[bot]
b8a94ff310 Bump io.fabric8:docker-maven-plugin from 0.43.4 to 0.45.0 (#2831)
Bumps [io.fabric8:docker-maven-plugin](https://github.com/fabric8io/docker-maven-plugin) from 0.43.4 to 0.45.0.
- [Release notes](https://github.com/fabric8io/docker-maven-plugin/releases)
- [Changelog](https://github.com/fabric8io/docker-maven-plugin/blob/master/doc/changelog.md)
- [Commits](https://github.com/fabric8io/docker-maven-plugin/compare/v0.43.4...v0.45.0)

---
updated-dependencies:
- dependency-name: io.fabric8:docker-maven-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-06 08:57:54 +02:00
alfresco-build
fd9e279715 [maven-release-plugin][skip ci] prepare for next development iteration 2024-08-05 14:21:04 +00:00
alfresco-build
6210ca95f9 [maven-release-plugin][skip ci] prepare release 23.3.0.89 2024-08-05 14:21:01 +00:00
Igor Białas
7edba79f69 Improve README (#2834) 2024-08-05 15:41:41 +02:00
alfresco-build
1eb24d2d85 [maven-release-plugin][skip ci] prepare for next development iteration 2024-08-04 00:06:56 +00:00
alfresco-build
3305eb91e5 [maven-release-plugin][skip ci] prepare release 23.3.0.88 2024-08-04 00:06:55 +00:00
Alfresco CI User
0994545c65 [force] Force release for 2024-08-04. 2024-08-04 00:04:06 +00:00
alfresco-build
94377f1e30 [maven-release-plugin][skip ci] prepare for next development iteration 2024-08-02 14:09:28 +00:00
alfresco-build
9c9d3dbbd5 [maven-release-plugin][skip ci] prepare release 23.3.0.87 2024-08-02 14:09:26 +00:00
Domenico Sibilio
7b4c210773 ACS-8421 Bump Transform Core to 5.1.4-A1 + Service to 4.1.4-A1 (#2839) 2024-08-02 15:30:46 +02:00
alfresco-build
06d500311c [maven-release-plugin][skip ci] prepare for next development iteration 2024-07-31 07:05:57 +00:00
alfresco-build
8d95ffc9ff [maven-release-plugin][skip ci] prepare release 23.3.0.86 2024-07-31 07:05:54 +00:00
varapathijanakiram
6e05d5d157 Merge pull request #2832 from Alfresco/feature/MNT-24400-Suggester-feature
Suggester feature in Share
2024-07-31 11:54:20 +05:30
vjanakiram
dfff72849d I have added bean 2024-07-29 21:17:30 +05:30
alfresco-build
d60172e860 [maven-release-plugin][skip ci] prepare for next development iteration 2024-07-28 00:07:08 +00:00
alfresco-build
3cac4e8206 [maven-release-plugin][skip ci] prepare release 23.3.0.85 2024-07-28 00:07:05 +00:00
Alfresco CI User
b35a64d14f [force] Force release for 2024-07-28. 2024-07-28 00:04:10 +00:00
alfresco-build
10e78191dd [maven-release-plugin][skip ci] prepare for next development iteration 2024-07-25 21:03:12 +00:00
alfresco-build
6290c46d62 [maven-release-plugin][skip ci] prepare release 23.3.0.84 2024-07-25 21:03:09 +00:00
Tiago Salvado
8a61badabc [MNT-24513] Immutable user (IDS): allow to change enabled status (#2789)
* [MNT-24513] Immutable user: allow enabled status change

* [MNT-24513] Created 'allow.immutable.user.enabled.status.update' to control whether an immutabled user enabled status can be changed or not

* [MNT-24513] Regardless user details enabled status, the person nodeRef enabled status is also checked

* [MNT-24513] Prevent LDAP users from being disabled. Changed variable name.
2024-07-25 21:23:51 +01:00
alfresco-build
f9946827c4 [maven-release-plugin][skip ci] prepare for next development iteration 2024-07-24 13:18:42 +00:00
alfresco-build
b812c7856e [maven-release-plugin][skip ci] prepare release 23.3.0.83 2024-07-24 13:18:40 +00:00
Eva Vasques
a3f6e13a7c MNT-24503 - FixedAclUpdater Job - Skip count if maxSize is set (#2809) 2024-07-24 13:40:50 +01:00
alfresco-build
afffc7e870 [maven-release-plugin][skip ci] prepare for next development iteration 2024-07-24 05:54:22 +00:00
alfresco-build
fe5a01e2bd [maven-release-plugin][skip ci] prepare release 23.3.0.82 2024-07-24 05:54:20 +00:00
purusothaman-mm
03625565e9 [MNT-24292] fix for delete vulnerability (#2806) 2024-07-24 10:45:14 +05:30
alfresco-build
8d1d2b4f1b [maven-release-plugin][skip ci] prepare for next development iteration 2024-07-23 11:55:48 +00:00
alfresco-build
1342c6a7bb [maven-release-plugin][skip ci] prepare release 23.3.0.81 2024-07-23 11:55:45 +00:00
Tom Page
17152b69fc Merge pull request #2807 from Alfresco/feature/PMD730
[skip tests] Upgrade ya-pmd-scan.
2024-07-23 12:43:50 +01:00
Tom Page
1a7027327e [skip tests] PRODENG-291 Upgrade ya-pmd-scan. 2024-07-23 12:17:46 +01:00
alfresco-build
7921969222 [maven-release-plugin][skip ci] prepare for next development iteration 2024-07-21 00:07:02 +00:00
alfresco-build
9cc93de7b2 [maven-release-plugin][skip ci] prepare release 23.3.0.80 2024-07-21 00:07:00 +00:00
Alfresco CI User
55c9cf3407 [force] Force release for 2024-07-21. 2024-07-21 00:04:10 +00:00
alfresco-build
120f45ba92 [maven-release-plugin][skip ci] prepare for next development iteration 2024-07-19 09:04:23 +00:00
alfresco-build
eacdbd3770 [maven-release-plugin][skip ci] prepare release 23.3.0.79 2024-07-19 09:04:21 +00:00
dependabot[bot]
93d4701d80 Bump dependency.cxf.version from 4.0.4 to 4.0.5 (#2794)
Bumps `dependency.cxf.version` from 4.0.4 to 4.0.5.

Updates `org.apache.cxf:cxf-rt-frontend-jaxws` from 4.0.4 to 4.0.5

Updates `org.apache.cxf:cxf-rt-frontend-jaxrs` from 4.0.4 to 4.0.5

Updates `org.apache.cxf:cxf-rt-rs-client` from 4.0.4 to 4.0.5

Updates `org.apache.cxf:cxf-rt-transports-http` from 4.0.4 to 4.0.5

Updates `org.apache.cxf:cxf-rt-ws-policy` from 4.0.4 to 4.0.5

---
updated-dependencies:
- dependency-name: org.apache.cxf:cxf-rt-frontend-jaxws
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.apache.cxf:cxf-rt-frontend-jaxrs
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.apache.cxf:cxf-rt-rs-client
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.apache.cxf:cxf-rt-transports-http
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.apache.cxf:cxf-rt-ws-policy
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-19 10:22:28 +02:00
alfresco-build
64baf03818 [maven-release-plugin][skip ci] prepare for next development iteration 2024-07-18 08:49:23 +00:00
alfresco-build
e39606aec5 [maven-release-plugin][skip ci] prepare release 23.3.0.78 2024-07-18 08:49:21 +00:00
Manish Kumar
7581e07c3c Merge pull request #2790 from Alfresco/fix/PRODSEC-8922-XSS
[PRODSEC-8922] fix xss vulnerability
2024-07-18 13:41:30 +05:30
alfresco-build
a01d375e6f [maven-release-plugin][skip ci] prepare for next development iteration 2024-07-17 11:25:21 +00:00
alfresco-build
a98f44803a [maven-release-plugin][skip ci] prepare release 23.3.0.77 2024-07-17 11:25:19 +00:00
SathishK-T
cabc38b386 [MNT-24137] Audit Issue Internal Server Error fix (#2786)
* [MNT-24137][ags][tas] Audit Bug Fix

* [MNT-24137][ags][tas] Audit Bug Fix

* [MNT-24137][ags][tas] Audit Bug Fix

* [MNT-24137][ags][tas] Audit Bug Fix

* [MNT-24137][ags][tas] Audit Bug Fix

* [MNT-24137][ags][tas] Audit Bug Fix

* [MNT-24137][ags][tas] Audit Bug Fix

---------

Co-authored-by: Sathish Kumar <ST28@ford.com>
2024-07-17 16:19:19 +05:30
Eva Vasques
9ed29967b7 MNT-24503 - Limits on FixedAclUpdater (#2788)
* Limit the job execution to a configurable amount of nodes (system.fixedACLsUpdater.maxItems)
    * Add query template select_NodesWithAspectIds_Limited that does a left join with alf_store and limits the results
    * Query executions by the job are now limited to maxItemBatchSize
    * Imposing the order by in the query is now configurable (system.fixedACLsUpdater.orderNodes)
2024-07-17 11:47:06 +01:00
alfresco-build
b63a3eae9b [maven-release-plugin][skip ci] prepare for next development iteration 2024-07-17 10:20:52 +00:00
alfresco-build
1ce46c2039 [maven-release-plugin][skip ci] prepare release 23.3.0.76 2024-07-17 10:20:50 +00:00
Suneet Gupta
278aa59302 [MNT-24310] Fix AGS Rest API returning non RM objects (#2787)
* [MNT-24310] Fix AGS Rest API returning non RM objects

* [MNT-24310] Fix AGS Rest API returning non RM objects

* [MNT-24310] Fix AGS Rest API returning non RM objects

* [MNT-24310] Fix AGS Rest API returning non RM objects

* [MNT-24310] Fix AGS Rest API returning non RM objects
2024-07-17 15:14:57 +05:30
Manish Kumar
51a51ecd6b [PRODSEC-8922] fix xss vulnerability 2024-07-17 13:52:19 +05:30
alfresco-build
10f4b10ae8 [maven-release-plugin][skip ci] prepare for next development iteration 2024-07-15 16:37:35 +00:00
56 changed files with 695 additions and 176 deletions

View File

@@ -138,7 +138,7 @@ jobs:
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.35.2
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v1.35.2
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.35.2
- uses: Alfresco/ya-pmd-scan@v3.0.2
- uses: Alfresco/ya-pmd-scan@v4.0.0
with:
classpath-build-command: "mvn test-compile -ntp -Pags -pl \"-:alfresco-community-repo-docker\""

View File

@@ -2,38 +2,57 @@
[![Build Status](https://github.com/Alfresco/alfresco-community-repo/actions/workflows/master_release.yml/badge.svg?branch=master)](https://github.com/Alfresco/alfresco-community-repo/actions/workflows/master_release.yml)
#### Alfresco Core
## Table of Contents
1. [Content](#content)
2. [Artifacts](#artifacts)
3. [Setup](#setting-up-and-building-your-development-environment)
4. [Branches](#branches)
5. [Contributing](#contributing-guide)
6. [Helpful links](#helpful-links)
## Content
Alfresco Community Repository contains following libraries:
### Alfresco Core
Core is a library packaged as a jar file which contains the following:
Alfresco Core is a library packaged as a jar file which contains the following:
* Various helpers and utils
* Canned queries interface and supporting classes
* Generic encryption supporting classes
#### Alfresco Data Model
Data model is a library packaged as a jar file which contains the following:
### Alfresco Data Model
Data Model is a library packaged as a jar file which contains the following:
* Dictionary, Repository and Search Services interfaces
* Models for data types and Dictionary implementation
* Parsers
#### Alfresco Repository
### Alfresco Repository
Repository is a library packaged as a jar file which contains the following:
* DAOs and SQL scripts
* Various Service implementations
* Utility classes
#### Alfresco Remote API
### Alfresco Remote API
Remote API is a library packaged as a jar file which contains the following:
* REST API framework
* WebScript implementations including [V1 REST APIs](https://hub.alfresco.com/t5/alfresco-content-services-blog/v1-rest-api-10-things-you-should-know/ba-p/287692)
* [OpenCMIS](https://chemistry.apache.org/java/opencmis.html) implementations
#### Artifacts
## Artifacts
The artifacts can be obtained by:
* downloading from [Alfresco maven repository](https://artifacts.alfresco.com/nexus/content/groups/public)
* downloading from [Alfresco maven repository](https://artifacts.alfresco.com/nexus/#browse/browse:public)
* as Maven dependency by adding the dependency to your pom file:
~~~
~~~xml
<dependency>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-core</artifactId>
@@ -64,34 +83,46 @@ The artifacts can be obtained by:
<version>version</version>
<type>war</type>
</dependency>
~~~
and Alfresco maven repository:
~~~
~~~xml
<repository>
<id>alfresco-maven-repo</id>
<url>https://artifacts.alfresco.com/nexus/content/groups/public</url>
</repository>
~~~
The SNAPSHOT versions of the artifact are not published.
## Setting up and building your development environment
See the [Development Tomcat Environment](https://github.com/Alfresco/acs-community-packaging/tree/master/dev/README.md)
page which will show you how to try out your repository changes in a local tomcat instance.
If you wish to use Docker images, take a look at the aliases ending in `D` and the docker-compose files in this
project's test modules.
See the [**Development Tomcat Environment**](https://github.com/Alfresco/acs-community-packaging/tree/master/dev/README.md)
page which will show you how to try out your repository changes in a local Tomcat instance or using Docker containers.
## Branches
This project has a branch for each ACS release. For example the code in ACS 6.2.1 is a
branch called `releases/6.2.2`. In addition to the original 6.2.2 release it will also contain Hot Fixes
added later. The latest unreleased code is on the `master` branch. There are also `.N` branches, such as
`releases/7.1.N` on which we gather unreleased fixes for future service pack releases. They do not indicate
This project has a branch for each ACS release. For example the code in ACS 6.2.2 is a
branch called **`release/6.2.2`**. In addition to the original 6.2.2 release it will also contain Hot Fixes
added later. The latest unreleased code is on the **`master`** branch. There are also **`.N`** branches, such as
**`release/7.1.N`** on which we gather unreleased fixes for future service pack releases. They do not indicate
that one is planned.
For historic reasons the version of artifacts created on each branch do not match the ACS version.
For example artifact in ACS 7.2.0 will be `14.<something>`.
For example artifact in ACS 7.2.0 will be **`14.<something>`**.
The enterprise projects which extend the `alfresco-community-repo` use the same branch names and leading
The enterprise projects which extend the **`alfresco-community-repo`** use the same branch names and leading
artifact version number.
### Contributing guide
Please use [this guide](CONTRIBUTING.md) to make a contribution to the project.
## Contributing guide
Please use [**this guide**](CONTRIBUTING.md) to make a contribution to the project.
## Helpful links
- [Alfresco Content Services Documentation](https://docs.alfresco.com/content-services/latest/)
- [Alfresco Platform](https://www.hyland.com/en/products/alfresco-platform)

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-amps</artifactId>
<version>23.3.0.75</version>
<version>23.3.0.97</version>
</parent>
<modules>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-governance-services-community-parent</artifactId>
<version>23.3.0.75</version>
<version>23.3.0.97</version>
</parent>
<modules>

View File

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

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-governance-services-community-parent</artifactId>
<version>23.3.0.75</version>
<version>23.3.0.97</version>
</parent>
<modules>

View File

@@ -125,7 +125,7 @@
parent="declarativeCapability">
<property name="name" value="DeleteRecordFolder"/>
<property name="private" value="true"/>
<property name="permission" value="CreateModifyDestroyFolders"/>
<property name="permission" value="DeleteRecords"/>
<property name="kinds">
<list>
<value>RECORD_FOLDER</value>

View File

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

View File

@@ -92,7 +92,7 @@ public class SearchTypesFactory
boolean includeRecords = false;
boolean includeSubTypes = false;
if (q != null)
if (q != null && q.getTree() != null)
{
// filtering via "where" clause
MapBasedQueryWalker propertyWalker = new MapBasedQueryWalker(listFolderChildrenEqualsQueryProperties, null);
@@ -101,11 +101,11 @@ public class SearchTypesFactory
Boolean isUnfiledRecordFolder = propertyWalker.getProperty(UnfiledChild.PARAM_IS_UNFILED_RECORD_FOLDER,
WhereClauseParser.EQUALS, Boolean.class);
Boolean isRecord = propertyWalker.getProperty(UnfiledChild.PARAM_IS_RECORD, WhereClauseParser.EQUALS, Boolean.class);
if ((isUnfiledRecordFolder != null && isUnfiledRecordFolder.booleanValue()) || (isRecord != null && !isRecord.booleanValue()))
if (checkIncludeUnfiledRecordFolders(isUnfiledRecordFolder, isRecord))
{
includeUnfiledRecordFolders = true;
}
else if ((isUnfiledRecordFolder != null && !isUnfiledRecordFolder.booleanValue()) || (isRecord != null && isRecord.booleanValue()))
else if (checkIncludeRecords(isUnfiledRecordFolder, isRecord))
{
includeRecords = true;
}
@@ -199,11 +199,11 @@ public class SearchTypesFactory
WhereClauseParser.EQUALS, Boolean.class);
Boolean isRecordCategory = propertyWalker.getProperty(RecordCategoryChild.PARAM_IS_RECORD_CATEGORY, WhereClauseParser.EQUALS, Boolean.class);
if ((isRecordFolder != null && isRecordFolder.booleanValue()) || (isRecordCategory != null && !isRecordCategory.booleanValue()))
if (checkIncludeUnfiledRecordFolders(isRecordFolder, isRecordCategory))
{
includeRecordFolders = true;
}
else if ((isRecordFolder != null && !isRecordFolder.booleanValue()) || (isRecordCategory != null && isRecordCategory.booleanValue()))
else if (checkIncludeRecords(isRecordFolder, isRecordCategory))
{
includeRecordCategories = true;
}
@@ -291,4 +291,16 @@ public class SearchTypesFactory
return new Pair<>(filterNodeTypeQName, filterIncludeSubTypes);
}
private static boolean checkIncludeRecords(Boolean isUnfiledRecordFolder, Boolean isRecord)
{
return (isUnfiledRecordFolder != null && !isUnfiledRecordFolder.booleanValue()) || (isRecord != null
&& isRecord.booleanValue());
}
private static boolean checkIncludeUnfiledRecordFolders(Boolean isUnfiledRecordFolder, Boolean isRecord)
{
return (isUnfiledRecordFolder != null && isUnfiledRecordFolder.booleanValue()) || (isRecord != null
&& !isRecord.booleanValue());
}
}

View File

@@ -93,15 +93,15 @@ public class RMv33HoldAuditEntryValuesPatchUnitTest
verify(mockedRecordsManagementQueryDAO, times(1)).updatePropertyStringValueEntity(deleteHoldPropertyStringValueEntity);
assertEquals("Add To Hold", addToHoldPropertyStringValueEntity.getStringValue());
assertEquals("add to hold", addToHoldPropertyStringValueEntity.getStringEndLower());
assertEquals("add to hold", addToHoldPropertyStringValueEntity.getStringLower());
assertEquals(Long.valueOf(770_786_109L), addToHoldPropertyStringValueEntity.getStringCrc());
assertEquals("Remove From Hold", removeFromHoldPropertyStringValueEntity.getStringValue());
assertEquals("remove from hold", removeFromHoldPropertyStringValueEntity.getStringEndLower());
assertEquals("remove from hold", removeFromHoldPropertyStringValueEntity.getStringLower());
assertEquals(Long.valueOf(2_967_613_012L), removeFromHoldPropertyStringValueEntity.getStringCrc());
assertEquals("Delete Hold", deleteHoldPropertyStringValueEntity.getStringValue());
assertEquals("delete hold", deleteHoldPropertyStringValueEntity.getStringEndLower());
assertEquals("delete hold", deleteHoldPropertyStringValueEntity.getStringLower());
assertEquals(Long.valueOf(132_640_810L), deleteHoldPropertyStringValueEntity.getStringCrc());
}

View File

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

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>23.3.0.75</version>
<version>23.3.0.97</version>
</parent>
<modules>

View File

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

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>23.3.0.75</version>
<version>23.3.0.97</version>
</parent>
<dependencies>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>23.3.0.75</version>
<version>23.3.0.97</version>
</parent>
<properties>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>23.3.0.75</version>
<version>23.3.0.97</version>
</parent>
<dependencies>

View File

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

View File

@@ -1,6 +1,5 @@
# Fetch image based on Tomcat 9.0, Java 17 and Rocky Linux 8
# More infos about this image: https://github.com/Alfresco/alfresco-docker-base-tomcat
FROM alfresco/alfresco-base-tomcat:tomcat10-jre17-rockylinux8-202306291245
FROM alfresco/alfresco-base-tomcat:tomcat10-jre17-rockylinux9@sha256:395664f9d9be0c9f73d3b722a58fd559ee7231609b263dfe19502617652740e3
# Set default docker_context.
ARG resource_path=target
@@ -14,6 +13,9 @@ ARG USERID=33000
# Set default environment args
ARG TOMCAT_DIR=/usr/local/tomcat
# Needed for installation but make sure another USER directive is added after
# this with a non-root user
USER root
# Create prerequisite to store tools and properties
RUN mkdir -p ${TOMCAT_DIR}/shared/classes/alfresco/extension/mimetypes && \
@@ -61,13 +63,7 @@ RUN sed -i -e "s_appender.rolling.fileName\=alfresco.log_appender.rolling.fileNa
sed -i -e "\$a\grant\ codeBase\ \"file:\$\{catalina.base\}\/webapps\/alfresco\/-\" \{\n\ permission\ java.security.AllPermission\;\n\};\ngrant\ codeBase\ \"file:\$\{catalina.base\}\/webapps\/_vti_bin\/-\" \{\n\ permission\ java.security.AllPermission\;\n\};\ngrant\ codeBase\ \"file:\$\{catalina.base\}\/webapps\/ROOT\/-\" \{\n\ permission org.apache.catalina.security.DeployXmlPermission \"ROOT\";\n\};" ${TOMCAT_DIR}/conf/catalina.policy
# fontconfig is required by Activiti worflow diagram generator
# installing pinned dependencies as well
RUN yum install -y fontconfig-2.13.1-4.el8 \
dejavu-fonts-common-2.35-7.el8 \
fontpackages-filesystem-1.44-22.el8 \
freetype-2.9.1-9.el8 \
libpng-1.6.34-5.el8 \
dejavu-sans-fonts-2.35-7.el8 && \
RUN yum install -y fontconfig-2.14.0-2.el9_1 && \
yum clean all
# The standard configuration is to have all Tomcat files owned by root with group GROUPNAME and whilst owner has read/write privileges,

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-packaging</artifactId>
<version>23.3.0.75</version>
<version>23.3.0.97</version>
</parent>
<properties>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>23.3.0.75</version>
<version>23.3.0.97</version>
</parent>
<modules>

View File

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

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-tests</artifactId>
<version>23.3.0.75</version>
<version>23.3.0.97</version>
</parent>
<organization>

View File

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

View File

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

View File

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

View File

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

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-packaging</artifactId>
<version>23.3.0.75</version>
<version>23.3.0.97</version>
</parent>
<properties>
@@ -110,6 +110,11 @@
<artifactId>mysql-connector-java</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.owasp.encoder</groupId>
<artifactId>encoder</artifactId>
<version>1.2.3</version>
</dependency>
</dependencies>
<build>

View File

@@ -34,6 +34,7 @@
<%@ page import="org.alfresco.service.cmr.module.ModuleDetails" %>
<%@ page import="org.alfresco.service.cmr.module.ModuleInstallState" %>
<%@ page import="java.util.Calendar" %>
<%@ page import="org.owasp.encoder.Encode" %>
<!-- Enterprise index-jsp placeholder -->
<%
@@ -88,7 +89,7 @@ ModuleDetails shareServicesModule = moduleService.getModule("alfresco-share-serv
<p></p>
<p><a href="./s/index">Alfresco WebScripts Home</a> (admin only - INTERNAL)</p>
<p></p>
<p><a href="<%=UrlUtil.getApiExplorerUrl(sysAdminParams, request.getRequestURL().toString(), request.getRequestURI())%>">Alfresco API Explorer</a></p>
<p><a href="<%=Encode.forHtmlAttribute(UrlUtil.getApiExplorerUrl(sysAdminParams, request.getRequestURL().toString(), request.getRequestURI()))%>">Alfresco API Explorer</a></p>
<%
if (descriptorService.getLicenseDescriptor() == null && transactionService.isReadOnly())
{

16
pom.xml
View File

@@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>alfresco-community-repo</artifactId>
<version>23.3.0.75</version>
<version>23.3.0.97</version>
<packaging>pom</packaging>
<name>Alfresco Community Repo Parent</name>
@@ -51,8 +51,8 @@
<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.3</dependency.alfresco-transform-core.version>
<dependency.alfresco-transform-service.version>4.1.3</dependency.alfresco-transform-service.version>
<dependency.alfresco-transform-core.version>5.1.4-A3</dependency.alfresco-transform-core.version>
<dependency.alfresco-transform-service.version>4.1.4-A2</dependency.alfresco-transform-service.version>
<dependency.alfresco-greenmail.version>7.0</dependency.alfresco-greenmail.version>
<dependency.acs-event-model.version>0.0.27</dependency.acs-event-model.version>
@@ -61,7 +61,7 @@
<dependency.spring-security.version>6.3.1</dependency.spring-security.version>
<dependency.antlr.version>3.5.3</dependency.antlr.version>
<dependency.jackson.version>2.15.2</dependency.jackson.version>
<dependency.cxf.version>4.0.4</dependency.cxf.version>
<dependency.cxf.version>4.0.5</dependency.cxf.version>
<dependency.opencmis.version>1.0.0-jakarta-1</dependency.opencmis.version>
<dependency.webscripts.version>9.0</dependency.webscripts.version>
<dependency.bouncycastle.version>1.78.1</dependency.bouncycastle.version>
@@ -113,13 +113,13 @@
<dependency.jakarta-json-path.version>2.9.0</dependency.jakarta-json-path.version>
<dependency.json-smart.version>2.5.1</dependency.json-smart.version>
<alfresco.googledrive.version>4.1.0</alfresco.googledrive.version>
<alfresco.aos-module.version>3.1.0-A1</alfresco.aos-module.version>
<alfresco.aos-module.version>3.1.0</alfresco.aos-module.version>
<alfresco.api-explorer.version>23.2.0</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.0.1</license-maven-plugin.version>
<dependency.postgresql.version>42.6.0</dependency.postgresql.version>
<dependency.postgresql.version>42.7.3</dependency.postgresql.version>
<dependency.mysql.version>8.0.30</dependency.mysql.version>
<dependency.mysql-image.version>8</dependency.mysql-image.version>
<dependency.mariadb.version>2.7.4</dependency.mariadb.version>
@@ -151,7 +151,7 @@
<connection>scm:git:https://github.com/Alfresco/alfresco-community-repo.git</connection>
<developerConnection>scm:git:https://github.com/Alfresco/alfresco-community-repo.git</developerConnection>
<url>https://github.com/Alfresco/alfresco-community-repo</url>
<tag>23.3.0.75</tag>
<tag>23.3.0.97</tag>
</scm>
<distributionManagement>
@@ -1004,7 +1004,7 @@
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.43.4</version>
<version>0.45.0</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>23.3.0.75</version>
<version>23.3.0.97</version>
</parent>
<dependencies>

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -909,16 +909,14 @@ public class AuditImpl implements Audit
public int getAuditEntriesCountByAppAndProperties(AuditService.AuditApplication auditApplication, AuditEntryQueryWalker propertyWalker)
{
final String applicationName = auditApplication.getKey().substring(1);
AuditQueryParameters parameters = new AuditQueryParameters();
parameters.setApplicationName(applicationName);
parameters.setApplicationName(auditApplication.getName());
parameters.setFromTime(propertyWalker.getFromTime());
parameters.setToTime(propertyWalker.getToTime());
parameters.setFromId(propertyWalker.getFromId());
parameters.setToId(propertyWalker.getToId());
parameters.setUser(propertyWalker.getCreatedByUser());
return auditService.getAuditEntriesCountByAppAndProperties(applicationName, parameters);
return auditService.getAuditEntriesCountByAppAndProperties(parameters);
}
}

View File

@@ -125,7 +125,7 @@ public class PeopleImpl implements People
protected ResetPasswordService resetPasswordService;
protected UserRegistrySynchronizer userRegistrySynchronizer;
protected Renditions renditions;
private Boolean allowImmutableEnabledUpdate;
private final static Map<String, QName> sort_params_to_qnames;
static
@@ -202,6 +202,11 @@ public class PeopleImpl implements People
this.userRegistrySynchronizer = userRegistrySynchronizer;
}
public void setAllowImmutableEnabledUpdate(Boolean allowImmutableEnabledUpdate)
{
this.allowImmutableEnabledUpdate = allowImmutableEnabledUpdate;
}
/**
* Validate, perform -me- substitution and canonicalize the person ID.
*
@@ -708,16 +713,26 @@ public class PeopleImpl implements People
// if requested, update password
updatePassword(isAdmin, personIdToUpdate, person);
if (person.isEnabled() != null)
Set<QName> immutableProperties = userRegistrySynchronizer.getPersonMappedProperties(personIdToUpdate);
Boolean isEnabled = person.isEnabled();
if (isEnabled != null)
{
if (isAdminAuthority(personIdToUpdate))
{
throw new PermissionDeniedException("Admin authority cannot be disabled.");
}
// note: if current user is not an admin then permission denied exception is thrown
MutableAuthenticationService mutableAuthenticationService = (MutableAuthenticationService) authenticationService;
mutableAuthenticationService.setAuthenticationEnabled(personIdToUpdate, person.isEnabled());
if (allowImmutableEnabledStatusUpdate(personIdToUpdate, isAdmin, immutableProperties))
{
LOGGER.info("User " + personIdToUpdate + " is immutable but enabled status will be set to: " + isEnabled);
}
else
{
// note: if current user is not an admin then permission denied exception is thrown
MutableAuthenticationService mutableAuthenticationService = (MutableAuthenticationService) authenticationService;
mutableAuthenticationService.setAuthenticationEnabled(personIdToUpdate, person.isEnabled());
}
}
NodeRef personNodeRef = personService.getPerson(personIdToUpdate, false);
@@ -742,9 +757,7 @@ public class PeopleImpl implements People
properties.putAll(nodes.mapToNodeProperties(customProps));
}
// MNT-21150 LDAP synced attributes can be changed using REST API
Set<QName> immutableProperties = userRegistrySynchronizer.getPersonMappedProperties(personIdToUpdate);
// MNT-21150 LDAP synced attributes can't be changed using REST API
immutableProperties.forEach(immutableProperty -> {
if (properties.containsKey(immutableProperty))
{
@@ -768,6 +781,28 @@ public class PeopleImpl implements People
return getPerson(personId);
}
private boolean allowImmutableEnabledStatusUpdate(String userId, boolean isAdmin, Set<QName> immutableProperties)
{
if (allowImmutableEnabledUpdate)
{
boolean containLdapUserAccountStatus = false;
QName propertyNameToCheck = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "userAccountStatusProperty");
for (QName immutableProperty : immutableProperties)
{
if (immutableProperty.equals(propertyNameToCheck))
{
containLdapUserAccountStatus = true;
break;
}
}
return isAdmin && !containLdapUserAccountStatus && !isMutableAuthority(userId);
}
return false;
}
private boolean checkCurrentUserOrAdmin(String personId)
{
boolean isAdmin = isAdminAuthority();

View File

@@ -764,6 +764,7 @@
<property name="thumbnailService" ref="ThumbnailService" />
<property name="resetPasswordService" ref="resetPasswordService" />
<property name="userRegistrySynchronizer" ref="userRegistrySynchronizer" />
<property name="allowImmutableEnabledUpdate" value="${allow.immutable.user.enabled.status.update}" />
</bean>
<bean id="People" class="org.springframework.aop.framework.ProxyFactoryBean">

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>23.3.0.75</version>
<version>23.3.0.97</version>
</parent>
<dependencies>

View File

@@ -41,6 +41,8 @@ public class IdsEntity
private Long idFour;
private List<Long> ids;
private boolean ordered;
private Integer maxResults;
public Long getIdOne()
{
return idOne;
@@ -89,4 +91,12 @@ public class IdsEntity
{
this.ordered = ordered;
}
public int getMaxResults()
{
return maxResults;
}
public void setMaxResults(Integer maxResults)
{
this.maxResults = maxResults;
}
}

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -276,11 +276,10 @@ public interface AuditComponent
/**
* Issue an audit query to retrieve count of records for a given application and properties
*
* @param applicationName the name of the application
* @param parameters audit parameters provided by the <code>where</code> clause on the ReST API
* @return a map containing min/max and the associated value
*/
default int getAuditEntriesCountByAppAndProperties(String applicationName, AuditQueryParameters parameters)
default int getAuditEntriesCountByAppAndProperties(AuditQueryParameters parameters)
{
return -1;
}

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -956,10 +956,8 @@ public class AuditComponentImpl implements AuditComponent
return auditDAO.getAuditEntriesCountByApp(applicationId);
}
@Override public int getAuditEntriesCountByAppAndProperties(String applicationName, AuditQueryParameters parameters)
@Override public int getAuditEntriesCountByAppAndProperties(AuditQueryParameters parameters)
{
org.alfresco.repo.domain.audit.AuditQueryParameters dbParameters = new org.alfresco.repo.domain.audit.AuditQueryParameters();
return auditDAO.getAuditEntriesCountByAppAndProperties(applicationName, parameters);
return auditDAO.getAuditEntriesCountByAppAndProperties(parameters);
}
}
}

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -190,8 +190,8 @@ public class AuditServiceImpl implements AuditService
/**
* {@inheritDoc}
*/
@Override public int getAuditEntriesCountByAppAndProperties(String applicationName, AuditQueryParameters parameters)
@Override public int getAuditEntriesCountByAppAndProperties(AuditQueryParameters parameters)
{
return auditComponent.getAuditEntriesCountByAppAndProperties(applicationName, parameters);
return auditComponent.getAuditEntriesCountByAppAndProperties(parameters);
}
}

View File

@@ -1,28 +1,28 @@
/*
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2016 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%
*/
/*
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2024 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.domain;
@@ -102,21 +102,22 @@ public class CrcHelper
{
throw new RuntimeException("UTF-8 encoding is not supported");
}
// Get the short value (case-sensitive or not)
// Crc Value will change based on the case-sensitive, So we need to get the short value based on case-sensitive
String valueShort = null;
int valueLen = valueLowerCase.length();
String currentValue = caseSensitive ? value : valueLowerCase;
int valueLen = currentValue.length();
if (valueLen < dataLength)
{
valueShort = valueLowerCase;
valueShort = currentValue;
}
else if (useCharsFromStart)
{
valueShort = valueLowerCase.substring(0, dataLength - 1);
valueShort = currentValue.substring(0, dataLength - 1);
}
else
{
valueShort = valueLowerCase.substring(valueLen - dataLength);
valueShort = currentValue.substring(valueLen - dataLength);
}
return new Pair<String, Long>(valueShort, valueCrc);
}
}
}

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -248,11 +248,10 @@ public interface AuditDAO
/**
* Issue an audit query to retrieve count of records for a given application and properties
*
* @param applicationName name of the application to be queried
* @param parameters audit parameters provided by the <code>where</code> clause on the ReST API
* @return a map containing min/max and the associated value
*/
default int getAuditEntriesCountByAppAndProperties(String applicationName, org.alfresco.service.cmr.audit.AuditQueryParameters parameters)
default int getAuditEntriesCountByAppAndProperties(org.alfresco.service.cmr.audit.AuditQueryParameters parameters)
{
return -1;
}

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -237,7 +237,7 @@ public class AuditDAOImpl extends AbstractAuditDAOImpl
}
@Override
public int getAuditEntriesCountByAppAndProperties(String applicationName, org.alfresco.service.cmr.audit.AuditQueryParameters parameters)
public int getAuditEntriesCountByAppAndProperties(org.alfresco.service.cmr.audit.AuditQueryParameters parameters)
{
AuditQueryParameters dbParameters = convertFromRestAuditQueryParameters(parameters);

View File

@@ -2785,6 +2785,23 @@ public abstract class AbstractNodeDAOImpl implements NodeDAO, BatchingDAO
selectNodesWithAspects(qnameIds, minNodeId, maxNodeId, ordered, resultsCallback);
}
@Override
public void getNodesWithAspects(
Set<QName> aspectQNames,
Long minNodeId, Long maxNodeId, boolean ordered,
int maxResults,
NodeRefQueryCallback resultsCallback)
{
Set<Long> qnameIdsSet = qnameDAO.convertQNamesToIds(aspectQNames, false);
if (qnameIdsSet.isEmpty())
{
// No point running a query
return;
}
List<Long> qnameIds = new ArrayList<>(qnameIdsSet);
selectNodesWithAspects(qnameIds, minNodeId, maxNodeId, ordered, maxResults, resultsCallback);
}
/**
* @return Returns a writable copy of the cached aspects set
*/
@@ -4960,6 +4977,10 @@ public abstract class AbstractNodeDAOImpl implements NodeDAO, BatchingDAO
List<Long> qnameIds,
Long minNodeId, Long maxNodeId, boolean ordered,
NodeRefQueryCallback resultsCallback);
protected abstract void selectNodesWithAspects(
List<Long> qnameIds,
Long minNodeId, Long maxNodeId, boolean ordered, int maxResults,
NodeRefQueryCallback resultsCallback);
protected abstract Long insertNodeAssoc(Long sourceNodeId, Long targetNodeId, Long assocTypeQNameId, int assocIndex);
protected abstract int updateNodeAssoc(Long id, int assocIndex);
protected abstract int deleteNodeAssoc(Long sourceNodeId, Long targetNodeId, Long assocTypeQNameId);
@@ -5088,4 +5109,5 @@ public abstract class AbstractNodeDAOImpl implements NodeDAO, BatchingDAO
protected abstract Long selectMinTxInNodeIdRange(Long fromNodeId, Long toNodeId);
protected abstract Long selectMaxTxInNodeIdRange(Long fromNodeId, Long toNodeId);
protected abstract Long selectNextTxCommitTime(Long fromCommitTime);
}

View File

@@ -427,6 +427,22 @@ public interface NodeDAO extends NodeBulkLoader
Long minNodeId, Long maxNodeId, boolean ordered,
NodeRefQueryCallback resultsCallback);
/**
* Get nodes with aspects between the given ranges, ordering the results optionally
* and limit the result set
*
* @param aspectQNames the aspects that must be on the nodes
* @param minNodeId the minimum node ID (inclusive)
* @param maxNodeId the maximum node ID (exclusive)
* @param ordered if the results are to be ordered by nodeID
* @param maxResults limit query to maxResults
* @param resultsCallback callback to process results
*/
public void getNodesWithAspects(
Set<QName> aspectQNames,
Long minNodeId, Long maxNodeId, boolean ordered, int maxResults,
NodeRefQueryCallback resultsCallback);
/*
* Node Assocs
*/

View File

@@ -116,6 +116,7 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
private static final String SELECT_NODE_MAX_ID = "alfresco.node.select_NodeMaxId";
private static final String SELECT_NODE_INTERVAL_BY_TYPE = "alfresco.node.select_MinMaxNodeIdForNodeType";
private static final String SELECT_NODES_WITH_ASPECT_IDS = "alfresco.node.select_NodesWithAspectIds";
private static final String SELECT_NODES_WITH_ASPECT_IDS_LIMITED = "alfresco.node.select_NodesWithAspectIds_Limited";
private static final String INSERT_NODE_ASSOC = "alfresco.node.insert.insert_NodeAssoc";
private static final String UPDATE_NODE_ASSOC = "alfresco.node.update_NodeAssoc";
private static final String DELETE_NODE_ASSOC = "alfresco.node.delete_NodeAssoc";
@@ -799,6 +800,33 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
template.select(SELECT_NODES_WITH_ASPECT_IDS, parameters, resultHandler);
}
@Override
protected void selectNodesWithAspects(
List<Long> qnameIds,
Long minNodeId, Long maxNodeId, boolean ordered,
final int maxResults,
final NodeRefQueryCallback resultsCallback)
{
@SuppressWarnings("rawtypes")
ResultHandler resultHandler = new ResultHandler()
{
public void handleResult(ResultContext context)
{
NodeEntity entity = (NodeEntity) context.getResultObject();
Pair<Long, NodeRef> nodePair = new Pair<>(entity.getId(), entity.getNodeRef());
resultsCallback.handle(nodePair);
}
};
IdsEntity parameters = new IdsEntity();
parameters.setIdOne(minNodeId);
parameters.setIdTwo(maxNodeId);
parameters.setIds(qnameIds);
parameters.setOrdered(ordered);
parameters.setMaxResults(maxResults);
template.select(SELECT_NODES_WITH_ASPECT_IDS_LIMITED, parameters, resultHandler);
}
@Override
protected Long insertNodeAssoc(Long sourceNodeId, Long targetNodeId, Long assocTypeQNameId, int assocIndex)
{

View File

@@ -85,8 +85,11 @@ public class FixedAclUpdater extends TransactionListenerAdapter implements Appli
public static final String FIXED_ACL_ASYNC_REQUIRED_KEY = "FIXED_ACL_ASYNC_REQUIRED";
public static final String FIXED_ACL_ASYNC_CALL_KEY = "FIXED_ACL_ASYNC_CALL";
protected static final QName LOCK_Q_NAME = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "FixedAclUpdater");
private static final int DEFAULT_MAX_ITEMS = Integer.MAX_VALUE;
/** A set of listeners to receive callback events whenever permissions are updated by this class. */
private static Set<FixedAclUpdaterListener> listeners = Sets.newConcurrentHashSet();
@@ -101,6 +104,8 @@ public class FixedAclUpdater extends TransactionListenerAdapter implements Appli
private int maxItemBatchSize = 100;
private int numThreads = 4;
private boolean forceSharedACL = false;
private int maxItems = DEFAULT_MAX_ITEMS;
private boolean orderNodes = true;
private ClassPolicyDelegate<OnInheritPermissionsDisabled> onInheritPermissionsDisabledDelegate;
private PolicyComponent policyComponent;
@@ -147,12 +152,22 @@ public class FixedAclUpdater extends TransactionListenerAdapter implements Appli
this.forceSharedACL = forceSharedACL;
}
public void setOrderNodes(boolean orderNodes)
{
this.orderNodes = orderNodes;
}
public void setLockTimeToLive(long lockTimeToLive)
{
this.lockTimeToLive = lockTimeToLive;
this.lockRefreshTime = lockTimeToLive / 2;
}
public void setMaxItems(int maxItems)
{
this.maxItems = maxItems > 0 ? maxItems : DEFAULT_MAX_ITEMS;
}
public void setPolicyComponent(PolicyComponent policyComponent)
{
this.policyComponent = policyComponent;
@@ -209,7 +224,7 @@ public class FixedAclUpdater extends TransactionListenerAdapter implements Appli
public List<NodeRef> execute() throws Throwable
{
getNodesCallback.init();
nodeDAO.getNodesWithAspects(aspects, getNodesCallback.getMinNodeId(), null, true, getNodesCallback);
nodeDAO.getNodesWithAspects(aspects, getNodesCallback.getMinNodeId(), null, orderNodes, maxItemBatchSize, getNodesCallback);
getNodesCallback.done();
return getNodesCallback.getNodes();
@@ -220,6 +235,11 @@ public class FixedAclUpdater extends TransactionListenerAdapter implements Appli
int countNodesWithAspects()
{
if (maxItems < DEFAULT_MAX_ITEMS) {
log.info("Job limited to process a maximum of " + maxItems + " Pending Acls");
return maxItems;
}
final CountNodesWithAspectCallback countNodesCallback = new CountNodesWithAspectCallback();
int count = transactionService.getRetryingTransactionHelper()
.doInTransaction(new RetryingTransactionCallback<Integer>()
@@ -238,6 +258,9 @@ public class FixedAclUpdater extends TransactionListenerAdapter implements Appli
private class AclWorkProvider implements BatchProcessWorkProvider<NodeRef>
{
private GetNodesWithAspects getNodesWithAspects;
private long estimatedUpdatedItems;
private long execTime;
private long execBatches;
AclWorkProvider()
{
@@ -259,8 +282,37 @@ public class FixedAclUpdater extends TransactionListenerAdapter implements Appli
@Override
public Collection<NodeRef> getNextWork()
{
return getNodesWithAspects.getNodesWithAspects();
if(estimatedUpdatedItems >= maxItems)
{
log.info("Reached max items to process. Nodes Processed: " + estimatedUpdatedItems + "/" + maxItems);
return Collections.emptyList();
}
long initTime = System.currentTimeMillis();
Collection<NodeRef> batchNodes = getNodesWithAspects.getNodesWithAspects();
long endTime = System.currentTimeMillis();
if (log.isDebugEnabled())
{
log.debug("Query for batch executed in " + (endTime-initTime) + " ms");
}
if (!batchNodes.isEmpty())
{
// Increment estimatedUpdatedItems with the expected number of nodes to process
estimatedUpdatedItems += batchNodes.size();
execTime+=endTime-initTime;
execBatches++;
}
return batchNodes;
}
public double getAverageQueryExecutionTime()
{
return execBatches > 0 ? execTime/execBatches : 0;
}
}
protected class AclWorker implements BatchProcessor.BatchProcessWorker<NodeRef>
@@ -451,6 +503,7 @@ public class FixedAclUpdater extends TransactionListenerAdapter implements Appli
try
{
log.info("Running FixedAclUpdater. Max Items: " + maxItems + ", Impose order: " + orderNodes);
lockToken = jobLockService.getLock(LOCK_Q_NAME, lockTimeToLive, 0, 1);
jobLockService.refreshLock(lockToken, LOCK_Q_NAME, lockRefreshTime, jobLockRefreshCallback);
@@ -460,6 +513,7 @@ public class FixedAclUpdater extends TransactionListenerAdapter implements Appli
transactionService.getRetryingTransactionHelper(), provider, numThreads, maxItemBatchSize, applicationContext,
log, 100);
int count = bp.process(worker, true);
log.info("FixedAclUpdater updated " + count + ". Average query time " + provider.getAverageQueryExecutionTime() + " ms");
return count;
}
catch (LockAcquisitionException e)

View File

@@ -1,28 +1,28 @@
/*
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2016 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%
*/
/*
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2024 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.domain.propval;
import org.alfresco.repo.domain.CrcHelper;
@@ -44,6 +44,7 @@ public class PropertyStringValueEntity
private String stringValue;
private String stringEndLower;
private Long stringCrc;
private String stringLower;
public PropertyStringValueEntity()
{
@@ -115,6 +116,9 @@ public class PropertyStringValueEntity
Pair<String, Long> crcPair = CrcHelper.getStringCrcPair(value, 16, false, true);
stringEndLower = crcPair.getFirst();
stringCrc = crcPair.getSecond();
// Calculate the crc value with case-insensitive
Pair<String, Long> crcPairWithCaseInSensitive = CrcHelper.getStringCrcPair(value, 16, false, false);
stringLower = crcPairWithCaseInSensitive.getFirst();
}
public Long getId()
@@ -156,4 +160,14 @@ public class PropertyStringValueEntity
{
this.stringCrc = stringCrc;
}
public String getStringLower()
{
return stringLower;
}
public void setStringLower(String stringLower)
{
this.stringLower = stringLower;
}
}

View File

@@ -0,0 +1,112 @@
/*
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2024 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.rendition2.script;
import java.util.List;
import org.alfresco.repo.jscript.BaseScopableProcessorExtension;
import org.alfresco.repo.jscript.ScriptNode;
import org.alfresco.repo.rendition2.RenditionService2;
import org.alfresco.service.ServiceRegistry;
import org.alfresco.service.cmr.repository.ChildAssociationRef;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* The {@code ScriptRenditionService2} class provides a scripting interface for working with Rendition Service 2.
* It allows rendering source nodes with specified rendition definitions and retrieving renditions associated with a node.
*/
@SuppressWarnings({"PMD.ProperLogger", "PMD.FieldNamingConventions"})
public class ScriptRenditionService2 extends BaseScopableProcessorExtension
{
private static final Log logger = LogFactory.getLog(ScriptRenditionService2.class);
private ServiceRegistry serviceRegistry;
private RenditionService2 renditionService;
/**
* Sets the {@link ServiceRegistry} to be used by this script object.
*
* @param serviceRegistry The ServiceRegistry to be set.
*/
public void setServiceRegistry(ServiceRegistry serviceRegistry)
{
this.serviceRegistry = serviceRegistry;
this.renditionService = serviceRegistry.getRenditionService2();
}
/**
* Renders the specified source node with the given rendition definition.
* Since renditionService2 is designed to asynchronous, no result is returned.
*
* @param sourceNode The source node to be rendered.
* @param renditionName The name of the rendition definition, like "pdf".
*/
public void render(ScriptNode sourceNode, String renditionName)
{
if (logger.isDebugEnabled())
{
String msg = "Rendering source node '" +
sourceNode +
"' with renditionDef '" + renditionName +
"'";
logger.debug(msg);
}
this.renditionService.render(sourceNode.getNodeRef(), renditionName);
}
/**
* Retrieves an array of {@link ScriptNode} objects representing renditions associated with the specified node.
*
* @param node The node for which to retrieve renditions.
* @return An array of {@code ScriptNode} objects representing renditions.
*/
public ScriptNode[] getRenditions(ScriptNode node)
{
List<ChildAssociationRef> renditions = this.renditionService.getRenditions(node.getNodeRef());
ScriptNode[] renditionObjs = new ScriptNode[renditions.size()];
for (int i = 0; i < renditions.size(); i++)
{
renditionObjs[i] = new ScriptNode(renditions.get(i).getChildRef(), serviceRegistry);
}
return renditionObjs;
}
/**
* Retrieves a {@link ScriptNode} object representing the rendition with the specified name associated with the given node.
*
* @param node The node for which to retrieve the rendition.
* @param renditionName The name of the rendition.
* @return A {@code ScriptNode} object representing the specified rendition, or {@code null} if not found.
*/
public ScriptNode getRenditionByName(ScriptNode node, String renditionName)
{
ChildAssociationRef result = this.renditionService.getRenditionByName(node.getNodeRef(), renditionName);
return result == null ? null : new ScriptNode(result.getChildRef(), serviceRegistry);
}
}

View File

@@ -36,7 +36,11 @@ import net.sf.acegisecurity.UserDetails;
import net.sf.acegisecurity.providers.UsernamePasswordAuthenticationToken;
import net.sf.acegisecurity.providers.dao.User;
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
import org.alfresco.repo.tenant.TenantService;
import org.alfresco.service.cmr.security.AuthenticationService;
import org.alfresco.service.cmr.security.MutableAuthenticationService;
import org.alfresco.service.cmr.security.PersonService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -49,12 +53,30 @@ public class AuthenticationContextImpl implements AuthenticationContext
private final Log logger = LogFactory.getLog(getClass());
private TenantService tenantService;
private PersonService personService;
private AuthenticationService authenticationService;
private Boolean allowImmutableEnabledUpdate;
public void setTenantService(TenantService tenantService)
{
this.tenantService = tenantService;
}
public void setPersonService(PersonService personService)
{
this.personService = personService;
}
public void setAuthenticationService(AuthenticationService authenticationService)
{
this.authenticationService = authenticationService;
}
public void setAllowImmutableEnabledUpdate(Boolean allowImmutableEnabledUpdate)
{
this.allowImmutableEnabledUpdate = allowImmutableEnabledUpdate;
}
/**
* Explicitly set the given validated user details to be authenticated.
*
@@ -70,7 +92,7 @@ public class AuthenticationContextImpl implements AuthenticationContext
{
// Apply the same validation that ACEGI would have to the user details - we may be going through a 'back
// door'.
if (!ud.isEnabled())
if (isDisabled(userId, ud))
{
throw new DisabledException("User is disabled");
}
@@ -114,6 +136,43 @@ public class AuthenticationContextImpl implements AuthenticationContext
}
}
private boolean isDisabled(String userId, UserDetails ud)
{
boolean isDisabled = !ud.isEnabled();
boolean isSystemUser = isSystemUserName(userId);
if (allowImmutableEnabledUpdate && !isSystemUser)
{
try
{
boolean isImmutable = isImmutableAuthority(userId);
boolean isPersonEnabled = personService.isEnabled(userId);
isDisabled = isDisabled || (isImmutable && !isPersonEnabled);
}
catch (Exception e)
{
if (logger.isWarnEnabled())
{
logger.warn("Failed to determine if person is enabled: " + userId + ", using user details status: " + isDisabled);
}
}
}
return isDisabled;
}
private boolean isImmutableAuthority(String authorityName)
{
return AuthenticationUtil.runAsSystem(new RunAsWork<Boolean>()
{
@Override public Boolean doWork() throws Exception
{
MutableAuthenticationService mutableAuthenticationService = (MutableAuthenticationService) authenticationService;
return !mutableAuthenticationService.isAuthenticationMutable(authorityName);
}
});
}
public Authentication setSystemUserAsCurrentUser()
{
return setSystemUserAsCurrentUser(TenantService.DEFAULT_DOMAIN);

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -256,11 +256,10 @@ public interface AuditService
/**
* Issue an audit query to retrieve min / max audit record id for a given application and properties
*
* @param applicationName the name of the application
* @param parameters audit parameters provided by the <code>where</code> clause on the ReST API
* @return a map containing min/max and the associated value
*/
default int getAuditEntriesCountByAppAndProperties(String applicationName, AuditQueryParameters parameters)
default int getAuditEntriesCountByAppAndProperties(AuditQueryParameters parameters)
{
return -1;
}

View File

@@ -274,6 +274,15 @@
<property name="tenantService">
<ref bean="tenantService" />
</property>
<property name="personService">
<ref bean="personService" />
</property>
<property name="authenticationService">
<ref bean="AuthenticationService" />
</property>
<property name="allowImmutableEnabledUpdate">
<value>${allow.immutable.user.enabled.status.update}</value>
</property>
</bean>
<!-- Simple Authentication component that rejects all authentication requests -->

View File

@@ -1342,6 +1342,8 @@
</property>
</bean>
<bean id="search.suggesterService" class="org.alfresco.repo.search.impl.DummySuggesterServiceImpl">
</bean>
<!-- Custom property editors -->
<bean class="org.springframework.beans.factory.config.CustomEditorConfigurer">
<property name="propertyEditorRegistrars">

View File

@@ -782,6 +782,25 @@
<if test="ordered == true">order by node.id ASC</if>
</select>
<select id="select_NodesWithAspectIds_Limited" parameterType="Ids" resultMap="result_NodeRef" >
select
node.id as id,
store.protocol as protocol,
store.identifier as identifier,
node.uuid as uuid
from
alf_node_aspects na
join alf_node node on (na.node_id = node.id)
left join alf_store store on (store.id = node.store_id)
where
<![CDATA[na.node_id >= #{idOne}]]>
<if test="idTwo != null"><![CDATA[and na.node_id < #{idTwo}]]></if>
and na.qname_id in
<foreach item="item" index="i" collection="ids" open="(" separator="," close=")">#{item}</foreach>
<if test="ordered == true">order by node.id ASC</if>
<if test="maxResults != null"><![CDATA[limit #{maxResults}]]></if>
</select>
<!-- Common results for result_NodeAssoc -->
<sql id="select_NodeAssoc_Results">
select

View File

@@ -121,6 +121,8 @@
<property name="maxItemBatchSize" value="${system.fixedACLsUpdater.maxItemBatchSize}"/>
<property name="numThreads" value="${system.fixedACLsUpdater.numThreads}"/>
<property name="forceSharedACL" value="${system.fixedACLsUpdater.forceSharedACL}"/>
<property name="maxItems" value="${system.fixedACLsUpdater.maxItems}"/>
<property name="orderNodes" value="${system.fixedACLsUpdater.orderNodes}"/>
<property name="lockTimeToLive" value="${system.fixedACLsUpdater.lockTTL}"/>
<property name="policyComponent" ref="policyComponent"/>
<property name="policyIgnoreUtil" ref="policyIgnoreUtil"/>

View File

@@ -176,4 +176,11 @@
<!-- The definitions are read from json files (possibly added to a volume via k8 ConfigMaps) -->
</beans>
<!-- JavaScript API support -->
<bean id="renditionService2Script"
class="org.alfresco.repo.rendition2.script.ScriptRenditionService2"
parent="baseJavaScriptExtension">
<property name="extensionName" value="renditionService2" />
<property name="serviceRegistry" ref="ServiceRegistry" />
</bean>
</beans>

View File

@@ -435,6 +435,9 @@ repo.remote.endpoint=/service
# persisted.
create.missing.people=${server.transaction.allow-writes}
# Allow an immutable user to have its enabled status changed
allow.immutable.user.enabled.status.update=false
# Create home folders (unless disabled, see next property) as people are created (true) or create them lazily (false)
home.folder.creation.eager=true
# Disable home folder creation - if true then home folders are not created (neither eagerly nor lazily)
@@ -1104,7 +1107,11 @@ system.fixedACLsUpdater.numThreads=4
# fixedACLsUpdater - Force shared ACL to propagate through children even if there is an unexpected ACL
system.fixedACLsUpdater.forceSharedACL=false
# fixedACLsUpdater cron expression - fire at midnight every day
system.fixedACLsUpdater.cronExpression=0 0 0 * * ?
system.fixedACLsUpdater.cronExpression=0 0 0 * * ?
# fixedACLsUpdater - maximum number of pending ACLs to process overall
system.fixedACLsUpdater.maxItems=-1
# fixedACLsUpdater - Impose the order by in the query. If false, it may not process all the results but should do the queries faster
system.fixedACLsUpdater.orderNodes=true
cmis.disable.hidden.leading.period.files=false

View File

@@ -104,9 +104,9 @@ public class FixedAclUpdaterTest
private ContentService contentService;
private AuthorityService authorityService;
private static final long MAX_TRANSACTION_TIME_DEFAULT = 10;
private static final int LARGE_TRANSACTION_TIME = 86_400_000;
private static final int[] filesPerLevelMoreFolders = { 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };
private static final int[] filesPerLevelMoreFiles = { 5, 100 };
private long maxTransactionTime;
private static HashMap<Integer, Class<?>> errors;
private static String TEST_GROUP_NAME = "FixedACLUpdaterTest";
private static String TEST_GROUP_NAME_FULL = PermissionService.GROUP_PREFIX + TEST_GROUP_NAME;
@@ -134,8 +134,11 @@ public class FixedAclUpdaterTest
AuthenticationUtil.setFullyAuthenticatedUser(AuthenticationUtil.getSystemUserName());
homeFolderNodeRef = repository.getCompanyHome();
maxTransactionTime = MAX_TRANSACTION_TIME_DEFAULT;
setFixedAclMaxTransactionTime(permissionsDaoComponent, homeFolderNodeRef, maxTransactionTime);
setFixedAclMaxTransactionTime(permissionsDaoComponent, homeFolderNodeRef, MAX_TRANSACTION_TIME_DEFAULT);
fixedAclUpdater.setForceSharedACL(false);
fixedAclUpdater.setMaxItems(-1);
fixedAclUpdater.setOrderNodes(true);
}
@After
@@ -155,8 +158,7 @@ public class FixedAclUpdaterTest
try
{
maxTransactionTime = 86400000;
setFixedAclMaxTransactionTime(permissionsDaoComponent, homeFolderNodeRef, maxTransactionTime);
setFixedAclMaxTransactionTime(permissionsDaoComponent, homeFolderNodeRef, LARGE_TRANSACTION_TIME);
setPermissionsOnTree(folderRef, false, false);
aclComparator.compareACLs();
@@ -164,6 +166,7 @@ public class FixedAclUpdaterTest
}
finally
{
setFixedAclMaxTransactionTime(permissionsDaoComponent, homeFolderNodeRef, MAX_TRANSACTION_TIME_DEFAULT);
deleteNodes(folderRef);
}
}
@@ -344,8 +347,7 @@ public class FixedAclUpdaterTest
try
{
maxTransactionTime = 86400000;
setFixedAclMaxTransactionTime(permissionsDaoComponent, homeFolderNodeRef, maxTransactionTime);
setFixedAclMaxTransactionTime(permissionsDaoComponent, homeFolderNodeRef, LARGE_TRANSACTION_TIME);
// Set permissions on target folder
txnHelper.doInTransaction((RetryingTransactionCallback<Void>) () -> {
@@ -386,6 +388,7 @@ public class FixedAclUpdaterTest
}
finally
{
setFixedAclMaxTransactionTime(permissionsDaoComponent, homeFolderNodeRef, MAX_TRANSACTION_TIME_DEFAULT);
deleteNodes(originalRef);
deleteNodes(targetRefBase);
}
@@ -1438,6 +1441,79 @@ public class FixedAclUpdaterTest
}
}
/*
* Test with maxItems limit
*/
@Test
@RetryAtMost(3)
public void testWithLimits()
{
NodeRef folderRef = createFolderHierarchyInRootForFileTests("testWithLimitsFolder");
try
{
int maxItems = 200;
setPermissionsOnTree(folderRef, true, true);
// Get the current amount of pending ACls
int initialPendingAcls = getNodesCountWithPendingFixedAclAspect();
// We need at least maxItems+1 pending ACLs
while (initialPendingAcls <= maxItems && initialPendingAcls > 0)
{
// Trigger the job a single round each time to create new pendings until we have enough
triggerFixedACLJob(false,true,maxItems,1);
initialPendingAcls = getNodesCountWithPendingFixedAclAspect();
}
assertTrue("We don't have enough pending acls to test", initialPendingAcls > 0);
// Increase transaction time to not create new pending ACLs
setFixedAclMaxTransactionTime(permissionsDaoComponent, homeFolderNodeRef, LARGE_TRANSACTION_TIME);
// Trigger job in single round without timeout
triggerFixedACLJob(false,true,maxItems,1);
int finalPendingAcls = getNodesCountWithPendingFixedAclAspect();
assertTrue("Processed ACLs should not have exceeded 200", (initialPendingAcls - finalPendingAcls) <= maxItems);
}
finally
{
setFixedAclMaxTransactionTime(permissionsDaoComponent, homeFolderNodeRef, MAX_TRANSACTION_TIME_DEFAULT);
deleteNodes(folderRef);
}
}
/*
* Test without imposing the order by
*/
@Test
@RetryAtMost(3)
public void testUnordered()
{
NodeRef folderRef = createFolderHierarchyInRootForFileTests("testWithLimitsFolder");
try
{
setPermissionsOnTree(folderRef, true, true);
int initialPendingAcls = getNodesCountWithPendingFixedAclAspect();
assertTrue("We don't have enough pending acls to test", initialPendingAcls > 0);
triggerFixedACLJob(false,true,-1,30);
int finalPendingAcls = getNodesCountWithPendingFixedAclAspect();
assertEquals("Not all ACls were processed",0, finalPendingAcls);
}
finally
{
setFixedAclMaxTransactionTime(permissionsDaoComponent, homeFolderNodeRef, MAX_TRANSACTION_TIME_DEFAULT);
deleteNodes(folderRef);
}
}
private Long getChild(Long parentId)
{
List<FileInfo> children = fileFolderService.list(nodeDAO.getNodePair(parentId).getSecond());
@@ -1601,13 +1677,18 @@ public class FixedAclUpdaterTest
private void triggerFixedACLJob()
{
triggerFixedACLJob(false);
// Trigger job 30 times max to process all nodes
triggerFixedACLJob(false, true, -1, 30);
}
private void triggerFixedACLJob(boolean forceSharedACL)
{
triggerFixedACLJob(forceSharedACL, true, -1, 30);
}
private void triggerFixedACLJob(boolean forceSharedACL, boolean orderNodes, int maxItems, int rounds)
{
LOG.debug("Fixing ACL");
final int rounds = 30;
final int enoughZeros = 3;
int numberOfConsecutiveZeros = 0;
@@ -1615,6 +1696,8 @@ public class FixedAclUpdaterTest
{
int count = txnHelper.doInTransaction(() -> {
fixedAclUpdater.setForceSharedACL(forceSharedACL);
fixedAclUpdater.setMaxItems(maxItems);
fixedAclUpdater.setOrderNodes(orderNodes);
return fixedAclUpdater.execute();
}, false, true);
numberOfConsecutiveZeros = count == 0 ? numberOfConsecutiveZeros + 1 : 0;