Skip to content

Commit

Permalink
Merge branch 'DSC-1459_new' of https://bitbucket.org/4Science/dspace-…
Browse files Browse the repository at this point in the history
…cris into DSC-1459_new
  • Loading branch information
abollini committed Mar 14, 2024
2 parents 9e30df5 + a27b339 commit 1071ccc
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/
package org.dspace.app.rest.converter;

import java.util.Objects;
import javax.servlet.http.HttpServletRequest;

import org.apache.logging.log4j.Logger;
Expand Down Expand Up @@ -138,7 +139,9 @@ protected void fillFromModel(EditItem obj, EditItemRest rest, Projection project
}
rest.setCollection(collection != null ? converter.toRest(collection, projection) : null);
rest.setItem(converter.toRest(item, projection));
rest.setSubmitter(converter.toRest(submitter, projection));
if (Objects.nonNull(submitter)) {
rest.setSubmitter(converter.toRest(submitter, projection));
}
}

private void addValidationErrorsToItem(EditItem obj, EditItemRest rest) {
Expand Down
82 changes: 79 additions & 3 deletions dspace/config/spring/api/discovery.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@
<value>dc.contributor.editor</value>
</util:list>

<!-- Additional indexing plugin enables searching by supervised (true,false) -->
<bean id="solrServiceSupervisionOrderIndexingPlugin" class="org.dspace.discovery.SolrServiceSupervisionOrderIndexingPlugin"/>

<alias name="solrServiceResourceIndexPlugin" alias="org.dspace.discovery.SolrServiceResourceRestrictionPlugin"/>

<!-- Additional indexing plugin make filtering by has content in original bundle (like pdf's, images) posible via SOLR -->
Expand All @@ -72,6 +69,9 @@
<!-- Additional indexing plugin enables searching by filenames and by file descriptions for files in ORIGINAL bundle -->
<bean id="solrServiceFileInfoPlugin" class="org.dspace.discovery.SolrServiceFileInfoPlugin"/>

<!-- Additional indexing plugin enables searching by supervised (true,false) -->
<bean id="solrServiceSupervisionOrderIndexingPlugin" class="org.dspace.discovery.SolrServiceSupervisionOrderIndexingPlugin"/>

<!--Bean that is used for mapping communities/collections to certain discovery configurations.-->
<bean id="org.dspace.discovery.configuration.DiscoveryConfigurationService" class="org.dspace.discovery.configuration.DiscoveryConfigurationService">
<property name="map">
Expand All @@ -91,6 +91,7 @@
<!-- Do not change the id of special entries or else they won't work -->
<!-- "workspace" is a special entry to search for your own workspace items -->
<entry key="workspace" value-ref="workspaceConfiguration" />
<entry key="supervisedWorkspace" value-ref="supervisedWorkspaceConfiguration" />
<entry key="otherworkspace" value-ref="otherWorkspaceConfiguration" />
<!-- "workflow" is a special entry to search for your own workflow tasks -->
<entry key="workflow" value-ref="workflowConfiguration" />
Expand Down Expand Up @@ -785,6 +786,81 @@
<property name="spellCheckEnabled" value="true"/>
</bean>

<!--The supervised workspace configuration settings for discovery -->
<bean id="supervisedWorkspaceConfiguration"
class="org.dspace.discovery.configuration.DiscoveryConfiguration"
scope="prototype">
<property name="id" value="supervisedWorkspace" />
<!--Which sidebar facets are to be displayed -->
<property name="sidebarFacets">
<list>
<ref bean="searchFilterObjectNamedType" />
<ref bean="searchFilterType" />
<ref bean="searchFilterIssued" />
</list>
</property>
<!--The search filters which can be used on the discovery search page -->
<property name="searchFilters">
<list>
<ref bean="searchFilterObjectNamedType" />
<ref bean="searchFilterType" />
<ref bean="searchFilterIssued" />
</list>
</property>
<!--The sort filters for the discovery search-->
<property name="searchSortConfiguration">
<bean class="org.dspace.discovery.configuration.DiscoverySortConfiguration">
<!--The default sort filter to use for the initial workspace loading-->
<property name="defaultSortField" ref="sortLastModified" />
<property name="sortFields">
<list>
<ref bean="sortLastModified" />
<ref bean="sortTitleAsc" />
<ref bean="sortDateIssuedDesc" />
</list>
</property>
</bean>
</property>
<!--Any default filter queries, these filter queries will be used for all
queries done by discovery for this configuration -->
<property name="defaultFilterQueries">
<list>
<!--Only find items, workspace and accepted for workflow -->
<value>search.resourcetype:WorkspaceItem AND supervised:true</value>
</list>
</property>
<!--Default result per page -->
<property name="defaultRpp" value="10" />
<property name="hitHighlightingConfiguration">
<bean class="org.dspace.discovery.configuration.DiscoveryHitHighlightingConfiguration">
<property name="metadataFields">
<list>
<bean class="org.dspace.discovery.configuration.DiscoveryHitHighlightFieldConfiguration">
<property name="field" value="dc.title"/>
<property name="snippets" value="5"/>
</bean>
<bean class="org.dspace.discovery.configuration.DiscoveryHitHighlightFieldConfiguration">
<property name="field" value="dc.contributor.author"/>
<property name="snippets" value="5"/>
</bean>
<bean class="org.dspace.discovery.configuration.DiscoveryHitHighlightFieldConfiguration">
<property name="field" value="dc.description.abstract"/>
<property name="maxSize" value="250"/>
<property name="snippets" value="2"/>
</bean>
<bean class="org.dspace.discovery.configuration.DiscoveryHitHighlightFieldConfiguration">
<property name="field" value="fulltext"/>
<property name="maxSize" value="250"/>
<property name="snippets" value="2"/>
</bean>
</list>
</property>
</bean>
</property>
<!-- When true a "did you mean" example will be displayed, value can be true or false -->
<property name="spellCheckEnabled" value="true"/>
</bean>

<!--The other workspace configuration settings for discovery -->
<bean id="otherWorkspaceConfiguration"
class="org.dspace.discovery.configuration.DiscoveryConfiguration"
Expand Down

0 comments on commit 1071ccc

Please sign in to comment.