europeana-blacklight 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e06e950f7d8839a8f3adcf6383f6ad14d90fe04b
|
4
|
+
data.tar.gz: 5d98016e3a0bd6b6dd627bc0cdd239c4c52ae529
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c19a7a7227141539622f58bcb0b7225125d6b5a2f391a047829e82194785ca8683d588b908cb7726d5039ac45e95981c0513444c9d7e77b525f583ebfc354e8
|
7
|
+
data.tar.gz: 1da07143ac3430f3941f82ad205ab608fd900d4afbf18cd9a89c8474c14847579fc06d14b21a91f04bea5d91487e34584354f2bb8abc73b12ca49d9d01c4399f
|
data/.gitignore
CHANGED
data/Gemfile
CHANGED
@@ -47,7 +47,7 @@ module Europeana
|
|
47
47
|
return nil unless string_terms.present?
|
48
48
|
|
49
49
|
or_terms = string_terms.map do |v|
|
50
|
-
'"' + Europeana::API
|
50
|
+
'"' + Europeana::API.record.escape(v) + '"'
|
51
51
|
end.join(' OR ')
|
52
52
|
"#{param}: (#{or_terms})^#{boost}"
|
53
53
|
end
|
@@ -13,7 +13,7 @@ module Europeana
|
|
13
13
|
# @return (see blacklight_config.response_model)
|
14
14
|
def find(id, params = {})
|
15
15
|
id = "/#{id}" unless id[0] == '/'
|
16
|
-
res = connection.record(id
|
16
|
+
res = connection.record.fetch(params.merge(id: id))
|
17
17
|
|
18
18
|
blacklight_config.response_model.new(
|
19
19
|
res, params, document_model: blacklight_config.document_model,
|
@@ -22,7 +22,7 @@ module Europeana
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def search(params = {})
|
25
|
-
res = connection.search(params)
|
25
|
+
res = connection.record.search(params.to_h)
|
26
26
|
|
27
27
|
blacklight_config.response_model.new(
|
28
28
|
res, params, document_model: blacklight_config.document_model,
|
@@ -42,23 +42,7 @@ module Europeana
|
|
42
42
|
|
43
43
|
def build_connection
|
44
44
|
Europeana::API.tap do |api|
|
45
|
-
api.
|
46
|
-
api.cache_store = cache_store
|
47
|
-
api.cache_expires_in = cache_expires_in
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
protected
|
52
|
-
|
53
|
-
def cache_store
|
54
|
-
@cache_store ||= begin
|
55
|
-
blacklight_config.europeana_api_cache || ActiveSupport::Cache::NullStore.new
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
59
|
-
def cache_expires_in
|
60
|
-
@expires_in ||= begin
|
61
|
-
blacklight_config.europeana_api_cache_expires_in || 24.hours
|
45
|
+
api.key = blacklight_config.connection_config[:europeana_api_key]
|
62
46
|
end
|
63
47
|
end
|
64
48
|
end
|
@@ -22,7 +22,12 @@ module Europeana
|
|
22
22
|
|
23
23
|
delegate :to_query, :delete, to: :to_hash
|
24
24
|
|
25
|
-
STANDALONE_FACETS = %w(COLOURPALETTE MEDIA REUSABILITY)
|
25
|
+
STANDALONE_FACETS = %w(COLOURPALETTE MEDIA REUSABILITY THUMBNAIL).freeze
|
26
|
+
|
27
|
+
MEDIA_FACETS = %w(COLOURPALETTE IMAGE_ASPECTRATIO IMAGE_COLOR IMAGE_COLOUR
|
28
|
+
IMAGE_GRAYSCALE IMAGE_GREYSCALE IMAGE_SIZE MEDIA MIME_TYPE
|
29
|
+
SOUND_DURATION SOUND_HQ TEXT_FULLTEXT VIDEO_DURATION
|
30
|
+
VIDEO_HD).freeze
|
26
31
|
|
27
32
|
##
|
28
33
|
# Start with general defaults from BL config. Need to use custom
|
@@ -103,7 +108,7 @@ module Europeana
|
|
103
108
|
end
|
104
109
|
|
105
110
|
def quote_facet_value(facet_field, value)
|
106
|
-
return value if
|
111
|
+
return value if MEDIA_FACETS.include?(facet_field)
|
107
112
|
return value if value.include?('*')
|
108
113
|
'"' + value.gsub('"', '\"') + '"'
|
109
114
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: europeana-blacklight
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Doe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: blacklight
|
@@ -256,7 +256,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
256
256
|
version: '0'
|
257
257
|
requirements: []
|
258
258
|
rubyforge_project:
|
259
|
-
rubygems_version: 2.5.
|
259
|
+
rubygems_version: 2.5.2
|
260
260
|
signing_key:
|
261
261
|
specification_version: 4
|
262
262
|
summary: Europeana REST API adapter for Blacklight
|