From fb28e5593800d16db1797e754a301d2fa7ab1d37 Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Tue, 29 Aug 2017 12:05:18 -0400 Subject: [PATCH 01/67] Removed empty rdoc file. --- lib/blacklight_oai_provider/README.rdoc | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 lib/blacklight_oai_provider/README.rdoc diff --git a/lib/blacklight_oai_provider/README.rdoc b/lib/blacklight_oai_provider/README.rdoc deleted file mode 100644 index e69de29..0000000 From a63adbfdb2e02e145f44b878a4277afc304147fa Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Tue, 29 Aug 2017 12:10:23 -0400 Subject: [PATCH 02/67] Adding .gitignore. Removing .sqlite file and Gemfile.lock. --- .gitignore | 18 +++ Gemfile.lock | 187 ------------------------ spec/internal/db/combustion_test.sqlite | Bin 13312 -> 0 bytes 3 files changed, 18 insertions(+), 187 deletions(-) create mode 100644 .gitignore delete mode 100644 Gemfile.lock delete mode 100644 spec/internal/db/combustion_test.sqlite diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..66f75b6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,18 @@ +/.bundle/ +/.yardoc +/Gemfile.lock +/_yardoc/ +/coverage/ +/doc/ +/pkg/ +/spec/reports/ +/tmp/ +*.gem +.ruby-version +.ruby-gemset + +# rspec failure tracking +.rspec_status + +# Ignoring files created for dummy/test application. +spec/internal/db/*.sqlite diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index da7e6d1..0000000 --- a/Gemfile.lock +++ /dev/null @@ -1,187 +0,0 @@ -PATH - remote: . - specs: - blacklight_oai_provider (0.0.2) - blacklight - oai - rails (~> 3.0) - -GEM - remote: http://rubygems.org/ - specs: - actionmailer (3.2.8) - actionpack (= 3.2.8) - mail (~> 2.4.4) - actionpack (3.2.8) - activemodel (= 3.2.8) - activesupport (= 3.2.8) - builder (~> 3.0.0) - erubis (~> 2.7.0) - journey (~> 1.0.4) - rack (~> 1.4.0) - rack-cache (~> 1.2) - rack-test (~> 0.6.1) - sprockets (~> 2.1.3) - activemodel (3.2.8) - activesupport (= 3.2.8) - builder (~> 3.0.0) - activerecord (3.2.8) - activemodel (= 3.2.8) - activesupport (= 3.2.8) - arel (~> 3.0.2) - tzinfo (~> 0.3.29) - activeresource (3.2.8) - activemodel (= 3.2.8) - activesupport (= 3.2.8) - activesupport (3.2.8) - i18n (~> 0.6) - multi_json (~> 1.0) - addressable (2.3.2) - arel (3.0.2) - blacklight (3.5.0) - compass-rails (~> 1.0.0) - compass-susy-plugin (>= 0.9.0) - kaminari - marc (>= 0.4.3, < 1.1) - nokogiri (~> 1.5) - rails (~> 3.1) - rsolr (~> 1.0.6) - rsolr-ext (~> 1.0.3) - sass-rails - unicode - builder (3.0.0) - capybara (1.1.2) - mime-types (>= 1.16) - nokogiri (>= 1.3.3) - rack (>= 1.0.0) - rack-test (>= 0.5.4) - selenium-webdriver (~> 2.0) - xpath (~> 0.1.4) - childprocess (0.3.5) - ffi (~> 1.0, >= 1.0.6) - chunky_png (1.2.6) - combustion (0.3.2) - rails (>= 3.0.0) - thor (>= 0.14.6) - compass (0.12.2) - chunky_png (~> 1.2) - fssm (>= 0.2.7) - sass (~> 3.1) - compass-rails (1.0.3) - compass (>= 0.12.2, < 0.14) - compass-susy-plugin (0.9) - compass (>= 0.11.1) - diff-lcs (1.1.3) - erubis (2.7.0) - fakeweb (1.3.0) - faraday (0.8.4) - multipart-post (~> 1.1) - faraday_middleware (0.8.8) - faraday (>= 0.7.4, < 0.9) - ffi (1.1.5) - fssm (0.2.9) - hike (1.2.1) - i18n (0.6.0) - journey (1.0.4) - json (1.7.4) - kaminari (0.13.0) - actionpack (>= 3.0.0) - activesupport (>= 3.0.0) - railties (>= 3.0.0) - libwebsocket (0.1.5) - addressable - mail (2.4.4) - i18n (>= 0.4.0) - mime-types (~> 1.16) - treetop (~> 1.4.8) - marc (0.5.0) - mime-types (1.19) - multi_json (1.3.6) - multipart-post (1.1.5) - nokogiri (1.5.5) - oai (0.2.1) - builder (>= 2.0.0) - faraday - faraday_middleware - polyglot (0.3.3) - rack (1.4.1) - rack-cache (1.2) - rack (>= 0.4) - rack-ssl (1.3.2) - rack - rack-test (0.6.1) - rack (>= 1.0) - rails (3.2.8) - actionmailer (= 3.2.8) - actionpack (= 3.2.8) - activerecord (= 3.2.8) - activeresource (= 3.2.8) - activesupport (= 3.2.8) - bundler (~> 1.0) - railties (= 3.2.8) - railties (3.2.8) - actionpack (= 3.2.8) - activesupport (= 3.2.8) - rack-ssl (~> 1.3.2) - rake (>= 0.8.7) - rdoc (~> 3.4) - thor (>= 0.14.6, < 2.0) - rake (0.9.2.2) - rdoc (3.12) - json (~> 1.4) - rsolr (1.0.8) - builder (>= 2.1.2) - rsolr-ext (1.0.3) - rsolr (>= 1.0.2) - rspec (2.11.0) - rspec-core (~> 2.11.0) - rspec-expectations (~> 2.11.0) - rspec-mocks (~> 2.11.0) - rspec-core (2.11.1) - rspec-expectations (2.11.2) - diff-lcs (~> 1.1.3) - rspec-mocks (2.11.2) - rspec-rails (2.11.0) - actionpack (>= 3.0) - activesupport (>= 3.0) - railties (>= 3.0) - rspec (~> 2.11.0) - rubyzip (0.9.9) - sass (3.2.1) - sass-rails (3.2.5) - railties (~> 3.2.0) - sass (>= 3.1.10) - tilt (~> 1.3) - selenium-webdriver (2.25.0) - childprocess (>= 0.2.5) - libwebsocket (~> 0.1.3) - multi_json (~> 1.0) - rubyzip - sprockets (2.1.3) - hike (~> 1.2) - rack (~> 1.0) - tilt (~> 1.1, != 1.3.0) - sqlite3 (1.3.6) - thor (0.16.0) - tilt (1.3.3) - treetop (1.4.10) - polyglot - polyglot (>= 0.3.1) - tzinfo (0.3.33) - unicode (0.4.3) - vcr (2.2.4) - xpath (0.1.4) - nokogiri (~> 1.3) - -PLATFORMS - ruby - -DEPENDENCIES - blacklight_oai_provider! - capybara - combustion - fakeweb - rspec - rspec-rails - sqlite3 - vcr diff --git a/spec/internal/db/combustion_test.sqlite b/spec/internal/db/combustion_test.sqlite deleted file mode 100644 index 1d98b8d6716f5b02779d32eebe28f0150694e0f8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 13312 zcmeHMOK;Oa5Z;Z`y5S)K7oVywMnEkT;RlsStky*oA3~bN3yHf*`3{;o%zOAfpx11K;3vY%;P1bx&J;Qa3u1A?+wIb2Xjdi_L*Gai{Q-46zvEx;;QX^_KOC^iy zK#{8T?n|;VKaZb1_07#TjmAXZ*})3+()Eg-RAIGLSh%j=*4N4EdbwI!-ynDO4N_{< zSIRY*SJi8EQd@zmQK_6K>Q0xkeWPPC)Am&2(>))Aks-u#e7Z#$h?E(RXX74G%6r2{t%Q>Lr^}!pT(U zqGQ7HFjMP2#j>)nfP-qNbJKOVZIf+#!%8NhM;*#J;6II48kjheEw|aVspG?=kn|d0 z@-4re!s3@Oh3J|M?!a9Rsyx6GQO(<;2m}NIQ-MGf|I){)a921f5D*BUqq*qcU=;rX z6oG(1VEPa^#9i*c)yLoMrw<6>u|QzT5RfF46Tkmcw&}uMfj|ra9{)4w9YXK$8T>kP zN;(tk{7gbkN+%sh49OajL$>m1v;4s`_7R+%wKVXdMAQ4S-Gd+-t8D|#`%+wGh;w% z`9M2)-V>L#4By?RPS|;9hLI|;7G9Ap@!U# zSP>3SE!&rAouKxIG1r1_up%ppf}fYeBQEqKyv-($vLQr2&3+9Wjx&1Xrhco`sMN{X zv%`ZAm@VM**nWo-gV7d$JtXsm%i5S}BR4ILTanx{Ptn(a_WiZPOdum!4{MzBSL~puqP9QKq;JBpalJOsdh93nvxMpLrDX#v7EZpR#nIWNj_uotC3T8w50{^E^ Aod5s; From 79ea2197900d48010df811b713b3584a25b888c2 Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Tue, 29 Aug 2017 14:18:52 -0400 Subject: [PATCH 03/67] Updating README to use markdown. Updating README a bit. --- README.rdoc => README.md | 59 ++++++++++++++++++++-------------------- 1 file changed, 30 insertions(+), 29 deletions(-) rename README.rdoc => README.md (66%) diff --git a/README.rdoc b/README.md similarity index 66% rename from README.rdoc rename to README.md index ad37116..28a7973 100644 --- a/README.rdoc +++ b/README.md @@ -1,42 +1,44 @@ -BlacklightOaiProvider: OAI-PMH service endpoint for Blacklight applications +# BlacklightOaiProvider: OAI-PMH service endpoint for Blacklight applications -= Description +## Description -The BlacklightOaiProvider plugin provides an Open Archives Initiative Protocolo for Metadata Harvesting (OAI-PMH) data provider endpoint, using the ruby-oai gem, that let serice providers harvest that metadata. +The BlacklightOaiProvider plugin provides an [Open Archives Initiative Protocolo for Metadata Harvesting (OAI-PMH)](http://www.openarchives.org/pmh/) data provider endpoint, using the [ruby-oai gem](https://github.com/code4lib/ruby-oai), that let service providers harvest that metadata. -= Requirements +## 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'. +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 +## Installation Add - +```ruby gem "blacklight_oai_provider" +``` -to your Gemfile and run "bundle install". +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: +Then run `rails generate blacklight_oai_provider` to install the appropriate extensions into your `CatalogController` and `SolrDocument` classes. If you want to do customize the way this installs, instead you may: - add this to your Solr Document model: - +```ruby use_extension(BlacklightOaiProvider::SolrDocumentExtension) - +``` - add this to your Controller: - +```ruby include BlacklightOaiProvider::ControllerExtension +``` - -= Configuration +## Configuration While the plugin provides some sensible (albeit generic) defaults out of the box, you probably will want to customize the OAI provider configuration. -== For Blacklight 3.x.x +### For Blacklight 3.x.x You can provide OAI-PMH provider parameters by placing the following in your blacklight configuration, in `./config/initializers/blacklight_config.rb` +```ruby config[:oai] = { :provider => { :repository_name => 'Test', @@ -49,11 +51,12 @@ You can provide OAI-PMH provider parameters by placing the following in your bla :limit => 25 } } - -== For Blacklight 4.x.x +``` +### For Blacklight 4.x.x in `app/controllers/catalog_controller.rb` +```ruby configure_blacklight do |config| # ... @@ -74,29 +77,27 @@ in `app/controllers/catalog_controller.rb` # ... end - +``` The "provider" configuration is documented as part of the ruby-oai gem at http://oai.rubyforge.org/ -== Injection +### 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. +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: - +```ruby 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. +``` +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: - +```ruby BlacklightOaiProvider.omit_inject = { :routes => false, } +``` +## Tests -= Tests - -There are none. This is bad I know, sorry. You can test OAI-PMH conformance against http://www.openarchives.org/data/registerasprovider.html#Protocol_Conformance_Testing or browse the data at http://re.cs.uct.ac.za/ - - +There are some basic tests. You can test OAI-PMH conformance against http://www.openarchives.org/data/registerasprovider.html#Protocol_Conformance_Testing or browse the data at http://re.cs.uct.ac.za/ From f88b2a198bf0930b618b9e9d4f48cebdaa4cbb4d Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Tue, 29 Aug 2017 14:19:25 -0400 Subject: [PATCH 04/67] Fixing test of GetRecord; missing metadataPrefix attribute. --- spec/acceptance/blacklight_oai_provider_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/acceptance/blacklight_oai_provider_spec.rb b/spec/acceptance/blacklight_oai_provider_spec.rb index 8e8a07a..fad1ad3 100644 --- a/spec/acceptance/blacklight_oai_provider_spec.rb +++ b/spec/acceptance/blacklight_oai_provider_spec.rb @@ -10,7 +10,7 @@ :rows => 10, :fl => 'id, title_display, author_display, format, timestamp' } - + config.oai = { :provider => { :repository_name => 'Test', @@ -43,7 +43,7 @@ end it "document page" do - visit '/catalog/oai?verb=GetRecord&identifier=00282214' + visit '/catalog/oai?verb=GetRecord&identifier=00282214&metadataPrefix=oai_dc' page.should have_xpath('//title', :content => 'Fikr-i Ayāz') end end From 2dec5c1c543619a396b386c725ecdc0bb9e45e26 Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Wed, 30 Aug 2017 12:27:18 -0400 Subject: [PATCH 05/67] Adding travis-ci configuration. --- .travis.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..2b23c3e --- /dev/null +++ b/.travis.yml @@ -0,0 +1,13 @@ +notifications: + email: false + +language: ruby +sudo: false +rvm: + - 1.9.3 + +before_install: + - gem install bundler + +script: + - bundle exec rspec spec From a52592aeedad9ca20a85b528bd725a27436d1dde Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Wed, 30 Aug 2017 15:58:59 -0400 Subject: [PATCH 06/67] Adding more ruby versions to test. --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index 2b23c3e..2a4949e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,10 @@ notifications: language: ruby sudo: false rvm: + - 2.3.3 + - 2.2 + - 2.1 + - 2.0 - 1.9.3 before_install: From 7a0d7c236edc3ec5259f09d76bb072892ce0748c Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Tue, 19 Sep 2017 14:00:59 -0400 Subject: [PATCH 07/67] Removing require statements for rsolr-ext. Blacklight dropped its dependency for rsolr-ext in v4.0. --- spec/spec_helper.rb | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index ca0f4fa..c10a05d 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -6,8 +6,6 @@ require 'blacklight/engine' require 'blacklight_oai_provider/engine' require 'rsolr' -require 'rsolr-ext' -require 'rsolr-ext/response' require 'capybara/rspec' Combustion.initialize! @@ -19,14 +17,14 @@ class SolrDocument include Blacklight::Solr::Document include BlacklightOaiProvider::SolrDocumentExtension -use_extension( Blacklight::Solr::Document::DublinCore) - field_semantics.merge!( +use_extension( Blacklight::Solr::Document::DublinCore) + field_semantics.merge!( :title => "title_display", :author => "author_display", :language => "language_facet", :format => "format" ) - + end require 'vcr' @@ -44,4 +42,3 @@ class SolrDocument config.extend VCR::RSpec::Macros end - From f6b000d1694612df8bf930f11df6af086c67e950 Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Wed, 20 Sep 2017 10:24:23 -0400 Subject: [PATCH 08/67] Locking blacklight version at 4.x; Locking rails version at 4.x --- blacklight_oai_provider.gemspec | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/blacklight_oai_provider.gemspec b/blacklight_oai_provider.gemspec index 1e58df0..4d63e4c 100644 --- a/blacklight_oai_provider.gemspec +++ b/blacklight_oai_provider.gemspec @@ -18,10 +18,9 @@ Gem::Specification.new do |s| s.require_paths = ["lib"] - s.add_dependency "rails", ">= 3.0" - s.add_dependency "blacklight", ">= 3.0" + s.add_dependency "rails", "~> 4.0" + s.add_dependency "blacklight", "~> 4.0" s.add_dependency "oai" - s.add_development_dependency 'rspec' s.add_development_dependency 'rspec-rails' s.add_development_dependency 'capybara' s.add_development_dependency 'vcr' From 61cc27a7131d23c158c69499bedccba6305f115c Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Wed, 20 Sep 2017 16:09:52 -0400 Subject: [PATCH 09/67] Moving all gem dependency definitions to gemspec. --- Gemfile | 3 --- blacklight_oai_provider.gemspec | 2 ++ 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 5684bd1..d65e2a6 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,3 @@ source 'http://rubygems.org' gemspec - -gem 'combustion' -gem 'sqlite3' diff --git a/blacklight_oai_provider.gemspec b/blacklight_oai_provider.gemspec index 4d63e4c..ab664d7 100644 --- a/blacklight_oai_provider.gemspec +++ b/blacklight_oai_provider.gemspec @@ -25,4 +25,6 @@ Gem::Specification.new do |s| s.add_development_dependency 'capybara' s.add_development_dependency 'vcr' s.add_development_dependency 'fakeweb' + s.add_development_dependency 'combustion' + s.add_development_dependency 'sqlite3' end From 9cdf2dad27340729de607c900b31888dfafacd7f Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Wed, 20 Sep 2017 16:11:18 -0400 Subject: [PATCH 10/67] Updating spec helper with new combustion configuration. --- spec/spec_helper.rb | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index c10a05d..b693ea6 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,13 +1,8 @@ -require 'rubygems' require 'bundler' Bundler.require :default, :development -require 'blacklight/engine' -require 'blacklight_oai_provider/engine' -require 'rsolr' -require 'capybara/rspec' -Combustion.initialize! +Combustion.initialize! :all # Setup blacklight environment @@ -17,7 +12,7 @@ class SolrDocument include Blacklight::Solr::Document include BlacklightOaiProvider::SolrDocumentExtension -use_extension( Blacklight::Solr::Document::DublinCore) + use_extension( Blacklight::Solr::Document::DublinCore) field_semantics.merge!( :title => "title_display", :author => "author_display", @@ -40,5 +35,4 @@ class SolrDocument RSpec.configure do |config| config.extend VCR::RSpec::Macros - end From 256080bbb2cac9c0ddf315501a55d2e6b7081c57 Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Thu, 21 Sep 2017 12:15:53 -0400 Subject: [PATCH 11/67] Fixing tests, vcr url requests and rails configuration to get most of the tests to run using combustion/vcr. --- .../blacklight_oai_provider_spec.rb | 2 +- spec/spec_helper.rb | 5 +- spec/vcr_cassettes/solr.yml | 88 +++++++++---------- 3 files changed, 48 insertions(+), 47 deletions(-) diff --git a/spec/acceptance/blacklight_oai_provider_spec.rb b/spec/acceptance/blacklight_oai_provider_spec.rb index fad1ad3..8623be8 100644 --- a/spec/acceptance/blacklight_oai_provider_spec.rb +++ b/spec/acceptance/blacklight_oai_provider_spec.rb @@ -35,7 +35,7 @@ it "identify page" do visit '/catalog/oai?verb=Identify' page.should have_content 'root@localhost' - page.should have_xpath('//earliestdatestamp', :content => '2012-08-01T16:49:55Z') + page.should have_xpath('//earliestdatestamp', :text => '2012-08-01T16:49:55Z') end it "should list records" do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index b693ea6..dae5d35 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -2,8 +2,9 @@ Bundler.require :default, :development -Combustion.initialize! :all - +Combustion.initialize! :all do + config.assets.precompile += %w( oai2.xsl ) ## Needs to be added as a generator +end # Setup blacklight environment Blacklight.solr_config = { :url => 'http://127.0.0.1:8983/solr' } diff --git a/spec/vcr_cassettes/solr.yml b/spec/vcr_cassettes/solr.yml index a27564b..9c02426 100644 --- a/spec/vcr_cassettes/solr.yml +++ b/spec/vcr_cassettes/solr.yml @@ -1,111 +1,111 @@ ---- -http_interactions: -- request: +--- +http_interactions: +- request: method: get - uri: http://127.0.0.1:8983/solr/select?wt=ruby&rows=1&fl=timestamp&sort=timestamp+asc - body: + uri: http://127.0.0.1:8983/solr/select?wt=ruby&rows=1&fl=timestamp&sort=timestamp+asc&qt=search + body: encoding: US-ASCII string: "" headers: {} - response: - status: + response: + status: code: 200 message: OK - headers: - content-type: + headers: + content-type: - text/plain; charset=utf-8 - connection: + connection: - close - body: + body: encoding: UTF-8 string: "{'responseHeader'=>{'status'=>0,'QTime'=>2,'params'=>{'fl'=>'timestamp','sort'=>'timestamp asc','wt'=>'ruby','rows'=>'1'}},'response'=>{'numFound'=>30,'start'=>0,'docs'=>[{'timestamp'=>'2012-08-01T16:49:55.214Z'}]},'facet_counts'=>{'facet_queries'=>{},'facet_fields'=>{'format'=>['Book',30],'lc_1letter_facet'=>['B - Philosophy, Psychology, Religion',6,'D - World History',6,'H - Social Sciences',4,'P - Language & Literature',4,'M - Music',3,'K - Law',2,'E - History of the Americas (General)',1,'G - Geography, Anthropology, Recreation',1,'U - Military Science',1],'lc_alpha_facet'=>['DS',5,'BQ',3,'PK',3,'BP',2,'HQ',2,'KPC',2,'BM',1,'DK',1,'E',1,'G',1],'lc_b4cutter_facet'=>['KPC13',2,'BM520.88.A53',1,'BP161.3',1,'BP44',1,'BQ4036',1,'BQ5593.P3',1,'BQ7684.4',1,'DK861.K3',1,'DS274',1,'DS318.84.N87',1],'language_facet'=>['Tibetan',6,'Hebrew',3,'Korean',3,'Persian',3,'Sanskrit',3,'Urdu',3,'Arabic',2,'English',2,'Japanese',2,'Russian',2],'pub_date'=>['2008',4,'1976',2,'1986',2,'1990',2,'1997',2,'2000',2,'1941',1,'1946',1,'1952',1,'1962',1],'subject_era_facet'=>['20th century',3,'1997-',2,'21st century',2,'1990-',1,'2005-2015',1,'Koryo\xCC\x86 period, 935-1392',1],'subject_geo_facet'=>['India',2,'Iran',2,'Japan',2,'Bon-brgya (China)',1,'Bridgeton',1,'China',1,'Economic history',1,'Hong Kong (China)',1,'Islamic countries',1,'Israel',1],'subject_topic_facet'=>['Japanese drama',2,'Kubo, Sakae, 1901-1958',2,'Political plays, Japanese',2,'Theater',2,'Women',2,'Accident insurance',1,'Buddhism',1,'Delaware Indians',1,'Delaware women',1,'Education and state',1]},'facet_dates'=>{},'facet_ranges'=>{}}}" http_version: "1.1" recorded_at: Thu, 16 Aug 2012 20:43:20 GMT -- request: +- request: method: get - uri: http://127.0.0.1:8983/solr/select?wt=ruby&rows=1&fl=timestamp&sort=timestamp+desc - body: + uri: http://127.0.0.1:8983/solr/select?wt=ruby&rows=1&fl=timestamp&sort=timestamp+desc&qt=search + body: encoding: US-ASCII string: "" headers: {} - response: - status: + response: + status: code: 200 message: OK - headers: - content-type: + headers: + content-type: - text/plain; charset=utf-8 - connection: + connection: - close - body: + body: encoding: UTF-8 string: "{'responseHeader'=>{'status'=>0,'QTime'=>3,'params'=>{'fl'=>'timestamp','sort'=>'timestamp desc','wt'=>'ruby','rows'=>'1'}},'response'=>{'numFound'=>30,'start'=>0,'docs'=>[{'timestamp'=>'2012-08-01T16:49:55.683Z'}]},'facet_counts'=>{'facet_queries'=>{},'facet_fields'=>{'format'=>['Book',30],'lc_1letter_facet'=>['B - Philosophy, Psychology, Religion',6,'D - World History',6,'H - Social Sciences',4,'P - Language & Literature',4,'M - Music',3,'K - Law',2,'E - History of the Americas (General)',1,'G - Geography, Anthropology, Recreation',1,'U - Military Science',1],'lc_alpha_facet'=>['DS',5,'BQ',3,'PK',3,'BP',2,'HQ',2,'KPC',2,'BM',1,'DK',1,'E',1,'G',1],'lc_b4cutter_facet'=>['KPC13',2,'BM520.88.A53',1,'BP161.3',1,'BP44',1,'BQ4036',1,'BQ5593.P3',1,'BQ7684.4',1,'DK861.K3',1,'DS274',1,'DS318.84.N87',1],'language_facet'=>['Tibetan',6,'Hebrew',3,'Korean',3,'Persian',3,'Sanskrit',3,'Urdu',3,'Arabic',2,'English',2,'Japanese',2,'Russian',2],'pub_date'=>['2008',4,'1976',2,'1986',2,'1990',2,'1997',2,'2000',2,'1941',1,'1946',1,'1952',1,'1962',1],'subject_era_facet'=>['20th century',3,'1997-',2,'21st century',2,'1990-',1,'2005-2015',1,'Koryo\xCC\x86 period, 935-1392',1],'subject_geo_facet'=>['India',2,'Iran',2,'Japan',2,'Bon-brgya (China)',1,'Bridgeton',1,'China',1,'Economic history',1,'Hong Kong (China)',1,'Islamic countries',1,'Israel',1],'subject_topic_facet'=>['Japanese drama',2,'Kubo, Sakae, 1901-1958',2,'Political plays, Japanese',2,'Theater',2,'Women',2,'Accident insurance',1,'Buddhism',1,'Delaware Indians',1,'Delaware women',1,'Education and state',1]},'facet_dates'=>{},'facet_ranges'=>{}}}" http_version: "1.1" recorded_at: Thu, 16 Aug 2012 20:43:20 GMT -- request: +- request: method: get uri: http://127.0.0.1:8983/solr/select?wt=ruby&rows=25&fl=id%2C+title_display%2C+author_display%2C+format%2C+timestamp&sort=timestamp+asc - body: + body: encoding: US-ASCII string: "" headers: {} - response: - status: + response: + status: code: 200 message: OK - headers: - content-type: + headers: + content-type: - text/plain; charset=utf-8 - connection: + connection: - close - body: + body: encoding: ASCII-8BIT string: "{'responseHeader'=>{'status'=>0,'QTime'=>2,'params'=>{'fl'=>'id, title_display, author_display, format, timestamp','sort'=>'timestamp asc','wt'=>'ruby','rows'=>'25'}},'response'=>{'numFound'=>30,'start'=>0,'docs'=>[{'author_display'=>'Ayaz, Shaikh, 1923-1997','format'=>'Book','title_display'=>'Fikr-i Aya\xCC\x84z','id'=>'00282214','timestamp'=>'2012-08-01T16:49:55.214Z'},{'author_display'=>'Ayaz, Shaikh, 1923-1997','format'=>'Book','title_display'=>'Sa\xCC\x84hiva\xCC\x84l jail ki\xCC\x84 d\xCC\xA3a\xCC\x84\xCA\xBCiri\xCC\x84','id'=>'00282371','timestamp'=>'2012-08-01T16:49:55.249Z'},{'title_display'=>'Naqdi\xCC\x84 bara\xCC\x84-yi tama\xCC\x84m-i fus\xCC\xA3u\xCC\x84l','id'=>'00313831','author_display'=>'Nu\xCC\x84ri\xCC\x84, \xCA\xBBAbd Alla\xCC\x84h, 1949-','format'=>'Book','timestamp'=>'2012-08-01T16:49:55.276Z'},{'author_display'=>'Yoshida, Hajime, 1934-','format'=>'Book','title_display'=>'Kubo Sakae \"Kazanbaichi\" o yomu','id'=>'00314247','timestamp'=>'2012-08-01T16:49:55.307Z'},{'author_display'=>'Vi\xEF\xB8\xA0a\xEF\xB8\xA1tkin, M. P. (Mikhail Porfir\xCA\xB9evich), 1895-1967','format'=>'Book','title_display'=>'Ocherki po istorii Kazakhskoi\xCC\x86 SSR','id'=>'43037890','timestamp'=>'2012-08-01T16:49:55.322Z'},{'author_display'=>'Korea (North)','format'=>'Book','title_display'=>'Konstitut\xEF\xB8\xA0s\xEF\xB8\xA1ii\xEF\xB8\xA0a\xEF\xB8\xA1 i osnovnye zakonodatel\xCA\xB9nye akty Korei\xCC\x86skoi\xCC\x86 Narodno-Demokraticheskoi\xCC\x86 Respubliki','id'=>'53029833','timestamp'=>'2012-08-01T16:49:55.336Z'},{'title_display'=>'Koryo\xCC\x86 inmul yo\xCC\x86lcho\xCC\x86n','id'=>'77826928','format'=>'Book','timestamp'=>'2012-08-01T16:49:55.353Z'},{'author_display'=>'Parikshit Sharma, Ogeti, 1930-','format'=>'Book','title_display'=>'Yas\xCC\x81odhara\xCC\x84-maha\xCC\x84ka\xCC\x84vyam','id'=>'78908283','timestamp'=>'2012-08-01T16:49:55.366Z'},{'author_display'=>'Is\xCC\xA3la\xCC\x84h\xCC\xA3i\xCC\x84, Ami\xCC\x84n Ah\xCC\xA3san, 1904-1997','format'=>'Book','title_display'=>'Pa\xCC\x84kista\xCC\x84ni\xCC\x84 \xCA\xBBaurat dora\xCC\x84he par','id'=>'79930185','timestamp'=>'2012-08-01T16:49:55.377Z'},{'author_display'=>'Na\xCC\x84ra\xCC\x84yan\xCC\xA3apan\xCC\xA3d\xCC\xA3ita, 17th cent','format'=>'Book','title_display'=>'A\xCC\x84s\xCC\x81les\xCC\xA3a\xCC\x84s\xCC\x81ataka of Na\xCC\x84ra\xCC\x84yan\xCC\xA3a Pan\xCC\xA3d\xCC\xA3ita','id'=>'85910001','timestamp'=>'2012-08-01T16:49:55.387Z'},{'title_display'=>'Shodede-yam Yehudiyim','id'=>'86207417','author_display'=>'Finkel, Chaim Jacob','format'=>'Book','timestamp'=>'2012-08-01T16:49:55.402Z'},{'title_display'=>'A\xCC\x84shna\xCC\x84\xCA\xBCi\xCC\x84 ba\xCC\x84 h\xCC\xA3awzah\xCA\xB9ha\xCC\x84-yi \xCA\xBBilmi\xCC\x84yah-\xCA\xBCi Shi\xCC\x84\xCA\xBBah dar t\xCC\xA3u\xCC\x84l-i ta\xCC\x84ri\xCC\x84kh','id'=>'87931798','author_display'=>'Muvah\xCC\xA3h\xCC\xA3id Abt\xCC\xA3ah\xCC\xA3i\xCC\x84, H\xCC\xA3ujjat','format'=>'Book','timestamp'=>'2012-08-01T16:49:55.419Z'},{'author_display'=>'Lomt\xCA\xBBat\xCA\xBBiz\xCC\x87e, C\xCC\x8Cola, 1879-1915','format'=>'Book','title_display'=>'Mrecvelobis mus\xCC\x8Cakis c\xCA\xBBxovrebis cesi','id'=>'90142413','timestamp'=>'2012-08-01T16:49:55.435Z'},{'title_display'=>'Pukhan po\xCC\x86mnyo\xCC\x86ngjip','id'=>'92117465','author_display'=>'Korea (North)','format'=>'Book','timestamp'=>'2012-08-01T16:49:55.447Z'},{'title_display'=>'Sefer Mishnah berurah','id'=>'92828023','author_display'=>'Israel Meir, ha-Kohen, 1838-1933','format'=>'Book','timestamp'=>'2012-08-01T16:49:55.464Z'},{'title_display'=>'Ajikto ku\xCC\x86ro\xCC\x86k cho\xCC\x86ro\xCC\x86k sasimnikka','id'=>'94120425','author_display'=>'Kim, Hong-sin, 1947-','format'=>'Book','timestamp'=>'2012-08-01T16:49:55.488Z'},{'title_display'=>'Ma\xCA\xBBrakah-\xCA\xBCi jaha\xCC\x84n\xCA\xB9bi\xCC\x84ni\xCC\x84\xCA\xB9ha\xCC\x84','id'=>'96933325','author_display'=>'Raja\xCC\x84yi\xCC\x84, Farhang, 1952 or 3-','format'=>'Book','timestamp'=>'2012-08-01T16:49:55.502Z'},{'author_display'=>'Na\xCC\x84ra\xCC\x84yan\xCC\xA3a Pan\xCC\xA3d\xCC\xA3ita\xCC\x84ca\xCC\x84rya, 13th cent','format'=>'Book','title_display'=>'Sumadhvavijayah\xCC\xA3','id'=>'2001417245','timestamp'=>'2012-08-01T16:49:55.515Z'},{'title_display'=>'al-H\xCC\xA3arb fi\xCC\x84 al-alfi\xCC\x84yah al-tha\xCC\x84lithah','id'=>'2003546302','author_display'=>'Wuld Mawla\xCC\x84y al-Zayn, Sayyid Muh\xCC\xA3ammad wuld Sayyid','format'=>'Book','timestamp'=>'2012-08-01T16:49:55.529Z'},{'author_display'=>'Bstan-\xCA\xBCdzin-mkhas-grub, 1967-','format'=>'Book','title_display'=>'Bon-brgya\xCA\xBCi lo rgyus lugs gn\xCC\x83is gsal ba\xCA\xBCi me lon\xCC\x87 z\xCC\x81es bya ba bz\xCC\x81ugs so','id'=>'2004310986','timestamp'=>'2012-08-01T16:49:55.539Z'},{'title_display'=>'Thuqu\xCC\x84b fi\xCC\x84 \xCA\xBBaql al-ummah','id'=>'2005461726','author_display'=>'Abu\xCC\x84 al-Khayr, \xCA\xBBAli\xCC\x84 \xCA\xBBAbd al-H\xCC\xA3ami\xCC\x84d','format'=>'Book','timestamp'=>'2012-08-01T16:49:55.551Z'},{'format'=>'Book','title_display'=>'Bituah\xCC\xA3 u-vit\xCC\xA3ah\xCC\xA3on sotsyali','id'=>'2005553155','timestamp'=>'2012-08-01T16:49:55.57Z'},{'title_display'=>'\"Strong Medicine speaks\"','id'=>'2007020969','author_display'=>'Hearth, Amy Hill, 1958-','format'=>'Book','timestamp'=>'2012-08-01T16:49:55.59Z'},{'title_display'=>'Dris lan don gcig ma','id'=>'2008305903','author_display'=>'Dkon-mchog-rgya-mtsho, Ra-se, 1968-','format'=>'Book','timestamp'=>'2012-08-01T16:49:55.602Z'},{'title_display'=>'Pluvial nectar of blessings','id'=>'2008308175','author_display'=>'N\xCC\x87ag-dban\xCC\x87-blo-bzan\xCC\x87-rgya-mtsho, Dalai Lama V, 1617-1682','format'=>'Book','timestamp'=>'2012-08-01T16:49:55.621Z'}]},'facet_counts'=>{'facet_queries'=>{},'facet_fields'=>{'format'=>['Book',30],'lc_1letter_facet'=>['B - Philosophy, Psychology, Religion',6,'D - World History',6,'H - Social Sciences',4,'P - Language & Literature',4,'M - Music',3,'K - Law',2,'E - History of the Americas (General)',1,'G - Geography, Anthropology, Recreation',1,'U - Military Science',1],'lc_alpha_facet'=>['DS',5,'BQ',3,'PK',3,'BP',2,'HQ',2,'KPC',2,'BM',1,'DK',1,'E',1,'G',1],'lc_b4cutter_facet'=>['KPC13',2,'BM520.88.A53',1,'BP161.3',1,'BP44',1,'BQ4036',1,'BQ5593.P3',1,'BQ7684.4',1,'DK861.K3',1,'DS274',1,'DS318.84.N87',1],'language_facet'=>['Tibetan',6,'Hebrew',3,'Korean',3,'Persian',3,'Sanskrit',3,'Urdu',3,'Arabic',2,'English',2,'Japanese',2,'Russian',2],'pub_date'=>['2008',4,'1976',2,'1986',2,'1990',2,'1997',2,'2000',2,'1941',1,'1946',1,'1952',1,'1962',1],'subject_era_facet'=>['20th century',3,'1997-',2,'21st century',2,'1990-',1,'2005-2015',1,'Koryo\xCC\x86 period, 935-1392',1],'subject_geo_facet'=>['India',2,'Iran',2,'Japan',2,'Bon-brgya (China)',1,'Bridgeton',1,'China',1,'Economic history',1,'Hong Kong (China)',1,'Islamic countries',1,'Israel',1],'subject_topic_facet'=>['Japanese drama',2,'Kubo, Sakae, 1901-1958',2,'Political plays, Japanese',2,'Theater',2,'Women',2,'Accident insurance',1,'Buddhism',1,'Delaware Indians',1,'Delaware women',1,'Education and state',1]},'facet_dates'=>{},'facet_ranges'=>{}}}" http_version: "1.1" recorded_at: Thu, 16 Aug 2012 20:43:20 GMT -- request: +- request: method: get uri: http://127.0.0.1:8983/solr/select?wt=ruby&rows=25&fl=id%2C+title_display%2C+author_display%2C+format%2C+timestamp&sort=timestamp+asc&start=0 - body: + body: encoding: US-ASCII string: "" headers: {} - response: - status: + response: + status: code: 200 message: OK - headers: - content-type: + headers: + content-type: - text/plain; charset=utf-8 - connection: + connection: - close - body: + body: encoding: ASCII-8BIT string: "{'responseHeader'=>{'status'=>0,'QTime'=>4,'params'=>{'fl'=>'id, title_display, author_display, format, timestamp','sort'=>'timestamp asc','wt'=>'ruby','start'=>'0','rows'=>'25'}},'response'=>{'numFound'=>30,'start'=>0,'docs'=>[{'author_display'=>'Ayaz, Shaikh, 1923-1997','format'=>'Book','title_display'=>'Fikr-i Aya\xCC\x84z','id'=>'00282214','timestamp'=>'2012-08-01T16:49:55.214Z'},{'author_display'=>'Ayaz, Shaikh, 1923-1997','format'=>'Book','title_display'=>'Sa\xCC\x84hiva\xCC\x84l jail ki\xCC\x84 d\xCC\xA3a\xCC\x84\xCA\xBCiri\xCC\x84','id'=>'00282371','timestamp'=>'2012-08-01T16:49:55.249Z'},{'title_display'=>'Naqdi\xCC\x84 bara\xCC\x84-yi tama\xCC\x84m-i fus\xCC\xA3u\xCC\x84l','id'=>'00313831','author_display'=>'Nu\xCC\x84ri\xCC\x84, \xCA\xBBAbd Alla\xCC\x84h, 1949-','format'=>'Book','timestamp'=>'2012-08-01T16:49:55.276Z'},{'author_display'=>'Yoshida, Hajime, 1934-','format'=>'Book','title_display'=>'Kubo Sakae \"Kazanbaichi\" o yomu','id'=>'00314247','timestamp'=>'2012-08-01T16:49:55.307Z'},{'author_display'=>'Vi\xEF\xB8\xA0a\xEF\xB8\xA1tkin, M. P. (Mikhail Porfir\xCA\xB9evich), 1895-1967','format'=>'Book','title_display'=>'Ocherki po istorii Kazakhskoi\xCC\x86 SSR','id'=>'43037890','timestamp'=>'2012-08-01T16:49:55.322Z'},{'author_display'=>'Korea (North)','format'=>'Book','title_display'=>'Konstitut\xEF\xB8\xA0s\xEF\xB8\xA1ii\xEF\xB8\xA0a\xEF\xB8\xA1 i osnovnye zakonodatel\xCA\xB9nye akty Korei\xCC\x86skoi\xCC\x86 Narodno-Demokraticheskoi\xCC\x86 Respubliki','id'=>'53029833','timestamp'=>'2012-08-01T16:49:55.336Z'},{'title_display'=>'Koryo\xCC\x86 inmul yo\xCC\x86lcho\xCC\x86n','id'=>'77826928','format'=>'Book','timestamp'=>'2012-08-01T16:49:55.353Z'},{'author_display'=>'Parikshit Sharma, Ogeti, 1930-','format'=>'Book','title_display'=>'Yas\xCC\x81odhara\xCC\x84-maha\xCC\x84ka\xCC\x84vyam','id'=>'78908283','timestamp'=>'2012-08-01T16:49:55.366Z'},{'author_display'=>'Is\xCC\xA3la\xCC\x84h\xCC\xA3i\xCC\x84, Ami\xCC\x84n Ah\xCC\xA3san, 1904-1997','format'=>'Book','title_display'=>'Pa\xCC\x84kista\xCC\x84ni\xCC\x84 \xCA\xBBaurat dora\xCC\x84he par','id'=>'79930185','timestamp'=>'2012-08-01T16:49:55.377Z'},{'author_display'=>'Na\xCC\x84ra\xCC\x84yan\xCC\xA3apan\xCC\xA3d\xCC\xA3ita, 17th cent','format'=>'Book','title_display'=>'A\xCC\x84s\xCC\x81les\xCC\xA3a\xCC\x84s\xCC\x81ataka of Na\xCC\x84ra\xCC\x84yan\xCC\xA3a Pan\xCC\xA3d\xCC\xA3ita','id'=>'85910001','timestamp'=>'2012-08-01T16:49:55.387Z'},{'title_display'=>'Shodede-yam Yehudiyim','id'=>'86207417','author_display'=>'Finkel, Chaim Jacob','format'=>'Book','timestamp'=>'2012-08-01T16:49:55.402Z'},{'title_display'=>'A\xCC\x84shna\xCC\x84\xCA\xBCi\xCC\x84 ba\xCC\x84 h\xCC\xA3awzah\xCA\xB9ha\xCC\x84-yi \xCA\xBBilmi\xCC\x84yah-\xCA\xBCi Shi\xCC\x84\xCA\xBBah dar t\xCC\xA3u\xCC\x84l-i ta\xCC\x84ri\xCC\x84kh','id'=>'87931798','author_display'=>'Muvah\xCC\xA3h\xCC\xA3id Abt\xCC\xA3ah\xCC\xA3i\xCC\x84, H\xCC\xA3ujjat','format'=>'Book','timestamp'=>'2012-08-01T16:49:55.419Z'},{'author_display'=>'Lomt\xCA\xBBat\xCA\xBBiz\xCC\x87e, C\xCC\x8Cola, 1879-1915','format'=>'Book','title_display'=>'Mrecvelobis mus\xCC\x8Cakis c\xCA\xBBxovrebis cesi','id'=>'90142413','timestamp'=>'2012-08-01T16:49:55.435Z'},{'title_display'=>'Pukhan po\xCC\x86mnyo\xCC\x86ngjip','id'=>'92117465','author_display'=>'Korea (North)','format'=>'Book','timestamp'=>'2012-08-01T16:49:55.447Z'},{'title_display'=>'Sefer Mishnah berurah','id'=>'92828023','author_display'=>'Israel Meir, ha-Kohen, 1838-1933','format'=>'Book','timestamp'=>'2012-08-01T16:49:55.464Z'},{'title_display'=>'Ajikto ku\xCC\x86ro\xCC\x86k cho\xCC\x86ro\xCC\x86k sasimnikka','id'=>'94120425','author_display'=>'Kim, Hong-sin, 1947-','format'=>'Book','timestamp'=>'2012-08-01T16:49:55.488Z'},{'title_display'=>'Ma\xCA\xBBrakah-\xCA\xBCi jaha\xCC\x84n\xCA\xB9bi\xCC\x84ni\xCC\x84\xCA\xB9ha\xCC\x84','id'=>'96933325','author_display'=>'Raja\xCC\x84yi\xCC\x84, Farhang, 1952 or 3-','format'=>'Book','timestamp'=>'2012-08-01T16:49:55.502Z'},{'author_display'=>'Na\xCC\x84ra\xCC\x84yan\xCC\xA3a Pan\xCC\xA3d\xCC\xA3ita\xCC\x84ca\xCC\x84rya, 13th cent','format'=>'Book','title_display'=>'Sumadhvavijayah\xCC\xA3','id'=>'2001417245','timestamp'=>'2012-08-01T16:49:55.515Z'},{'title_display'=>'al-H\xCC\xA3arb fi\xCC\x84 al-alfi\xCC\x84yah al-tha\xCC\x84lithah','id'=>'2003546302','author_display'=>'Wuld Mawla\xCC\x84y al-Zayn, Sayyid Muh\xCC\xA3ammad wuld Sayyid','format'=>'Book','timestamp'=>'2012-08-01T16:49:55.529Z'},{'author_display'=>'Bstan-\xCA\xBCdzin-mkhas-grub, 1967-','format'=>'Book','title_display'=>'Bon-brgya\xCA\xBCi lo rgyus lugs gn\xCC\x83is gsal ba\xCA\xBCi me lon\xCC\x87 z\xCC\x81es bya ba bz\xCC\x81ugs so','id'=>'2004310986','timestamp'=>'2012-08-01T16:49:55.539Z'},{'title_display'=>'Thuqu\xCC\x84b fi\xCC\x84 \xCA\xBBaql al-ummah','id'=>'2005461726','author_display'=>'Abu\xCC\x84 al-Khayr, \xCA\xBBAli\xCC\x84 \xCA\xBBAbd al-H\xCC\xA3ami\xCC\x84d','format'=>'Book','timestamp'=>'2012-08-01T16:49:55.551Z'},{'format'=>'Book','title_display'=>'Bituah\xCC\xA3 u-vit\xCC\xA3ah\xCC\xA3on sotsyali','id'=>'2005553155','timestamp'=>'2012-08-01T16:49:55.57Z'},{'title_display'=>'\"Strong Medicine speaks\"','id'=>'2007020969','author_display'=>'Hearth, Amy Hill, 1958-','format'=>'Book','timestamp'=>'2012-08-01T16:49:55.59Z'},{'title_display'=>'Dris lan don gcig ma','id'=>'2008305903','author_display'=>'Dkon-mchog-rgya-mtsho, Ra-se, 1968-','format'=>'Book','timestamp'=>'2012-08-01T16:49:55.602Z'},{'title_display'=>'Pluvial nectar of blessings','id'=>'2008308175','author_display'=>'N\xCC\x87ag-dban\xCC\x87-blo-bzan\xCC\x87-rgya-mtsho, Dalai Lama V, 1617-1682','format'=>'Book','timestamp'=>'2012-08-01T16:49:55.621Z'}]},'facet_counts'=>{'facet_queries'=>{},'facet_fields'=>{'format'=>['Book',30],'lc_1letter_facet'=>['B - Philosophy, Psychology, Religion',6,'D - World History',6,'H - Social Sciences',4,'P - Language & Literature',4,'M - Music',3,'K - Law',2,'E - History of the Americas (General)',1,'G - Geography, Anthropology, Recreation',1,'U - Military Science',1],'lc_alpha_facet'=>['DS',5,'BQ',3,'PK',3,'BP',2,'HQ',2,'KPC',2,'BM',1,'DK',1,'E',1,'G',1],'lc_b4cutter_facet'=>['KPC13',2,'BM520.88.A53',1,'BP161.3',1,'BP44',1,'BQ4036',1,'BQ5593.P3',1,'BQ7684.4',1,'DK861.K3',1,'DS274',1,'DS318.84.N87',1],'language_facet'=>['Tibetan',6,'Hebrew',3,'Korean',3,'Persian',3,'Sanskrit',3,'Urdu',3,'Arabic',2,'English',2,'Japanese',2,'Russian',2],'pub_date'=>['2008',4,'1976',2,'1986',2,'1990',2,'1997',2,'2000',2,'1941',1,'1946',1,'1952',1,'1962',1],'subject_era_facet'=>['20th century',3,'1997-',2,'21st century',2,'1990-',1,'2005-2015',1,'Koryo\xCC\x86 period, 935-1392',1],'subject_geo_facet'=>['India',2,'Iran',2,'Japan',2,'Bon-brgya (China)',1,'Bridgeton',1,'China',1,'Economic history',1,'Hong Kong (China)',1,'Islamic countries',1,'Israel',1],'subject_topic_facet'=>['Japanese drama',2,'Kubo, Sakae, 1901-1958',2,'Political plays, Japanese',2,'Theater',2,'Women',2,'Accident insurance',1,'Buddhism',1,'Delaware Indians',1,'Delaware women',1,'Education and state',1]},'facet_dates'=>{},'facet_ranges'=>{}}}" http_version: "1.1" recorded_at: Thu, 16 Aug 2012 20:43:20 GMT -- request: +- request: method: get uri: http://127.0.0.1:8983/solr/select?wt=ruby&fq=id%3A%2200282214%22&rows=10&fl=id%2C+title_display%2C+author_display%2C+format%2C+timestamp - body: + body: encoding: US-ASCII string: "" headers: {} - response: - status: + response: + status: code: 200 message: OK - headers: - content-type: + headers: + content-type: - text/plain; charset=utf-8 - connection: + connection: - close - body: + body: encoding: ASCII-8BIT string: "{'responseHeader'=>{'status'=>0,'QTime'=>3,'params'=>{'fl'=>'id, title_display, author_display, format, timestamp','wt'=>'ruby','fq'=>'id:\"00282214\"','rows'=>'10'}},'response'=>{'numFound'=>1,'start'=>0,'docs'=>[{'author_display'=>'Ayaz, Shaikh, 1923-1997','format'=>'Book','title_display'=>'Fikr-i Aya\xCC\x84z','id'=>'00282214','timestamp'=>'2012-08-01T16:49:55.214Z'}]},'facet_counts'=>{'facet_queries'=>{},'facet_fields'=>{'format'=>['Book',1],'lc_1letter_facet'=>['P - Language & Literature',1],'lc_alpha_facet'=>['PK',1],'lc_b4cutter_facet'=>['PK2788.9.A9',1],'language_facet'=>['Urdu',1],'pub_date'=>['1998',1],'subject_era_facet'=>[],'subject_geo_facet'=>[],'subject_topic_facet'=>[]},'facet_dates'=>{},'facet_ranges'=>{}}}" http_version: "1.1" From 97c894a22bb4e50ea1fca9c3b6fea7d456de8964 Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Thu, 21 Sep 2017 15:17:38 -0400 Subject: [PATCH 12/67] Adding solr_wrapper to list of dependencies. --- blacklight_oai_provider.gemspec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/blacklight_oai_provider.gemspec b/blacklight_oai_provider.gemspec index ab664d7..53aeeab 100644 --- a/blacklight_oai_provider.gemspec +++ b/blacklight_oai_provider.gemspec @@ -23,6 +23,8 @@ Gem::Specification.new do |s| s.add_dependency "oai" s.add_development_dependency 'rspec-rails' s.add_development_dependency 'capybara' + s.add_development_dependency 'solr_wrapper' + s.add_development_dependency 'vcr' s.add_development_dependency 'fakeweb' s.add_development_dependency 'combustion' From 841774ae5282951918cc3936be6b21b51c6413a8 Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Thu, 21 Sep 2017 15:18:08 -0400 Subject: [PATCH 13/67] Adding baseline solr config and test solr documents. Copied from Blacklight repository. --- solr/conf/_rest_managed.json | 3 + solr/conf/admin-extra.html | 31 + solr/conf/elevate.xml | 36 + solr/conf/mapping-ISOLatin1Accent.txt | 246 +++ solr/conf/protwords.txt | 21 + solr/conf/schema.xml | 629 ++++++ solr/conf/scripts.conf | 24 + solr/conf/solrconfig.xml | 401 ++++ solr/conf/spellings.txt | 2 + solr/conf/stopwords.txt | 58 + solr/conf/stopwords_en.txt | 58 + solr/conf/synonyms.txt | 31 + solr/conf/xslt/example.xsl | 132 ++ solr/conf/xslt/example_atom.xsl | 67 + solr/conf/xslt/example_rss.xsl | 66 + solr/conf/xslt/luke.xsl | 337 ++++ solr/sample_solr_documents.yml | 2692 +++++++++++++++++++++++++ 17 files changed, 4834 insertions(+) create mode 100755 solr/conf/_rest_managed.json create mode 100755 solr/conf/admin-extra.html create mode 100755 solr/conf/elevate.xml create mode 100755 solr/conf/mapping-ISOLatin1Accent.txt create mode 100755 solr/conf/protwords.txt create mode 100755 solr/conf/schema.xml create mode 100755 solr/conf/scripts.conf create mode 100755 solr/conf/solrconfig.xml create mode 100755 solr/conf/spellings.txt create mode 100755 solr/conf/stopwords.txt create mode 100755 solr/conf/stopwords_en.txt create mode 100755 solr/conf/synonyms.txt create mode 100755 solr/conf/xslt/example.xsl create mode 100755 solr/conf/xslt/example_atom.xsl create mode 100755 solr/conf/xslt/example_rss.xsl create mode 100755 solr/conf/xslt/luke.xsl create mode 100755 solr/sample_solr_documents.yml diff --git a/solr/conf/_rest_managed.json b/solr/conf/_rest_managed.json new file mode 100755 index 0000000..e7ada3f --- /dev/null +++ b/solr/conf/_rest_managed.json @@ -0,0 +1,3 @@ +{ + "initArgs":{}, + "managedList":[]} \ No newline at end of file diff --git a/solr/conf/admin-extra.html b/solr/conf/admin-extra.html new file mode 100755 index 0000000..21b5090 --- /dev/null +++ b/solr/conf/admin-extra.html @@ -0,0 +1,31 @@ + + + diff --git a/solr/conf/elevate.xml b/solr/conf/elevate.xml new file mode 100755 index 0000000..b91e75c --- /dev/null +++ b/solr/conf/elevate.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + diff --git a/solr/conf/mapping-ISOLatin1Accent.txt b/solr/conf/mapping-ISOLatin1Accent.txt new file mode 100755 index 0000000..186ca31 --- /dev/null +++ b/solr/conf/mapping-ISOLatin1Accent.txt @@ -0,0 +1,246 @@ +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Syntax: +# "source" => "target" +# "source".length() > 0 (source cannot be empty.) +# "target".length() >= 0 (target can be empty.) + +# example: +# "??" => "A" +# "\u00C0" => "A" +# "\u00C0" => "\u0041" +# "??" => "ss" +# "\t" => " " +# "\n" => "" + +# ?? => A +"\u00C0" => "A" + +# ?? => A +"\u00C1" => "A" + +# ?? => A +"\u00C2" => "A" + +# ?? => A +"\u00C3" => "A" + +# ?? => A +"\u00C4" => "A" + +# ?? => A +"\u00C5" => "A" + +# ?? => AE +"\u00C6" => "AE" + +# ?? => C +"\u00C7" => "C" + +# ?? => E +"\u00C8" => "E" + +# ?? => E +"\u00C9" => "E" + +# ?? => E +"\u00CA" => "E" + +# ?? => E +"\u00CB" => "E" + +# ?? => I +"\u00CC" => "I" + +# ?? => I +"\u00CD" => "I" + +# ?? => I +"\u00CE" => "I" + +# ?? => I +"\u00CF" => "I" + +# ?? => IJ +"\u0132" => "IJ" + +# ?? => D +"\u00D0" => "D" + +# ?? => N +"\u00D1" => "N" + +# ?? => O +"\u00D2" => "O" + +# ?? => O +"\u00D3" => "O" + +# ?? => O +"\u00D4" => "O" + +# ?? => O +"\u00D5" => "O" + +# ?? => O +"\u00D6" => "O" + +# ?? => O +"\u00D8" => "O" + +# ?? => OE +"\u0152" => "OE" + +# ?? +"\u00DE" => "TH" + +# ?? => U +"\u00D9" => "U" + +# ?? => U +"\u00DA" => "U" + +# ?? => U +"\u00DB" => "U" + +# ?? => U +"\u00DC" => "U" + +# ?? => Y +"\u00DD" => "Y" + +# ?? => Y +"\u0178" => "Y" + +# ?? => a +"\u00E0" => "a" + +# ?? => a +"\u00E1" => "a" + +# ?? => a +"\u00E2" => "a" + +# ?? => a +"\u00E3" => "a" + +# ?? => a +"\u00E4" => "a" + +# ?? => a +"\u00E5" => "a" + +# ?? => ae +"\u00E6" => "ae" + +# ?? => c +"\u00E7" => "c" + +# ?? => e +"\u00E8" => "e" + +# ?? => e +"\u00E9" => "e" + +# ?? => e +"\u00EA" => "e" + +# ?? => e +"\u00EB" => "e" + +# ?? => i +"\u00EC" => "i" + +# ?? => i +"\u00ED" => "i" + +# ?? => i +"\u00EE" => "i" + +# ?? => i +"\u00EF" => "i" + +# ?? => ij +"\u0133" => "ij" + +# ?? => d +"\u00F0" => "d" + +# ?? => n +"\u00F1" => "n" + +# ?? => o +"\u00F2" => "o" + +# ?? => o +"\u00F3" => "o" + +# ?? => o +"\u00F4" => "o" + +# ?? => o +"\u00F5" => "o" + +# ?? => o +"\u00F6" => "o" + +# ?? => o +"\u00F8" => "o" + +# ?? => oe +"\u0153" => "oe" + +# ?? => ss +"\u00DF" => "ss" + +# ?? => th +"\u00FE" => "th" + +# ?? => u +"\u00F9" => "u" + +# ?? => u +"\u00FA" => "u" + +# ?? => u +"\u00FB" => "u" + +# ?? => u +"\u00FC" => "u" + +# ?? => y +"\u00FD" => "y" + +# ?? => y +"\u00FF" => "y" + +# ??? => ff +"\uFB00" => "ff" + +# ??? => fi +"\uFB01" => "fi" + +# ??? => fl +"\uFB02" => "fl" + +# ??? => ffi +"\uFB03" => "ffi" + +# ??? => ffl +"\uFB04" => "ffl" + +# ??? => ft +"\uFB05" => "ft" + +# ??? => st +"\uFB06" => "st" diff --git a/solr/conf/protwords.txt b/solr/conf/protwords.txt new file mode 100755 index 0000000..5a32e50 --- /dev/null +++ b/solr/conf/protwords.txt @@ -0,0 +1,21 @@ +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +#----------------------------------------------------------------------- +# Use a protected word file to protect against the stemmer reducing two +# unrelated words to the same base word. + +# Some non-words that normally won't be encountered, +# just to test that they won't be stemmed. +dontstems +zwhacky + diff --git a/solr/conf/schema.xml b/solr/conf/schema.xml new file mode 100755 index 0000000..7ec1487 --- /dev/null +++ b/solr/conf/schema.xml @@ -0,0 +1,629 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/solr/conf/scripts.conf b/solr/conf/scripts.conf new file mode 100755 index 0000000..f58b262 --- /dev/null +++ b/solr/conf/scripts.conf @@ -0,0 +1,24 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +user= +solr_hostname=localhost +solr_port=8983 +rsyncd_port=18983 +data_dir= +webapp_name=solr +master_host= +master_data_dir= +master_status_dir= diff --git a/solr/conf/solrconfig.xml b/solr/conf/solrconfig.xml new file mode 100755 index 0000000..ffafb11 --- /dev/null +++ b/solr/conf/solrconfig.xml @@ -0,0 +1,401 @@ + + + + + + + + 5.0.0 + + + + + + + + + + + + + ${solr.blacklight-core.data.dir:} + + + + + + + + + + *:* + + + + + + + dismax + explicit + 10 + + *:* + 2<-1 5<-2 6<90% + + + + + title_unstem_search^100000 + subtitle_unstem_search^50000 + title_t^25000 + subtitle_t^10000 + title_addl_unstem_search^5000 + title_addl_t^2500 + title_added_entry_unstem_search^1500 + title_added_entry_t^1250 + subject_topic_unstem_search^1000 + subject_unstem_search^750 + subject_topic_facet^625 + subject_t^500 + author_unstem_search^250 + author_addl_unstem_search^250 + author_t^100 + author_addl_t^50 + subject_addl_unstem_search^250 + subject_addl_t^50 + title_series_unstem_search^25 + title_series_t^10 + isbn_t + text + + + title_unstem_search^1000000 + subtitle_unstem_search^500000 + title_t^250000 + subtitle_t^100000 + title_addl_unstem_search^50000 + title_addl_t^25000 + title_added_entry_unstem_search^15000 + title_added_entry_t^12500 + subject_topic_unstem_search^10000 + subject_unstem_search^7500 + subject_topic_facet^6250 + subject_t^5000 + author_unstem_search^2500 + author_addl_unstem_search^2500 + author_t^1000 + author_addl_t^500 + subject_addl_unstem_search^2500 + subject_addl_t^500 + title_series_unstem_search^250 + title_series_t^100 + text^10 + + + author_unstem_search^200 + author_addl_unstem_search^50 + author_t^20 + author_addl_t + + + author_unstem_search^2000 + author_addl_unstem_search^500 + author_t^200 + author_addl_t^10 + + + title_unstem_search^50000 + subtitle_unstem_search^25000 + title_addl_unstem_search^10000 + title_t^5000 + subtitle_t^2500 + title_addl_t^100 + title_added_entry_unstem_search^50 + title_added_entry_t^10 + title_series_unstem_search^5 + title_series_t + + + title_unstem_search^500000 + subtitle_unstem_search^250000 + title_addl_unstem_search^100000 + title_t^50000 + subtitle_t^25000 + title_addl_t^1000 + title_added_entry_unstem_search^500 + title_added_entry_t^100 + title_series_t^50 + title_series_unstem_search^10 + + + subject_topic_unstem_search^200 + subject_unstem_search^125 + subject_topic_facet^100 + subject_t^50 + subject_addl_unstem_search^10 + subject_addl_t + + + subject_topic_unstem_search^2000 + subject_unstem_search^1250 + subject_t^1000 + subject_topic_facet^500 + subject_addl_unstem_search^100 + subject_addl_t^10 + + + 3 + 0.01 + + + id, + score, + author_display, + author_vern_display, + format, + isbn_t, + language_facet, + lc_callnum_display, + material_type_display, + published_display, + published_vern_display, + pub_date, + title_display, + title_vern_display, + subject_topic_facet, + subject_geo_facet, + subject_era_facet, + subtitle_display, + subtitle_vern_display, + url_fulltext_display, + url_suppl_display, + marc_display, + + + true + 1 + format + lc_1letter_facet + lc_alpha_facet + lc_b4cutter_facet + language_facet + pub_date + subject_era_facet + subject_geo_facet + subject_topic_facet + + true + default + true + true + false + 5 + + + + + + + + + + + spellcheck + + + + + + + + textSpell + + + + + + default + spell + ./spell + true + + + author + author_spell + ./spell_author + 0.7 + true + + + subject + subject_spell + ./spell_subject + 0.7 + true + + + title + title_spell + ./spell_title + 0.7 + true + + + + + + + + + + + + + + + mySuggester + FuzzyLookupFactory + textSuggest + true + suggest + + + + + + true + 5 + mySuggester + + + suggest + + + + + diff --git a/solr/conf/spellings.txt b/solr/conf/spellings.txt new file mode 100755 index 0000000..765190a --- /dev/null +++ b/solr/conf/spellings.txt @@ -0,0 +1,2 @@ +pizza +history diff --git a/solr/conf/stopwords.txt b/solr/conf/stopwords.txt new file mode 100755 index 0000000..22f277f --- /dev/null +++ b/solr/conf/stopwords.txt @@ -0,0 +1,58 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +#----------------------------------------------------------------------- +# a couple of test stopwords to test that the words are really being +# configured from this file: +stopworda +stopwordb + +#Standard english stop words taken from Lucene's StopAnalyzer +a +an +and +are +as +at +be +but +by +for +if +in +into +is +it +no +not +of +on +or +s +such +t +that +the +their +then +there +these +they +this +to +was +will +with + diff --git a/solr/conf/stopwords_en.txt b/solr/conf/stopwords_en.txt new file mode 100755 index 0000000..22f277f --- /dev/null +++ b/solr/conf/stopwords_en.txt @@ -0,0 +1,58 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +#----------------------------------------------------------------------- +# a couple of test stopwords to test that the words are really being +# configured from this file: +stopworda +stopwordb + +#Standard english stop words taken from Lucene's StopAnalyzer +a +an +and +are +as +at +be +but +by +for +if +in +into +is +it +no +not +of +on +or +s +such +t +that +the +their +then +there +these +they +this +to +was +will +with + diff --git a/solr/conf/synonyms.txt b/solr/conf/synonyms.txt new file mode 100755 index 0000000..453eb31 --- /dev/null +++ b/solr/conf/synonyms.txt @@ -0,0 +1,31 @@ +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +#----------------------------------------------------------------------- +#some test synonym mappings unlikely to appear in real input text +aaa => aaaa +bbb => bbbb1 bbbb2 +ccc => cccc1,cccc2 +a\=>a => b\=>b +a\,a => b\,b +fooaaa,baraaa,bazaaa + +# Some synonym groups specific to this example +GB,gib,gigabyte,gigabytes +MB,mib,megabyte,megabytes +Television, Televisions, TV, TVs +#notice we use "gib" instead of "GiB" so any WordDelimiterFilter coming +#after us won't split it into two words. + +# Synonym mappings can be used for spelling correction too +pixima => pixma + diff --git a/solr/conf/xslt/example.xsl b/solr/conf/xslt/example.xsl new file mode 100755 index 0000000..ff7cae7 --- /dev/null +++ b/solr/conf/xslt/example.xsl @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + <xsl:value-of select="$title"/> + + + +

+
+ This has been formatted by the sample "example.xsl" transform - + use your own XSLT to get a nicer page +
+ + + +
+ + + +
+ + + + +
+
+
+ + + + + + + + + + + + + + javascript:toggle("");? +
+ + exp + + + + + +
+ + +
+ + + + + + + +
    + +
  • +
    +
+ + +
+ + + + + + + + + + + + + + + + + + + + +
diff --git a/solr/conf/xslt/example_atom.xsl b/solr/conf/xslt/example_atom.xsl new file mode 100755 index 0000000..dbc7afa --- /dev/null +++ b/solr/conf/xslt/example_atom.xsl @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + Example Solr Atom 1.0 Feed + + This has been formatted by the sample "example_atom.xsl" transform - + use your own XSLT to get a nicer Atom feed. + + + Apache Solr + solr-user@lucene.apache.org + + + + + + tag:localhost,2007:example + + + + + + + + + <xsl:value-of select="str[@name='name']"/> + + tag:localhost,2007: + + + + + + diff --git a/solr/conf/xslt/example_rss.xsl b/solr/conf/xslt/example_rss.xsl new file mode 100755 index 0000000..b5bd0cf --- /dev/null +++ b/solr/conf/xslt/example_rss.xsl @@ -0,0 +1,66 @@ + + + + + + + + + + + + + Example Solr RSS 2.0 Feed + http://localhost:8983/solr + + This has been formatted by the sample "example_rss.xsl" transform - + use your own XSLT to get a nicer RSS feed. + + en-us + http://localhost:8983/solr + + + + + + + + + + + <xsl:value-of select="str[@name='name']"/> + + http://localhost:8983/solr/select?q=id: + + + + + + + http://localhost:8983/solr/select?q=id: + + + + diff --git a/solr/conf/xslt/luke.xsl b/solr/conf/xslt/luke.xsl new file mode 100755 index 0000000..d3f71c6 --- /dev/null +++ b/solr/conf/xslt/luke.xsl @@ -0,0 +1,337 @@ + + + + + + + + + Solr Luke Request Handler Response + + + + + + + + + <xsl:value-of select="$title"/> + + + + + +

+ +

+
+ +
+ +

Index Statistics

+ +
+ +

Field Statistics

+ + + +

Document statistics

+ + + + +
+ + + + + +
+ +
+ + +
+ +
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + +
+

+ +

+ +
+ +
+
+
+ + +
+ + 50 + 800 + 160 + blue + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ background-color: ; width: px; height: px; +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
  • + +
  • +
    +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + + + + + + + + + + + + + + + + +
diff --git a/solr/sample_solr_documents.yml b/solr/sample_solr_documents.yml new file mode 100755 index 0000000..eee603d --- /dev/null +++ b/solr/sample_solr_documents.yml @@ -0,0 +1,2692 @@ +--- +- lc_1letter_facet: + - P - Language & Literature + author_t: + - Ayaz, Shaikh, + marc_display: "00799cam + a2200241 a 4500 00282214 DLC20090120022042.0000417s1998 pk 000 0 urdo 00282214 P-U-00282214; 05; 06DLCDLCDLCurdsndlcodePK2788.9.A9F55 + 1998Ayaz, Shaikh,1923-1997.Fikr-i Ayāz /murattibīn, Āṣif Farruk̲h̲ī, Shāh Muḥammad Pīrzādah.Karācī :Dāniyāl,[1998]375 p. ;23 cm.In Urdu.Selected poems and articles from the + works of renowned Sindhi poet; chiefly translated from Sindhi.Farruk̲h̲ī, Āṣif,1959-Pīrzādah, Shāh Muḥammad." + published_display: + - Karācī + author_display: Ayaz, Shaikh, 1923-1997 + lc_callnum_display: + - PK2788.9.A9 F55 1998 + title_t: + - Fikr-i Ayāz / + pub_date: + - '1998' + pub_date_sort: 1998 + format: Book + material_type_display: + - 375 p. + lc_b4cutter_facet: + - PK2788.9.A9 + title_display: Fikr-i Ayāz + title_sort: fikr-i ayāz + id: 00282214 + author_sort: Ayaz Shaikh 19231997 Fikri Ayāz + title_addl_t: + - Fikr-i Ayāz / + author_addl_t: + - Farruk̲h̲ī, Āṣif, + - Pīrzādah, Shāh Muḥammad. + lc_alpha_facet: + - PK + language_facet: + - Urdu + timestamp: '2014-02-03T18:42:53.056Z' +- lc_1letter_facet: + - M - Music + author_t: + - Ayaz, Shaikh, + marc_display: "00778cam + a22002417a 4500 00282371 DLC20090120021204.0000509s1986 pk 000 0 urdo 00282371 P-U-00282371; 08DLCDLCDLCurdsndlcodeMLCME 2002/02660 (D)Ayaz, Shaikh,1923-1997.Sāhivāl jail kī ḍāʼirī /Shaik̲h̲ Ayāz; tarjumah, Kiran Singh.Karācī :Maktabah-yi Dāniyāl,1986.232 p. ;23 cm.In Urdu.Translated from Sindhi.Author's memoirs during + his imprisonment in Sahiwal District jail during late 1960s.Includes bibliographical + references." + published_display: + - Karācī + author_display: Ayaz, Shaikh, 1923-1997 + lc_callnum_display: + - MLCME 2002/02660 (D) + title_t: + - Sāhivāl jail kī ḍāʼirī / + pub_date: + - '1986' + pub_date_sort: 1986 + format: Book + material_type_display: + - 232 p. + lc_b4cutter_facet: + - MLCME 2002/02660 (D) + title_display: Sāhivāl jail kī ḍāʼirī + title_sort: sāhivāl jail kī ḍāʼirī + id: 00282371 + author_sort: Ayaz Shaikh 19231997 Sāhivāl jail kī ḍāʼirī + title_addl_t: + - Sāhivāl jail kī ḍāʼirī / + language_facet: + - Urdu + timestamp: '2014-02-03T18:42:53.056Z' +- subtitle_display: 'guft va gū-yi Akbar Ganjī bā ʻAbd Allāh Nūrī : bih payvast-i + matn-i istīz̤āḥ-i ʻAbd Allāh Nūrī dar Majlis-i panjum' + author_vern_display: "‏نورى، عبد الله" + subject_addl_t: + - Interviews + - Trials, litigation, etc + - Officials and employees Interviews + - Politics and government 1997- + title_display: Naqdī barā-yi tamām-i fuṣūl + subject_era_facet: + - 1997- + id: 00313831 + isbn_t: + - '9645625963' + subject_geo_facet: + - Iran + subject_topic_facet: + - Nūrī, ʻAbd Allāh, 1949- + - Iran. Vizārat-i Kishvar + lc_alpha_facet: + - DS + title_series_t: + - Farhang-i ʻumūmī + - "‏فرهنگ عمومى" + subtitle_t: + - 'guft va gū-yi Akbar Ganjī bā ʻAbd Allāh Nūrī : bih payvast-i matn-i istīz̤āḥ-i + ʻAbd Allāh Nūrī dar Majlis-i panjum.' + - "‏گفت و گوى اکبر گنجى با عبد الله نورى : به پيوست متن استيضاح عبد الله نورى در + مجلس پنجم" + lc_1letter_facet: + - D - World History + author_t: + - Nūrī, ʻAbd Allāh, + - "‏نورى، عبد الله" + marc_display: "01988cam + a2200421 a 4500 00313831 DLC20090121100001.0010611s2000 ir b 001 0dper d 00313831 9645625963(CStRLIN)DCLN01-B3014MHMHCStRLINDLC-Rlccopycatlcodea-ir---DS318.84.N87N87 + 2000(3(4880-01Nūrī, ʻAbd Allāh,1949-880-02Naqdī barā-yi tamām-i fuṣūl :guft + va gū-yi Akbar Ganjī bā ʻAbd Allāh Nūrī : bih payvast-i matn-i istīz̤āḥ-i + ʻAbd Allāh Nūrī dar Majlis-i panjum.Critique for all seasons :Akbar Ganji's conversation with Abdullah Nuri880-03Chāp-i 1.880-04Tihrān + :Ṭarḥ-i Naw,2000.245 p. ;22 cm.880-05Farhang-i ʻumūmīIncludes bibliographical + references and index.880-06Nūrī, + ʻAbd Allāh,1949-Interviews.Iran.Vizārat-i KishvarOfficials and employeesInterviews.880-07Nūrī, + ʻAbd Allāh,1949-Trials, + litigation, etc.IranPolitics and government1997-880-08Ganjī, Akbar.100-01/(3/r‏‏نورى، عبد الله.245-02/(3/r‏‏نقدى + براى تمام فصول :‏‏گفت و گوى اکبر گنجى با عبد الله + نورى : به پيوست متن استيضاح عبد الله نورى در مجلس پنجم.250-03/(4/r‏‏چاپ 1.260-04/(3/r‏‏تهران :‏‏طرح نو،‏‏‪2000‬.440-05/(3/r‏‏فرهنگ عمومى600-06/(3/r‏‏نورى، + عبد الله.600-07/(3/r‏‏نورى، عبد الله.700-08/(3/r‏‏گنجى، اكبر." + published_display: + - Tihrān + author_display: Nūrī, ʻAbd Allāh, 1949- + title_vern_display: "‏نقدى براى تمام فصول :‏" + lc_callnum_display: + - DS318.84.N87 N87 2000 + title_t: + - 'Naqdī barā-yi tamām-i fuṣūl :' + - "‏نقدى براى تمام فصول :‏" + pub_date: + - '2000' + pub_date_sort: 2000 + published_vern_display: + - "‏تهران :‏" + format: Book + subtitle_vern_display: "‏گفت و گوى اکبر گنجى با عبد الله نورى : به پيوست متن استيضاح + عبد الله نورى در مجلس پنجم" + material_type_display: + - 245 p. + lc_b4cutter_facet: + - DS318.84.N87 + subject_t: + - Nūrī, ʻAbd Allāh, 1949- + - Iran. Vizārat-i Kishvar + - Iran + - "‏نورى، عبد الله" + title_sort: 'naqdī barā-yi tamām-i fuṣūl :guft va gū-yi akbar ganjī bā ʻabd + allāh nūrī : bih payvast-i matn-i istīz̤āḥ-i ʻabd allāh nūrī dar majlis-i + panjum' + author_sort: Nūrī ʻAbd Allāh 1949 Naqdī barāyi tamāmi fuṣūl guft va gūyi + Akbar Ganjī bā ʻAbd Allāh Nūrī bih payvasti matni istīz̤āḥi ʻAbd Allāh + Nūrī dar Majlisi panjum + title_addl_t: + - 'Naqdī barā-yi tamām-i fuṣūl : guft va gū-yi Akbar Ganjī bā ʻAbd Allāh + Nūrī : bih payvast-i matn-i istīz̤āḥ-i ʻAbd Allāh Nūrī dar Majlis-i panjum.' + - 'Critique for all seasons : Akbar Ganji''s conversation with Abdullah Nuri' + - "‏نقدى براى تمام فصول :‏ ‏گفت و گوى اکبر گنجى با عبد الله نورى : به پيوست متن + استيضاح عبد الله نورى در مجلس پنجم" + author_addl_t: + - Ganjī, Akbar. + - "‏گنجى، اكبر" + language_facet: + - Persian + timestamp: '2014-02-03T18:42:53.056Z' +- author_t: + - Yoshida, Hajime, + - "吉田一" + marc_display: "00956dam + a22002655a 4500 00314247 DLC20090126095911.0000214s1997 ja 000 0 jpn 00314247 (CStRLIN)DCLP00-B1931DLC-RDLC-RDLC$1880-01Yoshida, Hajime,1934-880-02Kubo Sakae \"Kazanbaichi\" o yomu /Yoshida + Hajime cho.880-03Tōkyō :Hōsei Daigaku Shuppankyoku,1997.480 p. ;19 cm.880-04Kubo, Sakae,1901-1958.Kazanbaichi.Japanese drama20th century.Political plays, Japanese.TheaterJapanHistory.100-01/$1吉田一,1934-245-02/$1久保栄 「火山灰地」 を読む /吉田一著.260-03/$1東京 :法政大学出版局,1997.600-04/$1久保栄,1901-1958.火山灰地." + published_display: + - Tōkyō + title_vern_display: "久保栄 「火山灰地」 を読む" + author_display: Yoshida, Hajime, 1934- + title_t: + - Kubo Sakae "Kazanbaichi" o yomu / + - "久保栄 「火山灰地」 を読む" + pub_date: + - '1997' + pub_date_sort: 1997 + published_vern_display: + - "東京" + format: Book + author_vern_display: "吉田一, 1934-" + material_type_display: + - 480 p. + title_display: Kubo Sakae "Kazanbaichi" o yomu + subject_addl_t: + - 20th century + - Japan History + subject_t: + - Kubo, Sakae, 1901-1958. Kazanbaichi + - Japanese drama + - Political plays, Japanese + - Theater + - "久保栄, 1901-1958. 火山灰地" + subject_era_facet: + - 20th century + title_sort: kubo sakae "kazanbaichi" o yomu + id: '00314247' + author_sort: Yoshida Hajime 1934 Kubo Sakae Kazanbaichi o yomu + title_addl_t: + - Kubo Sakae "Kazanbaichi" o yomu / + - "久保栄 「火山灰地」 を読む" + subject_geo_facet: + - Japan + subject_topic_facet: + - Kubo, Sakae, 1901-1958 + - Japanese drama + - Political plays, Japanese + - Theater + language_facet: + - Japanese + timestamp: '2014-02-03T18:42:53.056Z' +- lc_1letter_facet: + - D - World History + author_t: + - Vi︠a︡tkin, M. P. (Mikhail Porfirʹevich), + marc_display: "00987cam + a22002531 4500 43037890 DLC20090126171234.0810731m19419999ru b b 000 0 ruso 43037890 (OCoLC)28783996DLCICUOCoLCDLCe-ur-kzDK861.K3V5Vi︠a︡tkin, M. P.(Mikhail + Porfirʹevich),1895-1967.Ocherki po istorii Kazakhskoĭ + SSR.[Moskva],Ogiz, Gospolitizdat,1941-v.fold. map.20 cm.At head of title: Akademii︠a︡ nauk SSSR. Institut istorii + i Kazakhstanskiĭ filial. M. Vi︠a︡tkin.\"Obzor literatury i istochnikov\": + v. 1, p. 5-[19]. \"Bibliograficheskiĭ ukazatelʹ\": v. 1, p. 356-364.t. 1. S drevneĭshikh vremen + po 1870 g.KazakhstanHistory.Institut istorii (Akademii︠a︡ + nauk SSSR)Akademii︠a︡ nauk Kazakhskoĭ SSR, Alma Ata." + published_display: + - Moskva + author_display: Vi︠a︡tkin, M. P. (Mikhail Porfirʹevich), 1895-1967 + lc_callnum_display: + - DK861.K3 V5 + title_t: + - Ocherki po istorii Kazakhskoĭ SSR. + pub_date: + - '1941' + pub_date_sort: 1941 + format: Book + material_type_display: + - v. + lc_b4cutter_facet: + - DK861.K3 + title_display: Ocherki po istorii Kazakhskoĭ SSR + subject_addl_t: + - History + subject_t: + - Kazakhstan + title_sort: ocherki po istorii kazakhskoĭ ssr + id: '43037890' + author_sort: Vi︠a︡tkin M P Mikhail Porfirʹevich 18951967 Ocherki po istorii Kazakhskoĭ + SSR + title_addl_t: + - Ocherki po istorii Kazakhskoĭ SSR. + subject_geo_facet: + - Kazakhstan + author_addl_t: + - Institut istorii (Akademii︠a︡ nauk SSSR) + - Akademii︠a︡ nauk Kazakhskoĭ SSR, Alma Ata. + lc_alpha_facet: + - DK + language_facet: + - Russian + timestamp: '2014-02-03T18:42:53.056Z' +- lc_1letter_facet: + - K - Law + author_t: + - Korea (North) + marc_display: "00955cam + a22002411 4500 53029833 DLC20090126171326.0860911s1952 ru f000 0 rus 53029833 (OCoLC)14207259DLCCUCUDLCpremarca-kn---KPC131952Korea (North)Laws, etc. (Konstitut︠s︡ii︠a︡ i osnovnye + zakonodatelʹnye akty Koreĭskoĭ Narodno-Demokraticheskoĭ Respubliki)Konstitut︠s︡ii︠a︡ i osnovnye + zakonodatelʹnye akty Koreĭskoĭ Narodno-Demokraticheskoĭ Respubliki.Perevod s koreĭskogo I︠U︡.N. Mazura i Khan Dyk Pona. Pod red. i s + vstup. statʹeĭ G. Tavrova.Moskva,Izd-vo + inostrannoĭ lit-ry,1952.396 p.21 cm.Zakonodatelʹstvo stran narodnoĭ demokratiiMazur, I︠U︡. N.Korea (North)Constitution." + published_display: + - Moskva + author_display: Korea (North) + lc_callnum_display: + - KPC13 1952 + title_t: + - Konstitut︠s︡ii︠a︡ i osnovnye zakonodatelʹnye akty Koreĭskoĭ Narodno-Demokraticheskoĭ + Respubliki. + pub_date: + - '1952' + pub_date_sort: 1952 + format: Book + material_type_display: + - 396 p. + lc_b4cutter_facet: + - KPC13 + title_display: Konstitut︠s︡ii︠a︡ i osnovnye zakonodatelʹnye akty Koreĭskoĭ Narodno-Demokraticheskoĭ + Respubliki + title_sort: konstitut︠s︡ii︠a︡ i osnovnye zakonodatelʹnye akty koreĭskoĭ narodno-demokraticheskoĭ + respubliki + id: '53029833' + author_sort: Korea North Laws etc Konstitut︠s︡ii︠a︡ i osnovnye zakonodatelʹnye akty + Koreĭskoĭ NarodnoDemokraticheskoĭ Respubliki Konstitut︠s︡ii︠a︡ i osnovnye zakonodatelʹnye + akty Koreĭskoĭ NarodnoDemokraticheskoĭ Respubliki + title_addl_t: + - Konstitut︠s︡ii︠a︡ i osnovnye zakonodatelʹnye akty Koreĭskoĭ Narodno-Demokraticheskoĭ + Respubliki. + - Laws, etc. (Konstitut︠s︡ii︠a︡ i osnovnye zakonodatelʹnye akty Koreĭskoĭ Narodno-Demokraticheskoĭ + Respubliki) + author_addl_t: + - Mazur, I︠U︡. N. + - Korea (North) + title_added_entry_t: + - Constitution + title_series_t: + - Zakonodatelʹstvo stran narodnoĭ demokratii + lc_alpha_facet: + - KPC + language_facet: + - Russian + timestamp: '2014-02-03T18:42:53.056Z' +- lc_1letter_facet: + - D - World History + marc_display: "01062cam + a2200301 a 4500 77826928 DLC20090122103906.0070816s1976 ko 000 0ckor 77826928 (CStRLIN)DCLP07-B11425DLC*BZV*MH-HYOCoLCCUCStRLINDLC-RDLCa-kr---DS912.38.K982 + 1976$1880-01Koryŏsa.Yŏlchŏn.Selections.880-02Koryŏ inmul yŏlchŏn /Yi Min-su pʻyŏnyŏk.880-03Sŏul :Sŏmundang,1976.255 p. ;19 cm.880-04Sŏmun munʼgo ;237KoreaHistoryKoryŏ period, 935-1392Biography.KoreaBiography.880-05Yi, Min-su,1916-130-01/$1高麗史.列傅.Selections.245-02/$1高麗 人物 列傅 /李 民樹 編譯.260-03/$1서울 :瑞文堂,1976.490-04/$1瑞文 文庫 ;237700-05/$1李 民樹,1916-" + published_display: + - Sŏul + title_vern_display: "高麗 人物 列傅" + lc_callnum_display: + - DS912.38 .K982 1976 + title_t: + - Koryŏ inmul yŏlchŏn / + - "高麗 人物 列傅" + pub_date: + - '1976' + pub_date_sort: 1976 + published_vern_display: + - "서울" + format: Book + material_type_display: + - 255 p. + lc_b4cutter_facet: + - DS912.38 + title_display: Koryŏ inmul yŏlchŏn + subject_addl_t: + - History Koryŏ period, 935-1392 Biography + - Biography + subject_t: + - Korea + subject_era_facet: + - Koryŏ period, 935-1392 + title_sort: koryŏ inmul yŏlchŏn + id: '77826928' + author_sort: "\U0010FFFF Koryŏ inmul yŏlchŏn" + title_addl_t: + - Koryŏ inmul yŏlchŏn / + - Koryŏsa. Yŏlchŏn. Selections + - "高麗 人物 列傅" + - "高麗史. 列傅. Selections" + subject_geo_facet: + - Korea + author_addl_t: + - Yi, Min-su, + - "李 民樹" + title_series_t: + - Sŏmun munʼgo ; 237 + - "瑞文 文庫 ; 237" + lc_alpha_facet: + - DS + language_facet: + - Korean + timestamp: '2014-02-03T18:42:53.056Z' +- lc_1letter_facet: + - P - Language & Literature + author_t: + - Parikshit Sharma, Ogeti, + marc_display: "00813cam + a2200217 i 4500 78908283 DLC20090121104206.0790619s1976 ii 000 0 sano 78908283 DLCDLCDLCPK3799.P29Y3Parikshit Sharma, Ogeti,1930-Yaśodharā-mahākāvyam + /Ogeṭi Parīkṣitśarmā.Puṇyapattanam :Śāradā-Gaurava-Grantha-Mālā ;Haidrābāda + :prāptisthalam O. Acyutarāmaśāstrī,1976.24, 128, 2 p. ;22 cm.Śāradā-gaurava-grantha-mālā + ; 37In Sanskrit; introductory matter in English or Sanskrit.A poem.Gautama BuddhaPoetry.Yaśodharā(Wife of Gautama Buddha)Poetry." + published_display: + - Puṇyapattanam + - Haidrābāda + author_display: Parikshit Sharma, Ogeti, 1930- + lc_callnum_display: + - PK3799.P29 Y3 + title_t: + - Yaśodharā-mahākāvyam / + pub_date: + - '1976' + pub_date_sort: 1976 + format: Book + material_type_display: + - 24, 128, 2 p. + lc_b4cutter_facet: + - PK3799.P29 + title_display: Yaśodharā-mahākāvyam + subject_addl_t: + - Poetry + subject_t: + - Gautama Buddha + - Yaśodharā (Wife of Gautama Buddha) + title_sort: yaśodharā-mahākāvyam + id: '78908283' + author_sort: Parikshit Sharma Ogeti 1930 Yaśodharāmahākāvyam + title_addl_t: + - Yaśodharā-mahākāvyam / + subject_topic_facet: + - Gautama Buddha + - Yaśodharā (Wife of Gautama Buddha) + title_series_t: + - Śāradā-gaurava-grantha-mālā ; 37 + lc_alpha_facet: + - PK + language_facet: + - Sanskrit + timestamp: '2014-02-03T18:42:53.056Z' +- lc_1letter_facet: + - H - Social Sciences + author_t: + - Iṣlāḥī, Amīn Aḥsan, + marc_display: "00729cam + a2200229 i 4500 79930185 DLC20090123080110.0791203r19781950pk 000 0 urdo 79930185 Rs10.00DLCDLCDLCa-pk---HQ1745.5.I83 1978Iṣlāḥī, Amīn Aḥsan,1904-1997.Pākistānī ʻaurat dorāhe + par /tālīf Amīn Aḥsan Iṣlāḥī.Lāhaur :Maktabah-yi Markazī Anjuman-i K̲h̲uddāmulqurʼān,1978.8, 174 p. ;22 cm.In Urdu.First published in 1950.WomenPakistan.WomenPakistanSocial + conditions." + published_display: + - Lāhaur + author_display: Iṣlāḥī, Amīn Aḥsan, 1904-1997 + lc_callnum_display: + - HQ1745.5 .I83 1978 + title_t: + - Pākistānī ʻaurat dorāhe par / + pub_date: + - '1978' + pub_date_sort: 1978 + format: Book + material_type_display: + - 8, 174 p. + lc_b4cutter_facet: + - HQ1745.5 + title_display: Pākistānī ʻaurat dorāhe par + subject_addl_t: + - Pakistan + - Pakistan Social conditions + subject_t: + - Women + title_sort: pākistānī ʻaurat dorāhe par + id: '79930185' + author_sort: Iṣlāḥī Amīn Aḥsan 19041997 Pākistānī ʻaurat dorāhe par + title_addl_t: + - Pākistānī ʻaurat dorāhe par / + subject_geo_facet: + - Pakistan + subject_topic_facet: + - Women + lc_alpha_facet: + - HQ + language_facet: + - Urdu + timestamp: '2014-02-03T18:42:53.056Z' +- lc_1letter_facet: + - M - Music + author_t: + - Nārāyaṇapaṇḍita, + marc_display: "01012cam + a22002657a 4500 85910001 DLC20090121023106.0heuamb---bacaheubmb---baaa860321r19851946dcu bb s001 0 sano 85910001 LC San A 616DLCDLCDLCMicrofiche 90/61328 (P)Nārāyaṇapaṇḍita,17th cent.Āśleṣāśataka of Nārāyaṇa Paṇḍita[microform].Trivandrum :University + MSS. Library, University of Travancore,1946.xii, 24 p. ;24 cm.Poem.In Sanskrit; introd. in English.\"Reprint from the Journal + of the Travancore University Oriental Manuscripts Library, no. 7.\"Includes bibliographical + references and index.Master microform held by: DLC.Microfiche.Washington, D.C. :Library of Congress + Photoduplication Service,1985.1 microfiche ; 11 x 15 cm." + published_display: + - Trivandrum + author_display: Nārāyaṇapaṇḍita, 17th cent + lc_callnum_display: + - Microfiche 90/61328 (P) + title_t: + - Āśleṣāśataka of Nārāyaṇa Paṇḍita + pub_date: + - '1946' + pub_date_sort: 1946 + format: Book + material_type_display: + - xii, 24 p. + lc_b4cutter_facet: + - Microfiche 90/61328 (P) + title_display: Āśleṣāśataka of Nārāyaṇa Paṇḍita + title_sort: āśleṣāśataka of nārāyaṇa paṇḍita + id: '85910001' + author_sort: Nārāyaṇapaṇḍita 17th cent Āśleṣāśataka of Nārāyaṇa Paṇḍita + microform + title_addl_t: + - Āśleṣāśataka of Nārāyaṇa Paṇḍita + language_facet: + - Sanskrit + timestamp: '2014-02-03T18:42:53.056Z' +- subtitle_display: sipurim mafliʼim ha-mevusasim ʻal ʻuvdot hisṭoriyot + author_vern_display: "‏פינקל, חיים יעקב" + subject_addl_t: + - Anecdotes + title_display: Shodede-yam Yehudiyim + id: '86207417' + isbn_t: + - '9650101373' + subject_topic_facet: + - Jewish pirates + - Jewish criminals + lc_alpha_facet: + - G + subtitle_t: + - sipurim mafliʼim ha-mevusasim ʻal ʻuvdot hisṭoriyot / + - "‏ספורים מפליאים המבוססים על עובדות היסטוריות /‏" + author_t: + - Finkel, Chaim Jacob. + - "‏פינקל, חיים יעקב" + lc_1letter_facet: + - G - Geography, Anthropology, Recreation + marc_display: "01258cam + a2200301 a 4500 86207417 DLC20090123161900.0930810s1984 is a 000 0 heb 86207417 9650101373(CStRLIN)DCLH93-B1897DLC-RDLC-RhebengG535.F54 1984(2880-01Finkel, + Chaim Jacob.Jewish pirates.Hebrew880-02Shodede-yam Yehudiyim :sipurim mafliʼim + ha-mevusasim ʻal ʻuvdot hisṭoriyot /Ḥayim Yaʻaḳov + Finḳel ; me-Anglit, Ofirah Rahaṭ.880-03Yerushalayim + :Devir,c1984.283 p. :ill. ;22 cm.Title on t.p. verso: Jewish + pirates.Jewish piratesAnecdotes.Jewish criminalsAnecdotes.Jewish pirates.100-01/(2/r‏‏פינקל, חיים יעקב.245-02/(2/r‏‏שודדי־ים + יהודיים :‏‏ספורים מפליאים המבוססים על עובדות היסטוריות + /‏‏חיים יעקב פינקל ; מאנגלית, אופירה רהט.260-03/(2/r‏‏ירושלים :‏‏דביר,‏‏‪c1984‬." + published_display: + - Yerushalayim + author_display: Finkel, Chaim Jacob + title_vern_display: "‏שודדי־ים יהודיים :‏" + lc_callnum_display: + - G535 .F54 1984 + title_t: + - 'Shodede-yam Yehudiyim :' + - "‏שודדי־ים יהודיים :‏" + pub_date: + - '1984' + pub_date_sort: 1984 + published_vern_display: + - "‏ירושלים :‏" + format: Book + subtitle_vern_display: "‏ספורים מפליאים המבוססים על עובדות היסטוריות /‏" + lc_b4cutter_facet: + - G535 + material_type_display: + - 283 p. + subject_t: + - Jewish pirates + - Jewish criminals + title_sort: shodede-yam yehudiyim :sipurim mafliʼim ha-mevusasim ʻal ʻuvdot hisṭoriyot + author_sort: Finkel Chaim Jacob Jewish pirates Hebrew Shodedeyam Yehudiyim sipurim + mafliʼim hamevusasim ʻal ʻuvdot hisṭoriyot + title_addl_t: + - 'Shodede-yam Yehudiyim : sipurim mafliʼim ha-mevusasim ʻal ʻuvdot hisṭoriyot + /' + - Jewish pirates. Hebrew + - "‏שודדי־ים יהודיים :‏ ‏ספורים מפליאים המבוססים על עובדות היסטוריות /‏" + title_added_entry_t: + - Jewish pirates. + language_facet: + - Hebrew + timestamp: '2014-02-03T18:42:53.056Z' +- lc_1letter_facet: + - B - Philosophy, Psychology, Religion + author_t: + - Muvaḥḥid Abṭaḥī, Ḥujjat. + - "‏موحد ابطحى، خجة" + marc_display: "01657cam + a2200337 a 4500 87931798 DLC20090121115059.0060428m19869999ir ah b 000 0 per d 87931798 (CStRLIN)DCLN06-B3656NjPNjPUkLSOADLC-Rlccopycata------f------BP44.M88 1986(3(4880-01Muvaḥḥid Abṭaḥī, + Ḥujjat.880-02Āshnāʼī bā ḥawzahʹhā-yi + ʻilmīyah-ʼi Shīʻah dar ṭūl-i tārīkh /bih + qalam-i Ḥujjat Muvaḥḥid Abṭaḥī.880-03Āshnāyī + bā ḥawzahʹhā-yi ʻilmīyah-ʼi Shīʻah dar ṭūl-i tārīkh880-04Ḥawzahʹhā-yi ʻilmīyah-ʼi Shīʻah880-05Iṣfahān :Ḥawzah-i ʻIlmīyah,1365- [1986- ]v. <1> :ill. (some col.), facsims. ;25 cm.Bibliography: v. 1, p.451-455.Religious institutionsIslamic countries.ShiitesEducationIslamic countries.Islamic universities and colleges.100-01/(3/r‏‏موحد ابطحى، خجة.245-02/(3/r‏‏اشنائى + با حوزه‌هاى علميۀ شيعه در طول تاريخ /‏‏بقلم حجة + موحد ابطحى.246-03/(3/r‏‏اشنايى با حوزه‌هاى علميۀ + شيعه در طول تاريخ246-04/(3/r‏‏حوزه هاى علميۀ شيعه260-05/(3/r‏‏اصفهان :‏‏حوزۀ علميه،‏‏‪1365- [1986- ]‬." + published_display: + - Iṣfahān + title_vern_display: "‏اشنائى با حوزه‌هاى علميۀ شيعه در طول تاريخ /‏" + author_display: Muvaḥḥid Abṭaḥī, Ḥujjat + lc_callnum_display: + - BP44 .M88 1986 + title_t: + - Āshnāʼī bā ḥawzahʹhā-yi ʻilmīyah-ʼi Shīʻah dar ṭūl-i tārīkh / + - "‏اشنائى با حوزه‌هاى علميۀ شيعه در طول تاريخ /‏" + pub_date: + - '1986' + pub_date_sort: 1986 + published_vern_display: + - "‏اصفهان :‏" + format: Book + author_vern_display: "‏موحد ابطحى، خجة" + material_type_display: + - v. <1> + lc_b4cutter_facet: + - BP44 + title_display: Āshnāʼī bā ḥawzahʹhā-yi ʻilmīyah-ʼi Shīʻah dar ṭūl-i tārīkh + subject_addl_t: + - Islamic countries + - Education Islamic countries + subject_t: + - Religious institutions + - Shiites + - Islamic universities and colleges + title_sort: āshnāʼī bā ḥawzahʹhā-yi ʻilmīyah-ʼi shīʻah dar ṭūl-i tārīkh + id: '87931798' + author_sort: Muvaḥḥid Abṭaḥī Ḥujjat Āshnāʼī bā ḥawzahʹhāyi ʻilmīyahʼi + Shīʻah dar ṭūli tārīkh + title_addl_t: + - Āshnāʼī bā ḥawzahʹhā-yi ʻilmīyah-ʼi Shīʻah dar ṭūl-i tārīkh / + - Āshnāyī bā ḥawzahʹhā-yi ʻilmīyah-ʼi Shīʻah dar ṭūl-i tārīkh + - Ḥawzahʹhā-yi ʻilmīyah-ʼi Shīʻah + - "‏اشنائى با حوزه‌هاى علميۀ شيعه در طول تاريخ /‏" + - "‏اشنايى با حوزه‌هاى علميۀ شيعه در طول تاريخ" + - "‏حوزه هاى علميۀ شيعه" + subject_geo_facet: + - Islamic countries + subject_topic_facet: + - Religious institutions + - Shiites + - Islamic universities and colleges + lc_alpha_facet: + - BP + language_facet: + - Persian + timestamp: '2014-02-03T18:42:53.056Z' +- lc_1letter_facet: + - M - Music + author_t: + - Lomtʻatʻiże, Čola, + marc_display: "00610cam + a22001817a 4500 90142413 DLC20090126150928.0900409s1975 gs 000 0 geo 90142413 DLCDLCMLCSN 96/3906 (H)Lomtʻatʻiże, Čola,1879-1915.Mrecvelobis mušakis cʻxovrebis + cesi :tʻeoriul-metʻoduri narkvevi /Čola Lomtʻatʻiże.Title in colophon:Obraz + zhizni rabotnika promyshlennostiTʻbilisi :Mecʻniereba,1975.65 p. ;22 cm.Industrial workers;life style" + published_display: + - Tʻbilisi + author_display: Lomtʻatʻiże, Čola, 1879-1915 + lc_callnum_display: + - MLCSN 96/3906 (H) + title_t: + - 'Mrecvelobis mušakis cʻxovrebis cesi :' + pub_date: + - '1975' + pub_date_sort: 1975 + subtitle_display: tʻeoriul-metʻoduri narkvevi + format: Book + material_type_display: + - 65 p. + lc_b4cutter_facet: + - MLCSN 96/3906 (H) + title_display: Mrecvelobis mušakis cʻxovrebis cesi + subject_t: + - Industrial workers; life style + title_sort: mrecvelobis mušakis cʻxovrebis cesi :tʻeoriul-metʻoduri narkvevi + id: '90142413' + author_sort: Lomtʻatʻiże Čola 18791915 Mrecvelobis mušakis cʻxovrebis cesi tʻeoriulmetʻoduri + narkvevi + title_addl_t: + - 'Mrecvelobis mušakis cʻxovrebis cesi : tʻeoriul-metʻoduri narkvevi /' + - Obraz zhizni rabotnika promyshlennosti + subject_topic_facet: + - Industrial workers; life style + language_facet: + - Georgian + subtitle_t: + - tʻeoriul-metʻoduri narkvevi / + timestamp: '2014-02-03T18:42:53.056Z' +- lc_1letter_facet: + - K - Law + author_t: + - Korea (North) + marc_display: "01106cam + a2200325 a 4500 92117465 DLC20090126171556.0920805s1990 ko l 000 0 kor 92117465 W300000 (set)(CStRLIN)DCLP92-B14190DLC-RDLC-Ra-kn---KPC13.K67 1990$1Korea (North)Laws, etc.880-01Pukhan pŏmnyŏngjip /chʻaegim pʻyŏnjip + Chŏng Kyŏng-mo, Chʻoe Tal-gon.880-02Chaepʻan.880-03Sŏul Tʻŭkpyŏlsi :Taeryuk Yŏnʼguso,1990.5 v. ;27 cm.LawKorea (North)880-04Chŏng, + Kyŏng-mo,1937-880-05Chʻoe, Tal-gon.245-01/$1北韓 法令集 /責任 編輯 鄭 慶謨, 崔 逹坤.250-02/$1再版.260-03/$1서울 持別市 :大陸 研究所,1990.700-04/$1鄭 慶謨,1937-700-05/$1崔 逹坤." + published_display: + - Sŏul Tʻŭkpyŏlsi + title_vern_display: "北韓 法令集 /" + author_display: Korea (North) + lc_callnum_display: + - KPC13 .K67 1990 + title_t: + - Pukhan pŏmnyŏngjip / + - "北韓 法令集 /" + pub_date: + - '1990' + pub_date_sort: 1990 + published_vern_display: + - "서울 持別市 :" + format: Book + material_type_display: + - 5 v. + lc_b4cutter_facet: + - KPC13 + title_display: Pukhan pŏmnyŏngjip + subject_addl_t: + - Korea (North) + subject_t: + - Law + title_sort: pukhan pŏmnyŏngjip + id: '92117465' + author_sort: Korea North Laws etc Pukhan pŏmnyŏngjip + title_addl_t: + - Pukhan pŏmnyŏngjip / + - Laws, etc + - "北韓 法令集 /" + subject_geo_facet: + - Korea (North) + subject_topic_facet: + - Law + author_addl_t: + - Chŏng, Kyŏng-mo, + - Chʻoe, Tal-gon. + - "鄭 慶謨," + - "崔 逹坤." + lc_alpha_facet: + - KPC + language_facet: + - Korean + timestamp: '2014-02-03T18:42:53.056Z' +- subtitle_display: ṿe-hu perush yafeh u-menupeh ʻal Shulḥan ʻarukh Oraḥ ḥayim + asher ḥiber Yosef Ḳaro ... ʻim ḥidushe dinim she-hishmiṭ ha-gaʼon ... ṿe-himtsiʼam + ... Mosheh Iserlish + author_vern_display: "‏ישראל מאיר,‏ ‏הכהן" + subject_addl_t: + - Customs and practices + title_display: Sefer Mishnah berurah + id: '92828023' + subject_topic_facet: + - Karo, Joseph ben Ephraim, 1488-1575 + - Jewish law + - Judaism + lc_alpha_facet: + - BM + subtitle_t: + - ṿe-hu perush yafeh u-menupeh ʻal Shulḥan ʻarukh Oraḥ ḥayim asher ḥiber Yosef + Ḳaro ... ʻim ḥidushe dinim she-hishmiṭ ha-gaʼon ... ṿe-himtsiʼam ... Mosheh + Iserlish / + - "‏והוא פירוש יפה ומנפה על שלחן ערוך ארח חיים אשר חבר יוסף קארו ... עם חידושי דינים + שהשמיט הגאון ... והמציאם משה איסרליש /‏" + author_t: + - Israel Meir, ha-Kohen, + - "‏ישראל מאיר,‏ ‏הכהן" + lc_1letter_facet: + - B - Philosophy, Psychology, Religion + marc_display: "03361cam + a2200493 a 4500 92828023 DLC20090122150744.0921008m19929999is 000 0 heb 92828023 (CStRLIN)DCLH92-B2385DLC-RDLC-RDLC-RDLCBM520.88.A53I88 1992b(2880-01Israel Meir,ha-Kohen,1838-1933.880-02Mishnah berurah880-03Sefer Mishnah + berurah :ṿe-hu perush yafeh u-menupeh ʻal Shulḥan + ʻarukh Oraḥ ḥayim asher ḥiber Yosef Ḳaro ... ʻim ḥidushe dinim she-hishmiṭ + ha-gaʼon ... ṿe-himtsiʼam ... Mosheh Iserlish /kol + eleh ḥibarti [z.o. asafti ṿe-ʻarakhti] Yiśraʼel Meʼir b.R. Aryeh Zeʼev ha-Kohen.880-04Hotsaʼah ḥadashah, menuḳedet u-mefuseḳet uve-fiʻnuaḥ rashe-tevot + uve-hagahah meduḳdeḳet.880-05[Jerusalem? + :ḥ. mo. l. ],752-<[768]> + [1992-<2007 or 2008>](Yerushalayim :Nidpas ʻa. y. Makhon le-hotsaʼat sefarim ʻA. L.B.)v. <1-5> ;29 cm.Title on cover <v. 2-3, 5>: Sefer Mishnah berurah + ha-menuḳad.Vol. 4- has ed. statement: Mahadura meyuḥedet ʻim hagahot ṿe-heʻarot + \"Ish matsliaḥ\" la-Sefaradim ṿa-ʻadot ha-Mizraḥ.Vol. 4- published: Bene + Beraḳ : \"Mekhon ha-Rav Matsliaḥ\" she-ʻa. y. Mosdot Yeshivat \"Kise Raḥamim\" + Sefaradit.Includes text of Shulḥan ʻarukh, Oraḥ ḥayim.Includes Beʼer ha-Golah + by Mosheh Ravḳash, Baʼer heṭev by Judah ben Simon Ashkenazi, Shaʻare teshuvah + by Ḥayim Mordekhai Margaliyot.Karo, Joseph ben Ephraim,1488-1575.Oraḥ ḥayim.Jewish law.JudaismCustoms and practices.880-06Isserles, + Moses ben Israel,ca. 1525-1572.880-07Karo, Joseph ben Ephraim,1488-1575.Oraḥ ḥayim.880-08Mishnah + berurah.880-09Sefer Mishnah berurah ha-menuḳad.880-10Ish matsliaḥ.100-01/(2/r‏‏ישראל + מאיר,‏‏הכהן.240-02/(2/r‏‏משנה ברורה245-03/(2/r‏‏ספר + משנה ברורה :‏‏והוא פירוש יפה ומנפה על שלחן ערוך + ארח חיים אשר חבר יוסף קארו ... עם חידושי דינים שהשמיט הגאון ... והמציאם משה איסרליש + /‏‏כל אלה חיברתי [ז״א אספתי וערכתי] ישראל מאיר + בר׳ אריה זאב הכהן.250-04/(2/r‏‏הוצאה חדשה, + מנקדת ומפסקת ובפענוח ראשי־תבות ובהגהה מדקדקת.260-05/(2/r‏‏[Jerusalem? :‏‏חמו״ל,‏‏‪752-<[768]> [1992-<2007 or 2008>]‏‏(ירושלים :‏‏נדפס ע״י מכון להוצאת ספרים + ע.ל.ב.)‬630-00/(2/r‏‏שלחן ערוך.‏‏ארח חיים.700-06/(2/r‏‏איסרליש, + משה.700-07/(2/r‏‏קארו, יוסף.‏‏אורח חיים.740-08/(2/r‏‏משנה + ברורה.740-09/(2/r‏‏ספר משנה ברורה המנקד.740-10/(2/rאיש מצליח." + published_display: + - Jerusalem? + author_display: Israel Meir, ha-Kohen, 1838-1933 + title_vern_display: "‏ספר משנה ברורה :‏" + lc_callnum_display: + - BM520.88.A53 I88 1992b + title_t: + - 'Sefer Mishnah berurah :' + - "‏ספר משנה ברורה :‏" + pub_date: + - '1992' + pub_date_sort: 1992 + published_vern_display: + - "‏[Jerusalem? :‏" + format: Book + subtitle_vern_display: "‏והוא פירוש יפה ומנפה על שלחן ערוך ארח חיים אשר חבר יוסף + קארו ... עם חידושי דינים שהשמיט הגאון ... והמציאם משה איסרליש /‏" + lc_b4cutter_facet: + - BM520.88.A53 + material_type_display: + - v. <1-5> + subject_t: + - Karo, Joseph ben Ephraim, 1488-1575. Oraḥ ḥayim + - Jewish law + - Judaism + - "‏שלחן ערוך.‏ ‏ארח חיים" + title_sort: sefer mishnah berurah :ṿe-hu perush yafeh u-menupeh ʻal shulḥan ʻarukh + oraḥ ḥayim asher ḥiber yosef ḳaro ... ʻim ḥidushe dinim she-hishmiṭ ha-gaʼon + ... ṿe-himtsiʼam ... mosheh iserlish + author_sort: Israel Meir haKohen 18381933 Mishnah berurah Sefer Mishnah berurah + ṿehu perush yafeh umenupeh ʻal Shulḥan ʻarukh Oraḥ ḥayim asher ḥiber Yosef + Ḳaro ʻim ḥidushe dinim shehishmiṭ hagaʼon ṿehimtsiʼam Mosheh Iserlish + title_addl_t: + - 'Sefer Mishnah berurah : ṿe-hu perush yafeh u-menupeh ʻal Shulḥan ʻarukh Oraḥ + ḥayim asher ḥiber Yosef Ḳaro ... ʻim ḥidushe dinim she-hishmiṭ ha-gaʼon ... + ṿe-himtsiʼam ... Mosheh Iserlish /' + - Mishnah berurah + - "‏ספר משנה ברורה :‏ ‏והוא פירוש יפה ומנפה על שלחן ערוך ארח חיים אשר חבר יוסף קארו + ... עם חידושי דינים שהשמיט הגאון ... והמציאם משה איסרליש /‏" + - "‏משנה ברורה" + author_addl_t: + - Isserles, Moses ben Israel, + - Karo, Joseph ben Ephraim, + - "‏איסרליש, משה" + - "‏קארו, יוסף.‏" + title_added_entry_t: + - Oraḥ ḥayim + - Mishnah berurah. + - Sefer Mishnah berurah ha-menuḳad. + - Ish matsliaḥ. + - "‏אורח חיים" + - "‏משנה ברורה" + - "‏ספר משנה ברורה המנקד" + - "איש מצליח" + language_facet: + - Hebrew + timestamp: '2014-02-03T18:42:53.056Z' +- subtitle_display: 'kangnam yŏin kwa sin pʻalbulchʻul : Kim Hong-sin setʻae rŭpʻo' + author_vern_display: "김 홍신, 1947-" + subject_addl_t: + - Korea (South) Social conditions + - Social conditions + title_display: Ajikto kŭrŏk chŏrŏk sasimnikka + id: '94120425' + subject_geo_facet: + - Seoul (Korea) + - Korea (South) + subject_topic_facet: + - Women + lc_alpha_facet: + - HQ + subtitle_t: + - 'kangnam yŏin kwa sin pʻalbulchʻul : Kim Hong-sin setʻae rŭpʻo.' + - "강남 여인 과 신 팔불출 : 金 洪信 세태 르포" + author_t: + - Kim, Hong-sin, + - "김 홍신" + lc_1letter_facet: + - H - Social Sciences + marc_display: "01149cam + a2200301 a 4500 94120425 DLC20090123075708.0940328s1990 ko 000 0 kor d 94120425 W3800(CStRLIN)DCLP94-B5791CLASIACLASIADLCCStRLINDLC-Rlccopycata-ko---HQ1765.5.K46 1990$1880-01Kim, Hong-sin,1947-880-02Ajikto kŭrŏk chŏrŏk sasimnikka + :kangnam yŏin kwa sin pʻalbulchʻul : Kim Hong-sin + setʻae rŭpʻo.880-03Chʻopʻan.880-04Sŏul :Yŏwŏn Chʻulpʻanʼguk,1990(1992 printing)289 p. ;22 cm.WomenKorea (South)Social conditions.Seoul (Korea)Social + conditions.100-01/$1김 홍신,1947-245-02/$1아직도 그럭 저럭 사십니까 :강남 여인 과 신 팔불출 : 金 洪信 세태 르포.250-03/$1초판.260-04/$1서울 :女苑 出版局,1990(1992 printing)" + published_display: + - Sŏul + author_display: Kim, Hong-sin, 1947- + title_vern_display: "아직도 그럭 저럭 사십니까" + lc_callnum_display: + - HQ1765.5 .K46 1990 + title_t: + - 'Ajikto kŭrŏk chŏrŏk sasimnikka :' + - "아직도 그럭 저럭 사십니까" + pub_date: + - '1990' + pub_date_sort: 1990 + published_vern_display: + - "서울" + format: Book + subtitle_vern_display: "강남 여인 과 신 팔불출 : 金 洪信 세태 르포" + lc_b4cutter_facet: + - HQ1765.5 + material_type_display: + - 289 p. + subject_t: + - Women + - Seoul (Korea) + title_sort: 'ajikto kŭrŏk chŏrŏk sasimnikka :kangnam yŏin kwa sin pʻalbulchʻul + : kim hong-sin setʻae rŭpʻo' + author_sort: Kim Hongsin 1947 Ajikto kŭrŏk chŏrŏk sasimnikka kangnam yŏin kwa + sin pʻalbulchʻul Kim Hongsin setʻae rŭpʻo + title_addl_t: + - 'Ajikto kŭrŏk chŏrŏk sasimnikka : kangnam yŏin kwa sin pʻalbulchʻul : Kim + Hong-sin setʻae rŭpʻo.' + - "아직도 그럭 저럭 사십니까 : 강남 여인 과 신 팔불출 : 金 洪信 세태 르포" + language_facet: + - Korean + timestamp: '2014-02-03T18:42:53.056Z' +- subtitle_display: dar khiradvarzī-i siyāsī va huvīyat-i mā Īrānīyān + author_vern_display: "‏رجايى، فرهنگ ." + subject_addl_t: + - Iran + - Ethnic identity + - Politics and government + - Civilization + title_display: Maʻrakah-ʼi jahānʹbīnīʹhā + id: '96933325' + subject_geo_facet: + - Iran + subject_topic_facet: + - Political science + - Iranians + lc_alpha_facet: + - DS + title_series_t: + - Sipihr-i farhang va jāmiʻah ; 1 + - "‏سپهر فرهنگ و جامعه ؛‏ ‏1" + subtitle_t: + - dar khiradvarzī-i siyāsī va huvīyat-i mā Īrānīyān / + - "‏در خردورزى سياسى و هويت ما ايرانيان /‏" + author_t: + - Rajāyī, Farhang, + - "‏رجايى، فرهنگ ." + lc_1letter_facet: + - D - World History + marc_display: "01484cam + a2200349 a 4500 96933325 DLC20090121112252.0040115s1994 ir b 001 0 per 96933325 (CStRLIN)DCLN04-B274DLC-RDLC-Rlcodea-ir---DS274.R327 + 1994(3(4880-01Rajāyī, Farhang,1952 or 3-880-02Maʻrakah-ʼi jahānʹbīnīʹhā :dar + khiradvarzī-i siyāsī va huvīyat-i mā Īrānīyān /Farhang + Rajāʼī.880-03Chāp-i 1.880-04Tihrān :Iḥyā-yi Kitāb,1373 [1994 or 1995]323 p. ;22 + cm.880-05Sipihr-i farhang va jāmiʻah + ;1Includes bibliographical references + (p.287-320) and index.IranPolitics and + government.Political scienceIran.IraniansEthnic identity.IranCivilization.100-01/(4/r‏‏رجايى، فرهنگ .245-02/(3/r‏‏معركۀ + جهان‌بينىها :‏‏در خردورزى سياسى و هويت ما ايرانيان + /‏‏فرهنگ رجائى.250-03/(4/r‏‏چاپ 1.260-04/(3/r‏‏تهران :‏‏احياء كتاب،‏‏‪1373 [1994 or 1995]‬.440-05/(3/r‏‏سپهر فرهنگ و جامعه ؛‏‏1" + published_display: + - Tihrān + author_display: Rajāyī, Farhang, 1952 or 3- + title_vern_display: "‏معركۀ جهان‌بينىها :‏" + lc_callnum_display: + - DS274 .R327 1994 + title_t: + - 'Maʻrakah-ʼi jahānʹbīnīʹhā :' + - "‏معركۀ جهان‌بينىها :‏" + pub_date: + - '1994' + pub_date_sort: 1994 + published_vern_display: + - "‏تهران :‏" + format: Book + subtitle_vern_display: "‏در خردورزى سياسى و هويت ما ايرانيان /‏" + material_type_display: + - 323 p. + lc_b4cutter_facet: + - DS274 + subject_t: + - Political science + - Iranians + - Iran + title_sort: maʻrakah-ʼi jahānʹbīnīʹhā :dar khiradvarzī-i siyāsī va huvīyat-i + mā īrānīyān + author_sort: Rajāyī Farhang 1952 or 3 Maʻrakahʼi jahānʹbīnīʹhā dar khiradvarzīi + siyāsī va huvīyati mā Īrānīyān + title_addl_t: + - 'Maʻrakah-ʼi jahānʹbīnīʹhā : dar khiradvarzī-i siyāsī va huvīyat-i mā + Īrānīyān /' + - "‏معركۀ جهان‌بينىها :‏ ‏در خردورزى سياسى و هويت ما ايرانيان /‏" + language_facet: + - Persian + timestamp: '2014-02-03T18:42:53.056Z' +- lc_1letter_facet: + - P - Language & Literature + author_t: + - Nārāyaṇa Paṇḍitācārya, + marc_display: "01588cam + a2200313 a 4500 2001417245DLC20090121030347.0011001m20009999ii 001 0 sano 2001417245I-San-2001-417245; 11Library of Congress -- + New Delhi Overseas OfficeRs200.00 (v. 1)DLCDLCDLCsanengkanlcodePK3798.N313S87 2000Nārāyaṇa Paṇḍitācārya,13th + cent.Sumadhvavijayaḥ /Nārāyaṇapaṇḍitācāryaviracitaḥ + ; Nārāyaṇapaṇḍitācāryaviracitabhāvaprakāśikā, Viśvapatitīrthaviracitapadārthadīpikodbodhikā, + Chalārīśeṣācāryaviracitamandopakāriṇī iti vyākhyānatrayasametaḥ ; + edited by A.B. Shyamachar and S.R. Pandurangi.Bangalore :Dvaita Vedanta Studies and Research Foundation,2000-v. <1 > ;25 cm.In Sanskrit; prefatory + matter in English and Kannada.Verse work on Madhva, 13th cent. Vaishnava + religious leader and exponent of dualistic philosophy; includes autocommentary + and two classical commentaries.Includes indexes.Madhva,13th cent.Poetry.Nārāyaṇa Paṇḍitācārya,17th cent.Bhāvaprakāśikā.2000.Viśvapatitīrtha,16th cent.Padārthadīpikodbodhikā.2000.Chalāriśeṣācārya.Mandopakāriṇī.2000.Shyamachar, A. B.Pandurangi, S. R." + published_display: + - Bangalore + author_display: Nārāyaṇa Paṇḍitācārya, 13th cent + lc_callnum_display: + - PK3798.N313 S87 2000 + title_t: + - Sumadhvavijayaḥ / + pub_date: + - '2000' + pub_date_sort: 2000 + format: Book + material_type_display: + - v. <1 > + lc_b4cutter_facet: + - PK3798.N313 + title_display: Sumadhvavijayaḥ + subject_addl_t: + - Poetry + subject_t: + - Madhva, 13th cent + title_sort: sumadhvavijayaḥ + id: '2001417245' + author_sort: Nārāyaṇa Paṇḍitācārya 13th cent Sumadhvavijayaḥ + title_addl_t: + - Sumadhvavijayaḥ / + subject_topic_facet: + - Madhva, 13th cent + author_addl_t: + - Nārāyaṇa Paṇḍitācārya, + - Viśvapatitīrtha, + - Chalāriśeṣācārya. + - Shyamachar, A. B. + - Pandurangi, S. R. + title_added_entry_t: + - Bhāvaprakāśikā + - Padārthadīpikodbodhikā + - Mandopakāriṇī + lc_alpha_facet: + - PK + language_facet: + - Sanskrit + timestamp: '2014-02-03T18:42:53.056Z' +- lc_1letter_facet: + - U - Military Science + author_t: + - Wuld Mawlāy al-Zayn, Sayyid Muḥammad wuld Sayyid. + - "ولد مولاي الزين، سيد محمد ولد سيد" + marc_display: "01197cam + a22003014a 4500 2003546302DLC20090123173626.0030922s2003 mu 000 0 ara 2003546302(CStRLIN)DCLN03-B4961DLC-RDLC-RDLClcodeU21.2.W85 2003(3880-01Wuld Mawlāy + al-Zayn, Sayyid Muḥammad wuld Sayyid.880-02al-Ḥarb + fī al-alfīyah al-thālithah /bi-qalam Sayyid + Muḥammad wuld Sayyid wuld Mawlāy al-Zayn.880-03Nuwākshūṭ + :[s.n.],2003.128 p. ;20 cm.WarHistory21st + century.Military art and scienceHistory21st century.WarForecasting.Military art and scienceForecasting.Warfare, Conventional.Military weapons.100-01/(3/rولد مولاي الزين، سيد محمد ولد سيد.245-02/(3/rالحرب في الألفية الثالثة /بقلم سيد + محمد ولد سيد ولد مولاي الزين.260-03/(3/rنواكشوط + :[s.n.]،2003." + published_display: + - Nuwākshūṭ + title_vern_display: "الحرب في الألفية الثالثة" + author_display: Wuld Mawlāy al-Zayn, Sayyid Muḥammad wuld Sayyid + lc_callnum_display: + - U21.2 .W85 2003 + title_t: + - al-Ḥarb fī al-alfīyah al-thālithah / + - "الحرب في الألفية الثالثة" + pub_date: + - '2003' + pub_date_sort: 2003 + published_vern_display: + - "نواكشوط" + format: Book + author_vern_display: "ولد مولاي الزين، سيد محمد ولد سيد" + material_type_display: + - 128 p. + lc_b4cutter_facet: + - U21.2 + title_display: al-Ḥarb fī al-alfīyah al-thālithah + subject_addl_t: + - History 21st century + - Forecasting + subject_t: + - War + - Military art and science + - Warfare, Conventional + - Military weapons + subject_era_facet: + - 21st century + title_sort: ḥarb fī al-alfīyah al-thālithah + id: '2003546302' + author_sort: Wuld Mawlāy alZayn Sayyid Muḥammad wuld Sayyid Ḥarb fī alalfīyah + althālithah + title_addl_t: + - al-Ḥarb fī al-alfīyah al-thālithah / + - "الحرب في الألفية الثالثة" + subject_topic_facet: + - War + - Military art and science + - Warfare, Conventional + - Military weapons + lc_alpha_facet: + - U + language_facet: + - Arabic + timestamp: '2014-02-03T18:42:53.056Z' +- lc_1letter_facet: + - D - World History + author_t: + - Bstan-ʼdzin-mkhas-grub, + marc_display: "00875cam + a22002534a 4500 2004310986DLC20090123105515.0040812s2004 cc a 000 0 tibo 2004310986Ch-Tib-2004-310986; 16Library of Congress -- + New Delhi Overseas OfficeRs154.00DLCDLCDLClcodea-cc-tiDS797.82.B663B75 2004Bstan-ʼdzin-mkhas-grub,1967-Bon-brgyaʼi lo rgyus lugs + gñis gsal baʼi me loṅ źes bya ba bźugs so /Bstan-ʼdzin-mkhas-grub + kyis brtsams.[Lha-sa :s.n.,2004]149 p. :ill. ;21 cm.In Tibetan.Historical account of Bon-brgya in + Tibet during 7th-9th cent.Bon-brgya (China)History.Bon-brgya (China)Kings and rulers." + published_display: + - Lha-sa + author_display: Bstan-ʼdzin-mkhas-grub, 1967- + lc_callnum_display: + - DS797.82.B663 B75 2004 + title_t: + - Bon-brgyaʼi lo rgyus lugs gñis gsal baʼi me loṅ źes bya ba bźugs so / + pub_date: + - '2004' + pub_date_sort: 2004 + format: Book + material_type_display: + - 149 p. + lc_b4cutter_facet: + - DS797.82.B663 + title_display: Bon-brgyaʼi lo rgyus lugs gñis gsal baʼi me loṅ źes bya ba bźugs + so + subject_addl_t: + - History + - Kings and rulers + subject_t: + - Bon-brgya (China) + title_sort: bon-brgyaʼi lo rgyus lugs gñis gsal baʼi me loṅ źes bya ba bźugs + so + id: '2004310986' + author_sort: Bstanʼdzinmkhasgrub 1967 Bonbrgyaʼi lo rgyus lugs gñis gsal baʼi me + loṅ źes bya ba bźugs so + title_addl_t: + - Bon-brgyaʼi lo rgyus lugs gñis gsal baʼi me loṅ źes bya ba bźugs so / + subject_geo_facet: + - Bon-brgya (China) + lc_alpha_facet: + - DS + language_facet: + - Tibetan + timestamp: '2014-02-03T18:42:53.056Z' +- subtitle_display: min jald al-dhāt ilá ṣidq al-sharḥ + author_vern_display: "أبو الخير، علي عبد الحميد" + subject_addl_t: + - 20th century + - 21st century + title_display: Thuqūb fī ʻaql al-ummah + subject_era_facet: + - 20th century + - 21st century + id: '2005461726' + subject_topic_facet: + - Islam + lc_alpha_facet: + - BP + subtitle_t: + - min jald al-dhāt ilá ṣidq al-sharḥ. + - "من جلد الذات إلى صدق الشرح" + author_t: + - Abū al-Khayr, ʻAlī ʻAbd al-Ḥamīd. + - "أبو الخير، علي عبد الحميد" + lc_1letter_facet: + - B - Philosophy, Psychology, Religion + marc_display: "01127nam + a2200277 a 4500 2005461726DLC20090126155550.0070712s2006 ua 000 0 ara d 2005461726(CStRLIN)DCLN07-B4171EMUEMUCUYDLC-RlccopycatlcodeBP161.3.A27 2006(3880-01Abū al-Khayr, ʻAlī ʻAbd al-Ḥamīd.880-02Thuqūb fī ʻaql al-ummah :min jald + al-dhāt ilá ṣidq al-sharḥ.880-03al-Ṭabʻah + 1.880-04al-Maʻādī, al-Qāhirah :Markaz Yāfā lil-Dirāsāt wa-al-Abḥāth,2006.85 p. ;24 cm.Islam20th century.Islam21st century.100-01/(3/rأبو + الخير، علي عبد الحميد.245-02/(3/rثقوب + في عقل الأمة :من جلد الذات إلى صدق الشرح.250-03/(3/rالطبعة 1.260-04/(3/rالمعادي، القاهرة + :مركز يافا للدراسات والأبحاث،2006." + published_display: + - al-Maʻādī, al-Qāhirah + author_display: Abū al-Khayr, ʻAlī ʻAbd al-Ḥamīd + title_vern_display: "ثقوب في عقل الأمة" + lc_callnum_display: + - BP161.3 .A27 2006 + title_t: + - 'Thuqūb fī ʻaql al-ummah :' + - "ثقوب في عقل الأمة" + pub_date: + - '2006' + pub_date_sort: 2006 + published_vern_display: + - "المعادي، القاهرة" + format: Book + subtitle_vern_display: "من جلد الذات إلى صدق الشرح" + lc_b4cutter_facet: + - BP161.3 + material_type_display: + - 85 p. + subject_t: + - Islam + title_sort: thuqūb fī ʻaql al-ummah :min jald al-dhāt ilá ṣidq al-sharḥ + author_sort: Abū alKhayr ʻAlī ʻAbd alḤamīd Thuqūb fī ʻaql alummah min jald + aldhāt ilá ṣidq alsharḥ + title_addl_t: + - 'Thuqūb fī ʻaql al-ummah : min jald al-dhāt ilá ṣidq al-sharḥ.' + - "ثقوب في عقل الأمة : من جلد الذات إلى صدق الشرح" + language_facet: + - Arabic + timestamp: '2014-02-03T18:42:53.056Z' +- lc_1letter_facet: + - H - Social Sciences + marc_display: "03730cam + a22006257a 4500 2005553155DLC20090121104139.0051007m19659999is | l 000 0 heb 2005553155(CStRLIN)DCLH05-B11400DLC-RDLC-Ra-is---HG8695.2.B57 1962(2880-01[Bituaḥ u-viṭaḥon sotsyali].[Israel ,1962-<2001>]items 1-<13> of <13> + ;22-25 cm.[1] Megamot be-mesheḳ ha-biṭuaḥ + ṿeha-piḳuaḥ ʻal ʻisḳe biṭuaḥ bi-shenat 1965. 1966. 52 leaves ; 25 cm. -- + [2] Biṭuaḥ ziḳnah : meʻudkan le-Yuli 2001. 24 p. ; 22 cm. -- [3] Biṭuaḥ sheʼirim + : meʻudkan le-Yuli 2001. 2001. 24 p. ; 22 cm. -- [4] Gimlah le-yeled nekheh : + meʻudkan le-Yuni 2001. 2001. 16 p. 22 cm. -- [5] Biṭuaḥ imahut : meʻudkan le-Yuli + 2002. 24 p. ; 22 cm. -- [6] Biṭuaḥ siʻud : meʻudkan le-Februʼar 2001. 2001. + 12 p. ; 22 cm. -- [7] Medaʻ le-ʻoved ʻatsmaʼi : meʻudkan le-Februʼar 2000. 2000. + 18 p. ; 22 cm. -- [8] Biṭuaḥ nifgeʻe teʻunot. 1999. 1 folded leaflet ; 22 cm. + -- [9] ha-Ḳeren le-nifgeʻe ṭeror -- [10] Teluyim be-nifgeʻe ʻavodah : meʻudkan + le-Februʼar 2001. 2001. 24 p. ; 22 cm. -- [11] Sherut miluʼim : meʻudkan le-Yuli + 2002. 2002. 16 p. ; 22 cm. -- [12] Ḳitsbah le-sherutim meyuhadim le-nekhim ḳashim + : meʻudkan le-Detsember 2002. 2002. 16 p. ; 22 cm. -- [13] Mumḥim benleʼumiyim + ʻal medukat ha-biṭaḥon ha-sotsyali / Yitsḥaḳ Ḳanev. 1962. 10 p. ; 24 cm.InsuranceIsrael.Social securityIsrael.Family allowancesIsrael.Maternity insuranceIsrael.Accident insuranceIsrael.Old ageEconomic aspects.IsraelSocial policy.IsraelArmed + ForcesReservesPay, + allowances, etc.Law and legislationSocial securityLaw and legislationIsrael.880-02Megamot be-mesheḳ ha-biṭuaḥ ṿeha-piḳuaḥ ʻal ʻisḳe biṭuaḥ bi-shenat + 1965.880-03Biṭuaḥ ziḳnah.880-04Biṭuaḥ sheʼirim.880-05Gimlah le-yeled + nekheh.880-06Biṭuaḥ imahut.880-07Biṭuaḥ siʻud.880-08Medaʻ le-ʻoved + ʻatsmaʼi.880-09Biṭuaḥ nifgeʻe teʻunot.880-10Ḳeren le-nifgeʻe ṭeror.880-11Teluyim + be-nifgeʻe ʻavodah.880-12Sherut miluʼim.880-13Ḳitsbah le-sherutim meyuḥadim le-nekhim ḳashim.880-14Mumḥim benleʼumiyim ʻal medukat ha-biṭaḥon ha-sotsyali.245-01/(2/r[ביטוח וביטחון סוציאלי].740-02/(2/rמגמות + במשק הביטוח והפיקוח על עסקי ביטוח בשנת 1965.740-03/(2/rביטוח זקנה.740-04/(2/rביטוח + שאירים.740-05/(2/rגמלה לילד נכה.740-06/(2/rביטוח אמהות.740-07/(2/rביטוח + סיעוד.740-08/(2/rמדע לעובד עצמאי.740-09/(2/rביטוח נפגעי תעונות.740-10/(2/rקרן + לנפגעי טרור.740-11/(2/rתלויים בניפגעי תעונה.740-12/(2/rשירות מילואים.740-13/(2/rקצבה + לשירותים מיוחדים לנכים קשים.740-14/(2/rמומחים + בינלאומיים על מדוכת הביטחון הסוציאלי." + published_display: + - Israel + title_vern_display: "ביטוח וביטחון סוציאלי" + lc_callnum_display: + - HG8695.2 .B57 1962 + title_t: + - "[Bituaḥ u-viṭaḥon sotsyali]." + - "ביטוח וביטחון סוציאלי" + pub_date: + - '1962' + pub_date_sort: 1962 + format: Book + material_type_display: + - items 1-<13> of <13> + lc_b4cutter_facet: + - HG8695.2 + title_display: Bituaḥ u-viṭaḥon sotsyali + subject_addl_t: + - Israel + - Economic aspects + - Law and legislation Israel + - Social policy + - Armed Forces Reserves Pay, allowances, etc. Law and legislation + subject_t: + - Insurance + - Social security + - Family allowances + - Maternity insurance + - Accident insurance + - Old age + - Israel + title_sort: bituaḥ u-viṭaḥon sotsyali + id: '2005553155' + author_sort: "\U0010FFFF Bituaḥ uviṭaḥon sotsyali" + title_addl_t: + - "[Bituaḥ u-viṭaḥon sotsyali]." + - "ביטוח וביטחון סוציאלי" + subject_geo_facet: + - Israel + subject_topic_facet: + - Insurance + - Social security + - Family allowances + - Maternity insurance + - Accident insurance + - Old age + title_added_entry_t: + - Megamot be-mesheḳ ha-biṭuaḥ ṿeha-piḳuaḥ ʻal ʻisḳe biṭuaḥ bi-shenat 1965. + - Biṭuaḥ ziḳnah. + - Biṭuaḥ sheʼirim. + - Gimlah le-yeled nekheh. + - Biṭuaḥ imahut. + - Biṭuaḥ siʻud. + - Medaʻ le-ʻoved ʻatsmaʼi. + - Biṭuaḥ nifgeʻe teʻunot. + - Ḳeren le-nifgeʻe ṭeror. + - Teluyim be-nifgeʻe ʻavodah. + - Sherut miluʼim. + - Ḳitsbah le-sherutim meyuḥadim le-nekhim ḳashim. + - Mumḥim benleʼumiyim ʻal medukat ha-biṭaḥon ha-sotsyali. + - "מגמות במשק הביטוח והפיקוח על עסקי ביטוח בשנת 1965" + - "ביטוח זקנה" + - "ביטוח שאירים" + - "גמלה לילד נכה" + - "ביטוח אמהות" + - "ביטוח סיעוד" + - "מדע לעובד עצמאי" + - "ביטוח נפגעי תעונות" + - "קרן לנפגעי טרור" + - "תלויים בניפגעי תעונה" + - "שירות מילואים" + - "קצבה לשירותים מיוחדים לנכים קשים" + - "מומחים בינלאומיים על מדוכת הביטחון הסוציאלי" + lc_alpha_facet: + - HG + language_facet: + - Hebrew + timestamp: '2014-02-03T18:42:53.056Z' +- lc_1letter_facet: + - E - History of the Americas (General) + author_t: + - Hearth, Amy Hill, + marc_display: "01490cam + a2200361 a 4500 2007020969DLC20090126093447.0070522s2008 nyua b 000 0beng 20070209699780743297790 (alk. paper)0743297792 (alk. paper)(OCoLC)ocn137335139(OCoLC)137335139DLCDLCBAKERBTCTAYDXCPC#PDLCn-us-njE99.D2H437 2008974.004/97345B22Hearth, Amy Hill,1958-\"Strong Medicine speaks\" + :a Native American elder has her say : an oral + history /Amy Hill Hearth.1st Atria Books hardcover + ed.New York :Atria Books,2008.xvii, 267 p. :ill. ;23 cm.Includes bibliographical references (p. 261-266).Strong Medicine,1922-Delaware womenNew JerseyBridgetonBiography.Indian women shamansNew JerseyBridgetonBiography.Delaware IndiansNew + JerseyBridgetonBiography.Delaware IndiansNew JerseyBridgetonHistory.Strong Medicine,1922-Table of contents onlyhttp://www.loc.gov/catdir/toc/ecip0719/2007020969.htmlPublisher descriptionhttp://www.loc.gov/catdir/enhancements/fy0808/2007020969-d.htmlSample texthttp://www.loc.gov/catdir/enhancements/fy0808/2007020969-s.html" + published_display: + - New York + author_display: Hearth, Amy Hill, 1958- + lc_callnum_display: + - E99.D2 H437 2008 + title_t: + - "\"Strong Medicine speaks\" :" + pub_date: + - '2008' + pub_date_sort: 2008 + subtitle_display: 'a Native American elder has her say : an oral history' + format: Book + url_suppl_display: + - http://www.loc.gov/catdir/toc/ecip0719/2007020969.html + - http://www.loc.gov/catdir/enhancements/fy0808/2007020969-d.html + - http://www.loc.gov/catdir/enhancements/fy0808/2007020969-s.html + material_type_display: + - xvii, 267 p. + lc_b4cutter_facet: + - E99.D2 + title_display: "\"Strong Medicine speaks\"" + subject_addl_t: + - New Jersey Bridgeton Biography + - New Jersey Bridgeton History + subject_t: + - Strong Medicine, 1922- + - Delaware women + - Indian women shamans + - Delaware Indians + title_sort: "\"strong medicine speaks\" :a native american elder has her say : an + oral history" + isbn_t: + - '9780743297790' + - 0743297792 + id: '2007020969' + author_sort: Hearth Amy Hill 1958 Strong Medicine speaks a Native American elder + has her say an oral history + title_addl_t: + - "\"Strong Medicine speaks\" : a Native American elder has her say : an oral history + /" + subject_geo_facet: + - New Jersey + - Bridgeton + subject_topic_facet: + - Strong Medicine, 1922- + - Delaware women + - Indian women shamans + - Delaware Indians + author_addl_t: + - Strong Medicine, + lc_alpha_facet: + - E + language_facet: + - English + subtitle_t: + - 'a Native American elder has her say : an oral history /' + timestamp: '2014-02-03T18:42:53.056Z' +- lc_1letter_facet: + - B - Philosophy, Psychology, Religion + author_t: + - Dkon-mchog-rgya-mtsho, Ra-se, + marc_display: "01099cam + a22002534a 4500 2008305903DLC20090122162012.0080602s2008 ii a 000 0 tibo 2008305903I-Tib-2008-305903; 01; + 05-01Library of Congress -- New Delhi Overseas OfficeRs400.00DLCDLClcodeBQ7684.4.D564 2008Dkon-mchog-rgya-mtsho,Ra-se,1968-Dris lan don gcig ma :dam paʼi chos + dgoṅs pa gcig paʼi dri ba legs bśad bsu baʼi pho ñaʼi dris lan Dgoṅs-gcig + smra baʼi mdzes rgyan źes bya ba bźugs so /Dwags-po + Spyan-sṅa-ba Dkon-mchog-rgya-mtshos brtsams.Par theṅ 2.[ʼPhags-yul Dhe-ra-dhun + :Sroṅ-btsan dpe mdzod khaṅ nas grems spel byas,2008]208 p. :1 col. ill. ;24 cm.In Tibetan.On the Dgoṅs-gcig teaching of Drikung + Kagyudpa sect in questions/answers format.ʼBri-guṅ-pa (Sect)DoctrinesMiscellanea.Sroṅ-btsan dpe mdzod khaṅ." + published_display: + - "ʼPhags-yul Dhe-ra-dhun" + author_display: Dkon-mchog-rgya-mtsho, Ra-se, 1968- + lc_callnum_display: + - BQ7684.4 .D564 2008 + title_t: + - 'Dris lan don gcig ma :' + pub_date: + - '2008' + pub_date_sort: 2008 + subtitle_display: dam paʼi chos dgoṅs pa gcig paʼi dri ba legs bśad bsu baʼi pho + ñaʼi dris lan Dgoṅs-gcig smra baʼi mdzes rgyan źes bya ba bźugs so + format: Book + material_type_display: + - 208 p. + lc_b4cutter_facet: + - BQ7684.4 + title_display: Dris lan don gcig ma + subject_addl_t: + - Doctrines Miscellanea + subject_t: + - "ʼBri-guṅ-pa (Sect)" + title_sort: dris lan don gcig ma :dam paʼi chos dgoṅs pa gcig paʼi dri ba legs + bśad bsu baʼi pho ñaʼi dris lan dgoṅs-gcig smra baʼi mdzes rgyan źes bya ba + bźugs so + id: '2008305903' + author_sort: Dkonmchogrgyamtsho Rase 1968 Dris lan don gcig ma dam paʼi chos dgoṅs + pa gcig paʼi dri ba legs bśad bsu baʼi pho ñaʼi dris lan Dgoṅsgcig smra baʼi + mdzes rgyan źes bya ba bźugs so + title_addl_t: + - 'Dris lan don gcig ma : dam paʼi chos dgoṅs pa gcig paʼi dri ba legs bśad bsu + baʼi pho ñaʼi dris lan Dgoṅs-gcig smra baʼi mdzes rgyan źes bya ba bźugs so + /' + subject_topic_facet: + - "ʼBri-guṅ-pa (Sect)" + author_addl_t: + - Sroṅ-btsan dpe mdzod khaṅ. + lc_alpha_facet: + - BQ + language_facet: + - Tibetan + subtitle_t: + - dam paʼi chos dgoṅs pa gcig paʼi dri ba legs bśad bsu baʼi pho ñaʼi dris lan + Dgoṅs-gcig smra baʼi mdzes rgyan źes bya ba bźugs so / + timestamp: '2014-02-03T18:42:53.056Z' +- subtitle_display: a supplication to the noble Lama Mahaguru Padmasambhava + subject_addl_t: + - Prayers and devotions + - India Prayers and devotions + title_display: Pluvial nectar of blessings + id: '2008308175' + isbn_t: + - '8186470336' + subject_geo_facet: + - India + subject_topic_facet: + - Padma Sambhava, ca. 717-ca. 762 + - Priests, Buddhist + lc_alpha_facet: + - BQ + subtitle_t: + - a supplication to the noble Lama Mahaguru Padmasambhava / + author_t: + - Ṅag-dbaṅ-blo-bzaṅ-rgya-mtsho, Dalai Lama V, + lc_1letter_facet: + - B - Philosophy, Psychology, Religion + marc_display: "01582cam + a2200325 a 4500 2008308175DLC20090123091532.0080718s2002 ii b 000 0 eng 20083081758186470336I-E-2008-308175; 59-13Library of Congress -- + New Delhi Overseas OfficeRs185.00DLCDLCengtibtiblcodea-ii---BQ5593.P3N3313 + 2002Ṅag-dbaṅ-blo-bzaṅ-rgya-mtsho,Dalai + Lama V,1617-1682.Rje btsun bla ma ma hā + gu ru Padma-ʼbyuṅ-gnas la gsol ba ʼdebs pa byin rlabs bdud rtsiʼi char rgyun.English & TibetanPluvial nectar of blessings :a supplication to the noble Lama Mahaguru Padmasambhava /by His Holiness Ngag-dbang-blo-bzang-rgya-mtsho, the fifth Dalai Lama + ; translated from the Tibetan with commentary by Dennis Cordell.Dharamsala :Library of Tibetan Works and Archives,2002.viii, 101 p. ;22 cm.English and Tibetan(Tibetan + also in roman).Includes bibliographical references (p. [97]-101).Padma Sambhava,ca. 717-ca. 762Prayers and devotions.Priests, BuddhistIndiaPrayers and devotions.Cordell, Dennis.Ṅag-dbaṅ-blo-bzaṅ-rgya-mtsho,Dalai Lama V,1617-1682Rje btsun bla ma ma hā gu ru Padma-ʼbyuṅ-gnas la gsol ba ʼdebs pa + byin rlabs bdud rtsiʼi char rgyun.2002Library of Tibetan Works + & Archives." + published_display: + - Dharamsala + author_display: Ṅag-dbaṅ-blo-bzaṅ-rgya-mtsho, Dalai Lama V, 1617-1682 + lc_callnum_display: + - BQ5593.P3 N3313 2002 + title_t: + - 'Pluvial nectar of blessings :' + pub_date: + - '2002' + pub_date_sort: 2002 + format: Book + lc_b4cutter_facet: + - BQ5593.P3 + material_type_display: + - viii, 101 p. + subject_t: + - Padma Sambhava, ca. 717-ca. 762 + - Priests, Buddhist + title_sort: pluvial nectar of blessings :a supplication to the noble lama mahaguru + padmasambhava + author_sort: Ṅagdbaṅblobzaṅrgyamtsho Dalai Lama V 16171682 Rje btsun bla ma ma + hā gu ru Padmaʼbyuṅgnas la gsol ba ʼdebs pa byin rlabs bdud rtsiʼi char rgyun + English Tibetan Pluvial nectar of blessings a supplication to the noble Lama + Mahaguru Padmasambhava + title_addl_t: + - 'Pluvial nectar of blessings : a supplication to the noble Lama Mahaguru Padmasambhava + /' + - Rje btsun bla ma ma hā gu ru Padma-ʼbyuṅ-gnas la gsol ba ʼdebs pa byin rlabs + bdud rtsiʼi char rgyun. English & Tibetan + author_addl_t: + - Cordell, Dennis. + - Ṅag-dbaṅ-blo-bzaṅ-rgya-mtsho, Dalai Lama V, + - Library of Tibetan Works & Archives. + title_added_entry_t: + - Rje btsun bla ma ma hā gu ru Padma-ʼbyuṅ-gnas la gsol ba ʼdebs pa byin rlabs + bdud rtsiʼi char rgyun + language_facet: + - English + - Tibetan + timestamp: '2014-02-03T18:42:53.056Z' +- lc_1letter_facet: + - B - Philosophy, Psychology, Religion + author_t: + - Bstan-ʼdzin-rgya-mtsho, Dalai Lama XIV, + marc_display: "01221cam + a22002534a 4500 2008308201DLC20090122162646.0080721s2008 ii 000 0 tibo 2008308201I-Tib-2008-308201; 27Library of Congress -- + New Delhi Overseas OfficeRs150.00DLCDLClcodeBQ4036.B78 2008Bstan-ʼdzin-rgya-mtsho,Dalai Lama XIV,1935-Bod kyi naṅ chos ṅo sprod + sñiṅ bsdus :goṅ sa skyabs mgon chen po mchog + nas deṅ dus Bod rigs na gźon rnams la naṅ chos ṅo sprod bstsal ba bźugs so.Par theṅs 2.Dharamsala, H.P. :Sku-bcar Rnam-par-rgyal-ba Phan-bde-legs-bśad-gliṅ Grwa-tshaṅ gi + Śes-yon Lhan-tshogs,2008.4, iv, 254 p. ;23 cm.In Tibetan.Series of lectures delivered by His + Holiness the Dali Lama to younger generation of Tibetan studying in different + colleges and universities in India and students from schools in Dharamsala on + the introduction of Buddhist teaching.BuddhismEssence, + genius, nature.Rnam-rgyal Grwa-tshaṅ.Śes-yon + Lhan-tshogs." + published_display: + - Dharamsala, H.P. + author_display: Bstan-ʼdzin-rgya-mtsho, Dalai Lama XIV, 1935- + lc_callnum_display: + - BQ4036 .B78 2008 + title_t: + - 'Bod kyi naṅ chos ṅo sprod sñiṅ bsdus :' + pub_date: + - '2008' + pub_date_sort: 2008 + subtitle_display: goṅ sa skyabs mgon chen po mchog nas deṅ dus Bod rigs na gźon + rnams la naṅ chos ṅo sprod bstsal ba bźugs so + format: Book + material_type_display: + - 4, iv, 254 p. + lc_b4cutter_facet: + - BQ4036 + title_display: Bod kyi naṅ chos ṅo sprod sñiṅ bsdus + subject_addl_t: + - Essence, genius, nature + subject_t: + - Buddhism + title_sort: bod kyi naṅ chos ṅo sprod sñiṅ bsdus :goṅ sa skyabs mgon chen po + mchog nas deṅ dus bod rigs na gźon rnams la naṅ chos ṅo sprod bstsal ba bźugs + so + id: '2008308201' + author_sort: Bstanʼdzinrgyamtsho Dalai Lama XIV 1935 Bod kyi naṅ chos ṅo sprod + sñiṅ bsdus goṅ sa skyabs mgon chen po mchog nas deṅ dus Bod rigs na gźon + rnams la naṅ chos ṅo sprod bstsal ba bźugs so + title_addl_t: + - 'Bod kyi naṅ chos ṅo sprod sñiṅ bsdus : goṅ sa skyabs mgon chen po mchog + nas deṅ dus Bod rigs na gźon rnams la naṅ chos ṅo sprod bstsal ba bźugs so.' + subject_topic_facet: + - Buddhism + author_addl_t: + - Rnam-rgyal Grwa-tshaṅ. Śes-yon Lhan-tshogs. + lc_alpha_facet: + - BQ + language_facet: + - Tibetan + subtitle_t: + - goṅ sa skyabs mgon chen po mchog nas deṅ dus Bod rigs na gźon rnams la naṅ + chos ṅo sprod bstsal ba bźugs so. + timestamp: '2014-02-03T18:42:53.056Z' +- lc_1letter_facet: + - D - World History + author_t: + - Thub-bstan-yar-ʼphel, Rnam-grwa. + marc_display: "01111cam + a2200289 a 4500 2008308202DLC20090121092141.0080721s2005 ii b b 000 0 tibo 2008308202I-Tib-2008-308202; 16Library of Congress -- + New Delhi Overseas OfficeRs150.00DLCDLClcodea-cc-tiDS785.T475 + 2005Thub-bstan-yar-ʼphel,Rnam-grwa.Bod gaṅs can gyi rgyal + rabs mdor bsdus dris lan brgya pa rab gsal śel gyi me loṅ źes bya ba bźugs + so /Rnam-grwa Thub-bstan-yar-ʼphel.Rgyal rabs dris lan brgya + pa rab gsal śel gyi me loṅ1st ed.Dharamsala, H.P. :Sku-bcar Rnam-rgyal Grwa-tshaṅ nas ʼgrems spel źus,2005.a-e, iv, ii, 407 p. :maps + ;23 cm.In Tibetan.History of Tibet in questions/answers + format.Includes bibliographical references (p. 406-407).Tibet (China)HistoryMiscellanea.Rnam-rgyal Grwa-tshaṅ." + published_display: + - Dharamsala, H.P. + author_display: Thub-bstan-yar-ʼphel, Rnam-grwa + lc_callnum_display: + - DS785 .T475 2005 + title_t: + - Bod gaṅs can gyi rgyal rabs mdor bsdus dris lan brgya pa rab gsal śel gyi me + loṅ źes bya ba bźugs so / + pub_date: + - '2005' + pub_date_sort: 2005 + format: Book + material_type_display: + - a-e, iv, ii, 407 p. + lc_b4cutter_facet: + - DS785 + title_display: Bod gaṅs can gyi rgyal rabs mdor bsdus dris lan brgya pa rab gsal + śel gyi me loṅ źes bya ba bźugs so + subject_addl_t: + - History Miscellanea + subject_t: + - Tibet (China) + title_sort: bod gaṅs can gyi rgyal rabs mdor bsdus dris lan brgya pa rab gsal śel + gyi me loṅ źes bya ba bźugs so + id: '2008308202' + author_sort: Thubbstanyarʼphel Rnamgrwa Bod gaṅs can gyi rgyal rabs mdor bsdus + dris lan brgya pa rab gsal śel gyi me loṅ źes bya ba bźugs so + title_addl_t: + - Bod gaṅs can gyi rgyal rabs mdor bsdus dris lan brgya pa rab gsal śel gyi me + loṅ źes bya ba bźugs so / + - Rgyal rabs dris lan brgya pa rab gsal śel gyi me loṅ + subject_geo_facet: + - Tibet (China) + author_addl_t: + - Rnam-rgyal Grwa-tshaṅ. + lc_alpha_facet: + - DS + language_facet: + - Tibetan + timestamp: '2014-02-03T18:42:53.056Z' +- marc_display: "01127cam + a22002895a 4500 2008308478DLC20090123131001.0080728s2007 ii 000 0 tibo 2008308478I-Tib-2008-308478; 23Library of Congress -- + New Delhi Overseas OfficeDLCDLClcodea-cc-tia-ii---Śes yon.1st ed.Dharamsala, Distt. Kangra, H.P. :Skabs bźi paʼi ʼbriṅ rim dge ʼos slob thon pa thun moṅ gis ʼgrems + spel źus,2007.xii, 419 p. ;22 cm.In Tibetan.Copyright: College for Higher Tibetan + Studies.Contributed articles reflecting new educational policy for development + of Tibetan education system in exile Tibetan community and Tibetan language teaching + method etc.Education and stateChinaTibet.TibetansEducationIndia.Tibetan languageStudy and teachingIndia.TeachingMethodology.Sa-rā Bod kyi mtho rim + slob gñer khaṅ." + published_display: + - Dharamsala, Distt. Kangra, H.P. + title_t: + - Śes yon. + pub_date: + - '2007' + pub_date_sort: 2007 + format: Book + title_display: Śes yon + subject_addl_t: + - China Tibet + - Education India + - Study and teaching India + - Methodology + - Education Policy + material_type_display: + - xii, 419 p. + subject_t: + - Education and state + - Tibetans + - Tibetan language + - Teaching + title_sort: śes yon + id: '2008308478' + author_sort: "\U0010FFFF Śes yon" + title_addl_t: + - Śes yon. + subject_geo_facet: + - China + - Tibet + - India + subject_topic_facet: + - Education and state + - Tibetans + - Tibetan language + - Teaching + author_addl_t: + - Sa-rā Bod kyi mtho rim slob gñer khaṅ. + language_facet: + - Tibetan + timestamp: '2014-02-03T18:42:53.056Z' +- author_vern_display: "吉田一, 1934-" + subject_addl_t: + - 20th century History and criticism + - History and criticism + - Japan History + title_display: Kubo Sakae 'Kazanbaichi' o yomu + subject_era_facet: + - 20th century + id: '2008543486' + isbn_t: + - '9784588460050' + - '4588460056' + subject_geo_facet: + - Japan + subject_topic_facet: + - Kubo, Sakae, 1901-1958 + - Japanese drama + - Political plays, Japanese + - Theater + lc_alpha_facet: + - PL + author_t: + - Yoshida, Hajime, + - "吉田一" + lc_1letter_facet: + - P - Language & Literature + marc_display: "01230nam + a22003494a 4500 2008543486DLC20090126101044.0081217s1997 ja 000 0 jpn d 2008543486 200031424797845884600504588460056(OCoLC)ocm40868083UIUUIUTRCLSOCLCGDLClccopycata-ja---PL832.U25Z96 1997$1880-01Yoshida, + Hajime,1934-880-02Kubo Sakae 'Kazanbaichi' o yomu /Yoshida + Hajime cho.880-03Shohan.880-04Tōkyō :Hōsei Daigaku Shuppankyoku,1997.480 p. ;19 cm.880-05Kubo, Sakae,1901-1958.Kazanbaichi.Japanese drama20th + centuryHistory and criticism.Political plays, JapaneseHistory and criticism.TheaterJapanHistory.100-01/$1吉田一,1934-245-02/$1久保栄「火山灰地」を読む /吉田一著.250-03/$1初版.260-04/$1東京 :法政大学出版局,1997.600-05/$1久保栄,1901-1958.Kazanbaichi." + published_display: + - Tōkyō + author_display: Yoshida, Hajime, 1934- + title_vern_display: "久保栄「火山灰地」を読む" + lc_callnum_display: + - PL832.U25 Z96 1997 + title_t: + - Kubo Sakae 'Kazanbaichi' o yomu / + - "久保栄「火山灰地」を読む" + pub_date: + - '1997' + pub_date_sort: 1997 + published_vern_display: + - "東京" + format: Book + lc_b4cutter_facet: + - PL832.U25 + material_type_display: + - 480 p. + subject_t: + - Kubo, Sakae, 1901-1958. Kazanbaichi + - Japanese drama + - Political plays, Japanese + - Theater + - "久保栄, 1901-1958. Kazanbaichi" + title_sort: kubo sakae 'kazanbaichi' o yomu + author_sort: Yoshida Hajime 1934 Kubo Sakae Kazanbaichi o yomu + title_addl_t: + - Kubo Sakae 'Kazanbaichi' o yomu / + - "久保栄「火山灰地」を読む" + language_facet: + - Japanese + timestamp: '2014-02-03T18:42:53.056Z' +- author_vern_display: "林行止" + subject_addl_t: + - 1990- + - 2005-2015 + - Economic conditions 1997- + - Politics and government 1997- + title_display: Ci an zhou bian + subject_era_facet: + - 1990- + - 2005-2015 + - 1997- + id: '2009373513' + isbn_t: + - '9789573908678' + - '9573908670' + subject_geo_facet: + - Economic history + - World politics + - Hong Kong (China) + lc_alpha_facet: + - HC + title_series_t: + - Lin Xingzhi zuo pin ji ; 51 + - "林行止作品集 ; 51" + author_t: + - Lin, Xingzhi. + - "林行止" + lc_1letter_facet: + - H - Social Sciences + marc_display: "01213nam + a22003614a 4500 2009373513DLC20090121153231.0090114s2008 ch 000 0 chi d 200937351397895739086789573908670(OCoLC)ocn268619391HUAHUAHKPDLClccopycata-cc-hkHC59.15.L533 2008$1880-01Lin, + Xingzhi.880-02Ci an zhou bian /Lin Xingzhi zhu.880-03Chu ban.880-04Taibei Xian Banqiao Shi :Yuan jing + chu ban shi ye you xian gong si,2008.5, 300 p. ;21 cm.880-05Lin Xingzhi zuo + pin ji ;51Economic history1990-World politics2005-2015.Hong Kong (China)Economic conditions1997-Hong Kong (China)Politics and government1997-100-01/$1林行止.245-02/$1次按驟變 /林行止著.250-03/$1初版.260-04/$1臺北縣板橋市 :遠景出版事業有限公司,2008.490-05/$1林行止作品集 ;51" + published_display: + - Taibei Xian Banqiao Shi + author_display: Lin, Xingzhi + title_vern_display: "次按驟變" + lc_callnum_display: + - HC59.15 .L533 2008 + title_t: + - Ci an zhou bian / + - "次按驟變" + pub_date: + - '2008' + pub_date_sort: 2008 + published_vern_display: + - "臺北縣板橋市" + format: Book + lc_b4cutter_facet: + - HC59.15 + material_type_display: + - 5, 300 p. + subject_t: + - Economic history + - World politics + - Hong Kong (China) + title_sort: ci an zhou bian + author_sort: Lin Xingzhi Ci an zhou bian + title_addl_t: + - Ci an zhou bian / + - "次按驟變" + language_facet: + - Chinese + timestamp: '2014-02-03T18:42:53.056Z' From f1342cd79eb8f0d35d616d5be31ecc8fb8d025a0 Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Thu, 28 Sep 2017 12:09:43 -0400 Subject: [PATCH 14/67] Adding .solr_wrapper with defaults. --- .solr_wrapper | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .solr_wrapper diff --git a/.solr_wrapper b/.solr_wrapper new file mode 100644 index 0000000..3307716 --- /dev/null +++ b/.solr_wrapper @@ -0,0 +1,8 @@ +# Place any default configuration for solr_wrapper here +port: 8983 +verbose: true +version: 5.5.4 +managed: true +collection: + dir: solr/conf/ + name: blacklight-core From 08220a57a954262ecd7105a7eb6dd02d1eaa33a3 Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Thu, 28 Sep 2017 12:14:10 -0400 Subject: [PATCH 15/67] Remove VCR - Remove gem dependencies - Remove cassette - Remove from spec_helper --- blacklight_oai_provider.gemspec | 2 - spec/spec_helper.rb | 8 --- spec/vcr_cassettes/solr.yml | 113 -------------------------------- 3 files changed, 123 deletions(-) delete mode 100644 spec/vcr_cassettes/solr.yml diff --git a/blacklight_oai_provider.gemspec b/blacklight_oai_provider.gemspec index 53aeeab..fc22d39 100644 --- a/blacklight_oai_provider.gemspec +++ b/blacklight_oai_provider.gemspec @@ -25,8 +25,6 @@ Gem::Specification.new do |s| s.add_development_dependency 'capybara' s.add_development_dependency 'solr_wrapper' - s.add_development_dependency 'vcr' - s.add_development_dependency 'fakeweb' s.add_development_dependency 'combustion' s.add_development_dependency 'sqlite3' end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index dae5d35..b156880 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -23,17 +23,9 @@ class SolrDocument end -require 'vcr' - -VCR.configure do |config| - config.hook_into :fakeweb - config.cassette_library_dir = 'spec/vcr_cassettes' - config.default_cassette_options = { :serialize_with => :syck } -end require 'rspec/rails' require 'capybara/rails' RSpec.configure do |config| - config.extend VCR::RSpec::Macros end diff --git a/spec/vcr_cassettes/solr.yml b/spec/vcr_cassettes/solr.yml deleted file mode 100644 index 9c02426..0000000 --- a/spec/vcr_cassettes/solr.yml +++ /dev/null @@ -1,113 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: http://127.0.0.1:8983/solr/select?wt=ruby&rows=1&fl=timestamp&sort=timestamp+asc&qt=search - body: - encoding: US-ASCII - string: "" - headers: {} - - response: - status: - code: 200 - message: OK - headers: - content-type: - - text/plain; charset=utf-8 - connection: - - close - body: - encoding: UTF-8 - string: "{'responseHeader'=>{'status'=>0,'QTime'=>2,'params'=>{'fl'=>'timestamp','sort'=>'timestamp asc','wt'=>'ruby','rows'=>'1'}},'response'=>{'numFound'=>30,'start'=>0,'docs'=>[{'timestamp'=>'2012-08-01T16:49:55.214Z'}]},'facet_counts'=>{'facet_queries'=>{},'facet_fields'=>{'format'=>['Book',30],'lc_1letter_facet'=>['B - Philosophy, Psychology, Religion',6,'D - World History',6,'H - Social Sciences',4,'P - Language & Literature',4,'M - Music',3,'K - Law',2,'E - History of the Americas (General)',1,'G - Geography, Anthropology, Recreation',1,'U - Military Science',1],'lc_alpha_facet'=>['DS',5,'BQ',3,'PK',3,'BP',2,'HQ',2,'KPC',2,'BM',1,'DK',1,'E',1,'G',1],'lc_b4cutter_facet'=>['KPC13',2,'BM520.88.A53',1,'BP161.3',1,'BP44',1,'BQ4036',1,'BQ5593.P3',1,'BQ7684.4',1,'DK861.K3',1,'DS274',1,'DS318.84.N87',1],'language_facet'=>['Tibetan',6,'Hebrew',3,'Korean',3,'Persian',3,'Sanskrit',3,'Urdu',3,'Arabic',2,'English',2,'Japanese',2,'Russian',2],'pub_date'=>['2008',4,'1976',2,'1986',2,'1990',2,'1997',2,'2000',2,'1941',1,'1946',1,'1952',1,'1962',1],'subject_era_facet'=>['20th century',3,'1997-',2,'21st century',2,'1990-',1,'2005-2015',1,'Koryo\xCC\x86 period, 935-1392',1],'subject_geo_facet'=>['India',2,'Iran',2,'Japan',2,'Bon-brgya (China)',1,'Bridgeton',1,'China',1,'Economic history',1,'Hong Kong (China)',1,'Islamic countries',1,'Israel',1],'subject_topic_facet'=>['Japanese drama',2,'Kubo, Sakae, 1901-1958',2,'Political plays, Japanese',2,'Theater',2,'Women',2,'Accident insurance',1,'Buddhism',1,'Delaware Indians',1,'Delaware women',1,'Education and state',1]},'facet_dates'=>{},'facet_ranges'=>{}}}" - http_version: "1.1" - recorded_at: Thu, 16 Aug 2012 20:43:20 GMT -- request: - method: get - uri: http://127.0.0.1:8983/solr/select?wt=ruby&rows=1&fl=timestamp&sort=timestamp+desc&qt=search - body: - encoding: US-ASCII - string: "" - headers: {} - - response: - status: - code: 200 - message: OK - headers: - content-type: - - text/plain; charset=utf-8 - connection: - - close - body: - encoding: UTF-8 - string: "{'responseHeader'=>{'status'=>0,'QTime'=>3,'params'=>{'fl'=>'timestamp','sort'=>'timestamp desc','wt'=>'ruby','rows'=>'1'}},'response'=>{'numFound'=>30,'start'=>0,'docs'=>[{'timestamp'=>'2012-08-01T16:49:55.683Z'}]},'facet_counts'=>{'facet_queries'=>{},'facet_fields'=>{'format'=>['Book',30],'lc_1letter_facet'=>['B - Philosophy, Psychology, Religion',6,'D - World History',6,'H - Social Sciences',4,'P - Language & Literature',4,'M - Music',3,'K - Law',2,'E - History of the Americas (General)',1,'G - Geography, Anthropology, Recreation',1,'U - Military Science',1],'lc_alpha_facet'=>['DS',5,'BQ',3,'PK',3,'BP',2,'HQ',2,'KPC',2,'BM',1,'DK',1,'E',1,'G',1],'lc_b4cutter_facet'=>['KPC13',2,'BM520.88.A53',1,'BP161.3',1,'BP44',1,'BQ4036',1,'BQ5593.P3',1,'BQ7684.4',1,'DK861.K3',1,'DS274',1,'DS318.84.N87',1],'language_facet'=>['Tibetan',6,'Hebrew',3,'Korean',3,'Persian',3,'Sanskrit',3,'Urdu',3,'Arabic',2,'English',2,'Japanese',2,'Russian',2],'pub_date'=>['2008',4,'1976',2,'1986',2,'1990',2,'1997',2,'2000',2,'1941',1,'1946',1,'1952',1,'1962',1],'subject_era_facet'=>['20th century',3,'1997-',2,'21st century',2,'1990-',1,'2005-2015',1,'Koryo\xCC\x86 period, 935-1392',1],'subject_geo_facet'=>['India',2,'Iran',2,'Japan',2,'Bon-brgya (China)',1,'Bridgeton',1,'China',1,'Economic history',1,'Hong Kong (China)',1,'Islamic countries',1,'Israel',1],'subject_topic_facet'=>['Japanese drama',2,'Kubo, Sakae, 1901-1958',2,'Political plays, Japanese',2,'Theater',2,'Women',2,'Accident insurance',1,'Buddhism',1,'Delaware Indians',1,'Delaware women',1,'Education and state',1]},'facet_dates'=>{},'facet_ranges'=>{}}}" - http_version: "1.1" - recorded_at: Thu, 16 Aug 2012 20:43:20 GMT -- request: - method: get - uri: http://127.0.0.1:8983/solr/select?wt=ruby&rows=25&fl=id%2C+title_display%2C+author_display%2C+format%2C+timestamp&sort=timestamp+asc - body: - encoding: US-ASCII - string: "" - headers: {} - - response: - status: - code: 200 - message: OK - headers: - content-type: - - text/plain; charset=utf-8 - connection: - - close - body: - encoding: ASCII-8BIT - string: "{'responseHeader'=>{'status'=>0,'QTime'=>2,'params'=>{'fl'=>'id, title_display, author_display, format, timestamp','sort'=>'timestamp asc','wt'=>'ruby','rows'=>'25'}},'response'=>{'numFound'=>30,'start'=>0,'docs'=>[{'author_display'=>'Ayaz, Shaikh, 1923-1997','format'=>'Book','title_display'=>'Fikr-i Aya\xCC\x84z','id'=>'00282214','timestamp'=>'2012-08-01T16:49:55.214Z'},{'author_display'=>'Ayaz, Shaikh, 1923-1997','format'=>'Book','title_display'=>'Sa\xCC\x84hiva\xCC\x84l jail ki\xCC\x84 d\xCC\xA3a\xCC\x84\xCA\xBCiri\xCC\x84','id'=>'00282371','timestamp'=>'2012-08-01T16:49:55.249Z'},{'title_display'=>'Naqdi\xCC\x84 bara\xCC\x84-yi tama\xCC\x84m-i fus\xCC\xA3u\xCC\x84l','id'=>'00313831','author_display'=>'Nu\xCC\x84ri\xCC\x84, \xCA\xBBAbd Alla\xCC\x84h, 1949-','format'=>'Book','timestamp'=>'2012-08-01T16:49:55.276Z'},{'author_display'=>'Yoshida, Hajime, 1934-','format'=>'Book','title_display'=>'Kubo Sakae \"Kazanbaichi\" o yomu','id'=>'00314247','timestamp'=>'2012-08-01T16:49:55.307Z'},{'author_display'=>'Vi\xEF\xB8\xA0a\xEF\xB8\xA1tkin, M. P. (Mikhail Porfir\xCA\xB9evich), 1895-1967','format'=>'Book','title_display'=>'Ocherki po istorii Kazakhskoi\xCC\x86 SSR','id'=>'43037890','timestamp'=>'2012-08-01T16:49:55.322Z'},{'author_display'=>'Korea (North)','format'=>'Book','title_display'=>'Konstitut\xEF\xB8\xA0s\xEF\xB8\xA1ii\xEF\xB8\xA0a\xEF\xB8\xA1 i osnovnye zakonodatel\xCA\xB9nye akty Korei\xCC\x86skoi\xCC\x86 Narodno-Demokraticheskoi\xCC\x86 Respubliki','id'=>'53029833','timestamp'=>'2012-08-01T16:49:55.336Z'},{'title_display'=>'Koryo\xCC\x86 inmul yo\xCC\x86lcho\xCC\x86n','id'=>'77826928','format'=>'Book','timestamp'=>'2012-08-01T16:49:55.353Z'},{'author_display'=>'Parikshit Sharma, Ogeti, 1930-','format'=>'Book','title_display'=>'Yas\xCC\x81odhara\xCC\x84-maha\xCC\x84ka\xCC\x84vyam','id'=>'78908283','timestamp'=>'2012-08-01T16:49:55.366Z'},{'author_display'=>'Is\xCC\xA3la\xCC\x84h\xCC\xA3i\xCC\x84, Ami\xCC\x84n Ah\xCC\xA3san, 1904-1997','format'=>'Book','title_display'=>'Pa\xCC\x84kista\xCC\x84ni\xCC\x84 \xCA\xBBaurat dora\xCC\x84he par','id'=>'79930185','timestamp'=>'2012-08-01T16:49:55.377Z'},{'author_display'=>'Na\xCC\x84ra\xCC\x84yan\xCC\xA3apan\xCC\xA3d\xCC\xA3ita, 17th cent','format'=>'Book','title_display'=>'A\xCC\x84s\xCC\x81les\xCC\xA3a\xCC\x84s\xCC\x81ataka of Na\xCC\x84ra\xCC\x84yan\xCC\xA3a Pan\xCC\xA3d\xCC\xA3ita','id'=>'85910001','timestamp'=>'2012-08-01T16:49:55.387Z'},{'title_display'=>'Shodede-yam Yehudiyim','id'=>'86207417','author_display'=>'Finkel, Chaim Jacob','format'=>'Book','timestamp'=>'2012-08-01T16:49:55.402Z'},{'title_display'=>'A\xCC\x84shna\xCC\x84\xCA\xBCi\xCC\x84 ba\xCC\x84 h\xCC\xA3awzah\xCA\xB9ha\xCC\x84-yi \xCA\xBBilmi\xCC\x84yah-\xCA\xBCi Shi\xCC\x84\xCA\xBBah dar t\xCC\xA3u\xCC\x84l-i ta\xCC\x84ri\xCC\x84kh','id'=>'87931798','author_display'=>'Muvah\xCC\xA3h\xCC\xA3id Abt\xCC\xA3ah\xCC\xA3i\xCC\x84, H\xCC\xA3ujjat','format'=>'Book','timestamp'=>'2012-08-01T16:49:55.419Z'},{'author_display'=>'Lomt\xCA\xBBat\xCA\xBBiz\xCC\x87e, C\xCC\x8Cola, 1879-1915','format'=>'Book','title_display'=>'Mrecvelobis mus\xCC\x8Cakis c\xCA\xBBxovrebis cesi','id'=>'90142413','timestamp'=>'2012-08-01T16:49:55.435Z'},{'title_display'=>'Pukhan po\xCC\x86mnyo\xCC\x86ngjip','id'=>'92117465','author_display'=>'Korea (North)','format'=>'Book','timestamp'=>'2012-08-01T16:49:55.447Z'},{'title_display'=>'Sefer Mishnah berurah','id'=>'92828023','author_display'=>'Israel Meir, ha-Kohen, 1838-1933','format'=>'Book','timestamp'=>'2012-08-01T16:49:55.464Z'},{'title_display'=>'Ajikto ku\xCC\x86ro\xCC\x86k cho\xCC\x86ro\xCC\x86k sasimnikka','id'=>'94120425','author_display'=>'Kim, Hong-sin, 1947-','format'=>'Book','timestamp'=>'2012-08-01T16:49:55.488Z'},{'title_display'=>'Ma\xCA\xBBrakah-\xCA\xBCi jaha\xCC\x84n\xCA\xB9bi\xCC\x84ni\xCC\x84\xCA\xB9ha\xCC\x84','id'=>'96933325','author_display'=>'Raja\xCC\x84yi\xCC\x84, Farhang, 1952 or 3-','format'=>'Book','timestamp'=>'2012-08-01T16:49:55.502Z'},{'author_display'=>'Na\xCC\x84ra\xCC\x84yan\xCC\xA3a Pan\xCC\xA3d\xCC\xA3ita\xCC\x84ca\xCC\x84rya, 13th cent','format'=>'Book','title_display'=>'Sumadhvavijayah\xCC\xA3','id'=>'2001417245','timestamp'=>'2012-08-01T16:49:55.515Z'},{'title_display'=>'al-H\xCC\xA3arb fi\xCC\x84 al-alfi\xCC\x84yah al-tha\xCC\x84lithah','id'=>'2003546302','author_display'=>'Wuld Mawla\xCC\x84y al-Zayn, Sayyid Muh\xCC\xA3ammad wuld Sayyid','format'=>'Book','timestamp'=>'2012-08-01T16:49:55.529Z'},{'author_display'=>'Bstan-\xCA\xBCdzin-mkhas-grub, 1967-','format'=>'Book','title_display'=>'Bon-brgya\xCA\xBCi lo rgyus lugs gn\xCC\x83is gsal ba\xCA\xBCi me lon\xCC\x87 z\xCC\x81es bya ba bz\xCC\x81ugs so','id'=>'2004310986','timestamp'=>'2012-08-01T16:49:55.539Z'},{'title_display'=>'Thuqu\xCC\x84b fi\xCC\x84 \xCA\xBBaql al-ummah','id'=>'2005461726','author_display'=>'Abu\xCC\x84 al-Khayr, \xCA\xBBAli\xCC\x84 \xCA\xBBAbd al-H\xCC\xA3ami\xCC\x84d','format'=>'Book','timestamp'=>'2012-08-01T16:49:55.551Z'},{'format'=>'Book','title_display'=>'Bituah\xCC\xA3 u-vit\xCC\xA3ah\xCC\xA3on sotsyali','id'=>'2005553155','timestamp'=>'2012-08-01T16:49:55.57Z'},{'title_display'=>'\"Strong Medicine speaks\"','id'=>'2007020969','author_display'=>'Hearth, Amy Hill, 1958-','format'=>'Book','timestamp'=>'2012-08-01T16:49:55.59Z'},{'title_display'=>'Dris lan don gcig ma','id'=>'2008305903','author_display'=>'Dkon-mchog-rgya-mtsho, Ra-se, 1968-','format'=>'Book','timestamp'=>'2012-08-01T16:49:55.602Z'},{'title_display'=>'Pluvial nectar of blessings','id'=>'2008308175','author_display'=>'N\xCC\x87ag-dban\xCC\x87-blo-bzan\xCC\x87-rgya-mtsho, Dalai Lama V, 1617-1682','format'=>'Book','timestamp'=>'2012-08-01T16:49:55.621Z'}]},'facet_counts'=>{'facet_queries'=>{},'facet_fields'=>{'format'=>['Book',30],'lc_1letter_facet'=>['B - Philosophy, Psychology, Religion',6,'D - World History',6,'H - Social Sciences',4,'P - Language & Literature',4,'M - Music',3,'K - Law',2,'E - History of the Americas (General)',1,'G - Geography, Anthropology, Recreation',1,'U - Military Science',1],'lc_alpha_facet'=>['DS',5,'BQ',3,'PK',3,'BP',2,'HQ',2,'KPC',2,'BM',1,'DK',1,'E',1,'G',1],'lc_b4cutter_facet'=>['KPC13',2,'BM520.88.A53',1,'BP161.3',1,'BP44',1,'BQ4036',1,'BQ5593.P3',1,'BQ7684.4',1,'DK861.K3',1,'DS274',1,'DS318.84.N87',1],'language_facet'=>['Tibetan',6,'Hebrew',3,'Korean',3,'Persian',3,'Sanskrit',3,'Urdu',3,'Arabic',2,'English',2,'Japanese',2,'Russian',2],'pub_date'=>['2008',4,'1976',2,'1986',2,'1990',2,'1997',2,'2000',2,'1941',1,'1946',1,'1952',1,'1962',1],'subject_era_facet'=>['20th century',3,'1997-',2,'21st century',2,'1990-',1,'2005-2015',1,'Koryo\xCC\x86 period, 935-1392',1],'subject_geo_facet'=>['India',2,'Iran',2,'Japan',2,'Bon-brgya (China)',1,'Bridgeton',1,'China',1,'Economic history',1,'Hong Kong (China)',1,'Islamic countries',1,'Israel',1],'subject_topic_facet'=>['Japanese drama',2,'Kubo, Sakae, 1901-1958',2,'Political plays, Japanese',2,'Theater',2,'Women',2,'Accident insurance',1,'Buddhism',1,'Delaware Indians',1,'Delaware women',1,'Education and state',1]},'facet_dates'=>{},'facet_ranges'=>{}}}" - http_version: "1.1" - recorded_at: Thu, 16 Aug 2012 20:43:20 GMT -- request: - method: get - uri: http://127.0.0.1:8983/solr/select?wt=ruby&rows=25&fl=id%2C+title_display%2C+author_display%2C+format%2C+timestamp&sort=timestamp+asc&start=0 - body: - encoding: US-ASCII - string: "" - headers: {} - - response: - status: - code: 200 - message: OK - headers: - content-type: - - text/plain; charset=utf-8 - connection: - - close - body: - encoding: ASCII-8BIT - string: "{'responseHeader'=>{'status'=>0,'QTime'=>4,'params'=>{'fl'=>'id, title_display, author_display, format, timestamp','sort'=>'timestamp asc','wt'=>'ruby','start'=>'0','rows'=>'25'}},'response'=>{'numFound'=>30,'start'=>0,'docs'=>[{'author_display'=>'Ayaz, Shaikh, 1923-1997','format'=>'Book','title_display'=>'Fikr-i Aya\xCC\x84z','id'=>'00282214','timestamp'=>'2012-08-01T16:49:55.214Z'},{'author_display'=>'Ayaz, Shaikh, 1923-1997','format'=>'Book','title_display'=>'Sa\xCC\x84hiva\xCC\x84l jail ki\xCC\x84 d\xCC\xA3a\xCC\x84\xCA\xBCiri\xCC\x84','id'=>'00282371','timestamp'=>'2012-08-01T16:49:55.249Z'},{'title_display'=>'Naqdi\xCC\x84 bara\xCC\x84-yi tama\xCC\x84m-i fus\xCC\xA3u\xCC\x84l','id'=>'00313831','author_display'=>'Nu\xCC\x84ri\xCC\x84, \xCA\xBBAbd Alla\xCC\x84h, 1949-','format'=>'Book','timestamp'=>'2012-08-01T16:49:55.276Z'},{'author_display'=>'Yoshida, Hajime, 1934-','format'=>'Book','title_display'=>'Kubo Sakae \"Kazanbaichi\" o yomu','id'=>'00314247','timestamp'=>'2012-08-01T16:49:55.307Z'},{'author_display'=>'Vi\xEF\xB8\xA0a\xEF\xB8\xA1tkin, M. P. (Mikhail Porfir\xCA\xB9evich), 1895-1967','format'=>'Book','title_display'=>'Ocherki po istorii Kazakhskoi\xCC\x86 SSR','id'=>'43037890','timestamp'=>'2012-08-01T16:49:55.322Z'},{'author_display'=>'Korea (North)','format'=>'Book','title_display'=>'Konstitut\xEF\xB8\xA0s\xEF\xB8\xA1ii\xEF\xB8\xA0a\xEF\xB8\xA1 i osnovnye zakonodatel\xCA\xB9nye akty Korei\xCC\x86skoi\xCC\x86 Narodno-Demokraticheskoi\xCC\x86 Respubliki','id'=>'53029833','timestamp'=>'2012-08-01T16:49:55.336Z'},{'title_display'=>'Koryo\xCC\x86 inmul yo\xCC\x86lcho\xCC\x86n','id'=>'77826928','format'=>'Book','timestamp'=>'2012-08-01T16:49:55.353Z'},{'author_display'=>'Parikshit Sharma, Ogeti, 1930-','format'=>'Book','title_display'=>'Yas\xCC\x81odhara\xCC\x84-maha\xCC\x84ka\xCC\x84vyam','id'=>'78908283','timestamp'=>'2012-08-01T16:49:55.366Z'},{'author_display'=>'Is\xCC\xA3la\xCC\x84h\xCC\xA3i\xCC\x84, Ami\xCC\x84n Ah\xCC\xA3san, 1904-1997','format'=>'Book','title_display'=>'Pa\xCC\x84kista\xCC\x84ni\xCC\x84 \xCA\xBBaurat dora\xCC\x84he par','id'=>'79930185','timestamp'=>'2012-08-01T16:49:55.377Z'},{'author_display'=>'Na\xCC\x84ra\xCC\x84yan\xCC\xA3apan\xCC\xA3d\xCC\xA3ita, 17th cent','format'=>'Book','title_display'=>'A\xCC\x84s\xCC\x81les\xCC\xA3a\xCC\x84s\xCC\x81ataka of Na\xCC\x84ra\xCC\x84yan\xCC\xA3a Pan\xCC\xA3d\xCC\xA3ita','id'=>'85910001','timestamp'=>'2012-08-01T16:49:55.387Z'},{'title_display'=>'Shodede-yam Yehudiyim','id'=>'86207417','author_display'=>'Finkel, Chaim Jacob','format'=>'Book','timestamp'=>'2012-08-01T16:49:55.402Z'},{'title_display'=>'A\xCC\x84shna\xCC\x84\xCA\xBCi\xCC\x84 ba\xCC\x84 h\xCC\xA3awzah\xCA\xB9ha\xCC\x84-yi \xCA\xBBilmi\xCC\x84yah-\xCA\xBCi Shi\xCC\x84\xCA\xBBah dar t\xCC\xA3u\xCC\x84l-i ta\xCC\x84ri\xCC\x84kh','id'=>'87931798','author_display'=>'Muvah\xCC\xA3h\xCC\xA3id Abt\xCC\xA3ah\xCC\xA3i\xCC\x84, H\xCC\xA3ujjat','format'=>'Book','timestamp'=>'2012-08-01T16:49:55.419Z'},{'author_display'=>'Lomt\xCA\xBBat\xCA\xBBiz\xCC\x87e, C\xCC\x8Cola, 1879-1915','format'=>'Book','title_display'=>'Mrecvelobis mus\xCC\x8Cakis c\xCA\xBBxovrebis cesi','id'=>'90142413','timestamp'=>'2012-08-01T16:49:55.435Z'},{'title_display'=>'Pukhan po\xCC\x86mnyo\xCC\x86ngjip','id'=>'92117465','author_display'=>'Korea (North)','format'=>'Book','timestamp'=>'2012-08-01T16:49:55.447Z'},{'title_display'=>'Sefer Mishnah berurah','id'=>'92828023','author_display'=>'Israel Meir, ha-Kohen, 1838-1933','format'=>'Book','timestamp'=>'2012-08-01T16:49:55.464Z'},{'title_display'=>'Ajikto ku\xCC\x86ro\xCC\x86k cho\xCC\x86ro\xCC\x86k sasimnikka','id'=>'94120425','author_display'=>'Kim, Hong-sin, 1947-','format'=>'Book','timestamp'=>'2012-08-01T16:49:55.488Z'},{'title_display'=>'Ma\xCA\xBBrakah-\xCA\xBCi jaha\xCC\x84n\xCA\xB9bi\xCC\x84ni\xCC\x84\xCA\xB9ha\xCC\x84','id'=>'96933325','author_display'=>'Raja\xCC\x84yi\xCC\x84, Farhang, 1952 or 3-','format'=>'Book','timestamp'=>'2012-08-01T16:49:55.502Z'},{'author_display'=>'Na\xCC\x84ra\xCC\x84yan\xCC\xA3a Pan\xCC\xA3d\xCC\xA3ita\xCC\x84ca\xCC\x84rya, 13th cent','format'=>'Book','title_display'=>'Sumadhvavijayah\xCC\xA3','id'=>'2001417245','timestamp'=>'2012-08-01T16:49:55.515Z'},{'title_display'=>'al-H\xCC\xA3arb fi\xCC\x84 al-alfi\xCC\x84yah al-tha\xCC\x84lithah','id'=>'2003546302','author_display'=>'Wuld Mawla\xCC\x84y al-Zayn, Sayyid Muh\xCC\xA3ammad wuld Sayyid','format'=>'Book','timestamp'=>'2012-08-01T16:49:55.529Z'},{'author_display'=>'Bstan-\xCA\xBCdzin-mkhas-grub, 1967-','format'=>'Book','title_display'=>'Bon-brgya\xCA\xBCi lo rgyus lugs gn\xCC\x83is gsal ba\xCA\xBCi me lon\xCC\x87 z\xCC\x81es bya ba bz\xCC\x81ugs so','id'=>'2004310986','timestamp'=>'2012-08-01T16:49:55.539Z'},{'title_display'=>'Thuqu\xCC\x84b fi\xCC\x84 \xCA\xBBaql al-ummah','id'=>'2005461726','author_display'=>'Abu\xCC\x84 al-Khayr, \xCA\xBBAli\xCC\x84 \xCA\xBBAbd al-H\xCC\xA3ami\xCC\x84d','format'=>'Book','timestamp'=>'2012-08-01T16:49:55.551Z'},{'format'=>'Book','title_display'=>'Bituah\xCC\xA3 u-vit\xCC\xA3ah\xCC\xA3on sotsyali','id'=>'2005553155','timestamp'=>'2012-08-01T16:49:55.57Z'},{'title_display'=>'\"Strong Medicine speaks\"','id'=>'2007020969','author_display'=>'Hearth, Amy Hill, 1958-','format'=>'Book','timestamp'=>'2012-08-01T16:49:55.59Z'},{'title_display'=>'Dris lan don gcig ma','id'=>'2008305903','author_display'=>'Dkon-mchog-rgya-mtsho, Ra-se, 1968-','format'=>'Book','timestamp'=>'2012-08-01T16:49:55.602Z'},{'title_display'=>'Pluvial nectar of blessings','id'=>'2008308175','author_display'=>'N\xCC\x87ag-dban\xCC\x87-blo-bzan\xCC\x87-rgya-mtsho, Dalai Lama V, 1617-1682','format'=>'Book','timestamp'=>'2012-08-01T16:49:55.621Z'}]},'facet_counts'=>{'facet_queries'=>{},'facet_fields'=>{'format'=>['Book',30],'lc_1letter_facet'=>['B - Philosophy, Psychology, Religion',6,'D - World History',6,'H - Social Sciences',4,'P - Language & Literature',4,'M - Music',3,'K - Law',2,'E - History of the Americas (General)',1,'G - Geography, Anthropology, Recreation',1,'U - Military Science',1],'lc_alpha_facet'=>['DS',5,'BQ',3,'PK',3,'BP',2,'HQ',2,'KPC',2,'BM',1,'DK',1,'E',1,'G',1],'lc_b4cutter_facet'=>['KPC13',2,'BM520.88.A53',1,'BP161.3',1,'BP44',1,'BQ4036',1,'BQ5593.P3',1,'BQ7684.4',1,'DK861.K3',1,'DS274',1,'DS318.84.N87',1],'language_facet'=>['Tibetan',6,'Hebrew',3,'Korean',3,'Persian',3,'Sanskrit',3,'Urdu',3,'Arabic',2,'English',2,'Japanese',2,'Russian',2],'pub_date'=>['2008',4,'1976',2,'1986',2,'1990',2,'1997',2,'2000',2,'1941',1,'1946',1,'1952',1,'1962',1],'subject_era_facet'=>['20th century',3,'1997-',2,'21st century',2,'1990-',1,'2005-2015',1,'Koryo\xCC\x86 period, 935-1392',1],'subject_geo_facet'=>['India',2,'Iran',2,'Japan',2,'Bon-brgya (China)',1,'Bridgeton',1,'China',1,'Economic history',1,'Hong Kong (China)',1,'Islamic countries',1,'Israel',1],'subject_topic_facet'=>['Japanese drama',2,'Kubo, Sakae, 1901-1958',2,'Political plays, Japanese',2,'Theater',2,'Women',2,'Accident insurance',1,'Buddhism',1,'Delaware Indians',1,'Delaware women',1,'Education and state',1]},'facet_dates'=>{},'facet_ranges'=>{}}}" - http_version: "1.1" - recorded_at: Thu, 16 Aug 2012 20:43:20 GMT -- request: - method: get - uri: http://127.0.0.1:8983/solr/select?wt=ruby&fq=id%3A%2200282214%22&rows=10&fl=id%2C+title_display%2C+author_display%2C+format%2C+timestamp - body: - encoding: US-ASCII - string: "" - headers: {} - - response: - status: - code: 200 - message: OK - headers: - content-type: - - text/plain; charset=utf-8 - connection: - - close - body: - encoding: ASCII-8BIT - string: "{'responseHeader'=>{'status'=>0,'QTime'=>3,'params'=>{'fl'=>'id, title_display, author_display, format, timestamp','wt'=>'ruby','fq'=>'id:\"00282214\"','rows'=>'10'}},'response'=>{'numFound'=>1,'start'=>0,'docs'=>[{'author_display'=>'Ayaz, Shaikh, 1923-1997','format'=>'Book','title_display'=>'Fikr-i Aya\xCC\x84z','id'=>'00282214','timestamp'=>'2012-08-01T16:49:55.214Z'}]},'facet_counts'=>{'facet_queries'=>{},'facet_fields'=>{'format'=>['Book',1],'lc_1letter_facet'=>['P - Language & Literature',1],'lc_alpha_facet'=>['PK',1],'lc_b4cutter_facet'=>['PK2788.9.A9',1],'language_facet'=>['Urdu',1],'pub_date'=>['1998',1],'subject_era_facet'=>[],'subject_geo_facet'=>[],'subject_topic_facet'=>[]},'facet_dates'=>{},'facet_ranges'=>{}}}" - http_version: "1.1" - recorded_at: Thu, 16 Aug 2012 20:43:20 GMT -recorded_with: VCR 2.2.4 From 1a01fc9054c97b411538eba0e8da1f4d5400aa26 Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Thu, 28 Sep 2017 12:22:50 -0400 Subject: [PATCH 16/67] Remove Combustion - Remove gem dependency - Remove test rails application at /spec/internal - Remove configuration from spec_helper.rb --- .gitignore | 2 - blacklight_oai_provider.gemspec | 2 - .../app/controllers/application_controller.rb | 4 -- spec/internal/app/models/solr_document.rb | 3 -- spec/internal/config/database.yml | 3 -- spec/internal/config/routes.rb | 6 --- spec/internal/config/solr.yml | 18 ------- spec/internal/db/schema.rb | 53 ------------------- spec/internal/log/.gitignore | 1 - spec/internal/public/favicon.ico | 0 spec/spec_helper.rb | 8 --- 11 files changed, 100 deletions(-) delete mode 100644 spec/internal/app/controllers/application_controller.rb delete mode 100644 spec/internal/app/models/solr_document.rb delete mode 100644 spec/internal/config/database.yml delete mode 100644 spec/internal/config/routes.rb delete mode 100644 spec/internal/config/solr.yml delete mode 100644 spec/internal/db/schema.rb delete mode 100644 spec/internal/log/.gitignore delete mode 100644 spec/internal/public/favicon.ico diff --git a/.gitignore b/.gitignore index 66f75b6..72b305c 100644 --- a/.gitignore +++ b/.gitignore @@ -14,5 +14,3 @@ # rspec failure tracking .rspec_status -# Ignoring files created for dummy/test application. -spec/internal/db/*.sqlite diff --git a/blacklight_oai_provider.gemspec b/blacklight_oai_provider.gemspec index fc22d39..206af43 100644 --- a/blacklight_oai_provider.gemspec +++ b/blacklight_oai_provider.gemspec @@ -25,6 +25,4 @@ Gem::Specification.new do |s| s.add_development_dependency 'capybara' s.add_development_dependency 'solr_wrapper' - s.add_development_dependency 'combustion' - s.add_development_dependency 'sqlite3' end diff --git a/spec/internal/app/controllers/application_controller.rb b/spec/internal/app/controllers/application_controller.rb deleted file mode 100644 index 603d2e0..0000000 --- a/spec/internal/app/controllers/application_controller.rb +++ /dev/null @@ -1,4 +0,0 @@ -class ApplicationController < ActionController::Base - include Blacklight::Controller - -end diff --git a/spec/internal/app/models/solr_document.rb b/spec/internal/app/models/solr_document.rb deleted file mode 100644 index 1a3276e..0000000 --- a/spec/internal/app/models/solr_document.rb +++ /dev/null @@ -1,3 +0,0 @@ -class SolrDocument - include Blacklight::Solr::Document -end diff --git a/spec/internal/config/database.yml b/spec/internal/config/database.yml deleted file mode 100644 index b978119..0000000 --- a/spec/internal/config/database.yml +++ /dev/null @@ -1,3 +0,0 @@ -test: - adapter: sqlite3 - database: db/combustion_test.sqlite diff --git a/spec/internal/config/routes.rb b/spec/internal/config/routes.rb deleted file mode 100644 index bec17e5..0000000 --- a/spec/internal/config/routes.rb +++ /dev/null @@ -1,6 +0,0 @@ -Rails.application.routes.draw do - Blacklight.add_routes(self) - - root :to => "catalog#index" - # -end diff --git a/spec/internal/config/solr.yml b/spec/internal/config/solr.yml deleted file mode 100644 index 902111e..0000000 --- a/spec/internal/config/solr.yml +++ /dev/null @@ -1,18 +0,0 @@ -# = jetty_path key -# each environment can have a jetty_path with absolute or relative -# (to app root) path to a jetty/solr install. This is used -# by the rake tasks that start up solr automatically for testing -# and by rake solr:marc:index. -# -# jetty_path is not used by a running Blacklight application -# at all. In general you do NOT need to deploy solr in Jetty, you can deploy it -# however you want. -# jetty_path is only required for rake tasks that need to know -# how to start up solr, generally for automated testing. - -development: - url: http://127.0.0.1:8983/solr -test: &test - url: http://127.0.0.1:8983/solr -cucumber: - <<: *test diff --git a/spec/internal/db/schema.rb b/spec/internal/db/schema.rb deleted file mode 100644 index 4b24951..0000000 --- a/spec/internal/db/schema.rb +++ /dev/null @@ -1,53 +0,0 @@ -# encoding: UTF-8 -# This file is auto-generated from the current state of the database. Instead -# of editing this file, please use the migrations feature of Active Record to -# incrementally modify your database, and then regenerate this schema definition. -# -# Note that this schema.rb definition is the authoritative source for your -# database schema. If you need to create the application database on another -# system, you should be using db:schema:load, not running all the migrations -# from scratch. The latter is a flawed and unsustainable approach (the more migrations -# you'll amass, the slower it'll run and the greater likelihood for issues). -# -# It's strongly recommended to check this file into your version control system. - -ActiveRecord::Schema.define(:version => 20111123152341) do - - create_table "bookmarks", :force => true do |t| - t.integer "user_id", :null => false - t.string "document_id" - t.string "title" - t.datetime "created_at" - t.datetime "updated_at" - t.string "user_type" - end - - create_table "searches", :force => true do |t| - t.text "query_params" - t.integer "user_id" - t.datetime "created_at" - t.datetime "updated_at" - t.string "user_type" - end - - add_index "searches", ["user_id"], :name => "index_searches_on_user_id" - - create_table "users", :force => true do |t| - t.string "email", :default => "", :null => false - t.string "encrypted_password", :limit => 128, :default => "", :null => false - t.string "reset_password_token" - t.datetime "reset_password_sent_at" - t.datetime "remember_created_at" - t.integer "sign_in_count", :default => 0 - t.datetime "current_sign_in_at" - t.datetime "last_sign_in_at" - t.string "current_sign_in_ip" - t.string "last_sign_in_ip" - t.datetime "created_at" - t.datetime "updated_at" - end - - add_index "users", ["email"], :name => "index_users_on_email", :unique => true - add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token", :unique => true - -end diff --git a/spec/internal/log/.gitignore b/spec/internal/log/.gitignore deleted file mode 100644 index bf0824e..0000000 --- a/spec/internal/log/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.log \ No newline at end of file diff --git a/spec/internal/public/favicon.ico b/spec/internal/public/favicon.ico deleted file mode 100644 index e69de29..0000000 diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index b156880..52b3ede 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,11 +1,3 @@ -require 'bundler' - -Bundler.require :default, :development - -Combustion.initialize! :all do - config.assets.precompile += %w( oai2.xsl ) ## Needs to be added as a generator -end - # Setup blacklight environment Blacklight.solr_config = { :url => 'http://127.0.0.1:8983/solr' } CatalogController.send(:include, BlacklightOaiProvider::ControllerExtension) From 1f2dffbb6e8b2eea6deb7446d4ea350380a7af14 Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Thu, 28 Sep 2017 12:26:40 -0400 Subject: [PATCH 17/67] Add engine_cart --- .gitignore | 1 + Gemfile | 35 +++++++++++++++++++++++++++ blacklight_oai_provider.gemspec | 2 +- spec/spec_helper.rb | 42 +++++++++++++++++++-------------- 4 files changed, 61 insertions(+), 19 deletions(-) diff --git a/.gitignore b/.gitignore index 72b305c..a1831c2 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ # rspec failure tracking .rspec_status +.internal_test_app diff --git a/Gemfile b/Gemfile index d65e2a6..41d9afb 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,38 @@ source 'http://rubygems.org' gemspec + +# BEGIN ENGINE_CART BLOCK +# engine_cart: 1.1.0 +# engine_cart stanza: 0.10.0 +# the below comes from engine_cart, a gem used to test this Rails engine gem in the context of a Rails app. +file = File.expand_path('Gemfile', ENV['ENGINE_CART_DESTINATION'] || ENV['RAILS_ROOT'] || File.expand_path('.internal_test_app', File.dirname(__FILE__))) +if File.exist?(file) + begin + eval_gemfile file + rescue Bundler::GemfileError => e + Bundler.ui.warn '[EngineCart] Skipping Rails application dependencies:' + Bundler.ui.warn e.message + end +else + Bundler.ui.warn "[EngineCart] Unable to find test application dependencies in #{file}, using placeholder dependencies" + + if ENV['RAILS_VERSION'] + if ENV['RAILS_VERSION'] == 'edge' + gem 'rails', github: 'rails/rails' + ENV['ENGINE_CART_RAILS_OPTIONS'] = '--edge --skip-turbolinks' + else + gem 'rails', ENV['RAILS_VERSION'] + end + end + + case ENV['RAILS_VERSION'] + when /^4.2/ + gem 'responders', '~> 2.0' + gem 'sass-rails', '>= 5.0' + gem 'coffee-rails', '~> 4.1.0' + when /^4.[01]/ + gem 'sass-rails', '< 5.0' + end +end +# END ENGINE_CART BLOCK diff --git a/blacklight_oai_provider.gemspec b/blacklight_oai_provider.gemspec index 206af43..6b0ebcb 100644 --- a/blacklight_oai_provider.gemspec +++ b/blacklight_oai_provider.gemspec @@ -17,7 +17,6 @@ Gem::Specification.new do |s| s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } s.require_paths = ["lib"] - s.add_dependency "rails", "~> 4.0" s.add_dependency "blacklight", "~> 4.0" s.add_dependency "oai" @@ -25,4 +24,5 @@ Gem::Specification.new do |s| s.add_development_dependency 'capybara' s.add_development_dependency 'solr_wrapper' + s.add_development_dependency 'engine_cart' end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 52b3ede..b1bf605 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,23 +1,29 @@ -# Setup blacklight environment -Blacklight.solr_config = { :url => 'http://127.0.0.1:8983/solr' } -CatalogController.send(:include, BlacklightOaiProvider::ControllerExtension) - -class SolrDocument - include Blacklight::Solr::Document - include BlacklightOaiProvider::SolrDocumentExtension - use_extension( Blacklight::Solr::Document::DublinCore) - field_semantics.merge!( - :title => "title_display", - :author => "author_display", - :language => "language_facet", - :format => "format" - ) - -end - +ENV["RAILS_ENV"] ||= 'test' +require 'rsolr' +require 'engine_cart' +EngineCart.load_application! require 'rspec/rails' -require 'capybara/rails' +require 'capybara/rspec' + +# +# # Setup blacklight environment +# Blacklight.solr_config = { :url => 'http://127.0.0.1:8983/solr' } +# CatalogController.send(:include, BlacklightOaiProvider::ControllerExtension) +# +# class SolrDocument +# include Blacklight::Solr::Document +# include BlacklightOaiProvider::SolrDocumentExtension +# use_extension( Blacklight::Solr::Document::DublinCore) +# field_semantics.merge!( +# :title => "title_display", +# :author => "author_display", +# :language => "language_facet", +# :format => "format" +# ) +# +# end RSpec.configure do |config| + config.infer_spec_type_from_file_location! end From 0e3609a2387bee391d6548a669a384b66de7724e Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Thu, 28 Sep 2017 12:39:52 -0400 Subject: [PATCH 18/67] Rename engine install generator. --- .../blacklight_oai_provider_generator.rb | 27 ------------------- .../install_generator.rb | 27 +++++++++++++++++++ 2 files changed, 27 insertions(+), 27 deletions(-) delete mode 100644 lib/generators/blacklight_oai_provider/blacklight_oai_provider_generator.rb create mode 100644 lib/generators/blacklight_oai_provider/install_generator.rb diff --git a/lib/generators/blacklight_oai_provider/blacklight_oai_provider_generator.rb b/lib/generators/blacklight_oai_provider/blacklight_oai_provider_generator.rb deleted file mode 100644 index 0fc8f37..0000000 --- a/lib/generators/blacklight_oai_provider/blacklight_oai_provider_generator.rb +++ /dev/null @@ -1,27 +0,0 @@ -require 'rails/generators' - -class BlacklightOaiProviderGenerator < Rails::Generators::Base - - argument :model_name, :type => :string, :default => "SolrDocument" - argument :controller_name, :type => :string, :default => "CatalogController" - - def inject_solr_document_extension - file_path = "app/models/#{model_name.underscore}.rb" - - if File.exists? file_path - inject_into_file file_path, :after => "include Blacklight::Solr::Document" do - "\n SolrDocument.use_extension( BlacklightOaiProvider::SolrDocumentExtension )\n" - end - end - end - - def inject_catalog_controller_extension - file_path = "app/controllers/#{controller_name.underscore}.rb" - if File.exists? file_path - inject_into_file file_path, :after => "include Blacklight::Catalog" do - "\n include BlacklightOaiProvider::ControllerExtension\n" - end - end - - end -end diff --git a/lib/generators/blacklight_oai_provider/install_generator.rb b/lib/generators/blacklight_oai_provider/install_generator.rb new file mode 100644 index 0000000..d0a1c3a --- /dev/null +++ b/lib/generators/blacklight_oai_provider/install_generator.rb @@ -0,0 +1,27 @@ +require 'rails/generators' + +module BlacklightOaiProvider + class InstallGenerator < Rails::Generators::Base + argument :model_name, :type => :string, :default => "SolrDocument" + argument :controller_name, :type => :string, :default => "CatalogController" + + def inject_solr_document_extension + file_path = "app/models/#{model_name.underscore}.rb" + + if File.exists? file_path + inject_into_file file_path, :after => "include Blacklight::Solr::Document" do + "\n SolrDocument.use_extension( BlacklightOaiProvider::SolrDocumentExtension )\n" + end + end + end + + def inject_catalog_controller_extension + file_path = "app/controllers/#{controller_name.underscore}.rb" + if File.exists? file_path + inject_into_file file_path, :after => "include Blacklight::Catalog" do + "\n include BlacklightOaiProvider::ControllerExtension\n" + end + end + end + end +end From 60279d6e8774100c4fd9de12e27d96f137241171 Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Thu, 28 Sep 2017 12:42:50 -0400 Subject: [PATCH 19/67] Loading rake tasks for engine using railties. --- lib/blacklight_oai_provider.rb | 15 ++++++++------- lib/blacklight_oai_provider/engine.rb | 8 ++++++++ lib/railties/blacklight_oai_provider.rake | 14 ++++++++++++++ 3 files changed, 30 insertions(+), 7 deletions(-) create mode 100644 lib/railties/blacklight_oai_provider.rake diff --git a/lib/blacklight_oai_provider.rb b/lib/blacklight_oai_provider.rb index c87a068..220b4eb 100644 --- a/lib/blacklight_oai_provider.rb +++ b/lib/blacklight_oai_provider.rb @@ -1,7 +1,4 @@ -# BlacklightOaiProvider - module BlacklightOaiProvider - autoload :ControllerExtension, 'blacklight_oai_provider/controller_extension' autoload :SolrDocumentExtension, 'blacklight_oai_provider/solr_document_extension' autoload :SolrDocumentProvider, 'blacklight_oai_provider/solr_document_provider' @@ -11,14 +8,14 @@ module BlacklightOaiProvider require 'oai' require 'blacklight_oai_provider/version' require 'blacklight_oai_provider/engine' - + @omit_inject = {} def self.omit_inject=(value) value = Hash.new(true) if value == true - @omit_inject = value + @omit_inject = value end def self.omit_inject ; @omit_inject ; end - + def self.inject! unless BlacklightOaiProvider.omit_inject[:routes] Blacklight::Routes.send(:include, BlacklightOaiProvider::RouteSets) @@ -29,5 +26,9 @@ def self.inject! def self.safe_arr_add(array, element) array << element unless array.include?(element) end - + + # returns the full path the the blacklight plugin installation + def self.root + @root ||= File.expand_path(File.dirname(File.dirname(__FILE__))) + end end diff --git a/lib/blacklight_oai_provider/engine.rb b/lib/blacklight_oai_provider/engine.rb index e1788f2..4fcd2d2 100644 --- a/lib/blacklight_oai_provider/engine.rb +++ b/lib/blacklight_oai_provider/engine.rb @@ -13,5 +13,13 @@ class Engine < Rails::Engine config.to_prepare do BlacklightOaiProvider.inject! end + # Load rake tasks. + rake_tasks do + Dir.chdir(File.expand_path(File.join(File.dirname(__FILE__), '..'))) do + Dir.glob(File.join('railties', '*.rake')).each do |railtie| + load railtie + end + end + end end end diff --git a/lib/railties/blacklight_oai_provider.rake b/lib/railties/blacklight_oai_provider.rake new file mode 100644 index 0000000..378aaa2 --- /dev/null +++ b/lib/railties/blacklight_oai_provider.rake @@ -0,0 +1,14 @@ +namespace :blacklight_oai_provider do + # Copied index seeding task from newer versions of Blacklight + namespace :index do + desc "Put sample data into solr" + task :seed => [:environment] do + require 'yaml' + + docs = YAML.safe_load(File.open(File.join(BlacklightOaiProvider.root, 'solr', 'sample_solr_documents.yml'))) + conn = RSolr.connect(Blacklight.solr_config) + conn.add docs + conn.commit + end + end +end From af0cd14f8f7c005aad6ebdae4980a0442b4b59a3 Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Thu, 28 Sep 2017 12:45:11 -0400 Subject: [PATCH 20/67] Adding engine cart test app generator - Generator runs install rake task in blacklight and blacklight oai - Generator copies a solr.yml that matches our settings --- spec/test_app_templates/config/solr.yml | 9 ++++ .../lib/generators/test_app_generator.rb | 42 +++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 spec/test_app_templates/config/solr.yml create mode 100644 spec/test_app_templates/lib/generators/test_app_generator.rb diff --git a/spec/test_app_templates/config/solr.yml b/spec/test_app_templates/config/solr.yml new file mode 100644 index 0000000..36f6b50 --- /dev/null +++ b/spec/test_app_templates/config/solr.yml @@ -0,0 +1,9 @@ +development: + adapter: solr + url: <%= ENV['SOLR_URL'] || "http://127.0.0.1:8983/solr/blacklight-core" %> +test: &test + adapter: solr + url: <%= ENV['SOLR_URL'] || "http://127.0.0.1:#{ENV['TEST_JETTY_PORT'] || 8983}/solr/blacklight-core" %> +production: + adapter: solr + url: <%= ENV['SOLR_URL'] || "http://127.0.0.1:8983/solr/blacklight-core" %> diff --git a/spec/test_app_templates/lib/generators/test_app_generator.rb b/spec/test_app_templates/lib/generators/test_app_generator.rb new file mode 100644 index 0000000..56957f6 --- /dev/null +++ b/spec/test_app_templates/lib/generators/test_app_generator.rb @@ -0,0 +1,42 @@ +require 'rails/generators' + +class TestAppGenerator < Rails::Generators::Base + # source_root "./spec/test_app_templates" + source_root File.expand_path("../../../../spec/test_app_templates", __FILE__) + + # if you need to generate any additional configuration + # into the test app, this generator will be run immediately + # after setting up the application + + def run_blacklight_generator + say_status("warning", "GENERATING BL", :yellow) + + generate 'blacklight', '--devise' + end + + # Add favicon.ico to asset path + # ADD THIS LINE Rails.application.config.assets.precompile += %w( favicon.ico ) + # TO config/assets.rb + def add_favicon_to_asset_path + say_status("warning", "ADDING FAVICON TO ASSET PATH", :yellow) + + append_to_file 'config/initializers/assets.rb' do + 'Rails.application.config.assets.precompile += %w( favicon.ico )' + end + end + + + # Override solr.yml to match settings needed for solr_wrapper. + def update_solr_config + say_status("warning", "COPYING SOLR.YML", :yellow) + + remove_file "config/solr.yml" + copy_file "config/solr.yml", "config/solr.yml" + end + + def install_engine + say_status("warning", "GENERATING BL OAI PLUGIN", :yellow) + + generate 'blacklight_oai_provider:install' + end +end From fe5a12e3d90cd34d61261a55b218193bf79dd491 Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Thu, 28 Sep 2017 12:46:00 -0400 Subject: [PATCH 21/67] Adding rake tasks to run our rspec test with solr_wrapper and engine_cart. --- Rakefile | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Rakefile b/Rakefile index df0242c..66ba6ff 100644 --- a/Rakefile +++ b/Rakefile @@ -2,3 +2,24 @@ require 'rake' require 'bundler' Bundler::GemHelper.install_tasks + +require 'rspec/core/rake_task' +require 'engine_cart/rake_task' +require 'solr_wrapper' + +EngineCart.fingerprint_proc = EngineCart.rails_fingerprint_proc + +desc "Run specs" +RSpec::Core::RakeTask.new + +desc 'Run test suite' +task ci: ['engine_cart:generate'] do + SolrWrapper.wrap do |solr| + solr.with_collection(name: 'blacklight-core', dir: File.join(File.expand_path(File.dirname(__FILE__)), "solr", "conf")) do + within_test_app do + system "RAILS_ENV=test rake blacklight_oai_provider:index:seed" + end + Rake::Task['spec'].invoke + end + end +end From db49aa694a31daac728075035c61acdb6086b549 Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Thu, 28 Sep 2017 12:52:21 -0400 Subject: [PATCH 22/67] Namespacing XSL stylesheet in assets directory. --- .../{xsl => stylesheets/blacklight_oai_provider}/oai2.xsl | 0 lib/blacklight_oai_provider/controller_extension.rb | 6 +++--- 2 files changed, 3 insertions(+), 3 deletions(-) rename app/assets/{xsl => stylesheets/blacklight_oai_provider}/oai2.xsl (100%) diff --git a/app/assets/xsl/oai2.xsl b/app/assets/stylesheets/blacklight_oai_provider/oai2.xsl similarity index 100% rename from app/assets/xsl/oai2.xsl rename to app/assets/stylesheets/blacklight_oai_provider/oai2.xsl diff --git a/lib/blacklight_oai_provider/controller_extension.rb b/lib/blacklight_oai_provider/controller_extension.rb index f8f2b65..18a21fd 100644 --- a/lib/blacklight_oai_provider/controller_extension.rb +++ b/lib/blacklight_oai_provider/controller_extension.rb @@ -1,6 +1,6 @@ # Meant to be applied on top of a controller that implements # Blacklight::SolrHelper. Will inject range limiting behaviors -# to solr parameters creation. +# to solr parameters creation. module BlacklightOaiProvider::ControllerExtension def self.included(some_class) some_class.helper_method :oai_config @@ -9,10 +9,10 @@ def self.included(some_class) # Action method of our own! # Delivers a _partial_ that's a display of a single fields range facets. # Used when we need a second Solr query to get range facets, after the - # first found min/max from result set. + # first found min/max from result set. def oai options = params.delete_if { |k,v| %w{controller action}.include?(k) } - render :text => oai_provider.process_request(options).gsub('', "\n"), :content_type => 'text/xml' + render :text => oai_provider.process_request(options).gsub('', "\n"), :content_type => 'text/xml' end # Uses Blacklight.config, needs to be modified when From 96172f9f977871937139a1588becde16584254b5 Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Thu, 28 Sep 2017 12:53:23 -0400 Subject: [PATCH 23/67] Adding XSL stylesheet to list of assets to be precompiled by default. --- lib/blacklight_oai_provider/engine.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/blacklight_oai_provider/engine.rb b/lib/blacklight_oai_provider/engine.rb index 4fcd2d2..8908146 100644 --- a/lib/blacklight_oai_provider/engine.rb +++ b/lib/blacklight_oai_provider/engine.rb @@ -4,15 +4,21 @@ module BlacklightOaiProvider class Engine < Rails::Engine - + # Do these things in a to_prepare block, to try and make them work # in development mode with class-reloading. The trick is we can't # be sure if the controllers we're modifying are being reloaded in # dev mode, if they are in the BL plugin and haven't been copied to - # local, they won't be. But we do our best. + # local, they won't be. But we do our best. config.to_prepare do BlacklightOaiProvider.inject! end + + # Add XSL Stylesheet to list of assets to be precompiled. + initializer "blacklight_oai_provider.assets.precompile" do |app| + app.config.assets.precompile += %w( blacklight_oai_provider/oai2.xsl ) + end + # Load rake tasks. rake_tasks do Dir.chdir(File.expand_path(File.join(File.dirname(__FILE__), '..'))) do From 41b4350c4a4aa06a18baeda82f42cfe8fb2825a1 Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Thu, 28 Sep 2017 12:53:51 -0400 Subject: [PATCH 24/67] Moved acceptance tests to feature test directory. --- blacklight_oai_provider.gemspec | 3 +-- spec/{acceptance => features}/blacklight_oai_provider_spec.rb | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) rename spec/{acceptance => features}/blacklight_oai_provider_spec.rb (92%) diff --git a/blacklight_oai_provider.gemspec b/blacklight_oai_provider.gemspec index 6b0ebcb..76c57d6 100644 --- a/blacklight_oai_provider.gemspec +++ b/blacklight_oai_provider.gemspec @@ -20,9 +20,8 @@ Gem::Specification.new do |s| s.add_dependency "rails", "~> 4.0" s.add_dependency "blacklight", "~> 4.0" s.add_dependency "oai" - s.add_development_dependency 'rspec-rails' + s.add_development_dependency 'rspec-rails', "~> 3.0" s.add_development_dependency 'capybara' s.add_development_dependency 'solr_wrapper' - s.add_development_dependency 'engine_cart' end diff --git a/spec/acceptance/blacklight_oai_provider_spec.rb b/spec/features/blacklight_oai_provider_spec.rb similarity index 92% rename from spec/acceptance/blacklight_oai_provider_spec.rb rename to spec/features/blacklight_oai_provider_spec.rb index 8623be8..46c01fb 100644 --- a/spec/acceptance/blacklight_oai_provider_spec.rb +++ b/spec/features/blacklight_oai_provider_spec.rb @@ -2,7 +2,6 @@ require 'spec_helper' describe 'Blacklight oai provider' do - use_vcr_cassette "solr" before do CatalogController.configure_blacklight do |config| config.index.show_link = 'title_display' @@ -44,6 +43,6 @@ it "document page" do visit '/catalog/oai?verb=GetRecord&identifier=00282214&metadataPrefix=oai_dc' - page.should have_xpath('//title', :content => 'Fikr-i Ayāz') + page.should have_xpath('//title', :text => 'Fikr-i Ayāz') end end From ecceec2e4aa92651d77ee30b03ecdf5645b56633 Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Thu, 28 Sep 2017 13:03:18 -0400 Subject: [PATCH 25/67] Default rake task is now :ci --- .travis.yml | 3 --- Rakefile | 2 ++ 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2a4949e..1f3440c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,6 +12,3 @@ rvm: before_install: - gem install bundler - -script: - - bundle exec rspec spec diff --git a/Rakefile b/Rakefile index 66ba6ff..5015c74 100644 --- a/Rakefile +++ b/Rakefile @@ -9,6 +9,8 @@ require 'solr_wrapper' EngineCart.fingerprint_proc = EngineCart.rails_fingerprint_proc +task :default => :ci + desc "Run specs" RSpec::Core::RakeTask.new From 51b3554e81670912b4742d0a1c59e02accf97c41 Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Mon, 2 Oct 2017 10:52:33 -0400 Subject: [PATCH 26/67] Adding more configuration to generated test application. - Semantic field hash in BL needs to be updated. - Returning all fields with results. - Adding oai blacklight configuration. --- spec/spec_helper.rb | 18 ---------- .../lib/generators/test_app_generator.rb | 35 +++++++++++++++++-- 2 files changed, 33 insertions(+), 20 deletions(-) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index b1bf605..7820b2c 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -6,24 +6,6 @@ require 'rspec/rails' require 'capybara/rspec' -# -# # Setup blacklight environment -# Blacklight.solr_config = { :url => 'http://127.0.0.1:8983/solr' } -# CatalogController.send(:include, BlacklightOaiProvider::ControllerExtension) -# -# class SolrDocument -# include Blacklight::Solr::Document -# include BlacklightOaiProvider::SolrDocumentExtension -# use_extension( Blacklight::Solr::Document::DublinCore) -# field_semantics.merge!( -# :title => "title_display", -# :author => "author_display", -# :language => "language_facet", -# :format => "format" -# ) -# -# end - RSpec.configure do |config| config.infer_spec_type_from_file_location! end diff --git a/spec/test_app_templates/lib/generators/test_app_generator.rb b/spec/test_app_templates/lib/generators/test_app_generator.rb index 56957f6..ff77cfa 100644 --- a/spec/test_app_templates/lib/generators/test_app_generator.rb +++ b/spec/test_app_templates/lib/generators/test_app_generator.rb @@ -1,7 +1,6 @@ require 'rails/generators' class TestAppGenerator < Rails::Generators::Base - # source_root "./spec/test_app_templates" source_root File.expand_path("../../../../spec/test_app_templates", __FILE__) # if you need to generate any additional configuration @@ -25,7 +24,6 @@ def add_favicon_to_asset_path end end - # Override solr.yml to match settings needed for solr_wrapper. def update_solr_config say_status("warning", "COPYING SOLR.YML", :yellow) @@ -39,4 +37,37 @@ def install_engine generate 'blacklight_oai_provider:install' end + + def add_test_blacklight_oai_config + say_status("warning", "ADDING BL OIA-PMH CONFIG") + + insert_into_file "app/controllers/catalog_controller.rb", :after => " config.default_solr_params = { \n" do + " :fl => '*',\n" + end + + insert_into_file "app/controllers/catalog_controller.rb", :after => "configure_blacklight do |config|\n" do +%{ + config.oai = { + :provider => { + :repository_name => 'Test', + :repository_url => 'http://localhost', + :record_prefix => '', + :admin_email => 'root@localhost' + }, + :document => { + :timestamp => 'timestamp', + :limit => 25 + } + } +} + end + + insert_into_file "app/models/solr_document.rb", :after => " field_semantics.merge!( \n" do +%{ + :creator => "author_display", + :date => "pub_date", + :subject => "subject_topic_facet", +} + end + end end From 2ef4958a378759f762346d8cdf3ec83cb376c4f0 Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Mon, 2 Oct 2017 15:33:20 -0400 Subject: [PATCH 27/67] Adding exception class to engine. Throwing error when timestamp field missing from solr document. --- lib/blacklight_oai_provider.rb | 1 + lib/blacklight_oai_provider/exceptions.rb | 9 +++++++++ lib/blacklight_oai_provider/solr_document_extension.rb | 5 ++++- 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 lib/blacklight_oai_provider/exceptions.rb diff --git a/lib/blacklight_oai_provider.rb b/lib/blacklight_oai_provider.rb index 220b4eb..f8d9ab2 100644 --- a/lib/blacklight_oai_provider.rb +++ b/lib/blacklight_oai_provider.rb @@ -1,5 +1,6 @@ module BlacklightOaiProvider autoload :ControllerExtension, 'blacklight_oai_provider/controller_extension' + autoload :Exceptions, 'blacklight_oai_provider/exceptions' autoload :SolrDocumentExtension, 'blacklight_oai_provider/solr_document_extension' autoload :SolrDocumentProvider, 'blacklight_oai_provider/solr_document_provider' autoload :SolrDocumentWrapper, 'blacklight_oai_provider/solr_document_wrapper' diff --git a/lib/blacklight_oai_provider/exceptions.rb b/lib/blacklight_oai_provider/exceptions.rb new file mode 100644 index 0000000..1c29ee7 --- /dev/null +++ b/lib/blacklight_oai_provider/exceptions.rb @@ -0,0 +1,9 @@ +module BlacklightOaiProvider + module Exceptions + class MissingTimestamp < StandardError + def initialize(msg="Missing required timestamp field") + super + end + end + end +end diff --git a/lib/blacklight_oai_provider/solr_document_extension.rb b/lib/blacklight_oai_provider/solr_document_extension.rb index 68ac030..2b01db9 100644 --- a/lib/blacklight_oai_provider/solr_document_extension.rb +++ b/lib/blacklight_oai_provider/solr_document_extension.rb @@ -2,8 +2,11 @@ # methods required by the ruby-oai provider module BlacklightOaiProvider::SolrDocumentExtension def timestamp - Time.parse get('timestamp') + timestamp = get('timestamp') + raise BlacklightOaiProvider::Exceptions::MissingTimestamp if timestamp.blank? + Time.parse timestamp end + def to_oai_dc export_as('oai_dc_xml') end From 97df3b7b41e0d5716e0cb4413d6ce28356b68d7e Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Tue, 10 Oct 2017 10:37:33 -0400 Subject: [PATCH 28/67] Adding default document params. Using searchHandler instead of documentHandler in tests. --- .../lib/generators/test_app_generator.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/spec/test_app_templates/lib/generators/test_app_generator.rb b/spec/test_app_templates/lib/generators/test_app_generator.rb index ff77cfa..ea11089 100644 --- a/spec/test_app_templates/lib/generators/test_app_generator.rb +++ b/spec/test_app_templates/lib/generators/test_app_generator.rb @@ -45,6 +45,17 @@ def add_test_blacklight_oai_config " :fl => '*',\n" end + insert_into_file "app/controllers/catalog_controller.rb", :after => " configure_blacklight do |config|\n" do +%{ + config.default_document_solr_params = { + :qt => 'search', + :fl => '*', + :rows => 1, + :q => '{!raw f=id v=$id}' + } +} + end + insert_into_file "app/controllers/catalog_controller.rb", :after => "configure_blacklight do |config|\n" do %{ config.oai = { From 816b9f64a4027323f3de72e54941f1885325375a Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Wed, 4 Oct 2017 10:50:28 -0400 Subject: [PATCH 29/67] Removing CatalogController configuration from tests. --- spec/features/blacklight_oai_provider_spec.rb | 24 ------------------- 1 file changed, 24 deletions(-) diff --git a/spec/features/blacklight_oai_provider_spec.rb b/spec/features/blacklight_oai_provider_spec.rb index 46c01fb..dd8506d 100644 --- a/spec/features/blacklight_oai_provider_spec.rb +++ b/spec/features/blacklight_oai_provider_spec.rb @@ -2,30 +2,6 @@ require 'spec_helper' describe 'Blacklight oai provider' do - before do - CatalogController.configure_blacklight do |config| - config.index.show_link = 'title_display' - config.default_solr_params = { - :rows => 10, - :fl => 'id, title_display, author_display, format, timestamp' - } - - config.oai = { - :provider => { - :repository_name => 'Test', - :repository_url => 'http://localhost', - :record_prefix => '', - :admin_email => 'root@localhost' - }, - :document => { - :timestamp => 'timestamp', - :limit => 25 - } - } - - end - end - it "root page" do visit '/catalog/oai' page.should have_content 'not a legal OAI-PMH verb' From 4ddb19d7cb8c35a5baa5b3cec79a274348182046 Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Wed, 4 Oct 2017 10:51:23 -0400 Subject: [PATCH 30/67] Tests need to updated to use a javascript driver to be true feature tests. --- spec/features/blacklight_oai_provider_spec.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spec/features/blacklight_oai_provider_spec.rb b/spec/features/blacklight_oai_provider_spec.rb index dd8506d..1400988 100644 --- a/spec/features/blacklight_oai_provider_spec.rb +++ b/spec/features/blacklight_oai_provider_spec.rb @@ -8,6 +8,7 @@ end it "identify page" do + pending 'have to be updated to use capybary js tests' visit '/catalog/oai?verb=Identify' page.should have_content 'root@localhost' page.should have_xpath('//earliestdatestamp', :text => '2012-08-01T16:49:55Z') @@ -18,6 +19,7 @@ end it "document page" do + pending 'have to be updated to use capybary js tests' visit '/catalog/oai?verb=GetRecord&identifier=00282214&metadataPrefix=oai_dc' page.should have_xpath('//title', :text => 'Fikr-i Ayāz') end From add19db0dac8d431d3048ca3bff10130777b1f09 Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Wed, 4 Oct 2017 10:52:28 -0400 Subject: [PATCH 31/67] Adding API tests for Identify request. --- spec/requests/identify_spec.rb | 43 +++++++++++++++++++ .../lib/generators/test_app_generator.rb | 10 +++-- 2 files changed, 49 insertions(+), 4 deletions(-) create mode 100644 spec/requests/identify_spec.rb diff --git a/spec/requests/identify_spec.rb b/spec/requests/identify_spec.rb new file mode 100644 index 0000000..bab7f4c --- /dev/null +++ b/spec/requests/identify_spec.rb @@ -0,0 +1,43 @@ +require 'spec_helper' + +describe 'OIA-PMH Identify Request' do + let(:xml) { Nokogiri::XML(response.body) } + + before :example do + get '/catalog/oai?verb=Identify' + end + + it "contains repository name" do + expect(xml.at_xpath('//xmlns:repositoryName').text).to eql 'Test Repository' + end + + it "contains base url" do + expect(xml.at_xpath('//xmlns:baseURL').text).to eql 'http://localhost' + end + + it "contains protocol version" do + expect(xml.at_xpath('//xmlns:protocolVersion').text).to eql '2.0' + end + + it "contains earliest datestamp" do + expect(xml.at_xpath('//xmlns:earliestDatestamp').text).to eql '2014-02-03T18:42:53Z' + end + + it "contains delete records" do + expect(xml.at_xpath('//xmlns:deletedRecord').text).to eql 'persistent' + end + + it "contains granularity" do + expect(xml.at_xpath('//xmlns:granularity').text).to eql 'YYYY-MM-DDThh:mm:ssZ' + end + + it "contains admin email" do + expect(xml.at_xpath('//xmlns:adminEmail').text).to eql 'root@localhost' + end + + it "contains sample identifier" do + expect( + xml.at_xpath('//oai-identifier:sampleIdentifier', 'oai-identifier' => "http://www.openarchives.org/OAI/2.0/oai-identifier").text + ).to eql 'test:109660' + end +end diff --git a/spec/test_app_templates/lib/generators/test_app_generator.rb b/spec/test_app_templates/lib/generators/test_app_generator.rb index ea11089..5049aa7 100644 --- a/spec/test_app_templates/lib/generators/test_app_generator.rb +++ b/spec/test_app_templates/lib/generators/test_app_generator.rb @@ -59,11 +59,13 @@ def add_test_blacklight_oai_config insert_into_file "app/controllers/catalog_controller.rb", :after => "configure_blacklight do |config|\n" do %{ config.oai = { - :provider => { - :repository_name => 'Test', + :provider => { + :repository_name => 'Test Repository', :repository_url => 'http://localhost', - :record_prefix => '', - :admin_email => 'root@localhost' + :record_prefix => 'test', + :admin_email => 'root@localhost', + :deletion_support => 'persistent', + :sample_id => '109660' }, :document => { :timestamp => 'timestamp', From 4e5e0d2b221e175508e1ac32c46886f89233b19f Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Wed, 4 Oct 2017 12:09:17 -0400 Subject: [PATCH 32/67] Removing older version of ruby (1.9.3 and 2.0), running test in these version would require changes to upstream gems. --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1f3440c..eae584d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,8 +7,6 @@ rvm: - 2.3.3 - 2.2 - 2.1 - - 2.0 - - 1.9.3 before_install: - gem install bundler From 0087b677079bcc4d76af5010186c22dea105da80 Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Wed, 4 Oct 2017 12:15:18 -0400 Subject: [PATCH 33/67] Testing against multiple versions of rails. --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index eae584d..20a4231 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,5 +8,9 @@ rvm: - 2.2 - 2.1 +env: + - "RAILS_VERSION=4.2.9" + - "RAILS_VERSION=4.1.16" + before_install: - gem install bundler From 974d5251c8dc9da2b7b80e452e20b8f6e07eaea3 Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Thu, 5 Oct 2017 14:49:43 -0400 Subject: [PATCH 34/67] Changing timestamp of one document to make queries more interesting. --- solr/sample_solr_documents.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solr/sample_solr_documents.yml b/solr/sample_solr_documents.yml index eee603d..f8b8721 100755 --- a/solr/sample_solr_documents.yml +++ b/solr/sample_solr_documents.yml @@ -111,7 +111,7 @@ - Sāhivāl jail kī ḍāʼirī / language_facet: - Urdu - timestamp: '2014-02-03T18:42:53.056Z' + timestamp: '2014-03-03T18:42:53.056Z' - subtitle_display: 'guft va gū-yi Akbar Ganjī bā ʻAbd Allāh Nūrī : bih payvast-i matn-i istīz̤āḥ-i ʻAbd Allāh Nūrī dar Majlis-i panjum' author_vern_display: "‏نورى، عبد الله" From 3c6b52300a7a440005503a7dc98f54522e067fd0 Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Thu, 5 Oct 2017 14:50:27 -0400 Subject: [PATCH 35/67] Adding api tests for the following verbs: GetRecord, ListIdentifiers, ListMetadataFormats, ListRecords. --- spec/requests/get_record_spec.rb | 47 +++++++++ spec/requests/list_identifiers_spec.rb | 60 +++++++++++ spec/requests/list_metadata_formats_spec.rb | 43 ++++++++ spec/requests/list_records_spec.rb | 108 ++++++++++++++++++++ 4 files changed, 258 insertions(+) create mode 100644 spec/requests/get_record_spec.rb create mode 100644 spec/requests/list_identifiers_spec.rb create mode 100644 spec/requests/list_metadata_formats_spec.rb create mode 100644 spec/requests/list_records_spec.rb diff --git a/spec/requests/get_record_spec.rb b/spec/requests/get_record_spec.rb new file mode 100644 index 0000000..6789ffe --- /dev/null +++ b/spec/requests/get_record_spec.rb @@ -0,0 +1,47 @@ +require 'spec_helper' + +describe 'OIA-PMH GetRecord Request' do + let(:xml) { Nokogiri::XML(response.body) } + let(:namespaces) do + { + dc: 'http://purl.org/dc/elements/1.1/', + xmlns: 'http://www.openarchives.org/OAI/2.0/', + oai_dc: 'http://www.openarchives.org/OAI/2.0/oai_dc/' + } + end + + before :example do + get '/catalog/oai?verb=GetRecord&identifier=2007020969&metadataPrefix=oai_dc' + end + + it 'contains header information' do + expect(xml.at_xpath('//xmlns:GetRecord/xmlns:record/xmlns:header/xmlns:identifier').text).to eql 'test/2007020969' + expect(xml.at_xpath('//xmlns:GetRecord/xmlns:record/xmlns:header/xmlns:datestamp').text).to eql '2014-02-03T18:42:53Z' + end + + it 'contains creator' do + expect(xml.at_xpath('//xmlns:metadata/oai_dc:dc/dc:creator', namespaces).text).to eql 'Hearth, Amy Hill, 1958-' + end + + it 'contains date' do + expect(xml.at_xpath('//xmlns:metadata/oai_dc:dc/dc:date', namespaces).text).to eql '2008' + end + + it 'contains subjects' do + nodes = xml.xpath('//xmlns:metadata/oai_dc:dc/dc:subject', namespaces) + expect(nodes.count).to eql 4 + expect(nodes.map(&:text)).to match_array ['Strong Medicine, 1922-', 'Delaware women', 'Indian women shamans', 'Delaware Indians'] + end + + it 'contains title' do + expect(xml.at_xpath('//xmlns:metadata/oai_dc:dc/dc:title', namespaces).text).to eql '"Strong Medicine speaks"' + end + + it 'contains language' do + expect(xml.at_xpath('//xmlns:metadata/oai_dc:dc/dc:language', namespaces).text).to eql 'English' + end + + it 'contains format' do + expect(xml.at_xpath('//xmlns:metadata/oai_dc:dc/dc:format', namespaces).text).to eql 'Book' + end +end diff --git a/spec/requests/list_identifiers_spec.rb b/spec/requests/list_identifiers_spec.rb new file mode 100644 index 0000000..90c83c2 --- /dev/null +++ b/spec/requests/list_identifiers_spec.rb @@ -0,0 +1,60 @@ +require 'spec_helper' + +describe 'OIA-PMH ListIdentifiers Request' do + let(:xml) { Nokogiri::XML(response.body) } + + context 'for all documents' do + before :example do + get '/catalog/oai?verb=ListIdentifiers&metadataPrefix=oai_dc' + end + + it 'returns 25 records' do + expect(xml.xpath('//xmlns:ListIdentifiers/xmlns:header').count).to eql 25 + end + + it 'first record has identifier and timestamp' do + expect(xml.at_xpath('//xmlns:ListIdentifiers/xmlns:header/xmlns:identifier').text).not_to eql '' + expect(xml.at_xpath('//xmlns:ListIdentifiers/xmlns:header/xmlns:datestamp').text).not_to eql '' + end + + it 'contains resumptionToken' do + expect(xml.at_xpath('//xmlns:resumptionToken').text).to eql 'oai_dc.f(2014-02-03T18:42:53Z).u(2014-03-03T18:42:53Z):25' + end + end + + context 'with resumption_token' do + before :example do + get '/catalog/oai?verb=ListIdentifiers&resumptionToken=oai_dc.f(2014-02-03T18:42:53Z).u(2014-02-03T18:42:53Z):25' + end + + it 'returns 5 records' do + expect(xml.xpath('//xmlns:ListIdentifiers/xmlns:header').count).to eql 5 + end + + it 'first record has identifier and timestamp' do + expect(xml.at_xpath('//xmlns:ListIdentifiers/xmlns:header/xmlns:identifier').text).not_to eql '' + expect(xml.at_xpath('//xmlns:ListIdentifiers/xmlns:header/xmlns:datestamp').text).not_to eql '' + end + + it 'does not contain a resumptionToken' do + pending 'ResumptionToken needs to be removed if there aren\'t more records.' + expect(xml.at_xpath('//xmlns:resumptionToken').text).to eql '' + end + end + + context 'for all documents within a time range' do + before :example do + get '/catalog/oai?verb=ListIdentifiers&metadataPrefix=oai_dc&from=2014-03-03&until=2014-04-03' + end + + it 'returns 1 record' do + pending 'Filtering by date needs to be implemented.' + expect(xml.xpath('//xmlns:ListIdentifiers/xmlns:header').count).to eql 1 + end + + it 'does not contain a resumptionToken' do + pending 'Filtering by date needs to be implemented implemented' + expect(xml.at_xpath('//xmlns:resumptionToken').text).to eql '' + end + end +end diff --git a/spec/requests/list_metadata_formats_spec.rb b/spec/requests/list_metadata_formats_spec.rb new file mode 100644 index 0000000..141de62 --- /dev/null +++ b/spec/requests/list_metadata_formats_spec.rb @@ -0,0 +1,43 @@ +require 'spec_helper' + +describe 'OIA-PMH ListMetadataFormats Request' do + let(:xml) { Nokogiri::XML(response.body) } + + context 'without identifier parameter' do + before :example do + get '/catalog/oai?verb=ListMetadataFormats' + end + + it 'contains oai_dc schema' do + expect(xml.at_xpath('//xmlns:ListMetadataFormats/xmlns:metadataFormat/xmlns:schema').text).to eql 'http://www.openarchives.org/OAI/2.0/oai_dc.xsd' + end + + it 'contains oai_dc metadataPrefix' do + expect(xml.at_xpath('//xmlns:ListMetadataFormats/xmlns:metadataFormat/xmlns:metadataPrefix').text).to eql 'oai_dc' + + end + + it 'contains oai_dc metadataNamespace' do + expect(xml.at_xpath('//xmlns:ListMetadataFormats/xmlns:metadataFormat/xmlns:metadataNamespace').text).to eql 'http://www.openarchives.org/OAI/2.0/oai_dc/' + end + end + + context 'with identifier parameter' do + before :example do + get '/catalog/oai?verb=ListMetadataFormats&identifier=2007020969' + end + + it 'contains oai_dc schema' do + expect(xml.at_xpath('//xmlns:ListMetadataFormats/xmlns:metadataFormat/xmlns:schema').text).to eql 'http://www.openarchives.org/OAI/2.0/oai_dc.xsd' + end + + it 'contains oai_dc metadataPrefix' do + expect(xml.at_xpath('//xmlns:ListMetadataFormats/xmlns:metadataFormat/xmlns:metadataPrefix').text).to eql 'oai_dc' + + end + + it 'contains oai_dc metadataNamespace' do + expect(xml.at_xpath('//xmlns:ListMetadataFormats/xmlns:metadataFormat/xmlns:metadataNamespace').text).to eql 'http://www.openarchives.org/OAI/2.0/oai_dc/' + end + end +end diff --git a/spec/requests/list_records_spec.rb b/spec/requests/list_records_spec.rb new file mode 100644 index 0000000..d91c386 --- /dev/null +++ b/spec/requests/list_records_spec.rb @@ -0,0 +1,108 @@ +require 'spec_helper' + +describe 'OIA-PMH ListRecords Request' do + let(:xml) { Nokogiri::XML(response.body) } + let(:namespaces) do + { + dc: 'http://purl.org/dc/elements/1.1/', + xmlns: 'http://www.openarchives.org/OAI/2.0/', + oai_dc: 'http://www.openarchives.org/OAI/2.0/oai_dc/' + } + end + + context 'for all documents' do + before :example do + get '/catalog/oai?verb=ListRecords&metadataPrefix=oai_dc' + end + + it 'returns 25 records' do + expect(xml.xpath('//xmlns:ListRecords/xmlns:record/xmlns:header').count).to eql 25 + end + + it 'first record has oai_dc metadata element' do + expect(xml.at_xpath('//xmlns:ListRecords/xmlns:record/xmlns:metadata/oai_dc:dc', namespaces)).not_to be_nil + end + + it 'contains resumptionToken' do + expect(xml.at_xpath('//xmlns:resumptionToken').text).to eql 'oai_dc.f(2014-02-03T18:42:53Z).u(2014-03-03T18:42:53Z):25' + end + + context 'metadata element' do + let(:metadata_node) { + xml.xpath( + '//xmlns:ListRecords/xmlns:record/xmlns:header/xmlns:identifier[text()="test/2007020969"]/parent::*/parent::*/xmlns:metadata/oai_dc:dc', + namespaces + ) + } + + it 'contains title' do + expect(metadata_node.at_xpath('dc:title', namespaces).text).to eql '"Strong Medicine speaks"' + end + + it 'contains creator' do + expect(metadata_node.at_xpath('dc:creator', namespaces).text).to eql 'Hearth, Amy Hill, 1958-' + end + + it 'contains type' do + expect(metadata_node.at_xpath('dc:date', namespaces).text).to eql '2008' + end + + it 'contains language' do + expect(metadata_node.at_xpath('dc:language', namespaces).text).to eql 'English' + end + + it 'contains identifier' do + expect(metadata_node.at_xpath('dc:format', namespaces).text).to eql 'Book' + end + end + end + + context 'with resumption_token' do + before :example do + get '/catalog/oai?verb=ListRecords&resumptionToken=oai_dc.f(2014-02-03T18:42:53Z).u(2014-02-03T18:42:53Z):25' + end + + it 'returns 5 records' do + expect(xml.xpath('//xmlns:ListRecords/xmlns:record/xmlns:header').count).to eql 5 + end + + it 'first record has oai_dc metadata element' do + expect(xml.at_xpath('//xmlns:ListRecords/xmlns:record/xmlns:metadata/oai_dc:dc', namespaces)).not_to be_nil + end + + it 'does not contain a resumptionToken' do + pending 'ResumptionToken needs to be removed if there aren\'t more records.' + expect(xml.at_xpath('//xmlns:resumptionToken').text).to eql '' + end + end + + context 'for all documents within a time range' do + before :example do + get '/catalog/oai?verb=ListRecords&metadataPrefix=oai_dc&from=2014-03-03&until=2014-04-03' + end + + it 'returns 1 record' do + pending 'Filtering by date needs to be implemented.' + expect(xml.xpath('//xmlns:ListRecords/xmlns:header').count).to eql 1 + end + + it 'does not contain a resumptionToken' do + pending 'Filtering by date needs to be implemented implemented' + expect(xml.at_xpath('//xmlns:resumptionToken').text).to eql '' + end + end + + context 'throws badArgument error' do + it 'when metadataPrefix argument missing' do + get '/catalog/oai?verb=ListRecords' + expect(xml.at_xpath('//xmlns:error[@code]').attribute('code').text).to eql 'badArgument' + end + end + + context 'throws badResumptionToken error' do + it 'when resumptionToken is invalid' do + get '/catalog/oai?verb=ListRecords&resumptionToken=blahblahblah' + expect(xml.at_xpath('//xmlns:error').attribute('code').text).to eql 'badResumptionToken' + end + end +end From 4569654afa42a8f7d460365ee7f870baaa4292cc Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Thu, 5 Oct 2017 15:12:43 -0400 Subject: [PATCH 36/67] Adding byebug. --- .gitignore | 1 + blacklight_oai_provider.gemspec | 1 + 2 files changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index a1831c2..2bfba7d 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ *.gem .ruby-version .ruby-gemset +.byebug_history # rspec failure tracking .rspec_status diff --git a/blacklight_oai_provider.gemspec b/blacklight_oai_provider.gemspec index 76c57d6..0bfa460 100644 --- a/blacklight_oai_provider.gemspec +++ b/blacklight_oai_provider.gemspec @@ -24,4 +24,5 @@ Gem::Specification.new do |s| s.add_development_dependency 'capybara' s.add_development_dependency 'solr_wrapper' s.add_development_dependency 'engine_cart' + s.add_development_dependency 'byebug' end From abefe4f7a75e1dc04b9edcf6d573c2e0523b4932 Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Mon, 9 Oct 2017 15:27:40 -0400 Subject: [PATCH 37/67] Converting SolrDocumentExtension to a model concern. - Updated install generator - Removed test class --- .../concerns/blacklight_oai_provider/solr_document.rb | 6 +++--- lib/blacklight_oai_provider.rb | 1 - lib/generators/blacklight_oai_provider/install_generator.rb | 4 ++-- spec/lib/solr_document_extension_spec.rb | 6 ------ 4 files changed, 5 insertions(+), 12 deletions(-) rename lib/blacklight_oai_provider/solr_document_extension.rb => app/models/concerns/blacklight_oai_provider/solr_document.rb (58%) delete mode 100644 spec/lib/solr_document_extension_spec.rb diff --git a/lib/blacklight_oai_provider/solr_document_extension.rb b/app/models/concerns/blacklight_oai_provider/solr_document.rb similarity index 58% rename from lib/blacklight_oai_provider/solr_document_extension.rb rename to app/models/concerns/blacklight_oai_provider/solr_document.rb index 2b01db9..26e9956 100644 --- a/lib/blacklight_oai_provider/solr_document_extension.rb +++ b/app/models/concerns/blacklight_oai_provider/solr_document.rb @@ -1,6 +1,6 @@ -# Meant to be applied on top of SolrDocument to implement -# methods required by the ruby-oai provider -module BlacklightOaiProvider::SolrDocumentExtension +module BlacklightOaiProvider::SolrDocument + extend ActiveSupport::Concerns + def timestamp timestamp = get('timestamp') raise BlacklightOaiProvider::Exceptions::MissingTimestamp if timestamp.blank? diff --git a/lib/blacklight_oai_provider.rb b/lib/blacklight_oai_provider.rb index f8d9ab2..364a319 100644 --- a/lib/blacklight_oai_provider.rb +++ b/lib/blacklight_oai_provider.rb @@ -1,7 +1,6 @@ module BlacklightOaiProvider autoload :ControllerExtension, 'blacklight_oai_provider/controller_extension' autoload :Exceptions, 'blacklight_oai_provider/exceptions' - autoload :SolrDocumentExtension, 'blacklight_oai_provider/solr_document_extension' autoload :SolrDocumentProvider, 'blacklight_oai_provider/solr_document_provider' autoload :SolrDocumentWrapper, 'blacklight_oai_provider/solr_document_wrapper' autoload :RouteSets, 'blacklight_oai_provider/route_sets' diff --git a/lib/generators/blacklight_oai_provider/install_generator.rb b/lib/generators/blacklight_oai_provider/install_generator.rb index d0a1c3a..3e3655c 100644 --- a/lib/generators/blacklight_oai_provider/install_generator.rb +++ b/lib/generators/blacklight_oai_provider/install_generator.rb @@ -5,12 +5,12 @@ class InstallGenerator < Rails::Generators::Base argument :model_name, :type => :string, :default => "SolrDocument" argument :controller_name, :type => :string, :default => "CatalogController" - def inject_solr_document_extension + def inject_solr_document_concern file_path = "app/models/#{model_name.underscore}.rb" if File.exists? file_path inject_into_file file_path, :after => "include Blacklight::Solr::Document" do - "\n SolrDocument.use_extension( BlacklightOaiProvider::SolrDocumentExtension )\n" + "\n include BlacklightOaiProvider::SolrDocument\n" end end end diff --git a/spec/lib/solr_document_extension_spec.rb b/spec/lib/solr_document_extension_spec.rb deleted file mode 100644 index bebe30b..0000000 --- a/spec/lib/solr_document_extension_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require 'spec_helper' - -describe BlacklightOaiProvider::SolrDocumentExtension do - subject { SolrDocument.new :field => 'value' } - -end From 305789407af6d1a0a6791216031ecef851d1ef96 Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Mon, 9 Oct 2017 15:50:57 -0400 Subject: [PATCH 38/67] Converting ControllerExtension to a controller concern. --- .../concerns/blacklight_oai_provider/controller.rb | 8 +++++--- lib/blacklight_oai_provider.rb | 1 - .../blacklight_oai_provider/install_generator.rb | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) rename lib/blacklight_oai_provider/controller_extension.rb => app/controllers/concerns/blacklight_oai_provider/controller.rb (90%) diff --git a/lib/blacklight_oai_provider/controller_extension.rb b/app/controllers/concerns/blacklight_oai_provider/controller.rb similarity index 90% rename from lib/blacklight_oai_provider/controller_extension.rb rename to app/controllers/concerns/blacklight_oai_provider/controller.rb index 18a21fd..fe1c4db 100644 --- a/lib/blacklight_oai_provider/controller_extension.rb +++ b/app/controllers/concerns/blacklight_oai_provider/controller.rb @@ -1,9 +1,11 @@ # Meant to be applied on top of a controller that implements # Blacklight::SolrHelper. Will inject range limiting behaviors # to solr parameters creation. -module BlacklightOaiProvider::ControllerExtension - def self.included(some_class) - some_class.helper_method :oai_config +module BlacklightOaiProvider::Controller + extend ActiveSupport::Concern + + included do + helper_method :oai_config end # Action method of our own! diff --git a/lib/blacklight_oai_provider.rb b/lib/blacklight_oai_provider.rb index 364a319..62659b0 100644 --- a/lib/blacklight_oai_provider.rb +++ b/lib/blacklight_oai_provider.rb @@ -1,5 +1,4 @@ module BlacklightOaiProvider - autoload :ControllerExtension, 'blacklight_oai_provider/controller_extension' autoload :Exceptions, 'blacklight_oai_provider/exceptions' autoload :SolrDocumentProvider, 'blacklight_oai_provider/solr_document_provider' autoload :SolrDocumentWrapper, 'blacklight_oai_provider/solr_document_wrapper' diff --git a/lib/generators/blacklight_oai_provider/install_generator.rb b/lib/generators/blacklight_oai_provider/install_generator.rb index 3e3655c..d163903 100644 --- a/lib/generators/blacklight_oai_provider/install_generator.rb +++ b/lib/generators/blacklight_oai_provider/install_generator.rb @@ -15,11 +15,11 @@ def inject_solr_document_concern end end - def inject_catalog_controller_extension + def inject_catalog_controller_concern file_path = "app/controllers/#{controller_name.underscore}.rb" if File.exists? file_path inject_into_file file_path, :after => "include Blacklight::Catalog" do - "\n include BlacklightOaiProvider::ControllerExtension\n" + "\n include BlacklightOaiProvider::Controller\n" end end end From e3bfda6126a469ee653231c4a25b829d4b2c4f33 Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Wed, 11 Oct 2017 15:39:35 -0400 Subject: [PATCH 39/67] Using constant for default config --- .../solr_document_wrapper.rb | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/blacklight_oai_provider/solr_document_wrapper.rb b/lib/blacklight_oai_provider/solr_document_wrapper.rb index 0290c9d..3e69066 100644 --- a/lib/blacklight_oai_provider/solr_document_wrapper.rb +++ b/lib/blacklight_oai_provider/solr_document_wrapper.rb @@ -1,15 +1,14 @@ module BlacklightOaiProvider class SolrDocumentWrapper < ::OAI::Provider::Model - attr_reader :model, :timestamp_field + DEFAULT_CONFIG = { :timestamp => 'timestamp', :limit => 15 }.freeze + attr_accessor :options + def initialize(controller, options = {}) @controller = controller - - defaults = { :timestamp => 'timestamp', :limit => 15} - @options = defaults.merge options - - @timestamp_field = @options[:timestamp] - @limit = @options[:limit] + @options = DEFAULT_CONFIG.merge(options) + @timestamp_field = options[:timestamp] + @limit = options[:limit] end def sets @@ -43,7 +42,7 @@ def select_partial token raise ::OAI::ResumptionTokenException.new unless records - OAI::Provider::PartialResult.new(records, token.next(token.last+@limit)) + OAI::Provider::PartialResult.new(records, token.next(token.last + @limit)) end def next_set(token_string) From aec8d46485a7dc6640f18d930a3f38731510ed54 Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Wed, 11 Oct 2017 15:43:34 -0400 Subject: [PATCH 40/67] Filtering with :from and :until parameters. Resumption token no longer sent if there aren't more results. - Created custom resumptionToken class that stores total number of records - Returning empty resumption token if there aren't more records - Displaying total number of results in xml. - Convering from and until parameters to a solr filter that's added to the query --- lib/blacklight_oai_provider.rb | 1 + .../resumption_token.rb | 47 +++++++++++++++++++ .../solr_document_wrapper.rb | 41 +++++++++++++--- 3 files changed, 83 insertions(+), 6 deletions(-) create mode 100644 lib/blacklight_oai_provider/resumption_token.rb diff --git a/lib/blacklight_oai_provider.rb b/lib/blacklight_oai_provider.rb index 62659b0..9a27c0f 100644 --- a/lib/blacklight_oai_provider.rb +++ b/lib/blacklight_oai_provider.rb @@ -2,6 +2,7 @@ module BlacklightOaiProvider autoload :Exceptions, 'blacklight_oai_provider/exceptions' autoload :SolrDocumentProvider, 'blacklight_oai_provider/solr_document_provider' autoload :SolrDocumentWrapper, 'blacklight_oai_provider/solr_document_wrapper' + autoload :ResumptionToken, 'blacklight_oai_provider/resumption_token' autoload :RouteSets, 'blacklight_oai_provider/route_sets' require 'oai' diff --git a/lib/blacklight_oai_provider/resumption_token.rb b/lib/blacklight_oai_provider/resumption_token.rb new file mode 100644 index 0000000..c9f95f2 --- /dev/null +++ b/lib/blacklight_oai_provider/resumption_token.rb @@ -0,0 +1,47 @@ +module BlacklightOaiProvider + class ResumptionToken < ::OAI::Provider::ResumptionToken + # parses a token string and returns a ResumptionToken + def self.parse(token_string) + begin + options = {} + total = nil + matches = /(.+):(\d+)$/.match(token_string) + options[:last] = matches.captures[1].to_i + + parts = matches.captures[0].split('.') + options[:metadata_prefix] = parts.shift + parts.each do |part| + case part + when /^s/ + options[:set] = part.sub(/^s\(/, '').sub(/\)$/, '') + when /^f/ + options[:from] = Time.parse(part.sub(/^f\(/, '').sub(/\)$/, '')).localtime + when /^u/ + options[:until] = Time.parse(part.sub(/^u\(/, '').sub(/\)$/, '')).localtime + when /^t/ + total = part.sub(/^t\(/, '').sub(/\)$/, '').to_i + end + end + self.new(options, nil, total) + rescue => err + raise OAI::ResumptionTokenException.new + end + end + + def encode_conditions + encoded_token = @prefix.to_s.dup + encoded_token << ".s(#{set})" if set + encoded_token << ".f(#{self.from.utc.xmlschema})" if self.from + encoded_token << ".u(#{self.until.utc.xmlschema})" if self.until + encoded_token << ".t(#{self.total})" if self.total + encoded_token << ":#{last}" + end + + def to_xml + xml = Builder::XmlMarkup.new + token = (self.total && (self.last > self.total)) ? '' : encode_conditions + xml.resumptionToken(token, hash_of_attributes) + xml.target! + end + end +end diff --git a/lib/blacklight_oai_provider/solr_document_wrapper.rb b/lib/blacklight_oai_provider/solr_document_wrapper.rb index 3e69066..e86765b 100644 --- a/lib/blacklight_oai_provider/solr_document_wrapper.rb +++ b/lib/blacklight_oai_provider/solr_document_wrapper.rb @@ -26,10 +26,10 @@ def find(selector, options={}) return next_set(options[:resumption_token]) if options[:resumption_token] if :all == selector - response, records = @controller.get_search_results(@controller.params, {:sort => @timestamp_field + ' asc', :rows => @limit}) + response, records = @controller.get_search_results(@controller.params, conditions(options)) - if @limit && response.total >= @limit - return select_partial(OAI::Provider::ResumptionToken.new(options.merge({:last => 0}))) + if @limit && response.total > @limit + return select_partial(BlacklightOaiProvider::ResumptionToken.new(options.merge({:last => 0}), nil, response.total)) end else response, records = @controller.get_solr_response_for_doc_id selector.split('/', 2).last @@ -38,7 +38,7 @@ def find(selector, options={}) end def select_partial token - records = @controller.get_search_results(@controller.params, {:sort => @timestamp_field + ' asc', :rows => @limit, :start => token.last}).last + response, records = @controller.get_search_results(@controller.params, token_conditions(token)) raise ::OAI::ResumptionTokenException.new unless records @@ -48,9 +48,38 @@ def select_partial token def next_set(token_string) raise ::OAI::ResumptionTokenException.new unless @limit - token = OAI::Provider::ResumptionToken.parse(token_string) + token = BlacklightOaiProvider::ResumptionToken.parse(token_string) select_partial(token) end + + private + + def base_conditions + { :sort => "#{@timestamp_field} asc", :rows => @limit } + end + + def token_conditions(token) + base_conditions.merge({:start => token.last}) + end + + def conditions(options) # conditions/query derived from options + if !(options[:from].blank? && options[:until].blank?) + base_conditions.merge( + { :fq => "#{timestamp_field}:[#{solr_date(options[:from])} TO #{solr_date(options[:until])}]" } + ) + else + base_conditions + end + end + + def solr_date(time) + if time.respond_to?(:strftime) + time.strftime("%Y-%m-%dT%H:%M:%SZ") + elsif time.blank? + '*' + else + time.to_s + end + end end end - From be2fc96e5af84e14bbb41517da403075ab2fd4dd Mon Sep 17 00:00:00 2001 From: Corey Hinshaw Date: Mon, 16 Oct 2017 10:26:16 -0400 Subject: [PATCH 41/67] XSLT stylesheet correctly handles empty resumption tokens. Code taken from osulibraries fork of blacklight-oai-provider. --- .../blacklight_oai_provider/oai2.xsl | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/app/assets/stylesheets/blacklight_oai_provider/oai2.xsl b/app/assets/stylesheets/blacklight_oai_provider/oai2.xsl index ee31732..bc03391 100644 --- a/app/assets/stylesheets/blacklight_oai_provider/oai2.xsl +++ b/app/assets/stylesheets/blacklight_oai_provider/oai2.xsl @@ -528,13 +528,20 @@ p.intro { -

There are more results.

- - -
resumptionToken: + + +

There are more results.

+ + + -
resumptionToken: Resume
+
+ + +

End of results.

+
+
From b0481a440db47af838a260070eb0ff0b73afcbc4 Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Mon, 16 Oct 2017 12:46:01 -0400 Subject: [PATCH 42/67] Adding milliseconds to solr query incase the solr instance saves timestamps with fractional second granularity. --- lib/blacklight_oai_provider/solr_document_wrapper.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/blacklight_oai_provider/solr_document_wrapper.rb b/lib/blacklight_oai_provider/solr_document_wrapper.rb index e86765b..e9a622e 100644 --- a/lib/blacklight_oai_provider/solr_document_wrapper.rb +++ b/lib/blacklight_oai_provider/solr_document_wrapper.rb @@ -65,7 +65,7 @@ def token_conditions(token) def conditions(options) # conditions/query derived from options if !(options[:from].blank? && options[:until].blank?) base_conditions.merge( - { :fq => "#{timestamp_field}:[#{solr_date(options[:from])} TO #{solr_date(options[:until])}]" } + { :fq => "#{timestamp_field}:[#{solr_date(options[:from])} TO #{solr_date(options[:until]).gsub('Z', '.999Z')}]" } ) else base_conditions @@ -73,8 +73,8 @@ def conditions(options) # conditions/query derived from options end def solr_date(time) - if time.respond_to?(:strftime) - time.strftime("%Y-%m-%dT%H:%M:%SZ") + if time.respond_to?(:xmlschema) + time.xmlschema elsif time.blank? '*' else From dee54e453c4657dfe1b4504c01c151d0ee998e6b Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Mon, 16 Oct 2017 12:46:48 -0400 Subject: [PATCH 43/67] Fixing test about resumptionTokens and result date filtering. --- spec/requests/list_identifiers_spec.rb | 9 +++------ spec/requests/list_records_spec.rb | 11 ++++------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/spec/requests/list_identifiers_spec.rb b/spec/requests/list_identifiers_spec.rb index 90c83c2..09f8508 100644 --- a/spec/requests/list_identifiers_spec.rb +++ b/spec/requests/list_identifiers_spec.rb @@ -18,13 +18,13 @@ end it 'contains resumptionToken' do - expect(xml.at_xpath('//xmlns:resumptionToken').text).to eql 'oai_dc.f(2014-02-03T18:42:53Z).u(2014-03-03T18:42:53Z):25' + expect(xml.at_xpath('//xmlns:resumptionToken').text).to eql 'oai_dc.f(2014-02-03T18:42:53Z).u(2014-03-03T18:42:53Z).t(30):25' end end context 'with resumption_token' do before :example do - get '/catalog/oai?verb=ListIdentifiers&resumptionToken=oai_dc.f(2014-02-03T18:42:53Z).u(2014-02-03T18:42:53Z):25' + get '/catalog/oai?verb=ListIdentifiers&resumptionToken=oai_dc.f(2014-02-03T18:42:53Z).u(2014-02-03T18:42:53Z).t(30):25' end it 'returns 5 records' do @@ -37,7 +37,6 @@ end it 'does not contain a resumptionToken' do - pending 'ResumptionToken needs to be removed if there aren\'t more records.' expect(xml.at_xpath('//xmlns:resumptionToken').text).to eql '' end end @@ -48,13 +47,11 @@ end it 'returns 1 record' do - pending 'Filtering by date needs to be implemented.' expect(xml.xpath('//xmlns:ListIdentifiers/xmlns:header').count).to eql 1 end it 'does not contain a resumptionToken' do - pending 'Filtering by date needs to be implemented implemented' - expect(xml.at_xpath('//xmlns:resumptionToken').text).to eql '' + expect(xml.at_xpath('//xmlns:resumptionToken')).to be_nil end end end diff --git a/spec/requests/list_records_spec.rb b/spec/requests/list_records_spec.rb index d91c386..6cc985e 100644 --- a/spec/requests/list_records_spec.rb +++ b/spec/requests/list_records_spec.rb @@ -24,7 +24,7 @@ end it 'contains resumptionToken' do - expect(xml.at_xpath('//xmlns:resumptionToken').text).to eql 'oai_dc.f(2014-02-03T18:42:53Z).u(2014-03-03T18:42:53Z):25' + expect(xml.at_xpath('//xmlns:resumptionToken').text).to eql 'oai_dc.f(2014-02-03T18:42:53Z).u(2014-03-03T18:42:53Z).t(30):25' end context 'metadata element' do @@ -59,7 +59,7 @@ context 'with resumption_token' do before :example do - get '/catalog/oai?verb=ListRecords&resumptionToken=oai_dc.f(2014-02-03T18:42:53Z).u(2014-02-03T18:42:53Z):25' + get '/catalog/oai?verb=ListRecords&resumptionToken=oai_dc.f(2014-02-03T18:42:53Z).u(2014-02-03T18:42:53Z).t(30):25' end it 'returns 5 records' do @@ -71,7 +71,6 @@ end it 'does not contain a resumptionToken' do - pending 'ResumptionToken needs to be removed if there aren\'t more records.' expect(xml.at_xpath('//xmlns:resumptionToken').text).to eql '' end end @@ -82,13 +81,11 @@ end it 'returns 1 record' do - pending 'Filtering by date needs to be implemented.' - expect(xml.xpath('//xmlns:ListRecords/xmlns:header').count).to eql 1 + expect(xml.xpath('//xmlns:ListRecords/xmlns:record/xmlns:header').count).to eql 1 end it 'does not contain a resumptionToken' do - pending 'Filtering by date needs to be implemented implemented' - expect(xml.at_xpath('//xmlns:resumptionToken').text).to eql '' + expect(xml.at_xpath('//xmlns:resumptionToken')).to be_nil end end From 0cd142f989cd8fe68253ec5ed7e0dfe9977b04b5 Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Mon, 16 Oct 2017 19:52:45 -0400 Subject: [PATCH 44/67] Adding more tests for concerns - Creating tests for controller and model concerns - Adding more tests --- spec/controllers/catalog_controller_spec.rb | 39 +++++++++++++++++++++ spec/integration/blacklight_stub_spec.rb | 10 ------ spec/models/solr_document_spec.rb | 39 +++++++++++++++++++++ spec/requests/identify_spec.rb | 4 +++ spec/requests/list_records_spec.rb | 15 ++++++++ 5 files changed, 97 insertions(+), 10 deletions(-) create mode 100644 spec/controllers/catalog_controller_spec.rb delete mode 100644 spec/integration/blacklight_stub_spec.rb create mode 100644 spec/models/solr_document_spec.rb diff --git a/spec/controllers/catalog_controller_spec.rb b/spec/controllers/catalog_controller_spec.rb new file mode 100644 index 0000000..0f07467 --- /dev/null +++ b/spec/controllers/catalog_controller_spec.rb @@ -0,0 +1,39 @@ +require 'spec_helper' + +describe CatalogController do + it "should have a Blacklight module" do + expect(Blacklight).to be_a_kind_of Module + end + + it 'should have blacklight configuration' do + expect(CatalogController.blacklight_config).to be_a_kind_of Blacklight::Configuration + end + + describe '#oai' do + it 'should respond to oai' do + expect(controller).to respond_to :oai + end + end + + describe '#oai_config' do + it 'returns correct configuration' do + expect(controller.oai_config).to match( + :provider => { + :repository_name => "Test Repository", + :repository_url => "http://localhost", + :record_prefix => "test", + :admin_email => "root@localhost", + :deletion_support => "persistent", + :sample_id => "109660" + }, + :document => { :timestamp => "timestamp", :limit => 25 } + ) + end + end + + describe '#oai_provider' do + it 'returns BlacklightOaiProvider::SolrDocumentProvider' do + expect(controller.oai_provider).to be_a BlacklightOaiProvider::SolrDocumentProvider + end + end +end diff --git a/spec/integration/blacklight_stub_spec.rb b/spec/integration/blacklight_stub_spec.rb deleted file mode 100644 index c25d739..0000000 --- a/spec/integration/blacklight_stub_spec.rb +++ /dev/null @@ -1,10 +0,0 @@ -require 'spec_helper' - -describe 'Blacklight Test Application' do - it "should have a Blacklight module" do - Blacklight.should be_a_kind_of(Module) - end - it "should have a Catalog controller" do - CatalogController.blacklight_config.should be_a_kind_of(Blacklight::Configuration) - end -end diff --git a/spec/models/solr_document_spec.rb b/spec/models/solr_document_spec.rb new file mode 100644 index 0000000..244f630 --- /dev/null +++ b/spec/models/solr_document_spec.rb @@ -0,0 +1,39 @@ +require 'spec_helper' + +RSpec.describe SolrDocument do + it 'should include BlacklightOaiProvider::SolrDocument' do + expect(SolrDocument.ancestors.include?(BlacklightOaiProvider::SolrDocument)).to eql true + end + + subject { SolrDocument.new } + + describe '#timestamp' do + it 'responds to timestamp' do + expect(subject).to respond_to :timestamp + end + + it 'throws error if timestamp field not available' do + expect{ + subject.timestamp + }.to raise_error BlacklightOaiProvider::Exceptions::MissingTimestamp + end + + it 'returns timestamp' do + doc = SolrDocument.new({ timestamp: '2017-10-16T19:20:14Z' }) + expect(doc.timestamp).to be_a Time + expect(doc.timestamp.xmlschema).to eql '2017-10-16T19:20:14Z' + end + end + + describe '#to_oai_dc' do + it 'responds to to_oai_dc' do + expect(subject).to respond_to :to_oai_dc + end + + it "returns xml document" do + expect( + subject.to_oai_dc + ).to eql '' + end + end +end diff --git a/spec/requests/identify_spec.rb b/spec/requests/identify_spec.rb index bab7f4c..89e07ce 100644 --- a/spec/requests/identify_spec.rb +++ b/spec/requests/identify_spec.rb @@ -7,6 +7,10 @@ get '/catalog/oai?verb=Identify' end + it "contains response date" do + expect(Time.parse(xml.at_xpath('//xmlns:responseDate').text)).to be_within(5.seconds).of(Time.now) + end + it "contains repository name" do expect(xml.at_xpath('//xmlns:repositoryName').text).to eql 'Test Repository' end diff --git a/spec/requests/list_records_spec.rb b/spec/requests/list_records_spec.rb index 6cc985e..7378b6b 100644 --- a/spec/requests/list_records_spec.rb +++ b/spec/requests/list_records_spec.rb @@ -89,11 +89,26 @@ end end + context 'throws noRecordsMatch error' do + before :example do + get '/catalog/oai?verb=ListRecords&metadataPrefix=oai_dc&from=2015-01-01' + end + + it 'returns no records error' do + expect(xml.at_xpath('//xmlns:error').attribute('code').text).to eql 'noRecordsMatch' + end + end + context 'throws badArgument error' do it 'when metadataPrefix argument missing' do get '/catalog/oai?verb=ListRecords' expect(xml.at_xpath('//xmlns:error[@code]').attribute('code').text).to eql 'badArgument' end + + it "when date is invalid" do + get '/catalog/oai?verb=ListRecords&metadataPrefix=oai_dc&from=2012-01-f01' + expect(xml.at_xpath('//xmlns:error[@code]').attribute('code').text).to eql 'badArgument' + end end context 'throws badResumptionToken error' do From a00e5d7eebf7c59ce8c235cc406b08b86e606a79 Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Tue, 17 Oct 2017 13:18:28 -0400 Subject: [PATCH 45/67] Adding additional field for timestamp to make tests more interesting. --- solr/sample_solr_documents.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/solr/sample_solr_documents.yml b/solr/sample_solr_documents.yml index f8b8721..f8a82f7 100755 --- a/solr/sample_solr_documents.yml +++ b/solr/sample_solr_documents.yml @@ -58,6 +58,7 @@ language_facet: - Urdu timestamp: '2014-02-03T18:42:53.056Z' + record_creation_dt: '2014-02-03T18:42:53.056Z' - lc_1letter_facet: - M - Music author_t: @@ -112,6 +113,7 @@ language_facet: - Urdu timestamp: '2014-03-03T18:42:53.056Z' + record_creation_dt: '2014-03-03T18:42:53.056Z' - subtitle_display: 'guft va gū-yi Akbar Ganjī bā ʻAbd Allāh Nūrī : bih payvast-i matn-i istīz̤āḥ-i ʻAbd Allāh Nūrī dar Majlis-i panjum' author_vern_display: "‏نورى، عبد الله" @@ -249,6 +251,7 @@ language_facet: - Persian timestamp: '2014-02-03T18:42:53.056Z' + record_creation_dt: '2014-02-03T18:42:53.056Z' - author_t: - Yoshida, Hajime, - "吉田一" @@ -330,6 +333,7 @@ language_facet: - Japanese timestamp: '2014-02-03T18:42:53.056Z' + record_creation_dt: '2014-02-03T18:42:53.056Z' - lc_1letter_facet: - D - World History author_t: @@ -399,6 +403,7 @@ language_facet: - Russian timestamp: '2014-02-03T18:42:53.056Z' + record_creation_dt: '2014-02-03T18:42:53.056Z' - lc_1letter_facet: - K - Law author_t: @@ -471,6 +476,7 @@ language_facet: - Russian timestamp: '2014-02-03T18:42:53.056Z' + record_creation_dt: '2014-02-03T18:42:53.056Z' - lc_1letter_facet: - D - World History marc_display: "01062cam @@ -560,6 +566,7 @@ language_facet: - Korean timestamp: '2014-02-03T18:42:53.056Z' + record_creation_dt: '2014-02-03T18:42:53.056Z' - lc_1letter_facet: - P - Language & Literature author_t: @@ -626,6 +633,7 @@ language_facet: - Sanskrit timestamp: '2014-02-03T18:42:53.056Z' + record_creation_dt: '2015-02-03T18:42:53.056Z' - lc_1letter_facet: - H - Social Sciences author_t: @@ -689,6 +697,7 @@ language_facet: - Urdu timestamp: '2014-02-03T18:42:53.056Z' + record_creation_dt: '2014-02-03T18:42:53.056Z' - lc_1letter_facet: - M - Music author_t: @@ -747,6 +756,7 @@ language_facet: - Sanskrit timestamp: '2014-02-03T18:42:53.056Z' + record_creation_dt: '2014-02-03T18:42:53.056Z' - subtitle_display: sipurim mafliʼim ha-mevusasim ʻal ʻuvdot hisṭoriyot author_vern_display: "‏פינקל, חיים יעקב" subject_addl_t: @@ -842,6 +852,7 @@ language_facet: - Hebrew timestamp: '2014-02-03T18:42:53.056Z' + record_creation_dt: '2014-02-03T18:42:53.056Z' - lc_1letter_facet: - B - Philosophy, Psychology, Religion author_t: @@ -942,6 +953,7 @@ language_facet: - Persian timestamp: '2014-02-03T18:42:53.056Z' + record_creation_dt: '2014-02-03T18:42:53.056Z' - lc_1letter_facet: - M - Music author_t: @@ -998,6 +1010,7 @@ subtitle_t: - tʻeoriul-metʻoduri narkvevi / timestamp: '2014-02-03T18:42:53.056Z' + record_creation_dt: '2014-02-03T18:42:53.056Z' - lc_1letter_facet: - K - Law author_t: @@ -1084,6 +1097,7 @@ language_facet: - Korean timestamp: '2014-02-03T18:42:53.056Z' + record_creation_dt: '2014-02-03T18:42:53.056Z' - subtitle_display: ṿe-hu perush yafeh u-menupeh ʻal Shulḥan ʻarukh Oraḥ ḥayim asher ḥiber Yosef Ḳaro ... ʻim ḥidushe dinim she-hishmiṭ ha-gaʼon ... ṿe-himtsiʼam ... Mosheh Iserlish @@ -1248,6 +1262,7 @@ language_facet: - Hebrew timestamp: '2014-02-03T18:42:53.056Z' + record_creation_dt: '2014-02-03T18:42:53.056Z' - subtitle_display: 'kangnam yŏin kwa sin pʻalbulchʻul : Kim Hong-sin setʻae rŭpʻo' author_vern_display: "김 홍신, 1947-" subject_addl_t: @@ -1342,6 +1357,7 @@ language_facet: - Korean timestamp: '2014-02-03T18:42:53.056Z' + record_creation_dt: '2014-02-03T18:42:53.056Z' - subtitle_display: dar khiradvarzī-i siyāsī va huvīyat-i mā Īrānīyān author_vern_display: "‏رجايى، فرهنگ ." subject_addl_t: @@ -1450,6 +1466,7 @@ language_facet: - Persian timestamp: '2014-02-03T18:42:53.056Z' + record_creation_dt: '2014-02-03T18:42:53.056Z' - lc_1letter_facet: - P - Language & Literature author_t: @@ -1537,6 +1554,7 @@ language_facet: - Sanskrit timestamp: '2014-02-03T18:42:53.056Z' + record_creation_dt: '2014-02-03T18:42:53.056Z' - lc_1letter_facet: - U - Military Science author_t: @@ -1627,6 +1645,7 @@ language_facet: - Arabic timestamp: '2014-02-03T18:42:53.056Z' + record_creation_dt: '2014-02-03T18:42:53.056Z' - lc_1letter_facet: - D - World History author_t: @@ -1695,6 +1714,7 @@ language_facet: - Tibetan timestamp: '2014-02-03T18:42:53.056Z' + record_creation_dt: '2014-02-03T18:42:53.056Z' - subtitle_display: min jald al-dhāt ilá ṣidq al-sharḥ author_vern_display: "أبو الخير، علي عبد الحميد" subject_addl_t: @@ -1783,6 +1803,7 @@ language_facet: - Arabic timestamp: '2014-02-03T18:42:53.056Z' + record_creation_dt: '2014-02-03T18:42:53.056Z' - lc_1letter_facet: - H - Social Sciences marc_display: "03730cam @@ -1956,6 +1977,7 @@ language_facet: - Hebrew timestamp: '2014-02-03T18:42:53.056Z' + record_creation_dt: '2014-02-03T18:42:53.056Z' - lc_1letter_facet: - E - History of the Americas (General) author_t: @@ -2064,6 +2086,7 @@ subtitle_t: - 'a Native American elder has her say : an oral history /' timestamp: '2014-02-03T18:42:53.056Z' + record_creation_dt: '2014-02-03T18:42:53.056Z' - lc_1letter_facet: - B - Philosophy, Psychology, Religion author_t: @@ -2144,6 +2167,7 @@ - dam paʼi chos dgoṅs pa gcig paʼi dri ba legs bśad bsu baʼi pho ñaʼi dris lan Dgoṅs-gcig smra baʼi mdzes rgyan źes bya ba bźugs so / timestamp: '2014-02-03T18:42:53.056Z' + record_creation_dt: '2014-02-03T18:42:53.056Z' - subtitle_display: a supplication to the noble Lama Mahaguru Padmasambhava subject_addl_t: - Prayers and devotions @@ -2249,6 +2273,7 @@ - English - Tibetan timestamp: '2014-02-03T18:42:53.056Z' + record_creation_dt: '2014-02-03T18:42:53.056Z' - lc_1letter_facet: - B - Philosophy, Psychology, Religion author_t: @@ -2329,6 +2354,7 @@ - goṅ sa skyabs mgon chen po mchog nas deṅ dus Bod rigs na gźon rnams la naṅ chos ṅo sprod bstsal ba bźugs so. timestamp: '2014-02-03T18:42:53.056Z' + record_creation_dt: '2014-02-03T18:42:53.056Z' - lc_1letter_facet: - D - World History author_t: @@ -2406,6 +2432,7 @@ language_facet: - Tibetan timestamp: '2014-02-03T18:42:53.056Z' + record_creation_dt: '2014-02-03T18:42:53.056Z' - marc_display: "01127cam a22002895a 4500 2008308478DLC20090123131001.0 Date: Tue, 17 Oct 2017 13:25:52 -0400 Subject: [PATCH 46/67] Changing oai configuration to accept model name. To change timestamp field name SolrDocument.timestamp_key needs to be updated - Refactored SolrDocumentWrapper to accept model name and use correct key when creating solr queries - Changed timestamp method to use timestamp_key method instead of a string - Added tests that change the SolrDocument.timestamp_key --- .../blacklight_oai_provider/solr_document.rb | 12 +++++++-- .../solr_document_wrapper.rb | 27 +++++++++---------- spec/controllers/catalog_controller_spec.rb | 2 +- spec/requests/list_identifiers_spec.rb | 23 ++++++++++++++++ .../lib/generators/test_app_generator.rb | 2 +- 5 files changed, 48 insertions(+), 18 deletions(-) diff --git a/app/models/concerns/blacklight_oai_provider/solr_document.rb b/app/models/concerns/blacklight_oai_provider/solr_document.rb index 26e9956..4748505 100644 --- a/app/models/concerns/blacklight_oai_provider/solr_document.rb +++ b/app/models/concerns/blacklight_oai_provider/solr_document.rb @@ -1,8 +1,8 @@ module BlacklightOaiProvider::SolrDocument - extend ActiveSupport::Concerns + extend ActiveSupport::Concern def timestamp - timestamp = get('timestamp') + timestamp = get("#{self.class.timestamp_key}") raise BlacklightOaiProvider::Exceptions::MissingTimestamp if timestamp.blank? Time.parse timestamp end @@ -10,4 +10,12 @@ def timestamp def to_oai_dc export_as('oai_dc_xml') end + + module ClassMethods + attr_writer :timestamp_key + + def timestamp_key + @timestamp_key ||= 'timestamp' + end + end end diff --git a/lib/blacklight_oai_provider/solr_document_wrapper.rb b/lib/blacklight_oai_provider/solr_document_wrapper.rb index e9a622e..cb51db8 100644 --- a/lib/blacklight_oai_provider/solr_document_wrapper.rb +++ b/lib/blacklight_oai_provider/solr_document_wrapper.rb @@ -1,25 +1,24 @@ module BlacklightOaiProvider class SolrDocumentWrapper < ::OAI::Provider::Model - DEFAULT_CONFIG = { :timestamp => 'timestamp', :limit => 15 }.freeze - - attr_accessor :options + attr_reader :document_model, :timestamp_field, :solr_timestamp, :limit def initialize(controller, options = {}) - @controller = controller - @options = DEFAULT_CONFIG.merge(options) - @timestamp_field = options[:timestamp] - @limit = options[:limit] + @controller = controller + @document_model = options[:model] || ::SolrDocument + @solr_timestamp = document_model.timestamp_key + @timestamp_field = 'timestamp' # method name used by ruby-oai + @limit = options[:limit] || 15 end def sets end def earliest - Time.parse @controller.get_search_results(@controller.params, {:fl => @timestamp_field, :sort => @timestamp_field +' asc', :rows => 1}).last.first.get(@timestamp_field) + Time.parse @controller.get_search_results(@controller.params, {:fl => solr_timestamp, :sort => "#{solr_timestamp} asc", :rows => 1}).last.first.get(solr_timestamp) end def latest - Time.parse @controller.get_search_results(@controller.params, {:fl => @timestamp_field, :sort => @timestamp_field +' desc', :rows => 1}).last.first.get(@timestamp_field) + Time.parse @controller.get_search_results(@controller.params, {:fl => solr_timestamp, :sort => "#{solr_timestamp} desc", :rows => 1}).last.first.get(solr_timestamp) end def find(selector, options={}) @@ -28,7 +27,7 @@ def find(selector, options={}) if :all == selector response, records = @controller.get_search_results(@controller.params, conditions(options)) - if @limit && response.total > @limit + if limit && response.total > limit return select_partial(BlacklightOaiProvider::ResumptionToken.new(options.merge({:last => 0}), nil, response.total)) end else @@ -42,11 +41,11 @@ def select_partial token raise ::OAI::ResumptionTokenException.new unless records - OAI::Provider::PartialResult.new(records, token.next(token.last + @limit)) + OAI::Provider::PartialResult.new(records, token.next(token.last + limit)) end def next_set(token_string) - raise ::OAI::ResumptionTokenException.new unless @limit + raise ::OAI::ResumptionTokenException.new unless limit token = BlacklightOaiProvider::ResumptionToken.parse(token_string) select_partial(token) @@ -55,7 +54,7 @@ def next_set(token_string) private def base_conditions - { :sort => "#{@timestamp_field} asc", :rows => @limit } + { :sort => "#{solr_timestamp} asc", :rows => limit } end def token_conditions(token) @@ -65,7 +64,7 @@ def token_conditions(token) def conditions(options) # conditions/query derived from options if !(options[:from].blank? && options[:until].blank?) base_conditions.merge( - { :fq => "#{timestamp_field}:[#{solr_date(options[:from])} TO #{solr_date(options[:until]).gsub('Z', '.999Z')}]" } + { :fq => "#{solr_timestamp}:[#{solr_date(options[:from])} TO #{solr_date(options[:until]).gsub('Z', '.999Z')}]" } ) else base_conditions diff --git a/spec/controllers/catalog_controller_spec.rb b/spec/controllers/catalog_controller_spec.rb index 0f07467..2e04f0d 100644 --- a/spec/controllers/catalog_controller_spec.rb +++ b/spec/controllers/catalog_controller_spec.rb @@ -26,7 +26,7 @@ :deletion_support => "persistent", :sample_id => "109660" }, - :document => { :timestamp => "timestamp", :limit => 25 } + :document => { :model => SolrDocument, :limit => 25 } ) end end diff --git a/spec/requests/list_identifiers_spec.rb b/spec/requests/list_identifiers_spec.rb index 09f8508..8423ba2 100644 --- a/spec/requests/list_identifiers_spec.rb +++ b/spec/requests/list_identifiers_spec.rb @@ -54,4 +54,27 @@ expect(xml.at_xpath('//xmlns:resumptionToken')).to be_nil end end + + context 'with different timestamp_field' do + before :all do + SolrDocument.timestamp_key = "record_creation_dt" + end + + before :each do + get '/catalog/oai?verb=ListIdentifiers&metadataPrefix=oai_dc&from=2015-01-01' + end + + after :all do + SolrDocument.timestamp_key = "timestamp" + end + + it 'returns correct document' do + expect(xml.xpath('//xmlns:ListIdentifiers/xmlns:header').count).to eql 1 + expect(xml.at_xpath('//xmlns:ListIdentifiers/xmlns:header/xmlns:identifier').text).to eql 'test/78908283' + end + + it 'document displays correct timestamp' do + expect(xml.at_xpath('//xmlns:ListIdentifiers/xmlns:header/xmlns:datestamp').text).to eql '2015-02-03T18:42:53Z' + end + end end diff --git a/spec/test_app_templates/lib/generators/test_app_generator.rb b/spec/test_app_templates/lib/generators/test_app_generator.rb index 5049aa7..5b0ef5f 100644 --- a/spec/test_app_templates/lib/generators/test_app_generator.rb +++ b/spec/test_app_templates/lib/generators/test_app_generator.rb @@ -68,7 +68,7 @@ def add_test_blacklight_oai_config :sample_id => '109660' }, :document => { - :timestamp => 'timestamp', + :model => SolrDocument, :limit => 25 } } From 01103499a350d02ea59809d9a4d685cb22840e7a Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Wed, 18 Oct 2017 10:32:37 -0400 Subject: [PATCH 47/67] Adding rubocop gem. --- blacklight_oai_provider.gemspec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/blacklight_oai_provider.gemspec b/blacklight_oai_provider.gemspec index 0bfa460..77393d7 100644 --- a/blacklight_oai_provider.gemspec +++ b/blacklight_oai_provider.gemspec @@ -25,4 +25,6 @@ Gem::Specification.new do |s| s.add_development_dependency 'solr_wrapper' s.add_development_dependency 'engine_cart' s.add_development_dependency 'byebug' + s.add_development_dependency 'rubocop', '~> 0.50.0' + s.add_development_dependency "rubocop-rspec", '~> 1.8.0' end From a1a6d838f222733c262dfc931ec96384ffc0342f Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Wed, 18 Oct 2017 11:01:56 -0400 Subject: [PATCH 48/67] Copying rubocop configuration from Blacklight project with customizations. --- .rubocop.yml | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .rubocop.yml diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 0000000..640de9c --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,39 @@ +require: rubocop-rspec + +# inherit_from: +# - .rubocop_todo.yml + +AllCops: + DisplayCopNames: true + Exclude: + - "spec/**/*" + - "blacklight_oai_provider.gemspec" + +Rails: + Enabled: true + +Metrics/BlockLength: + Exclude: + - "lib/railties/blacklight_oai_provider.rake" + +Metrics/LineLength: + Max: 200 + +Style/StringLiterals: + Enabled: false + +Layout/IndentationConsistency: + EnforcedStyle: normal + +Rails/OutputSafety: + Enabled: false + +# engine_cart block includes conditional, not duplication +Bundler/DuplicatedGem: + Exclude: + - 'Gemfile' + +# engine_cart block is following default Rails order +Bundler/OrderedGems: + Exclude: + - 'Gemfile' From aceda55f1b57e7028946341b25cb6308c2cf1726 Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Wed, 18 Oct 2017 14:26:23 -0400 Subject: [PATCH 49/67] Implementing rubocop suggestions/fixes. --- Rakefile | 4 +- .../blacklight_oai_provider/controller.rb | 51 +++++++++++-------- .../blacklight_oai_provider/solr_document.rb | 30 ++++++----- blacklight_oai_provider.gemspec | 1 - config/routes.rb | 3 +- lib/blacklight_oai_provider.rb | 11 ++-- lib/blacklight_oai_provider/engine.rb | 3 +- lib/blacklight_oai_provider/exceptions.rb | 2 +- .../resumption_token.rb | 46 ++++++++--------- lib/blacklight_oai_provider/route_sets.rb | 5 +- .../solr_document_provider.rb | 4 +- .../solr_document_wrapper.rb | 31 +++++------ lib/blacklight_oai_provider/version.rb | 3 +- .../install_generator.rb | 12 ++--- lib/railties/blacklight_oai_provider.rake | 4 +- 15 files changed, 107 insertions(+), 103 deletions(-) diff --git a/Rakefile b/Rakefile index 5015c74..f52b147 100644 --- a/Rakefile +++ b/Rakefile @@ -9,7 +9,7 @@ require 'solr_wrapper' EngineCart.fingerprint_proc = EngineCart.rails_fingerprint_proc -task :default => :ci +task default: :ci desc "Run specs" RSpec::Core::RakeTask.new @@ -17,7 +17,7 @@ RSpec::Core::RakeTask.new desc 'Run test suite' task ci: ['engine_cart:generate'] do SolrWrapper.wrap do |solr| - solr.with_collection(name: 'blacklight-core', dir: File.join(File.expand_path(File.dirname(__FILE__)), "solr", "conf")) do + solr.with_collection(name: 'blacklight-core', dir: File.join(File.expand_path(__dir__), "solr", "conf")) do within_test_app do system "RAILS_ENV=test rake blacklight_oai_provider:index:seed" end diff --git a/app/controllers/concerns/blacklight_oai_provider/controller.rb b/app/controllers/concerns/blacklight_oai_provider/controller.rb index fe1c4db..3e8ffc2 100644 --- a/app/controllers/concerns/blacklight_oai_provider/controller.rb +++ b/app/controllers/concerns/blacklight_oai_provider/controller.rb @@ -1,31 +1,38 @@ # Meant to be applied on top of a controller that implements # Blacklight::SolrHelper. Will inject range limiting behaviors # to solr parameters creation. -module BlacklightOaiProvider::Controller - extend ActiveSupport::Concern +module BlacklightOaiProvider + module Controller + extend ActiveSupport::Concern - included do - helper_method :oai_config - end + included do + helper_method :oai_config + end - # Action method of our own! - # Delivers a _partial_ that's a display of a single fields range facets. - # Used when we need a second Solr query to get range facets, after the - # first found min/max from result set. - def oai - options = params.delete_if { |k,v| %w{controller action}.include?(k) } - render :text => oai_provider.process_request(options).gsub('', "\n"), :content_type => 'text/xml' - end + # Action method of our own! + # Delivers a _partial_ that's a display of a single fields range facets. + # Used when we need a second Solr query to get range facets, after the + # first found min/max from result set. + def oai + options = params.delete_if { |k, _| %w[controller action].include?(k) } + body = oai_provider + .process_request(options) + .gsub('') do |m| + "#{m}\n\n" + end + render text: body, content_type: 'text/xml' + end - # Uses Blacklight.config, needs to be modified when - # that changes to be controller-based. This is the only method - # in this plugin that accesses Blacklight.config, single point - # of contact. - def oai_config - blacklight_config.oai || {} - end + # Uses Blacklight.config, needs to be modified when + # that changes to be controller-based. This is the only method + # in this plugin that accesses Blacklight.config, single point + # of contact. + def oai_config + blacklight_config.oai || {} + end - def oai_provider - @oai_provider ||= BlacklightOaiProvider::SolrDocumentProvider.new(self, oai_config) + def oai_provider + @oai_provider ||= BlacklightOaiProvider::SolrDocumentProvider.new(self, oai_config) + end end end diff --git a/app/models/concerns/blacklight_oai_provider/solr_document.rb b/app/models/concerns/blacklight_oai_provider/solr_document.rb index 4748505..045b9e7 100644 --- a/app/models/concerns/blacklight_oai_provider/solr_document.rb +++ b/app/models/concerns/blacklight_oai_provider/solr_document.rb @@ -1,21 +1,23 @@ -module BlacklightOaiProvider::SolrDocument - extend ActiveSupport::Concern +module BlacklightOaiProvider + module SolrDocument + extend ActiveSupport::Concern - def timestamp - timestamp = get("#{self.class.timestamp_key}") - raise BlacklightOaiProvider::Exceptions::MissingTimestamp if timestamp.blank? - Time.parse timestamp - end + def timestamp + timestamp = get(self.class.timestamp_key) + raise BlacklightOaiProvider::Exceptions::MissingTimestamp if timestamp.blank? + Time.zone.parse(timestamp) # Will default to application timezone, if timezone not provided in timestamp. + end - def to_oai_dc - export_as('oai_dc_xml') - end + def to_oai_dc + export_as('oai_dc_xml') + end - module ClassMethods - attr_writer :timestamp_key + module ClassMethods + attr_writer :timestamp_key - def timestamp_key - @timestamp_key ||= 'timestamp' + def timestamp_key + @timestamp_key ||= 'timestamp' + end end end end diff --git a/blacklight_oai_provider.gemspec b/blacklight_oai_provider.gemspec index 77393d7..befdd08 100644 --- a/blacklight_oai_provider.gemspec +++ b/blacklight_oai_provider.gemspec @@ -1,4 +1,3 @@ - # -*- coding: utf-8 -*- require File.join(File.dirname(__FILE__), "lib/blacklight_oai_provider/version") Gem::Specification.new do |s| diff --git a/config/routes.rb b/config/routes.rb index ea9efec..b33846e 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,5 +1,4 @@ # We want to add a new collection action to Catalog, without over-writing -# what's already there. This SEEMS to do it. +# what's already there. This SEEMS to do it. Rails.application.routes.draw do end - diff --git a/lib/blacklight_oai_provider.rb b/lib/blacklight_oai_provider.rb index 9a27c0f..03665b4 100644 --- a/lib/blacklight_oai_provider.rb +++ b/lib/blacklight_oai_provider.rb @@ -1,5 +1,5 @@ module BlacklightOaiProvider - autoload :Exceptions, 'blacklight_oai_provider/exceptions' + autoload :Exceptions, 'blacklight_oai_provider/exceptions' autoload :SolrDocumentProvider, 'blacklight_oai_provider/solr_document_provider' autoload :SolrDocumentWrapper, 'blacklight_oai_provider/solr_document_wrapper' autoload :ResumptionToken, 'blacklight_oai_provider/resumption_token' @@ -14,12 +14,13 @@ def self.omit_inject=(value) value = Hash.new(true) if value == true @omit_inject = value end - def self.omit_inject ; @omit_inject ; end + + def self.omit_inject + @omit_inject + end def self.inject! - unless BlacklightOaiProvider.omit_inject[:routes] - Blacklight::Routes.send(:include, BlacklightOaiProvider::RouteSets) - end + Blacklight::Routes.send(:include, BlacklightOaiProvider::RouteSets) unless BlacklightOaiProvider.omit_inject[:routes] end # Add element to array only if it's not already there diff --git a/lib/blacklight_oai_provider/engine.rb b/lib/blacklight_oai_provider/engine.rb index 8908146..0579807 100644 --- a/lib/blacklight_oai_provider/engine.rb +++ b/lib/blacklight_oai_provider/engine.rb @@ -4,7 +4,6 @@ module BlacklightOaiProvider class Engine < Rails::Engine - # Do these things in a to_prepare block, to try and make them work # in development mode with class-reloading. The trick is we can't # be sure if the controllers we're modifying are being reloaded in @@ -16,7 +15,7 @@ class Engine < Rails::Engine # Add XSL Stylesheet to list of assets to be precompiled. initializer "blacklight_oai_provider.assets.precompile" do |app| - app.config.assets.precompile += %w( blacklight_oai_provider/oai2.xsl ) + app.config.assets.precompile += %w[blacklight_oai_provider/oai2.xsl] end # Load rake tasks. diff --git a/lib/blacklight_oai_provider/exceptions.rb b/lib/blacklight_oai_provider/exceptions.rb index 1c29ee7..e558aa8 100644 --- a/lib/blacklight_oai_provider/exceptions.rb +++ b/lib/blacklight_oai_provider/exceptions.rb @@ -1,7 +1,7 @@ module BlacklightOaiProvider module Exceptions class MissingTimestamp < StandardError - def initialize(msg="Missing required timestamp field") + def initialize(msg = "Missing required timestamp field") super end end diff --git a/lib/blacklight_oai_provider/resumption_token.rb b/lib/blacklight_oai_provider/resumption_token.rb index c9f95f2..8dfc97f 100644 --- a/lib/blacklight_oai_provider/resumption_token.rb +++ b/lib/blacklight_oai_provider/resumption_token.rb @@ -2,44 +2,42 @@ module BlacklightOaiProvider class ResumptionToken < ::OAI::Provider::ResumptionToken # parses a token string and returns a ResumptionToken def self.parse(token_string) - begin - options = {} - total = nil - matches = /(.+):(\d+)$/.match(token_string) - options[:last] = matches.captures[1].to_i + options = {} + total = nil + matches = /(.+):(\d+)$/.match(token_string) + options[:last] = matches.captures[1].to_i - parts = matches.captures[0].split('.') - options[:metadata_prefix] = parts.shift - parts.each do |part| - case part - when /^s/ - options[:set] = part.sub(/^s\(/, '').sub(/\)$/, '') - when /^f/ - options[:from] = Time.parse(part.sub(/^f\(/, '').sub(/\)$/, '')).localtime - when /^u/ - options[:until] = Time.parse(part.sub(/^u\(/, '').sub(/\)$/, '')).localtime - when /^t/ - total = part.sub(/^t\(/, '').sub(/\)$/, '').to_i - end + parts = matches.captures[0].split('.') + options[:metadata_prefix] = parts.shift + parts.each do |part| + case part + when /^s/ + options[:set] = part.sub(/^s\(/, '').sub(/\)$/, '') + when /^f/ + options[:from] = Time.zone.parse(part.sub(/^f\(/, '').sub(/\)$/, '')).utc + when /^u/ + options[:until] = Time.zone.parse(part.sub(/^u\(/, '').sub(/\)$/, '')).utc + when /^t/ + total = part.sub(/^t\(/, '').sub(/\)$/, '').to_i end - self.new(options, nil, total) - rescue => err - raise OAI::ResumptionTokenException.new end + new(options, nil, total) + rescue StandardError + raise OAI::ResumptionTokenException end def encode_conditions encoded_token = @prefix.to_s.dup encoded_token << ".s(#{set})" if set - encoded_token << ".f(#{self.from.utc.xmlschema})" if self.from + encoded_token << ".f(#{from.utc.xmlschema})" if from encoded_token << ".u(#{self.until.utc.xmlschema})" if self.until - encoded_token << ".t(#{self.total})" if self.total + encoded_token << ".t(#{total})" if total encoded_token << ":#{last}" end def to_xml xml = Builder::XmlMarkup.new - token = (self.total && (self.last > self.total)) ? '' : encode_conditions + token = total && (last > total) ? '' : encode_conditions xml.resumptionToken(token, hash_of_attributes) xml.target! end diff --git a/lib/blacklight_oai_provider/route_sets.rb b/lib/blacklight_oai_provider/route_sets.rb index eb1fd1e..9b37620 100644 --- a/lib/blacklight_oai_provider/route_sets.rb +++ b/lib/blacklight_oai_provider/route_sets.rb @@ -1,9 +1,9 @@ module BlacklightOaiProvider - module RouteSets protected + def catalog - add_routes do |options| + add_routes do get 'catalog/oai' => 'catalog#oai', :as => 'oai_provider' end @@ -11,4 +11,3 @@ def catalog end end end - diff --git a/lib/blacklight_oai_provider/solr_document_provider.rb b/lib/blacklight_oai_provider/solr_document_provider.rb index 63d31a1..dea620f 100644 --- a/lib/blacklight_oai_provider/solr_document_provider.rb +++ b/lib/blacklight_oai_provider/solr_document_provider.rb @@ -1,8 +1,8 @@ module BlacklightOaiProvider class SolrDocumentProvider < ::OAI::Provider::Base attr_accessor :options - def initialize controller, options = {} + def initialize(controller, options = {}) options[:provider] ||= {} options[:document] ||= {} @@ -11,7 +11,7 @@ def initialize controller, options = {} options[:repository_name] ||= controller.view_context.send(:application_name) options[:repository_url] ||= controller.view_context.send(:oai_provider_url) - options[:provider].each do |k,v| + options[:provider].each do |k, v| self.class.send k, v end end diff --git a/lib/blacklight_oai_provider/solr_document_wrapper.rb b/lib/blacklight_oai_provider/solr_document_wrapper.rb index cb51db8..cd0ff29 100644 --- a/lib/blacklight_oai_provider/solr_document_wrapper.rb +++ b/lib/blacklight_oai_provider/solr_document_wrapper.rb @@ -10,42 +10,43 @@ def initialize(controller, options = {}) @limit = options[:limit] || 15 end - def sets - end + def sets; end def earliest - Time.parse @controller.get_search_results(@controller.params, {:fl => solr_timestamp, :sort => "#{solr_timestamp} asc", :rows => 1}).last.first.get(solr_timestamp) + _response, records = @controller.get_search_results(@controller.params, { fl: solr_timestamp, sort: "#{solr_timestamp} asc", rows: 1 }) + records.first.timestamp end def latest - Time.parse @controller.get_search_results(@controller.params, {:fl => solr_timestamp, :sort => "#{solr_timestamp} desc", :rows => 1}).last.first.get(solr_timestamp) + _response, records = @controller.get_search_results(@controller.params, { fl: solr_timestamp, sort: "#{solr_timestamp} desc", rows: 1 }) + records.first.timestamp end - def find(selector, options={}) + def find(selector, options = {}) return next_set(options[:resumption_token]) if options[:resumption_token] - if :all == selector + if selector == :all response, records = @controller.get_search_results(@controller.params, conditions(options)) if limit && response.total > limit - return select_partial(BlacklightOaiProvider::ResumptionToken.new(options.merge({:last => 0}), nil, response.total)) + return select_partial(BlacklightOaiProvider::ResumptionToken.new(options.merge(last: 0), nil, response.total)) end else - response, records = @controller.get_solr_response_for_doc_id selector.split('/', 2).last + _response, records = @controller.get_solr_response_for_doc_id selector.split('/', 2).last end records end - def select_partial token - response, records = @controller.get_search_results(@controller.params, token_conditions(token)) + def select_partial(token) + _response, records = @controller.get_search_results(@controller.params, token_conditions(token)) - raise ::OAI::ResumptionTokenException.new unless records + raise ::OAI::ResumptionTokenException unless records OAI::Provider::PartialResult.new(records, token.next(token.last + limit)) end def next_set(token_string) - raise ::OAI::ResumptionTokenException.new unless limit + raise ::OAI::ResumptionTokenException unless limit token = BlacklightOaiProvider::ResumptionToken.parse(token_string) select_partial(token) @@ -54,17 +55,17 @@ def next_set(token_string) private def base_conditions - { :sort => "#{solr_timestamp} asc", :rows => limit } + { sort: "#{solr_timestamp} asc", rows: limit } end def token_conditions(token) - base_conditions.merge({:start => token.last}) + base_conditions.merge(start: token.last) end def conditions(options) # conditions/query derived from options if !(options[:from].blank? && options[:until].blank?) base_conditions.merge( - { :fq => "#{solr_timestamp}:[#{solr_date(options[:from])} TO #{solr_date(options[:until]).gsub('Z', '.999Z')}]" } + fq: "#{solr_timestamp}:[#{solr_date(options[:from])} TO #{solr_date(options[:until]).gsub('Z', '.999Z')}]" ) else base_conditions diff --git a/lib/blacklight_oai_provider/version.rb b/lib/blacklight_oai_provider/version.rb index 99ef5d8..655530e 100644 --- a/lib/blacklight_oai_provider/version.rb +++ b/lib/blacklight_oai_provider/version.rb @@ -4,7 +4,6 @@ def self.version @version ||= File.read(File.join(File.dirname(__FILE__), '..', '..', 'VERSION')).chomp end - VERSION = self.version + VERSION = version end end - diff --git a/lib/generators/blacklight_oai_provider/install_generator.rb b/lib/generators/blacklight_oai_provider/install_generator.rb index d163903..cc0fbef 100644 --- a/lib/generators/blacklight_oai_provider/install_generator.rb +++ b/lib/generators/blacklight_oai_provider/install_generator.rb @@ -2,14 +2,14 @@ module BlacklightOaiProvider class InstallGenerator < Rails::Generators::Base - argument :model_name, :type => :string, :default => "SolrDocument" - argument :controller_name, :type => :string, :default => "CatalogController" + argument :model_name, type: :string, default: "SolrDocument" + argument :controller_name, type: :string, default: "CatalogController" def inject_solr_document_concern file_path = "app/models/#{model_name.underscore}.rb" - if File.exists? file_path - inject_into_file file_path, :after => "include Blacklight::Solr::Document" do + if File.exist? file_path + inject_into_file file_path, after: "include Blacklight::Solr::Document" do "\n include BlacklightOaiProvider::SolrDocument\n" end end @@ -17,8 +17,8 @@ def inject_solr_document_concern def inject_catalog_controller_concern file_path = "app/controllers/#{controller_name.underscore}.rb" - if File.exists? file_path - inject_into_file file_path, :after => "include Blacklight::Catalog" do + if File.exist? file_path + inject_into_file file_path, after: "include Blacklight::Catalog" do "\n include BlacklightOaiProvider::Controller\n" end end diff --git a/lib/railties/blacklight_oai_provider.rake b/lib/railties/blacklight_oai_provider.rake index 378aaa2..26cd888 100644 --- a/lib/railties/blacklight_oai_provider.rake +++ b/lib/railties/blacklight_oai_provider.rake @@ -2,11 +2,11 @@ namespace :blacklight_oai_provider do # Copied index seeding task from newer versions of Blacklight namespace :index do desc "Put sample data into solr" - task :seed => [:environment] do + task seed: [:environment] do require 'yaml' docs = YAML.safe_load(File.open(File.join(BlacklightOaiProvider.root, 'solr', 'sample_solr_documents.yml'))) - conn = RSolr.connect(Blacklight.solr_config) + conn = RSolr.connect(Blacklight.solr_config) conn.add docs conn.commit end From a36277ff523ecd0612a184417e7d2944309cc7b8 Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Wed, 18 Oct 2017 14:27:07 -0400 Subject: [PATCH 50/67] Adding rubocop_todo, outlining more clean up work to do. --- .rubocop.yml | 4 ++-- .rubocop_todo.yml | 53 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 .rubocop_todo.yml diff --git a/.rubocop.yml b/.rubocop.yml index 640de9c..df19158 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,7 +1,7 @@ require: rubocop-rspec -# inherit_from: -# - .rubocop_todo.yml +inherit_from: + - .rubocop_todo.yml AllCops: DisplayCopNames: true diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml new file mode 100644 index 0000000..d464fcd --- /dev/null +++ b/.rubocop_todo.yml @@ -0,0 +1,53 @@ +# This configuration was generated by +# `rubocop --auto-gen-config` +# on 2017-10-18 13:58:24 -0400 using RuboCop version 0.50.0. +# The point is for the user to remove these configuration records +# one by one as the offenses are removed from the code base. +# Note that changes in the inspected code, or installation of new +# versions of RuboCop, may require this file to be generated again. + +# Offense count: 4 +Metrics/AbcSize: + Max: 29 + +# Offense count: 1 +# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. +# URISchemes: http, https +Metrics/LineLength: + Max: 280 + +# Offense count: 1 +# Configuration parameters: CountComments. +Metrics/MethodLength: + Max: 21 + +# Offense count: 2 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: braces, no_braces, context_dependent +Style/BracesAroundHashParameters: + Exclude: + - 'lib/blacklight_oai_provider/solr_document_wrapper.rb' + +# Offense count: 12 +Style/Documentation: + Exclude: + - 'spec/**/*' + - 'test/**/*' + - 'app/controllers/concerns/blacklight_oai_provider/controller.rb' + - 'app/models/concerns/blacklight_oai_provider/solr_document.rb' + - 'lib/blacklight_oai_provider.rb' + - 'lib/blacklight_oai_provider/engine.rb' + - 'lib/blacklight_oai_provider/exceptions.rb' + - 'lib/blacklight_oai_provider/resumption_token.rb' + - 'lib/blacklight_oai_provider/route_sets.rb' + - 'lib/blacklight_oai_provider/solr_document_provider.rb' + - 'lib/blacklight_oai_provider/solr_document_wrapper.rb' + - 'lib/blacklight_oai_provider/version.rb' + - 'lib/generators/blacklight_oai_provider/install_generator.rb' + +# Offense count: 2 +# Configuration parameters: MinBodyLength. +Style/GuardClause: + Exclude: + - 'lib/generators/blacklight_oai_provider/install_generator.rb' From 0bb67e079229cf5e6d2b8b005760eac7c49026c2 Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Wed, 18 Oct 2017 14:36:18 -0400 Subject: [PATCH 51/67] Running rubocop on each travis build. --- .rubocop_todo.yml | 15 ++++++++------- Rakefile | 12 +++++++----- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index d464fcd..58f0638 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2017-10-18 13:58:24 -0400 using RuboCop version 0.50.0. +# on 2017-10-18 14:33:45 -0400 using RuboCop version 0.50.0. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new @@ -10,12 +10,6 @@ Metrics/AbcSize: Max: 29 -# Offense count: 1 -# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. -# URISchemes: http, https -Metrics/LineLength: - Max: 280 - # Offense count: 1 # Configuration parameters: CountComments. Metrics/MethodLength: @@ -51,3 +45,10 @@ Style/Documentation: Style/GuardClause: Exclude: - 'lib/generators/blacklight_oai_provider/install_generator.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: MinSize, SupportedStyles. +# SupportedStyles: percent, brackets +Style/SymbolArray: + EnforcedStyle: brackets diff --git a/Rakefile b/Rakefile index f52b147..6c41f01 100644 --- a/Rakefile +++ b/Rakefile @@ -3,17 +3,19 @@ require 'bundler' Bundler::GemHelper.install_tasks -require 'rspec/core/rake_task' require 'engine_cart/rake_task' require 'solr_wrapper' -EngineCart.fingerprint_proc = EngineCart.rails_fingerprint_proc - -task default: :ci +task default: [:rubocop, :ci] -desc "Run specs" +require 'rspec/core/rake_task' RSpec::Core::RakeTask.new +require 'rubocop/rake_task' +RuboCop::RakeTask.new(:rubocop) + +EngineCart.fingerprint_proc = EngineCart.rails_fingerprint_proc + desc 'Run test suite' task ci: ['engine_cart:generate'] do SolrWrapper.wrap do |solr| From 201bede5a956423fbc56fc177a46d1eeb5ca9e30 Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Thu, 19 Oct 2017 13:40:53 -0400 Subject: [PATCH 52/67] Pasing out from and until dates in resumption tokens. --- .../solr_document_wrapper.rb | 2 +- spec/requests/list_identifiers_spec.rb | 2 +- spec/requests/list_records_spec.rb | 14 ++++++++++---- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/lib/blacklight_oai_provider/solr_document_wrapper.rb b/lib/blacklight_oai_provider/solr_document_wrapper.rb index cd0ff29..a5053ad 100644 --- a/lib/blacklight_oai_provider/solr_document_wrapper.rb +++ b/lib/blacklight_oai_provider/solr_document_wrapper.rb @@ -59,7 +59,7 @@ def base_conditions end def token_conditions(token) - base_conditions.merge(start: token.last) + conditions(token.to_conditions_hash).merge(start: token.last) end def conditions(options) # conditions/query derived from options diff --git a/spec/requests/list_identifiers_spec.rb b/spec/requests/list_identifiers_spec.rb index 8423ba2..2e1d8b5 100644 --- a/spec/requests/list_identifiers_spec.rb +++ b/spec/requests/list_identifiers_spec.rb @@ -24,7 +24,7 @@ context 'with resumption_token' do before :example do - get '/catalog/oai?verb=ListIdentifiers&resumptionToken=oai_dc.f(2014-02-03T18:42:53Z).u(2014-02-03T18:42:53Z).t(30):25' + get '/catalog/oai?verb=ListIdentifiers&resumptionToken=oai_dc.f(2014-02-03T18:42:53Z).u(2014-03-03T18:42:53Z).t(30):25' end it 'returns 5 records' do diff --git a/spec/requests/list_records_spec.rb b/spec/requests/list_records_spec.rb index 7378b6b..d6f1407 100644 --- a/spec/requests/list_records_spec.rb +++ b/spec/requests/list_records_spec.rb @@ -57,13 +57,13 @@ end end - context 'with resumption_token' do + context 'with resumption_token with date filter' do before :example do - get '/catalog/oai?verb=ListRecords&resumptionToken=oai_dc.f(2014-02-03T18:42:53Z).u(2014-02-03T18:42:53Z).t(30):25' + get '/catalog/oai?verb=ListRecords&resumptionToken=oai_dc.f(2014-02-03T18:42:53Z).u(2014-02-03T18:42:53Z).t(29):25' end - it 'returns 5 records' do - expect(xml.xpath('//xmlns:ListRecords/xmlns:record/xmlns:header').count).to eql 5 + it 'returns 4 records' do + expect(xml.xpath('//xmlns:ListRecords/xmlns:record/xmlns:header').count).to eql 4 end it 'first record has oai_dc metadata element' do @@ -89,6 +89,12 @@ end end + context 'for all document until a specified time' do + before :example do + get '/catalog/oai?verb=ListRecords&metadataPrefix=oai_dc&until=2014-02-03T18:42:53Z' + end + end + context 'throws noRecordsMatch error' do before :example do get '/catalog/oai?verb=ListRecords&metadataPrefix=oai_dc&from=2015-01-01' From b39c4f9f924710aed0cd502a4894f8c9c3229db7 Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Thu, 19 Oct 2017 13:42:20 -0400 Subject: [PATCH 53/67] Updating README to reflect new installation and configuration instructions. --- README.md | 92 ++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 60 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index 28a7973..a787bc1 100644 --- a/README.md +++ b/README.md @@ -1,60 +1,56 @@ -# BlacklightOaiProvider: OAI-PMH service endpoint for Blacklight applications +# BlacklightOaiProvider +OAI-PMH service endpoint for Blacklight applications ## Description +The BlacklightOaiProvider plugin provides an [Open Archives Initiative Protocol for Metadata Harvesting (OAI-PMH)](http://www.openarchives.org/pmh/) data provider endpoint, using the [ruby-oai gem](https://github.com/code4lib/ruby-oai), that let service providers harvest that metadata. -The BlacklightOaiProvider plugin provides an [Open Archives Initiative Protocolo for Metadata Harvesting (OAI-PMH)](http://www.openarchives.org/pmh/) data provider endpoint, using the [ruby-oai gem](https://github.com/code4lib/ruby-oai), that let service providers harvest that metadata. +### Versioning +Starting `v4.1` major plugin versions are synced with major Blacklight versions. The last known version to work with Blacklight 3.x/Rails 3.x is `v0.1.0`. + +A few maintenance branches have been left in place in case there is interest to add support for older versions of rails/blacklight: + +`v3.x` -> Support for Blacklight 3.0 + +`v4.x` -> Support for Blacklight 4.0 and Rails 3.0 ## Requirements +A Rails app running Blacklight 4.x and Rails 4.x. -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. This field should be able to support date range queries. By default, the name of this field is `timestamp` (more on how to configure this below). -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`. +A properly configured documentHandler in the blacklight/solr configuration. ## Installation Add + ```ruby - gem "blacklight_oai_provider" + gem 'blacklight_oai_provider', '~> 4.1' ``` 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. If you want to do customize the way this installs, instead you may: +Then run +```ruby +rails generate blacklight_oai_provider:install +``` +to install the appropriate extensions into your `CatalogController` and `SolrDocument` classes. If you want to do customize the way this installs, instead you may: - add this to your Solr Document model: ```ruby - use_extension(BlacklightOaiProvider::SolrDocumentExtension) + include BlacklightOaiProvider::SolrDocument ``` - add this to your Controller: ```ruby - include BlacklightOaiProvider::ControllerExtension + include BlacklightOaiProvider::Controller ``` ## Configuration While the plugin provides some sensible (albeit generic) defaults out of the box, you probably will want to customize the OAI provider configuration. -### For Blacklight 3.x.x - -You can provide OAI-PMH provider parameters by placing the following in your blacklight configuration, in `./config/initializers/blacklight_config.rb` - -```ruby - config[:oai] = { - :provider => { - :repository_name => 'Test', - :repository_url => 'http://localhost', - :record_prefix => '', - :admin_email => 'root@localhost' - }, - :document => { - :timestamp => 'timestamp', - :limit => 25 - } - } -``` -### For Blacklight 4.x.x - -in `app/controllers/catalog_controller.rb` +### Blacklight configuration +You can provide OAI-PMH provider parameters by placing the following in your blacklight configuration (most likely in `app/controllers/catalog_controller.rb`) ```ruby configure_blacklight do |config| @@ -69,7 +65,7 @@ in `app/controllers/catalog_controller.rb` :admin_email => 'root@localhost' }, :document => { - :timestamp => 'timestamp', + :model => SolrDocument, # SolrDocument class you are using. :limit => 25 } } @@ -78,10 +74,36 @@ in `app/controllers/catalog_controller.rb` end ``` + The "provider" configuration is documented as part of the ruby-oai gem at http://oai.rubyforge.org/ -### Injection +_Note:_ The document handler in your blacklight controller must be configured properly for this plugin to correctly look up records. +### SolrDocument configuration +To change the name of the timestamp solr field in your `SolrDocument` model change the following attribute: +```ruby + self.timestamp_key = 'record_creation_date' # Default: 'timestamp' +``` + +The metadata displayed in the xml serialization of each record is based off the `field_semantics` hash in the `SolrDocument`. To update/change these fields add something like the following to your model: + +```ruby + field_semantics.merge!( + creator: "author_display", + date: "pub_date", + subject: "subject_topic_facet", + title: "title_display", + language: "language_facet", + format: "format" + ) +``` + +The fields used by the dublin core serialization are: +```ruby + [:contributor, :coverage, :creator, :date, :description, :format, :identifier, :language, :publisher, :relation, :rights, :source, :subject, :title, :type] +``` + +## 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. @@ -99,5 +121,11 @@ You can also turn off injection of individual components, which could be more us } ``` ## Tests +We use `engine_cart` and `solr_wrapper` to run tests on a dummy instance of an app using this plugin. + +To run the entire test suite: +```ruby + rake ci +``` -There are some basic tests. You can test OAI-PMH conformance against http://www.openarchives.org/data/registerasprovider.html#Protocol_Conformance_Testing or browse the data at http://re.cs.uct.ac.za/ +You can test OAI-PMH conformance against http://www.openarchives.org/data/registerasprovider.html#Protocol_Conformance_Testing or browse the data at http://re.cs.uct.ac.za/ From bdb1edc492e387afc9c67f03a19c1920301d9dec Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Thu, 19 Oct 2017 14:17:34 -0400 Subject: [PATCH 54/67] Forcing the use of UTC when parsing dates. --- .../concerns/blacklight_oai_provider/solr_document.rb | 2 +- lib/blacklight_oai_provider/resumption_token.rb | 10 ++++++++-- lib/blacklight_oai_provider/solr_document_wrapper.rb | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/app/models/concerns/blacklight_oai_provider/solr_document.rb b/app/models/concerns/blacklight_oai_provider/solr_document.rb index 045b9e7..bf19925 100644 --- a/app/models/concerns/blacklight_oai_provider/solr_document.rb +++ b/app/models/concerns/blacklight_oai_provider/solr_document.rb @@ -5,7 +5,7 @@ module SolrDocument def timestamp timestamp = get(self.class.timestamp_key) raise BlacklightOaiProvider::Exceptions::MissingTimestamp if timestamp.blank? - Time.zone.parse(timestamp) # Will default to application timezone, if timezone not provided in timestamp. + Time.zone.parse(timestamp) # Solr timestamps are all in UTC. end def to_oai_dc diff --git a/lib/blacklight_oai_provider/resumption_token.rb b/lib/blacklight_oai_provider/resumption_token.rb index 8dfc97f..fa5ef57 100644 --- a/lib/blacklight_oai_provider/resumption_token.rb +++ b/lib/blacklight_oai_provider/resumption_token.rb @@ -14,9 +14,9 @@ def self.parse(token_string) when /^s/ options[:set] = part.sub(/^s\(/, '').sub(/\)$/, '') when /^f/ - options[:from] = Time.zone.parse(part.sub(/^f\(/, '').sub(/\)$/, '')).utc + options[:from] = parse_date(part.sub(/^f\(/, '').sub(/\)$/, '')) when /^u/ - options[:until] = Time.zone.parse(part.sub(/^u\(/, '').sub(/\)$/, '')).utc + options[:until] = parse_date(part.sub(/^u\(/, '').sub(/\)$/, '')) when /^t/ total = part.sub(/^t\(/, '').sub(/\)$/, '').to_i end @@ -26,6 +26,12 @@ def self.parse(token_string) raise OAI::ResumptionTokenException end + # Force date to be in UTC. If date does not have a timezone UTC is assumed. + # If date is a different timezone it is converted to UTC. + def self.parse_date(str) + ActiveSupport::TimeZone.new('UTC').parse(str) + end + def encode_conditions encoded_token = @prefix.to_s.dup encoded_token << ".s(#{set})" if set diff --git a/lib/blacklight_oai_provider/solr_document_wrapper.rb b/lib/blacklight_oai_provider/solr_document_wrapper.rb index a5053ad..b32095e 100644 --- a/lib/blacklight_oai_provider/solr_document_wrapper.rb +++ b/lib/blacklight_oai_provider/solr_document_wrapper.rb @@ -74,7 +74,7 @@ def conditions(options) # conditions/query derived from options def solr_date(time) if time.respond_to?(:xmlschema) - time.xmlschema + time.utc.xmlschema # Force UTC. elsif time.blank? '*' else From 4fb7ba5a468a0b0345a3dfd2a3cfc1c6951182a8 Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Fri, 20 Oct 2017 11:25:08 -0400 Subject: [PATCH 55/67] Adding selenium with headless chrome for feature tests. --- blacklight_oai_provider.gemspec | 2 ++ spec/spec_helper.rb | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/blacklight_oai_provider.gemspec b/blacklight_oai_provider.gemspec index befdd08..1bd13df 100644 --- a/blacklight_oai_provider.gemspec +++ b/blacklight_oai_provider.gemspec @@ -23,6 +23,8 @@ Gem::Specification.new do |s| s.add_development_dependency 'capybara' s.add_development_dependency 'solr_wrapper' s.add_development_dependency 'engine_cart' + s.add_development_dependency "chromedriver-helper" + s.add_development_dependency "selenium-webdriver" s.add_development_dependency 'byebug' s.add_development_dependency 'rubocop', '~> 0.50.0' s.add_development_dependency "rubocop-rspec", '~> 1.8.0' diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 7820b2c..9d2b4b6 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -5,6 +5,19 @@ require 'rspec/rails' require 'capybara/rspec' +require 'selenium-webdriver' + +Capybara.javascript_driver = :headless_chrome + +Capybara.register_driver :headless_chrome do |app| + capabilities = Selenium::WebDriver::Remote::Capabilities.chrome( + chromeOptions: { args: %w[headless disable-gpu] } + ) + + Capybara::Selenium::Driver.new(app, + browser: :chrome, + desired_capabilities: capabilities) +end RSpec.configure do |config| config.infer_spec_type_from_file_location! From c9e4e5ce10da5f80d0250bd8b31b78a1d70e29ec Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Fri, 20 Oct 2017 11:25:22 -0400 Subject: [PATCH 56/67] Fixing feature tests. --- spec/features/blacklight_oai_provider_spec.rb | 26 ------------------- spec/features/html_rendering_spec.rb | 25 ++++++++++++++++++ 2 files changed, 25 insertions(+), 26 deletions(-) delete mode 100644 spec/features/blacklight_oai_provider_spec.rb create mode 100644 spec/features/html_rendering_spec.rb diff --git a/spec/features/blacklight_oai_provider_spec.rb b/spec/features/blacklight_oai_provider_spec.rb deleted file mode 100644 index 1400988..0000000 --- a/spec/features/blacklight_oai_provider_spec.rb +++ /dev/null @@ -1,26 +0,0 @@ -# encoding: utf-8 -require 'spec_helper' - -describe 'Blacklight oai provider' do - it "root page" do - visit '/catalog/oai' - page.should have_content 'not a legal OAI-PMH verb' - end - - it "identify page" do - pending 'have to be updated to use capybary js tests' - visit '/catalog/oai?verb=Identify' - page.should have_content 'root@localhost' - page.should have_xpath('//earliestdatestamp', :text => '2012-08-01T16:49:55Z') - end - - it "should list records" do - visit '/catalog/oai?verb=ListRecords' - end - - it "document page" do - pending 'have to be updated to use capybary js tests' - visit '/catalog/oai?verb=GetRecord&identifier=00282214&metadataPrefix=oai_dc' - page.should have_xpath('//title', :text => 'Fikr-i Ayāz') - end -end diff --git a/spec/features/html_rendering_spec.rb b/spec/features/html_rendering_spec.rb new file mode 100644 index 0000000..726b30c --- /dev/null +++ b/spec/features/html_rendering_spec.rb @@ -0,0 +1,25 @@ +# encoding: utf-8 +require 'spec_helper' + +# Spot checking a few pages to ensure that the stylesheet is rendered correctly in browser. +describe 'HTML page rendering', :js => true do + it "root page" do + visit '/catalog/oai' + expect(page).to have_content 'not a legal OAI-PMH verb' + end + + it "identify page" do + visit '/catalog/oai?verb=Identify' + expect(page).to have_xpath('//td[text()="Earliest Datestamp"]/parent::*/td[@class="value"]', :text => '2014-02-03T18:42:53Z') + end + + it "should list records" do + visit '/catalog/oai?verb=ListRecords&metadataPrefix=oai_dc' + expect(page).to have_content('OAI Record: test/00282214') + end + + it "document page" do + visit '/catalog/oai?verb=GetRecord&identifier=00282214&metadataPrefix=oai_dc' + expect(page).to have_xpath('//td[text()="Title"]/parent::*/td[@class="value"]', :text => 'Fikr-i Ayāz') + end +end From 95fc2c0963edb60e68b197f7cde0b067159227f4 Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Mon, 23 Oct 2017 10:24:46 -0400 Subject: [PATCH 57/67] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a787bc1..ed6ceaf 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ A properly configured documentHandler in the blacklight/solr configuration. Add ```ruby - gem 'blacklight_oai_provider', '~> 4.1' + gem 'blacklight_oai_provider', git: 'https://github.com/projectblacklight/blacklight_oai_provider', branch: 'v4.1' ``` to your Gemfile and run `bundle install`. From 3d576abe7dbbe4cafeede060420d5ccff51bd128 Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Tue, 24 Oct 2017 14:19:15 -0400 Subject: [PATCH 58/67] Updating how routes are added to the application. Inserting routes into blacklight routes. --- .rubocop_todo.yml | 28 ++++++++++++++++++++--- config/routes.rb | 4 ---- lib/blacklight_oai_provider.rb | 4 ++-- lib/blacklight_oai_provider/route_sets.rb | 13 ----------- lib/blacklight_oai_provider/routes.rb | 15 ++++++++++++ 5 files changed, 42 insertions(+), 22 deletions(-) delete mode 100644 config/routes.rb delete mode 100644 lib/blacklight_oai_provider/route_sets.rb create mode 100644 lib/blacklight_oai_provider/routes.rb diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 58f0638..f409b46 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2017-10-18 14:33:45 -0400 using RuboCop version 0.50.0. +# on 2017-10-24 12:55:49 -0400 using RuboCop version 0.50.0. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new @@ -8,7 +8,7 @@ # Offense count: 4 Metrics/AbcSize: - Max: 29 + Max: 25 # Offense count: 1 # Configuration parameters: CountComments. @@ -34,12 +34,34 @@ Style/Documentation: - 'lib/blacklight_oai_provider/engine.rb' - 'lib/blacklight_oai_provider/exceptions.rb' - 'lib/blacklight_oai_provider/resumption_token.rb' - - 'lib/blacklight_oai_provider/route_sets.rb' + - 'lib/blacklight_oai_provider/routes.rb' - 'lib/blacklight_oai_provider/solr_document_provider.rb' - 'lib/blacklight_oai_provider/solr_document_wrapper.rb' - 'lib/blacklight_oai_provider/version.rb' - 'lib/generators/blacklight_oai_provider/install_generator.rb' +# Offense count: 15 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: when_needed, always, never +Style/FrozenStringLiteralComment: + Exclude: + - 'Gemfile' + - 'Rakefile' + - 'app/controllers/concerns/blacklight_oai_provider/controller.rb' + - 'app/models/concerns/blacklight_oai_provider/solr_document.rb' + - 'config/routes.rb' + - 'lib/blacklight_oai_provider.rb' + - 'lib/blacklight_oai_provider/engine.rb' + - 'lib/blacklight_oai_provider/exceptions.rb' + - 'lib/blacklight_oai_provider/resumption_token.rb' + - 'lib/blacklight_oai_provider/routes.rb' + - 'lib/blacklight_oai_provider/solr_document_provider.rb' + - 'lib/blacklight_oai_provider/solr_document_wrapper.rb' + - 'lib/blacklight_oai_provider/version.rb' + - 'lib/generators/blacklight_oai_provider/install_generator.rb' + - 'lib/railties/blacklight_oai_provider.rake' + # Offense count: 2 # Configuration parameters: MinBodyLength. Style/GuardClause: diff --git a/config/routes.rb b/config/routes.rb deleted file mode 100644 index b33846e..0000000 --- a/config/routes.rb +++ /dev/null @@ -1,4 +0,0 @@ -# We want to add a new collection action to Catalog, without over-writing -# what's already there. This SEEMS to do it. -Rails.application.routes.draw do -end diff --git a/lib/blacklight_oai_provider.rb b/lib/blacklight_oai_provider.rb index 03665b4..3a3736b 100644 --- a/lib/blacklight_oai_provider.rb +++ b/lib/blacklight_oai_provider.rb @@ -3,7 +3,7 @@ module BlacklightOaiProvider autoload :SolrDocumentProvider, 'blacklight_oai_provider/solr_document_provider' autoload :SolrDocumentWrapper, 'blacklight_oai_provider/solr_document_wrapper' autoload :ResumptionToken, 'blacklight_oai_provider/resumption_token' - autoload :RouteSets, 'blacklight_oai_provider/route_sets' + autoload :Routes, 'blacklight_oai_provider/routes' require 'oai' require 'blacklight_oai_provider/version' @@ -20,7 +20,7 @@ def self.omit_inject end def self.inject! - Blacklight::Routes.send(:include, BlacklightOaiProvider::RouteSets) unless BlacklightOaiProvider.omit_inject[:routes] + Blacklight::Routes.send(:include, BlacklightOaiProvider::Routes) unless BlacklightOaiProvider.omit_inject[:routes] end # Add element to array only if it's not already there diff --git a/lib/blacklight_oai_provider/route_sets.rb b/lib/blacklight_oai_provider/route_sets.rb deleted file mode 100644 index 9b37620..0000000 --- a/lib/blacklight_oai_provider/route_sets.rb +++ /dev/null @@ -1,13 +0,0 @@ -module BlacklightOaiProvider - module RouteSets - protected - - def catalog - add_routes do - get 'catalog/oai' => 'catalog#oai', :as => 'oai_provider' - end - - super - end - end -end diff --git a/lib/blacklight_oai_provider/routes.rb b/lib/blacklight_oai_provider/routes.rb new file mode 100644 index 0000000..8470973 --- /dev/null +++ b/lib/blacklight_oai_provider/routes.rb @@ -0,0 +1,15 @@ +module BlacklightOaiProvider + module Routes + extend ActiveSupport::Concern + + included do |klass| + klass.default_route_sets.insert(klass.default_route_sets.index(:catalog), :oai_routing) + end + + def oai_routing + add_routes do + get "catalog/oai", to: "catalog#oai", as: 'oai_provider' + end + end + end +end From 7d24b506bfb5b994ddb60c3bbc6f2600f9a5dd8d Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Tue, 24 Oct 2017 15:43:00 -0400 Subject: [PATCH 59/67] Updating version of solr used for testing. --- .solr_wrapper | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.solr_wrapper b/.solr_wrapper index 3307716..dd02056 100644 --- a/.solr_wrapper +++ b/.solr_wrapper @@ -1,7 +1,7 @@ # Place any default configuration for solr_wrapper here port: 8983 verbose: true -version: 5.5.4 +version: 5.5.5 managed: true collection: dir: solr/conf/ From f687e356a5e05073599767b75ae507553217fa4d Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Thu, 26 Oct 2017 15:19:52 -0400 Subject: [PATCH 60/67] Running rubocop-rspec on our test files. - Updated rubocop configuration and todo - Fixed/cleanup code --- .rubocop.yml | 2 +- .rubocop_todo.yml | 94 +++++++++++++++---- blacklight_oai_provider.gemspec | 2 +- spec/controllers/catalog_controller_spec.rb | 24 ++--- spec/features/html_rendering_spec.rb | 9 +- spec/models/solr_document_spec.rb | 26 ++--- spec/requests/get_record_spec.rb | 6 +- spec/requests/identify_spec.rb | 2 +- spec/requests/list_identifiers_spec.rb | 16 ++-- spec/requests/list_metadata_formats_spec.rb | 4 +- spec/requests/list_records_spec.rb | 20 ++-- .../lib/generators/test_app_generator.rb | 28 +++--- 12 files changed, 145 insertions(+), 88 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index df19158..bb3ae90 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -6,7 +6,6 @@ inherit_from: AllCops: DisplayCopNames: true Exclude: - - "spec/**/*" - "blacklight_oai_provider.gemspec" Rails: @@ -14,6 +13,7 @@ Rails: Metrics/BlockLength: Exclude: + - 'spec/**/*' - "lib/railties/blacklight_oai_provider.rake" Metrics/LineLength: diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index f409b46..4ae3de6 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,27 +1,88 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2017-10-24 12:55:49 -0400 using RuboCop version 0.50.0. +# on 2017-10-26 15:19:14 -0400 using RuboCop version 0.50.0. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new # versions of RuboCop, may require this file to be generated again. +# Offense count: 2 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: empty_lines, no_empty_lines +Layout/EmptyLinesAroundBlockBody: + Exclude: + - 'spec/requests/list_metadata_formats_spec.rb' + # Offense count: 4 Metrics/AbcSize: Max: 25 -# Offense count: 1 +# Offense count: 2 # Configuration parameters: CountComments. Metrics/MethodLength: - Max: 21 + Max: 39 # Offense count: 2 +RSpec/BeforeAfterAll: + Exclude: + - 'spec/spec_helper.rb' + - 'spec/rails_helper.rb' + - 'spec/support/**/*.rb' + - 'spec/requests/list_identifiers_spec.rb' + +# Offense count: 6 +RSpec/DescribeClass: + Exclude: + - 'spec/features/html_rendering_spec.rb' + - 'spec/requests/get_record_spec.rb' + - 'spec/requests/identify_spec.rb' + - 'spec/requests/list_identifiers_spec.rb' + - 'spec/requests/list_metadata_formats_spec.rb' + - 'spec/requests/list_records_spec.rb' + +# Offense count: 1 +# Configuration parameters: CustomIncludeMethods. +RSpec/EmptyExampleGroup: + Exclude: + - 'spec/requests/list_records_spec.rb' + +# Offense count: 1 +# Configuration parameters: Max. +RSpec/ExampleLength: + Exclude: + - 'spec/controllers/catalog_controller_spec.rb' + +# Offense count: 6 +RSpec/MultipleExpectations: + Max: 2 + +# Offense count: 2 +# Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: strict, flexible +Rails/TimeZone: + Exclude: + - 'spec/requests/identify_spec.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles, ProceduralMethods, FunctionalMethods, IgnoredMethods. +# SupportedStyles: line_count_based, semantic, braces_for_chaining +# ProceduralMethods: benchmark, bm, bmbm, create, each_with_object, measure, new, realtime, tap, with_object +# FunctionalMethods: let, let!, subject, watch +# IgnoredMethods: lambda, proc, it +Style/BlockDelimiters: + Exclude: + - 'spec/models/solr_document_spec.rb' + +# Offense count: 3 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles. # SupportedStyles: braces, no_braces, context_dependent Style/BracesAroundHashParameters: Exclude: - 'lib/blacklight_oai_provider/solr_document_wrapper.rb' + - 'spec/models/solr_document_spec.rb' # Offense count: 12 Style/Documentation: @@ -40,27 +101,12 @@ Style/Documentation: - 'lib/blacklight_oai_provider/version.rb' - 'lib/generators/blacklight_oai_provider/install_generator.rb' -# Offense count: 15 +# Offense count: 24 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles. # SupportedStyles: when_needed, always, never Style/FrozenStringLiteralComment: - Exclude: - - 'Gemfile' - - 'Rakefile' - - 'app/controllers/concerns/blacklight_oai_provider/controller.rb' - - 'app/models/concerns/blacklight_oai_provider/solr_document.rb' - - 'config/routes.rb' - - 'lib/blacklight_oai_provider.rb' - - 'lib/blacklight_oai_provider/engine.rb' - - 'lib/blacklight_oai_provider/exceptions.rb' - - 'lib/blacklight_oai_provider/resumption_token.rb' - - 'lib/blacklight_oai_provider/routes.rb' - - 'lib/blacklight_oai_provider/solr_document_provider.rb' - - 'lib/blacklight_oai_provider/solr_document_wrapper.rb' - - 'lib/blacklight_oai_provider/version.rb' - - 'lib/generators/blacklight_oai_provider/install_generator.rb' - - 'lib/railties/blacklight_oai_provider.rake' + Enabled: false # Offense count: 2 # Configuration parameters: MinBodyLength. @@ -74,3 +120,11 @@ Style/GuardClause: # SupportedStyles: percent, brackets Style/SymbolArray: EnforcedStyle: brackets + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: IgnoredMethods. +# IgnoredMethods: respond_to, define_method +Style/SymbolProc: + Exclude: + - 'spec/spec_helper.rb' diff --git a/blacklight_oai_provider.gemspec b/blacklight_oai_provider.gemspec index 1bd13df..f36a4b2 100644 --- a/blacklight_oai_provider.gemspec +++ b/blacklight_oai_provider.gemspec @@ -27,5 +27,5 @@ Gem::Specification.new do |s| s.add_development_dependency "selenium-webdriver" s.add_development_dependency 'byebug' s.add_development_dependency 'rubocop', '~> 0.50.0' - s.add_development_dependency "rubocop-rspec", '~> 1.8.0' + s.add_development_dependency "rubocop-rspec", '~> 1.18.0' end diff --git a/spec/controllers/catalog_controller_spec.rb b/spec/controllers/catalog_controller_spec.rb index 2e04f0d..745966d 100644 --- a/spec/controllers/catalog_controller_spec.rb +++ b/spec/controllers/catalog_controller_spec.rb @@ -1,16 +1,16 @@ require 'spec_helper' describe CatalogController do - it "should have a Blacklight module" do + it "has a Blacklight module" do expect(Blacklight).to be_a_kind_of Module end - it 'should have blacklight configuration' do - expect(CatalogController.blacklight_config).to be_a_kind_of Blacklight::Configuration + it 'has blacklight configuration' do + expect(described_class.blacklight_config).to be_a_kind_of Blacklight::Configuration end describe '#oai' do - it 'should respond to oai' do + it 'responds to oai' do expect(controller).to respond_to :oai end end @@ -18,15 +18,15 @@ describe '#oai_config' do it 'returns correct configuration' do expect(controller.oai_config).to match( - :provider => { - :repository_name => "Test Repository", - :repository_url => "http://localhost", - :record_prefix => "test", - :admin_email => "root@localhost", - :deletion_support => "persistent", - :sample_id => "109660" + provider: { + repository_name: "Test Repository", + repository_url: "http://localhost", + record_prefix: "test", + admin_email: "root@localhost", + deletion_support: "persistent", + sample_id: "109660" }, - :document => { :model => SolrDocument, :limit => 25 } + document: { model: SolrDocument, limit: 25 } ) end end diff --git a/spec/features/html_rendering_spec.rb b/spec/features/html_rendering_spec.rb index 726b30c..ee98c17 100644 --- a/spec/features/html_rendering_spec.rb +++ b/spec/features/html_rendering_spec.rb @@ -1,8 +1,7 @@ -# encoding: utf-8 require 'spec_helper' # Spot checking a few pages to ensure that the stylesheet is rendered correctly in browser. -describe 'HTML page rendering', :js => true do +describe 'HTML page rendering', js: true do it "root page" do visit '/catalog/oai' expect(page).to have_content 'not a legal OAI-PMH verb' @@ -10,16 +9,16 @@ it "identify page" do visit '/catalog/oai?verb=Identify' - expect(page).to have_xpath('//td[text()="Earliest Datestamp"]/parent::*/td[@class="value"]', :text => '2014-02-03T18:42:53Z') + expect(page).to have_xpath('//td[text()="Earliest Datestamp"]/parent::*/td[@class="value"]', text: '2014-02-03T18:42:53Z') end - it "should list records" do + it "lists records" do visit '/catalog/oai?verb=ListRecords&metadataPrefix=oai_dc' expect(page).to have_content('OAI Record: test/00282214') end it "document page" do visit '/catalog/oai?verb=GetRecord&identifier=00282214&metadataPrefix=oai_dc' - expect(page).to have_xpath('//td[text()="Title"]/parent::*/td[@class="value"]', :text => 'Fikr-i Ayāz') + expect(page).to have_xpath('//td[text()="Title"]/parent::*/td[@class="value"]', text: 'Fikr-i Ayāz') end end diff --git a/spec/models/solr_document_spec.rb b/spec/models/solr_document_spec.rb index 244f630..d979a84 100644 --- a/spec/models/solr_document_spec.rb +++ b/spec/models/solr_document_spec.rb @@ -1,39 +1,43 @@ require 'spec_helper' RSpec.describe SolrDocument do - it 'should include BlacklightOaiProvider::SolrDocument' do - expect(SolrDocument.ancestors.include?(BlacklightOaiProvider::SolrDocument)).to eql true + it 'includes BlacklightOaiProvider::SolrDocument' do + expect(described_class.ancestors.include?(BlacklightOaiProvider::SolrDocument)).to be true end - subject { SolrDocument.new } + subject(:document) { described_class.new } describe '#timestamp' do it 'responds to timestamp' do - expect(subject).to respond_to :timestamp + expect(document).to respond_to :timestamp end it 'throws error if timestamp field not available' do - expect{ - subject.timestamp + expect { + document.timestamp }.to raise_error BlacklightOaiProvider::Exceptions::MissingTimestamp end it 'returns timestamp' do - doc = SolrDocument.new({ timestamp: '2017-10-16T19:20:14Z' }) + doc = described_class.new({ timestamp: '2017-10-16T19:20:14Z' }) expect(doc.timestamp).to be_a Time expect(doc.timestamp.xmlschema).to eql '2017-10-16T19:20:14Z' end end describe '#to_oai_dc' do + let(:valid_xml) do + '' + end + it 'responds to to_oai_dc' do - expect(subject).to respond_to :to_oai_dc + expect(document).to respond_to :to_oai_dc end it "returns xml document" do - expect( - subject.to_oai_dc - ).to eql '' + expect(document.to_oai_dc).to eql valid_xml end end end diff --git a/spec/requests/get_record_spec.rb b/spec/requests/get_record_spec.rb index 6789ffe..18558f4 100644 --- a/spec/requests/get_record_spec.rb +++ b/spec/requests/get_record_spec.rb @@ -10,7 +10,7 @@ } end - before :example do + before do get '/catalog/oai?verb=GetRecord&identifier=2007020969&metadataPrefix=oai_dc' end @@ -24,12 +24,12 @@ end it 'contains date' do - expect(xml.at_xpath('//xmlns:metadata/oai_dc:dc/dc:date', namespaces).text).to eql '2008' + expect(xml.at_xpath('//xmlns:metadata/oai_dc:dc/dc:date', namespaces).text).to eql '2008' end it 'contains subjects' do nodes = xml.xpath('//xmlns:metadata/oai_dc:dc/dc:subject', namespaces) - expect(nodes.count).to eql 4 + expect(nodes.count).to be 4 expect(nodes.map(&:text)).to match_array ['Strong Medicine, 1922-', 'Delaware women', 'Indian women shamans', 'Delaware Indians'] end diff --git a/spec/requests/identify_spec.rb b/spec/requests/identify_spec.rb index 89e07ce..0bec3fa 100644 --- a/spec/requests/identify_spec.rb +++ b/spec/requests/identify_spec.rb @@ -3,7 +3,7 @@ describe 'OIA-PMH Identify Request' do let(:xml) { Nokogiri::XML(response.body) } - before :example do + before do get '/catalog/oai?verb=Identify' end diff --git a/spec/requests/list_identifiers_spec.rb b/spec/requests/list_identifiers_spec.rb index 2e1d8b5..a73f991 100644 --- a/spec/requests/list_identifiers_spec.rb +++ b/spec/requests/list_identifiers_spec.rb @@ -4,12 +4,12 @@ let(:xml) { Nokogiri::XML(response.body) } context 'for all documents' do - before :example do + before do get '/catalog/oai?verb=ListIdentifiers&metadataPrefix=oai_dc' end it 'returns 25 records' do - expect(xml.xpath('//xmlns:ListIdentifiers/xmlns:header').count).to eql 25 + expect(xml.xpath('//xmlns:ListIdentifiers/xmlns:header').count).to be 25 end it 'first record has identifier and timestamp' do @@ -23,12 +23,12 @@ end context 'with resumption_token' do - before :example do + before do get '/catalog/oai?verb=ListIdentifiers&resumptionToken=oai_dc.f(2014-02-03T18:42:53Z).u(2014-03-03T18:42:53Z).t(30):25' end it 'returns 5 records' do - expect(xml.xpath('//xmlns:ListIdentifiers/xmlns:header').count).to eql 5 + expect(xml.xpath('//xmlns:ListIdentifiers/xmlns:header').count).to be 5 end it 'first record has identifier and timestamp' do @@ -42,12 +42,12 @@ end context 'for all documents within a time range' do - before :example do + before do get '/catalog/oai?verb=ListIdentifiers&metadataPrefix=oai_dc&from=2014-03-03&until=2014-04-03' end it 'returns 1 record' do - expect(xml.xpath('//xmlns:ListIdentifiers/xmlns:header').count).to eql 1 + expect(xml.xpath('//xmlns:ListIdentifiers/xmlns:header').count).to be 1 end it 'does not contain a resumptionToken' do @@ -60,7 +60,7 @@ SolrDocument.timestamp_key = "record_creation_dt" end - before :each do + before do get '/catalog/oai?verb=ListIdentifiers&metadataPrefix=oai_dc&from=2015-01-01' end @@ -69,7 +69,7 @@ end it 'returns correct document' do - expect(xml.xpath('//xmlns:ListIdentifiers/xmlns:header').count).to eql 1 + expect(xml.xpath('//xmlns:ListIdentifiers/xmlns:header').count).to be 1 expect(xml.at_xpath('//xmlns:ListIdentifiers/xmlns:header/xmlns:identifier').text).to eql 'test/78908283' end diff --git a/spec/requests/list_metadata_formats_spec.rb b/spec/requests/list_metadata_formats_spec.rb index 141de62..eff86b0 100644 --- a/spec/requests/list_metadata_formats_spec.rb +++ b/spec/requests/list_metadata_formats_spec.rb @@ -4,7 +4,7 @@ let(:xml) { Nokogiri::XML(response.body) } context 'without identifier parameter' do - before :example do + before do get '/catalog/oai?verb=ListMetadataFormats' end @@ -23,7 +23,7 @@ end context 'with identifier parameter' do - before :example do + before do get '/catalog/oai?verb=ListMetadataFormats&identifier=2007020969' end diff --git a/spec/requests/list_records_spec.rb b/spec/requests/list_records_spec.rb index d6f1407..7abba54 100644 --- a/spec/requests/list_records_spec.rb +++ b/spec/requests/list_records_spec.rb @@ -11,12 +11,12 @@ end context 'for all documents' do - before :example do + before do get '/catalog/oai?verb=ListRecords&metadataPrefix=oai_dc' end it 'returns 25 records' do - expect(xml.xpath('//xmlns:ListRecords/xmlns:record/xmlns:header').count).to eql 25 + expect(xml.xpath('//xmlns:ListRecords/xmlns:record/xmlns:header').count).to be 25 end it 'first record has oai_dc metadata element' do @@ -28,12 +28,12 @@ end context 'metadata element' do - let(:metadata_node) { + let(:metadata_node) do xml.xpath( '//xmlns:ListRecords/xmlns:record/xmlns:header/xmlns:identifier[text()="test/2007020969"]/parent::*/parent::*/xmlns:metadata/oai_dc:dc', namespaces ) - } + end it 'contains title' do expect(metadata_node.at_xpath('dc:title', namespaces).text).to eql '"Strong Medicine speaks"' @@ -58,12 +58,12 @@ end context 'with resumption_token with date filter' do - before :example do + before do get '/catalog/oai?verb=ListRecords&resumptionToken=oai_dc.f(2014-02-03T18:42:53Z).u(2014-02-03T18:42:53Z).t(29):25' end it 'returns 4 records' do - expect(xml.xpath('//xmlns:ListRecords/xmlns:record/xmlns:header').count).to eql 4 + expect(xml.xpath('//xmlns:ListRecords/xmlns:record/xmlns:header').count).to be 4 end it 'first record has oai_dc metadata element' do @@ -76,12 +76,12 @@ end context 'for all documents within a time range' do - before :example do + before do get '/catalog/oai?verb=ListRecords&metadataPrefix=oai_dc&from=2014-03-03&until=2014-04-03' end it 'returns 1 record' do - expect(xml.xpath('//xmlns:ListRecords/xmlns:record/xmlns:header').count).to eql 1 + expect(xml.xpath('//xmlns:ListRecords/xmlns:record/xmlns:header').count).to be 1 end it 'does not contain a resumptionToken' do @@ -90,13 +90,13 @@ end context 'for all document until a specified time' do - before :example do + before do get '/catalog/oai?verb=ListRecords&metadataPrefix=oai_dc&until=2014-02-03T18:42:53Z' end end context 'throws noRecordsMatch error' do - before :example do + before do get '/catalog/oai?verb=ListRecords&metadataPrefix=oai_dc&from=2015-01-01' end diff --git a/spec/test_app_templates/lib/generators/test_app_generator.rb b/spec/test_app_templates/lib/generators/test_app_generator.rb index 5b0ef5f..882c885 100644 --- a/spec/test_app_templates/lib/generators/test_app_generator.rb +++ b/spec/test_app_templates/lib/generators/test_app_generator.rb @@ -41,23 +41,23 @@ def install_engine def add_test_blacklight_oai_config say_status("warning", "ADDING BL OIA-PMH CONFIG") - insert_into_file "app/controllers/catalog_controller.rb", :after => " config.default_solr_params = { \n" do + insert_into_file "app/controllers/catalog_controller.rb", after: " config.default_solr_params = { \n" do " :fl => '*',\n" end - insert_into_file "app/controllers/catalog_controller.rb", :after => " configure_blacklight do |config|\n" do -%{ + insert_into_file "app/controllers/catalog_controller.rb", after: " configure_blacklight do |config|\n" do + <<-CONFIG config.default_document_solr_params = { - :qt => 'search', - :fl => '*', - :rows => 1, - :q => '{!raw f=id v=$id}' + :qt => 'search', + :fl => '*', + :rows => 1, + :q => '{!raw f=id v=$id}' } -} + CONFIG end - insert_into_file "app/controllers/catalog_controller.rb", :after => "configure_blacklight do |config|\n" do -%{ + insert_into_file "app/controllers/catalog_controller.rb", after: "configure_blacklight do |config|\n" do + <<-CONFIG config.oai = { :provider => { :repository_name => 'Test Repository', @@ -72,15 +72,15 @@ def add_test_blacklight_oai_config :limit => 25 } } -} + CONFIG end - insert_into_file "app/models/solr_document.rb", :after => " field_semantics.merge!( \n" do -%{ + insert_into_file "app/models/solr_document.rb", after: " field_semantics.merge!( \n" do + <<-CONFIG :creator => "author_display", :date => "pub_date", :subject => "subject_topic_facet", -} + CONFIG end end end From b9dfa6d3200ca7a7352c7d81a613aa0ad4e88213 Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Tue, 31 Oct 2017 10:35:26 -0400 Subject: [PATCH 61/67] Minor README edits. --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index ed6ceaf..f31e4c8 100644 --- a/README.md +++ b/README.md @@ -2,21 +2,21 @@ OAI-PMH service endpoint for Blacklight applications ## Description -The BlacklightOaiProvider plugin provides an [Open Archives Initiative Protocol for Metadata Harvesting (OAI-PMH)](http://www.openarchives.org/pmh/) data provider endpoint, using the [ruby-oai gem](https://github.com/code4lib/ruby-oai), that let service providers harvest that metadata. +The BlacklightOaiProvider plugin provides an [Open Archives Initiative Protocol for Metadata Harvesting (OAI-PMH)](http://www.openarchives.org/pmh/) data provider endpoint, using the [ruby-oai gem](https://github.com/code4lib/ruby-oai). This endpoint enables service providers harvest a data provider's metadata. ### Versioning Starting `v4.1` major plugin versions are synced with major Blacklight versions. The last known version to work with Blacklight 3.x/Rails 3.x is `v0.1.0`. -A few maintenance branches have been left in place in case there is interest to add support for older versions of rails/blacklight: +A few maintenance branches have been left in place in case there is interest to add support for older versions of Rails/Blacklight: `v3.x` -> Support for Blacklight 3.0 `v4.x` -> Support for Blacklight 4.0 and Rails 3.0 ## Requirements -A Rails app running Blacklight 4.x and Rails 4.x. +A Rails app running Rails 4.x and Blacklight 4.x. -OAI-PMH requires a timestamp field for all records, so your Solr index should include an appropriate field. This field should be able to support date range queries. By default, the name of this field is `timestamp` (more on how to configure this below). +OAI-PMH requires a timestamp field for all records. The Solr index should include an appropriate field. This field should be able to support date range queries. By default, the name of this field is `timestamp` (more on how to configure this below). A properly configured documentHandler in the blacklight/solr configuration. @@ -25,14 +25,14 @@ A properly configured documentHandler in the blacklight/solr configuration. Add ```ruby - gem 'blacklight_oai_provider', git: 'https://github.com/projectblacklight/blacklight_oai_provider', branch: 'v4.1' + gem 'blacklight_oai_provider', git: 'https://github.com/projectblacklight/blacklight_oai_provider', tag: 'v4.1.0.pre1' ``` to your Gemfile and run `bundle install`. Then run ```ruby -rails generate blacklight_oai_provider:install + rails generate blacklight_oai_provider:install ``` to install the appropriate extensions into your `CatalogController` and `SolrDocument` classes. If you want to do customize the way this installs, instead you may: @@ -85,9 +85,9 @@ To change the name of the timestamp solr field in your `SolrDocument` model chan self.timestamp_key = 'record_creation_date' # Default: 'timestamp' ``` -The metadata displayed in the xml serialization of each record is based off the `field_semantics` hash in the `SolrDocument`. To update/change these fields add something like the following to your model: +The metadata displayed in the xml serialization of each record is based off the `field_semantics` hash in the `SolrDocument` model. To update/change these fields add something like the following to your model: -```ruby +```ruby field_semantics.merge!( creator: "author_display", date: "pub_date", @@ -106,7 +106,7 @@ The fields used by the dublin core serialization are: ## 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. +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: ```ruby From d9dbb9d646f7c97eb35572a6afeccf362b561784 Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Tue, 31 Oct 2017 10:51:08 -0400 Subject: [PATCH 62/67] Bumping version to 4.1.0.pre1 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 17e51c3..d2deef7 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.1.1 +4.1.0.pre1 From 942918ee1e6f5a894221b9b5d204523309c8226e Mon Sep 17 00:00:00 2001 From: Corey Hinshaw Date: Wed, 21 Dec 2016 15:14:24 -0500 Subject: [PATCH 63/67] Patch identifier bug in OAI gem --- config/initializers/oai_patches.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 config/initializers/oai_patches.rb diff --git a/config/initializers/oai_patches.rb b/config/initializers/oai_patches.rb new file mode 100644 index 0000000..11439eb --- /dev/null +++ b/config/initializers/oai_patches.rb @@ -0,0 +1,20 @@ +# Fix the OAI gem resource identifier format +# See: https://github.com/code4lib/ruby-oai/issues/38 + +Rails.application.config.to_prepare do + OAI::Provider::Response::RecordResponse.class_eval do + private + + def identifier_for(record) + "#{provider.prefix}:#{record.id}" + end + end + + OAI::Provider::Response::Base.class_eval do + private + + def extract_identifier(id) + id.sub("#{provider.prefix}:", '') + end + end +end From 3a1761d2dc5687550ebe4b5eb19222b4adf8874d Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Wed, 1 Nov 2017 12:38:01 -0400 Subject: [PATCH 64/67] Fixing tests to expect correct oai identifier. Adding more tests for identifiers. --- spec/controllers/catalog_controller_spec.rb | 2 +- spec/features/html_rendering_spec.rb | 2 +- spec/requests/get_record_spec.rb | 2 +- spec/requests/identify_spec.rb | 8 +++++++- spec/requests/list_identifiers_spec.rb | 2 +- spec/requests/list_records_spec.rb | 4 ++-- .../lib/generators/test_app_generator.rb | 2 +- 7 files changed, 14 insertions(+), 8 deletions(-) diff --git a/spec/controllers/catalog_controller_spec.rb b/spec/controllers/catalog_controller_spec.rb index 745966d..6e5ed0d 100644 --- a/spec/controllers/catalog_controller_spec.rb +++ b/spec/controllers/catalog_controller_spec.rb @@ -21,7 +21,7 @@ provider: { repository_name: "Test Repository", repository_url: "http://localhost", - record_prefix: "test", + record_prefix: "oai:test", admin_email: "root@localhost", deletion_support: "persistent", sample_id: "109660" diff --git a/spec/features/html_rendering_spec.rb b/spec/features/html_rendering_spec.rb index ee98c17..8163a88 100644 --- a/spec/features/html_rendering_spec.rb +++ b/spec/features/html_rendering_spec.rb @@ -14,7 +14,7 @@ it "lists records" do visit '/catalog/oai?verb=ListRecords&metadataPrefix=oai_dc' - expect(page).to have_content('OAI Record: test/00282214') + expect(page).to have_content('OAI Record: oai:test:00282214') end it "document page" do diff --git a/spec/requests/get_record_spec.rb b/spec/requests/get_record_spec.rb index 18558f4..5e84b6b 100644 --- a/spec/requests/get_record_spec.rb +++ b/spec/requests/get_record_spec.rb @@ -15,7 +15,7 @@ end it 'contains header information' do - expect(xml.at_xpath('//xmlns:GetRecord/xmlns:record/xmlns:header/xmlns:identifier').text).to eql 'test/2007020969' + expect(xml.at_xpath('//xmlns:GetRecord/xmlns:record/xmlns:header/xmlns:identifier').text).to eql 'oai:test:2007020969' expect(xml.at_xpath('//xmlns:GetRecord/xmlns:record/xmlns:header/xmlns:datestamp').text).to eql '2014-02-03T18:42:53Z' end diff --git a/spec/requests/identify_spec.rb b/spec/requests/identify_spec.rb index 0bec3fa..7a54c23 100644 --- a/spec/requests/identify_spec.rb +++ b/spec/requests/identify_spec.rb @@ -39,9 +39,15 @@ expect(xml.at_xpath('//xmlns:adminEmail').text).to eql 'root@localhost' end + it "contains repository prefix/identifier" do + expect( + xml.at_xpath('//oai-identifier:repositoryIdentifier', 'oai-identifier' => "http://www.openarchives.org/OAI/2.0/oai-identifier").text + ).to eql 'test' + end + it "contains sample identifier" do expect( xml.at_xpath('//oai-identifier:sampleIdentifier', 'oai-identifier' => "http://www.openarchives.org/OAI/2.0/oai-identifier").text - ).to eql 'test:109660' + ).to eql 'oai:test:109660' end end diff --git a/spec/requests/list_identifiers_spec.rb b/spec/requests/list_identifiers_spec.rb index a73f991..5626ec0 100644 --- a/spec/requests/list_identifiers_spec.rb +++ b/spec/requests/list_identifiers_spec.rb @@ -70,7 +70,7 @@ it 'returns correct document' do expect(xml.xpath('//xmlns:ListIdentifiers/xmlns:header').count).to be 1 - expect(xml.at_xpath('//xmlns:ListIdentifiers/xmlns:header/xmlns:identifier').text).to eql 'test/78908283' + expect(xml.at_xpath('//xmlns:ListIdentifiers/xmlns:header/xmlns:identifier').text).to eql 'oai:test:78908283' end it 'document displays correct timestamp' do diff --git a/spec/requests/list_records_spec.rb b/spec/requests/list_records_spec.rb index 7abba54..2c1bc8c 100644 --- a/spec/requests/list_records_spec.rb +++ b/spec/requests/list_records_spec.rb @@ -30,7 +30,7 @@ context 'metadata element' do let(:metadata_node) do xml.xpath( - '//xmlns:ListRecords/xmlns:record/xmlns:header/xmlns:identifier[text()="test/2007020969"]/parent::*/parent::*/xmlns:metadata/oai_dc:dc', + '//xmlns:ListRecords/xmlns:record/xmlns:header/xmlns:identifier[text()="oai:test:2007020969"]/parent::*/parent::*/xmlns:metadata/oai_dc:dc', namespaces ) end @@ -51,7 +51,7 @@ expect(metadata_node.at_xpath('dc:language', namespaces).text).to eql 'English' end - it 'contains identifier' do + it 'contains format' do expect(metadata_node.at_xpath('dc:format', namespaces).text).to eql 'Book' end end diff --git a/spec/test_app_templates/lib/generators/test_app_generator.rb b/spec/test_app_templates/lib/generators/test_app_generator.rb index 882c885..8bcf11a 100644 --- a/spec/test_app_templates/lib/generators/test_app_generator.rb +++ b/spec/test_app_templates/lib/generators/test_app_generator.rb @@ -62,7 +62,7 @@ def add_test_blacklight_oai_config :provider => { :repository_name => 'Test Repository', :repository_url => 'http://localhost', - :record_prefix => 'test', + :record_prefix => 'oai:test', :admin_email => 'root@localhost', :deletion_support => 'persistent', :sample_id => '109660' From 5d81210f2602e8357de88f6c783bfae5c4686b48 Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Mon, 4 Dec 2017 10:10:15 -0500 Subject: [PATCH 65/67] Adding gem author. --- blacklight_oai_provider.gemspec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/blacklight_oai_provider.gemspec b/blacklight_oai_provider.gemspec index f36a4b2..c26346d 100644 --- a/blacklight_oai_provider.gemspec +++ b/blacklight_oai_provider.gemspec @@ -4,8 +4,8 @@ Gem::Specification.new do |s| s.name = "blacklight_oai_provider" s.version = BlacklightOaiProvider::VERSION s.platform = Gem::Platform::RUBY - s.authors = ["Chris Beer"] - s.email = ["chris@cbeer.info"] + s.authors = ["Chris Beer", "Carla Galarza"] + s.email = ["chris@cbeer.info", "cmg2228@columbia.edu"] s.homepage = "http://projectblacklight.org/" s.summary = "Blacklight Oai Provider plugin" From 43284a07ca8c2b26a9e88374502e4d26e07992f6 Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Mon, 4 Dec 2017 10:41:41 -0500 Subject: [PATCH 66/67] Adding post install message. --- blacklight_oai_provider.gemspec | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/blacklight_oai_provider.gemspec b/blacklight_oai_provider.gemspec index c26346d..3dffbc4 100644 --- a/blacklight_oai_provider.gemspec +++ b/blacklight_oai_provider.gemspec @@ -9,6 +9,11 @@ Gem::Specification.new do |s| s.homepage = "http://projectblacklight.org/" s.summary = "Blacklight Oai Provider plugin" + s.post_install_message = %q{ +BlacklightOaiProvider v4.1 implements configuration changes. Please visit README for more information. + +} + s.rubyforge_project = "blacklight" s.files = `git ls-files`.split("\n") From cfc79a6e2aaaa44f65fe438c917bb7e64720865b Mon Sep 17 00:00:00 2001 From: Carla Galarza Date: Mon, 4 Dec 2017 10:48:01 -0500 Subject: [PATCH 67/67] Bumping to v4.1.0 --- README.md | 6 +++--- VERSION | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f31e4c8..3741a3a 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ A properly configured documentHandler in the blacklight/solr configuration. Add ```ruby - gem 'blacklight_oai_provider', git: 'https://github.com/projectblacklight/blacklight_oai_provider', tag: 'v4.1.0.pre1' + gem 'blacklight_oai_provider', git: 'https://github.com/projectblacklight/blacklight_oai_provider' ``` to your Gemfile and run `bundle install`. @@ -87,7 +87,7 @@ To change the name of the timestamp solr field in your `SolrDocument` model chan The metadata displayed in the xml serialization of each record is based off the `field_semantics` hash in the `SolrDocument` model. To update/change these fields add something like the following to your model: -```ruby +```ruby field_semantics.merge!( creator: "author_display", date: "pub_date", @@ -104,7 +104,7 @@ The fields used by the dublin core serialization are: ``` ## 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. +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. diff --git a/VERSION b/VERSION index d2deef7..ee74734 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.1.0.pre1 +4.1.0