blacklight 5.16.4 → 5.17.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -0
- data/VERSION +1 -1
- data/app/controllers/concerns/blacklight/catalog.rb +2 -0
- data/app/views/catalog/_document_default.atom.builder +2 -4
- data/app/views/catalog/index.atom.builder +1 -1
- data/db/migrate/20140202020201_create_searches.rb +1 -1
- data/db/migrate/20140202020202_create_bookmarks.rb +1 -1
- data/lib/blacklight/abstract_repository.rb +15 -0
- data/lib/blacklight/search_builder.rb +4 -0
- data/lib/blacklight/utils.rb +15 -1
- data/lib/generators/blacklight/templates/catalog_controller.rb +12 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d718d6ce1d7a9acf09add7de9ffc63a514c886b2
|
4
|
+
data.tar.gz: 4fb53f6e833c2bbb4db244269378dc82acae1612
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 707e0171c0847a5110d2684f1fae48c127ef7a2ef715a758ba8d58dcf6e425d02a4164a23d6e53996eb248852d183f031223ff8eea23e387210240a0e6f084da
|
7
|
+
data.tar.gz: bb7e8038c4d226a4c895288079b311b8cd7d286616f26ec95c1dd3dec1f8a8ce49abe08e5d3e216e76af9d49424e55a014ad1b2e72766994be4ec3bcd5761574
|
data/Gemfile
CHANGED
@@ -5,6 +5,7 @@ gemspec path: File.expand_path('..', __FILE__)
|
|
5
5
|
|
6
6
|
gem 'simplecov', '~> 0.10', require: false
|
7
7
|
gem 'coveralls', '~> 0.8.6', require: false
|
8
|
+
gem 'autoprefixer-rails', '~> 6.0.0' if RUBY_VERSION < '2.0'
|
8
9
|
|
9
10
|
group :test do
|
10
11
|
gem "blacklight-marc", "~> 5.0", github: "projectblacklight/blacklight_marc"
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
5.
|
1
|
+
5.17.0
|
@@ -320,6 +320,8 @@ module Blacklight::Catalog
|
|
320
320
|
# DEPRECATED; this method will be removed in Blacklight 6.0 and the functionality
|
321
321
|
# moved to invalid_document_id_error
|
322
322
|
def invalid_solr_id_error(exception)
|
323
|
+
raise exception unless Pathname.new("#{Rails.root}/public/404.html").exist?
|
324
|
+
|
323
325
|
error_info = {
|
324
326
|
"status" => "404",
|
325
327
|
"error" => "#{exception.class}: #{exception.message}"
|
@@ -3,7 +3,7 @@ xml.entry do
|
|
3
3
|
xml.title presenter(document).render_document_index_label(document_show_link_field(document))
|
4
4
|
|
5
5
|
# updated is required, for now we'll just set it to now, sorry
|
6
|
-
xml.updated Time.
|
6
|
+
xml.updated Time.current.iso8601
|
7
7
|
|
8
8
|
xml.link "rel" => "alternate", "type" => "text/html", "href" => polymorphic_url(url_for_document(document))
|
9
9
|
# add other doc-specific formats, atom only lets us have one per
|
@@ -50,6 +50,4 @@ xml.entry do
|
|
50
50
|
end
|
51
51
|
|
52
52
|
end
|
53
|
-
|
54
|
-
|
55
|
-
end
|
53
|
+
end
|
@@ -43,7 +43,7 @@ xml.feed("xmlns" => "http://www.w3.org/2005/Atom",
|
|
43
43
|
|
44
44
|
|
45
45
|
# updated is required, for now we'll just set it to now, sorry
|
46
|
-
xml.updated Time.
|
46
|
+
xml.updated Time.current.iso8601
|
47
47
|
|
48
48
|
@document_list.each_with_index do |document, document_counter|
|
49
49
|
xml << Nokogiri::XML.fragment(render_document_partials(document, blacklight_config.view_config(:atom).partials, document_counter: document_counter))
|
@@ -16,6 +16,21 @@ module Blacklight
|
|
16
16
|
@connection ||= build_connection
|
17
17
|
end
|
18
18
|
|
19
|
+
##
|
20
|
+
# Find a single document result by a known id
|
21
|
+
# @param [String] document's unique key value
|
22
|
+
# @param [Hash] additional query parameters
|
23
|
+
def find(id, params = {})
|
24
|
+
fail NotImplementedError
|
25
|
+
end
|
26
|
+
|
27
|
+
##
|
28
|
+
# Execute a search query against a search index
|
29
|
+
# @param [Hash] query parameters
|
30
|
+
def search(params = {})
|
31
|
+
fail NotImplementedError
|
32
|
+
end
|
33
|
+
|
19
34
|
protected
|
20
35
|
def connection_config
|
21
36
|
blacklight_config.connection_config
|
@@ -1,4 +1,8 @@
|
|
1
1
|
module Blacklight
|
2
|
+
##
|
3
|
+
# Blacklight's SearchBuilder converts blacklight request parameters into
|
4
|
+
# query parameters appropriate for search index. It does so by evaluating a
|
5
|
+
# chain of processing methods to populate a result hash (see {#to_hash}).
|
2
6
|
class SearchBuilder
|
3
7
|
extend Deprecation
|
4
8
|
self.deprecation_horizon = "blacklight 6.0"
|
data/lib/blacklight/utils.rb
CHANGED
@@ -181,7 +181,21 @@ module Blacklight
|
|
181
181
|
# @return [OpenStructWithHashAccess] a new instance of an OpenStructWithHashAccess
|
182
182
|
def merge! other_hash
|
183
183
|
@table.merge!(nested_class, (other_hash if other_hash.is_a? Hash) || other_hash.to_h)
|
184
|
-
end
|
184
|
+
end
|
185
|
+
|
186
|
+
##
|
187
|
+
# Override #method_missing from OpenStruct to ensure the default_proc logic
|
188
|
+
# gets triggered.
|
189
|
+
def method_missing(mid, *args)
|
190
|
+
len = args.length
|
191
|
+
|
192
|
+
if len == 0
|
193
|
+
new_ostruct_member(mid)
|
194
|
+
@table[mid]
|
195
|
+
else
|
196
|
+
super
|
197
|
+
end
|
198
|
+
end
|
185
199
|
|
186
200
|
private
|
187
201
|
def set_default_proc!
|
@@ -4,6 +4,15 @@ class <%= controller_name.classify %>Controller < ApplicationController
|
|
4
4
|
include Blacklight::Catalog
|
5
5
|
|
6
6
|
configure_blacklight do |config|
|
7
|
+
## Class for sending and receiving requests from a search index
|
8
|
+
# config.repository_class = Blacklight::Solr::Repository
|
9
|
+
#
|
10
|
+
## Class for converting Blacklight's url parameters to into request parameters for the search index
|
11
|
+
# config.search_builder_class = ::SearchBuilder
|
12
|
+
#
|
13
|
+
## Model that maps search index responses to the blacklight response model
|
14
|
+
# config.response_model = Blacklight::Solr::Response
|
15
|
+
|
7
16
|
## Default parameters to send to solr for all search-like requests. See also SearchBuilder#processed_parameters
|
8
17
|
config.default_solr_params = {
|
9
18
|
:qt => 'search',
|
@@ -65,9 +74,9 @@ class <%= controller_name.classify %>Controller < ApplicationController
|
|
65
74
|
config.add_facet_field 'example_pivot_field', :label => 'Pivot Field', :pivot => ['format', 'language_facet']
|
66
75
|
|
67
76
|
config.add_facet_field 'example_query_facet_field', :label => 'Publish Date', :query => {
|
68
|
-
|
69
|
-
|
70
|
-
|
77
|
+
:years_5 => { :label => 'within 5 Years', :fq => "pub_date:[#{Time.zone.now.year - 5 } TO *]" },
|
78
|
+
:years_10 => { :label => 'within 10 Years', :fq => "pub_date:[#{Time.zone.now.year - 10 } TO *]" },
|
79
|
+
:years_25 => { :label => 'within 25 Years', :fq => "pub_date:[#{Time.zone.now.year - 25 } TO *]" }
|
71
80
|
}
|
72
81
|
|
73
82
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blacklight
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.17.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Rochkind
|
@@ -17,7 +17,7 @@ authors:
|
|
17
17
|
autorequire:
|
18
18
|
bindir: bin
|
19
19
|
cert_chain: []
|
20
|
-
date: 2015-
|
20
|
+
date: 2015-12-12 00:00:00.000000000 Z
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
23
23
|
name: rails
|