Package org.dspace.app.sherpa.submit
Class SHERPASubmitService
- java.lang.Object
-
- org.dspace.app.sherpa.submit.SHERPASubmitService
-
public class SHERPASubmitService extends Object
SHERPASubmitService is- Author:
- Kim Shepherd
-
-
Field Summary
Fields Modifier and Type Field Description protected SHERPASubmitConfigurationServiceconfigurationprotected SHERPAServicesherpaServiceSpring beans for configuration and API service
-
Constructor Summary
Constructors Constructor Description SHERPASubmitService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<String>getISSNs(Context context, Item item)Using the configured itemIssnExtractors from SHERPA configuration, extract ISSNs from item metadata or authority valuesbooleanhasISSNs(Context context, Item item)Simple boolean test that runs the getISSNs extraction method to determine whether an item has any ISSNs at allSHERPAResponsesearchRelatedJournals(Context context, Item item)Search SHERPA for journal policies matching the ISSNs in the item.SHERPAResponsesearchRelatedJournalsByISSN(String issn)Search SHERPA for journal policies matching the passed ISSN.voidsetConfiguration(SHERPASubmitConfigurationService configuration)Setter for configuration (from Spring)voidsetSherpaService(SHERPAService sherpaService)Setter for SHERPA service, reponsible for actual HTTP API calls
-
-
-
Field Detail
-
sherpaService
protected SHERPAService sherpaService
Spring beans for configuration and API service
-
configuration
protected SHERPASubmitConfigurationService configuration
-
-
Method Detail
-
setConfiguration
public void setConfiguration(SHERPASubmitConfigurationService configuration)
Setter for configuration (from Spring)- Parameters:
configuration-- See Also:
- "dspace-dspace-addon-sherpa-configuration-services.xml"
-
setSherpaService
public void setSherpaService(SHERPAService sherpaService)
Setter for SHERPA service, reponsible for actual HTTP API calls- Parameters:
sherpaService-- See Also:
- "dspace-dspace-addon-sherpa-configuration-services.xml"
-
searchRelatedJournals
public SHERPAResponse searchRelatedJournals(Context context, Item item)
Search SHERPA for journal policies matching the ISSNs in the item. Rather than a 'search' query for any/all ISSNs, the v2 API requires a separate query for each ISSN found in the item. The ISSNs are extracted using the configured issnItemExtractor(s) in the SHERPA spring configuration. The ISSNs are not validated with a regular expression or other rules - any values extracted will be included in API queries. Return the first not empty response from Sherpa- Parameters:
context- DSpace contextitem- DSpace item containing ISSNs to be checked- Returns:
- SHERPA v2 API response (policy data)
- See Also:
- "dspace-dspace-addon-sherpa-configuration-services.xml"
-
searchRelatedJournalsByISSN
public SHERPAResponse searchRelatedJournalsByISSN(String issn)
Search SHERPA for journal policies matching the passed ISSN. The ISSN are not validated with a regular expression or other rules - any String passed to this method will be considered an ISSN for the purposes of an API query- Parameters:
issn- ISSN string- Returns:
- SHERPA v2 API response object (policy data)
-
getISSNs
public Set<String> getISSNs(Context context, Item item)
Using the configured itemIssnExtractors from SHERPA configuration, extract ISSNs from item metadata or authority values- Parameters:
context- DSpace contextitem- Item containing metadata / authority values- Returns:
- Set of ISSN strings
-
-