Add comments to discovery.xml config and move constants to plugin class

This commit is contained in:
Antoine Snyers
2020-03-25 14:13:03 +01:00
parent cc471c4f50
commit 224d252f1a
3 changed files with 17 additions and 16 deletions

View File

@@ -100,16 +100,6 @@ import org.springframework.stereotype.Service;
@Service @Service
public class SolrServiceImpl implements SearchService, IndexingService { public class SolrServiceImpl implements SearchService, IndexingService {
/**
* The name of the discover configuration used to search for workflow tasks in the mydspace
*/
public static final String DISCOVER_WORKFLOW_CONFIGURATION_NAME = "workflow";
/**
* The name of the discover configuration used to search for inprogress submission in the mydspace
*/
public static final String DISCOVER_WORKSPACE_CONFIGURATION_NAME = "workspace";
private static final Logger log = org.apache.logging.log4j.LogManager.getLogger(SolrServiceImpl.class); private static final Logger log = org.apache.logging.log4j.LogManager.getLogger(SolrServiceImpl.class);
@Autowired @Autowired

View File

@@ -1,5 +1,8 @@
package org.dspace.discovery; package org.dspace.discovery;
import java.sql.SQLException;
import java.util.Set;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.solr.client.solrj.SolrQuery; import org.apache.solr.client.solrj.SolrQuery;
import org.dspace.authorize.service.AuthorizeService; import org.dspace.authorize.service.AuthorizeService;
@@ -9,18 +12,22 @@ import org.dspace.eperson.Group;
import org.dspace.eperson.service.GroupService; import org.dspace.eperson.service.GroupService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import java.sql.SQLException;
import java.util.Set;
import static org.dspace.discovery.SolrServiceImpl.DISCOVER_WORKFLOW_CONFIGURATION_NAME;
import static org.dspace.discovery.SolrServiceImpl.DISCOVER_WORKSPACE_CONFIGURATION_NAME;
/** /**
* Created by: Antoine Snyers (antoine at atmire dot com) * Created by: Antoine Snyers (antoine at atmire dot com)
* Date: 18 Mar 2020 * Date: 18 Mar 2020
*/ */
public class SolrServiceWorkspaceWorkflowRestrictionPlugin implements SolrServiceSearchPlugin { public class SolrServiceWorkspaceWorkflowRestrictionPlugin implements SolrServiceSearchPlugin {
/**
* The name of the discover configuration used to search for inprogress submission in the mydspace
*/
public static final String DISCOVER_WORKSPACE_CONFIGURATION_NAME = "workspace";
/**
* The name of the discover configuration used to search for workflow tasks in the mydspace
*/
public static final String DISCOVER_WORKFLOW_CONFIGURATION_NAME = "workflow";
/** /**
* The name of the discover configuration used by administrators to search for workflow tasks * The name of the discover configuration used by administrators to search for workflow tasks
*/ */

View File

@@ -53,8 +53,12 @@
<entry key="site" value-ref="homepageConfiguration" /> <entry key="site" value-ref="homepageConfiguration" />
<!--<entry key="123456789/7621" value-ref="defaultConfiguration"/>--> <!--<entry key="123456789/7621" value-ref="defaultConfiguration"/>-->
<!-- Used to show filters and results on MyDSpace --> <!-- Used to show filters and results on MyDSpace -->
<!-- Do not change the key 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="workspace" value-ref="workspaceConfiguration" />
<!-- "workflow" is a special entry to search for your own workflow items -->
<entry key="workflow" value-ref="workflowConfiguration" /> <entry key="workflow" value-ref="workflowConfiguration" />
<!-- "workflowAdmin" is a special entry to search for all workflow items for which you are an administrator -->
<entry key="workflowAdmin" value-ref="workflowConfiguration" /> <entry key="workflowAdmin" value-ref="workflowConfiguration" />
<entry key="undiscoverable" value-ref="unDiscoverableItems" /> <entry key="undiscoverable" value-ref="unDiscoverableItems" />
<entry key="administrativeView" value-ref="administrativeView" /> <entry key="administrativeView" value-ref="administrativeView" />