Class: Spotlight::Resources::IiifHarvester
- Inherits:
 - 
      Spotlight::Resource
      
        
- Object
 - ActiveRecord::Base
 - Spotlight::Resource
 - Spotlight::Resources::IiifHarvester
 
 
- Defined in:
 - app/models/spotlight/resources/iiif_harvester.rb
 
Overview
harvest Images from IIIF Manifest and turn them into a Spotlight::Resource Note: IIIF API : iiif.io/api/presentation/2.0
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Spotlight::Resource
#document_model, #reindex_later, #save_and_index
Class Method Details
.indexing_pipeline ⇒ Object
      18 19 20 21 22 23 24 25 26  | 
    
      # File 'app/models/spotlight/resources/iiif_harvester.rb', line 18 def self.indexing_pipeline @indexing_pipeline ||= super.dup.tap do |pipeline| pipeline.sources = [Spotlight::Etl::Sources::SourceMethodSource(:iiif_manifests)] pipeline.transforms = [ ->(data, p) { data.merge(p.source.to_solr(exhibit: p.context.resource.exhibit)) } ] + pipeline.transforms end end  | 
  
Instance Method Details
#iiif_manifests ⇒ Object
      14 15 16  | 
    
      # File 'app/models/spotlight/resources/iiif_harvester.rb', line 14 def iiif_manifests @iiif_manifests ||= IiifService.parse(url) end  |