mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-11-05 15:32:21 +00:00
Compare commits
32 Commits
23.3.0.75
...
dependabot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
41f34381d8 | ||
|
|
10e78191dd | ||
|
|
6290c46d62 | ||
|
|
8a61badabc | ||
|
|
f9946827c4 | ||
|
|
b812c7856e | ||
|
|
a3f6e13a7c | ||
|
|
afffc7e870 | ||
|
|
fe5a01e2bd | ||
|
|
03625565e9 | ||
|
|
8d1d2b4f1b | ||
|
|
1342c6a7bb | ||
|
|
17152b69fc | ||
|
|
1a7027327e | ||
|
|
7921969222 | ||
|
|
9cc93de7b2 | ||
|
|
55c9cf3407 | ||
|
|
120f45ba92 | ||
|
|
eacdbd3770 | ||
|
|
93d4701d80 | ||
|
|
64baf03818 | ||
|
|
e39606aec5 | ||
|
|
7581e07c3c | ||
|
|
a01d375e6f | ||
|
|
a98f44803a | ||
|
|
cabc38b386 | ||
|
|
9ed29967b7 | ||
|
|
b63a3eae9b | ||
|
|
1ce46c2039 | ||
|
|
278aa59302 | ||
|
|
51a51ecd6b | ||
|
|
10f4b10ae8 |
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@@ -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/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/free-hosted-runner-disk-space@v1.35.2
|
||||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@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:
|
with:
|
||||||
classpath-build-command: "mvn test-compile -ntp -Pags -pl \"-:alfresco-community-repo-docker\""
|
classpath-build-command: "mvn test-compile -ntp -Pags -pl \"-:alfresco-community-repo-docker\""
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-community-repo-amps</artifactId>
|
<artifactId>alfresco-community-repo-amps</artifactId>
|
||||||
<version>23.3.0.75</version>
|
<version>23.3.0.85-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-governance-services-community-parent</artifactId>
|
<artifactId>alfresco-governance-services-community-parent</artifactId>
|
||||||
<version>23.3.0.75</version>
|
<version>23.3.0.85-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-governance-services-automation-community-repo</artifactId>
|
<artifactId>alfresco-governance-services-automation-community-repo</artifactId>
|
||||||
<version>23.3.0.75</version>
|
<version>23.3.0.85-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-governance-services-community-parent</artifactId>
|
<artifactId>alfresco-governance-services-community-parent</artifactId>
|
||||||
<version>23.3.0.75</version>
|
<version>23.3.0.85-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
|
|||||||
@@ -125,7 +125,7 @@
|
|||||||
parent="declarativeCapability">
|
parent="declarativeCapability">
|
||||||
<property name="name" value="DeleteRecordFolder"/>
|
<property name="name" value="DeleteRecordFolder"/>
|
||||||
<property name="private" value="true"/>
|
<property name="private" value="true"/>
|
||||||
<property name="permission" value="CreateModifyDestroyFolders"/>
|
<property name="permission" value="DeleteRecords"/>
|
||||||
<property name="kinds">
|
<property name="kinds">
|
||||||
<list>
|
<list>
|
||||||
<value>RECORD_FOLDER</value>
|
<value>RECORD_FOLDER</value>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-governance-services-community-repo-parent</artifactId>
|
<artifactId>alfresco-governance-services-community-repo-parent</artifactId>
|
||||||
<version>23.3.0.75</version>
|
<version>23.3.0.85-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ public class SearchTypesFactory
|
|||||||
boolean includeRecords = false;
|
boolean includeRecords = false;
|
||||||
boolean includeSubTypes = false;
|
boolean includeSubTypes = false;
|
||||||
|
|
||||||
if (q != null)
|
if (q != null && q.getTree() != null)
|
||||||
{
|
{
|
||||||
// filtering via "where" clause
|
// filtering via "where" clause
|
||||||
MapBasedQueryWalker propertyWalker = new MapBasedQueryWalker(listFolderChildrenEqualsQueryProperties, null);
|
MapBasedQueryWalker propertyWalker = new MapBasedQueryWalker(listFolderChildrenEqualsQueryProperties, null);
|
||||||
@@ -101,11 +101,11 @@ public class SearchTypesFactory
|
|||||||
Boolean isUnfiledRecordFolder = propertyWalker.getProperty(UnfiledChild.PARAM_IS_UNFILED_RECORD_FOLDER,
|
Boolean isUnfiledRecordFolder = propertyWalker.getProperty(UnfiledChild.PARAM_IS_UNFILED_RECORD_FOLDER,
|
||||||
WhereClauseParser.EQUALS, Boolean.class);
|
WhereClauseParser.EQUALS, Boolean.class);
|
||||||
Boolean isRecord = propertyWalker.getProperty(UnfiledChild.PARAM_IS_RECORD, 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;
|
includeUnfiledRecordFolders = true;
|
||||||
}
|
}
|
||||||
else if ((isUnfiledRecordFolder != null && !isUnfiledRecordFolder.booleanValue()) || (isRecord != null && isRecord.booleanValue()))
|
else if (checkIncludeRecords(isUnfiledRecordFolder, isRecord))
|
||||||
{
|
{
|
||||||
includeRecords = true;
|
includeRecords = true;
|
||||||
}
|
}
|
||||||
@@ -199,11 +199,11 @@ public class SearchTypesFactory
|
|||||||
WhereClauseParser.EQUALS, Boolean.class);
|
WhereClauseParser.EQUALS, Boolean.class);
|
||||||
Boolean isRecordCategory = propertyWalker.getProperty(RecordCategoryChild.PARAM_IS_RECORD_CATEGORY, 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;
|
includeRecordFolders = true;
|
||||||
}
|
}
|
||||||
else if ((isRecordFolder != null && !isRecordFolder.booleanValue()) || (isRecordCategory != null && isRecordCategory.booleanValue()))
|
else if (checkIncludeRecords(isRecordFolder, isRecordCategory))
|
||||||
{
|
{
|
||||||
includeRecordCategories = true;
|
includeRecordCategories = true;
|
||||||
}
|
}
|
||||||
@@ -291,4 +291,16 @@ public class SearchTypesFactory
|
|||||||
|
|
||||||
return new Pair<>(filterNodeTypeQName, filterIncludeSubTypes);
|
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());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -93,15 +93,15 @@ public class RMv33HoldAuditEntryValuesPatchUnitTest
|
|||||||
verify(mockedRecordsManagementQueryDAO, times(1)).updatePropertyStringValueEntity(deleteHoldPropertyStringValueEntity);
|
verify(mockedRecordsManagementQueryDAO, times(1)).updatePropertyStringValueEntity(deleteHoldPropertyStringValueEntity);
|
||||||
|
|
||||||
assertEquals("Add To Hold", addToHoldPropertyStringValueEntity.getStringValue());
|
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(Long.valueOf(770_786_109L), addToHoldPropertyStringValueEntity.getStringCrc());
|
||||||
|
|
||||||
assertEquals("Remove From Hold", removeFromHoldPropertyStringValueEntity.getStringValue());
|
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(Long.valueOf(2_967_613_012L), removeFromHoldPropertyStringValueEntity.getStringCrc());
|
||||||
|
|
||||||
assertEquals("Delete Hold", deleteHoldPropertyStringValueEntity.getStringValue());
|
assertEquals("Delete Hold", deleteHoldPropertyStringValueEntity.getStringValue());
|
||||||
assertEquals("delete hold", deleteHoldPropertyStringValueEntity.getStringEndLower());
|
assertEquals("delete hold", deleteHoldPropertyStringValueEntity.getStringLower());
|
||||||
assertEquals(Long.valueOf(132_640_810L), deleteHoldPropertyStringValueEntity.getStringCrc());
|
assertEquals(Long.valueOf(132_640_810L), deleteHoldPropertyStringValueEntity.getStringCrc());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-governance-services-community-repo-parent</artifactId>
|
<artifactId>alfresco-governance-services-community-repo-parent</artifactId>
|
||||||
<version>23.3.0.75</version>
|
<version>23.3.0.85-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-community-repo</artifactId>
|
<artifactId>alfresco-community-repo</artifactId>
|
||||||
<version>23.3.0.75</version>
|
<version>23.3.0.85-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-community-repo-amps</artifactId>
|
<artifactId>alfresco-community-repo-amps</artifactId>
|
||||||
<version>23.3.0.75</version>
|
<version>23.3.0.85-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-community-repo</artifactId>
|
<artifactId>alfresco-community-repo</artifactId>
|
||||||
<version>23.3.0.75</version>
|
<version>23.3.0.85-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-community-repo</artifactId>
|
<artifactId>alfresco-community-repo</artifactId>
|
||||||
<version>23.3.0.75</version>
|
<version>23.3.0.85-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-community-repo</artifactId>
|
<artifactId>alfresco-community-repo</artifactId>
|
||||||
<version>23.3.0.75</version>
|
<version>23.3.0.85-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|||||||
@@ -9,6 +9,6 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||||
<version>23.3.0.75</version>
|
<version>23.3.0.85-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||||
<version>23.3.0.75</version>
|
<version>23.3.0.85-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-community-repo</artifactId>
|
<artifactId>alfresco-community-repo</artifactId>
|
||||||
<version>23.3.0.75</version>
|
<version>23.3.0.85-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||||
<version>23.3.0.75</version>
|
<version>23.3.0.85-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||||
<version>23.3.0.75</version>
|
<version>23.3.0.85-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<organization>
|
<organization>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||||
<version>23.3.0.75</version>
|
<version>23.3.0.85-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<developers>
|
<developers>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||||
<version>23.3.0.75</version>
|
<version>23.3.0.85-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<developers>
|
<developers>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||||
<version>23.3.0.75</version>
|
<version>23.3.0.85-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||||
<version>23.3.0.75</version>
|
<version>23.3.0.85-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<developers>
|
<developers>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||||
<version>23.3.0.75</version>
|
<version>23.3.0.85-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
@@ -110,6 +110,11 @@
|
|||||||
<artifactId>mysql-connector-java</artifactId>
|
<artifactId>mysql-connector-java</artifactId>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.owasp.encoder</groupId>
|
||||||
|
<artifactId>encoder</artifactId>
|
||||||
|
<version>1.2.3</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|||||||
@@ -34,6 +34,7 @@
|
|||||||
<%@ page import="org.alfresco.service.cmr.module.ModuleDetails" %>
|
<%@ page import="org.alfresco.service.cmr.module.ModuleDetails" %>
|
||||||
<%@ page import="org.alfresco.service.cmr.module.ModuleInstallState" %>
|
<%@ page import="org.alfresco.service.cmr.module.ModuleInstallState" %>
|
||||||
<%@ page import="java.util.Calendar" %>
|
<%@ page import="java.util.Calendar" %>
|
||||||
|
<%@ page import="org.owasp.encoder.Encode" %>
|
||||||
|
|
||||||
<!-- Enterprise index-jsp placeholder -->
|
<!-- Enterprise index-jsp placeholder -->
|
||||||
<%
|
<%
|
||||||
@@ -88,7 +89,7 @@ ModuleDetails shareServicesModule = moduleService.getModule("alfresco-share-serv
|
|||||||
<p></p>
|
<p></p>
|
||||||
<p><a href="./s/index">Alfresco WebScripts Home</a> (admin only - INTERNAL)</p>
|
<p><a href="./s/index">Alfresco WebScripts Home</a> (admin only - INTERNAL)</p>
|
||||||
<p></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())
|
if (descriptorService.getLicenseDescriptor() == null && transactionService.isReadOnly())
|
||||||
{
|
{
|
||||||
|
|||||||
8
pom.xml
8
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">
|
<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>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<artifactId>alfresco-community-repo</artifactId>
|
<artifactId>alfresco-community-repo</artifactId>
|
||||||
<version>23.3.0.75</version>
|
<version>23.3.0.85-SNAPSHOT</version>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<name>Alfresco Community Repo Parent</name>
|
<name>Alfresco Community Repo Parent</name>
|
||||||
|
|
||||||
@@ -61,7 +61,7 @@
|
|||||||
<dependency.spring-security.version>6.3.1</dependency.spring-security.version>
|
<dependency.spring-security.version>6.3.1</dependency.spring-security.version>
|
||||||
<dependency.antlr.version>3.5.3</dependency.antlr.version>
|
<dependency.antlr.version>3.5.3</dependency.antlr.version>
|
||||||
<dependency.jackson.version>2.15.2</dependency.jackson.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.opencmis.version>1.0.0-jakarta-1</dependency.opencmis.version>
|
||||||
<dependency.webscripts.version>9.0</dependency.webscripts.version>
|
<dependency.webscripts.version>9.0</dependency.webscripts.version>
|
||||||
<dependency.bouncycastle.version>1.78.1</dependency.bouncycastle.version>
|
<dependency.bouncycastle.version>1.78.1</dependency.bouncycastle.version>
|
||||||
@@ -76,7 +76,7 @@
|
|||||||
<dependency.httpcore.version>4.4.16</dependency.httpcore.version>
|
<dependency.httpcore.version>4.4.16</dependency.httpcore.version>
|
||||||
<dependency.httpcomponents-httpclient5.version>5.2.1</dependency.httpcomponents-httpclient5.version>
|
<dependency.httpcomponents-httpclient5.version>5.2.1</dependency.httpcomponents-httpclient5.version>
|
||||||
<dependency.httpcomponents-httpcore5.version>5.2.5</dependency.httpcomponents-httpcore5.version>
|
<dependency.httpcomponents-httpcore5.version>5.2.5</dependency.httpcomponents-httpcore5.version>
|
||||||
<dependency.commons-httpclient.version>3.1-HTTPCLIENT-1265</dependency.commons-httpclient.version>
|
<dependency.commons-httpclient.version>3.1-jbossorg-1</dependency.commons-httpclient.version>
|
||||||
<dependency.xercesImpl.version>2.12.2</dependency.xercesImpl.version>
|
<dependency.xercesImpl.version>2.12.2</dependency.xercesImpl.version>
|
||||||
<dependency.slf4j.version>2.0.13</dependency.slf4j.version>
|
<dependency.slf4j.version>2.0.13</dependency.slf4j.version>
|
||||||
<dependency.log4j.version>2.23.1</dependency.log4j.version>
|
<dependency.log4j.version>2.23.1</dependency.log4j.version>
|
||||||
@@ -151,7 +151,7 @@
|
|||||||
<connection>scm:git:https://github.com/Alfresco/alfresco-community-repo.git</connection>
|
<connection>scm:git:https://github.com/Alfresco/alfresco-community-repo.git</connection>
|
||||||
<developerConnection>scm:git:https://github.com/Alfresco/alfresco-community-repo.git</developerConnection>
|
<developerConnection>scm:git:https://github.com/Alfresco/alfresco-community-repo.git</developerConnection>
|
||||||
<url>https://github.com/Alfresco/alfresco-community-repo</url>
|
<url>https://github.com/Alfresco/alfresco-community-repo</url>
|
||||||
<tag>23.3.0.75</tag>
|
<tag>HEAD</tag>
|
||||||
</scm>
|
</scm>
|
||||||
|
|
||||||
<distributionManagement>
|
<distributionManagement>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-community-repo</artifactId>
|
<artifactId>alfresco-community-repo</artifactId>
|
||||||
<version>23.3.0.75</version>
|
<version>23.3.0.85-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* #%L
|
* #%L
|
||||||
* Alfresco Remote API
|
* 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.
|
* This file is part of the Alfresco software.
|
||||||
* If the software was purchased under a paid Alfresco license, the terms of
|
* 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)
|
public int getAuditEntriesCountByAppAndProperties(AuditService.AuditApplication auditApplication, AuditEntryQueryWalker propertyWalker)
|
||||||
{
|
{
|
||||||
final String applicationName = auditApplication.getKey().substring(1);
|
|
||||||
|
|
||||||
AuditQueryParameters parameters = new AuditQueryParameters();
|
AuditQueryParameters parameters = new AuditQueryParameters();
|
||||||
parameters.setApplicationName(applicationName);
|
parameters.setApplicationName(auditApplication.getName());
|
||||||
parameters.setFromTime(propertyWalker.getFromTime());
|
parameters.setFromTime(propertyWalker.getFromTime());
|
||||||
parameters.setToTime(propertyWalker.getToTime());
|
parameters.setToTime(propertyWalker.getToTime());
|
||||||
parameters.setFromId(propertyWalker.getFromId());
|
parameters.setFromId(propertyWalker.getFromId());
|
||||||
parameters.setToId(propertyWalker.getToId());
|
parameters.setToId(propertyWalker.getToId());
|
||||||
parameters.setUser(propertyWalker.getCreatedByUser());
|
parameters.setUser(propertyWalker.getCreatedByUser());
|
||||||
|
|
||||||
return auditService.getAuditEntriesCountByAppAndProperties(applicationName, parameters);
|
return auditService.getAuditEntriesCountByAppAndProperties(parameters);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ public class PeopleImpl implements People
|
|||||||
protected ResetPasswordService resetPasswordService;
|
protected ResetPasswordService resetPasswordService;
|
||||||
protected UserRegistrySynchronizer userRegistrySynchronizer;
|
protected UserRegistrySynchronizer userRegistrySynchronizer;
|
||||||
protected Renditions renditions;
|
protected Renditions renditions;
|
||||||
|
private Boolean allowImmutableEnabledUpdate;
|
||||||
|
|
||||||
private final static Map<String, QName> sort_params_to_qnames;
|
private final static Map<String, QName> sort_params_to_qnames;
|
||||||
static
|
static
|
||||||
@@ -202,6 +202,11 @@ public class PeopleImpl implements People
|
|||||||
this.userRegistrySynchronizer = userRegistrySynchronizer;
|
this.userRegistrySynchronizer = userRegistrySynchronizer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setAllowImmutableEnabledUpdate(Boolean allowImmutableEnabledUpdate)
|
||||||
|
{
|
||||||
|
this.allowImmutableEnabledUpdate = allowImmutableEnabledUpdate;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validate, perform -me- substitution and canonicalize the person ID.
|
* Validate, perform -me- substitution and canonicalize the person ID.
|
||||||
*
|
*
|
||||||
@@ -708,16 +713,26 @@ public class PeopleImpl implements People
|
|||||||
// if requested, update password
|
// if requested, update password
|
||||||
updatePassword(isAdmin, personIdToUpdate, person);
|
updatePassword(isAdmin, personIdToUpdate, person);
|
||||||
|
|
||||||
if (person.isEnabled() != null)
|
Set<QName> immutableProperties = userRegistrySynchronizer.getPersonMappedProperties(personIdToUpdate);
|
||||||
|
|
||||||
|
Boolean isEnabled = person.isEnabled();
|
||||||
|
if (isEnabled != null)
|
||||||
{
|
{
|
||||||
if (isAdminAuthority(personIdToUpdate))
|
if (isAdminAuthority(personIdToUpdate))
|
||||||
{
|
{
|
||||||
throw new PermissionDeniedException("Admin authority cannot be disabled.");
|
throw new PermissionDeniedException("Admin authority cannot be disabled.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// note: if current user is not an admin then permission denied exception is thrown
|
if (allowImmutableEnabledStatusUpdate(personIdToUpdate, isAdmin, immutableProperties))
|
||||||
MutableAuthenticationService mutableAuthenticationService = (MutableAuthenticationService) authenticationService;
|
{
|
||||||
mutableAuthenticationService.setAuthenticationEnabled(personIdToUpdate, person.isEnabled());
|
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);
|
NodeRef personNodeRef = personService.getPerson(personIdToUpdate, false);
|
||||||
@@ -742,9 +757,7 @@ public class PeopleImpl implements People
|
|||||||
properties.putAll(nodes.mapToNodeProperties(customProps));
|
properties.putAll(nodes.mapToNodeProperties(customProps));
|
||||||
}
|
}
|
||||||
|
|
||||||
// MNT-21150 LDAP synced attributes can be changed using REST API
|
// MNT-21150 LDAP synced attributes can't be changed using REST API
|
||||||
Set<QName> immutableProperties = userRegistrySynchronizer.getPersonMappedProperties(personIdToUpdate);
|
|
||||||
|
|
||||||
immutableProperties.forEach(immutableProperty -> {
|
immutableProperties.forEach(immutableProperty -> {
|
||||||
if (properties.containsKey(immutableProperty))
|
if (properties.containsKey(immutableProperty))
|
||||||
{
|
{
|
||||||
@@ -768,6 +781,28 @@ public class PeopleImpl implements People
|
|||||||
return getPerson(personId);
|
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)
|
private boolean checkCurrentUserOrAdmin(String personId)
|
||||||
{
|
{
|
||||||
boolean isAdmin = isAdminAuthority();
|
boolean isAdmin = isAdminAuthority();
|
||||||
|
|||||||
@@ -764,6 +764,7 @@
|
|||||||
<property name="thumbnailService" ref="ThumbnailService" />
|
<property name="thumbnailService" ref="ThumbnailService" />
|
||||||
<property name="resetPasswordService" ref="resetPasswordService" />
|
<property name="resetPasswordService" ref="resetPasswordService" />
|
||||||
<property name="userRegistrySynchronizer" ref="userRegistrySynchronizer" />
|
<property name="userRegistrySynchronizer" ref="userRegistrySynchronizer" />
|
||||||
|
<property name="allowImmutableEnabledUpdate" value="${allow.immutable.user.enabled.status.update}" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="People" class="org.springframework.aop.framework.ProxyFactoryBean">
|
<bean id="People" class="org.springframework.aop.framework.ProxyFactoryBean">
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-community-repo</artifactId>
|
<artifactId>alfresco-community-repo</artifactId>
|
||||||
<version>23.3.0.75</version>
|
<version>23.3.0.85-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|||||||
@@ -41,6 +41,8 @@ public class IdsEntity
|
|||||||
private Long idFour;
|
private Long idFour;
|
||||||
private List<Long> ids;
|
private List<Long> ids;
|
||||||
private boolean ordered;
|
private boolean ordered;
|
||||||
|
private Integer maxResults;
|
||||||
|
|
||||||
public Long getIdOne()
|
public Long getIdOne()
|
||||||
{
|
{
|
||||||
return idOne;
|
return idOne;
|
||||||
@@ -89,4 +91,12 @@ public class IdsEntity
|
|||||||
{
|
{
|
||||||
this.ordered = ordered;
|
this.ordered = ordered;
|
||||||
}
|
}
|
||||||
|
public int getMaxResults()
|
||||||
|
{
|
||||||
|
return maxResults;
|
||||||
|
}
|
||||||
|
public void setMaxResults(Integer maxResults)
|
||||||
|
{
|
||||||
|
this.maxResults = maxResults;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* #%L
|
* #%L
|
||||||
* Alfresco Repository
|
* Alfresco Repository
|
||||||
* %%
|
* %%
|
||||||
* Copyright (C) 2005 - 2016 Alfresco Software Limited
|
* Copyright (C) 2005 - 2024 Alfresco Software Limited
|
||||||
* %%
|
* %%
|
||||||
* This file is part of the Alfresco software.
|
* This file is part of the Alfresco software.
|
||||||
* If the software was purchased under a paid Alfresco license, the terms of
|
* 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
|
* 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
|
* @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
|
* @return a map containing min/max and the associated value
|
||||||
*/
|
*/
|
||||||
default int getAuditEntriesCountByAppAndProperties(String applicationName, AuditQueryParameters parameters)
|
default int getAuditEntriesCountByAppAndProperties(AuditQueryParameters parameters)
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* #%L
|
* #%L
|
||||||
* Alfresco Repository
|
* Alfresco Repository
|
||||||
* %%
|
* %%
|
||||||
* Copyright (C) 2005 - 2016 Alfresco Software Limited
|
* Copyright (C) 2005 - 2024 Alfresco Software Limited
|
||||||
* %%
|
* %%
|
||||||
* This file is part of the Alfresco software.
|
* This file is part of the Alfresco software.
|
||||||
* If the software was purchased under a paid Alfresco license, the terms of
|
* 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);
|
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(parameters);
|
||||||
|
|
||||||
return auditDAO.getAuditEntriesCountByAppAndProperties(applicationName, parameters);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
* #%L
|
* #%L
|
||||||
* Alfresco Repository
|
* Alfresco Repository
|
||||||
* %%
|
* %%
|
||||||
* Copyright (C) 2005 - 2016 Alfresco Software Limited
|
* Copyright (C) 2005 - 2024 Alfresco Software Limited
|
||||||
* %%
|
* %%
|
||||||
* This file is part of the Alfresco software.
|
* This file is part of the Alfresco software.
|
||||||
* If the software was purchased under a paid Alfresco license, the terms of
|
* If the software was purchased under a paid Alfresco license, the terms of
|
||||||
@@ -190,8 +190,8 @@ public class AuditServiceImpl implements AuditService
|
|||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
@Override public int getAuditEntriesCountByAppAndProperties(String applicationName, AuditQueryParameters parameters)
|
@Override public int getAuditEntriesCountByAppAndProperties(AuditQueryParameters parameters)
|
||||||
{
|
{
|
||||||
return auditComponent.getAuditEntriesCountByAppAndProperties(applicationName, parameters);
|
return auditComponent.getAuditEntriesCountByAppAndProperties(parameters);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,28 +1,28 @@
|
|||||||
/*
|
/*
|
||||||
* #%L
|
* #%L
|
||||||
* Alfresco Repository
|
* Alfresco Repository
|
||||||
* %%
|
* %%
|
||||||
* Copyright (C) 2005 - 2016 Alfresco Software Limited
|
* Copyright (C) 2005 - 2024 Alfresco Software Limited
|
||||||
* %%
|
* %%
|
||||||
* This file is part of the Alfresco software.
|
* This file is part of the Alfresco software.
|
||||||
* If the software was purchased under a paid Alfresco license, the terms of
|
* If the software was purchased under a paid Alfresco license, the terms of
|
||||||
* the paid license agreement will prevail. Otherwise, the software is
|
* the paid license agreement will prevail. Otherwise, the software is
|
||||||
* provided under the following open source license terms:
|
* provided under the following open source license terms:
|
||||||
*
|
*
|
||||||
* Alfresco is free software: you can redistribute it and/or modify
|
* 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
|
* 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
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* Alfresco is distributed in the hope that it will be useful,
|
* Alfresco is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU Lesser General Public License for more details.
|
* GNU Lesser General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Lesser General Public License
|
* You should have received a copy of the GNU Lesser General Public License
|
||||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||||
* #L%
|
* #L%
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.alfresco.repo.domain;
|
package org.alfresco.repo.domain;
|
||||||
|
|
||||||
@@ -102,21 +102,22 @@ public class CrcHelper
|
|||||||
{
|
{
|
||||||
throw new RuntimeException("UTF-8 encoding is not supported");
|
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;
|
String valueShort = null;
|
||||||
int valueLen = valueLowerCase.length();
|
String currentValue = caseSensitive ? value : valueLowerCase;
|
||||||
|
int valueLen = currentValue.length();
|
||||||
if (valueLen < dataLength)
|
if (valueLen < dataLength)
|
||||||
{
|
{
|
||||||
valueShort = valueLowerCase;
|
valueShort = currentValue;
|
||||||
}
|
}
|
||||||
else if (useCharsFromStart)
|
else if (useCharsFromStart)
|
||||||
{
|
{
|
||||||
valueShort = valueLowerCase.substring(0, dataLength - 1);
|
valueShort = currentValue.substring(0, dataLength - 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
valueShort = valueLowerCase.substring(valueLen - dataLength);
|
valueShort = currentValue.substring(valueLen - dataLength);
|
||||||
}
|
}
|
||||||
return new Pair<String, Long>(valueShort, valueCrc);
|
return new Pair<String, Long>(valueShort, valueCrc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
* #%L
|
* #%L
|
||||||
* Alfresco Repository
|
* Alfresco Repository
|
||||||
* %%
|
* %%
|
||||||
* Copyright (C) 2005 - 2016 Alfresco Software Limited
|
* Copyright (C) 2005 - 2024 Alfresco Software Limited
|
||||||
* %%
|
* %%
|
||||||
* This file is part of the Alfresco software.
|
* This file is part of the Alfresco software.
|
||||||
* If the software was purchased under a paid Alfresco license, the terms of
|
* 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
|
* 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
|
* @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
|
* @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;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* #%L
|
* #%L
|
||||||
* Alfresco Repository
|
* Alfresco Repository
|
||||||
* %%
|
* %%
|
||||||
* Copyright (C) 2005 - 2016 Alfresco Software Limited
|
* Copyright (C) 2005 - 2024 Alfresco Software Limited
|
||||||
* %%
|
* %%
|
||||||
* This file is part of the Alfresco software.
|
* This file is part of the Alfresco software.
|
||||||
* If the software was purchased under a paid Alfresco license, the terms of
|
* If the software was purchased under a paid Alfresco license, the terms of
|
||||||
@@ -237,7 +237,7 @@ public class AuditDAOImpl extends AbstractAuditDAOImpl
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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);
|
AuditQueryParameters dbParameters = convertFromRestAuditQueryParameters(parameters);
|
||||||
|
|
||||||
|
|||||||
@@ -2785,6 +2785,23 @@ public abstract class AbstractNodeDAOImpl implements NodeDAO, BatchingDAO
|
|||||||
selectNodesWithAspects(qnameIds, minNodeId, maxNodeId, ordered, resultsCallback);
|
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
|
* @return Returns a writable copy of the cached aspects set
|
||||||
*/
|
*/
|
||||||
@@ -4960,6 +4977,10 @@ public abstract class AbstractNodeDAOImpl implements NodeDAO, BatchingDAO
|
|||||||
List<Long> qnameIds,
|
List<Long> qnameIds,
|
||||||
Long minNodeId, Long maxNodeId, boolean ordered,
|
Long minNodeId, Long maxNodeId, boolean ordered,
|
||||||
NodeRefQueryCallback resultsCallback);
|
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 Long insertNodeAssoc(Long sourceNodeId, Long targetNodeId, Long assocTypeQNameId, int assocIndex);
|
||||||
protected abstract int updateNodeAssoc(Long id, int assocIndex);
|
protected abstract int updateNodeAssoc(Long id, int assocIndex);
|
||||||
protected abstract int deleteNodeAssoc(Long sourceNodeId, Long targetNodeId, Long assocTypeQNameId);
|
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 selectMinTxInNodeIdRange(Long fromNodeId, Long toNodeId);
|
||||||
protected abstract Long selectMaxTxInNodeIdRange(Long fromNodeId, Long toNodeId);
|
protected abstract Long selectMaxTxInNodeIdRange(Long fromNodeId, Long toNodeId);
|
||||||
protected abstract Long selectNextTxCommitTime(Long fromCommitTime);
|
protected abstract Long selectNextTxCommitTime(Long fromCommitTime);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -427,6 +427,22 @@ public interface NodeDAO extends NodeBulkLoader
|
|||||||
Long minNodeId, Long maxNodeId, boolean ordered,
|
Long minNodeId, Long maxNodeId, boolean ordered,
|
||||||
NodeRefQueryCallback resultsCallback);
|
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
|
* Node Assocs
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -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_MAX_ID = "alfresco.node.select_NodeMaxId";
|
||||||
private static final String SELECT_NODE_INTERVAL_BY_TYPE = "alfresco.node.select_MinMaxNodeIdForNodeType";
|
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 = "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 INSERT_NODE_ASSOC = "alfresco.node.insert.insert_NodeAssoc";
|
||||||
private static final String UPDATE_NODE_ASSOC = "alfresco.node.update_NodeAssoc";
|
private static final String UPDATE_NODE_ASSOC = "alfresco.node.update_NodeAssoc";
|
||||||
private static final String DELETE_NODE_ASSOC = "alfresco.node.delete_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);
|
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
|
@Override
|
||||||
protected Long insertNodeAssoc(Long sourceNodeId, Long targetNodeId, Long assocTypeQNameId, int assocIndex)
|
protected Long insertNodeAssoc(Long sourceNodeId, Long targetNodeId, Long assocTypeQNameId, int assocIndex)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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_REQUIRED_KEY = "FIXED_ACL_ASYNC_REQUIRED";
|
||||||
public static final String FIXED_ACL_ASYNC_CALL_KEY = "FIXED_ACL_ASYNC_CALL";
|
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");
|
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. */
|
/** A set of listeners to receive callback events whenever permissions are updated by this class. */
|
||||||
private static Set<FixedAclUpdaterListener> listeners = Sets.newConcurrentHashSet();
|
private static Set<FixedAclUpdaterListener> listeners = Sets.newConcurrentHashSet();
|
||||||
|
|
||||||
@@ -101,6 +104,8 @@ public class FixedAclUpdater extends TransactionListenerAdapter implements Appli
|
|||||||
private int maxItemBatchSize = 100;
|
private int maxItemBatchSize = 100;
|
||||||
private int numThreads = 4;
|
private int numThreads = 4;
|
||||||
private boolean forceSharedACL = false;
|
private boolean forceSharedACL = false;
|
||||||
|
private int maxItems = DEFAULT_MAX_ITEMS;
|
||||||
|
private boolean orderNodes = true;
|
||||||
|
|
||||||
private ClassPolicyDelegate<OnInheritPermissionsDisabled> onInheritPermissionsDisabledDelegate;
|
private ClassPolicyDelegate<OnInheritPermissionsDisabled> onInheritPermissionsDisabledDelegate;
|
||||||
private PolicyComponent policyComponent;
|
private PolicyComponent policyComponent;
|
||||||
@@ -147,12 +152,22 @@ public class FixedAclUpdater extends TransactionListenerAdapter implements Appli
|
|||||||
this.forceSharedACL = forceSharedACL;
|
this.forceSharedACL = forceSharedACL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setOrderNodes(boolean orderNodes)
|
||||||
|
{
|
||||||
|
this.orderNodes = orderNodes;
|
||||||
|
}
|
||||||
|
|
||||||
public void setLockTimeToLive(long lockTimeToLive)
|
public void setLockTimeToLive(long lockTimeToLive)
|
||||||
{
|
{
|
||||||
this.lockTimeToLive = lockTimeToLive;
|
this.lockTimeToLive = lockTimeToLive;
|
||||||
this.lockRefreshTime = lockTimeToLive / 2;
|
this.lockRefreshTime = lockTimeToLive / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setMaxItems(int maxItems)
|
||||||
|
{
|
||||||
|
this.maxItems = maxItems > 0 ? maxItems : DEFAULT_MAX_ITEMS;
|
||||||
|
}
|
||||||
|
|
||||||
public void setPolicyComponent(PolicyComponent policyComponent)
|
public void setPolicyComponent(PolicyComponent policyComponent)
|
||||||
{
|
{
|
||||||
this.policyComponent = policyComponent;
|
this.policyComponent = policyComponent;
|
||||||
@@ -209,7 +224,7 @@ public class FixedAclUpdater extends TransactionListenerAdapter implements Appli
|
|||||||
public List<NodeRef> execute() throws Throwable
|
public List<NodeRef> execute() throws Throwable
|
||||||
{
|
{
|
||||||
getNodesCallback.init();
|
getNodesCallback.init();
|
||||||
nodeDAO.getNodesWithAspects(aspects, getNodesCallback.getMinNodeId(), null, true, getNodesCallback);
|
nodeDAO.getNodesWithAspects(aspects, getNodesCallback.getMinNodeId(), null, orderNodes, maxItemBatchSize, getNodesCallback);
|
||||||
getNodesCallback.done();
|
getNodesCallback.done();
|
||||||
|
|
||||||
return getNodesCallback.getNodes();
|
return getNodesCallback.getNodes();
|
||||||
@@ -220,6 +235,11 @@ public class FixedAclUpdater extends TransactionListenerAdapter implements Appli
|
|||||||
|
|
||||||
int countNodesWithAspects()
|
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();
|
final CountNodesWithAspectCallback countNodesCallback = new CountNodesWithAspectCallback();
|
||||||
int count = transactionService.getRetryingTransactionHelper()
|
int count = transactionService.getRetryingTransactionHelper()
|
||||||
.doInTransaction(new RetryingTransactionCallback<Integer>()
|
.doInTransaction(new RetryingTransactionCallback<Integer>()
|
||||||
@@ -238,6 +258,9 @@ public class FixedAclUpdater extends TransactionListenerAdapter implements Appli
|
|||||||
private class AclWorkProvider implements BatchProcessWorkProvider<NodeRef>
|
private class AclWorkProvider implements BatchProcessWorkProvider<NodeRef>
|
||||||
{
|
{
|
||||||
private GetNodesWithAspects getNodesWithAspects;
|
private GetNodesWithAspects getNodesWithAspects;
|
||||||
|
private long estimatedUpdatedItems;
|
||||||
|
private long execTime;
|
||||||
|
private long execBatches;
|
||||||
|
|
||||||
AclWorkProvider()
|
AclWorkProvider()
|
||||||
{
|
{
|
||||||
@@ -259,8 +282,37 @@ public class FixedAclUpdater extends TransactionListenerAdapter implements Appli
|
|||||||
@Override
|
@Override
|
||||||
public Collection<NodeRef> getNextWork()
|
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>
|
protected class AclWorker implements BatchProcessor.BatchProcessWorker<NodeRef>
|
||||||
@@ -451,6 +503,7 @@ public class FixedAclUpdater extends TransactionListenerAdapter implements Appli
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
log.info("Running FixedAclUpdater. Max Items: " + maxItems + ", Impose order: " + orderNodes);
|
||||||
lockToken = jobLockService.getLock(LOCK_Q_NAME, lockTimeToLive, 0, 1);
|
lockToken = jobLockService.getLock(LOCK_Q_NAME, lockTimeToLive, 0, 1);
|
||||||
jobLockService.refreshLock(lockToken, LOCK_Q_NAME, lockRefreshTime, jobLockRefreshCallback);
|
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,
|
transactionService.getRetryingTransactionHelper(), provider, numThreads, maxItemBatchSize, applicationContext,
|
||||||
log, 100);
|
log, 100);
|
||||||
int count = bp.process(worker, true);
|
int count = bp.process(worker, true);
|
||||||
|
log.info("FixedAclUpdater updated " + count + ". Average query time " + provider.getAverageQueryExecutionTime() + " ms");
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
catch (LockAcquisitionException e)
|
catch (LockAcquisitionException e)
|
||||||
|
|||||||
@@ -1,28 +1,28 @@
|
|||||||
/*
|
/*
|
||||||
* #%L
|
* #%L
|
||||||
* Alfresco Repository
|
* Alfresco Repository
|
||||||
* %%
|
* %%
|
||||||
* Copyright (C) 2005 - 2016 Alfresco Software Limited
|
* Copyright (C) 2005 - 2024 Alfresco Software Limited
|
||||||
* %%
|
* %%
|
||||||
* This file is part of the Alfresco software.
|
* This file is part of the Alfresco software.
|
||||||
* If the software was purchased under a paid Alfresco license, the terms of
|
* If the software was purchased under a paid Alfresco license, the terms of
|
||||||
* the paid license agreement will prevail. Otherwise, the software is
|
* the paid license agreement will prevail. Otherwise, the software is
|
||||||
* provided under the following open source license terms:
|
* provided under the following open source license terms:
|
||||||
*
|
*
|
||||||
* Alfresco is free software: you can redistribute it and/or modify
|
* 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
|
* 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
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* Alfresco is distributed in the hope that it will be useful,
|
* Alfresco is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU Lesser General Public License for more details.
|
* GNU Lesser General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Lesser General Public License
|
* You should have received a copy of the GNU Lesser General Public License
|
||||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||||
* #L%
|
* #L%
|
||||||
*/
|
*/
|
||||||
package org.alfresco.repo.domain.propval;
|
package org.alfresco.repo.domain.propval;
|
||||||
|
|
||||||
import org.alfresco.repo.domain.CrcHelper;
|
import org.alfresco.repo.domain.CrcHelper;
|
||||||
@@ -44,6 +44,7 @@ public class PropertyStringValueEntity
|
|||||||
private String stringValue;
|
private String stringValue;
|
||||||
private String stringEndLower;
|
private String stringEndLower;
|
||||||
private Long stringCrc;
|
private Long stringCrc;
|
||||||
|
private String stringLower;
|
||||||
|
|
||||||
public PropertyStringValueEntity()
|
public PropertyStringValueEntity()
|
||||||
{
|
{
|
||||||
@@ -115,6 +116,9 @@ public class PropertyStringValueEntity
|
|||||||
Pair<String, Long> crcPair = CrcHelper.getStringCrcPair(value, 16, false, true);
|
Pair<String, Long> crcPair = CrcHelper.getStringCrcPair(value, 16, false, true);
|
||||||
stringEndLower = crcPair.getFirst();
|
stringEndLower = crcPair.getFirst();
|
||||||
stringCrc = crcPair.getSecond();
|
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()
|
public Long getId()
|
||||||
@@ -156,4 +160,14 @@ public class PropertyStringValueEntity
|
|||||||
{
|
{
|
||||||
this.stringCrc = stringCrc;
|
this.stringCrc = stringCrc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getStringLower()
|
||||||
|
{
|
||||||
|
return stringLower;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStringLower(String stringLower)
|
||||||
|
{
|
||||||
|
this.stringLower = stringLower;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,11 @@ import net.sf.acegisecurity.UserDetails;
|
|||||||
import net.sf.acegisecurity.providers.UsernamePasswordAuthenticationToken;
|
import net.sf.acegisecurity.providers.UsernamePasswordAuthenticationToken;
|
||||||
import net.sf.acegisecurity.providers.dao.User;
|
import net.sf.acegisecurity.providers.dao.User;
|
||||||
|
|
||||||
|
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
|
||||||
import org.alfresco.repo.tenant.TenantService;
|
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.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
|
||||||
@@ -49,12 +53,30 @@ public class AuthenticationContextImpl implements AuthenticationContext
|
|||||||
private final Log logger = LogFactory.getLog(getClass());
|
private final Log logger = LogFactory.getLog(getClass());
|
||||||
|
|
||||||
private TenantService tenantService;
|
private TenantService tenantService;
|
||||||
|
private PersonService personService;
|
||||||
|
private AuthenticationService authenticationService;
|
||||||
|
private Boolean allowImmutableEnabledUpdate;
|
||||||
|
|
||||||
public void setTenantService(TenantService tenantService)
|
public void setTenantService(TenantService tenantService)
|
||||||
{
|
{
|
||||||
this.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.
|
* 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
|
// Apply the same validation that ACEGI would have to the user details - we may be going through a 'back
|
||||||
// door'.
|
// door'.
|
||||||
if (!ud.isEnabled())
|
if (isDisabled(userId, ud))
|
||||||
{
|
{
|
||||||
throw new DisabledException("User is disabled");
|
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()
|
public Authentication setSystemUserAsCurrentUser()
|
||||||
{
|
{
|
||||||
return setSystemUserAsCurrentUser(TenantService.DEFAULT_DOMAIN);
|
return setSystemUserAsCurrentUser(TenantService.DEFAULT_DOMAIN);
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* #%L
|
* #%L
|
||||||
* Alfresco Repository
|
* Alfresco Repository
|
||||||
* %%
|
* %%
|
||||||
* Copyright (C) 2005 - 2016 Alfresco Software Limited
|
* Copyright (C) 2005 - 2024 Alfresco Software Limited
|
||||||
* %%
|
* %%
|
||||||
* This file is part of the Alfresco software.
|
* This file is part of the Alfresco software.
|
||||||
* If the software was purchased under a paid Alfresco license, the terms of
|
* 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
|
* 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
|
* @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
|
* @return a map containing min/max and the associated value
|
||||||
*/
|
*/
|
||||||
default int getAuditEntriesCountByAppAndProperties(String applicationName, AuditQueryParameters parameters)
|
default int getAuditEntriesCountByAppAndProperties(AuditQueryParameters parameters)
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -274,6 +274,15 @@
|
|||||||
<property name="tenantService">
|
<property name="tenantService">
|
||||||
<ref bean="tenantService" />
|
<ref bean="tenantService" />
|
||||||
</property>
|
</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>
|
</bean>
|
||||||
|
|
||||||
<!-- Simple Authentication component that rejects all authentication requests -->
|
<!-- Simple Authentication component that rejects all authentication requests -->
|
||||||
|
|||||||
@@ -782,6 +782,25 @@
|
|||||||
<if test="ordered == true">order by node.id ASC</if>
|
<if test="ordered == true">order by node.id ASC</if>
|
||||||
</select>
|
</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 -->
|
<!-- Common results for result_NodeAssoc -->
|
||||||
<sql id="select_NodeAssoc_Results">
|
<sql id="select_NodeAssoc_Results">
|
||||||
select
|
select
|
||||||
|
|||||||
@@ -121,6 +121,8 @@
|
|||||||
<property name="maxItemBatchSize" value="${system.fixedACLsUpdater.maxItemBatchSize}"/>
|
<property name="maxItemBatchSize" value="${system.fixedACLsUpdater.maxItemBatchSize}"/>
|
||||||
<property name="numThreads" value="${system.fixedACLsUpdater.numThreads}"/>
|
<property name="numThreads" value="${system.fixedACLsUpdater.numThreads}"/>
|
||||||
<property name="forceSharedACL" value="${system.fixedACLsUpdater.forceSharedACL}"/>
|
<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="lockTimeToLive" value="${system.fixedACLsUpdater.lockTTL}"/>
|
||||||
<property name="policyComponent" ref="policyComponent"/>
|
<property name="policyComponent" ref="policyComponent"/>
|
||||||
<property name="policyIgnoreUtil" ref="policyIgnoreUtil"/>
|
<property name="policyIgnoreUtil" ref="policyIgnoreUtil"/>
|
||||||
|
|||||||
@@ -435,6 +435,9 @@ repo.remote.endpoint=/service
|
|||||||
# persisted.
|
# persisted.
|
||||||
create.missing.people=${server.transaction.allow-writes}
|
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)
|
# Create home folders (unless disabled, see next property) as people are created (true) or create them lazily (false)
|
||||||
home.folder.creation.eager=true
|
home.folder.creation.eager=true
|
||||||
# Disable home folder creation - if true then home folders are not created (neither eagerly nor lazily)
|
# 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
|
# fixedACLsUpdater - Force shared ACL to propagate through children even if there is an unexpected ACL
|
||||||
system.fixedACLsUpdater.forceSharedACL=false
|
system.fixedACLsUpdater.forceSharedACL=false
|
||||||
# fixedACLsUpdater cron expression - fire at midnight every day
|
# 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
|
cmis.disable.hidden.leading.period.files=false
|
||||||
|
|
||||||
|
|||||||
@@ -104,9 +104,9 @@ public class FixedAclUpdaterTest
|
|||||||
private ContentService contentService;
|
private ContentService contentService;
|
||||||
private AuthorityService authorityService;
|
private AuthorityService authorityService;
|
||||||
private static final long MAX_TRANSACTION_TIME_DEFAULT = 10;
|
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[] filesPerLevelMoreFolders = { 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };
|
||||||
private static final int[] filesPerLevelMoreFiles = { 5, 100 };
|
private static final int[] filesPerLevelMoreFiles = { 5, 100 };
|
||||||
private long maxTransactionTime;
|
|
||||||
private static HashMap<Integer, Class<?>> errors;
|
private static HashMap<Integer, Class<?>> errors;
|
||||||
private static String TEST_GROUP_NAME = "FixedACLUpdaterTest";
|
private static String TEST_GROUP_NAME = "FixedACLUpdaterTest";
|
||||||
private static String TEST_GROUP_NAME_FULL = PermissionService.GROUP_PREFIX + TEST_GROUP_NAME;
|
private static String TEST_GROUP_NAME_FULL = PermissionService.GROUP_PREFIX + TEST_GROUP_NAME;
|
||||||
@@ -134,8 +134,11 @@ public class FixedAclUpdaterTest
|
|||||||
AuthenticationUtil.setFullyAuthenticatedUser(AuthenticationUtil.getSystemUserName());
|
AuthenticationUtil.setFullyAuthenticatedUser(AuthenticationUtil.getSystemUserName());
|
||||||
|
|
||||||
homeFolderNodeRef = repository.getCompanyHome();
|
homeFolderNodeRef = repository.getCompanyHome();
|
||||||
maxTransactionTime = MAX_TRANSACTION_TIME_DEFAULT;
|
setFixedAclMaxTransactionTime(permissionsDaoComponent, homeFolderNodeRef, MAX_TRANSACTION_TIME_DEFAULT);
|
||||||
setFixedAclMaxTransactionTime(permissionsDaoComponent, homeFolderNodeRef, maxTransactionTime);
|
|
||||||
|
fixedAclUpdater.setForceSharedACL(false);
|
||||||
|
fixedAclUpdater.setMaxItems(-1);
|
||||||
|
fixedAclUpdater.setOrderNodes(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@After
|
@After
|
||||||
@@ -155,8 +158,7 @@ public class FixedAclUpdaterTest
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
maxTransactionTime = 86400000;
|
setFixedAclMaxTransactionTime(permissionsDaoComponent, homeFolderNodeRef, LARGE_TRANSACTION_TIME);
|
||||||
setFixedAclMaxTransactionTime(permissionsDaoComponent, homeFolderNodeRef, maxTransactionTime);
|
|
||||||
setPermissionsOnTree(folderRef, false, false);
|
setPermissionsOnTree(folderRef, false, false);
|
||||||
aclComparator.compareACLs();
|
aclComparator.compareACLs();
|
||||||
|
|
||||||
@@ -164,6 +166,7 @@ public class FixedAclUpdaterTest
|
|||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
setFixedAclMaxTransactionTime(permissionsDaoComponent, homeFolderNodeRef, MAX_TRANSACTION_TIME_DEFAULT);
|
||||||
deleteNodes(folderRef);
|
deleteNodes(folderRef);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -344,8 +347,7 @@ public class FixedAclUpdaterTest
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
maxTransactionTime = 86400000;
|
setFixedAclMaxTransactionTime(permissionsDaoComponent, homeFolderNodeRef, LARGE_TRANSACTION_TIME);
|
||||||
setFixedAclMaxTransactionTime(permissionsDaoComponent, homeFolderNodeRef, maxTransactionTime);
|
|
||||||
|
|
||||||
// Set permissions on target folder
|
// Set permissions on target folder
|
||||||
txnHelper.doInTransaction((RetryingTransactionCallback<Void>) () -> {
|
txnHelper.doInTransaction((RetryingTransactionCallback<Void>) () -> {
|
||||||
@@ -386,6 +388,7 @@ public class FixedAclUpdaterTest
|
|||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
setFixedAclMaxTransactionTime(permissionsDaoComponent, homeFolderNodeRef, MAX_TRANSACTION_TIME_DEFAULT);
|
||||||
deleteNodes(originalRef);
|
deleteNodes(originalRef);
|
||||||
deleteNodes(targetRefBase);
|
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)
|
private Long getChild(Long parentId)
|
||||||
{
|
{
|
||||||
List<FileInfo> children = fileFolderService.list(nodeDAO.getNodePair(parentId).getSecond());
|
List<FileInfo> children = fileFolderService.list(nodeDAO.getNodePair(parentId).getSecond());
|
||||||
@@ -1601,13 +1677,18 @@ public class FixedAclUpdaterTest
|
|||||||
|
|
||||||
private void triggerFixedACLJob()
|
private void triggerFixedACLJob()
|
||||||
{
|
{
|
||||||
triggerFixedACLJob(false);
|
// Trigger job 30 times max to process all nodes
|
||||||
|
triggerFixedACLJob(false, true, -1, 30);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void triggerFixedACLJob(boolean forceSharedACL)
|
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");
|
LOG.debug("Fixing ACL");
|
||||||
final int rounds = 30;
|
|
||||||
final int enoughZeros = 3;
|
final int enoughZeros = 3;
|
||||||
|
|
||||||
int numberOfConsecutiveZeros = 0;
|
int numberOfConsecutiveZeros = 0;
|
||||||
@@ -1615,6 +1696,8 @@ public class FixedAclUpdaterTest
|
|||||||
{
|
{
|
||||||
int count = txnHelper.doInTransaction(() -> {
|
int count = txnHelper.doInTransaction(() -> {
|
||||||
fixedAclUpdater.setForceSharedACL(forceSharedACL);
|
fixedAclUpdater.setForceSharedACL(forceSharedACL);
|
||||||
|
fixedAclUpdater.setMaxItems(maxItems);
|
||||||
|
fixedAclUpdater.setOrderNodes(orderNodes);
|
||||||
return fixedAclUpdater.execute();
|
return fixedAclUpdater.execute();
|
||||||
}, false, true);
|
}, false, true);
|
||||||
numberOfConsecutiveZeros = count == 0 ? numberOfConsecutiveZeros + 1 : 0;
|
numberOfConsecutiveZeros = count == 0 ? numberOfConsecutiveZeros + 1 : 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user