Coder Social home page Coder Social logo

blacklight-marc's Introduction

Build Status

Blacklight::Marc

MARC-specific enhancements for Blacklight

Features

  • Rake task solr:marc:index to import .mrc files using Traject and app/models/marc_indexer
  • "Librarian View" at catalog/:id/librarian_view
  • Export records to refworks and endnote
  • Blacklight::Solr::Document mixins for exporting and transforming MARC data from a stored Solr field

Installation

Add this line to your application's Gemfile:

gem 'blacklight-marc'

And then execute:

$ bundle

After running the blacklight generator, run the blacklight_marc generator:

$ rails generate blacklight:marc:install

How does it work?

This generator injects an include into CatalogController (parent class of BookmarksController):

include Blacklight::Marc::Catalog

and the following code is generated into SolrDocument:

use_extension( Blacklight::Solr::Document::Marc) do |document|
  document.key?( :marc_display  )
end

This means, the extension will be applied on the instance if the backing hash has a field called marc_display.

Indexing

The generator will create a model called MarcIndexer. This model can be customized by modifying the field configurations in its initializer as a Traject 2 indexer; new indexing behaviors can be added to it via mixins or inline methods. Two example mixins are provided:

MarcIndexer
  # you would add one or both of the mixins below
  include Blacklight::Marc::Indexer::Formats
  include Blacklight::Marc::Indexer::Dewey
  def initialize
    # and define fields as normal with the mixed-in methods
    to_field 'format', get_format
    to_field 'dewey100', dewey_facets(base: :hundreds)
    to_field 'dewey010', dewey_facets(base: :tens)
    to_field 'dewey_text', dewey_text
  end
end

Documentation, Information and Support

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

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.