Class PublicationLoader

java.lang.Object
org.dspace.app.suggestion.SolrSuggestionProvider
org.dspace.app.suggestion.loader.PublicationLoader
All Implemented Interfaces:
SuggestionProvider
Direct Known Subclasses:
OpenAlexPublicationLoader

public class PublicationLoader extends SolrSuggestionProvider
Class responsible to load and manage ImportRecords from external sources
Author:
Pasquale Cavallo (pasquale.cavallo at 4science dot it)
  • Field Details

  • Constructor Details

    • PublicationLoader

      public PublicationLoader()
  • Method Details

    • setPrimaryProvider

      public void setPrimaryProvider(ExternalDataProvider primaryProvider)
    • setOtherProviders

      public void setOtherProviders(List<ExternalDataProvider> otherProviders)
    • setPipeline

      public void setPipeline(List<EvidenceScorer> pipeline)
      Set the pipeline of Approver
      Parameters:
      pipeline - list Approver
    • reduceAndTransform

      public List<Suggestion> reduceAndTransform(Item researcher, List<ExternalDataObject> importRecords)
      This method filter a list of ImportRecords using a pipeline of AuthorNamesApprover and return a filtered list of ImportRecords.
      Parameters:
      researcher - the researcher Item
      importRecords - List of import record
      Returns:
      a list of filtered import records
      See Also:
    • importRecords

      public void importRecords(Context context, Item researcher) throws Exception
      Save a List of ImportRecord into Solr. ImportRecord will be translate into a SolrDocument by the method translateImportRecordToSolrDocument.
      Specified by:
      importRecords in class SolrSuggestionProvider
      Parameters:
      context - the DSpace Context
      researcher - a DSpace Item
      Throws:
      org.apache.solr.client.solrj.SolrServerException
      IOException
      SolrServerException
      IOException
      Exception
    • getNames

      public List<String> getNames()
    • setNames

      public void setNames(List<String> names)
    • searchMetadataValues

      public List<String> searchMetadataValues(Item researcher)
      Return list of Item metadata values starting from metadata keys defined in class level variable names.
      Parameters:
      researcher - DSpace item
      Returns:
      list of metadata values
    • isExternalDataObjectPotentiallySuggested

      protected boolean isExternalDataObjectPotentiallySuggested(Context context, ExternalDataObject externalDataObject)
      Description copied from class: SolrSuggestionProvider
      check if the externalDataObject may have suggestion
      Specified by:
      isExternalDataObjectPotentiallySuggested in class SolrSuggestionProvider
      Returns:
      true if the externalDataObject could be suggested by this provider (i.e. it comes from a DataProvider used by this suggestor)