umlaut 4.1.0.pre.2 → 4.1.0.pre3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/Rakefile +2 -4
- data/app/controllers/search_controller.rb +5 -3
- data/app/controllers/umlaut_controller.rb +6 -0
- data/app/service_adaptors/sfx.rb +53 -3
- data/app/views/search/journal_search.html.erb +1 -1
- data/lib/umlaut/version.rb +1 -1
- metadata +10 -18
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YWI3ZDMwMWJhNWJjMTAxZTE5NzE5MjcwNTU0M2YxN2NmN2MzODI2MQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YzU1M2E1NWJlNjc4NmQzNDA3ZGJmMDk3NDI0MWM4N2IzNGZlMmNhMg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZTNkMGY2OWQzODRiMDE1MGQ3MjA3YjJlNGNkYjhlODMyYmFmNmI5OTY4OTBm
|
10
|
+
NzcyYTIwYTI4YmRhMzQ1ZDRjOTE5ZTA3OTVkNDBlM2I1MTgyMWMzOTFjMjg1
|
11
|
+
NTczYTAwNmFkODhkNjI2YzgwMjcxMzM5MzUxNTYxOWQ4NDM0MGU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NzkwNTBiZWNhMTdlMDBmYzkxNWIyZDVmOGM2N2U5NmJiMTAwMWJhZTE4M2M0
|
14
|
+
NmUxOTcwNTBjM2YyZDQ2YzI5MThiZWIwMDRlZDg1YzZkN2EzN2ZmNmQyMDJm
|
15
|
+
ZDExMGJmYzNkYTk4NDhhYTk1NmNmODJkMDliMGJhZjE0ZWU2MjI=
|
data/Rakefile
CHANGED
@@ -20,7 +20,8 @@ RDoc::Task.new(:rdoc) do |rdoc|
|
|
20
20
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
21
21
|
end
|
22
22
|
|
23
|
-
|
23
|
+
APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
|
24
|
+
load 'rails/tasks/engine.rake'
|
24
25
|
|
25
26
|
Bundler::GemHelper.install_tasks
|
26
27
|
|
@@ -33,7 +34,4 @@ Rake::TestTask.new(:test) do |t|
|
|
33
34
|
t.verbose = false
|
34
35
|
end
|
35
36
|
|
36
|
-
require 'single_test'
|
37
|
-
SingleTest.load_tasks
|
38
|
-
|
39
37
|
task :default => :test
|
@@ -98,11 +98,13 @@ class SearchController < UmlautController
|
|
98
98
|
# If we narrowed down to one result redirect
|
99
99
|
# to resolve action.
|
100
100
|
redirect_to( url_for_with_co({:controller => 'resolve'}, @display_results[0]) )
|
101
|
-
elsif (@display_results.length == 0)
|
102
|
-
# 0 hits,
|
101
|
+
elsif (@display_results.length == 0) && (umlaut_config.lookup!("search.display_zero_hit_results") != true)
|
102
|
+
# If we have 0 hits, also redirect to resolve, unless config tells
|
103
|
+
# us not to.
|
103
104
|
redirect_to( url_for_with_co({:controller => 'resolve'}, @search_context_object) )
|
104
105
|
end
|
105
|
-
|
106
|
+
|
107
|
+
@page_title = @display_results.length > 0 ? 'Journal titles that ' : 'No journal titles found that '
|
106
108
|
@page_title +=
|
107
109
|
(params["umlaut.title_search_type"] == "begins") ?
|
108
110
|
'begin with ' : 'contain '
|
@@ -90,6 +90,12 @@ class UmlautController < ApplicationController
|
|
90
90
|
|
91
91
|
# can set to "_blank" etc.
|
92
92
|
# result_link_target nil
|
93
|
+
|
94
|
+
# On 0 hits from search screen, ordinarily we redirect to resolve
|
95
|
+
# screen becuase Resolve might be able to provide other useful
|
96
|
+
# services such as ILL or backed by other KB's. But to instead
|
97
|
+
# display a "no results" page, set:
|
98
|
+
# display_zero_hit_results true
|
93
99
|
end
|
94
100
|
|
95
101
|
# config only relevant to SFX use
|
data/app/service_adaptors/sfx.rb
CHANGED
@@ -36,12 +36,21 @@
|
|
36
36
|
# relationships, set to empty array [] to eliminate defaults.
|
37
37
|
# sfx_timeout: in seconds, for both open/read timeout value for SFX connection.
|
38
38
|
# Defaults to 8.
|
39
|
+
# boost_targets: ARRAY of STRINGS containing SFX target names in the form of
|
40
|
+
# "HIGHWIRE_PRESS_JOURNALS". Any target names listed here will be floated to
|
41
|
+
# the top of the full-text results list. You can end your boosted target
|
42
|
+
# in a "*" to wildcard: "EBSCOHOST_*".
|
43
|
+
# sink_targets: ARRAY of STRINGS containing SFX target names in the form of
|
44
|
+
# "HIGHWIRE_PRESS_JOURNALS". Any target names listed here will be floated to
|
45
|
+
# the bottom of the full-text results list. You an end your sunk target
|
46
|
+
# in a "*" to wildcard: "EBSCOHOST_*".
|
39
47
|
# roll_up_prefixes: ARRAY of STRINGs, prefixes like "EBSCOHOST_". If multiple
|
40
48
|
# targets sharing one of the specified prefixes are supplied from SFX,
|
41
49
|
# they will be "rolled up" and collapsed, just the first one included
|
42
50
|
# in response. For TITLE-LEVEL (rather than article-level) requests,
|
43
51
|
# the roll-up algorithm is sensitive to COVERAGES, and will only suppress
|
44
52
|
# targets that have coverages included in remaining non-suppressed targets.
|
53
|
+
#
|
45
54
|
class Sfx < Service
|
46
55
|
require 'uri'
|
47
56
|
require 'htmlentities'
|
@@ -232,6 +241,7 @@ class Sfx < Service
|
|
232
241
|
|
233
242
|
# For each target delivered by SFX
|
234
243
|
sfx_obj.search("./ctx_obj_targets/target").each_with_index do|target, target_index|
|
244
|
+
|
235
245
|
response_data = {}
|
236
246
|
|
237
247
|
# First check @extra_targets_of_interest
|
@@ -311,7 +321,7 @@ class Sfx < Service
|
|
311
321
|
next
|
312
322
|
end
|
313
323
|
|
314
|
-
related_note = "
|
324
|
+
related_note = "May be available under related title: <em>" + CGI.unescapeHTML( title ) + "</em>.\n"
|
315
325
|
end
|
316
326
|
|
317
327
|
if ( sfx_service_type == 'getDocumentDelivery' )
|
@@ -377,6 +387,8 @@ class Sfx < Service
|
|
377
387
|
end
|
378
388
|
|
379
389
|
if response_queue["fulltext"].present?
|
390
|
+
response_queue["fulltext"] = sort_sunk_responses(response_queue["fulltext"])
|
391
|
+
response_queue["fulltext"] = sort_boosted_responses(response_queue["fulltext"])
|
380
392
|
response_queue["fulltext"] = roll_up_responses(response_queue["fulltext"], :coverage_sensitive => request.title_level_citation? )
|
381
393
|
end
|
382
394
|
|
@@ -517,6 +529,45 @@ class Sfx < Service
|
|
517
529
|
return list
|
518
530
|
end
|
519
531
|
|
532
|
+
def sort_boosted_responses(list)
|
533
|
+
return list unless @boost_targets.present?
|
534
|
+
|
535
|
+
preferred = []
|
536
|
+
other_targets = list
|
537
|
+
|
538
|
+
@boost_targets.each do |spec|
|
539
|
+
(picked, other_targets) = other_targets.partition do |a|
|
540
|
+
if spec.end_with?("*")
|
541
|
+
a[:sfx_target_name] && a[:sfx_target_name].start_with?(spec[0..-2])
|
542
|
+
else
|
543
|
+
spec == a[:sfx_target_name]
|
544
|
+
end
|
545
|
+
end
|
546
|
+
|
547
|
+
preferred.concat picked
|
548
|
+
end
|
549
|
+
|
550
|
+
return preferred + other_targets
|
551
|
+
end
|
552
|
+
|
553
|
+
def sort_sunk_responses(list)
|
554
|
+
return list unless @sink_targets.present?
|
555
|
+
|
556
|
+
sunk = []
|
557
|
+
other_targets = list
|
558
|
+
@sink_targets.each do |spec|
|
559
|
+
(picked, other_targets) = other_targets.partition do |a|
|
560
|
+
if spec.end_with?("*")
|
561
|
+
a[:sfx_target_name] && a[:sfx_target_name].start_with?(spec[0..-2])
|
562
|
+
else
|
563
|
+
spec == a[:sfx_target_name]
|
564
|
+
end
|
565
|
+
end
|
566
|
+
sunk.concat picked
|
567
|
+
end
|
568
|
+
|
569
|
+
return other_targets + sunk
|
570
|
+
end
|
520
571
|
|
521
572
|
def sfx_click_passthrough
|
522
573
|
# From config, or default to false.
|
@@ -726,5 +777,4 @@ class Sfx < Service
|
|
726
777
|
return display
|
727
778
|
end
|
728
779
|
|
729
|
-
|
730
|
-
|
780
|
+
end
|
@@ -34,7 +34,7 @@
|
|
34
34
|
<% unless @hits == 0%>
|
35
35
|
<h3><%= t( 'umlaut.search.showing_results', start: @start_result_num, until: @end_result_num, total: @hits) %></h3>
|
36
36
|
<% end %>
|
37
|
-
<% if params["rft.jtitle"] %>
|
37
|
+
<% if params["rft.jtitle"] && (@display_results.size > 0) %>
|
38
38
|
<div class="note"><em><strong><%= t 'umlaut.search.note' %>:</strong> <%= t 'umlaut.search.other_titles_might' %> </em></div>
|
39
39
|
<% end %>
|
40
40
|
<div class='umlaut-pagination pagination'>
|
data/lib/umlaut/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: umlaut
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.1.0.
|
4
|
+
version: 4.1.0.pre3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Rochkind, et al
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -154,14 +154,20 @@ dependencies:
|
|
154
154
|
requirements:
|
155
155
|
- - ~>
|
156
156
|
- !ruby/object:Gem::Version
|
157
|
-
version: '0
|
157
|
+
version: '1.0'
|
158
|
+
- - ! '>='
|
159
|
+
- !ruby/object:Gem::Version
|
160
|
+
version: 1.0.1
|
158
161
|
type: :runtime
|
159
162
|
prerelease: false
|
160
163
|
version_requirements: !ruby/object:Gem::Requirement
|
161
164
|
requirements:
|
162
165
|
- - ~>
|
163
166
|
- !ruby/object:Gem::Version
|
164
|
-
version: '0
|
167
|
+
version: '1.0'
|
168
|
+
- - ! '>='
|
169
|
+
- !ruby/object:Gem::Version
|
170
|
+
version: 1.0.1
|
165
171
|
- !ruby/object:Gem::Dependency
|
166
172
|
name: scrub_rb
|
167
173
|
requirement: !ruby/object:Gem::Requirement
|
@@ -210,20 +216,6 @@ dependencies:
|
|
210
216
|
- - ! '>='
|
211
217
|
- !ruby/object:Gem::Version
|
212
218
|
version: 3.2.5
|
213
|
-
- !ruby/object:Gem::Dependency
|
214
|
-
name: single_test
|
215
|
-
requirement: !ruby/object:Gem::Requirement
|
216
|
-
requirements:
|
217
|
-
- - ~>
|
218
|
-
- !ruby/object:Gem::Version
|
219
|
-
version: 0.5.1
|
220
|
-
type: :development
|
221
|
-
prerelease: false
|
222
|
-
version_requirements: !ruby/object:Gem::Requirement
|
223
|
-
requirements:
|
224
|
-
- - ~>
|
225
|
-
- !ruby/object:Gem::Version
|
226
|
-
version: 0.5.1
|
227
219
|
- !ruby/object:Gem::Dependency
|
228
220
|
name: uglifier
|
229
221
|
requirement: !ruby/object:Gem::Requirement
|