exlibris-aleph 1.1.0 → 2.0.0

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.
Files changed (268) hide show
  1. data/README.md +199 -82
  2. data/Rakefile +8 -14
  3. data/lib/exlibris-aleph.rb +0 -3
  4. data/lib/exlibris/aleph/admin_library.rb +27 -0
  5. data/lib/exlibris/aleph/api/base.rb +27 -0
  6. data/lib/exlibris/aleph/api/client/base.rb +86 -0
  7. data/lib/exlibris/aleph/api/client/patron.rb +20 -0
  8. data/lib/exlibris/aleph/api/client/patron/address.rb +22 -0
  9. data/lib/exlibris/aleph/api/client/patron/record.rb +23 -0
  10. data/lib/exlibris/aleph/api/client/patron/record/item.rb +26 -0
  11. data/lib/exlibris/aleph/api/client/patron/record/item/create_hold.rb +31 -0
  12. data/lib/exlibris/aleph/api/client/patron/record/item/create_hold/parameters.rb +55 -0
  13. data/lib/exlibris/aleph/api/client/patron/record/item/hold.rb +29 -0
  14. data/lib/exlibris/aleph/api/client/patron/status.rb +22 -0
  15. data/lib/exlibris/aleph/api/client/record.rb +21 -0
  16. data/lib/exlibris/aleph/api/client/record/filters.rb +23 -0
  17. data/lib/exlibris/aleph/api/client/record/holding.rb +23 -0
  18. data/lib/exlibris/aleph/api/client/record/holdings.rb +23 -0
  19. data/lib/exlibris/aleph/api/client/record/item.rb +23 -0
  20. data/lib/exlibris/aleph/api/client/record/items.rb +23 -0
  21. data/lib/exlibris/aleph/api/reader/base.rb +15 -0
  22. data/lib/exlibris/aleph/api/reader/patron.rb +19 -0
  23. data/lib/exlibris/aleph/api/reader/patron/address.rb +90 -0
  24. data/lib/exlibris/aleph/api/reader/patron/record.rb +38 -0
  25. data/lib/exlibris/aleph/api/reader/patron/record/item.rb +77 -0
  26. data/lib/exlibris/aleph/api/reader/patron/record/item/create_hold.rb +33 -0
  27. data/lib/exlibris/aleph/api/reader/patron/record/item/hold.rb +56 -0
  28. data/lib/exlibris/aleph/api/reader/patron/status.rb +33 -0
  29. data/lib/exlibris/aleph/api/reader/record.rb +10 -0
  30. data/lib/exlibris/aleph/api/reader/record/item.rb +45 -0
  31. data/lib/exlibris/aleph/collection.rb +26 -0
  32. data/lib/exlibris/aleph/config.rb +17 -57
  33. data/lib/exlibris/aleph/holding.rb +59 -0
  34. data/lib/exlibris/aleph/holding/metadata.rb +28 -0
  35. data/lib/exlibris/aleph/holdings.rb +51 -0
  36. data/lib/exlibris/aleph/item.rb +138 -0
  37. data/lib/exlibris/aleph/item/call_number.rb +14 -0
  38. data/lib/exlibris/aleph/item/circulation_policy.rb +30 -0
  39. data/lib/exlibris/aleph/item/circulation_policy/display.rb +16 -0
  40. data/lib/exlibris/aleph/item/circulation_policy/identifier.rb +34 -0
  41. data/lib/exlibris/aleph/item/circulation_policy/privileges.rb +72 -0
  42. data/lib/exlibris/aleph/item/circulation_status.rb +31 -0
  43. data/lib/exlibris/aleph/item/display_mask.rb +19 -0
  44. data/lib/exlibris/aleph/item/opac_note.rb +17 -0
  45. data/lib/exlibris/aleph/item/processing_status.rb +23 -0
  46. data/lib/exlibris/aleph/item/queue.rb +32 -0
  47. data/lib/exlibris/aleph/item/status.rb +23 -0
  48. data/lib/exlibris/aleph/items.rb +51 -0
  49. data/lib/exlibris/aleph/metadata.rb +25 -0
  50. data/lib/exlibris/aleph/patron.rb +18 -82
  51. data/lib/exlibris/aleph/patron/address.rb +56 -0
  52. data/lib/exlibris/aleph/patron/circulation_policy.rb +26 -0
  53. data/lib/exlibris/aleph/patron/circulation_policy/identifier.rb +29 -0
  54. data/lib/exlibris/aleph/patron/circulation_policy/privileges.rb +56 -0
  55. data/lib/exlibris/aleph/patron/record.rb +39 -0
  56. data/lib/exlibris/aleph/patron/record/circulation_policy.rb +18 -0
  57. data/lib/exlibris/aleph/patron/record/circulation_policy/privileges.rb +42 -0
  58. data/lib/exlibris/aleph/patron/record/item.rb +63 -0
  59. data/lib/exlibris/aleph/patron/record/item/circulation_policy.rb +21 -0
  60. data/lib/exlibris/aleph/patron/record/item/circulation_policy/privileges.rb +39 -0
  61. data/lib/exlibris/aleph/patron/record/item/create_hold.rb +43 -0
  62. data/lib/exlibris/aleph/patron/record/item/hold.rb +41 -0
  63. data/lib/exlibris/aleph/patron/status.rb +19 -0
  64. data/lib/exlibris/aleph/pickup_location.rb +12 -0
  65. data/lib/exlibris/aleph/record.rb +14 -43
  66. data/lib/exlibris/aleph/record/metadata.rb +8 -0
  67. data/lib/exlibris/aleph/sub_library.rb +30 -0
  68. data/lib/exlibris/aleph/table/base.rb +22 -0
  69. data/lib/exlibris/aleph/table/collections.rb +17 -0
  70. data/lib/exlibris/aleph/table/item/circulation_policies.rb +65 -0
  71. data/lib/exlibris/aleph/table/item/display_masks.rb +19 -0
  72. data/lib/exlibris/aleph/table/patron/circulation_policies.rb +47 -0
  73. data/lib/exlibris/aleph/table/patron/statuses.rb +19 -0
  74. data/lib/exlibris/aleph/table/reader/base.rb +57 -0
  75. data/lib/exlibris/aleph/table/reader/collections.rb +35 -0
  76. data/lib/exlibris/aleph/table/reader/item_circulation_policies.rb +50 -0
  77. data/lib/exlibris/aleph/table/reader/item_display_masks.rb +19 -0
  78. data/lib/exlibris/aleph/table/reader/matcher/base.rb +30 -0
  79. data/lib/exlibris/aleph/table/reader/matcher/collections.rb +17 -0
  80. data/lib/exlibris/aleph/table/reader/matcher/item_circulation_policies.rb +17 -0
  81. data/lib/exlibris/aleph/table/reader/matcher/item_display_masks.rb +17 -0
  82. data/lib/exlibris/aleph/table/reader/matcher/patron_circulation_policies.rb +17 -0
  83. data/lib/exlibris/aleph/table/reader/matcher/patron_statuses.rb +17 -0
  84. data/lib/exlibris/aleph/table/reader/matcher/sub_libraries.rb +17 -0
  85. data/lib/exlibris/aleph/table/reader/patron_circulation_policies.rb +51 -0
  86. data/lib/exlibris/aleph/table/reader/patron_statuses.rb +19 -0
  87. data/lib/exlibris/aleph/table/reader/row/base.rb +25 -0
  88. data/lib/exlibris/aleph/table/reader/row/collections.rb +13 -0
  89. data/lib/exlibris/aleph/table/reader/row/item_circulation_policies.rb +17 -0
  90. data/lib/exlibris/aleph/table/reader/row/item_display_masks.rb +13 -0
  91. data/lib/exlibris/aleph/table/reader/row/patron_circulation_policies.rb +20 -0
  92. data/lib/exlibris/aleph/table/reader/row/patron_statuses.rb +13 -0
  93. data/lib/exlibris/aleph/table/reader/row/sub_libraries.rb +13 -0
  94. data/lib/exlibris/aleph/table/reader/sub_libraries.rb +32 -0
  95. data/lib/exlibris/aleph/table/sub_libraries.rb +11 -0
  96. data/lib/exlibris/aleph/tables_manager.rb +66 -0
  97. data/lib/exlibris/aleph/version.rb +1 -1
  98. data/spec/exlibris/aleph/admin_library_spec.rb +83 -0
  99. data/spec/exlibris/aleph/api/base_spec.rb +23 -0
  100. data/spec/exlibris/aleph/api/client/base_spec.rb +40 -0
  101. data/spec/exlibris/aleph/api/client/patron/address_spec.rb +40 -0
  102. data/spec/exlibris/aleph/api/client/patron/record/item/create_hold/parameters_spec.rb +101 -0
  103. data/spec/exlibris/aleph/api/client/patron/record/item/create_hold_spec.rb +102 -0
  104. data/spec/exlibris/aleph/api/client/patron/record/item/hold_spec.rb +89 -0
  105. data/spec/exlibris/aleph/api/client/patron/record/item_spec.rb +52 -0
  106. data/spec/exlibris/aleph/api/client/patron/record_spec.rb +45 -0
  107. data/spec/exlibris/aleph/api/client/patron/status_spec.rb +40 -0
  108. data/spec/exlibris/aleph/api/client/patron_spec.rb +38 -0
  109. data/spec/exlibris/aleph/api/client/record/filters_spec.rb +46 -0
  110. data/spec/exlibris/aleph/api/client/record/holding_spec.rb +41 -0
  111. data/spec/exlibris/aleph/api/client/record/holdings_spec.rb +46 -0
  112. data/spec/exlibris/aleph/api/client/record/item_spec.rb +41 -0
  113. data/spec/exlibris/aleph/api/client/record/items_spec.rb +46 -0
  114. data/spec/exlibris/aleph/api/client/record_spec.rb +43 -0
  115. data/spec/exlibris/aleph/api/reader/base_spec.rb +18 -0
  116. data/spec/exlibris/aleph/api/reader/patron/address_spec.rb +151 -0
  117. data/spec/exlibris/aleph/api/reader/patron/record/item/create_hold_spec.rb +65 -0
  118. data/spec/exlibris/aleph/api/reader/patron/record/item/hold_spec.rb +145 -0
  119. data/spec/exlibris/aleph/api/reader/patron/record/item_spec.rb +266 -0
  120. data/spec/exlibris/aleph/api/reader/patron/record_spec.rb +98 -0
  121. data/spec/exlibris/aleph/api/reader/patron/status_spec.rb +57 -0
  122. data/spec/exlibris/aleph/api/reader/patron_spec.rb +28 -0
  123. data/spec/exlibris/aleph/api/reader/record/item_spec.rb +178 -0
  124. data/spec/exlibris/aleph/collection_spec.rb +95 -0
  125. data/spec/exlibris/aleph/config_spec.rb +17 -0
  126. data/spec/exlibris/aleph/holding/metadata_spec.rb +57 -0
  127. data/spec/exlibris/aleph/holding_spec.rb +53 -0
  128. data/spec/exlibris/aleph/holdings_spec.rb +59 -0
  129. data/spec/exlibris/aleph/item/call_number_spec.rb +20 -0
  130. data/spec/exlibris/aleph/item/circulation_policy/display_spec.rb +33 -0
  131. data/spec/exlibris/aleph/item/circulation_policy/identifier_spec.rb +154 -0
  132. data/spec/exlibris/aleph/item/circulation_policy/privileges_spec.rb +183 -0
  133. data/spec/exlibris/aleph/item/circulation_policy_spec.rb +146 -0
  134. data/spec/exlibris/aleph/item/circulation_status_spec.rb +83 -0
  135. data/spec/exlibris/aleph/item/display_mask_spec.rb +72 -0
  136. data/spec/exlibris/aleph/item/opac_note_spec.rb +19 -0
  137. data/spec/exlibris/aleph/item/processing_status_spec.rb +75 -0
  138. data/spec/exlibris/aleph/item/queue_spec.rb +31 -0
  139. data/spec/exlibris/aleph/item/status_spec.rb +80 -0
  140. data/spec/exlibris/aleph/item_spec.rb +97 -0
  141. data/spec/exlibris/aleph/items_spec.rb +59 -0
  142. data/spec/exlibris/aleph/metadata_spec.rb +118 -0
  143. data/spec/exlibris/aleph/patron/address_spec.rb +68 -0
  144. data/spec/exlibris/aleph/patron/circulation_policy/identifier_spec.rb +115 -0
  145. data/spec/exlibris/aleph/patron/circulation_policy/privileges_spec.rb +128 -0
  146. data/spec/exlibris/aleph/patron/circulation_policy_spec.rb +119 -0
  147. data/spec/exlibris/aleph/patron/record/circulation_policy/privileges_spec.rb +88 -0
  148. data/spec/exlibris/aleph/patron/record/circulation_policy_spec.rb +37 -0
  149. data/spec/exlibris/aleph/patron/record/item/circulation_policy/privileges_spec.rb +76 -0
  150. data/spec/exlibris/aleph/patron/record/item/circulation_policy_spec.rb +52 -0
  151. data/spec/exlibris/aleph/patron/record/item/create_hold_spec.rb +49 -0
  152. data/spec/exlibris/aleph/patron/record/item/hold_spec.rb +41 -0
  153. data/spec/exlibris/aleph/patron/record/item_spec.rb +64 -0
  154. data/spec/exlibris/aleph/patron/record_spec.rb +30 -0
  155. data/spec/exlibris/aleph/patron/status_spec.rb +72 -0
  156. data/spec/exlibris/aleph/patron_spec.rb +28 -0
  157. data/spec/exlibris/aleph/pickup_location_spec.rb +19 -0
  158. data/spec/exlibris/aleph/record/metadata_spec.rb +120 -0
  159. data/spec/exlibris/aleph/record_spec.rb +44 -0
  160. data/spec/exlibris/aleph/sub_library_spec.rb +110 -0
  161. data/spec/exlibris/aleph/table/base_spec.rb +17 -0
  162. data/spec/exlibris/aleph/table/collections_spec.rb +24 -0
  163. data/spec/exlibris/aleph/table/item/circulation_policies_spec.rb +65 -0
  164. data/spec/exlibris/aleph/table/item/display_masks_spec.rb +26 -0
  165. data/spec/exlibris/aleph/table/patron/circulation_policies_spec.rb +47 -0
  166. data/spec/exlibris/aleph/table/patron/statuses_spec.rb +26 -0
  167. data/spec/exlibris/aleph/table/reader/base_spec.rb +28 -0
  168. data/spec/exlibris/aleph/table/reader/collections_spec.rb +33 -0
  169. data/spec/exlibris/aleph/table/reader/item_circulation_policies_spec.rb +33 -0
  170. data/spec/exlibris/aleph/table/reader/item_display_masks_spec.rb +27 -0
  171. data/spec/exlibris/aleph/table/reader/matcher/base_spec.rb +32 -0
  172. data/spec/exlibris/aleph/table/reader/matcher/collections_spec.rb +39 -0
  173. data/spec/exlibris/aleph/table/reader/matcher/item_circulation_policies_spec.rb +39 -0
  174. data/spec/exlibris/aleph/table/reader/matcher/item_display_masks_spec.rb +40 -0
  175. data/spec/exlibris/aleph/table/reader/matcher/patron_circulation_policies_spec.rb +40 -0
  176. data/spec/exlibris/aleph/table/reader/matcher/patron_statuses_spec.rb +40 -0
  177. data/spec/exlibris/aleph/table/reader/matcher/sub_libraries_spec.rb +40 -0
  178. data/spec/exlibris/aleph/table/reader/patron_circulation_policies_spec.rb +27 -0
  179. data/spec/exlibris/aleph/table/reader/patron_statuses_spec.rb +27 -0
  180. data/spec/exlibris/aleph/table/reader/row/base_spec.rb +20 -0
  181. data/spec/exlibris/aleph/table/reader/row/collections_spec.rb +37 -0
  182. data/spec/exlibris/aleph/table/reader/row/item_circulation_policies_spec.rb +89 -0
  183. data/spec/exlibris/aleph/table/reader/row/item_display_masks_spec.rb +29 -0
  184. data/spec/exlibris/aleph/table/reader/row/patron_circulation_policies_spec.rb +115 -0
  185. data/spec/exlibris/aleph/table/reader/row/patron_statuses_spec.rb +29 -0
  186. data/spec/exlibris/aleph/table/reader/row/sub_libraries_spec.rb +41 -0
  187. data/spec/exlibris/aleph/table/reader/sub_libraries_spec.rb +36 -0
  188. data/spec/exlibris/aleph/table/sub_libraries_spec.rb +19 -0
  189. data/spec/exlibris/aleph/tables_manager_spec.rb +120 -0
  190. data/spec/exlibris/aleph_spec.rb +5 -0
  191. data/spec/spec_helper.rb +27 -0
  192. data/spec/support/mnt/aleph_tab/adm50/tab/filename +0 -0
  193. data/{test → spec/support}/mnt/aleph_tab/alephe/tab/tab_sub_library.eng +0 -0
  194. data/{test → spec/support}/mnt/aleph_tab/nyu50/tab/pc_tab_exp_field_extended.eng +0 -0
  195. data/{test/mnt/aleph_tab → spec/support/mnt/aleph_tab/nyu50/tab}/tab15.eng +2 -0
  196. data/{test → spec/support}/mnt/aleph_tab/nyu50/tab/tab16 +0 -0
  197. data/{test → spec/support}/mnt/aleph_tab/nyu50/tab/tab31 +0 -0
  198. data/{test → spec/support}/mnt/aleph_tab/nyu50/tab/tab37 +0 -0
  199. data/{test → spec/support}/mnt/aleph_tab/nyu50/tab/tab40.eng +0 -0
  200. data/{test → spec/support}/mnt/aleph_tab/nyu50/tab/tab_www_item_desc.eng +0 -0
  201. data/{test → spec/support}/mnt/aleph_tab/nyu51/tab/pc_tab_exp_field_extended.eng +0 -0
  202. data/{test → spec/support}/mnt/aleph_tab/nyu51/tab/tab15.eng +0 -0
  203. data/{test → spec/support}/mnt/aleph_tab/nyu51/tab/tab16 +0 -0
  204. data/{test → spec/support}/mnt/aleph_tab/nyu51/tab/tab31 +0 -0
  205. data/{test → spec/support}/mnt/aleph_tab/nyu51/tab/tab37 +0 -0
  206. data/{test → spec/support}/mnt/aleph_tab/nyu51/tab/tab40.eng +0 -0
  207. data/{test → spec/support}/mnt/aleph_tab/nyu51/tab/tab_www_item_desc.eng +0 -0
  208. data/spec/vcr_cassettes/patron.yml +1443 -0
  209. data/spec/vcr_cassettes/record.yml +763 -0
  210. metadata +351 -165
  211. data/lib/exlibris/aleph/abstract.rb +0 -28
  212. data/lib/exlibris/aleph/rest/base.rb +0 -56
  213. data/lib/exlibris/aleph/tab_helper.rb +0 -303
  214. data/lib/exlibris/aleph/tabs_parser/base.rb +0 -49
  215. data/lib/exlibris/aleph/tabs_parser/pc_tab_exp_field_extended.rb +0 -20
  216. data/lib/exlibris/aleph/tabs_parser/sub_library.rb +0 -32
  217. data/lib/exlibris/aleph/tabs_parser/tab15_by_item_process_status.rb +0 -33
  218. data/lib/exlibris/aleph/tabs_parser/tab15_by_item_status.rb +0 -33
  219. data/lib/exlibris/aleph/tabs_parser/tab31.rb +0 -39
  220. data/lib/exlibris/aleph/tabs_parser/tab37.rb +0 -63
  221. data/lib/exlibris/aleph/tabs_parser/tab40.rb +0 -20
  222. data/lib/exlibris/aleph/tabs_parser/tab_sub_library.rb +0 -21
  223. data/lib/exlibris/aleph/tabs_parser/tab_www_item_desc.rb +0 -20
  224. data/lib/exlibris/aleph/task_installer.rb +0 -25
  225. data/lib/exlibris/aleph/write_attributes.rb +0 -38
  226. data/lib/exlibris/aleph/xml_util.rb +0 -50
  227. data/lib/exlibris/aleph/xservice/bor_auth.rb +0 -47
  228. data/lib/tasks/exlibris-aleph_tasks.rake +0 -48
  229. data/test/config/aleph/alephe/sub_libraries.yml +0 -801
  230. data/test/config/aleph/nyu50/collections.yml +0 -1168
  231. data/test/config/aleph/nyu50/item_permissions_by_item_process_status.yml +0 -61876
  232. data/test/config/aleph/nyu50/item_permissions_by_item_status.yml +0 -17319
  233. data/test/config/aleph/nyu50/items.yml +0 -617
  234. data/test/config/aleph/nyu50/patron_permissions.yml +0 -19720
  235. data/test/config/aleph/nyu50/patrons.yml +0 -249
  236. data/test/config/aleph/nyu50/pickup_locations.yml +0 -2910
  237. data/test/config/aleph/nyu51/collections.yml +0 -41
  238. data/test/config/aleph/nyu51/item_permissions_by_item_process_status.yml +0 -7689
  239. data/test/config/aleph/nyu51/item_permissions_by_item_status.yml +0 -430
  240. data/test/config/aleph/nyu51/items.yml +0 -617
  241. data/test/config/aleph/nyu51/patron_permissions.yml +0 -6588
  242. data/test/config/aleph/nyu51/patrons.yml +0 -237
  243. data/test/config/aleph/nyu51/pickup_locations.yml +0 -456
  244. data/test/config_test.rb +0 -24
  245. data/test/exlibris-aleph_test.rb +0 -7
  246. data/test/mnt/aleph_tab/nyu50/tab/tab15.eng +0 -4742
  247. data/test/mnt/aleph_tab/pc_tab_exp_field_extended.eng +0 -158
  248. data/test/mnt/aleph_tab/tab16 +0 -3792
  249. data/test/mnt/aleph_tab/tab31 +0 -998
  250. data/test/mnt/aleph_tab/tab37 +0 -405
  251. data/test/mnt/aleph_tab/tab40.eng +0 -335
  252. data/test/mnt/aleph_tab/tab_sub_library.eng +0 -378
  253. data/test/mnt/aleph_tab/tab_www_item_desc.eng +0 -208
  254. data/test/patron_test.rb +0 -98
  255. data/test/record_benchmarks.rb +0 -26
  256. data/test/record_test.rb +0 -64
  257. data/test/support/config.yml +0 -2
  258. data/test/tab_helper_benchmarks.rb +0 -53
  259. data/test/tab_helper_test.rb +0 -192
  260. data/test/test_helper.rb +0 -46
  261. data/test/vcr_cassettes/bor_auth.yml +0 -42
  262. data/test/vcr_cassettes/patron.yml +0 -142
  263. data/test/vcr_cassettes/patron_address.yml +0 -45
  264. data/test/vcr_cassettes/patron_bogus_url.yml +0 -731
  265. data/test/vcr_cassettes/patron_error.yml +0 -93
  266. data/test/vcr_cassettes/record.yml +0 -146
  267. data/test/vcr_cassettes/record_bogus_url.yml +0 -690
  268. data/test/xservice/bor_auth_test.rb +0 -28
@@ -1,32 +0,0 @@
1
- module Exlibris
2
- module Aleph
3
- module TabParser
4
- class SubLibrary < Exlibris::Aleph::TabParser::Base
5
- def initialize(args)
6
- super(args)
7
- @aleph_sub_library_key = :sub_library
8
- end
9
-
10
- def to_h
11
- a = self.to_a
12
- @config_hash = {}
13
- sl_a = a.collect do |i|
14
- i[@aleph_sub_library_key]
15
- end
16
- sl_a.uniq!
17
- sl_a.each do |sl|
18
- sl_hash = {}
19
- a.each do |i|
20
- isl = i[@aleph_sub_library_key]
21
- if isl.strip == sl.strip
22
- sl_hash[i[@hash_key]] = i
23
- end
24
- end
25
- @config_hash["#{sl}"] = sl_hash
26
- end
27
- return @config_hash
28
- end
29
- end
30
- end
31
- end
32
- end
@@ -1,33 +0,0 @@
1
- module Exlibris
2
- module Aleph
3
- module TabParser
4
- class Tab15ByItemProcessStatus < Exlibris::Aleph::TabParser::SubLibrary
5
-
6
- def initialize(args)
7
- args[:aleph_file_name] = "tab15.eng"
8
- args[:pattern] = /^(.{5})\s([0-9#]{2})\s([A-Z#]{2})\s(L)\s(.{30})\s([YN])\s([YN])\s([YNCT])\s([YN])\s([YN])\s([YN])\s([YN])\s([YN])\s([YN])\s([0-9]{2})\s([YNC])\s([AOC])/
9
- args[:pattern_key] = {
10
- 1 => :sub_library,
11
- 2 => :item_status,
12
- 3 => :item_process_status,
13
- 5 => :text,
14
- 6 => :loan,
15
- 7 => :renew,
16
- 8 => :hold_request,
17
- 9 => :photocopy_request,
18
- 10 => :web_opac,
19
- 11 => :specific_item,
20
- 12 => :limit_hold,
21
- 13 => :recall,
22
- 14 => :rush_recall,
23
- 15 => :reloaning_limit,
24
- 16 => :booking_permission,
25
- 17 => :booking_hours
26
- }
27
- args[:hash_key] = :item_process_status
28
- super(args)
29
- end
30
- end
31
- end
32
- end
33
- end
@@ -1,33 +0,0 @@
1
- module Exlibris
2
- module Aleph
3
- module TabParser
4
- class Tab15ByItemStatus < Exlibris::Aleph::TabParser::SubLibrary
5
-
6
- def initialize(args)
7
- args[:aleph_file_name] = "tab15.eng"
8
- args[:pattern] = /^(.{5})\s([0-9#]{2})\s([A-Z#]{2})\s(L)\s(.{30})\s([YN])\s([YN])\s([YNCT])\s([YN])\s([YN])\s([YN])\s([YN])\s([YN])\s([YN])\s([0-9]{2})\s([YNC])\s([AOC])/
9
- args[:pattern_key] = {
10
- 1 => :sub_library,
11
- 2 => :item_status,
12
- 3 => :item_process_status,
13
- 5 => :text,
14
- 6 => :loan,
15
- 7 => :renew,
16
- 8 => :hold_request,
17
- 9 => :photocopy_request,
18
- 10 => :web_opac,
19
- 11 => :specific_item,
20
- 12 => :limit_hold,
21
- 13 => :recall,
22
- 14 => :rush_recall,
23
- 15 => :reloaning_limit,
24
- 16 => :booking_permission,
25
- 17 => :booking_hours
26
- }
27
- args[:hash_key] = :item_status
28
- super(args)
29
- end
30
- end
31
- end
32
- end
33
- end
@@ -1,39 +0,0 @@
1
- module Exlibris
2
- module Aleph
3
- module TabParser
4
- class Tab31 < Exlibris::Aleph::TabParser::SubLibrary
5
-
6
- def initialize(args)
7
- args[:aleph_file_name] = "tab31"
8
- args[:pattern] = /^(.{5})\s([0-9#]{2})\s([YN])\s([YN])\s([YN])\s([YN])\s([YN])\s([YN])\s([YN])\s([YN])\s([CF])\s([+A])\s([DMY\s])\s([0-9]{8})\s([0-9]{10})\s([YN])\s([YN])\s([YN])\s([0-9]{2})\s([YN])\s([YN])\s([YN])/
9
- args[:pattern_key] = {
10
- 1 => :sub_library,
11
- 2 => :patron_status,
12
- 3 => :loan_permission,
13
- 4 => :photo_permission,
14
- 5 => :override_permission,
15
- 6 => :multiple_hold_permission,
16
- 7 => :check_loan,
17
- 8 => :hold_permission,
18
- 9 => :renew_permission,
19
- 10 => :ignore_late_return,
20
- 11 => :photocopy_charge,
21
- 12 => :expiration_date_operator,
22
- 13 => :expiration_date_operator_type,
23
- 14 => :expiration_date_parameter,
24
- 15 => :cash_overspend_limit,
25
- 16 => :hold_request_permission_for_item_on_shelf,
26
- 17 => :loan_display,
27
- 18 => :reading_room_permission,
28
- 19 => :default_hold_priority,
29
- 20 => :item_booking_permission,
30
- 21 => :booking_ignore_closing_hours,
31
- 22 => :automatically_create_aleph_record
32
- }
33
- args[:hash_key] = :patron_status
34
- super(args)
35
- end
36
- end
37
- end
38
- end
39
- end
@@ -1,63 +0,0 @@
1
- module Exlibris
2
- module Aleph
3
- module TabParser
4
- class Tab37 < Exlibris::Aleph::TabParser::Base
5
-
6
- def initialize(args)
7
- args[:aleph_file_name] = "tab37"
8
- args[:pattern] = /^(.{5})\s([0-9#]{2})\s(.{2})\s(.{2})\s([YN#])\s(.{2}.?.?.?)\s?(.{5})?\s?(.{5})?\s?(.{5})?\s?(.{5})?\s?(.{5})?\s?(.{5})?\s?(.{5})?\s?(.{5})?\s?(.{5})?/
9
- args[:pattern_key] = {
10
- 1 => :sub_library,
11
- 2 => :item_status,
12
- 3 => :item_process_status,
13
- 4 => :patron_status,
14
- 5 => :availability_status
15
- }
16
- args[:hash_key] = :sub_library
17
- super(args)
18
- end
19
-
20
- protected
21
- def parse_file
22
- config_array = []
23
- config_hash = {}
24
- File.open(@aleph_file).each do |line|
25
- line.chomp!
26
- config_match = line.match(@pattern)
27
- if(config_match)
28
- config_match_hash = {}
29
- @pattern_key.each do |column, key|
30
- config_match_hash[key] = config_match[column].strip
31
- end
32
- pickup_locations = []
33
- (6..15).each do |column|
34
- pickup_locations.push(config_match[column].strip) unless config_match[column].nil?
35
- end
36
- config_match_hash[:pickup_locations] = pickup_locations
37
- config_array.push(config_match_hash) unless config_match_hash.empty?
38
- config_hash[config_match_hash[:sub_library]]={} if config_hash[config_match_hash[:sub_library]].nil?
39
- config_hash[config_match_hash[:sub_library]][config_match_hash[:item_status]]={} if config_hash[config_match_hash[:sub_library]][config_match_hash[:item_status]].nil?
40
- config_hash[config_match_hash[:sub_library]][config_match_hash[:item_status]][config_match_hash[:item_process_status]]={} if config_hash[config_match_hash[:sub_library]][config_match_hash[:item_status]][config_match_hash[:item_process_status]].nil?
41
- config_hash[config_match_hash[:sub_library]][config_match_hash[:item_status]][config_match_hash[:item_process_status]][config_match_hash[:patron_status]]={} if config_hash[config_match_hash[:sub_library]][config_match_hash[:item_status]][config_match_hash[:item_process_status]][config_match_hash[:patron_status]].nil?
42
- config_hash[config_match_hash[:sub_library]][config_match_hash[:item_status]][config_match_hash[:item_process_status]][config_match_hash[:patron_status]][config_match_hash[:availability_status]] = config_match_hash unless config_match_hash.empty? or hash_key.nil?
43
- else
44
- continuation_pattern = /^(\s{17})(.{2}.?.?.?)\s?(.{5})?\s?(.{5})?\s?(.{5})?\s?(.{5})?\s?(.{5})?\s?(.{5})?\s?(.{5})?\s?(.{5})?\s?(.{5})?/
45
- continuation_match = line.match(continuation_pattern)
46
- if(continuation_match)
47
- continuation_match_hash = config_array.pop
48
- pickup_locations = continuation_match_hash[:pickup_locations]
49
- (2..11).each do |column|
50
- pickup_locations.push(continuation_match[column].strip) unless continuation_match[column].nil?
51
- end
52
- continuation_match_hash[:pickup_locations] = pickup_locations
53
- config_array.push(continuation_match_hash) unless continuation_match_hash.empty?
54
- config_hash[continuation_match_hash[:sub_library]][continuation_match_hash[:item_status]][continuation_match_hash[:item_process_status]][continuation_match_hash[:patron_status]][continuation_match_hash[:availability_status]] = continuation_match_hash unless continuation_match_hash.empty? or hash_key.nil?
55
- end
56
- end
57
- end
58
- return [config_array, config_hash]
59
- end
60
- end
61
- end
62
- end
63
- end
@@ -1,20 +0,0 @@
1
- module Exlibris
2
- module Aleph
3
- module TabParser
4
- class Tab40 < Exlibris::Aleph::TabParser::SubLibrary
5
-
6
- def initialize(args)
7
- args[:aleph_file_name] = "tab40.eng"
8
- args[:pattern] = /^(.{5})\s(.{5})\s(L)\s(.+)/
9
- args[:pattern_key] = {
10
- 1 => :collection_code,
11
- 2 => :sub_library,
12
- 4 => :text
13
- }
14
- args[:hash_key] = :collection_code
15
- super(args)
16
- end
17
- end
18
- end
19
- end
20
- end
@@ -1,21 +0,0 @@
1
- module Exlibris
2
- module Aleph
3
- module TabParser
4
- class TabSubLibrary < Exlibris::Aleph::TabParser::Base
5
-
6
- def initialize(args)
7
- args[:aleph_file_name] = "tab_sub_library.eng"
8
- args[:pattern] = /^(.{5})\s([1-6]{1})\s(.{5})\s([L,H,A,R,S]{1})\s(.{1,30})/
9
- args[:pattern_key] = {
10
- 1 => :code,
11
- 2 => :type,
12
- 3 => :library,
13
- 5 => :text
14
- }
15
- args[:hash_key] = :code
16
- super(args)
17
- end
18
- end
19
- end
20
- end
21
- end
@@ -1,20 +0,0 @@
1
- module Exlibris
2
- module Aleph
3
- module TabParser
4
- class TabWwwItemDesc < Exlibris::Aleph::TabParser::Base
5
-
6
- def initialize(args)
7
- args[:aleph_file_name] = "tab_www_item_desc.eng"
8
- args[:pattern] = /^(ITEM-STATUS )\s(.{80})\s([^\n]*)/
9
- args[:pattern_key] = {
10
- 1 => :code,
11
- 2 => :original_text,
12
- 3 => :web_text
13
- }
14
- args[:hash_key] = :original_text
15
- super(args)
16
- end
17
- end
18
- end
19
- end
20
- end
@@ -1,25 +0,0 @@
1
- module Exlibris
2
- module Aleph
3
- if defined?(::Rails) && ::Rails.version >= '3.1.0'
4
- class Railtie < Rails::Railtie
5
- rake_tasks do
6
- load "tasks/exlibris-aleph_tasks.rake"
7
- end
8
- end
9
- else
10
- require 'rake'
11
- class TaskInstaller
12
- include Rake::DSL if defined? Rake::DSL
13
- class << self
14
- def install_tasks
15
- @rake_tasks ||= []
16
- @rake_tasks << load("tasks/exlibris-aleph_tasks.rake")
17
- @rake_tasks
18
- end
19
- end
20
- end
21
- # Install tasks
22
- Exlibris::Aleph::TaskInstaller.install_tasks
23
- end
24
- end
25
- end
@@ -1,38 +0,0 @@
1
- module Exlibris
2
- module Aleph
3
- #
4
- # Write passed in arguments to instance attributes
5
- #
6
- module WriteAttributes
7
-
8
- def initialize *args
9
- # Just call super w/o any args for now. Eventually, we'll want to check the arity and adjust.
10
- # self.class.superclass.instance_method(:initialize).arity.eql? self.class.instance_method(:initialize).arity
11
- super
12
- write_attributes args.last unless args.last.nil?
13
- end
14
-
15
- def write_attributes attributes
16
- attributes.each do |attribute, value|
17
- write_attribute attribute, value
18
- end
19
- end
20
-
21
- def attributize symbol
22
- symbol.id2name.sub(/=$/, "").to_sym
23
- end
24
- protected :attributize
25
-
26
- def write_attribute attribute, value
27
- attribute_writer = writify attribute
28
- send attribute_writer, value if respond_to? attribute_writer
29
- end
30
- private :write_attribute
31
-
32
- def writify key
33
- "#{key}=".to_sym
34
- end
35
- private :writify
36
- end
37
- end
38
- end
@@ -1,50 +0,0 @@
1
- module Exlibris
2
- module Aleph
3
- #
4
- # Utility for parsing and building XML
5
- #
6
- module XmlUtil
7
- require 'nokogiri'
8
-
9
- def self.included(klass)
10
- klass.class_eval do
11
- extend ClassAttributes
12
- end
13
- end
14
-
15
- module ClassAttributes
16
- def xml_options
17
- @xml_options ||= {
18
- :encoding => 'UTF-8',
19
- :indent => 0,
20
- :save_with => Nokogiri::XML::Node::SaveOptions::AS_XML | Nokogiri::XML::Node::SaveOptions::NO_DECLARATION
21
- }
22
- end
23
- end
24
-
25
- attr_reader :raw_xml
26
- protected :raw_xml
27
-
28
- # Returns an XML string and takes any args that are
29
- # understood by Nokogiri::XML::Builder.
30
- def build_xml options={}, &block
31
- Nokogiri::XML::Builder.new(options.merge(:encoding => 'UTF-8'), &block).to_xml(xml_options).strip
32
- end
33
- protected :build_xml
34
-
35
- def xml_options
36
- @xml_options ||= self.class.xml_options
37
- end
38
- protected :xml_options
39
-
40
- def xml(*args)
41
- Nokogiri::XML((args.shift[:xml] || raw_xml))
42
- end
43
- protected :xml
44
-
45
- def to_xml
46
- xml.to_xml(xml_options).strip
47
- end
48
- end
49
- end
50
- end
@@ -1,47 +0,0 @@
1
- module Exlibris
2
- module Aleph
3
- module Xservice
4
- require 'open-uri'
5
- require 'nokogiri'
6
- # ==Overview
7
- # Exlibris::Aleph::BorAuth provides access to the BorAuth Aleph XService.
8
- class BorAuth
9
- attr_reader :response, :error, :session_id
10
-
11
- # Creates an instance of Exlibris::Aleph::BorAuth based on the input parameters.
12
- def initialize(aleph_url, library, sub_library, translate, bor_id, bor_verification)
13
- url = "#{aleph_url}/X?"
14
- url += "op=bor-auth&library=#{library}&"
15
- url += "sub_library=#{sub_library}&translate=#{translate}&"
16
- url += "bor_id=#{bor_id}&verification=#{bor_verification}&"
17
- @response = Nokogiri.XML(open(url))
18
- @session_id = @response.at("//session-id").inner_text unless @response.at("//session-id").nil?
19
- @error = @response.at("//error").inner_text unless @response.at("//error").nil?
20
- end
21
-
22
- # Returns a Hash of permissions for the Aleph sub library passed into the constructor.
23
- def permissions
24
- rv = {}
25
- return rv unless @response and self.error.nil?
26
- rv[:home_sub_library] = @response.at("z303-home-library").inner_text unless @response.at("z303-home-library").nil?
27
- rv[:bor_status] = @response.at("z305-bor-status").inner_text unless @response.at("z305-bor-status").nil?
28
- rv[:bor_type] = @response.at("z305-bor-type").inner_text unless @response.at("z305-bor-type").nil?
29
- rv[:loan_permission] = @response.at("z305-loan-permission").inner_text unless @response.at("z305-loan-permission").nil?
30
- rv[:photo_permission] = @response.at("z305-photo-permission").inner_text unless @response.at("z305-photo-permission").nil?
31
- rv[:over_permission] = @response.at("z305-over-permission").inner_text unless @response.at("z305-over-permission").nil?
32
- rv[:multi_hold] = @response.at("z305-multi-hold").inner_text unless @response.at("z305-multi-hold").nil?
33
- rv[:loan_check] = @response.at("z305-loan-check").inner_text unless @response.at("z305-loan-check").nil?
34
- rv[:hold_permission] = @response.at("z305-hold-permission").inner_text unless @response.at("z305-hold-permission").nil?
35
- rv[:renew_permission] = @response.at("z305-renew-permission").inner_text unless @response.at("z305-renew-permission").nil?
36
- rv[:rr_permission] = @response.at("z305-rr-permission").inner_text unless @response.at("z305-rr-permission").nil?
37
- rv[:ignore_late_return] = @response.at("z305-ignore-late-return").inner_text unless @response.at("z305-ignore-late-return").nil?
38
- rv[:hold_on_shelf] = @response.at("z305-hold-on-shelf").inner_text unless @response.at("z305-hold-on-shelf").nil?
39
- rv[:end_block_date] = @response.at("z305-end-block-date").inner_text unless @response.at("z305-end-block-date").nil?
40
- rv[:booking_permission] = @response.at("z305-booking-permission").inner_text unless @response.at("z305-booking-permission").nil?
41
- rv[:booking_ignore_hours] = @response.at("z305-booking-ignore-hours").inner_text unless @response.at("z305-booking-ignore-hours").nil?
42
- return rv
43
- end
44
- end
45
- end
46
- end
47
- end
@@ -1,48 +0,0 @@
1
- namespace :exlibris do
2
- namespace :aleph do
3
- desc "Initialize the Exlibris::Aleph environment"
4
- task :initialize, :config_file, :tab_path, :yml_path, :adms do |task, args|
5
- args.with_defaults(:config_file => '', :tab_path => '', :adms => [])
6
- # If we're in the Rails environment, use Rails initializers
7
- if defined?(::Rails) && ::Rails.version >= '3.1.0'
8
- Rake::Task[:environment].invoke
9
- elsif (not args[:config_file].empty?)
10
- Rake::Task['exlibris:aleph:initialize_via_config_file'].invoke(args[:config_file])
11
- elsif (not args[:tab_path].empty?) and (not args[:adms].empty?)
12
- Rake::Task['exlibris:aleph:initialize_via_args'].invoke(args[:tab_path], args[:yml_path], args[:adms])
13
- else
14
- raise Rake::TaskArgumentError.new("Insufficient arguments.")
15
- end
16
- p "Configured tab path: #{Exlibris::Aleph::TabHelper.tab_path}"
17
- p "Configured yml path: #{Exlibris::Aleph::TabHelper.yml_path}"
18
- p "Configured ADMs: #{Exlibris::Aleph::TabHelper.adms}"
19
- end
20
-
21
- desc "Initialize the Exlibris::Aleph environment via the given yaml config file"
22
- task :initialize_via_config_file, :config_file do |task, args|
23
- config_file = args[:config_file]
24
- # Load Aleph configuration via given config_file
25
- Exlibris::Aleph.configure do |config|
26
- config.load_yaml config_file
27
- end
28
- end
29
-
30
- desc "Initialize the Exlibris::Aleph environment via the given args.\nADMs should be separated by semicolons."
31
- task :initialize_via_args, :tab_path, :yml_path, :adms do |task, args|
32
- tab_path = args[:tab_path]
33
- yml_path = args[:yml_path]
34
- adms = args[:adms].split(";")
35
- # Load Aleph configuration via given config_file
36
- Exlibris::Aleph.configure do |config|
37
- config.tab_path = tab_path
38
- config.yml_path = yml_path
39
- config.adms = adms
40
- end
41
- end
42
-
43
- desc "Refresh the Exlibris::Aleph tables"
44
- task :refresh, [:config_file, :tab_path, :yml_path, :adms] => :initialize do
45
- Exlibris::Aleph::TabHelper.refresh_yml
46
- end
47
- end
48
- end