Project

dbla

0.01
No commit activity in last 3 years
No release in over 3 years
There's a lot of open issues
Rails engine to put BL on DPLA -> DBLA
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
 Dependencies

Development

Runtime

~> 5.10
~> 4.1
 Project Readme

= Dbla

Access DPLA's API via the Blacklight search interface.

Installation

  1. Generate a Blacklight app:
$ rails new search_app -m https://raw.github.com/projectblacklight/blacklight/master/template.demo.rb
$ cd search_app
  1. Add the dbla gem to the Gemfile:
gem "dbla"

and bundle install.

  1. Run the dbla generators:
$ rails g dbla:install
  1. Create a config/dpla.yml file of the form
api_key: <your-api-key
api_email: <your-email-that-you-used-for-your-api-key>
url: http://api.dp.la/v2/

Find out how to request your DPLA API key

This file can be stubbed out with a rake task:

$ rake dbla:key:get email=my.email@my.server.org
# get your email from DPLA
$ rake dbla:key:config key=YOURKEY00000000
  1. Configure the CatalogController

Replace the following code in your CatalogController:

    # solr field configuration for search results/index views
    config.index.title_field = 'title_display'
    config.index.display_type_field = 'format'

With Dbla options.

    config.repository_class = Dbla::Repository
    config.document_model = Item
    config.response_model = Dbla::Response
    config.document_presenter_class = Dbla::DocumentPresenter
    # solr field configuration for search results/index views
    config.index.title_field = 'sourceResource/title'
    config.index.thumbnail_field = 'object'
    config.index.display_type_field = 'format'

... or just copy the most recent mimicry of the DP.LA portal:

rails g dbla:catalog
  1. Fire it up!
$ rails s

Open your browser and go to localhost:3000.

Search for kittens!