Giter Site home page Giter Site logo

blacklight_oai_provider's Introduction

BlacklightOaiProvider: OAI-PMH service endpoint for Blacklight applications

Description

The BlacklightOaiProvider plugin provides an Open Archives Initiative Protocolo for Metadata Harvesting (OAI-PMH) <www.openarchives.org/pmh/> data provider endpoint, using the ruby-oai gem, that let serice providers harvest that metadata.

Requirements

A Rails app using Blacklight 3.x.

OAI-PMH requires a timestamp field for all records, so your Solr index should include an appropriate field. By default, the name of this field is simply ‘timestamp’.

Installation

Add

gem "blacklight_oai_provider"

to your Gemfile and run “bundle install”.

Then run “rails generate blacklight_oai_provider” to install the appropriate extensions into your CatalogController and SolrDocument classes. In you want to do customize the way this installs, instead you may:

  • add this to your Solr Document model:

    use_extension(BlacklightOaiProvider::SolrDocumentExtension)
    
  • add this to your Controller:

    include BlacklightOaiProvider::ControllerExtension
    

Configuration

While the plugin provides some sensible (albeit generic) defaults out of the box, you probably will want to customize the OAI provider configuration. You can provide OAI-PMH provider parameters by placing the following in your blacklight configuration (in ./config/initializers/blacklight_config.rb), e.g.:

config = {

  :provider => {
    :repository_name => 'Test',
    :repository_url => 'http://localhost',
    :record_prefix => '',
    :admin_email => 'root@localhost'
  },
  :document => {
    :timestamp => 'timestamp',
    :limit => 25
  }
}

The “provider” configuration is documented as part of the ruby-oai gem at oai.rubyforge.org/

Injection

This plugin assumes it is in a Blacklight Rails app, uses Blacklight methods, Rails methods, and standard ruby module includes to inject it’s behaviors into the app.

You can turn off this injection if you like, although it will make the plugin less (or non-) functional unless you manually do similar injection. See lib/blacklight_oai_provider.rb#inject! to see exactly what’s going on.

In any initializer, you can set:

BlacklightOaiProvider.omit_inject = true

to turn off all injection. The plugin will be completely non-functional if you do this, of course. But perhaps you could try to re-use some of it’s classes in a non-Blacklight, highly hacked Blacklight, or even non-Rails application this way.

You can also turn off injection of individual components, which could be more useful:

BlacklightOaiProvider.omit_inject = {
  :routes => false,
}

Tests

There are none. This is bad I know, sorry. You can test OAI-PMH conformance against www.openarchives.org/data/registerasprovider.html#Protocol_Conformance_Testing or browse the data at re.cs.uct.ac.za/

blacklight_oai_provider's People

Contributors

cbeer avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.