Skip to content

Instantly share code, notes, and snippets.

@mankind
Created August 6, 2019 07:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mankind/5abcc4bbcdb7e2b6aa38363f8e0b55d0 to your computer and use it in GitHub Desktop.
Save mankind/5abcc4bbcdb7e2b6aa38363f8e0b55d0 to your computer and use it in GitHub Desktop.
oai_exporting repository_url
#file location
#app/controllers/ubiquity/oai_extension.rb
module Ubiquity
module OaiExtension
extend ActiveSupport::Concern
def oai_config
blacklight_config.oai.merge(provider: {repository_url: request.original_url}) || {provider: {repository_url: request.original_url}}
end
end
end
#changes config/application.rb
CatalogController.prepend(::Ubiquity::OaiExtension)
#####changes to catalog controller
#we removed repository_url: CurrentScope.user_tenant_cname
config.oai = {
provider: {
repository_name: Settings.oai.name
},
document: {
limit: 25, # number of records returned with each request, default: 15
set_fields: [ # ability to define ListSets, optional, default: nil
{ label: 'collection', solr_field: 'isPartOf_ssim' }
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment