From 940f473ba66d3048b24b74241539ee2f85efc068 Mon Sep 17 00:00:00 2001 From: "aliaksei.bykau" Date: Fri, 8 Mar 2024 16:45:04 +0100 Subject: [PATCH 1/3] [DSC-1630]Port of [CST-13936] added new addDSpaceObjectFilter to BulkItemExport and added new types to DiscoverResultItemIterator --- .../integration/crosswalks/script/BulkItemExport.java | 4 +++- .../dspace/discovery/DiscoverResultItemIterator.java | 10 ++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/dspace-api/src/main/java/org/dspace/content/integration/crosswalks/script/BulkItemExport.java b/dspace-api/src/main/java/org/dspace/content/integration/crosswalks/script/BulkItemExport.java index ef2d711a29d4..6c0f4532d039 100644 --- a/dspace-api/src/main/java/org/dspace/content/integration/crosswalks/script/BulkItemExport.java +++ b/dspace-api/src/main/java/org/dspace/content/integration/crosswalks/script/BulkItemExport.java @@ -43,9 +43,11 @@ import org.dspace.discovery.configuration.DiscoveryConfiguration; import org.dspace.discovery.configuration.DiscoveryConfigurationService; import org.dspace.discovery.configuration.DiscoveryRelatedItemConfiguration; +import org.dspace.discovery.indexobject.IndexableClaimedTask; import org.dspace.discovery.indexobject.IndexableCollection; import org.dspace.discovery.indexobject.IndexableCommunity; import org.dspace.discovery.indexobject.IndexableItem; +import org.dspace.discovery.indexobject.IndexablePoolTask; import org.dspace.discovery.indexobject.IndexableWorkflowItem; import org.dspace.discovery.indexobject.IndexableWorkspaceItem; import org.dspace.discovery.utils.DiscoverQueryBuilder; @@ -276,7 +278,7 @@ private DiscoverResultItemIterator searchItemsToExport(int maxResults, boolean o private DiscoverQuery buildDiscoveryQuery(DiscoveryConfiguration discoveryConfiguration, IndexableObject scope, boolean onlyPublic) throws SQLException, SearchServiceException { - List dsoTypes = List.of(IndexableItem.TYPE, IndexableWorkspaceItem.TYPE, IndexableWorkflowItem.TYPE); + List dsoTypes = List.of(IndexableItem.TYPE, IndexableWorkspaceItem.TYPE, IndexableWorkflowItem.TYPE, IndexablePoolTask.TYPE, IndexableClaimedTask.TYPE); String sortBy = null; String sortOrder = null; diff --git a/dspace-api/src/main/java/org/dspace/discovery/DiscoverResultItemIterator.java b/dspace-api/src/main/java/org/dspace/discovery/DiscoverResultItemIterator.java index 9c8e6088653d..ac06602107cf 100644 --- a/dspace-api/src/main/java/org/dspace/discovery/DiscoverResultItemIterator.java +++ b/dspace-api/src/main/java/org/dspace/discovery/DiscoverResultItemIterator.java @@ -11,7 +11,9 @@ import org.dspace.content.Item; import org.dspace.core.Context; +import org.dspace.discovery.indexobject.IndexableClaimedTask; import org.dspace.discovery.indexobject.IndexableItem; +import org.dspace.discovery.indexobject.IndexablePoolTask; import org.dspace.discovery.indexobject.IndexableWorkflowItem; import org.dspace.discovery.indexobject.IndexableWorkspaceItem; @@ -61,6 +63,14 @@ public Item next() { return ((IndexableWorkspaceItem) nextIndexableObject).getIndexedObject().getItem(); } + if (IndexablePoolTask.TYPE.equals(objectType)) { + return ((IndexablePoolTask) nextIndexableObject).getIndexedObject().getWorkflowItem().getItem(); + } + + if (IndexableClaimedTask.TYPE.equals(objectType)) { + return ((IndexableClaimedTask) nextIndexableObject).getIndexedObject().getWorkflowItem().getItem(); + } + throw new IllegalStateException("Invalid object type for discover item iterator:" + objectType); } From 71a17477defb7f40c4a6efaad08c2c16bf6d9112 Mon Sep 17 00:00:00 2001 From: Giuseppe Digilio Date: Mon, 30 Sep 2024 17:33:47 +0200 Subject: [PATCH 2/3] [DSC-1630] Added searchFilterEntityType to configuration used by the mydspace page --- dspace/config/spring/api/discovery.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dspace/config/spring/api/discovery.xml b/dspace/config/spring/api/discovery.xml index 080edb2e4ad7..fa865b7aa3de 100644 --- a/dspace/config/spring/api/discovery.xml +++ b/dspace/config/spring/api/discovery.xml @@ -783,6 +783,7 @@ + @@ -854,6 +855,7 @@ + @@ -929,6 +931,7 @@ + @@ -1007,6 +1010,7 @@ + From 478aac1573e0beaf72809b7fd6f6822b1c015ee5 Mon Sep 17 00:00:00 2001 From: Giuseppe Digilio Date: Mon, 30 Sep 2024 18:48:28 +0200 Subject: [PATCH 3/3] [DSC-1630] Fix checkstyle issue --- .../content/integration/crosswalks/script/BulkItemExport.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dspace-api/src/main/java/org/dspace/content/integration/crosswalks/script/BulkItemExport.java b/dspace-api/src/main/java/org/dspace/content/integration/crosswalks/script/BulkItemExport.java index 6c0f4532d039..5b685d36e4f5 100644 --- a/dspace-api/src/main/java/org/dspace/content/integration/crosswalks/script/BulkItemExport.java +++ b/dspace-api/src/main/java/org/dspace/content/integration/crosswalks/script/BulkItemExport.java @@ -278,7 +278,8 @@ private DiscoverResultItemIterator searchItemsToExport(int maxResults, boolean o private DiscoverQuery buildDiscoveryQuery(DiscoveryConfiguration discoveryConfiguration, IndexableObject scope, boolean onlyPublic) throws SQLException, SearchServiceException { - List dsoTypes = List.of(IndexableItem.TYPE, IndexableWorkspaceItem.TYPE, IndexableWorkflowItem.TYPE, IndexablePoolTask.TYPE, IndexableClaimedTask.TYPE); + List dsoTypes = List.of(IndexableItem.TYPE, IndexableWorkspaceItem.TYPE, IndexableWorkflowItem.TYPE, + IndexablePoolTask.TYPE, IndexableClaimedTask.TYPE); String sortBy = null; String sortOrder = null;