umlaut 3.0.0alpha10 → 3.0.0alpha11
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.
- data/app/models/collection.rb +7 -1
- data/app/models/referent.rb +11 -77
- data/app/models/request.rb +2 -2
- data/app/models/service_store.rb +4 -0
- data/app/models/service_wave.rb +1 -1
- data/lib/section_renderer.rb +9 -5
- data/lib/service.rb +0 -62
- data/lib/service_adaptors/isi.rb +1 -1
- data/lib/service_adaptors/jcr.rb +1 -1
- data/lib/umlaut/version.rb +1 -1
- data/lib/umlaut_configurable.rb +1 -0
- data/test/dummy/config/environments/profile.rb +24 -0
- data/test/dummy/config/primo.yml +271 -0
- data/test/dummy/config/umlaut_services-TEST.yml +37 -0
- data/test/dummy/profile/sfx_collection_prof.rb +22 -0
- data/test/dummy/tmp/cache/assets/C2A/410/sprockets%2Fd654b74912b4773a2534616863fb6565 +0 -0
- data/test/dummy/tmp/cache/assets/C45/A30/sprockets%2F39494895e462697b478d3d0c79298a26 +0 -0
- data/test/dummy/tmp/cache/assets/C5F/340/sprockets%2F99692920160b7a279b86a80415b79db7 +0 -0
- data/test/dummy/tmp/cache/assets/C70/4D0/sprockets%2F034ad2036e623081bd352800786dfe80 +0 -0
- data/test/dummy/tmp/cache/assets/C80/980/sprockets%2Fc94807409c1523d43e18d25f35d93c41 +0 -0
- data/test/dummy/tmp/cache/assets/{D0E/570/sprockets%2Fd4a16e3bdd7c7b9543c446b1b0174688 → CBD/730/sprockets%2F034c1086748b981c36672d5a56e7fed6} +0 -0
- data/test/dummy/tmp/cache/assets/CBF/B60/sprockets%2F08ca89671549936265dcb673bf02e36f +0 -0
- data/test/dummy/tmp/cache/assets/CC9/9F0/sprockets%2F306166316e2cafd13c15e62b51a2339d +0 -0
- data/test/dummy/tmp/cache/assets/CD6/300/sprockets%2F397ec39d3d883789effe506c38760368 +0 -0
- data/test/dummy/tmp/cache/assets/CD7/DD0/sprockets%2F4f1fe68aa2042a0970bde9b185530646 +0 -0
- data/test/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953 +0 -0
- data/test/dummy/tmp/cache/assets/CF7/2B0/sprockets%2F25a7c73655bd3598173b39d9f98bcd46 +0 -0
- data/test/dummy/tmp/cache/assets/CFE/080/sprockets%2F37fe9f4255baddbd549a659914929398 +0 -0
- data/test/dummy/tmp/cache/assets/{CE1/F50/sprockets%2F6e6b593b107866863500ba0fee5a9e24 → D16/F90/sprockets%2F5fe3c021048c6f9a6086bed7736d87b1} +0 -0
- data/test/dummy/tmp/cache/assets/{CDD/7D0/sprockets%2F60687bff4553a7f8c701bb9627a6200a → D24/360/sprockets%2F6987b047a96dc685ba3cf39b31477f6d} +0 -0
- data/test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/test/dummy/tmp/cache/assets/D37/2B0/sprockets%2F40834fb07d7318c1fddd5003bd9e04f6 +0 -0
- data/test/dummy/tmp/cache/assets/D43/0D0/sprockets%2F682843a8d0795a5fbcfeb2f0c81727d0 +0 -0
- data/test/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/test/dummy/tmp/cache/assets/D50/A30/sprockets%2F7d8b294ac433db5d056538f8cf7c66b9 +0 -0
- data/test/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/test/dummy/tmp/cache/assets/D6C/7D0/sprockets%2F8a05d6981ec0d38c51739bef0b3a9c2b +0 -0
- data/test/dummy/tmp/cache/assets/D94/FF0/sprockets%2F3b56a1aa77de0d570c38a4a9d5f4b1d6 +0 -0
- data/test/dummy/tmp/cache/assets/D97/6B0/sprockets%2Fb070e8c799d1a4ad5e62e0a1ae3b83e6 +0 -0
- data/test/dummy/tmp/cache/assets/DA6/A80/sprockets%2F92e26d8e58d5bcc8b8f6c25d1b05b9c1 +0 -0
- data/test/dummy/tmp/cache/assets/{DB7/BD0/sprockets%2Ff2c59778ab79dcfd3792f46f2ce82f2a → DC0/D20/sprockets%2F1ccf7405cd252dcec4bf23af82e2563a} +0 -0
- data/test/dummy/tmp/cache/assets/{D5C/B00/sprockets%2F2b7ac06cc680d7480c06b917bac5a6b0 → DD2/D80/sprockets%2Fc66d103807d0f971fbbcf9aa8b8b27ee} +0 -0
- data/test/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/test/dummy/tmp/cache/assets/DE8/790/sprockets%2Fd1333bde2b9aafcc712d11dd09ab35d8 +0 -0
- data/test/dummy/tmp/cache/assets/DF5/5E0/sprockets%2F8e64a37c73cdc0b37a4ccfcb42ab45d8 +0 -0
- data/test/dummy/tmp/cache/assets/DF7/960/sprockets%2F99ac6db10b44a64fbba4ee847b35ba8b +0 -0
- data/test/dummy/tmp/cache/assets/{C84/A00/sprockets%2F3ba04c88513936081d59d8771f6804aa → DFC/040/sprockets%2F15ea81cf915c0cb1dfc9cc04c9fef364} +0 -0
- data/test/dummy/tmp/cache/assets/DFD/300/sprockets%2Fabac9489cf7f1db8ef00d72a1571ee1e +0 -0
- data/test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/test/dummy/tmp/cache/assets/E38/FE0/sprockets%2Fe1fc875efa817cbb94a5d8de25ea4e6b +0 -0
- data/test/dummy/tmp/cache/assets/E5F/960/sprockets%2Fdc007b6cad5c7ef08e33ec28cfff0ef6 +0 -0
- data/test/dummy/tmp/performance/BenchmarkerTest#test_puts_foo_gc_runs.csv +2 -0
- data/test/dummy/tmp/performance/BenchmarkerTest#test_puts_foo_gc_time.csv +2 -0
- data/test/dummy/tmp/performance/BenchmarkerTest#test_puts_foo_memory.csv +2 -0
- data/test/dummy/tmp/performance/BenchmarkerTest#test_puts_foo_objects.csv +2 -0
- data/test/dummy/tmp/performance/BenchmarkerTest#test_puts_foo_wall_time.csv +2 -0
- data/test/dummy/tmp/performance/ProfilerTest#test_puts_foo_process_time_flat.txt +11 -0
- data/test/dummy/tmp/performance/ProfilerTest#test_puts_foo_process_time_graph.html +303 -0
- data/test/dummy/tmp/performance/ProfilerTest#test_puts_foo_process_time_stack.html +546 -0
- data/test/dummy/tmp/performance/ProfilerTest#test_puts_foo_process_time_tree.txt +38 -0
- data/test/dummy/tmp/performance/empty.png +0 -0
- data/test/dummy/tmp/performance/minus.png +0 -0
- data/test/dummy/tmp/performance/plus.png +0 -0
- data/test/test_helper.rb +36 -0
- data/test/unit/aleph_patron_test.rb +40 -35
- data/test/unit/aleph_record_benchmarks.rb +28 -24
- data/test/unit/aleph_record_test.rb +31 -26
- data/test/unit/collection_test.rb +17 -18
- data/test/unit/google_book_search_test.rb +18 -44
- data/test/unit/primo_searcher_test.rb +325 -321
- data/test/unit/primo_service_test.rb +924 -919
- data/test/unit/primo_ws_test.rb +141 -138
- data/test/unit/service_test.rb +2 -16
- metadata +93 -100
- data/test/dummy/tmp/cache/assets/C73/920/sprockets%2Fd371318f22900492fd180f17c5e2a504 +0 -0
- data/test/dummy/tmp/cache/assets/C8F/780/sprockets%2Fe47e28558116fb5f8038754e60d1961d +0 -0
- data/test/dummy/tmp/cache/assets/CAA/EB0/sprockets%2F1d179210e8b76f1ea63c802688a015e4 +0 -9271
- data/test/dummy/tmp/cache/assets/CB2/DA0/sprockets%2Fa1808990b72376256db2ae3818c0e9b5 +0 -0
- data/test/dummy/tmp/cache/assets/CBB/9C0/sprockets%2F706f28923fb754cad04b9107c89986a1 +0 -0
- data/test/dummy/tmp/cache/assets/CDC/680/sprockets%2F2b68ef632d12610f3c9563168bfa7c05 +0 -0
- data/test/dummy/tmp/cache/assets/CEA/2A0/sprockets%2F9c8607157b998108ce08f4aca39f810a +0 -0
- data/test/dummy/tmp/cache/assets/CF5/9B0/sprockets%2F7933bfe880731b396791f1682ce3f7fa +0 -0
- data/test/dummy/tmp/cache/assets/CFB/2F0/sprockets%2F62d51f0aa5cac4b1cf7091823772a604 +0 -0
- data/test/dummy/tmp/cache/assets/D22/060/sprockets%2F9aec77b768e91a802d284271c58e2f7e +0 -0
- data/test/dummy/tmp/cache/assets/D33/6D0/sprockets%2F500129c57f1146e556ec3aacd6cd38c1 +0 -0
- data/test/dummy/tmp/cache/assets/D33/FD0/sprockets%2F2ba0b4e6334a77b923e5f770381bb2bf +0 -0
- data/test/dummy/tmp/cache/assets/D4C/0A0/sprockets%2F7810d837eec3ac57ad78756af83a6a55 +0 -0
- data/test/dummy/tmp/cache/assets/D4C/E30/sprockets%2F631abf89746799b7a5b2b3b4f6294bcd +0 -0
- data/test/dummy/tmp/cache/assets/D54/ED0/sprockets%2F71c9fa01091d432b131da3bb73faf3d4 +0 -873
- data/test/dummy/tmp/cache/assets/D5D/AD0/sprockets%2Fbdb053d9a6a967788f09fbc555d69f58 +0 -0
- data/test/dummy/tmp/cache/assets/D66/890/sprockets%2F06287a78ed20d8214197eab03bfca5dd +0 -0
- data/test/dummy/tmp/cache/assets/D6B/2A0/sprockets%2F81f17ab0ed20f4a8d9355f7a1d872eb2 +0 -0
- data/test/dummy/tmp/cache/assets/D70/080/sprockets%2F24d3ce40ae5cc827a9183b1fb837e84e +0 -0
- data/test/dummy/tmp/cache/assets/D71/6B0/sprockets%2Fde558b71b494cf09b1bf055c8dff0353 +0 -0
- data/test/dummy/tmp/cache/assets/D72/610/sprockets%2Fa8c708eeb30ef93de34d755d4f45d023 +0 -0
- data/test/dummy/tmp/cache/assets/D74/4C0/sprockets%2F64fdf30f75592d6e45fcfc45a48d20a2 +0 -0
- data/test/dummy/tmp/cache/assets/D76/AD0/sprockets%2Fe2158cde93188cf5ab6457bc6d6602ec +0 -0
- data/test/dummy/tmp/cache/assets/D7A/E40/sprockets%2F9622ffcc499a57627cd1bb18fe31b8e4 +0 -11772
- data/test/dummy/tmp/cache/assets/D84/210/sprockets%2Fabd0103ccec2b428ac62c94e4c40b384 +0 -0
- data/test/dummy/tmp/cache/assets/D9B/770/sprockets%2F8aacf02eb7dbb0949704b28f27b87e0b +0 -0
- data/test/dummy/tmp/cache/assets/DF7/F30/sprockets%2F7bc16c4109b17fabe29f8ddbbf732d1c +0 -0
- data/test/dummy/tmp/cache/assets/E03/570/sprockets%2F493bdc0ac14cd4f57fdfe4253f992bde +0 -0
- data/test/dummy/tmp/cache/assets/E09/850/sprockets%2F4bf497a38ecfef660b2f0ebb852d5e9c +0 -0
- data/test/dummy/tmp/cache/assets/E0B/4B0/sprockets%2F7988df51a61c81ce6ede4a2d4c8cce4f +0 -377
- data/test/dummy/tmp/cache/assets/E6F/A00/sprockets%2Fd32bcea45ea04a6aaee95b3aa840cbab +0 -0
data/app/models/collection.rb
CHANGED
@@ -18,7 +18,13 @@ class Collection
|
|
18
18
|
# configs
|
19
19
|
attr_accessor :response_expire_interval, :response_expire_crontab_format, :background_service_timeout, :requeue_failedtemporary_services
|
20
20
|
|
21
|
-
|
21
|
+
# a_umlaut_request is an UmlautRequest, representing a request for services for a context
|
22
|
+
# object.
|
23
|
+
# service_hash is a hash of hashes with service definitions, as would
|
24
|
+
# be in services.yml
|
25
|
+
# config is a Confstruct::Configuration associated with the current controller,
|
26
|
+
# has a few config options in it relevant to collection service exec; but
|
27
|
+
# don't pass in, we'll use a blank one with default values, no prob.
|
22
28
|
def initialize(a_umlaut_request, service_hash, config = Confstruct::Configuration.new)
|
23
29
|
self.umlaut_request = a_umlaut_request
|
24
30
|
|
data/app/models/referent.rb
CHANGED
@@ -1,95 +1,29 @@
|
|
1
|
+
# Note: There are a few actual attributes stored as Columns in referent --
|
2
|
+
# these were originally used for identifying a Referent identifying the
|
3
|
+
# 'same thing' as an incoming OpenURL, to re-use it. But we don't re-use
|
4
|
+
# cached referents anymore. So these attributes are NOT USED -- actual
|
5
|
+
# values are over in ReferentValues. But the attributes are left for now
|
6
|
+
# (and set) merely for making it easier to eyeball the database by hand:
|
7
|
+
# atitle, title, issn, isbn, volume, year. (why no issue/page number? hell
|
8
|
+
# if i know).
|
1
9
|
class Referent < ActiveRecord::Base
|
2
10
|
# for shortcut metadata manipulations
|
3
11
|
include MetadataHelper
|
4
12
|
|
5
|
-
|
6
|
-
# referent. They hold normalized value (use ReferentValue.normalize) or
|
7
|
-
# empty string. Never nil.
|
8
|
-
@@shortcut_attributes = [:atitle, :title, :issn, :isbn, :volume, :year]
|
13
|
+
|
9
14
|
has_many :requests
|
10
15
|
has_many :referent_values
|
11
16
|
has_many :permalinks
|
12
17
|
|
13
|
-
def before_validation_on_create
|
14
|
-
# shortcuts initialize to empty string, they should never be null.
|
15
|
-
@@shortcut_attributes.each do |key|
|
16
|
-
self[key] = "" if self[key].nil?
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
# When provided an OpenURL::ContextObject, it will return a Referent object
|
21
|
-
# (if one exists). At least that's the intent.
|
22
|
-
#This turns out to be a really
|
23
|
-
# tricky task, identifying when two citations that may not match exactly
|
24
|
-
# are the same citation. So this doesn't really work well--we err
|
25
|
-
# on the side of missing existing matches, better than finding
|
26
|
-
# a false match. So there are seldom matches found. A particular
|
27
|
-
# problem is that when the Referent is enhanced by a service,
|
28
|
-
# it will no longer match _itself_ as it came in! Oh well.
|
29
|
-
def self.find_by_context_object(co)
|
30
|
-
|
31
|
-
rft = co.referent
|
32
|
-
|
33
|
-
|
34
|
-
# Try to find for re-use by special indexed shortcut values. Create hash
|
35
|
-
# of shortcuts.
|
36
|
-
|
37
|
-
# Preload values as empty, even if they aren't found in our
|
38
|
-
# incoming referent--we want to find a match with them empty too, then!
|
39
|
-
shortcuts = {:atitle=>"", :title=>"", :issn=>"", :isbn=>"", :volume=>"", :year=>""}
|
40
|
-
|
41
|
-
# Special handling of title
|
42
|
-
incoming_title = rft.metadata['jtitle'] || rft.metadata['btitle'] || rft.metadata['title']
|
43
|
-
# DC OpenURL is an array, not a single value. Grr.
|
44
|
-
incoming_title = incoming_title[0] if incoming_title.kind_of?(Array)
|
45
|
-
shortcuts[:title] = ReferentValue.normalize(incoming_title) if incoming_title
|
46
|
-
# Special handling of date/year, since we use year instead of date for
|
47
|
-
# stored shortcut.
|
48
|
-
# I don't know why.
|
49
|
-
shortcuts[:year] = rft.metadata['date'] if rft.metadata['date']
|
50
|
-
|
51
|
-
# Other four.
|
52
|
-
[:atitle, :issn, :isbn, :volume].each do |att|
|
53
|
-
shortcuts[att] = ReferentValue.normalize( rft.metadata[att.to_s]) if rft.metadata[ att.to_s ]
|
54
|
-
end
|
55
|
-
# Don't look up by shortcuts if they're ALL blank. That doesn't do us well.
|
56
|
-
found_rft = nil
|
57
|
-
found_rft = Referent.find(:first, :conditions => shortcuts) if shortcuts.values.find {|v| ! v.empty?}
|
58
|
-
if ( found_rft && found_rft.metadata_intersects?( rft ) )
|
59
|
-
return found_rft
|
60
|
-
end
|
61
|
-
|
62
|
-
# found nothing?
|
63
|
-
return nil
|
64
|
-
end
|
65
|
-
|
66
|
-
# When provided an OpenURL::ContextObject, it will return a Referent object
|
67
|
-
# (creating one if doesn't already exist) . At least that's the idea.
|
68
|
-
# But see caveats at #find_by_context_object . Most of the time
|
69
|
-
# this ends up creating a new Referent.
|
70
|
-
# pass in referrer for source-specific referent munging.
|
71
|
-
def self.find_or_create_by_context_object(co)
|
72
|
-
# Okay, we need to do some pre-processing on weird context objects
|
73
|
-
# sent by, for example, firstSearch.
|
74
|
-
self.clean_up_context_object(co)
|
75
|
-
|
76
|
-
if rft = Referent.find_by_context_object(co)
|
77
|
-
return rft
|
78
|
-
else
|
79
|
-
rft = Referent.create_by_context_object(co)
|
80
|
-
return rft
|
81
|
-
end
|
82
|
-
end
|
83
|
-
|
84
18
|
# Does call save! on referent created.
|
85
19
|
# :permalink => false if you already have a permalink and don't
|
86
20
|
# need to create one. Caller should attach that permalink to this referent!
|
87
21
|
def self.create_by_context_object(co, options = {})
|
88
22
|
options = { :permalink => UmlautController.umlaut_config.create_permalinks
|
89
23
|
}.merge(options)
|
90
|
-
|
91
|
-
|
24
|
+
|
92
25
|
self.clean_up_context_object(co)
|
26
|
+
|
93
27
|
rft = Referent.new
|
94
28
|
|
95
29
|
# Wrap everything in a transaction for better efficiency, at least
|
data/app/models/request.rb
CHANGED
@@ -62,7 +62,7 @@ class Request < ActiveRecord::Base
|
|
62
62
|
# Okay, if we found a req, it might NOT have a referent, it might
|
63
63
|
# have been purged. If so, create a new one.
|
64
64
|
if ( req && ! req.referent )
|
65
|
-
req.referent = Referent.
|
65
|
+
req.referent = Referent.create_by_context_object(context_object)
|
66
66
|
end
|
67
67
|
|
68
68
|
unless (req || options[:allow_create] == false)
|
@@ -367,7 +367,7 @@ class Request < ActiveRecord::Base
|
|
367
367
|
|
368
368
|
# No id given, or no object found? Create it.
|
369
369
|
unless (rft )
|
370
|
-
rft = Referent.
|
370
|
+
rft = Referent.create_by_context_object(context_object)
|
371
371
|
end
|
372
372
|
|
373
373
|
# Create the Request
|
data/app/models/service_store.rb
CHANGED
@@ -29,6 +29,10 @@ class ServiceStore
|
|
29
29
|
config.each_pair do |group_name, group|
|
30
30
|
@@service_definitions.merge!( group["services"] ) if group["services"]
|
31
31
|
end
|
32
|
+
# set service_id key in each based on hash key
|
33
|
+
@@service_definitions.each_pair do |key, hash|
|
34
|
+
hash["service_id"] = key
|
35
|
+
end
|
32
36
|
end
|
33
37
|
return @@service_definitions
|
34
38
|
end
|
data/app/models/service_wave.rb
CHANGED
@@ -42,7 +42,7 @@ class ServiceWave
|
|
42
42
|
return if (@services.nil? || @services.empty?)
|
43
43
|
|
44
44
|
bundle_start = Time.now
|
45
|
-
Rails.logger.info(TermColor.color("Umlaut: Launching service wave #{@priority_level}", :yellow) + ", request #{request.id}") if @log_timing
|
45
|
+
Rails.logger.info(TermColor.color("Umlaut: Launching service wave #{@priority_level} #{'(non-threaded)' unless config.lookup!("threaded_service_wave", true) }", :yellow) + ", request #{request.id}") if @log_timing
|
46
46
|
|
47
47
|
|
48
48
|
|
data/lib/section_renderer.rb
CHANGED
@@ -388,11 +388,7 @@ class SectionRenderer
|
|
388
388
|
when true, false
|
389
389
|
@options[:visibility]
|
390
390
|
when :any_services
|
391
|
-
|
392
|
-
# if they've completed without doing so?.
|
393
|
-
nil != @umlaut_request.dispatched_services.to_a.find do |ds|
|
394
|
-
! (service_type_values & ds.service.service_types_generated ).empty?
|
395
|
-
end
|
391
|
+
any_services?
|
396
392
|
when :in_progress
|
397
393
|
# Do we have any of our types generated, or any services in progress
|
398
394
|
# that might generate them?
|
@@ -408,6 +404,14 @@ class SectionRenderer
|
|
408
404
|
else true
|
409
405
|
end
|
410
406
|
end
|
407
|
+
|
408
|
+
# do any services exist which even potentially generate our types, even
|
409
|
+
# if they've completed without doing so?.
|
410
|
+
def any_services?
|
411
|
+
nil != @umlaut_request.dispatched_services.to_a.find do |ds|
|
412
|
+
! (service_type_values & ds.service.service_types_generated ).empty?
|
413
|
+
end
|
414
|
+
end
|
411
415
|
|
412
416
|
def list_visible_limit
|
413
417
|
@options[:list_visible_limit]
|
data/lib/service.rb
CHANGED
@@ -43,7 +43,6 @@ class Service
|
|
43
43
|
|
44
44
|
|
45
45
|
def initialize(config)
|
46
|
-
|
47
46
|
config.each do | key, val |
|
48
47
|
self.instance_variable_set(('@'+key).to_sym, val)
|
49
48
|
end
|
@@ -179,67 +178,6 @@ class Service
|
|
179
178
|
return @session_id
|
180
179
|
end
|
181
180
|
|
182
|
-
# FakeSession little placeholder class we'll use in self.session to trick
|
183
|
-
# out Rails.
|
184
|
-
class FakeSession
|
185
|
-
attr_accessor :session_id
|
186
|
-
def initialize(a_session_id)
|
187
|
-
self.session_id = a_session_id
|
188
|
-
end
|
189
|
-
def new_session
|
190
|
-
return self.session_id
|
191
|
-
end
|
192
|
-
end
|
193
|
-
# Returns a read-only version of the session hash. Lazy loaded.
|
194
|
-
# See #update_session for making changes. Will have to be fixed
|
195
|
-
# for Rails 2.3.
|
196
|
-
def session
|
197
|
-
#lazy load
|
198
|
-
unless (@session_data || session_id.blank? )
|
199
|
-
# Craziness to restore a session in Rails pre 2.2. Will definitely
|
200
|
-
# need to be changed for Rails 2.3
|
201
|
-
|
202
|
-
fake_cgi_session = FakeSession.new(session_id)
|
203
|
-
|
204
|
-
@session_store_obj =
|
205
|
-
ActionController::Base.session_store.new(fake_cgi_session)
|
206
|
-
@_session_data = @session_store_obj.restore
|
207
|
-
# modifications here are not going to be automatically stored,
|
208
|
-
# so don't do them. See #update_session instead.
|
209
|
-
@session_data = @_session_data.clone
|
210
|
-
@session_data.freeze
|
211
|
-
end
|
212
|
-
if ( session_id.blank? && @session_data.nil?)
|
213
|
-
raise Exception.new("No session_id is available, therefore no session is available.")
|
214
|
-
end
|
215
|
-
return @session_data
|
216
|
-
end
|
217
|
-
|
218
|
-
|
219
|
-
# If we just allowed changes to our session hash, and rewrote it to
|
220
|
-
# the store, we'd get a race condition where we could over-write another
|
221
|
-
# service's changes. Rails itself is actually subject to that too.
|
222
|
-
# So, you tell us exactly which values you want to update, we'll
|
223
|
-
# refetch a fresh session, and save it with your changes.
|
224
|
-
#
|
225
|
-
# We're not actually guarding against the race condition, just
|
226
|
-
# fetching and storing quickly and hoping to miss it. FIXME.
|
227
|
-
#
|
228
|
-
# example: update_session( :new_value => "foo", :other => "bar")
|
229
|
-
#
|
230
|
-
# Will have to be fixed for Rails 2.3.
|
231
|
-
def update_session(new_values)
|
232
|
-
# force a new fetch
|
233
|
-
@session = nil
|
234
|
-
session
|
235
|
-
#and update that guy, with our mutable version
|
236
|
-
@_session_data.merge!(new_values)
|
237
|
-
@session_store_obj.close
|
238
|
-
# and update our cached copy to have the changes.
|
239
|
-
@session_data = @_session_data.clone
|
240
|
-
@session_data.freeze
|
241
|
-
end
|
242
|
-
|
243
181
|
# This method is called by Umlaut when user clicks on a service response.
|
244
182
|
# Default implementation here just returns response['url']. You can
|
245
183
|
# over-ride in a sub-class to provide custom implementation of on-demand
|
data/lib/service_adaptors/isi.rb
CHANGED
@@ -9,7 +9,7 @@
|
|
9
9
|
#
|
10
10
|
# You need to register for the the Thomson 'Links Article Match Retrieval'
|
11
11
|
# (LAMR) service api, which is used here. To register, see:
|
12
|
-
# http://
|
12
|
+
# http://wokinfo.com/products_tools/products/related/amr/
|
13
13
|
#
|
14
14
|
# You register by IP address, so no API key is needed once your registration
|
15
15
|
# goes through.
|
data/lib/service_adaptors/jcr.rb
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
# You need to register for the the Thomson 'Links Article Match Retrieval'
|
11
11
|
# (LAMR) service api, which is used here (and also in the Isi plugin). To
|
12
12
|
# register, see:
|
13
|
-
# http://
|
13
|
+
# http://wokinfo.com/products_tools/products/related/amr/
|
14
14
|
#
|
15
15
|
# You register by IP address, so no API key is needed once your registration
|
16
16
|
# goes through.
|
data/lib/umlaut/version.rb
CHANGED
data/lib/umlaut_configurable.rb
CHANGED
@@ -349,6 +349,7 @@ module UmlautConfigurable
|
|
349
349
|
# custom visibility, show it for item-level cites,
|
350
350
|
# or if we actually have some
|
351
351
|
visibility( lambda do |renderer|
|
352
|
+
renderer.any_services? &&
|
352
353
|
(! renderer.request.title_level_citation?) ||
|
353
354
|
(! renderer.responses_empty?)
|
354
355
|
end )
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# Settings specified here will take precedence over those in config/environment.rb
|
2
|
+
# The profile environment should match the same settings
|
3
|
+
# as the production environment to give a reasonalbe
|
4
|
+
# approximation of performance. However, it should
|
5
|
+
# definitely not use the production databse!
|
6
|
+
|
7
|
+
|
8
|
+
# Cache classes - otherwise your code
|
9
|
+
# will run approximately 5 times slower and the
|
10
|
+
# profiling results will be overwhelmed by Rails
|
11
|
+
# dependency loading mechanism
|
12
|
+
config.cache_classes = true
|
13
|
+
|
14
|
+
# Don't check template timestamps - once again this
|
15
|
+
# is to avoid IO times overwhelming profile results
|
16
|
+
config.action_view.cache_template_loading = true
|
17
|
+
|
18
|
+
# This is debatable, but turn off action controller
|
19
|
+
# caching to see how long it really takes to run
|
20
|
+
# queries and render templates
|
21
|
+
config.action_controller.perform_caching = false
|
22
|
+
|
23
|
+
# Turn off most logging
|
24
|
+
config.log_level = :info
|
@@ -0,0 +1,271 @@
|
|
1
|
+
libraries:
|
2
|
+
"BAFC": "NYU Bobst Avery Fisher Center"
|
3
|
+
"BARCH": "NYU Bobst University Archives"
|
4
|
+
"BCHIL": "NYU Bobst Children's Literature"
|
5
|
+
"BFALE": "NYU Bobst Fales"
|
6
|
+
"BHS": "Brooklyn Historical Society"
|
7
|
+
"BLCC": "NYU Bobst Library"
|
8
|
+
"BOBST": "NYU Bobst"
|
9
|
+
"BREF": "NYU Bobst Reference"
|
10
|
+
"BREF6": "NYU Bobst 6th Floor Reference"
|
11
|
+
"BTAM": "NYU Bobst Tamiment/Wagner Archives"
|
12
|
+
"BWEB": "NYU Restricted Internet"
|
13
|
+
"CARCH": "Cooper Union Archives"
|
14
|
+
"CCLOS": "Cooper Union Closed Stacks"
|
15
|
+
"CGEN": "Cooper Union General"
|
16
|
+
"CMEZZ": "Cooper Union Mezzanine"
|
17
|
+
"CMICRO": "Cooper Union Microform"
|
18
|
+
"COUR": "NYU Courant"
|
19
|
+
"CPER": "Cooper Union Periodicals"
|
20
|
+
"CREF": "Cooper Union Reference"
|
21
|
+
"CRES": "Cooper Union Reserves"
|
22
|
+
"CU": "Cooper Union"
|
23
|
+
"CWEB": "Cooper Union Restricted Internet Resources"
|
24
|
+
"IFA": "NYU Inst Fine Arts"
|
25
|
+
"IFAC": "NYU Inst Fine Arts Conservation"
|
26
|
+
"ISAW": "NYU Inst Study Ancient World"
|
27
|
+
"KEV": "NYU Kevorkian"
|
28
|
+
"LAPI": "NYU La Pietra (Italy)"
|
29
|
+
"NABUD": "NYU Abu Dhabi Library (UAE)"
|
30
|
+
"NOFFS": "NYU Offsite Storage"
|
31
|
+
"NSFO": "New School Fogelman Library"
|
32
|
+
"NSGI": "New School Gimbel Library"
|
33
|
+
"NSKE": "New School Kellen Archives Library"
|
34
|
+
"NSOS": "New School Offsite Storage"
|
35
|
+
"NSSC": "New School Scherman Library"
|
36
|
+
"NYHS": "New-York Historical Society"
|
37
|
+
"NYHSBR": "NYHS Broadsides"
|
38
|
+
"NYHSLAN": "NYHS Landauer"
|
39
|
+
"NYHSM": "New-York Historical Society"
|
40
|
+
"NYHSMAPS": "NYHS Maps"
|
41
|
+
"NYHSMSS": "NYHS Mss Collection"
|
42
|
+
"NYHSPAM": "NYHS Pamphlets"
|
43
|
+
"NYHSPR": "NYHS Print Room"
|
44
|
+
"NYHSREF": "NYHS Reference"
|
45
|
+
"NYSID": "New York School of Interior Design"
|
46
|
+
"REI": "NYU Real Estate"
|
47
|
+
"TWEB": "New School Restricted Internet"
|
48
|
+
"WEB": "Unrestricted Internet Access"
|
49
|
+
aleph_sub_library_codes:
|
50
|
+
"BARCH": "BOBST"
|
51
|
+
"BCHIL": "BOBST"
|
52
|
+
"BHS": "KBHS"
|
53
|
+
"BREF": "BOBST"
|
54
|
+
"CARCH": "CU"
|
55
|
+
"CCLOS": "CU"
|
56
|
+
"CGEN": "CU"
|
57
|
+
"CMEZZ": "CU"
|
58
|
+
"CMICRO": "CU"
|
59
|
+
"COUR": "NCOUR"
|
60
|
+
"CPER": "CU"
|
61
|
+
"CREF": "CU"
|
62
|
+
"CRES": "CU"
|
63
|
+
"CWEB": "CU"
|
64
|
+
"IFA": "NIFA"
|
65
|
+
"IFAC": "NIFAC"
|
66
|
+
"ISAW": "NISAW"
|
67
|
+
"KEV": "NKEV"
|
68
|
+
"LAPI": "NLAPI"
|
69
|
+
"NSFO": "TNSFO"
|
70
|
+
"NSGI": "TNSGI"
|
71
|
+
"NSKE": "TNSKE"
|
72
|
+
"NSOS": "TNSOS"
|
73
|
+
"NSSC": "TNSSC"
|
74
|
+
"NYHSBR": "NYHS"
|
75
|
+
"NYHSLAN": "NYHS"
|
76
|
+
"NYHSM": "NYHS"
|
77
|
+
"NYHSMAPS": "NYHS"
|
78
|
+
"NYHSMSS": "NYHS"
|
79
|
+
"NYHSPAM": "NYHS"
|
80
|
+
"NYHSPR": "NYHS"
|
81
|
+
"NYHSREF": "NYHS"
|
82
|
+
"REI": "NREI"
|
83
|
+
statuses:
|
84
|
+
"available": "Available"
|
85
|
+
"requested": "Requested"
|
86
|
+
"unavailable": "Check Availability"
|
87
|
+
"check_holdings": "Check Availability"
|
88
|
+
"request_ill": "Request ILL"
|
89
|
+
"billed_as_lost": "Request ILL"
|
90
|
+
"offsite": "Offsite Available"
|
91
|
+
"processing": "In Processing"
|
92
|
+
"in_transit": "In Processing"
|
93
|
+
"ask_afc": "Ask at Avery Fisher Center"
|
94
|
+
"ask_archives": "Ask at NYU Archives"
|
95
|
+
"ask_fales": "Ask at Fales"
|
96
|
+
"ask_reference": "Ask at Reference"
|
97
|
+
"ask_tam": "Ask at Tamiment"
|
98
|
+
"at_bindery": "At Bindery"
|
99
|
+
"on_order": "On Order"
|
100
|
+
"on_exhibit": "On Exhibit"
|
101
|
+
|
102
|
+
sources:
|
103
|
+
nyu_aleph:
|
104
|
+
base_url: "http://alephstage.library.nyu.edu"
|
105
|
+
rest_url: "http://alephstage.library.nyu.edu:1891/rest-dlf"
|
106
|
+
illiad_url: "http://illdev.library.nyu.edu"
|
107
|
+
type: aleph
|
108
|
+
class_name: NYUAleph
|
109
|
+
local_base: "PRIMOCOMMON"
|
110
|
+
"866$l_mappings":
|
111
|
+
Bobst:
|
112
|
+
sub_library: BOBST
|
113
|
+
collection: MAIN
|
114
|
+
NYHistSoc:
|
115
|
+
sub_library: NYHS
|
116
|
+
collection: MAIN
|
117
|
+
Bobst Microform:
|
118
|
+
sub_library: BOBST
|
119
|
+
collection: MFORM
|
120
|
+
Bobst Tamiment:
|
121
|
+
sub_library: BTAM
|
122
|
+
collection: TAM
|
123
|
+
Bobst REF6:
|
124
|
+
sub_library: BREF6
|
125
|
+
collection: RF6
|
126
|
+
Bobst REF6 IntlDocs:
|
127
|
+
sub_library: BREF6
|
128
|
+
collection: RF6IN
|
129
|
+
Bobst SpecCol Downtown:
|
130
|
+
sub_library: BFALE
|
131
|
+
collection: FDOWN
|
132
|
+
IFA:
|
133
|
+
sub_library: NIFA
|
134
|
+
collection: MAIN
|
135
|
+
Cooper:
|
136
|
+
sub_library: CU
|
137
|
+
collection: MAIN
|
138
|
+
Cooper Periodicals:
|
139
|
+
sub_library: CU
|
140
|
+
collection: PERIO
|
141
|
+
Bobst SpecCol:
|
142
|
+
sub_library: BFALE
|
143
|
+
collection: FALES
|
144
|
+
Bobst Tamiment Microfilm:
|
145
|
+
sub_library: BTAM
|
146
|
+
collection: MAIN
|
147
|
+
Parsons:
|
148
|
+
sub_library: TNSGI
|
149
|
+
collection: MAIN
|
150
|
+
NewSchool Reference:
|
151
|
+
sub_library: TNSFO
|
152
|
+
collection: REF
|
153
|
+
NewSchool Periodicals:
|
154
|
+
sub_library: TNSFO
|
155
|
+
collection: PERIO
|
156
|
+
Bobst REF1:
|
157
|
+
sub_library: BOBST
|
158
|
+
collection: REF1
|
159
|
+
Courant:
|
160
|
+
sub_library: NCOUR
|
161
|
+
collection: MAIN
|
162
|
+
NewSchool:
|
163
|
+
sub_library: TNSFO
|
164
|
+
collection: MAIN
|
165
|
+
Courant Periodicals:
|
166
|
+
sub_library: NCOUR
|
167
|
+
collection: PERIO
|
168
|
+
RealEstate:
|
169
|
+
sub_library: NREI
|
170
|
+
collection: MAIN
|
171
|
+
ConservIFA:
|
172
|
+
sub_library: NIFAC
|
173
|
+
collection: MAIN
|
174
|
+
Bobst REF9:
|
175
|
+
sub_library: BOBST
|
176
|
+
collection: REF9
|
177
|
+
Cooper Reference:
|
178
|
+
sub_library: CU
|
179
|
+
collection: REF
|
180
|
+
Bobst Offsite:
|
181
|
+
sub_library: BOBST
|
182
|
+
collection: MAIN
|
183
|
+
NYIntDes:
|
184
|
+
sub_library: NYSID
|
185
|
+
collection: MAIN
|
186
|
+
Cooper Mezzanine:
|
187
|
+
sub_library: CU
|
188
|
+
collection: MEZZ
|
189
|
+
NYHistSoc Bella C. Landauer Collection of Business and Advertising Ephemera.:
|
190
|
+
sub_library: NYHS
|
191
|
+
collection: LANDA
|
192
|
+
Bobst Tamiment Microform:
|
193
|
+
sub_library: BTAM
|
194
|
+
collection: MAIN
|
195
|
+
Bobst Ref6:
|
196
|
+
sub_library: BREF6
|
197
|
+
collection: RF6
|
198
|
+
Bobst Archives:
|
199
|
+
sub_library: BOBST
|
200
|
+
collection: ARCH
|
201
|
+
Bobst REF6 IntlRef:
|
202
|
+
sub_library: BREF6
|
203
|
+
collection: RF6IR
|
204
|
+
Brooklyn HistSoc Microform:
|
205
|
+
sub_library: KBHS
|
206
|
+
collection: MFORM
|
207
|
+
IFA Periodicals:
|
208
|
+
sub_library: NIFA
|
209
|
+
collection: PERIO
|
210
|
+
Parsons Reference:
|
211
|
+
sub_library: TNSGI
|
212
|
+
collection: REF
|
213
|
+
N-YHistSoc Bella C. Landauer Collection of Business and Advertising Ephemera.:
|
214
|
+
sub_library: NYHS
|
215
|
+
collection: LANDA
|
216
|
+
Mannes:
|
217
|
+
sub_library: TNSSC
|
218
|
+
collection: MAIN
|
219
|
+
Bobst REF6 Index:
|
220
|
+
sub_library: BREF6
|
221
|
+
collection: RF6I
|
222
|
+
Bobst REF6 Desk:
|
223
|
+
sub_library: BREF6
|
224
|
+
collection: RF6DR
|
225
|
+
IFA Offsite:
|
226
|
+
sub_library: NIFA
|
227
|
+
collection: OFFSI
|
228
|
+
Bobst REF6 USDocs:
|
229
|
+
sub_library: BREF6
|
230
|
+
collection: RF6US
|
231
|
+
ConservIFA Periodicals:
|
232
|
+
sub_library: NIFAC
|
233
|
+
collection: PERIO
|
234
|
+
Bobst REF6I Microform: ???
|
235
|
+
Bobst REF6 Microform: ???
|
236
|
+
Bobst REF6 Micro: ???
|
237
|
+
statuses:
|
238
|
+
available: ["On Shelf", "Available"]
|
239
|
+
requested: ["Requested"]
|
240
|
+
request_ill: ["Request ILL"]
|
241
|
+
billed_as_lost: ["Billed as Lost", "Claimed Returned"]
|
242
|
+
offsite: ["Offsite Available"]
|
243
|
+
checked_out: !ruby/regexp '/([0-9]{2}\/[0-9]{2}\/[0-9]{2})/'
|
244
|
+
unavailable: ["Unavailable"]
|
245
|
+
processing: ["In Processing", "In Transit"]
|
246
|
+
ask_afc: ["Ask at Avery Fisher Center"]
|
247
|
+
ask_archives: ["Ask at NYU Archives"]
|
248
|
+
ask_tam: ["Ask at Tamiment"]
|
249
|
+
ask_fales: ["Ask at Fales"]
|
250
|
+
ask_reference: ["Ask at Reference"]
|
251
|
+
on_exhibit: ["On Exhibit"]
|
252
|
+
#new_books: ["New Books Display", "New Books Display"]
|
253
|
+
#sorting: ["Sorting Shelves", "Sorting Shelves", "Sorting Shelves"]
|
254
|
+
#bound: "Bound"
|
255
|
+
#order_initiated: "Order initiated"
|
256
|
+
requestable_statuses: ["checked_out", "offsite", available_requestable, "Depository", "Offsite Available"]
|
257
|
+
requestable_collections: ["checked_out", "offsite", available_requestable, "Depository", "Offsite Available"]
|
258
|
+
COURSES:
|
259
|
+
base_url: "http://alephstage.library.nyu.edu"
|
260
|
+
rest_url: "http://alephstage.library.nyu.edu:1891/rest-dlf"
|
261
|
+
illiad_url: "http://illdev.library.nyu.edu"
|
262
|
+
type: aleph
|
263
|
+
class_name: NYUAleph
|
264
|
+
local_base: "PRIMOCOMMON"
|
265
|
+
ADCOURSES:
|
266
|
+
base_url: "http://alephstage.library.nyu.edu"
|
267
|
+
rest_url: "http://alephstage.library.nyu.edu:1891/rest-dlf"
|
268
|
+
illiad_url: "http://illdev.library.nyu.edu"
|
269
|
+
type: aleph
|
270
|
+
class_name: NYUAleph
|
271
|
+
local_base: "PRIMOCOMMON"
|
@@ -0,0 +1,37 @@
|
|
1
|
+
|
2
|
+
# Configure what service plugins are used by Umlaut. This skeleton file
|
3
|
+
# has been generated into your app to help you get started.
|
4
|
+
#
|
5
|
+
# If a service has "disabled:true", it's currently turned off.
|
6
|
+
#
|
7
|
+
# Some services require local api key or connection details as config.
|
8
|
+
# Most services take other options for custom configuration too, not
|
9
|
+
# all options are neccesarily listed as examples here, see source
|
10
|
+
# or source-generated docs for more info.
|
11
|
+
|
12
|
+
default:
|
13
|
+
services:
|
14
|
+
JH_SFX:
|
15
|
+
name: Find It @ JH
|
16
|
+
display_name: Find It @ JH
|
17
|
+
type: Sfx
|
18
|
+
base_url: http://sfx.library.jhu.edu:8000/sfxlcl41 #http://sfx.library.jhu.edu:8000/sfxlcl3
|
19
|
+
priority: 3
|
20
|
+
status: active
|
21
|
+
# click_passthrough: true
|
22
|
+
click_passthrough: false
|
23
|
+
sfx_requests_expire_crontab: '00 00 * * 00'
|
24
|
+
sfx_timeout: 9
|
25
|
+
# We do NOT include abstract and ToC from SFX.
|
26
|
+
services_of_interest:
|
27
|
+
getFullTxt: fulltext
|
28
|
+
getSelectedFullTxt: fulltext
|
29
|
+
getDocumentDelivery: document_delivery
|
30
|
+
getDOI: highlighted_link
|
31
|
+
extra_targets_of_interest:
|
32
|
+
LOCAL_FEEDBACK_MSE_LCL: help
|
33
|
+
LOCAL_FEEDBACK_SAIS_LCL: help
|
34
|
+
LOCAL_FEEDBACK_WELCH_LCL: help
|
35
|
+
LOCAL_FEEDBACK_AFL_LCL: help
|
36
|
+
LOCAL_FEEDBACK_APL_LCL: help
|
37
|
+
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# Just a hacky script I'm using for trying to examine performance,
|
2
|
+
# run with 'rails runner script_name'
|
3
|
+
# Couldn't get it working within test env, sorry.
|
4
|
+
|
5
|
+
params = {"genre" => "article",
|
6
|
+
"issn" => "09237534",
|
7
|
+
"title" => "Annals of Oncology",
|
8
|
+
"volume" => "23",
|
9
|
+
"issue" => "1",
|
10
|
+
"date" => "20120101",
|
11
|
+
"atitle" => "Risk for incident and fatal prostate cancer in men with a family history of any incident and fatal cancer.",
|
12
|
+
"aulast" => "Brandt, A.",
|
13
|
+
"spage" => "251",
|
14
|
+
"sid" => "EBSCO:Academic Search Complete"
|
15
|
+
}
|
16
|
+
session = {}
|
17
|
+
umlaut_request = Request.create_new_request!(:params => params, :session => session)
|
18
|
+
|
19
|
+
|
20
|
+
collection = Collection.new(umlaut_request, services)
|
21
|
+
|
22
|
+
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|