Module: BlacklightOaiProvider::Controller

Extended by:
ActiveSupport::Concern
Defined in:
app/controllers/concerns/blacklight_oai_provider/controller.rb

Instance Method Summary collapse

Instance Method Details

#oaiObject

Action method of our own! Delivers a partial that’s a display of a single fields range facets. Used when we need a second Solr query to get range facets, after the first found min/max from result set.



16
17
18
19
20
21
22
23
# File 'app/controllers/concerns/blacklight_oai_provider/controller.rb', line 16

def oai
  body = oai_provider
         .process_request(oai_params.to_h)
         .gsub('<?xml version="1.0" encoding="UTF-8"?>') do |m|
           "#{m}\n<?xml-stylesheet type=\"text/xsl\" href=\"#{ActionController::Base.helpers.asset_path('blacklight_oai_provider/oai2.xsl')}\"?>\n"
         end
  render xml: body, content_type: 'text/xml'
end

#oai_configObject

Uses Blacklight.config, needs to be modified when that changes to be controller-based. This is the only method in this plugin that accesses Blacklight.config, single point of contact.



29
30
31
# File 'app/controllers/concerns/blacklight_oai_provider/controller.rb', line 29

def oai_config
  blacklight_config.oai || {}
end

#oai_providerObject



33
34
35
# File 'app/controllers/concerns/blacklight_oai_provider/controller.rb', line 33

def oai_provider
  @oai_provider ||= BlacklightOaiProvider::SolrDocumentProvider.new(self, oai_config)
end