From 30ec17fae08347c17fbc9efef14b5783ae7b2804 Mon Sep 17 00:00:00 2001 From: rodicasutu Date: Thu, 22 Apr 2021 10:29:23 +0300 Subject: [PATCH 1/3] Remove the limit from UI as it will limit the number of results returned from back-end(solr) Add a global property for setting the record search result limit from backend --- .../alfresco-global.properties | 3 +++ .../rm-service-context.xml | 10 +++++++++ .../RecordsManagementSearchParameters.java | 2 +- .../RecordsManagementSearchServiceImpl.java | 22 +++++++++++++++---- 4 files changed, 32 insertions(+), 5 deletions(-) diff --git a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/alfresco-global.properties b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/alfresco-global.properties index 8bdd9b15e6..25ce15941f 100644 --- a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/alfresco-global.properties +++ b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/alfresco-global.properties @@ -127,3 +127,6 @@ rm.enableAutoVersionOnRecordCreation=false # Metadata Extraction # content.metadata.async.extract.6.enabled=false + +# Max number of entries returned in Record search view +rm.recordSearch.maxItems=500 diff --git a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/rm-service-context.xml b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/rm-service-context.xml index 3d46d6a87a..3546ee64eb 100644 --- a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/rm-service-context.xml +++ b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/rm-service-context.xml @@ -14,6 +14,15 @@ http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"> + + + + + ${rm.recordSearch.maxItems} + + + @@ -346,6 +355,7 @@ + diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/search/RecordsManagementSearchParameters.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/search/RecordsManagementSearchParameters.java index 511c6afeaa..3dd5aaffbb 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/search/RecordsManagementSearchParameters.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/search/RecordsManagementSearchParameters.java @@ -87,7 +87,7 @@ public class RecordsManagementSearchParameters private static final List DEFAULT_INCLUDED_CONTAINER_TYPES = Collections.emptyList(); /** Max items */ - private int maxItems = 500; + private int maxItems ; private boolean includeRecords = true; private boolean includeUndeclaredRecords = false; diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/search/RecordsManagementSearchServiceImpl.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/search/RecordsManagementSearchServiceImpl.java index c7c94bb96b..80343f07c5 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/search/RecordsManagementSearchServiceImpl.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/search/RecordsManagementSearchServiceImpl.java @@ -93,6 +93,11 @@ public class RecordsManagementSearchServiceImpl implements RecordsManagementSear /** List of report details */ private List reports = new ArrayList<>(13); + /** + * Records Search Parameters + */ + private RecordsManagementSearchParameters recordsManagementSearchParameters; + /** * @param fileFolderService file folder service */ @@ -176,14 +181,13 @@ public class RecordsManagementSearchServiceImpl implements RecordsManagementSear } } - RecordsManagementSearchParameters searchParameters = new RecordsManagementSearchParameters(); if (report.has("searchparams")) { - searchParameters = RecordsManagementSearchParameters.createFromJSON(report.getJSONObject("searchparams"), namespaceService); + recordsManagementSearchParameters = RecordsManagementSearchParameters.createFromJSON(report.getJSONObject("searchparams"), namespaceService); } // Create the report details and add to list - ReportDetails reportDetails = new ReportDetails(name, description, query, searchParameters); + ReportDetails reportDetails = new ReportDetails(name, description, query, recordsManagementSearchParameters); reports.add(reportDetails); } } @@ -193,6 +197,16 @@ public class RecordsManagementSearchServiceImpl implements RecordsManagementSear } } + /** + * Set RecordsManagementSearchParameters service + * + * @param recordsManagementSearchParameters + */ + public void setRecordsManagementSearchParameters(RecordsManagementSearchParameters recordsManagementSearchParameters) + { + this.recordsManagementSearchParameters = recordsManagementSearchParameters; + } + /** * @see org.alfresco.module.org_alfresco_module_rm.search.RecordsManagementSearchService#search(java.lang.String, java.lang.String, org.alfresco.module.org_alfresco_module_rm.search.RecordsManagementSearchParameters) */ @@ -213,7 +227,7 @@ public class RecordsManagementSearchServiceImpl implements RecordsManagementSear searchParameters.setQuery(fullQuery.toString()); searchParameters.setLanguage(SearchService.LANGUAGE_FTS_ALFRESCO); searchParameters.addStore(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE); - searchParameters.setMaxItems(rmSearchParameters.getMaxItems()); + searchParameters.setMaxItems(recordsManagementSearchParameters.getMaxItems()); searchParameters.setNamespace(RecordsManagementModel.RM_URI); // set sort From aec655457b86c211ef7683ae2210362b8b4c64d3 Mon Sep 17 00:00:00 2001 From: rodicasutu Date: Thu, 22 Apr 2021 14:22:01 +0300 Subject: [PATCH 2/3] clean up the commented code APPS-908 [skip tests] --- .../module/org_alfresco_module_rm/rm-service-context.xml | 2 +- .../search/RecordsManagementSearchParameters.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/rm-service-context.xml b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/rm-service-context.xml index 3546ee64eb..5f8c0710aa 100644 --- a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/rm-service-context.xml +++ b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/rm-service-context.xml @@ -21,7 +21,7 @@ ${rm.recordSearch.maxItems} - + diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/search/RecordsManagementSearchParameters.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/search/RecordsManagementSearchParameters.java index 3dd5aaffbb..38600df7d9 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/search/RecordsManagementSearchParameters.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/search/RecordsManagementSearchParameters.java @@ -87,7 +87,7 @@ public class RecordsManagementSearchParameters private static final List DEFAULT_INCLUDED_CONTAINER_TYPES = Collections.emptyList(); /** Max items */ - private int maxItems ; + private int maxItems; private boolean includeRecords = true; private boolean includeUndeclaredRecords = false; From 8ee99468253090d9b263986b7e006cc590ceb337 Mon Sep 17 00:00:00 2001 From: rodicasutu Date: Tue, 27 Apr 2021 10:56:57 +0300 Subject: [PATCH 3/3] typo from review comment for APPS-908 [skip tests] --- .../module/org_alfresco_module_rm/rm-service-context.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/rm-service-context.xml b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/rm-service-context.xml index 5f8c0710aa..2b23c08a65 100644 --- a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/rm-service-context.xml +++ b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/rm-service-context.xml @@ -16,7 +16,7 @@ - ${rm.recordSearch.maxItems} @@ -355,7 +355,7 @@ - +