uw_catalog 0.0.2
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/lib/uw_catalog.rb +13 -0
- data/lib/uw_catalog/catalog.rb +98 -0
- data/lib/uw_catalog/data_loader.rb +22 -0
- data/lib/uw_catalog/model/bib_data.rb +16 -0
- data/lib/uw_catalog/model/holding.rb +102 -0
- data/lib/uw_catalog/model/item.rb +16 -0
- data/lib/uw_catalog/model/items_listing.rb +6 -0
- data/lib/uw_catalog/model/location.rb +36 -0
- data/lib/uw_catalog/version.rb +3 -0
- data/lib/uw_catalog/voyager_item_status.rb +49 -0
- data/lib/uw_catalog/voyager_sql.rb +80 -0
- data/uw_catalog.gemspec +43 -0
- metadata +170 -0
data/lib/uw_catalog.rb
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
require 'rubygems'
|
|
2
|
+
require 'data_mapper'
|
|
3
|
+
require 'yaml'
|
|
4
|
+
|
|
5
|
+
require 'uw_catalog/model/bib_data'
|
|
6
|
+
require 'uw_catalog/model/location'
|
|
7
|
+
require 'uw_catalog/model/holding'
|
|
8
|
+
require 'uw_catalog/model/item'
|
|
9
|
+
require 'uw_catalog/model/items_listing'
|
|
10
|
+
require 'uw_catalog/voyager_sql'
|
|
11
|
+
require 'uw_catalog/voyager_item_status'
|
|
12
|
+
require 'uw_catalog/catalog'
|
|
13
|
+
require 'uw_catalog/data_loader'
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
module UwCatalog
|
|
2
|
+
|
|
3
|
+
class UwCatalogError < RuntimeError; end
|
|
4
|
+
class UwCatalogAccessError < UwCatalogError; end
|
|
5
|
+
class UwCatalogTimeoutError < UwCatalogError; end
|
|
6
|
+
class UwCatalogNotFoundError < UwCatalogError; end
|
|
7
|
+
|
|
8
|
+
class Catalog
|
|
9
|
+
def self.get_bibliographic_data(bibid)
|
|
10
|
+
bibs = Array.new
|
|
11
|
+
begin
|
|
12
|
+
sql = VoyagerSql.get_bibliographic_sql
|
|
13
|
+
data = DataLoader.get_data(:UW, sql, bibid)
|
|
14
|
+
data.each do | d |
|
|
15
|
+
bib = BibData.new
|
|
16
|
+
DataLoader.load(d, bib)
|
|
17
|
+
bibs << bib
|
|
18
|
+
end
|
|
19
|
+
rescue => e
|
|
20
|
+
throw UwCatalogError.new("#{e.class}: #{e.message}")
|
|
21
|
+
end
|
|
22
|
+
bibs
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def self.get_item_from_hash(d)
|
|
26
|
+
item = Item.new({:id => d[:item_id], :item_enum=>d[:item_enum],
|
|
27
|
+
:copy_number=>d[:copy_number], :on_reserve=>d[:on_reserve],
|
|
28
|
+
:item_status=>d[:item_status],
|
|
29
|
+
:item_barcode=>d[:item_barcode],
|
|
30
|
+
:item_status_date=>d[:item_status_date], :current_due_date=>d[:current_due_date],
|
|
31
|
+
:hold_recall_status_date=>d[:hold_recall_status_date]})
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def self.get_availability_data_hash(bibid)
|
|
35
|
+
data_hash = Catalog.get_items_data_hash(bibid)
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def self.parse_availability_data_hash(data_hash)
|
|
39
|
+
ret = Array.new
|
|
40
|
+
data_hash.each do |d|
|
|
41
|
+
loc_id = d[:location_id]
|
|
42
|
+
location = d[:location]
|
|
43
|
+
if !d[:temp_location].nil?
|
|
44
|
+
loc_id = d[:temp_location_id]
|
|
45
|
+
location = d[:temp_location]
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
loc = Location.new({:id => loc_id, :location => location})
|
|
49
|
+
idx = ret.index(loc)
|
|
50
|
+
if (idx.nil?)
|
|
51
|
+
ret << loc
|
|
52
|
+
else
|
|
53
|
+
loc = ret.at(idx)
|
|
54
|
+
end
|
|
55
|
+
h = Holding.new({:id=>d[:holding_id], :call_number => d[:display_call_no],
|
|
56
|
+
:item_enum => d[:item_enum],
|
|
57
|
+
:perm_location_id => d[:location_id], :perm_location => d[:location]})
|
|
58
|
+
holding = loc.get_holding(h)
|
|
59
|
+
if (holding.nil?)
|
|
60
|
+
loc.add_holding(h)
|
|
61
|
+
holding = h
|
|
62
|
+
end
|
|
63
|
+
if (!d[:item_id].nil?)
|
|
64
|
+
item = get_item_from_hash(d)
|
|
65
|
+
holding.add_item(item)
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
ret
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
def self.get_availability_data(bibid)
|
|
72
|
+
ret = Array.new
|
|
73
|
+
begin
|
|
74
|
+
data_hash = get_availability_data_hash(bibid)
|
|
75
|
+
parse_availability_data_hash(data_hash)
|
|
76
|
+
rescue => e
|
|
77
|
+
throw UwCatalogError.new("#{e.class}: #{e.message}")
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
def self.get_items_data_hash(bibid)
|
|
82
|
+
data = Array.new
|
|
83
|
+
begin
|
|
84
|
+
sql = VoyagerSql.get_holdings_with_items_sql
|
|
85
|
+
data = DataLoader.get_data(:UW, sql, bibid)
|
|
86
|
+
|
|
87
|
+
sql = VoyagerSql.get_holdings_without_items_sql
|
|
88
|
+
holdings_without_items_data = DataLoader.get_data(:UW, sql, bibid)
|
|
89
|
+
data.concat(holdings_without_items_data)
|
|
90
|
+
rescue => e
|
|
91
|
+
throw UwCatalogError.new("#{e.class}: #{e.message}")
|
|
92
|
+
end
|
|
93
|
+
data
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
module UwCatalog
|
|
2
|
+
|
|
3
|
+
class DataLoader
|
|
4
|
+
|
|
5
|
+
def self.load_dynamic_object(data_struct, class_name)
|
|
6
|
+
cls = Object.const_get(class_name)
|
|
7
|
+
obj = cls.new
|
|
8
|
+
data_struct.each_pair {|key, value| obj.send("#{key}=",value) }
|
|
9
|
+
obj
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def self.load(data_struct, obj)
|
|
13
|
+
data_struct.each_pair {|key, value| obj.send("#{key}=",value) }
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def self.get_data(repository_key, sql, bibid)
|
|
17
|
+
repository(repository_key).adapter.select(sql, bibid)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
module UwCatalog
|
|
2
|
+
|
|
3
|
+
class BibData
|
|
4
|
+
attr_accessor :bibid, :title, :author, :edition, :pub_place, :publisher, :publish_date
|
|
5
|
+
|
|
6
|
+
def published_display
|
|
7
|
+
ret = ''
|
|
8
|
+
ret += edition unless edition.nil?
|
|
9
|
+
ret += pub_place unless pub_place.nil?
|
|
10
|
+
ret += publisher unless publisher.nil?
|
|
11
|
+
ret += publish_date unless publish_date.nil?
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
end
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
module UwCatalog
|
|
2
|
+
class Holding
|
|
3
|
+
@@date_format = "%B %d, %Y"
|
|
4
|
+
attr_accessor :id, :call_number, :item_enum, :perm_location_id, :perm_location, :items
|
|
5
|
+
|
|
6
|
+
def initialize(h=Hash.new)
|
|
7
|
+
@items = Array.new
|
|
8
|
+
h.each {|k,v| send("#{k}=",v)}
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def ==(another_holding)
|
|
12
|
+
self.id == another_holding.id
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def get_copies
|
|
16
|
+
if items.nil?
|
|
17
|
+
return Array.new
|
|
18
|
+
end
|
|
19
|
+
copies = items.collect {|c| c.copy_number}.uniq
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def self.get_item_rank(item)
|
|
23
|
+
status_guide = VoyagerItemStatus.status_guide(item.item_status.to_i)
|
|
24
|
+
status_guide[:rank]
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def self.override_status(item)
|
|
28
|
+
(16 == item.item_status.to_i)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def add_item(item)
|
|
32
|
+
idx = items.index(item)
|
|
33
|
+
if idx.nil?
|
|
34
|
+
items << item
|
|
35
|
+
else
|
|
36
|
+
item_in_list = items.fetch(idx)
|
|
37
|
+
if Holding.override_status(item_in_list)
|
|
38
|
+
elsif Holding.override_status(item)
|
|
39
|
+
items.delete_at(idx)
|
|
40
|
+
items << item
|
|
41
|
+
else
|
|
42
|
+
if Holding.get_item_rank(item_in_list) > Holding.get_item_rank(item)
|
|
43
|
+
items.delete_at(idx)
|
|
44
|
+
items << item
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def get_items_display(concise = false)
|
|
51
|
+
ret = Hash.new
|
|
52
|
+
return ret unless items.size > 0
|
|
53
|
+
|
|
54
|
+
status_list = Array.new
|
|
55
|
+
|
|
56
|
+
items.each do |item|
|
|
57
|
+
status_available, status_text = get_status(item)
|
|
58
|
+
status_list << {:item_id => item.id, :status_text => status_text,
|
|
59
|
+
:available => status_available, :copy_number=> item.copy_number, :item_enum => item.item_enum}
|
|
60
|
+
end
|
|
61
|
+
if (concise)
|
|
62
|
+
total_count = status_list.size
|
|
63
|
+
status_list.keep_if{|i| i[:available] == false}.compact
|
|
64
|
+
if (total_count > 0 && status_list.size == 0)
|
|
65
|
+
status_list << {:status_text => 'Available', :available => true}
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
status_list.sort! {|a,b| a[:item_enum].to_s <=> b[:item_enum].to_s} unless status_list.size < 1
|
|
70
|
+
ret[:status] = status_list
|
|
71
|
+
ret
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
def get_status(item)
|
|
75
|
+
status_guide = VoyagerItemStatus.status_guide(item.item_status.to_i)
|
|
76
|
+
status_available = status_guide[:available]
|
|
77
|
+
status_text = status_guide[:forward_status]
|
|
78
|
+
ret = status_text
|
|
79
|
+
status_date = nil
|
|
80
|
+
if status_guide[:display_date]
|
|
81
|
+
case item.item_status.to_i
|
|
82
|
+
when 2, 3
|
|
83
|
+
status_date = item.current_due_date.strftime(@@date_format) unless item.current_due_date.nil?
|
|
84
|
+
if (!item.item_enum.nil?)
|
|
85
|
+
status_text = "#{item.item_enum} Not Available - #{status_text}, Due on #{status_date}"
|
|
86
|
+
else
|
|
87
|
+
status_text = "Not Available - #{status_text}, Due on #{status_date}."
|
|
88
|
+
end
|
|
89
|
+
else
|
|
90
|
+
status_date = item.item_status_date.strftime(@@date_format) unless item.item_status_date.nil?
|
|
91
|
+
if (!item.item_enum.nil?)
|
|
92
|
+
status_text = "#{item.item_enum} Not Available - #{status_text} #{status_date}"
|
|
93
|
+
else
|
|
94
|
+
status_text = "#{status_text} #{status_date}."
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
return [status_available, status_text]
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
end
|
|
102
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
module UwCatalog
|
|
2
|
+
class Item
|
|
3
|
+
attr_accessor :id, :item_enum, :copy_number, :on_reserve, :item_status,
|
|
4
|
+
:item_barcode,
|
|
5
|
+
:item_status_date, :current_due_date, :hold_recall_status_date
|
|
6
|
+
|
|
7
|
+
def initialize(h=Hash.new)
|
|
8
|
+
h.each {|k,v| send("#{k}=",v)}
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def ==(another_item)
|
|
12
|
+
self.id == another_item.id
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
module UwCatalog
|
|
2
|
+
class Location
|
|
3
|
+
|
|
4
|
+
attr_accessor :id, :location, :holdings
|
|
5
|
+
|
|
6
|
+
def initialize(h=Hash.new)
|
|
7
|
+
@holdings = Array.new
|
|
8
|
+
h.each {|k,v| send("#{k}=",v)}
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def ==(another_loc)
|
|
12
|
+
self.id == another_loc.id
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def display_location
|
|
16
|
+
location
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def add_holding(holding)
|
|
20
|
+
idx = @holdings.index(holding)
|
|
21
|
+
if idx.nil?
|
|
22
|
+
holdings << holding
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def get_holding(holding)
|
|
27
|
+
idx = @holdings.index(holding)
|
|
28
|
+
if idx.nil?
|
|
29
|
+
nil
|
|
30
|
+
else
|
|
31
|
+
@holdings.at(idx)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
module UwCatalog
|
|
2
|
+
class VoyagerItemStatus
|
|
3
|
+
@@item_statuses =
|
|
4
|
+
{
|
|
5
|
+
0 => { :voyager_identifer => 0, :available => false, :forward_status => "Unknown", :display_date => false, :rank => 25 },
|
|
6
|
+
1 => { :voyager_identifer => 1, :available => true, :forward_status => "Available", :display_date => false, :rank => 20 },
|
|
7
|
+
2 => { :voyager_identifer => 2, :available => false, :forward_status => "Checked Out", :display_date => true, :rank => 7 },
|
|
8
|
+
3 => { :voyager_identifer => 3, :available => false, :forward_status => "Checked Out", :display_date => true, :rank => 8 },
|
|
9
|
+
4 => { :voyager_identifer => 4, :available => false, :forward_status => "Overdue", :display_date => true, :rank => 9 },
|
|
10
|
+
5 => { :voyager_identifer => 5, :available => false, :forward_status => "Recalled", :display_date => true, :rank => 14 },
|
|
11
|
+
6 => { :voyager_identifer => 6, :available => false, :forward_status => "Requested", :display_date => true, :rank => 15 },
|
|
12
|
+
7 => { :voyager_identifer => 7, :available => false, :forward_status => "On Hold", :display_date => true, :rank => 10 },
|
|
13
|
+
8 => { :voyager_identifer => 8, :available => false, :forward_status => "In Transit", :display_date => true, :rank => 11 },
|
|
14
|
+
9 => { :voyager_identifer => 9, :available => false, :forward_status => "In Transit", :display_date => true, :rank => 12 },
|
|
15
|
+
10 => { :voyager_identifer => 10, :available => false, :forward_status => "In Transit", :display_date => true, :rank => 13 },
|
|
16
|
+
11 => { :voyager_identifer => 11, :available => true, :forward_status => "Available", :display_date => false, :rank => 19 },
|
|
17
|
+
12 => { :voyager_identifer => 12, :available => false, :forward_status => "Missing", :display_date => true, :rank => 5 },
|
|
18
|
+
13 => { :voyager_identifer => 13, :available => false, :forward_status => "Lost", :display_date => true, :rank => 4 },
|
|
19
|
+
14 => { :voyager_identifer => 14, :available => false, :forward_status => "Lost", :display_date => true, :rank => 3 },
|
|
20
|
+
15 => { :voyager_identifer => 15, :available => false, :forward_status => "Missing", :display_date => true, :rank => 23 },
|
|
21
|
+
16 => { :voyager_identifer => 16, :available => false, :forward_status => "Damaged", :display_date => true, :rank => 24 },
|
|
22
|
+
17 => { :voyager_identifer => 17, :available => false, :forward_status => "Withdrawn", :display_date => true, :rank => 25 },
|
|
23
|
+
18 => { :voyager_identifer => 18, :available => false, :forward_status => "At Bindery", :display_date => true, :rank => 6 },
|
|
24
|
+
19 => { :voyager_identifer => 19, :available => true, :forward_status => "Needed By Circulation Staff", :display_date => false, :rank => 21 },
|
|
25
|
+
20 => { :voyager_identifer => 20, :available => true, :forward_status => "Needed By Cataloging Staff", :display_date => false, :rank => 22 },
|
|
26
|
+
21 => { :voyager_identifer => 21, :available => false, :forward_status => "Scheduled", :display_date => true, :rank => 1 },
|
|
27
|
+
22 => { :voyager_identifer => 22, :available => false, :forward_status => "In Process", :display_date => true, :rank => 2 },
|
|
28
|
+
23 => { :voyager_identifer => 23, :available => false, :forward_status => "Requested", :display_date => true, :rank => 18 },
|
|
29
|
+
24 => { :voyager_identifer => 24, :available => false, :forward_status => "Requested", :display_date => true, :rank => 16 },
|
|
30
|
+
25 => { :voyager_identifer => 25, :available => false, :forward_status => "Requested", :display_date => true, :rank => 17 }
|
|
31
|
+
}
|
|
32
|
+
def self.status_guide(status_code)
|
|
33
|
+
@@item_statuses[status_code]
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def available?(itemStatusCode)
|
|
37
|
+
item_statuses[itemStatusCode][:available]
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def forward_status
|
|
41
|
+
item_statuses[itemStatusCode][:forward_status]
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def display_date?
|
|
45
|
+
item_statuses[itemStatusCode][:display_date]
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
end
|
|
49
|
+
end
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
module UwCatalog
|
|
2
|
+
|
|
3
|
+
class VoyagerSql
|
|
4
|
+
|
|
5
|
+
def self.get_bibliographic_sql()
|
|
6
|
+
"select distinct bib_text.bib_id as bibid, bib_text.author as author, bib_text.title_brief as title, " +
|
|
7
|
+
"bib_text.edition, bib_text.pub_place, bib_text.publisher as publisher, bib_text.publisher_date as publish_date " +
|
|
8
|
+
"from bib_text, bib_mfhd, mfhd_master, location " +
|
|
9
|
+
"where bib_text.bib_id=? " +
|
|
10
|
+
"and bib_text.bib_id=bib_mfhd.bib_id " +
|
|
11
|
+
"and bib_mfhd.mfhd_id=mfhd_master.mfhd_id " +
|
|
12
|
+
"and mfhd_master.location_id=location.location_id " +
|
|
13
|
+
"and location.suppress_in_opac='N'"
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def self.get_holdings_with_items_sql()
|
|
17
|
+
"select distinct mfhd_master.mfhd_id as holding_id," +
|
|
18
|
+
"mfhd_master.location_id, " +
|
|
19
|
+
"hloc.location_display_name as location," +
|
|
20
|
+
"item.temp_location as temp_location_id," +
|
|
21
|
+
"iloc.location_display_name as temp_location," +
|
|
22
|
+
"mfhd_master.display_call_no," +
|
|
23
|
+
"mfhd_item.item_enum," +
|
|
24
|
+
"item.item_id, " +
|
|
25
|
+
"item.copy_number," +
|
|
26
|
+
"item.on_reserve, " +
|
|
27
|
+
"item.item_type_id," +
|
|
28
|
+
"item_barcode.item_barcode, " +
|
|
29
|
+
"item_status.item_status, " +
|
|
30
|
+
"item_status.item_status_date," +
|
|
31
|
+
"circ_transactions.current_due_date, " +
|
|
32
|
+
"hold_recall_items.hold_recall_status_date " +
|
|
33
|
+
"from bib_mfhd, mfhd_master, location hloc, location iloc, mfhd_item, item, item_status, item_barcode " +
|
|
34
|
+
", circ_transactions, hold_recall_items " +
|
|
35
|
+
"where bib_mfhd.bib_id=? " +
|
|
36
|
+
"and bib_mfhd.mfhd_id=mfhd_master.mfhd_id " +
|
|
37
|
+
"and mfhd_master.location_id=hloc.location_id " +
|
|
38
|
+
"and mfhd_master.suppress_in_opac='N' " +
|
|
39
|
+
"and hloc.suppress_in_opac='N' " +
|
|
40
|
+
"and mfhd_master.mfhd_id=mfhd_item.mfhd_id " +
|
|
41
|
+
"and mfhd_item.item_id=item.item_id " +
|
|
42
|
+
"and item.temp_location=iloc.location_id (+) " +
|
|
43
|
+
"and item.item_id=item_status.item_id " +
|
|
44
|
+
"and item.item_id=item_barcode.item_id " +
|
|
45
|
+
"and item_barcode.barcode_status=1 " +
|
|
46
|
+
"and item.item_id=circ_transactions.item_id (+) " +
|
|
47
|
+
"and item.item_id=hold_recall_items.item_id (+) "
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def self.get_holdings_without_items_sql()
|
|
51
|
+
"select distinct mfhd_master.mfhd_id as holding_id," +
|
|
52
|
+
"mfhd_master.location_id, " +
|
|
53
|
+
"location.location_display_name as location," +
|
|
54
|
+
"null as temp_location_id," +
|
|
55
|
+
"null as temp_location," +
|
|
56
|
+
"mfhd_master.display_call_no," +
|
|
57
|
+
"null as item_enum, " +
|
|
58
|
+
"null as item_id, " +
|
|
59
|
+
"null as copy_number, " +
|
|
60
|
+
"null as perm_location, " +
|
|
61
|
+
"null as temp_location, " +
|
|
62
|
+
"null as on_reserve, " +
|
|
63
|
+
"null as item_type_id," +
|
|
64
|
+
"null as item_barcode, " +
|
|
65
|
+
"null as item_status, " +
|
|
66
|
+
"null as item_sequence_number," +
|
|
67
|
+
"null as item_status_date," +
|
|
68
|
+
"null as current_due_date, " +
|
|
69
|
+
"null as hold_recall_status_date " +
|
|
70
|
+
"from bib_mfhd, mfhd_master, location " +
|
|
71
|
+
"where bib_mfhd.bib_id=? " +
|
|
72
|
+
"and bib_mfhd.mfhd_id=mfhd_master.mfhd_id " +
|
|
73
|
+
"and mfhd_master.location_id=location.location_id " +
|
|
74
|
+
"and mfhd_master.suppress_in_opac='N' " +
|
|
75
|
+
"and location.suppress_in_opac='N' " +
|
|
76
|
+
"and not exists (select 'x' from mfhd_item mi where mi.mfhd_id = mfhd_master.mfhd_id)"
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
end
|
|
80
|
+
end
|
data/uw_catalog.gemspec
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
lib = File.expand_path('../lib', __FILE__)
|
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
3
|
+
require 'uw_catalog/version'
|
|
4
|
+
|
|
5
|
+
Gem::Specification.new do |gem|
|
|
6
|
+
gem.name = "uw_catalog"
|
|
7
|
+
gem.version = UwCatalog::VERSION
|
|
8
|
+
gem.authors = ["Ev Krylova"]
|
|
9
|
+
gem.email = ["ekrylova@wisc.edu"]
|
|
10
|
+
gem.description = %q{Gem for the University of Wisconsin Library Voyager catalog data}
|
|
11
|
+
gem.summary = %q{Use UW-Madison Voyager catalog data}
|
|
12
|
+
gem.homepage = "https://github.com/ekrylova/uw_catalog"
|
|
13
|
+
|
|
14
|
+
gem.add_dependency('data_mapper', '~>1.2.0')
|
|
15
|
+
|
|
16
|
+
gem.files = `git ls-files`.split($/)
|
|
17
|
+
gem.files = [
|
|
18
|
+
# "Gemfile",
|
|
19
|
+
# "Rakefile",
|
|
20
|
+
"uw_catalog.gemspec",
|
|
21
|
+
"lib/uw_catalog.rb",
|
|
22
|
+
"lib/uw_catalog/model/location.rb",
|
|
23
|
+
"lib/uw_catalog/model/holding.rb",
|
|
24
|
+
"lib/uw_catalog/model/bib_data.rb",
|
|
25
|
+
"lib/uw_catalog/model/item.rb",
|
|
26
|
+
"lib/uw_catalog/model/items_listing.rb",
|
|
27
|
+
"lib/uw_catalog/version.rb",
|
|
28
|
+
"lib/uw_catalog/catalog.rb",
|
|
29
|
+
"lib/uw_catalog/data_loader.rb",
|
|
30
|
+
"lib/uw_catalog/voyager_item_status.rb",
|
|
31
|
+
"lib/uw_catalog/voyager_sql.rb"
|
|
32
|
+
]
|
|
33
|
+
gem.require_paths = ["lib"]
|
|
34
|
+
|
|
35
|
+
gem.add_development_dependency 'rake'
|
|
36
|
+
gem.add_development_dependency 'rspec'
|
|
37
|
+
gem.add_development_dependency 'yard'
|
|
38
|
+
|
|
39
|
+
gem.add_dependency('data_mapper', '~> 1.2.0')
|
|
40
|
+
gem.add_dependency('dm-oracle-adapter', '~> 1.2.0')
|
|
41
|
+
gem.add_dependency('ruby-oci8', '~> 2.1.3')
|
|
42
|
+
|
|
43
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: uw_catalog
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.0.2
|
|
5
|
+
prerelease:
|
|
6
|
+
platform: ruby
|
|
7
|
+
authors:
|
|
8
|
+
- Ev Krylova
|
|
9
|
+
autorequire:
|
|
10
|
+
bindir: bin
|
|
11
|
+
cert_chain: []
|
|
12
|
+
date: 2013-07-06 00:00:00.000000000 Z
|
|
13
|
+
dependencies:
|
|
14
|
+
- !ruby/object:Gem::Dependency
|
|
15
|
+
name: data_mapper
|
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
|
17
|
+
none: false
|
|
18
|
+
requirements:
|
|
19
|
+
- - ~>
|
|
20
|
+
- !ruby/object:Gem::Version
|
|
21
|
+
version: 1.2.0
|
|
22
|
+
type: :runtime
|
|
23
|
+
prerelease: false
|
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
25
|
+
none: false
|
|
26
|
+
requirements:
|
|
27
|
+
- - ~>
|
|
28
|
+
- !ruby/object:Gem::Version
|
|
29
|
+
version: 1.2.0
|
|
30
|
+
- !ruby/object:Gem::Dependency
|
|
31
|
+
name: rake
|
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
|
33
|
+
none: false
|
|
34
|
+
requirements:
|
|
35
|
+
- - ! '>='
|
|
36
|
+
- !ruby/object:Gem::Version
|
|
37
|
+
version: '0'
|
|
38
|
+
type: :development
|
|
39
|
+
prerelease: false
|
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
41
|
+
none: false
|
|
42
|
+
requirements:
|
|
43
|
+
- - ! '>='
|
|
44
|
+
- !ruby/object:Gem::Version
|
|
45
|
+
version: '0'
|
|
46
|
+
- !ruby/object:Gem::Dependency
|
|
47
|
+
name: rspec
|
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
|
49
|
+
none: false
|
|
50
|
+
requirements:
|
|
51
|
+
- - ! '>='
|
|
52
|
+
- !ruby/object:Gem::Version
|
|
53
|
+
version: '0'
|
|
54
|
+
type: :development
|
|
55
|
+
prerelease: false
|
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
57
|
+
none: false
|
|
58
|
+
requirements:
|
|
59
|
+
- - ! '>='
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
version: '0'
|
|
62
|
+
- !ruby/object:Gem::Dependency
|
|
63
|
+
name: yard
|
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
|
65
|
+
none: false
|
|
66
|
+
requirements:
|
|
67
|
+
- - ! '>='
|
|
68
|
+
- !ruby/object:Gem::Version
|
|
69
|
+
version: '0'
|
|
70
|
+
type: :development
|
|
71
|
+
prerelease: false
|
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
73
|
+
none: false
|
|
74
|
+
requirements:
|
|
75
|
+
- - ! '>='
|
|
76
|
+
- !ruby/object:Gem::Version
|
|
77
|
+
version: '0'
|
|
78
|
+
- !ruby/object:Gem::Dependency
|
|
79
|
+
name: data_mapper
|
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
|
81
|
+
none: false
|
|
82
|
+
requirements:
|
|
83
|
+
- - ~>
|
|
84
|
+
- !ruby/object:Gem::Version
|
|
85
|
+
version: 1.2.0
|
|
86
|
+
type: :runtime
|
|
87
|
+
prerelease: false
|
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
89
|
+
none: false
|
|
90
|
+
requirements:
|
|
91
|
+
- - ~>
|
|
92
|
+
- !ruby/object:Gem::Version
|
|
93
|
+
version: 1.2.0
|
|
94
|
+
- !ruby/object:Gem::Dependency
|
|
95
|
+
name: dm-oracle-adapter
|
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
|
97
|
+
none: false
|
|
98
|
+
requirements:
|
|
99
|
+
- - ~>
|
|
100
|
+
- !ruby/object:Gem::Version
|
|
101
|
+
version: 1.2.0
|
|
102
|
+
type: :runtime
|
|
103
|
+
prerelease: false
|
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
105
|
+
none: false
|
|
106
|
+
requirements:
|
|
107
|
+
- - ~>
|
|
108
|
+
- !ruby/object:Gem::Version
|
|
109
|
+
version: 1.2.0
|
|
110
|
+
- !ruby/object:Gem::Dependency
|
|
111
|
+
name: ruby-oci8
|
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
|
113
|
+
none: false
|
|
114
|
+
requirements:
|
|
115
|
+
- - ~>
|
|
116
|
+
- !ruby/object:Gem::Version
|
|
117
|
+
version: 2.1.3
|
|
118
|
+
type: :runtime
|
|
119
|
+
prerelease: false
|
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
121
|
+
none: false
|
|
122
|
+
requirements:
|
|
123
|
+
- - ~>
|
|
124
|
+
- !ruby/object:Gem::Version
|
|
125
|
+
version: 2.1.3
|
|
126
|
+
description: Gem for the University of Wisconsin Library Voyager catalog data
|
|
127
|
+
email:
|
|
128
|
+
- ekrylova@wisc.edu
|
|
129
|
+
executables: []
|
|
130
|
+
extensions: []
|
|
131
|
+
extra_rdoc_files: []
|
|
132
|
+
files:
|
|
133
|
+
- uw_catalog.gemspec
|
|
134
|
+
- lib/uw_catalog.rb
|
|
135
|
+
- lib/uw_catalog/model/location.rb
|
|
136
|
+
- lib/uw_catalog/model/holding.rb
|
|
137
|
+
- lib/uw_catalog/model/bib_data.rb
|
|
138
|
+
- lib/uw_catalog/model/item.rb
|
|
139
|
+
- lib/uw_catalog/model/items_listing.rb
|
|
140
|
+
- lib/uw_catalog/version.rb
|
|
141
|
+
- lib/uw_catalog/catalog.rb
|
|
142
|
+
- lib/uw_catalog/data_loader.rb
|
|
143
|
+
- lib/uw_catalog/voyager_item_status.rb
|
|
144
|
+
- lib/uw_catalog/voyager_sql.rb
|
|
145
|
+
homepage: https://github.com/ekrylova/uw_catalog
|
|
146
|
+
licenses: []
|
|
147
|
+
post_install_message:
|
|
148
|
+
rdoc_options: []
|
|
149
|
+
require_paths:
|
|
150
|
+
- lib
|
|
151
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
152
|
+
none: false
|
|
153
|
+
requirements:
|
|
154
|
+
- - ! '>='
|
|
155
|
+
- !ruby/object:Gem::Version
|
|
156
|
+
version: '0'
|
|
157
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
158
|
+
none: false
|
|
159
|
+
requirements:
|
|
160
|
+
- - ! '>='
|
|
161
|
+
- !ruby/object:Gem::Version
|
|
162
|
+
version: '0'
|
|
163
|
+
requirements: []
|
|
164
|
+
rubyforge_project:
|
|
165
|
+
rubygems_version: 1.8.23
|
|
166
|
+
signing_key:
|
|
167
|
+
specification_version: 3
|
|
168
|
+
summary: Use UW-Madison Voyager catalog data
|
|
169
|
+
test_files: []
|
|
170
|
+
has_rdoc:
|