umlaut 3.1.1 → 3.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -1
- data/app/assets/javascripts/umlaut/update_html.js +3 -0
- data/app/controllers/link_router_controller.rb +16 -1
- data/app/controllers/umlaut_configurable.rb +1 -0
- data/app/mixin_logic/marc_helper.rb +82 -78
- data/app/referent_filters/dissertation_catch.rb +11 -5
- data/app/views/resolve/_background_updater.html.erb +19 -17
- data/app/views/resolve/_citation.html.erb +11 -22
- data/app/views/resolve/_fulltext.html.erb +23 -21
- data/app/views/resolve/_help.html.erb +13 -20
- data/app/views/resolve/_manually_entered_warning.html.erb +2 -2
- data/app/views/resolve/_modal.html.erb +1 -1
- data/app/views/resolve/_search_inside.html.erb +2 -2
- data/app/views/resolve/_section_display.html.erb +30 -32
- data/app/views/resolve/_section_heading.html.erb +14 -17
- data/app/views/resolve/index.html.erb +17 -24
- data/lib/umlaut/version.rb +1 -1
- data/test/fixtures/referent_values.yml +33 -0
- data/test/fixtures/referents.yml +3 -0
- data/test/fixtures/requests.yml +4 -0
- data/test/fixtures/service_responses.yml +12 -0
- data/test/functional/resolve_controller_test.rb +53 -8
- data/test/unit/dissertation_catch_test.rb +22 -0
- data/test/vcr_cassettes/resolve/manually_entered.yml +84 -0
- metadata +8 -4
data/README.md
CHANGED
@@ -48,6 +48,9 @@
|
|
48
48
|
if (context_object == undefined)
|
49
49
|
context_object = "";
|
50
50
|
|
51
|
+
// Remove query string (if present)
|
52
|
+
umlaut_base = umlaut_base.replace(/\?.*$/, '')
|
53
|
+
// Remove trailing slash
|
51
54
|
umlaut_base = umlaut_base.replace(/\/$/,'');
|
52
55
|
this.umlaut_uri = umlaut_base + '/resolve/partial_html_sections?umlaut.response_format=json&' + context_object;
|
53
56
|
|
@@ -25,6 +25,8 @@ class LinkRouterController < UmlautController
|
|
25
25
|
redirect_to calculate_url_for_response(svc_response)
|
26
26
|
end
|
27
27
|
|
28
|
+
protected
|
29
|
+
|
28
30
|
# Used to calculate a destination/target url for an Umlaut response item.
|
29
31
|
#
|
30
32
|
# Pass in a ServiceType join object (not actually a ServiceResponse, sorry)
|
@@ -39,6 +41,8 @@ class LinkRouterController < UmlautController
|
|
39
41
|
svc = ServiceStore.instantiate_service!(svc_response.service_id, nil)
|
40
42
|
destination = svc.response_url(svc_response, params)
|
41
43
|
|
44
|
+
raise_missing_url!(svc_response) if destination.blank?
|
45
|
+
|
42
46
|
# if response_url returned a string, it's an external url and we're
|
43
47
|
# done. If it's something else, usually a hash, then pass it to
|
44
48
|
# url_for to generate a url.
|
@@ -59,4 +63,15 @@ class LinkRouterController < UmlautController
|
|
59
63
|
end
|
60
64
|
end
|
61
65
|
protected :calculate_url_for_response
|
62
|
-
end
|
66
|
+
end
|
67
|
+
|
68
|
+
def raise_missing_url!(service_response)
|
69
|
+
svc_rsp_id = service_response.try(:id)
|
70
|
+
service_id = service_response.try(:service_id)
|
71
|
+
type = service_response.try(:service_type_value_name)
|
72
|
+
text = service_response.try(:display_text)
|
73
|
+
request_id = service_response.try(:request).try(:id)
|
74
|
+
request_url = service_response.try(:request).try(:http_env).try {|h| h["REQUEST_URI"] }
|
75
|
+
|
76
|
+
raise ArgumentError.new("LinkRouterController#index missing URL to redirect to for ServiceResponse:#{svc_rsp_id} (#{service_id}/#{type}/#{text}) from original request url: #{request_url}")
|
77
|
+
end
|
@@ -3,37 +3,37 @@
|
|
3
3
|
module MarcHelper
|
4
4
|
|
5
5
|
# Takes an array of ruby MARC objects, adds ServiceResponses
|
6
|
-
# for the 856 links contained.
|
6
|
+
# for the 856 links contained.
|
7
7
|
# Returns a hash of arrays of ServiceResponse objects added, keyed
|
8
|
-
# by service type value string.
|
8
|
+
# by service type value string.
|
9
9
|
def add_856_links(request, marc_records, options = {})
|
10
10
|
options[:default_service_type] ||= "fulltext"
|
11
11
|
options[:match_reliability] ||= ServiceResponse::MatchExact
|
12
12
|
|
13
13
|
responses_added = Hash.new
|
14
|
-
|
14
|
+
|
15
15
|
# Keep track of urls to avoid putting the exact same url in twice
|
16
16
|
urls_seen = Array.new
|
17
|
-
|
17
|
+
|
18
18
|
marc_records.each do |marc_xml|
|
19
|
-
|
19
|
+
|
20
20
|
marc_xml.find_all {|f| '856' === f.tag}.each do |field|
|
21
21
|
# Might have more than one $u, in which case we want to
|
22
22
|
# possibly add each of them. Might have 0 $u in which case
|
23
|
-
# we skip.
|
24
|
-
field.subfields.find_all {|sf| sf.code == 'u'}.each do |sf|
|
25
|
-
url = sf.value
|
26
|
-
|
23
|
+
# we skip.
|
24
|
+
field.subfields.find_all {|sf| sf.code == 'u'}.each do |sf|
|
25
|
+
url = sf.value
|
26
|
+
|
27
27
|
# Already got it from another catalog record?
|
28
28
|
next if urls_seen.include?(url)
|
29
|
-
|
30
|
-
# Trying to avoid duplicates with SFX/link resolver.
|
29
|
+
|
30
|
+
# Trying to avoid duplicates with SFX/link resolver.
|
31
31
|
skip = should_skip_856_link?(request, marc_xml, url)
|
32
32
|
next if skip
|
33
|
-
|
33
|
+
|
34
34
|
urls_seen.push(url)
|
35
|
-
|
36
|
-
|
35
|
+
|
36
|
+
|
37
37
|
display_name = nil
|
38
38
|
if field['y']
|
39
39
|
display_name = field['y']
|
@@ -50,46 +50,46 @@ module MarcHelper
|
|
50
50
|
# But if we've got a $3, the closest MARC comes to a field
|
51
51
|
# that explains what this actually IS, use that too please.
|
52
52
|
display_name = field['3'] + ' from ' + display_name if field['3']
|
53
|
-
|
54
|
-
# Build the response.
|
55
|
-
|
53
|
+
|
54
|
+
# Build the response.
|
55
|
+
|
56
56
|
response_params = {:service=>self, :display_text=>display_name, :url=>url}
|
57
|
-
# get all those $z subfields and put em in notes.
|
57
|
+
# get all those $z subfields and put em in notes.
|
58
58
|
response_params[:url] = url
|
59
|
-
|
59
|
+
|
60
60
|
# subfield 3 is being used for OCA records loaded in our catalog.
|
61
61
|
response_params[:notes] =
|
62
62
|
field.subfields.collect {|f| f.value if (f.code == 'z') }.compact.join('; ')
|
63
|
-
|
63
|
+
|
64
64
|
is_journal = (marc_xml.leader[7,1] == 's')
|
65
|
-
unless ( field['3'] || ! is_journal ) # subfield 3 is in fact some kind of coverage note, usually
|
66
|
-
response_params[:notes] += "; " unless response_params[:notes].blank?
|
65
|
+
unless ( field['3'] || ! is_journal ) # subfield 3 is in fact some kind of coverage note, usually
|
66
|
+
response_params[:notes] += "; " unless response_params[:notes].blank?
|
67
67
|
response_params[:notes] += "Dates of coverage unknown."
|
68
68
|
end
|
69
|
-
|
70
|
-
|
69
|
+
|
70
|
+
|
71
71
|
unless ( options[:match_reliability] == ServiceResponse::MatchExact )
|
72
72
|
response_params[:match_reliability] = options[:match_reliability]
|
73
|
-
|
73
|
+
|
74
74
|
response_params[:edition_str] = edition_statement(marc_xml)
|
75
75
|
end
|
76
|
-
|
76
|
+
|
77
77
|
# Figure out the right service type value for this, fulltext, ToC,
|
78
78
|
# whatever.
|
79
|
-
response_params[:service_type_value] = service_type_for_856( field, options )
|
80
|
-
|
79
|
+
response_params[:service_type_value] = service_type_for_856( field, options )
|
80
|
+
|
81
81
|
# fulltext urls from MARC are always marked as specially stupid.
|
82
82
|
response_params[:coverage_checked] = false
|
83
83
|
response_params[:can_link_to_article] = false
|
84
|
-
|
84
|
+
|
85
85
|
# Some debugging info, add the 001 bibID if we have one.
|
86
|
-
|
86
|
+
|
87
87
|
response_params[:debug_info] = "BibID: #{marc_xml['001'].value}" if marc_xml['001']
|
88
|
-
|
89
|
-
|
88
|
+
|
89
|
+
|
90
90
|
# Add the response
|
91
91
|
response = request.add_service_response(response_params)
|
92
|
-
|
92
|
+
|
93
93
|
responses_added[response_params[:service_type_value]] ||= Array.new
|
94
94
|
responses_added[response_params[:service_type_value]].push(response)
|
95
95
|
end
|
@@ -118,17 +118,17 @@ module MarcHelper
|
|
118
118
|
# SFX. We use MARC leader byte 7 to tell if it's a journal. Confusing enough?
|
119
119
|
# Not yet! Even if it is a journal, if this isn't an article-level
|
120
120
|
# cite and there are no other full text already provided, we
|
121
|
-
# still include.
|
121
|
+
# still include.
|
122
122
|
def should_skip_856_link?(request, marc_record, url)
|
123
123
|
is_journal = (marc_record.leader[7,1] == 's')
|
124
|
-
|
124
|
+
|
125
125
|
sfx_controlled = SfxUrl.sfx_controls_url?(url)
|
126
|
-
|
126
|
+
|
127
127
|
# Do NOT skip if it's a title-level citation with no
|
128
|
-
# existing full text entries.
|
129
|
-
not_title_level_empty = !( request.title_level_citation? &&
|
130
|
-
request.get_service_type("fulltext").length == 0
|
131
|
-
)
|
128
|
+
# existing full text entries.
|
129
|
+
not_title_level_empty = !( request.title_level_citation? &&
|
130
|
+
request.get_service_type("fulltext").length == 0
|
131
|
+
)
|
132
132
|
|
133
133
|
result = ( is_journal && sfx_controlled && not_title_level_empty )
|
134
134
|
return result
|
@@ -137,43 +137,47 @@ module MarcHelper
|
|
137
137
|
# Take a ruby Marc Field object representing an 856 field,
|
138
138
|
# decide what umlaut service type value to map it to. Fulltext, ToC, etc.
|
139
139
|
# This is neccesarily a heuristic guess, Marc doesn't have enough granularity
|
140
|
-
# to really let us know for sure
|
140
|
+
# to really let us know for sure --
|
141
|
+
# although if indicator2 is '2' for 'related resource', we decide it is
|
142
|
+
# NOT fulltext.
|
141
143
|
def service_type_for_856(field, options)
|
142
144
|
options[:default_service_type] ||= "fulltext_title_level"
|
143
145
|
|
144
146
|
# LC records here at hopkins have "Table of contents only" in the 856$3
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
147
|
+
# Think that's a convention from LC?
|
148
|
+
if (field['3'] && field['3'].downcase =~ /table of contents( only)?/)
|
149
|
+
return "table_of_contents"
|
150
|
+
elsif (field['3'] && field['3'].downcase =~ /description/)
|
151
|
+
# If it contains the word 'description', it's probably an abstract.
|
152
|
+
# That's the best we can do, sadly.
|
153
|
+
return "abstract"
|
154
|
+
elsif (field['3'] && field['3'].downcase == 'sample text')
|
155
|
+
# LC records often include these links.
|
156
|
+
return "excerpts"
|
157
|
+
elsif ( field['u'] =~ /www\.loc\.gov/ )
|
158
|
+
# Any other loc.gov link, we know it's not full text, don't put
|
159
|
+
# it in full text field, put it as "see also".
|
160
|
+
return "highlighted_link"
|
161
|
+
elsif field.indicator2 == '2' # 'related resource'
|
162
|
+
return "highlighted_link"
|
163
|
+
else
|
164
|
+
return options[:default_service_type]
|
165
|
+
end
|
162
166
|
end
|
163
167
|
|
164
168
|
# A MARC record has two dates in it, date1 and date2. Exactly
|
165
169
|
# what they represent is something of an esoteric mystery.
|
166
|
-
# But this will return them both, in an array.
|
170
|
+
# But this will return them both, in an array.
|
167
171
|
def get_years(marc)
|
168
172
|
array = []
|
169
|
-
|
170
|
-
# no marc 008? Weird, but okay.
|
171
|
-
return array unless marc['008']
|
172
|
-
|
173
|
+
|
174
|
+
# no marc 008? Weird, but okay.
|
175
|
+
return array unless marc['008']
|
176
|
+
|
173
177
|
date1 = marc['008'].value[7,4]
|
174
178
|
date1.strip! if date1
|
175
179
|
array.push(date1) unless date1.blank?
|
176
|
-
|
180
|
+
|
177
181
|
date2 = marc['008'].value[11,4]
|
178
182
|
date2.strip! if date2
|
179
183
|
array.push(date2) unless date2.blank?
|
@@ -186,9 +190,9 @@ module MarcHelper
|
|
186
190
|
marc['245'].find_all {|sf| sf.code == "a" || sf.code == "b" || sf.code == "k"}.collect {|sf| sf.text}.join(" ").sub(/\s*[;:\/.,]\s*$/)
|
187
191
|
end
|
188
192
|
|
189
|
-
|
193
|
+
|
190
194
|
# From a marc record, get a string useful to display for identifying
|
191
|
-
# which edition/version of a work this represents.
|
195
|
+
# which edition/version of a work this represents.
|
192
196
|
def edition_statement(marc, options = {})
|
193
197
|
options[:include_repro_info] ||= true
|
194
198
|
options[:exclude_533_fields] = ['7','f','b', 'e']
|
@@ -196,7 +200,7 @@ module MarcHelper
|
|
196
200
|
parts = Array.new
|
197
201
|
|
198
202
|
return "" unless marc
|
199
|
-
|
203
|
+
|
200
204
|
#245$h GMD
|
201
205
|
unless ( marc['245'].blank? || marc['245']['h'].blank? )
|
202
206
|
parts.push('(' + marc['245']['h'].gsub(/[^\w\s]/, '').strip.titlecase + ')')
|
@@ -207,7 +211,7 @@ module MarcHelper
|
|
207
211
|
parts.push( marc['250']['a'] ) unless marc['250']['a'].blank?
|
208
212
|
parts.push( marc['250']['b'] ) unless marc['250']['b'].blank?
|
209
213
|
end
|
210
|
-
|
214
|
+
|
211
215
|
# 260
|
212
216
|
if ( marc['260'])
|
213
217
|
if (marc['260']['b'] =~ /s\.n\./)
|
@@ -217,18 +221,18 @@ module MarcHelper
|
|
217
221
|
end
|
218
222
|
parts.push( marc['260']['c'] ) unless marc['260']['c'].blank?
|
219
223
|
end
|
220
|
-
|
224
|
+
|
221
225
|
# 533
|
222
226
|
if options[:include_repro_info] && marc['533']
|
223
227
|
marc['533'].subfields.each do |s|
|
224
228
|
if ( s.code == 'a' )
|
225
|
-
parts.push(s.value.gsub(/[^\w\s]/, '') + ':' )
|
229
|
+
parts.push(s.value.gsub(/[^\w\s]/, '') + ':' )
|
226
230
|
elsif (! options[:exclude_533_fields].include?( s.code ))
|
227
231
|
parts.push(s.value)
|
228
|
-
end
|
232
|
+
end
|
229
233
|
end
|
230
234
|
end
|
231
|
-
|
235
|
+
|
232
236
|
return nil if parts.length == 0
|
233
237
|
|
234
238
|
return parts.join(' ')
|
@@ -236,24 +240,24 @@ module MarcHelper
|
|
236
240
|
|
237
241
|
# AACR2 "General Material Designation" . While these are (I think?)
|
238
242
|
# controlled, it's actually really hard to find the list. Maybe they're
|
239
|
-
# only semi-controlled.
|
243
|
+
# only semi-controlled.
|
240
244
|
# ONE list can be found here: http://www.oclc.org/bibformats/en/onlinecataloging/default.shtm#BCGFECEG
|
241
245
|
def gmd_values
|
242
|
-
# 'computer file' is an old one that may still be found in data.
|
243
|
-
return ['activity card',
|
246
|
+
# 'computer file' is an old one that may still be found in data.
|
247
|
+
return ['activity card',
|
244
248
|
'art original','art reproduction','braille','chart','diorama','electronic resource','computer file', 'filmstrip','flash card','game','globe','kit','manuscript','map','microform','microscope slides','model','motion picture','music','picture','realia','slide','sound recording','technical drawing','text','toy','transparency','videorecording']
|
245
249
|
end
|
246
250
|
|
247
251
|
# removes something that looks like an AACR2 GMD in square brackets from
|
248
|
-
# the string. Pretty kludgey.
|
252
|
+
# the string. Pretty kludgey.
|
249
253
|
def strip_gmd(arg_string, options = {})
|
250
254
|
options[:replacement] ||= ':'
|
251
|
-
|
255
|
+
|
252
256
|
gmd_values.each do |gmd_val|
|
253
257
|
arg_string = arg_string.sub(/\[#{gmd_val}( \((tactile|braile|large print)\))?\]/, options[:replacement])
|
254
258
|
end
|
255
259
|
return arg_string
|
256
260
|
end
|
257
261
|
|
258
|
-
|
262
|
+
|
259
263
|
end
|
@@ -25,14 +25,14 @@ class DissertationCatch < ReferentFilter
|
|
25
25
|
|
26
26
|
|
27
27
|
|
28
|
-
# input:
|
28
|
+
# input: Umlaut Referent object
|
29
29
|
# Is this a citation to a Dissertation Abstracts
|
30
30
|
# issn, or do we otherwise think it's a dissertation citation? Then change
|
31
31
|
# it to a dissertation citation.
|
32
32
|
def filter(referent)
|
33
33
|
issn = get_identifier(:urn, "issn", referent)
|
34
|
-
|
35
34
|
return unless issn
|
35
|
+
|
36
36
|
|
37
37
|
# normalize removing hyphen
|
38
38
|
issn.gsub!('-', '')
|
@@ -43,10 +43,16 @@ class DissertationCatch < ReferentFilter
|
|
43
43
|
referent.enhance_referent("genre", "dissertation")
|
44
44
|
|
45
45
|
metadata = referent.metadata
|
46
|
+
|
46
47
|
# Reset it's title to the dissertation title
|
47
|
-
title = metadata['atitle']
|
48
|
-
|
49
|
-
|
48
|
+
title = if metadata['atitle'].present?
|
49
|
+
metadata['atitle']
|
50
|
+
elsif metadata['title'].present?
|
51
|
+
metadata['title']
|
52
|
+
end
|
53
|
+
referent.enhance_referent("btitle", title) if title.present?
|
54
|
+
referent.enhance_referent("title", title, true, false, :overwrite => true) if title.present?
|
55
|
+
|
50
56
|
# Now erase titles that do not apply
|
51
57
|
referent.remove_value("atitle")
|
52
58
|
referent.remove_value("jtitle")
|
@@ -1,25 +1,27 @@
|
|
1
|
-
<%-
|
1
|
+
<%-
|
2
2
|
# Include this partial to put the background updater device on your page.
|
3
3
|
# This actually just sets up the Umlaut JQuery background updater, for
|
4
|
-
# unobtrusive adding of background html content to menu page.
|
5
|
-
|
6
|
-
#
|
4
|
+
# unobtrusive adding of background html content to menu page.
|
5
|
+
|
6
|
+
# Only include if we have any background services. We could check to make
|
7
7
|
# sure we only have background services we care about, but it's more work--
|
8
8
|
# the updater will only run ONCE at most wrongly, then the
|
9
|
-
# background_update action will stop it.
|
10
|
-
|
9
|
+
# background_update action will stop it.
|
10
|
+
-%>
|
11
|
+
<% if (any_services_in_progress?) %>
|
11
12
|
<script type="text/javascript">
|
12
13
|
//<![CDATA[
|
13
|
-
jQuery(document).ready(function($) {
|
14
|
-
var updater = new Umlaut.HtmlUpdater("<%= root_url %>",
|
15
|
-
bg_update_sections.collect do |section| %>
|
16
|
-
updater.add_section_target({ umlaut_section_id: "<%= section[:div_id]
|
17
|
-
end
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
14
|
+
jQuery(document).ready(function ($) {
|
15
|
+
var updater = new Umlaut.HtmlUpdater("<%= root_url %>", "umlaut.request_id=<%= user_request.id %>");
|
16
|
+
<% bg_update_sections.collect do |section| %>
|
17
|
+
updater.add_section_target({ umlaut_section_id: "<%= section[:div_id] %>" });
|
18
|
+
<% end %>
|
19
|
+
<%-
|
20
|
+
# Wait the designated number of seconds before kicking off the first bg
|
21
|
+
# update request. Future requests will be automatically made with delay.
|
22
|
+
-%>
|
23
|
+
setTimeout(function () { updater.update(); }, <%= umlaut_config.lookup!("initial_poll_wait_seconds", 4)*1000 %>);
|
22
24
|
});
|
23
25
|
//]]>
|
24
|
-
</script
|
25
|
-
end %>
|
26
|
+
</script>
|
27
|
+
<% end %>
|
@@ -1,49 +1,40 @@
|
|
1
1
|
<%
|
2
|
-
|
2
|
+
# Get the citation from the user request
|
3
|
+
cite = user_request.referent.to_citation
|
4
|
+
# Set the page title to the citation's title
|
3
5
|
@page_title = cite[:title] %>
|
4
|
-
|
5
|
-
|
6
|
-
<p class="resource-type"><%=@user_request.referent.type_of_thing.titlecase %></p>
|
6
|
+
<% if user_request.referent.type_of_thing.present? %>
|
7
|
+
<p class="resource-type"><%= user_request.referent.type_of_thing.titlecase %></p>
|
7
8
|
<% end %>
|
8
|
-
|
9
9
|
<h2 class="title"><%= cite[:title] %></h2>
|
10
|
-
|
11
10
|
<% if cite[:author].present? || cite[:date].present? %>
|
12
11
|
<p class="author-and-date">
|
13
12
|
<% if cite[:author].present? %>
|
14
13
|
<span class="author"><%= cite[:author] %></span>
|
15
14
|
<% end %>
|
16
|
-
|
17
15
|
<% if cite[:author].present? && cite[:date].present? %>
|
18
16
|
<span class="sep">•</span>
|
19
17
|
<% end %>
|
20
|
-
|
21
18
|
<% if cite[:date].present? %>
|
22
19
|
<span class="date"><%= date_format(cite[:date]) %></span>
|
23
20
|
<% end %>
|
24
21
|
</p>
|
25
22
|
<% end %>
|
26
|
-
|
27
23
|
<p class="published_in">
|
28
24
|
<% if [:container_title, :volume, :issue, :page].find {|k| cite[k].present? } %>
|
29
|
-
|
30
|
-
<span class="
|
31
|
-
<%= cite[:container_title] %></span>.
|
25
|
+
<span class="published-label">Published in <%= cite[:container_label] %></span>
|
26
|
+
<span class="container-title"><%= cite[:container_title] %></span>.
|
32
27
|
<% end %>
|
33
|
-
|
34
28
|
<% if cite[:volume].present? %>
|
35
|
-
|
29
|
+
<span class="volume">Volume <%= cite[:volume] %></span>.
|
36
30
|
<% end %>
|
37
|
-
|
38
31
|
<% if cite[:issue].present? %>
|
39
|
-
|
32
|
+
<span class="issue">Issue <%= cite[:issue] %></span>.
|
40
33
|
<% end %>
|
41
|
-
|
42
34
|
<% if cite[:page].present? %>
|
43
|
-
|
35
|
+
<span class="page">Page <%= cite[:page] %></span>.
|
44
36
|
<% end %>
|
45
37
|
</p>
|
46
|
-
|
47
38
|
<dl class="citation-info">
|
48
39
|
<%= if cite[:pub].present?
|
49
40
|
content_tag(:dt, "Publisher:", :class => "publisher") +
|
@@ -57,7 +48,5 @@ cite = @user_request.referent.to_citation
|
|
57
48
|
content_tag(:dt, "ISBN:", :class => "isbn") +
|
58
49
|
content_tag(:dd, cite[:isbn], :class => "isbn")
|
59
50
|
end %>
|
60
|
-
|
61
51
|
<%# todo, doi %>
|
62
|
-
|
63
|
-
</dl>
|
52
|
+
</dl>
|
@@ -1,32 +1,34 @@
|
|
1
1
|
<%
|
2
2
|
all_responses = fulltext
|
3
|
-
(title_level_fulltxt, fulltxt) =
|
4
|
-
|
3
|
+
(title_level_fulltxt, fulltxt) = all_responses.partition do |i|
|
4
|
+
i.view_data[:coverage_checked] == false || i.view_data[:can_link_to_article] == false
|
5
|
+
end
|
5
6
|
# order em with full fulltxt before title_level_fulltxt
|
6
|
-
all_responses = fulltxt + title_level_fulltxt
|
7
|
+
all_responses = fulltxt + title_level_fulltxt
|
8
|
+
%>
|
7
9
|
<div class="<%= section_css_classes(@user_request, "fulltext", all_responses).join(" ") %>">
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
if (index == fulltxt.length && !title_level_request?) %>
|
10
|
+
<%= render 'section_heading', :presenter => renderer, :force_render => true %>
|
11
|
+
<div class="umlaut_section_content">
|
12
|
+
<%= list_with_limit('umlaut_fulltext', all_responses,
|
13
|
+
:ul_class => "response_list", :limit => renderer.list_visible_limit ) do |item, index | %>
|
14
|
+
<%-
|
15
|
+
# Display special warning header if it's title-level only,
|
16
|
+
# and it's an article or issue level link. Are we
|
17
|
+
# at the beginning of title level display?
|
18
|
+
-%>
|
19
|
+
<% if (index == fulltxt.length && !title_level_request?) %>
|
18
20
|
</ul>
|
19
21
|
<div class="section-subheading title-level-link-warning">
|
20
22
|
<h4><%= (@user_request.referent.container_type_of_thing || "Container").titlecase %>-level Page Only</h4>
|
21
23
|
<p><span class="notice">Can not link directly to citation. Dates or extent of coverage may be unknown.</span></p>
|
22
24
|
</div>
|
23
|
-
<ul class="response_list"
|
24
|
-
end %>
|
25
|
-
<%= render
|
26
|
-
end
|
27
|
-
if (fulltxt.empty? && title_level_fulltxt.empty? && !service_type_in_progress?('fulltext')) %>
|
28
|
-
<p class="umlaut-unavailable umlaut-content-indent">Not Available</p
|
29
|
-
end %>
|
30
|
-
<%= render
|
25
|
+
<ul class="response_list">
|
26
|
+
<% end %>
|
27
|
+
<%= render :partial => "standard_response_item", :object => item %>
|
28
|
+
<% end %>
|
29
|
+
<% if (fulltxt.empty? && title_level_fulltxt.empty? && !service_type_in_progress?('fulltext')) %>
|
30
|
+
<p class="umlaut-unavailable umlaut-content-indent">Not Available</p>
|
31
|
+
<% end %>
|
32
|
+
<%= render renderer.spinner_render_hash if renderer.services_in_progress? %>
|
31
33
|
</div>
|
32
34
|
</div>
|
@@ -1,20 +1,13 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
<br />
|
15
|
-
<%= value_hash[:note] %>
|
16
|
-
<% end %>
|
17
|
-
</li>
|
18
|
-
<% end %>
|
19
|
-
</ul>
|
20
|
-
|
1
|
+
<div class="help-text-icon">?</div>
|
2
|
+
<%= render 'section_heading', :presenter => renderer, :force_render => true %>
|
3
|
+
<ul class="response_list umlaut-help-list">
|
4
|
+
<% help.each do |help|
|
5
|
+
value_hash = help.view_data %>
|
6
|
+
<li><%= link_to value_hash[:display_text], {:controller=>'link_router', :id=>help.id}, 'target'=>"_blank" %>
|
7
|
+
<% unless value_hash[:note].blank? %>
|
8
|
+
<br />
|
9
|
+
<%= value_hash[:note] %>
|
10
|
+
<% end %>
|
11
|
+
</li>
|
12
|
+
<% end %>
|
13
|
+
</ul>
|
@@ -3,5 +3,5 @@
|
|
3
3
|
# SFX recognized it as an actually existing journal. If not, then it
|
4
4
|
# might be a typo. If it came from a manually entered citation, warn them.
|
5
5
|
content_tag(:div, content_tag(:i, "", :class => "umlaut_icons-famfamfam-error") +
|
6
|
-
" Warning: #{umlaut_config.app_name} does not know about a #{
|
7
|
-
:class=>"alert alert-error") if display_not_found_warning?(
|
6
|
+
" Warning: #{umlaut_config.app_name} does not know about a #{user_request.referent.format.downcase} with this name. Please check your entry.",
|
7
|
+
:class=>"alert alert-error") if display_not_found_warning?(user_request) %>
|
@@ -12,7 +12,7 @@
|
|
12
12
|
<div class="umlaut_section_content">
|
13
13
|
<%= content_tag("form", :target => "_blank", :action => url_for(:controller=>'link_router', :action=>'index')) do %>
|
14
14
|
|
15
|
-
<div class="source input-prepend input-append">
|
15
|
+
<div class="search-inside-source input-prepend input-append">
|
16
16
|
<span class="add-on"> via </span>
|
17
17
|
|
18
18
|
<% if search_providers.length > 1 %>
|
@@ -24,7 +24,7 @@
|
|
24
24
|
<% end %>
|
25
25
|
|
26
26
|
</div>
|
27
|
-
<div class="
|
27
|
+
<div class="search-inside-query input-append">
|
28
28
|
<input name="query" type="text" />
|
29
29
|
<input value="search" type="submit" class="btn add-on">
|
30
30
|
</div>
|
@@ -1,37 +1,35 @@
|
|
1
|
-
|
1
|
+
<%-
|
2
2
|
# You generally shoudln't call this partial directly, it's called through
|
3
3
|
# the render_section helper method in resolve_helper.rb
|
4
|
-
|
5
|
-
|
4
|
+
-%>
|
5
|
+
<% if presenter.visible? %>
|
6
|
+
<% unless presenter.show_partial_only? %>
|
6
7
|
<div class="<%= section_css_classes(@user_request, presenter.div_id, []).join(" ") %>">
|
7
|
-
<% end %>
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
<%
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
end
|
21
|
-
elsif presenter.responses_list.length == 0 && ! presenter.services_in_progress?%>
|
8
|
+
<% end %>
|
9
|
+
<%= render 'section_heading', :presenter => presenter %>
|
10
|
+
<% unless presenter.show_partial_only? %>
|
11
|
+
<div class="umlaut_section_content">
|
12
|
+
<% end %>
|
13
|
+
<% if presenter.custom_partial? %>
|
14
|
+
<%= render presenter.content_render_hash %>
|
15
|
+
<% elsif presenter.list_visible_limit %>
|
16
|
+
<%= list_with_limit("#{presenter.div_id}_list_with_limit", presenter.responses_list,
|
17
|
+
:limit => presenter.list_visible_limit, :ul_class => "response_list #{presenter.div_id}") do |item, index|
|
18
|
+
render presenter.item_render_hash(item)
|
19
|
+
end %>
|
20
|
+
<% elsif presenter.responses_list.length == 0 && ! presenter.services_in_progress? %>
|
22
21
|
<ul class="response_list">
|
23
22
|
<li>None available.</li>
|
24
|
-
</ul
|
25
|
-
else %>
|
26
|
-
<ul class="response_list <%= presenter.div_id %>"
|
27
|
-
render
|
28
|
-
</ul
|
29
|
-
end
|
30
|
-
if presenter.show_spinner?
|
31
|
-
render
|
32
|
-
end
|
33
|
-
unless presenter.show_partial_only? %>
|
34
|
-
</div>
|
35
|
-
|
36
|
-
|
37
|
-
end %>
|
23
|
+
</ul>
|
24
|
+
<% else %>
|
25
|
+
<ul class="response_list <%= presenter.div_id %>">
|
26
|
+
<%= render presenter.content_render_hash %>
|
27
|
+
</ul>
|
28
|
+
<% end %>
|
29
|
+
<% if presenter.show_spinner? %>
|
30
|
+
<%= render presenter.spinner_render_hash %>
|
31
|
+
<% end %>
|
32
|
+
<% unless presenter.show_partial_only? %>
|
33
|
+
</div></div>
|
34
|
+
<% end %>
|
35
|
+
<% end %>
|
@@ -1,17 +1,14 @@
|
|
1
|
-
<%# requires local :presenter with a SectionRenderer
|
2
|
-
optional local :force_render=> true to ignore presentation logic. legacy. %>
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
<% if presenter.
|
8
|
-
<
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
</div>
|
16
|
-
|
17
|
-
<% end %>
|
1
|
+
<%# requires local :presenter with a SectionRenderer
|
2
|
+
optional local :force_render=> true to ignore presentation logic. legacy. %>
|
3
|
+
<% if presenter.show_heading? || local_assigns[:force_render] == true %>
|
4
|
+
<div class="section_heading">
|
5
|
+
<% if presenter.section_title %>
|
6
|
+
<h3><%= presenter.section_title %></h3>
|
7
|
+
<% if presenter.section_prompt %>
|
8
|
+
<p class="section_prompt">
|
9
|
+
<%= presenter.section_prompt %>
|
10
|
+
</p>
|
11
|
+
<% end %>
|
12
|
+
<% end %>
|
13
|
+
</div>
|
14
|
+
<% end %>
|
@@ -1,27 +1,21 @@
|
|
1
|
-
<%= render
|
1
|
+
<%= render 'background_updater', :user_request => @user_request %>
|
2
2
|
<div class="row-fluid">
|
3
|
-
|
4
3
|
<div class="span8 umlaut-main">
|
5
|
-
|
6
4
|
<div class="umlaut-resource-info">
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
<%= render_section(html_section_by_div_id("cover_image")) %>
|
21
|
-
</div>
|
22
|
-
|
5
|
+
<div class="resource_info_sections">
|
6
|
+
<%= render 'manually_entered_warning', :user_request => @user_request %>
|
7
|
+
<%= render 'citation', :user_request => @user_request %>
|
8
|
+
<% html_sections(:resource_info).each do |section| %>
|
9
|
+
<%= content_tag "div", :id => section[:div_id] do %>
|
10
|
+
<%= render_section(section) %>
|
11
|
+
<% end %>
|
12
|
+
<% end %>
|
13
|
+
</div>
|
14
|
+
<%# need a div here for ajax bg loader to put bg loaded cover into %>
|
15
|
+
<div id="cover_image">
|
16
|
+
<%= render_section(html_section_by_div_id("cover_image")) %>
|
17
|
+
</div>
|
23
18
|
</div>
|
24
|
-
|
25
19
|
<div class="main_response_list">
|
26
20
|
<% html_sections(:main).each do |section| %>
|
27
21
|
<%= content_tag "div", :id => section[:div_id] do %>
|
@@ -29,8 +23,7 @@
|
|
29
23
|
<% end %>
|
30
24
|
<% end %>
|
31
25
|
</div>
|
32
|
-
</div>
|
33
|
-
|
26
|
+
</div>
|
34
27
|
<div class="span4 umlaut-sidebar">
|
35
28
|
<% html_sections(:sidebar).each do |section| %>
|
36
29
|
<%= content_tag "div", :id => section[:div_id] do %>
|
@@ -43,5 +36,5 @@
|
|
43
36
|
<% end %>
|
44
37
|
</div>
|
45
38
|
</div>
|
46
|
-
<%= render
|
47
|
-
</div>
|
39
|
+
<%= render 'modal' %>
|
40
|
+
</div>
|
data/lib/umlaut/version.rb
CHANGED
@@ -487,3 +487,36 @@ coffeemakers5:
|
|
487
487
|
normalized_value: "25"
|
488
488
|
metadata: true
|
489
489
|
private_data: false
|
490
|
+
|
491
|
+
manually_entered1:
|
492
|
+
referent: manually_entered
|
493
|
+
normalized_value: ""
|
494
|
+
key_name: object_id
|
495
|
+
metadata: true
|
496
|
+
value: ""
|
497
|
+
private_data: false
|
498
|
+
|
499
|
+
manually_entered2:
|
500
|
+
referent: manually_entered
|
501
|
+
normalized_value: journal
|
502
|
+
key_name: format
|
503
|
+
metadata: false
|
504
|
+
value: journal
|
505
|
+
private_data: false
|
506
|
+
|
507
|
+
manually_entered3:
|
508
|
+
referent: manually_entered
|
509
|
+
key_name: genre
|
510
|
+
value: article
|
511
|
+
normalized_value: article
|
512
|
+
metadata: true
|
513
|
+
private_data: false
|
514
|
+
|
515
|
+
manually_entered4:
|
516
|
+
referent: manually_entered
|
517
|
+
normalized_value: entry manual
|
518
|
+
key_name: jtitle
|
519
|
+
metadata: true
|
520
|
+
value: Entry Manual
|
521
|
+
private_data: false
|
522
|
+
|
data/test/fixtures/referents.yml
CHANGED
data/test/fixtures/requests.yml
CHANGED
@@ -167,3 +167,15 @@ service_response10:
|
|
167
167
|
:citation_issue:
|
168
168
|
:citation_spage:
|
169
169
|
:debug_info: ! ' Target: GALEGROUP_IT_NEWSSTAND ; SFX object ID: 2670000000017711'
|
170
|
+
|
171
|
+
service_response11:
|
172
|
+
service_id: SFX
|
173
|
+
display_text: Ask a Librarian
|
174
|
+
url: "http://library.edu/ask"
|
175
|
+
notes:
|
176
|
+
request: nytimes
|
177
|
+
service_type_value_name: help
|
178
|
+
service_data: |
|
179
|
+
---
|
180
|
+
:display_text: Ask a Librarian
|
181
|
+
:url: http://library.edu/ask
|
@@ -7,19 +7,28 @@ require 'rack/utils'
|
|
7
7
|
class ResolveControllerTest < ActionController::TestCase
|
8
8
|
extend TestWithCassette
|
9
9
|
fixtures :requests, :referents, :referent_values, :dispatched_services, :service_responses
|
10
|
-
|
10
|
+
|
11
11
|
setup do
|
12
12
|
@controller = ResolveController.new
|
13
13
|
end
|
14
|
-
|
14
|
+
|
15
15
|
test_with_cassette("nytimes by issn", :resolve, :match_requests_on => [:method, :uri_without_ctx_tim]) do
|
16
16
|
umlaut_request = requests(:nytimes)
|
17
17
|
get :index, "umlaut.request_id" => umlaut_request.id
|
18
18
|
assert_response :success
|
19
19
|
assert_select "title", "Find It | The New York times"
|
20
20
|
assert_select "h1", "Find It"
|
21
|
+
# Resource title assertion
|
21
22
|
assert_select "h2.title", "The New York times"
|
22
|
-
|
23
|
+
# Background updater assertions
|
24
|
+
assert_select ".umlaut-resolve-container > script" do |scripts|
|
25
|
+
assert_equal 1, scripts.size
|
26
|
+
# Make sure we have an HtmlUpdater in our script
|
27
|
+
scripts.each do |script|
|
28
|
+
assert_match /var updater = new Umlaut.HtmlUpdater\("http:\/\/test\.host\/", "umlaut\.request_id=#{umlaut_request.id}"\);/, script.to_s
|
29
|
+
end
|
30
|
+
end
|
31
|
+
# Citation section assertions
|
23
32
|
assert_select ".umlaut-main .umlaut-resource-info dl.citation-info" do |dls|
|
24
33
|
assert_equal 1, dls.size
|
25
34
|
dls.each do |dl|
|
@@ -33,16 +42,18 @@ class ResolveControllerTest < ActionController::TestCase
|
|
33
42
|
end
|
34
43
|
end
|
35
44
|
end
|
36
|
-
#
|
45
|
+
# Fulltext section assertions
|
37
46
|
assert_select ".umlaut-main .umlaut-section.fulltext" do |sections|
|
38
47
|
assert_equal 1, sections.size
|
39
48
|
sections.each do |section|
|
40
49
|
assert_select section, ".response_list", 1
|
41
50
|
assert_select section, ".response_list" do |response_lists|
|
51
|
+
assert_select section, ".section_heading h3", { :count => 1, :text => "Online Access" }
|
42
52
|
assert_select section, "li.response_item", 4
|
43
53
|
end
|
44
54
|
end
|
45
55
|
end
|
56
|
+
# Holding section assertions
|
46
57
|
assert_select ".umlaut-main .umlaut-section.holding" do |sections|
|
47
58
|
assert_equal 1, sections.size
|
48
59
|
sections.each do |section|
|
@@ -62,18 +73,39 @@ class ResolveControllerTest < ActionController::TestCase
|
|
62
73
|
end
|
63
74
|
end
|
64
75
|
end
|
76
|
+
# Export citation section assertions
|
65
77
|
assert_select ".umlaut-sidebar .umlaut-section.export_citation" do |sections|
|
66
78
|
assert_equal 1, sections.size
|
67
79
|
sections.each do |section|
|
80
|
+
assert_select section, ".section_heading h3", { :count => 1, :text => "Export tool" }
|
68
81
|
assert_select section, ".response_list", 1
|
69
82
|
end
|
70
83
|
end
|
84
|
+
# Highlighted link section assertions
|
71
85
|
assert_select ".umlaut-sidebar .umlaut-section.highlighted_link" do |sections|
|
72
86
|
assert_equal 1, sections.size
|
73
87
|
sections.each do |section|
|
88
|
+
assert_select section, ".section_heading h3", { :count => 1, :text => "See also" }
|
89
|
+
assert_select section, ".response_list", 1
|
90
|
+
end
|
91
|
+
end
|
92
|
+
# Help section assertions
|
93
|
+
assert_select ".umlaut-sidebar .umlaut-section.help" do |sections|
|
94
|
+
assert_equal 1, sections.size
|
95
|
+
sections.each do |section|
|
96
|
+
assert_select section, ".section_heading h3", { :count => 1, :text => "Question? Problem? Contact:" }
|
74
97
|
assert_select section, ".response_list", 1
|
75
98
|
end
|
76
99
|
end
|
100
|
+
# Modal assertions
|
101
|
+
assert_select ".modal" do |modals|
|
102
|
+
assert_equal 1, modals.size
|
103
|
+
modals.each do |modal|
|
104
|
+
assert_select modal, ".modal-header", { :count => 1 }
|
105
|
+
assert_select modal, ".modal-body", { :count => 1 }
|
106
|
+
assert_select modal, ".modal-footer", { :count => 1 }
|
107
|
+
end
|
108
|
+
end
|
77
109
|
end
|
78
110
|
|
79
111
|
test_with_cassette("POSTed OpenURL redirects to GET", :resolve, :match_requests_on => [:method, :uri_without_ctx_tim]) do
|
@@ -85,10 +117,10 @@ class ResolveControllerTest < ActionController::TestCase
|
|
85
117
|
|
86
118
|
redirect_uri = URI.parse(@response.redirect_url)
|
87
119
|
|
88
|
-
assert_equal "/resolve", redirect_uri.path
|
120
|
+
assert_equal "/resolve", redirect_uri.path
|
89
121
|
|
90
122
|
# Redirected params is a subset of pparams, pparams can have extra
|
91
|
-
# stuff maybe, we don't care.
|
123
|
+
# stuff maybe, we don't care.
|
92
124
|
redirected_params = Rack::Utils.parse_nested_query redirect_uri.query
|
93
125
|
assert (redirected_params.to_a - pparams.to_a).empty?, "Redirected params include all of original POSTed params"
|
94
126
|
end
|
@@ -109,7 +141,7 @@ class ResolveControllerTest < ActionController::TestCase
|
|
109
141
|
|
110
142
|
test_with_cassette("no holdings", :resolve, :match_requests_on => [:method, :uri_without_ctx_tim]) do
|
111
143
|
umlaut_request = requests(:advocate)
|
112
|
-
get(:index, {'umlaut.request_id' => umlaut_request.id
|
144
|
+
get(:index, {'umlaut.request_id' => umlaut_request.id})
|
113
145
|
assert_response :success
|
114
146
|
assert_select 'div#fulltext ul.response_list li.response_item' do |elements|
|
115
147
|
assert_equal(1, elements.size)
|
@@ -121,4 +153,17 @@ class ResolveControllerTest < ActionController::TestCase
|
|
121
153
|
# Assert no holdings
|
122
154
|
assert_select 'div#holding div.umlaut-holdings', :count => 0
|
123
155
|
end
|
124
|
-
|
156
|
+
|
157
|
+
test_with_cassette("manually entered", :resolve, :match_requests_on => [:method, :uri_without_ctx_tim]) do
|
158
|
+
umlaut_request = requests(:manually_entered)
|
159
|
+
get(:index, {'umlaut.request_id' => umlaut_request.id})
|
160
|
+
assert_response :success
|
161
|
+
assert_select('.resource_info_sections > div.alert.alert-error',
|
162
|
+
{:text => "Warning: Find It does not know about a journal with this name. Please check your entry."}) do |error_divs|
|
163
|
+
assert_equal 1, error_divs.size, "More than one error div"
|
164
|
+
error_divs.each do |error_div|
|
165
|
+
assert_select error_div, 'i.umlaut_icons-famfamfam-error', 1
|
166
|
+
end
|
167
|
+
end
|
168
|
+
end
|
169
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
require 'referent'
|
4
|
+
require 'dissertation_catch'
|
5
|
+
|
6
|
+
|
7
|
+
class DissertationCatchTest < ActiveSupport::TestCase
|
8
|
+
# this was a regression
|
9
|
+
def test_blank_atitle
|
10
|
+
context_object = OpenURL::ContextObject.new_from_kev("atitle=&title=Between+Us+and+Artistic+Appreciation%3a+Nabokov+and+the+Problem+of+Distortion&issn=04194209")
|
11
|
+
|
12
|
+
# Not sure how we get a blank atitle in there, but we want DissertationCatch to handle it
|
13
|
+
referent = Referent.new
|
14
|
+
referent.set_values_from_context_object(context_object)
|
15
|
+
referent.ensure_value!("atitle", "")
|
16
|
+
referent.referent_values(true) # reload
|
17
|
+
|
18
|
+
DissertationCatch.new.filter(referent)
|
19
|
+
|
20
|
+
assert_equal "Between Us and Artistic Appreciation: Nabokov and the Problem of Distortion", referent.metadata['title']
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,84 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://worldcat.org/identities/search/PersonalIdentities?maximumRecords=1&query=local.Name%20all%20%22Michael%20Ende%22&sortKeys=holdingscount
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- text/xml
|
12
|
+
User-Agent:
|
13
|
+
- Ruby
|
14
|
+
response:
|
15
|
+
status:
|
16
|
+
code: 200
|
17
|
+
message: OK
|
18
|
+
headers:
|
19
|
+
Date:
|
20
|
+
- Thu, 09 Jan 2014 15:32:33 GMT
|
21
|
+
Server:
|
22
|
+
- Apache
|
23
|
+
Content-Length:
|
24
|
+
- '1582'
|
25
|
+
Content-Type:
|
26
|
+
- text/xml
|
27
|
+
body:
|
28
|
+
encoding: US-ASCII
|
29
|
+
string: ! "<?xml version=\"1.0\" encoding=\"UTF-8\"?> \n<?xml-stylesheet type=\"text/xsl\"
|
30
|
+
href=\"/identities/NameFinderResponse.xsl\"?>\n<searchRetrieveResponse xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
|
31
|
+
xsi:schemaLocation=\"http://www.loc.gov/zing/srw/ http://www.loc.gov/standards/sru/sru1-1archive/xml-files/srw-types.xsd\"
|
32
|
+
xmlns=\"http://www.loc.gov/zing/srw/\"><version xsi:type=\"xsd:string\">1.1</version><numberOfRecords
|
33
|
+
xsi:type=\"xsd:nonNegativeInteger\">0</numberOfRecords><echoedSearchRetrieveRequest
|
34
|
+
xsi:type=\"ns1:echoedSearchRetrieveRequestType\" xmlns:ns1=\"http://www.loc.gov/zing/srw/\"><version
|
35
|
+
xsi:type=\"xsd:string\">1.1</version><query xsi:type=\"xsd:string\">local.Name
|
36
|
+
all "Michael Ende"</query><xQuery><ns2:searchClause xsi:type=\"ns2:searchClauseType\"
|
37
|
+
xmlns:ns2=\"http://www.loc.gov/zing/cql/xcql/\"><ns2:index xsi:type=\"xsd:string\">local.Name</ns2:index><ns2:relation
|
38
|
+
xsi:type=\"ns2:relationType\"><ns2:value xsi:type=\"xsd:string\">all</ns2:value></ns2:relation><ns2:term
|
39
|
+
xsi:type=\"xsd:string\">Michael Ende</ns2:term></ns2:searchClause></xQuery><maximumRecords
|
40
|
+
xsi:type=\"xsd:nonNegativeInteger\">1</maximumRecords><recordSchema xsi:type=\"xsd:string\">default</recordSchema><sortKeys
|
41
|
+
xsi:type=\"xsd:string\">holdingscount</sortKeys></echoedSearchRetrieveRequest><extraResponseData
|
42
|
+
xsi:type=\"ns3:extraDataType\" xmlns:ns3=\"http://www.loc.gov/zing/srw/\"><ns4:extraData
|
43
|
+
xmlns=\"http://oclc.org/srw/extraData\" xmlns:ns4=\"http://oclc.org/srw/extraData\"><ns4:databaseTitle>WorldCat
|
44
|
+
Personal Identity Records</ns4:databaseTitle></ns4:extraData></extraResponseData></searchRetrieveResponse>"
|
45
|
+
http_version:
|
46
|
+
recorded_at: Thu, 09 Jan 2014 15:32:33 GMT
|
47
|
+
- request:
|
48
|
+
method: get
|
49
|
+
uri: http://catalog.hathitrust.org/api/volumes/brief/json/isbn:038519093X
|
50
|
+
body:
|
51
|
+
encoding: US-ASCII
|
52
|
+
string: ''
|
53
|
+
headers:
|
54
|
+
Accept:
|
55
|
+
- ! '*/*'
|
56
|
+
User-Agent:
|
57
|
+
- Ruby
|
58
|
+
response:
|
59
|
+
status:
|
60
|
+
code: 200
|
61
|
+
message: OK
|
62
|
+
headers:
|
63
|
+
Date:
|
64
|
+
- Thu, 09 Jan 2014 15:32:33 GMT
|
65
|
+
Server:
|
66
|
+
- Apache/2.2.22 (Debian) mod_fastcgi/mod_fastcgi-SNAP-0910052141 PHP/5.4.4-14+deb7u5
|
67
|
+
X-Powered-By:
|
68
|
+
- PHP/5.4.4-14+deb7u5
|
69
|
+
Content-Length:
|
70
|
+
- '495'
|
71
|
+
Content-Type:
|
72
|
+
- application/json; charset=UTF-8
|
73
|
+
Set-Cookie:
|
74
|
+
- NSC_mchspvq-iu=ffffffff854c63df45525d5f4f58455e445a4a423660;expires=Thu, 09-Jan-2014
|
75
|
+
15:42:33 GMT;path=/;httponly
|
76
|
+
body:
|
77
|
+
encoding: US-ASCII
|
78
|
+
string: ! '{"isbn:038519093X":{"records":{"000346062":{"recordURL":"http:\/\/catalog.hathitrust.org\/Record\/000346062","titles":["Momo
|
79
|
+
\/"],"isbns":["9780385190930"],"issns":[],"oclcs":["10779071"],"lccns":["84010157"],"publishDates":["1985"]}},"items":[{"orig":"University
|
80
|
+
of Michigan","fromRecord":"000346062","htid":"mdp.39015054080638","itemURL":"http:\/\/hdl.handle.net\/2027\/mdp.39015054080638","rightsCode":"ic","lastUpdate":"20130802","enumcron":false,"usRightsString":"Limited
|
81
|
+
(search-only)"}]}}'
|
82
|
+
http_version:
|
83
|
+
recorded_at: Thu, 09 Jan 2014 15:32:33 GMT
|
84
|
+
recorded_with: VCR 2.5.0
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: umlaut
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.2.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2014-02-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -672,6 +672,7 @@ files:
|
|
672
672
|
- ./test/unit/bx_test.rb
|
673
673
|
- ./test/unit/collection_test.rb
|
674
674
|
- ./test/unit/determine_services_test.rb
|
675
|
+
- ./test/unit/dissertation_catch_test.rb
|
675
676
|
- ./test/unit/google_book_search_test.rb
|
676
677
|
- ./test/unit/google_scholar_link_test.rb
|
677
678
|
- ./test/unit/internet_archive_test.rb
|
@@ -689,6 +690,7 @@ files:
|
|
689
690
|
- ./test/vcr_cassettes/google_book_search/frankenstein_by_OCLC_number.yml
|
690
691
|
- ./test/vcr_cassettes/internet_archive/momo_by_title_author.yml
|
691
692
|
- ./test/vcr_cassettes/resolve/fulltext_with_edition_warning.yml
|
693
|
+
- ./test/vcr_cassettes/resolve/manually_entered.yml
|
692
694
|
- ./test/vcr_cassettes/resolve/no_holdings.yml
|
693
695
|
- ./test/vcr_cassettes/resolve/nytimes_by_issn.yml
|
694
696
|
- ./test/vcr_cassettes/sfx/nytimes_by_issn.yml
|
@@ -711,7 +713,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
711
713
|
version: '0'
|
712
714
|
segments:
|
713
715
|
- 0
|
714
|
-
hash:
|
716
|
+
hash: -3449280870636764014
|
715
717
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
716
718
|
none: false
|
717
719
|
requirements:
|
@@ -720,7 +722,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
720
722
|
version: '0'
|
721
723
|
segments:
|
722
724
|
- 0
|
723
|
-
hash:
|
725
|
+
hash: -3449280870636764014
|
724
726
|
requirements: []
|
725
727
|
rubyforge_project:
|
726
728
|
rubygems_version: 1.8.23
|
@@ -891,6 +893,7 @@ test_files:
|
|
891
893
|
- ./test/unit/bx_test.rb
|
892
894
|
- ./test/unit/collection_test.rb
|
893
895
|
- ./test/unit/determine_services_test.rb
|
896
|
+
- ./test/unit/dissertation_catch_test.rb
|
894
897
|
- ./test/unit/google_book_search_test.rb
|
895
898
|
- ./test/unit/google_scholar_link_test.rb
|
896
899
|
- ./test/unit/internet_archive_test.rb
|
@@ -908,6 +911,7 @@ test_files:
|
|
908
911
|
- ./test/vcr_cassettes/google_book_search/frankenstein_by_OCLC_number.yml
|
909
912
|
- ./test/vcr_cassettes/internet_archive/momo_by_title_author.yml
|
910
913
|
- ./test/vcr_cassettes/resolve/fulltext_with_edition_warning.yml
|
914
|
+
- ./test/vcr_cassettes/resolve/manually_entered.yml
|
911
915
|
- ./test/vcr_cassettes/resolve/no_holdings.yml
|
912
916
|
- ./test/vcr_cassettes/resolve/nytimes_by_issn.yml
|
913
917
|
- ./test/vcr_cassettes/sfx/nytimes_by_issn.yml
|