Skip to content

Commit

Permalink
Merged in task/dspace-cris-2023_02_x/DSC-1630 (pull request DSpace#2813)
Browse files Browse the repository at this point in the history
Added searchFilterEntityType to configuration used by the mydspace page

Approved-by: Vincenzo Mecca
  • Loading branch information
atarix83 authored and vins01-4science committed Oct 1, 2024
2 parents 39c9ef1 + 01e3b5c commit ff0a459
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -276,7 +278,8 @@ private DiscoverResultItemIterator searchItemsToExport(int maxResults, boolean o
private DiscoverQuery buildDiscoveryQuery(DiscoveryConfiguration discoveryConfiguration,
IndexableObject<?, ?> scope, boolean onlyPublic) throws SQLException, SearchServiceException {

List<String> dsoTypes = List.of(IndexableItem.TYPE, IndexableWorkspaceItem.TYPE, IndexableWorkflowItem.TYPE);
List<String> dsoTypes = List.of(IndexableItem.TYPE, IndexableWorkspaceItem.TYPE, IndexableWorkflowItem.TYPE,
IndexablePoolTask.TYPE, IndexableClaimedTask.TYPE);

String sortBy = null;
String sortOrder = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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);
}

Expand Down
4 changes: 4 additions & 0 deletions dspace/config/spring/api/discovery.xml
Original file line number Diff line number Diff line change
Expand Up @@ -783,6 +783,7 @@
<ref bean="searchFilterObjectNamedType" />
<ref bean="searchFilterType" />
<ref bean="searchFilterIssued" />
<ref bean="searchFilterEntityType" />
</list>
</property>
<!--The sort filters for the discovery search-->
Expand Down Expand Up @@ -854,6 +855,7 @@
<ref bean="searchFilterObjectNamedType" />
<ref bean="searchFilterType" />
<ref bean="searchFilterIssued" />
<ref bean="searchFilterEntityType" />
</list>
</property>
<!--The sort filters for the discovery search-->
Expand Down Expand Up @@ -929,6 +931,7 @@
<ref bean="searchFilterObjectNamedType" />
<ref bean="searchFilterType" />
<ref bean="searchFilterIssued" />
<ref bean="searchFilterEntityType" />
</list>
</property>
<!--The sort filters for the discovery search-->
Expand Down Expand Up @@ -1007,6 +1010,7 @@
<ref bean="searchFilterType" />
<ref bean="searchFilterIssued" />
<ref bean="searchFilterSubmitter" />
<ref bean="searchFilterEntityType" />
</list>
</property>
<!--The sort filters for the discovery search-->
Expand Down

0 comments on commit ff0a459

Please sign in to comment.