Class LCNameDataProvider
- java.lang.Object
-
- org.dspace.external.provider.impl.LCNameDataProvider
-
- All Implemented Interfaces:
ExternalDataProvider
public class LCNameDataProvider extends Object implements ExternalDataProvider
Sample personal name authority based on Library of Congress Name Authority Also serves as an example of an SRU client as authority. This is tuned for the data in the LC Name Authority test instance, see http://alcme.oclc.org/srw/search/lcnaf WARNING: This is just a proof-of-concept implementation. It would need WARNING: lots of refinement to be used in production, because it is very WARNING: sloppy about digging through the MARC/XML results. No doubt WARNING: it is losing a lot of valid results and information. WARNING: Could also do a better job including more info (title, life dates WARNING: etc) in the label instead of just the name. Reads these DSpace Config properties: lcname.url = http://alcme.oclc.org/srw/search/lcnaf- Version:
- $Revision $
- Author:
- Larry Stone
-
-
Constructor Summary
Constructors Constructor Description LCNameDataProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<ExternalDataObject>getExternalDataObject(String id)This method will take a String id as a parameter and it'll call the ExternalDataProvider's endpoint or data source to retrieve and build the ExternalDataObjectintgetNumberOfResults(String query)Returns the total amount of results that this source can return for the given queryStringgetSourceIdentifier()This method will return the SourceIdentifier for the ExternalDataProvider that implements the interfaceStringgetUrl()Generic getter for the urlList<ExternalDataObject>searchExternalDataObjects(String text, int start, int limit)This method will query the ExternalDataProvider's endpoint or data source to retrieve and build a list of ExternalDataObjects through a search with the given parametersvoidsetSourceIdentifier(String sourceIdentifier)Generic setter for the sourceIdentifiervoidsetUrl(String url)Generic setter for the urlbooleansupports(String source)This method will return a boolean indicating whether this ExternalDataProvider can deal with the given source or not
-
-
-
Field Detail
-
NS_SRU
protected static final String NS_SRU
- See Also:
- Constant Field Values
-
NS_MX
protected static final String NS_MX
- See Also:
- Constant Field Values
-
-
Method Detail
-
getSourceIdentifier
public String getSourceIdentifier()
Description copied from interface:ExternalDataProviderThis method will return the SourceIdentifier for the ExternalDataProvider that implements the interface- Specified by:
getSourceIdentifierin interfaceExternalDataProvider- Returns:
- The source identifier as a String
-
getExternalDataObject
public Optional<ExternalDataObject> getExternalDataObject(String id)
Description copied from interface:ExternalDataProviderThis method will take a String id as a parameter and it'll call the ExternalDataProvider's endpoint or data source to retrieve and build the ExternalDataObject- Specified by:
getExternalDataObjectin interfaceExternalDataProvider- Parameters:
id- The id on which will be searched- Returns:
- An Optional object of ExternalDataObject. This is to indicate that this object may be null. This ExternalDataObject will return all the data returned by the ExternalDataProvider
-
getUrl
public String getUrl()
Generic getter for the url- Returns:
- the url value of this LCNameDataProvider
-
setUrl
public void setUrl(String url)
Generic setter for the url- Parameters:
url- The url to be set on this LCNameDataProvider
-
setSourceIdentifier
public void setSourceIdentifier(String sourceIdentifier)
Generic setter for the sourceIdentifier- Parameters:
sourceIdentifier- The sourceIdentifier to be set on this LCNameDataProvider
-
searchExternalDataObjects
public List<ExternalDataObject> searchExternalDataObjects(String text, int start, int limit)
Description copied from interface:ExternalDataProviderThis method will query the ExternalDataProvider's endpoint or data source to retrieve and build a list of ExternalDataObjects through a search with the given parameters- Specified by:
searchExternalDataObjectsin interfaceExternalDataProvider- Parameters:
text- 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 ExternalDataObjects that were retrieved and built by this search
-
supports
public boolean supports(String source)
Description copied from interface:ExternalDataProviderThis method will return a boolean indicating whether this ExternalDataProvider can deal with the given source or not- Specified by:
supportsin interfaceExternalDataProvider- 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
public int getNumberOfResults(String query)
Description copied from interface:ExternalDataProviderReturns the total amount of results that this source can return for the given query- Specified by:
getNumberOfResultsin interfaceExternalDataProvider- Parameters:
query- The query to be search on and give the total amount of results- Returns:
- The total amount of results that the source can return for the given query
-
-