Class SHERPAv2PublisherDataProvider
java.lang.Object
org.dspace.external.provider.AbstractExternalDataProvider
org.dspace.external.provider.impl.SHERPAv2PublisherDataProvider
- All Implemented Interfaces:
ExternalDataProvider
This class is the implementation of the ExternalDataProvider interface that will deal with SHERPAPublisher External
data lookups.
This provider is a refactored version of SherpaPublisherDataPublisher, rewritten to work with SHERPA v2 API
It uses a more simple response object than the normal publication / policy search
- Author:
- Kim Shepherd
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet a single publisher based on a "id equals string" queryintgetNumberOfResults(String query) Get number of results returned from a SHERPA v2 publication searchThis method will return the SourceIdentifier for the ExternalDataProvider that implements the interfacevoidinit()Initialise the client that we need to call the endpointsearchExternalDataObjects(String query, int start, int limit) Search SHERPA v2 API for publisher results based on a 'contains word' query for publisher namevoidsetSherpaService(SHERPAService sherpaService) Generic setter for the SHERPA ServicevoidsetSourceIdentifier(String sourceIdentifier) Generic setter for the sourceIdentifierbooleanThis method will return a boolean indicating whether this ExternalDataProvider can deal with the given source or notMethods inherited from class org.dspace.external.provider.AbstractExternalDataProvider
getSupportedEntityTypes, setSupportedEntityTypes, supportsEntityType
-
Constructor Details
-
SHERPAv2PublisherDataProvider
public SHERPAv2PublisherDataProvider()
-
-
Method Details
-
getSourceIdentifier
Description copied from interface:ExternalDataProviderThis method will return the SourceIdentifier for the ExternalDataProvider that implements the interface- Returns:
- The source identifier as a String
-
init
Initialise the client that we need to call the endpoint- Throws:
IOException- If something goes wrong
-
getExternalDataObject
Get a single publisher based on a "id equals string" query- Parameters:
id- The publisher ID which will be used as query string- Returns:
- external data object representing publisher
-
searchExternalDataObjects
Search SHERPA v2 API for publisher results based on a 'contains word' query for publisher name- Parameters:
query- The query for the searchstart- The start of the searchlimit- The max amount of records to be returned by the search- Returns:
- a list of external data objects
-
supports
Description copied from interface:ExternalDataProviderThis method will return a boolean indicating whether this ExternalDataProvider can deal with the given source or not- Parameters:
source- The source on which the check needs to be done- Returns:
- A boolean indicating whether this ExternalDataProvider can deal with this source or not
-
getNumberOfResults
Get number of results returned from a SHERPA v2 publication search- Parameters:
query- The query to be search on and give the total amount of results- Returns:
- int representing number of publisher results
-
setSourceIdentifier
Generic setter for the sourceIdentifier- Parameters:
sourceIdentifier- The sourceIdentifier to be set on this SHERPAv2PublisherDataProvider
-
setSherpaService
Generic setter for the SHERPA Service- Parameters:
sherpaService- THe SHERPA service to be set on this SHERPAv2PublisherDataProvider
-