diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3bd7c9f27f..923ff10f8e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,7 +38,7 @@ jobs: !contains(github.event.head_commit.message, '[skip tests]') && !contains(github.event.head_commit.message, '[force') steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: fetch-depth: 0 - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.24.1 @@ -61,7 +61,7 @@ jobs: !contains(github.event.head_commit.message, '[skip tests]') && !contains(github.event.head_commit.message, '[force') steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.24.1 - uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.24.1 - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.24.1 @@ -84,7 +84,7 @@ jobs: !contains(github.event.head_commit.message, '[skip tests]') && !contains(github.event.head_commit.message, '[force') steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.24.1 - uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.24.1 - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.24.1 @@ -173,7 +173,7 @@ jobs: testModule: mmt testAttributes: "-Dtest=AllMmtUnitTestSuite" steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.24.1 - uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.24.1 - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.24.1 @@ -210,7 +210,7 @@ jobs: env: REQUIRES_INSTALLED_ARTIFACTS: true steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.24.1 - uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.24.1 - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.24.1 @@ -245,7 +245,7 @@ jobs: matrix: version: ['10.5', '10.6'] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.24.1 - uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.24.1 - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.24.1 @@ -272,7 +272,7 @@ jobs: !contains(github.event.head_commit.message, '[skip tests]') && !contains(github.event.head_commit.message, '[force') steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.24.1 - uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.24.1 - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.24.1 @@ -299,7 +299,7 @@ jobs: !contains(github.event.head_commit.message, '[skip tests]') && !contains(github.event.head_commit.message, '[force') steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.24.1 - uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.24.1 - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.24.1 @@ -325,7 +325,7 @@ jobs: !contains(github.event.head_commit.message, '[skip tests]') && !contains(github.event.head_commit.message, '[force') steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.24.1 - uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.24.1 - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.24.1 @@ -351,7 +351,7 @@ jobs: !contains(github.event.head_commit.message, '[skip tests]') && !contains(github.event.head_commit.message, '[force') steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.24.1 - uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.24.1 - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.24.1 @@ -377,7 +377,7 @@ jobs: !contains(github.event.head_commit.message, '[skip tests]') && !contains(github.event.head_commit.message, '[force') steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.24.1 - uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.24.1 - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.24.1 @@ -401,7 +401,7 @@ jobs: !contains(github.event.head_commit.message, '[skip tests]') && !contains(github.event.head_commit.message, '[force') steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.24.1 - uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.24.1 - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.24.1 @@ -457,7 +457,7 @@ jobs: disabledHostnameVerification: false mvn-options: '-Dencryption.ssl.keystore.location=${CI_WORKSPACE}/keystores/alfresco/alfresco.keystore -Dencryption.ssl.truststore.location=${CI_WORKSPACE}/keystores/alfresco/alfresco.truststore' steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.24.1 - uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.24.1 - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.24.1 @@ -527,7 +527,7 @@ jobs: env: REQUIRES_LOCAL_IMAGES: true steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.24.1 - uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.24.1 - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.24.1 @@ -566,7 +566,7 @@ jobs: !contains(github.event.head_commit.message, '[skip tests]') && !contains(github.event.head_commit.message, '[force') steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.24.1 - uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.24.1 - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.24.1 @@ -596,7 +596,7 @@ jobs: env: REQUIRES_INSTALLED_ARTIFACTS: true steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.24.1 - uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.24.1 - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.24.1 @@ -628,7 +628,7 @@ jobs: env: REQUIRES_INSTALLED_ARTIFACTS: true steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.24.1 - uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.24.1 - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.24.1 @@ -656,7 +656,7 @@ jobs: env: REQUIRES_LOCAL_IMAGES: true steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.24.1 - uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.24.1 - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.24.1 @@ -702,7 +702,7 @@ jobs: !contains(github.event.head_commit.message, '[skip tests]') && !contains(github.event.head_commit.message, '[force]') steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.24.1 - uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.24.1 - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.24.1 diff --git a/.github/workflows/master_release.yml b/.github/workflows/master_release.yml index 78a599739c..b7c31c6203 100644 --- a/.github/workflows/master_release.yml +++ b/.github/workflows/master_release.yml @@ -31,7 +31,7 @@ jobs: !contains(github.event.head_commit.message, '[no release]') && github.event_name != 'pull_request' steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: persist-credentials: false - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.24.1 @@ -60,7 +60,7 @@ jobs: !contains(github.event.head_commit.message, '[no downstream]') && github.event_name != 'pull_request' steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: persist-credentials: false - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.24.1 diff --git a/.github/workflows/precommit_formatter.yml b/.github/workflows/precommit_formatter.yml index cffb653476..d312435768 100644 --- a/.github/workflows/precommit_formatter.yml +++ b/.github/workflows/precommit_formatter.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest if: contains(github.event.head_commit.message, '[reformat code]') steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Python ${{ inputs.python-version }} uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: diff --git a/amps/ags/pom.xml b/amps/ags/pom.xml index 1ffd18c89d..078e873e9e 100644 --- a/amps/ags/pom.xml +++ b/amps/ags/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo-amps - 25.3.0.22-SNAPSHOT + 25.3.0.33-SNAPSHOT diff --git a/amps/ags/rm-automation/pom.xml b/amps/ags/rm-automation/pom.xml index 43bdf6d81f..add6f5ee01 100644 --- a/amps/ags/rm-automation/pom.xml +++ b/amps/ags/rm-automation/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-governance-services-community-parent - 25.3.0.22-SNAPSHOT + 25.3.0.33-SNAPSHOT diff --git a/amps/ags/rm-automation/rm-automation-community-rest-api/pom.xml b/amps/ags/rm-automation/rm-automation-community-rest-api/pom.xml index e53f11c700..2a28657544 100644 --- a/amps/ags/rm-automation/rm-automation-community-rest-api/pom.xml +++ b/amps/ags/rm-automation/rm-automation-community-rest-api/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-governance-services-automation-community-repo - 25.3.0.22-SNAPSHOT + 25.3.0.33-SNAPSHOT diff --git a/amps/ags/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/util/DockerHelper.java b/amps/ags/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/util/DockerHelper.java index bb31200581..b70d39414a 100644 --- a/amps/ags/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/util/DockerHelper.java +++ b/amps/ags/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/util/DockerHelper.java @@ -43,7 +43,7 @@ import com.github.dockerjava.core.command.LogContainerResultCallback; import com.github.dockerjava.netty.NettyDockerCmdExecFactory; import lombok.Getter; import lombok.Setter; -import org.apache.commons.lang.SystemUtils; +import org.apache.commons.lang3.SystemUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; diff --git a/amps/ags/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/records/AddRelationshipTests.java b/amps/ags/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/records/AddRelationshipTests.java index eec813c6f4..10bdd08c66 100644 --- a/amps/ags/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/records/AddRelationshipTests.java +++ b/amps/ags/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/records/AddRelationshipTests.java @@ -37,7 +37,7 @@ import static org.alfresco.rest.rm.community.util.CommonTestUtils.generateTestPr import java.util.Collections; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.json.JSONObject; import org.springframework.beans.factory.annotation.Autowired; import org.testng.annotations.Test; @@ -56,7 +56,7 @@ import org.alfresco.test.AlfrescoTest; /** * Add Relationship tests - * + * * @author Kavit Shah */ public class AddRelationshipTests extends BaseRMRestTest diff --git a/amps/ags/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/smoke/DispositionScheduleLinkedRecordsTest.java b/amps/ags/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/smoke/DispositionScheduleLinkedRecordsTest.java index cef8676f98..2bf4b5f4a2 100644 --- a/amps/ags/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/smoke/DispositionScheduleLinkedRecordsTest.java +++ b/amps/ags/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/smoke/DispositionScheduleLinkedRecordsTest.java @@ -45,7 +45,7 @@ import java.time.Instant; import java.util.ArrayList; import java.util.List; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.HttpStatus; diff --git a/amps/ags/rm-community/pom.xml b/amps/ags/rm-community/pom.xml index 4b9a92385d..308a48b9ed 100644 --- a/amps/ags/rm-community/pom.xml +++ b/amps/ags/rm-community/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-governance-services-community-parent - 25.3.0.22-SNAPSHOT + 25.3.0.33-SNAPSHOT diff --git a/amps/ags/rm-community/rm-community-repo/pom.xml b/amps/ags/rm-community/rm-community-repo/pom.xml index a5f0303356..0832f96a7f 100644 --- a/amps/ags/rm-community/rm-community-repo/pom.xml +++ b/amps/ags/rm-community/rm-community-repo/pom.xml @@ -8,7 +8,7 @@ org.alfresco alfresco-governance-services-community-repo-parent - 25.3.0.22-SNAPSHOT + 25.3.0.33-SNAPSHOT diff --git a/amps/ags/rm-community/rm-community-rest-api-explorer/pom.xml b/amps/ags/rm-community/rm-community-rest-api-explorer/pom.xml index 4abc684aeb..7782f97472 100644 --- a/amps/ags/rm-community/rm-community-rest-api-explorer/pom.xml +++ b/amps/ags/rm-community/rm-community-rest-api-explorer/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-governance-services-community-repo-parent - 25.3.0.22-SNAPSHOT + 25.3.0.33-SNAPSHOT diff --git a/amps/pom.xml b/amps/pom.xml index 1f282517f0..fa807203ff 100644 --- a/amps/pom.xml +++ b/amps/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo - 25.3.0.22-SNAPSHOT + 25.3.0.33-SNAPSHOT diff --git a/amps/share-services/pom.xml b/amps/share-services/pom.xml index 3e22171afd..683015e9c3 100644 --- a/amps/share-services/pom.xml +++ b/amps/share-services/pom.xml @@ -8,7 +8,7 @@ org.alfresco alfresco-community-repo-amps - 25.3.0.22-SNAPSHOT + 25.3.0.33-SNAPSHOT @@ -51,8 +51,8 @@ - commons-lang - commons-lang + org.apache.commons + commons-lang3 provided diff --git a/amps/share-services/src/main/java/org/alfresco/repo/web/scripts/wiki/WikiPageGet.java b/amps/share-services/src/main/java/org/alfresco/repo/web/scripts/wiki/WikiPageGet.java index 53d6e0bd0c..90b15e198f 100644 --- a/amps/share-services/src/main/java/org/alfresco/repo/web/scripts/wiki/WikiPageGet.java +++ b/amps/share-services/src/main/java/org/alfresco/repo/web/scripts/wiki/WikiPageGet.java @@ -28,7 +28,7 @@ import java.util.ResourceBundle; import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.apache.commons.lang.StringEscapeUtils; +import org.apache.commons.lang3.StringEscapeUtils; import org.json.simple.JSONObject; import org.springframework.extensions.webscripts.Cache; import org.springframework.extensions.webscripts.Status; @@ -92,7 +92,7 @@ public class WikiPageGet extends AbstractWikiWebScript { links.add(link); // build the list of available pages - WikiPageInfo wikiPage = wikiService.getWikiPage(site.getShortName(), StringEscapeUtils.unescapeHtml(link)); + WikiPageInfo wikiPage = wikiService.getWikiPage(site.getShortName(), StringEscapeUtils.unescapeHtml4(link)); if (wikiPage != null) { pageTitles.add(wikiPage.getTitle()); diff --git a/amps/share-services/src/main/resources/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary-v2/doclist.lib.js b/amps/share-services/src/main/resources/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary-v2/doclist.lib.js index e23552cd98..1c74369cc5 100644 --- a/amps/share-services/src/main/resources/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary-v2/doclist.lib.js +++ b/amps/share-services/src/main/resources/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary-v2/doclist.lib.js @@ -91,6 +91,15 @@ function doclist_getAllNodes(parsedArgs, filterParams, query, totalItemCount) }; } +function sanitizeJunkFavouriteKeys(favourites){ + for (var key in favourites) { + if (!key || key.trim() === "") { + delete favourites[key]; + } + } + return favourites; +} + /** * Main entry point: Create collection of documents and folders in the given space * @@ -123,6 +132,28 @@ function doclist_main() if (logger.isLoggingEnabled()) logger.log("doclist.lib.js - NodeRef: " + parsedArgs.nodeRef + " Query: " + query); + + favourites = sanitizeJunkFavouriteKeys(favourites); + + if(Object.keys(favourites).length === 0 && query === null) + { + return { + luceneQuery: "", + paging: { + totalRecords: 0, + startIndex: 0 + }, + container: parsedArgs.rootNode, + parent: null, + onlineEditing: utils.moduleInstalled("org.alfresco.module.vti"), + itemCount: { + folders: 0, + documents: 0 + }, + items: [], + customJSON: slingshotDocLib.getJSON() + }; + } var totalItemCount = filterParams.limitResults ? parseInt(filterParams.limitResults, 10) : -1; // For all sites documentLibrary query we pull in all available results and post filter diff --git a/amps/share-services/src/main/resources/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary-v2/filters.lib.js b/amps/share-services/src/main/resources/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary-v2/filters.lib.js index 0dad0bbc46..9ced3d4452 100644 --- a/amps/share-services/src/main/resources/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary-v2/filters.lib.js +++ b/amps/share-services/src/main/resources/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary-v2/filters.lib.js @@ -182,11 +182,14 @@ var Filters = case "favourites": for (var favourite in favourites) { - if (filterQuery) + if (favourite && favourite.trim() !== "") { - filterQuery += " OR "; + if (filterQuery) + { + filterQuery += " OR "; + } + filterQuery += "ID:\"" + favourite + "\""; } - filterQuery += "ID:\"" + favourite + "\""; } if (filterQuery.length !== 0) @@ -201,7 +204,13 @@ var Filters = else { // empty favourites query - filterQuery = "+ID:\"\""; + logger.warn("No favourites found for user: " + person.properties.userName); + return { + query: null, + limitResults: 0, + sort: [], + language: "lucene" + }; } filterParams.query = filterQuery; diff --git a/amps/share-services/src/test/java/org/alfresco/repo/web/scripts/wiki/WikiRestApiTest.java b/amps/share-services/src/test/java/org/alfresco/repo/web/scripts/wiki/WikiRestApiTest.java index 2aa56e0981..68070730b8 100644 --- a/amps/share-services/src/test/java/org/alfresco/repo/web/scripts/wiki/WikiRestApiTest.java +++ b/amps/share-services/src/test/java/org/alfresco/repo/web/scripts/wiki/WikiRestApiTest.java @@ -25,7 +25,7 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import jakarta.transaction.UserTransaction; -import org.apache.commons.lang.StringEscapeUtils; +import org.apache.commons.lang3.StringEscapeUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.json.JSONArray; @@ -958,7 +958,7 @@ public class WikiRestApiTest extends BaseWebScriptTest String link = m.group(1); link += "?title="; WikiPageInfo wikiPage2 = this.wikiService.getWikiPage(SITE_SHORT_NAME_WIKI, link); - WikiPageInfo wikiPage1 = this.wikiService.getWikiPage(SITE_SHORT_NAME_WIKI, StringEscapeUtils.unescapeHtml(link)); + WikiPageInfo wikiPage1 = this.wikiService.getWikiPage(SITE_SHORT_NAME_WIKI, StringEscapeUtils.unescapeHtml4(link)); assertEquals(wikiPage2, wikiPage1); } diff --git a/core/pom.xml b/core/pom.xml index bc5cd5cc41..daf518a6ce 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo - 25.3.0.22-SNAPSHOT + 25.3.0.33-SNAPSHOT diff --git a/data-model/pom.xml b/data-model/pom.xml index 864fa96f74..cb8a86bde9 100644 --- a/data-model/pom.xml +++ b/data-model/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo - 25.3.0.22-SNAPSHOT + 25.3.0.33-SNAPSHOT diff --git a/mmt/pom.xml b/mmt/pom.xml index d221722884..3a61fb0fba 100644 --- a/mmt/pom.xml +++ b/mmt/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo - 25.3.0.22-SNAPSHOT + 25.3.0.33-SNAPSHOT diff --git a/packaging/distribution/pom.xml b/packaging/distribution/pom.xml index 62d4fe6070..c3d88c3308 100644 --- a/packaging/distribution/pom.xml +++ b/packaging/distribution/pom.xml @@ -9,6 +9,6 @@ org.alfresco alfresco-community-repo-packaging - 25.3.0.22-SNAPSHOT + 25.3.0.33-SNAPSHOT diff --git a/packaging/distribution/src/main/resources/licenses/notice.txt b/packaging/distribution/src/main/resources/licenses/notice.txt index 3fa5e4c0a6..51c565a400 100644 --- a/packaging/distribution/src/main/resources/licenses/notice.txt +++ b/packaging/distribution/src/main/resources/licenses/notice.txt @@ -37,8 +37,7 @@ commons-fileupload http://jakarta.apache.org/commons/ commons-httpclient http://jakarta.apache.org/commons/ commons-io http://jakarta.apache.org/commons/ commons-jxpath http://jakarta.apache.org/commons/ -commons-lang http://jakarta.apache.org/commons/ -commons-lang3 http://jakarta.apache.org/commons/ +commons-lang3 http://jakarta.apache.org/commons/ commons-logging http://jakarta.apache.org/commons/ commons-net http://jakarta.apache.org/commons/ commons-pool http://jakarta.apache.org/commons/ diff --git a/packaging/docker-alfresco/pom.xml b/packaging/docker-alfresco/pom.xml index dcd6ca0712..76488fe741 100644 --- a/packaging/docker-alfresco/pom.xml +++ b/packaging/docker-alfresco/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo-packaging - 25.3.0.22-SNAPSHOT + 25.3.0.33-SNAPSHOT diff --git a/packaging/pom.xml b/packaging/pom.xml index 31b44e6d7d..01ee390a17 100644 --- a/packaging/pom.xml +++ b/packaging/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo - 25.3.0.22-SNAPSHOT + 25.3.0.33-SNAPSHOT diff --git a/packaging/tests/pom.xml b/packaging/tests/pom.xml index 7fd67c79f4..b0f7a119c2 100644 --- a/packaging/tests/pom.xml +++ b/packaging/tests/pom.xml @@ -6,7 +6,7 @@ org.alfresco alfresco-community-repo-packaging - 25.3.0.22-SNAPSHOT + 25.3.0.33-SNAPSHOT diff --git a/packaging/tests/tas-cmis/pom.xml b/packaging/tests/tas-cmis/pom.xml index 3badc29a83..f5716d9b69 100644 --- a/packaging/tests/tas-cmis/pom.xml +++ b/packaging/tests/tas-cmis/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo-tests - 25.3.0.22-SNAPSHOT + 25.3.0.33-SNAPSHOT diff --git a/packaging/tests/tas-cmis/src/test/java/org/alfresco/cmis/SecondaryTypesTests.java b/packaging/tests/tas-cmis/src/test/java/org/alfresco/cmis/SecondaryTypesTests.java index 699675ff80..6efdff2f9e 100644 --- a/packaging/tests/tas-cmis/src/test/java/org/alfresco/cmis/SecondaryTypesTests.java +++ b/packaging/tests/tas-cmis/src/test/java/org/alfresco/cmis/SecondaryTypesTests.java @@ -5,7 +5,7 @@ import java.util.Date; import org.apache.chemistry.opencmis.commons.exceptions.CmisObjectNotFoundException; import org.apache.chemistry.opencmis.commons.exceptions.CmisPermissionDeniedException; import org.apache.chemistry.opencmis.commons.exceptions.CmisUnauthorizedException; -import org.apache.commons.lang.time.DateUtils; +import org.apache.commons.lang3.time.DateUtils; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; diff --git a/packaging/tests/tas-email/pom.xml b/packaging/tests/tas-email/pom.xml index fa2b97eb31..f92f6e9844 100644 --- a/packaging/tests/tas-email/pom.xml +++ b/packaging/tests/tas-email/pom.xml @@ -9,7 +9,7 @@ org.alfresco alfresco-community-repo-tests - 25.3.0.22-SNAPSHOT + 25.3.0.33-SNAPSHOT diff --git a/packaging/tests/tas-integration/pom.xml b/packaging/tests/tas-integration/pom.xml index 4aa1c98a66..c3c13f1264 100644 --- a/packaging/tests/tas-integration/pom.xml +++ b/packaging/tests/tas-integration/pom.xml @@ -9,7 +9,7 @@ org.alfresco alfresco-community-repo-tests - 25.3.0.22-SNAPSHOT + 25.3.0.33-SNAPSHOT diff --git a/packaging/tests/tas-restapi/pom.xml b/packaging/tests/tas-restapi/pom.xml index 6dbdac8636..548a23037a 100644 --- a/packaging/tests/tas-restapi/pom.xml +++ b/packaging/tests/tas-restapi/pom.xml @@ -8,7 +8,7 @@ org.alfresco alfresco-community-repo-tests - 25.3.0.22-SNAPSHOT + 25.3.0.33-SNAPSHOT diff --git a/packaging/tests/tas-webdav/pom.xml b/packaging/tests/tas-webdav/pom.xml index 0d5b666e45..81c209b315 100644 --- a/packaging/tests/tas-webdav/pom.xml +++ b/packaging/tests/tas-webdav/pom.xml @@ -9,7 +9,7 @@ org.alfresco alfresco-community-repo-tests - 25.3.0.22-SNAPSHOT + 25.3.0.33-SNAPSHOT diff --git a/packaging/war/pom.xml b/packaging/war/pom.xml index 5fc15a9246..4d0b58b88d 100644 --- a/packaging/war/pom.xml +++ b/packaging/war/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo-packaging - 25.3.0.22-SNAPSHOT + 25.3.0.33-SNAPSHOT diff --git a/pom.xml b/pom.xml index dce84c1f77..13ef180bf4 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 alfresco-community-repo - 25.3.0.22-SNAPSHOT + 25.3.0.33-SNAPSHOT pom Alfresco Community Repo Parent @@ -51,8 +51,8 @@ 7.0.2 5.23.0 5.23.0 - 5.2.0-A.3 - 4.2.0 + 5.2.1 + 4.2.1 7.1 1.0.9 @@ -422,9 +422,9 @@ 1.18.0 - commons-lang - commons-lang - 2.6 + org.apache.commons + commons-lang3 + 3.18.0 commons-io diff --git a/remote-api/pom.xml b/remote-api/pom.xml index 8d066e3998..96ce980ea4 100644 --- a/remote-api/pom.xml +++ b/remote-api/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo - 25.3.0.22-SNAPSHOT + 25.3.0.33-SNAPSHOT diff --git a/remote-api/src/main/resources/alfresco/templates/webscripts/org/alfresco/repository/forms/pickerresults.lib.ftl b/remote-api/src/main/resources/alfresco/templates/webscripts/org/alfresco/repository/forms/pickerresults.lib.ftl index d8b195dcd6..d8fef4d89f 100644 --- a/remote-api/src/main/resources/alfresco/templates/webscripts/org/alfresco/repository/forms/pickerresults.lib.ftl +++ b/remote-api/src/main/resources/alfresco/templates/webscripts/org/alfresco/repository/forms/pickerresults.lib.ftl @@ -40,6 +40,7 @@ "items": [ <#list results as row> + <#if row.item.hasPermission("Read")> { "type": "${row.item.typeShort}", "parentType": "${row.item.parentTypeShort!""}", @@ -75,6 +76,7 @@ "nodeRef": "${row.item.nodeRef}"<#if row.selectable?exists>, "selectable" : ${row.selectable?string} }<#if row_has_next>, + ] } diff --git a/repository/pom.xml b/repository/pom.xml index c140bed023..3b819e58c4 100644 --- a/repository/pom.xml +++ b/repository/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-community-repo - 25.3.0.22-SNAPSHOT + 25.3.0.33-SNAPSHOT @@ -94,7 +94,6 @@ org.apache.commons commons-lang3 - 3.18.0 commons-codec @@ -737,10 +736,6 @@ reflections test - - commons-lang - commons-lang - diff --git a/repository/src/main/java/org/alfresco/repo/domain/node/ibatis/NodeDAOImpl.java b/repository/src/main/java/org/alfresco/repo/domain/node/ibatis/NodeDAOImpl.java index 35f3b352fc..0d943023cd 100644 --- a/repository/src/main/java/org/alfresco/repo/domain/node/ibatis/NodeDAOImpl.java +++ b/repository/src/main/java/org/alfresco/repo/domain/node/ibatis/NodeDAOImpl.java @@ -116,7 +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 SELECT_NODES_WITH_ASPECT_IDS_LIMITED = "alfresco.node.select.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"; diff --git a/repository/src/main/java/org/alfresco/repo/jscript/RhinoScriptProcessor.java b/repository/src/main/java/org/alfresco/repo/jscript/RhinoScriptProcessor.java index 714e86ae1e..00d29569ff 100644 --- a/repository/src/main/java/org/alfresco/repo/jscript/RhinoScriptProcessor.java +++ b/repository/src/main/java/org/alfresco/repo/jscript/RhinoScriptProcessor.java @@ -2,7 +2,7 @@ * #%L * Alfresco Repository * %% - * Copyright (C) 2005 - 2016 Alfresco Software Limited + * Copyright (C) 2005 - 2025 Alfresco Software Limited * %% * This file is part of the Alfresco software. * If the software was purchased under a paid Alfresco license, the terms of @@ -124,6 +124,9 @@ public class RhinoScriptProcessor extends BaseProcessor implements ScriptProcess /** Number of (bytecode) instructions that will trigger the observer */ private int observerInstructionCount = 100; + /** Flag to enable or disable scope cleaning at the end of each script execution */ + private boolean cleanScope = true; + /** Custom context factory */ public static AlfrescoContextFactory contextFactory; @@ -210,6 +213,15 @@ public class RhinoScriptProcessor extends BaseProcessor implements ScriptProcess this.observerInstructionCount = observerInstructionCount; } + /** + * @param cleanScope + * true to enable scope cleaning at the end of each script execution - set to false to disable this feature. + */ + public void setCleanScope(boolean cleanScope) + { + this.cleanScope = cleanScope; + } + /** * @see org.alfresco.service.cmr.repository.ScriptProcessor#reset() */ @@ -619,7 +631,7 @@ public class RhinoScriptProcessor extends BaseProcessor implements ScriptProcess } finally { - if (!secure) + if (!secure && cleanScope) { unsetScope(model, scope); } diff --git a/repository/src/main/java/org/alfresco/repo/rendition2/RenditionService2Impl.java b/repository/src/main/java/org/alfresco/repo/rendition2/RenditionService2Impl.java index 730b476b03..3eb8b59c07 100644 --- a/repository/src/main/java/org/alfresco/repo/rendition2/RenditionService2Impl.java +++ b/repository/src/main/java/org/alfresco/repo/rendition2/RenditionService2Impl.java @@ -81,11 +81,19 @@ public class RenditionService2Impl implements RenditionService2, InitializingBea public static final QName DEFAULT_RENDITION_CONTENT_PROP = ContentModel.PROP_CONTENT; public static final String DEFAULT_MIMETYPE = MimetypeMap.MIMETYPE_TEXT_PLAIN; + public static final String MIMETYPE_METADATA_EXTRACT = "alfresco-metadata-extract"; + public static final String MIMETYPE_METADATA_EMBED = "alfresco-metadata-embed"; public static final String DEFAULT_ENCODING = "UTF-8"; public static final int SOURCE_HAS_NO_CONTENT = -1; public static final int RENDITION2_DOES_NOT_EXIST = -2; + // Allowed mimetypes to support text or metadata extract transforms when thumbnails are disabled. + private static final Set ALLOWED_MIMETYPES = Set.of( + MimetypeMap.MIMETYPE_TEXT_PLAIN, + MIMETYPE_METADATA_EXTRACT, + MIMETYPE_METADATA_EMBED); + private static Log logger = LogFactory.getLog(RenditionService2Impl.class); // As Async transforms and renditions are so similar, this class provides a way to provide the code that is different. @@ -288,7 +296,7 @@ public class RenditionService2Impl implements RenditionService2, InitializingBea { try { - if (!isEnabled()) + if (!isAsyncAllowed(renderOrTransform)) { throw new RenditionService2Exception("Async transforms and renditions are disabled " + "(system.thumbnail.generate=false or renditionService2.enabled=false)."); @@ -967,4 +975,24 @@ public class RenditionService2Impl implements RenditionService2, InitializingBea } } } + + // Checks if the given transform callback is a text extract transform for content indexing or metadata extract/embed. + private boolean isTextOrMetadataExtractTransform(RenderOrTransformCallBack renderOrTransform) + { + RenditionDefinition2 renditionDefinition = renderOrTransform.getRenditionDefinition(); + return renditionDefinition != null && ALLOWED_MIMETYPES.contains(renditionDefinition.getTargetMimetype()); + } + + private boolean isAsyncAllowed(RenderOrTransformCallBack renderOrTransform) + { + // If enabled is false, all async transforms/renditions must be blocked + if (!enabled) + { + return false; + } + + // If thumbnails are disabled, allow only text extract or metadata extract/embed transforms + return thumbnailsEnabled || isTextOrMetadataExtractTransform(renderOrTransform); + } + } diff --git a/repository/src/main/java/org/alfresco/repo/security/authentication/identityservice/IdentityServiceFacadeFactoryBean.java b/repository/src/main/java/org/alfresco/repo/security/authentication/identityservice/IdentityServiceFacadeFactoryBean.java index bcafe791d4..fe06a8b466 100644 --- a/repository/src/main/java/org/alfresco/repo/security/authentication/identityservice/IdentityServiceFacadeFactoryBean.java +++ b/repository/src/main/java/org/alfresco/repo/security/authentication/identityservice/IdentityServiceFacadeFactoryBean.java @@ -74,7 +74,7 @@ import com.nimbusds.oauth2.sdk.id.Identifier; import com.nimbusds.oauth2.sdk.id.Issuer; import com.nimbusds.openid.connect.sdk.claims.PersonClaims; import com.nimbusds.openid.connect.sdk.op.OIDCProviderMetadata; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hc.client5.http.classic.HttpClient; diff --git a/repository/src/main/java/org/alfresco/repo/security/authentication/identityservice/authentication/AbstractIdentityServiceAuthenticator.java b/repository/src/main/java/org/alfresco/repo/security/authentication/identityservice/authentication/AbstractIdentityServiceAuthenticator.java index 616ae6f34e..09fa49a15e 100644 --- a/repository/src/main/java/org/alfresco/repo/security/authentication/identityservice/authentication/AbstractIdentityServiceAuthenticator.java +++ b/repository/src/main/java/org/alfresco/repo/security/authentication/identityservice/authentication/AbstractIdentityServiceAuthenticator.java @@ -42,7 +42,7 @@ import jakarta.servlet.http.HttpServletResponse; import com.nimbusds.oauth2.sdk.Scope; import com.nimbusds.oauth2.sdk.id.Identifier; import com.nimbusds.oauth2.sdk.id.State; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.security.oauth2.client.registration.ClientRegistration; diff --git a/repository/src/main/resources/alfresco/ibatis/org.alfresco.repo.domain.dialect.Dialect/node-common-SqlMap.xml b/repository/src/main/resources/alfresco/ibatis/org.alfresco.repo.domain.dialect.Dialect/node-common-SqlMap.xml index 9c1a6a0bd8..2b5f825492 100644 --- a/repository/src/main/resources/alfresco/ibatis/org.alfresco.repo.domain.dialect.Dialect/node-common-SqlMap.xml +++ b/repository/src/main/resources/alfresco/ibatis/org.alfresco.repo.domain.dialect.Dialect/node-common-SqlMap.xml @@ -782,25 +782,6 @@ order by node.id ASC - - select @@ -1566,4 +1547,4 @@ - \ No newline at end of file + diff --git a/repository/src/main/resources/alfresco/ibatis/org.alfresco.repo.domain.dialect.Dialect/node-select-SqlMap.xml b/repository/src/main/resources/alfresco/ibatis/org.alfresco.repo.domain.dialect.Dialect/node-select-SqlMap.xml index 52ec37ea9d..69c54aca25 100644 --- a/repository/src/main/resources/alfresco/ibatis/org.alfresco.repo.domain.dialect.Dialect/node-select-SqlMap.xml +++ b/repository/src/main/resources/alfresco/ibatis/org.alfresco.repo.domain.dialect.Dialect/node-select-SqlMap.xml @@ -30,4 +30,23 @@ - \ No newline at end of file + + + diff --git a/repository/src/main/resources/alfresco/ibatis/org.alfresco.repo.domain.dialect.MySQLInnoDBDialect/node-select-SqlMap.xml b/repository/src/main/resources/alfresco/ibatis/org.alfresco.repo.domain.dialect.MySQLInnoDBDialect/node-select-SqlMap.xml index a8c97446b8..5ceca005e4 100644 --- a/repository/src/main/resources/alfresco/ibatis/org.alfresco.repo.domain.dialect.MySQLInnoDBDialect/node-select-SqlMap.xml +++ b/repository/src/main/resources/alfresco/ibatis/org.alfresco.repo.domain.dialect.MySQLInnoDBDialect/node-select-SqlMap.xml @@ -30,4 +30,23 @@ - \ No newline at end of file + + + diff --git a/repository/src/main/resources/alfresco/repository.properties b/repository/src/main/resources/alfresco/repository.properties index f099100c89..1c88e94740 100644 --- a/repository/src/main/resources/alfresco/repository.properties +++ b/repository/src/main/resources/alfresco/repository.properties @@ -1396,6 +1396,9 @@ scripts.execution.maxMemoryUsedInBytes=-1 # Number of instructions that will trigger the observer scripts.execution.observerInstructionCount=5000 +# Flag to control if the scope is cleaned at the end of script execution +scripts.execution.clean.scope=true + # Default value being used in POST/size-details endpoint to partition a huge folder into smaller chunks # so that we can compute more efficiently and consolidate all sizes into a single unit. default.async.folder.items=1000 diff --git a/repository/src/main/resources/alfresco/script-services-context.xml b/repository/src/main/resources/alfresco/script-services-context.xml index cbff40693a..460d8890ff 100644 --- a/repository/src/main/resources/alfresco/script-services-context.xml +++ b/repository/src/main/resources/alfresco/script-services-context.xml @@ -60,6 +60,9 @@ ${scripts.execution.observerInstructionCount} + + ${scripts.execution.clean.scope} +