Code Monkey home page Code Monkey logo

blacklight_with_eds's Introduction

This repo is deprecated. For other code for Blacklight and EDS, see:


This repository contains a full Blacklight instance. You can use it, or if you have an existing Blacklight instance, you can simply download these files and make the following changes.

Add the following files in the noted locations:

articles FOLDER to app/views/articles
articles_helper.rb to app/helpers/articles_helper.rb
articles_helper_behavior.rb to app/helpers/blacklight/articles_helper_behavior.rb
articles_controller.rb to app/controllers/articles_controller.rb
APIauthentication.txt to root of blacklight
token.txt to root of blacklight

CSS:

_default_ebsco_theme.css.scss containts the required CSS styling to show EDS pubtype icons and "loading" circle when a checkbox is clicked

Append the following to Blacklight’s Gemfile, then BUNDLE INSTALL:

gem "ebsco-discovery-service-api", "1.0.3"
gem "addressable", "2.3.2"
gem "htmlentities"
gem "Sanitize"

Edit config/routes.rb to include:

match 'articles' => 'articles#index'
match 'articles/:dbid/:an' => 'articles#detail', :constraints  => { :an => /[^\/]+/ }
match 'articles/:dbid/:an/fulltext' => 'articles#fulltext', :constraints  => { :an => /[^\/]+/ }
match 'articles/switch/' => 'articles#recordSwitch'

Edit app/controllers/application_controller.rb to include:

def after_sign_in_path_for(resource)
  if session[:session_key].present?
    connection = EDSApi::ConnectionHandler.new(2)
    connection.end_session(session[:session_key])
    session[:session_key] = nil
  end
  if session[:results].present?
    session[:results] = nil
  end
  if session[:current_url].present?
    session[:current_url]
  end
end

def after_sign_out_path_for(resource)
  if session[:session_key].present?
    connection = EDSApi::ConnectionHandler.new(2)
    connection.end_session(session[:session_key])
    session[:session_key] = nil
  end
  if session[:results].present?
    session[:results] = nil
  end
  root_path
end

Finally, ensure that session information is stored in the DB, not in COOKIES. From the command line…

rake db:sessions:create
rake db:migrate

…and then in config/initializers/session_store.rb, change

(App)::Application.config.session_store :cookie_store, :key => 'xxx'

to

(App)::Application.config.session_store :active_record_store

This instance requires authentication (via Blacklight) in order for access to be granted to the “articles” portion, as it provides full text access to articles. Guest mode coming soon.

Finally, you’ll need to have an EDS API profile in EBSCOadmin. You can request this at [email protected], or you can create a new EDS API profile yourself using the PROFILE MAINTENANCE FEATURE. Be sure you add content to your EDS API profile (via the DATABASES tab) so it will return results. Create a userID and password to access your API profile in the AUTHENTICATION tab at the top of the screen. Make sure the GROUP associated with the login you create is the group that contains your EDS API profile. EBSCO Support ([email protected]) can help you set up an EDS API profile and get a userID and password for it if you are unfamiliar with EBSCOadmin.

blacklight_with_eds's People

Contributors

jjensen-ebsco avatar

Stargazers

 avatar R. S. Doiel avatar Adam Wead avatar

Watchers

Bill McKinney avatar James Cloos avatar Robert H. McDonald avatar Ron Burns avatar  avatar Michael Abrahamson avatar Ellie Collier avatar

Forkers

fedderm n2sol

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.