enju_biblio 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (185) hide show
  1. data/app/controllers/items_controller.rb +5 -1
  2. data/app/controllers/manifestations_controller.rb +16 -13
  3. data/app/controllers/picture_files_controller.rb +2 -2
  4. data/app/helpers/manifestations_helper.rb +9 -5
  5. data/app/models/item.rb +11 -109
  6. data/app/models/manifestation.rb +53 -20
  7. data/app/models/page_sweeper.rb +1 -1
  8. data/app/models/patron.rb +2 -1
  9. data/app/models/patron_import_file.rb +2 -2
  10. data/app/models/picture_file.rb +4 -2
  11. data/app/models/resource_import_file.rb +8 -4
  12. data/app/models/series_statement.rb +1 -1
  13. data/app/views/carrier_types/index.html.erb +1 -1
  14. data/app/views/content_types/index.html.erb +1 -1
  15. data/app/views/countries/index.html.erb +1 -1
  16. data/app/views/create_types/index.html.erb +1 -1
  17. data/app/views/creates/_index.html.erb +1 -1
  18. data/app/views/creates/_index_patron.html.erb +1 -1
  19. data/app/views/creates/_index_work.html.erb +1 -1
  20. data/app/views/donates/index.html.erb +1 -1
  21. data/app/views/exemplifies/index.html.erb +1 -1
  22. data/app/views/extents/index.html.erb +1 -1
  23. data/app/views/form_of_works/index.html.erb +1 -1
  24. data/app/views/frequencies/index.html.erb +1 -1
  25. data/app/views/import_requests/index.html.erb +1 -1
  26. data/app/views/items/index.html.erb +1 -1
  27. data/app/views/items/index.mobile.erb +1 -1
  28. data/app/views/items/show.html.erb +1 -1
  29. data/app/views/languages/index.html.erb +1 -1
  30. data/app/views/licenses/index.html.erb +1 -1
  31. data/app/views/manifestation_relationship_types/index.html.erb +1 -1
  32. data/app/views/manifestation_relationships/index.html.erb +1 -1
  33. data/app/views/manifestations/_form.html.erb +4 -2
  34. data/app/views/manifestations/_index_form.html.erb +1 -1
  35. data/app/views/manifestations/_library_facet.html.erb +1 -6
  36. data/app/views/manifestations/_list.html.erb +1 -1
  37. data/app/views/manifestations/_paginate_id_link.html.erb +2 -0
  38. data/app/views/manifestations/_show_detail_librarian.html.erb +1 -1
  39. data/app/views/manifestations/_show_detail_user.html.erb +1 -1
  40. data/app/views/manifestations/_show_holding.html.erb +1 -1
  41. data/app/views/manifestations/_show_holding.mobile.erb +1 -1
  42. data/app/views/manifestations/_show_series_statement.html.erb +1 -1
  43. data/app/views/manifestations/index.csv.erb +1 -1
  44. data/app/views/manifestations/index.html.erb +1 -1
  45. data/app/views/manifestations/show.mobile.erb +1 -1
  46. data/app/views/medium_of_performances/index.html.erb +1 -1
  47. data/app/views/owns/index.html.erb +1 -1
  48. data/app/views/patron_import_files/index.html.erb +1 -1
  49. data/app/views/patron_import_results/index.html.erb +1 -1
  50. data/app/views/patron_relationship_types/index.html.erb +1 -1
  51. data/app/views/patron_relationships/index.html.erb +1 -1
  52. data/app/views/patron_types/index.html.erb +1 -1
  53. data/app/views/patrons/_index.html.erb +1 -3
  54. data/app/views/patrons/_index_expression.html.erb +1 -1
  55. data/app/views/patrons/_index_manifestation.html.erb +1 -1
  56. data/app/views/patrons/_index_patron.html.erb +1 -1
  57. data/app/views/patrons/_index_patron_merge_list.html.erb +1 -1
  58. data/app/views/patrons/_index_work.html.erb +1 -1
  59. data/app/views/patrons/_patron.html.erb +0 -4
  60. data/app/views/patrons/show.html.erb +3 -3
  61. data/app/views/patrons/show.mobile.erb +1 -1
  62. data/app/views/picture_files/_index.html.erb +1 -1
  63. data/app/views/picture_files/_index_event.html.erb +1 -1
  64. data/app/views/picture_files/_index_manifestation.html.erb +1 -1
  65. data/app/views/picture_files/_index_patron.html.erb +1 -1
  66. data/app/views/picture_files/_index_shelf.html.erb +1 -1
  67. data/app/views/produce_types/index.html.erb +1 -1
  68. data/app/views/produces/_index.html.erb +1 -1
  69. data/app/views/produces/_index_manifestation.html.erb +1 -1
  70. data/app/views/produces/_index_patron.html.erb +1 -1
  71. data/app/views/realize_types/index.html.erb +1 -1
  72. data/app/views/realizes/_index.html.erb +1 -1
  73. data/app/views/realizes/_index_expression.html.erb +1 -1
  74. data/app/views/realizes/_index_patron.html.erb +1 -1
  75. data/app/views/resource_import_files/index.html.erb +1 -1
  76. data/app/views/resource_import_results/index.html.erb +1 -1
  77. data/app/views/series_has_manifestations/index.html.erb +1 -1
  78. data/app/views/series_statements/_index.html.erb +1 -1
  79. data/app/views/series_statements/_index_manifestation.html.erb +1 -1
  80. data/app/views/series_statements/_index_series_statement_merge_list.html.erb +1 -1
  81. data/app/views/series_statements/_manifestation_list.html.erb +1 -1
  82. data/app/views/series_statements/_merge.html.erb +1 -1
  83. data/app/views/series_statements/show.html.erb +1 -1
  84. data/config/routes.rb +13 -13
  85. data/lib/enju_biblio/biblio_helper.rb +59 -0
  86. data/lib/enju_biblio/engine.rb +1 -0
  87. data/{spec/dummy/lib/enju_leaf → lib/enju_biblio}/openurl.rb +0 -0
  88. data/{spec/dummy/lib/enju_leaf → lib/enju_biblio}/porta_cql.rb +1 -1
  89. data/{spec/dummy/lib/enju_leaf → lib/enju_biblio}/sru.rb +1 -1
  90. data/lib/enju_biblio/version.rb +1 -1
  91. data/lib/enju_biblio.rb +4 -0
  92. data/spec/cassette_library/enju_ndl/manifestation.yml +10 -10
  93. data/spec/cassette_library/enju_ndl/ndl_search.yml +18 -18
  94. data/spec/dummy/app/mailers/notifier.rb +6 -2
  95. data/spec/dummy/config/initializers/resque_mailer.rb +1 -0
  96. data/spec/dummy/db/development.sqlite3 +0 -0
  97. data/spec/dummy/db/test.sqlite3 +0 -0
  98. data/spec/dummy/lib/enju_leaf.rb +0 -2
  99. data/spec/dummy/private/system/resource_import_files/resource_imports/000/000/004/original/isbn_sample.txt +3 -0
  100. data/spec/dummy/private/system/resource_import_files/resource_imports/000/000/004/original/item_delete_file.tsv +11 -0
  101. data/spec/dummy/private/system/resource_import_files/resource_imports/000/000/004/original/item_update_file.tsv +4 -0
  102. data/spec/dummy/private/system/resource_import_files/resource_imports/000/000/004/original/resource_import_file_sample1.tsv +19 -0
  103. data/spec/dummy/private/system/resource_import_files/resource_imports/000/000/004/original/resource_import_file_sample2.tsv +19 -0
  104. data/spec/dummy/private/system/resource_import_files/resource_imports/000/000/004/original/update_series_statement.tsv +2 -0
  105. data/spec/dummy/public/system/picture_files/pictures/000/000/005/medium/spinner.gif +0 -0
  106. data/spec/dummy/public/system/picture_files/pictures/000/000/005/original/spinner.gif +0 -0
  107. data/spec/dummy/public/system/picture_files/pictures/000/000/005/thumb/spinner.gif +0 -0
  108. data/spec/dummy/solr/conf/schema.xml +7 -1
  109. data/spec/dummy/solr/data/test/index/{_39.fdt → _h.fdt} +0 -0
  110. data/spec/dummy/solr/data/test/index/_h.fdx +0 -0
  111. data/spec/dummy/solr/data/test/index/_h.fnm +5 -0
  112. data/spec/dummy/solr/data/test/index/_h.frq +0 -0
  113. data/spec/dummy/solr/data/test/index/_h.nrm +1 -0
  114. data/spec/dummy/solr/data/test/index/_h.prx +0 -0
  115. data/spec/dummy/solr/data/test/index/{_39.tii → _h.tii} +0 -0
  116. data/spec/dummy/solr/data/test/index/_h.tis +0 -0
  117. data/spec/dummy/solr/data/test/index/_h_1.del +0 -0
  118. data/spec/dummy/solr/data/test/index/segments.gen +0 -0
  119. data/spec/dummy/solr/data/test/index/segments_1e +0 -0
  120. data/spec/dummy/solr/data/test/spellchecker/segments_1 +0 -0
  121. data/spec/dummy/tmp/cache/4F7/F90/default_role +0 -0
  122. data/spec/dummy/tmp/cache/6E4/420/search_engine_all +0 -0
  123. data/spec/fixtures/manifestations.yml +6 -6
  124. data/spec/models/manifestation_spec.rb +8 -1
  125. data/spec/models/resource_import_file_spec.rb +1 -0
  126. metadata +58 -139
  127. data/app/views/manifestations/_form.html.erb.osakac +0 -153
  128. data/spec/dummy/solr/data/test/index/_2s.fdt +0 -0
  129. data/spec/dummy/solr/data/test/index/_2s.fdx +0 -0
  130. data/spec/dummy/solr/data/test/index/_2s.fnm +0 -10
  131. data/spec/dummy/solr/data/test/index/_2s.frq +0 -0
  132. data/spec/dummy/solr/data/test/index/_2s.nrm +0 -1
  133. data/spec/dummy/solr/data/test/index/_2s.prx +0 -0
  134. data/spec/dummy/solr/data/test/index/_2s.tii +0 -0
  135. data/spec/dummy/solr/data/test/index/_2s.tis +0 -0
  136. data/spec/dummy/solr/data/test/index/_2t.fdt +0 -0
  137. data/spec/dummy/solr/data/test/index/_2t.fdx +0 -0
  138. data/spec/dummy/solr/data/test/index/_2t.fnm +0 -10
  139. data/spec/dummy/solr/data/test/index/_2t.frq +0 -0
  140. data/spec/dummy/solr/data/test/index/_2t.nrm +0 -1
  141. data/spec/dummy/solr/data/test/index/_2t.prx +0 -0
  142. data/spec/dummy/solr/data/test/index/_2t.tii +0 -0
  143. data/spec/dummy/solr/data/test/index/_2t.tis +0 -0
  144. data/spec/dummy/solr/data/test/index/_2u.fdt +0 -0
  145. data/spec/dummy/solr/data/test/index/_2u.fdx +0 -0
  146. data/spec/dummy/solr/data/test/index/_2u.fnm +0 -10
  147. data/spec/dummy/solr/data/test/index/_2u.frq +0 -0
  148. data/spec/dummy/solr/data/test/index/_2u.nrm +0 -1
  149. data/spec/dummy/solr/data/test/index/_2u.prx +0 -0
  150. data/spec/dummy/solr/data/test/index/_2u.tii +0 -0
  151. data/spec/dummy/solr/data/test/index/_2u.tis +0 -0
  152. data/spec/dummy/solr/data/test/index/_2z.fdt +0 -0
  153. data/spec/dummy/solr/data/test/index/_2z.fdx +0 -0
  154. data/spec/dummy/solr/data/test/index/_2z.fnm +0 -10
  155. data/spec/dummy/solr/data/test/index/_2z.frq +0 -0
  156. data/spec/dummy/solr/data/test/index/_2z.nrm +0 -1
  157. data/spec/dummy/solr/data/test/index/_2z.prx +0 -0
  158. data/spec/dummy/solr/data/test/index/_2z.tii +0 -0
  159. data/spec/dummy/solr/data/test/index/_2z.tis +0 -0
  160. data/spec/dummy/solr/data/test/index/_39.fdx +0 -0
  161. data/spec/dummy/solr/data/test/index/_39.fnm +0 -10
  162. data/spec/dummy/solr/data/test/index/_39.frq +0 -0
  163. data/spec/dummy/solr/data/test/index/_39.nrm +0 -1
  164. data/spec/dummy/solr/data/test/index/_39.prx +0 -0
  165. data/spec/dummy/solr/data/test/index/_39.tis +0 -0
  166. data/spec/dummy/solr/data/test/index/_39_1.del +0 -0
  167. data/spec/dummy/solr/data/test/index/_k.fdt +0 -0
  168. data/spec/dummy/solr/data/test/index/_k.fdx +0 -0
  169. data/spec/dummy/solr/data/test/index/_k.fnm +0 -10
  170. data/spec/dummy/solr/data/test/index/_k.frq +0 -0
  171. data/spec/dummy/solr/data/test/index/_k.nrm +0 -1
  172. data/spec/dummy/solr/data/test/index/_k.prx +0 -0
  173. data/spec/dummy/solr/data/test/index/_k.tii +0 -0
  174. data/spec/dummy/solr/data/test/index/_k.tis +0 -0
  175. data/spec/dummy/solr/data/test/index/_k_3.del +0 -0
  176. data/spec/dummy/solr/data/test/index/_x.fdt +0 -0
  177. data/spec/dummy/solr/data/test/index/_x.fdx +0 -0
  178. data/spec/dummy/solr/data/test/index/_x.fnm +0 -10
  179. data/spec/dummy/solr/data/test/index/_x.frq +0 -0
  180. data/spec/dummy/solr/data/test/index/_x.nrm +0 -1
  181. data/spec/dummy/solr/data/test/index/_x.prx +0 -0
  182. data/spec/dummy/solr/data/test/index/_x.tii +0 -0
  183. data/spec/dummy/solr/data/test/index/_x.tis +0 -0
  184. data/spec/dummy/solr/data/test/index/_x_2.del +0 -0
  185. data/spec/dummy/solr/data/test/index/segments_39 +0 -0
@@ -1,5 +1,5 @@
1
1
  <%= form_for :series_statements, :url => series_statements_path, :html => {:method => 'get'} do |f| -%>
2
- <table class="index">
2
+ <table class="table table-striped index">
3
3
  <tr>
4
4
  <th id="position"></th>
5
5
  <th><%= t('activerecord.attributes.series_statement.original_title') -%></th>
@@ -11,7 +11,7 @@
11
11
  <div id="tabs">
12
12
  <%= render 'tab_menu', :series_statement => @series_statement %>
13
13
  <div id="detail">
14
- <table id="resource_detail">
14
+ <table class="table table-striped" id="resource_detail">
15
15
  <tr>
16
16
  <td style="width: 200px"><%= t('activerecord.attributes.series_statement.title_transcription') -%></td>
17
17
  <td style="width: 490px"><%= @series_statement.title_transcription %></td>
data/config/routes.rb CHANGED
@@ -1,14 +1,4 @@
1
1
  Rails.application.routes.draw do
2
- resources :works, :controller => 'manifestations' do
3
- resources :patrons
4
- resources :creates
5
- end
6
-
7
- resources :expressions, :controller => 'manifestations' do
8
- resources :patrons
9
- resources :realizes
10
- end
11
-
12
2
  resources :manifestations do
13
3
  resources :patrons
14
4
  resources :produces
@@ -41,15 +31,25 @@ Rails.application.routes.draw do
41
31
  resources :produces
42
32
  end
43
33
 
44
- resources :creators, :controller => 'patrons' do
34
+ resources :works, :controller => 'manifestations', :except => [:index, :new, :create] do
35
+ resources :patrons
36
+ resources :creates
37
+ end
38
+
39
+ resources :expressions, :controller => 'manifestations', :except => [:index, :new, :create] do
40
+ resources :patrons
41
+ resources :realizes
42
+ end
43
+
44
+ resources :creators, :controller => 'patrons', :except => [:index, :new, :create] do
45
45
  resources :manifestations
46
46
  end
47
47
 
48
- resources :contributors, :controller => 'patrons' do
48
+ resources :contributors, :controller => 'patrons', :except => [:index, :new, :create] do
49
49
  resources :manifestations
50
50
  end
51
51
 
52
- resources :publishers, :controller => 'patrons' do
52
+ resources :publishers, :controller => 'patrons', :except => [:index, :new, :create] do
53
53
  resources :manifestations
54
54
  end
55
55
 
@@ -0,0 +1,59 @@
1
+ module EnjuBiblio
2
+ module BiblioHelper
3
+ def form_icon(carrier_type)
4
+ case carrier_type.name
5
+ when 'print'
6
+ image_tag('icons/book.png', :size => '16x16', :alt => carrier_type.display_name.localize)
7
+ when 'CD'
8
+ image_tag('icons/cd.png', :size => '16x16', :alt => carrier_type.display_name.localize)
9
+ when 'DVD'
10
+ image_tag('icons/dvd.png', :size => '16x16', :alt => carrier_type.display_name.localize)
11
+ when 'file'
12
+ image_tag('icons/monitor.png', :size => '16x16', :alt => carrier_type.display_name.localize)
13
+ else
14
+ image_tag('icons/help.png', :size => '16x16', :alt => t('page.unknown'))
15
+ end
16
+ rescue NoMethodError
17
+ image_tag('icons/help.png', :size => '16x16', :alt => t('page.unknown'))
18
+ end
19
+
20
+ def content_type_icon(content_type)
21
+ case content_type.name
22
+ when 'text'
23
+ image_tag('icons/page_white_text.png', :size => '16x16', :alt => content_type.display_name.localize)
24
+ when 'picture'
25
+ image_tag('icons/picture.png', :size => '16x16', :alt => content_type.display_name.localize)
26
+ when 'sound'
27
+ image_tag('icons/sound.png', :size => '16x16', :alt => content_type.display_name.localize)
28
+ when 'video'
29
+ image_tag('icons/film.png', :size => '16x16', :alt => content_type.display_name.localize)
30
+ else
31
+ image_tag('icons/help.png', :size => '16x16', :alt => t('page.unknown'))
32
+ end
33
+ rescue NoMethodError
34
+ image_tag('icons/help.png', :size => '16x16', :alt => t('page.unknown'))
35
+ end
36
+
37
+ def patron_type_icon(patron_type)
38
+ case patron_type
39
+ when 'Person'
40
+ image_tag('icons/user.png', :size => '16x16', :alt => 'Person')
41
+ when 'CorporateBody'
42
+ image_tag('icons/group.png', :size => '16x16', :alt => 'CorporateBody')
43
+ else
44
+ image_tag('icons/help.png', :size => '16x16', :alt => t('page.unknown'))
45
+ end
46
+ end
47
+
48
+ def patrons_list(patrons = [], options = {})
49
+ return nil if patrons.blank?
50
+ patrons_list = []
51
+ if options[:nolink]
52
+ patrons_list = patrons.map{|patron| patron.full_name}
53
+ else
54
+ patrons_list = patrons.map{|patron| link_to(patron.full_name, patron, options)}
55
+ end
56
+ patrons_list.join(" ").html_safe
57
+ end
58
+ end
59
+ end
@@ -12,6 +12,7 @@ require 'enju_ndl'
12
12
  require 'dynamic_form'
13
13
  require 'simple_form'
14
14
  require 'will_paginate/array'
15
+ require 'resque_mailer'
15
16
 
16
17
  module EnjuBiblio
17
18
  class Engine < ::Rails::Engine
@@ -65,7 +65,7 @@ class Cql
65
65
 
66
66
  def date_range(from_date, until_date)
67
67
  unless from_date == '*' and until_date == '*'
68
- ["date_of_publication_d:[#{from_date} TO #{until_date}]"]
68
+ ["pub_date_dm:[#{from_date} TO #{until_date}]"]
69
69
  else
70
70
  []
71
71
  end
@@ -1,5 +1,5 @@
1
1
  # -*- encoding: utf-8 -*-
2
- require 'enju_leaf/porta_cql'
2
+ require 'enju_biblio/porta_cql'
3
3
 
4
4
  class QueryArgumentError < QueryError; end
5
5
 
@@ -1,3 +1,3 @@
1
1
  module EnjuBiblio
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
data/lib/enju_biblio.rb CHANGED
@@ -1,4 +1,8 @@
1
1
  require "enju_biblio/engine"
2
+ require "enju_biblio/openurl"
3
+ require "enju_biblio/porta_cql"
4
+ require "enju_biblio/sru"
5
+ require "enju_biblio/biblio_helper"
2
6
 
3
7
  module EnjuBiblio
4
8
  def self.included(base)
@@ -17,7 +17,7 @@ http_interactions:
17
17
  message: OK
18
18
  headers:
19
19
  date:
20
- - Fri, 01 Jun 2012 00:05:07 GMT
20
+ - Sat, 02 Jun 2012 13:40:23 GMT
21
21
  server:
22
22
  - Apache
23
23
  x-powered-by:
@@ -27,7 +27,7 @@ http_interactions:
27
27
  x-ua-compatible:
28
28
  - IE=Edge,chrome=1
29
29
  x-runtime:
30
- - "0.224538"
30
+ - "0.153323"
31
31
  cache-control:
32
32
  - max-age=0, private, must-revalidate
33
33
  content-length:
@@ -37,8 +37,8 @@ http_interactions:
37
37
  content-type:
38
38
  - application/xml; charset=utf-8
39
39
  set-cookie:
40
- - _front_session_id=7d526ab7c3f484c682b7ee59096e66bf; domain=.iss.ndl.go.jp; path=/; expires=Fri, 01-Jun-2012 01:05:07 GMT; HttpOnly
41
- - serverid=1102; path=/
40
+ - _front_session_id=726567f43b738891cd20529045366623; domain=.iss.ndl.go.jp; path=/; expires=Sat, 02-Jun-2012 14:40:23 GMT; HttpOnly
41
+ - serverid=1105; path=/
42
42
  vary:
43
43
  - Accept-Encoding,User-Agent
44
44
  connection:
@@ -102,7 +102,7 @@ http_interactions:
102
102
  ZGVzY3JpcHRpb24+CiAgICA8L2l0ZW0+CiAgPC9jaGFubmVsPgo8L3Jzcz4K
103
103
 
104
104
  http_version: "1.0"
105
- recorded_at: Fri, 01 Jun 2012 00:05:08 GMT
105
+ recorded_at: Sat, 02 Jun 2012 13:40:23 GMT
106
106
  - request:
107
107
  method: get
108
108
  uri: http://iss.ndl.go.jp/books/R100000002-I000007602726-00.rdf
@@ -120,7 +120,7 @@ http_interactions:
120
120
  message: OK
121
121
  headers:
122
122
  date:
123
- - Fri, 01 Jun 2012 00:05:08 GMT
123
+ - Sat, 02 Jun 2012 13:40:23 GMT
124
124
  server:
125
125
  - Apache
126
126
  x-powered-by:
@@ -130,7 +130,7 @@ http_interactions:
130
130
  x-ua-compatible:
131
131
  - IE=Edge,chrome=1
132
132
  x-runtime:
133
- - "0.406517"
133
+ - "0.886560"
134
134
  cache-control:
135
135
  - max-age=0, private, must-revalidate
136
136
  content-length:
@@ -140,8 +140,8 @@ http_interactions:
140
140
  content-type:
141
141
  - application/rdf+xml; charset=utf-8
142
142
  set-cookie:
143
- - _front_session_id=27b1944a32962a13f3e8284d0e281ea8; domain=.iss.ndl.go.jp; path=/; expires=Fri, 01-Jun-2012 01:05:08 GMT; HttpOnly
144
- - serverid=1105; path=/
143
+ - _front_session_id=f2df568d1169394863f7ae3973585aa4; domain=.iss.ndl.go.jp; path=/; expires=Sat, 02-Jun-2012 14:40:24 GMT; HttpOnly
144
+ - serverid=1101; path=/
145
145
  vary:
146
146
  - Accept-Encoding,User-Agent
147
147
  connection:
@@ -519,5 +519,5 @@ http_interactions:
519
519
  dGlvbj4KICA8L2RjbmRsOkl0ZW0+CjwvcmRmOlJERj4=
520
520
 
521
521
  http_version: "1.0"
522
- recorded_at: Fri, 01 Jun 2012 00:05:08 GMT
522
+ recorded_at: Sat, 02 Jun 2012 13:40:24 GMT
523
523
  recorded_with: VCR 2.2.0
@@ -17,7 +17,7 @@ http_interactions:
17
17
  message: OK
18
18
  headers:
19
19
  date:
20
- - Wed, 06 Jun 2012 00:47:18 GMT
20
+ - Sat, 02 Jun 2012 14:18:10 GMT
21
21
  server:
22
22
  - Apache
23
23
  x-powered-by:
@@ -27,7 +27,7 @@ http_interactions:
27
27
  x-ua-compatible:
28
28
  - IE=Edge,chrome=1
29
29
  x-runtime:
30
- - "0.159748"
30
+ - "0.159388"
31
31
  cache-control:
32
32
  - max-age=0, private, must-revalidate
33
33
  content-length:
@@ -37,7 +37,7 @@ http_interactions:
37
37
  content-type:
38
38
  - application/xml; charset=utf-8
39
39
  set-cookie:
40
- - _front_session_id=6cbce8417ee4d4abc56ba0833e296639; domain=.iss.ndl.go.jp; path=/; expires=Wed, 06-Jun-2012 01:47:18 GMT; HttpOnly
40
+ - _front_session_id=5170aa59dc71a4b1408f4b5001e315c3; domain=.iss.ndl.go.jp; path=/; expires=Sat, 02-Jun-2012 15:18:10 GMT; HttpOnly
41
41
  - serverid=1105; path=/
42
42
  vary:
43
43
  - Accept-Encoding,User-Agent
@@ -103,7 +103,7 @@ http_interactions:
103
103
  dGlvbj4KICAgIDwvaXRlbT4KICA8L2NoYW5uZWw+CjwvcnNzPgo=
104
104
 
105
105
  http_version: "1.0"
106
- recorded_at: Wed, 06 Jun 2012 00:47:20 GMT
106
+ recorded_at: Sat, 02 Jun 2012 14:18:10 GMT
107
107
  - request:
108
108
  method: get
109
109
  uri: http://iss.ndl.go.jp/books/R100000002-I000009423883-00.rdf
@@ -121,7 +121,7 @@ http_interactions:
121
121
  message: OK
122
122
  headers:
123
123
  date:
124
- - Wed, 06 Jun 2012 00:47:19 GMT
124
+ - Sat, 02 Jun 2012 14:18:10 GMT
125
125
  server:
126
126
  - Apache
127
127
  x-powered-by:
@@ -131,7 +131,7 @@ http_interactions:
131
131
  x-ua-compatible:
132
132
  - IE=Edge,chrome=1
133
133
  x-runtime:
134
- - "0.744922"
134
+ - "0.836118"
135
135
  cache-control:
136
136
  - max-age=0, private, must-revalidate
137
137
  content-length:
@@ -141,7 +141,7 @@ http_interactions:
141
141
  content-type:
142
142
  - application/rdf+xml; charset=utf-8
143
143
  set-cookie:
144
- - _front_session_id=fef35c7dea106d383888b8651402db4c; domain=.iss.ndl.go.jp; path=/; expires=Wed, 06-Jun-2012 01:47:19 GMT; HttpOnly
144
+ - _front_session_id=b364b1688e10e7bf73c43a9bacc873f3; domain=.iss.ndl.go.jp; path=/; expires=Sat, 02-Jun-2012 15:18:11 GMT; HttpOnly
145
145
  - serverid=1102; path=/
146
146
  vary:
147
147
  - Accept-Encoding,User-Agent
@@ -574,7 +574,7 @@ http_interactions:
574
574
  Y3JpcHRpb24+CiAgPC9kY25kbDpJdGVtPgo8L3JkZjpSREY+
575
575
 
576
576
  http_version: "1.0"
577
- recorded_at: Wed, 06 Jun 2012 00:47:21 GMT
577
+ recorded_at: Sat, 02 Jun 2012 14:18:11 GMT
578
578
  - request:
579
579
  method: get
580
580
  uri: http://iss.ndl.go.jp/api/opensearch?dpid=iss-ndl-opac&isbn=9784873114422&cnt=10&idx=1
@@ -592,7 +592,7 @@ http_interactions:
592
592
  message: OK
593
593
  headers:
594
594
  date:
595
- - Thu, 07 Jun 2012 12:39:42 GMT
595
+ - Sat, 02 Jun 2012 15:28:30 GMT
596
596
  server:
597
597
  - Apache
598
598
  x-powered-by:
@@ -602,7 +602,7 @@ http_interactions:
602
602
  x-ua-compatible:
603
603
  - IE=Edge,chrome=1
604
604
  x-runtime:
605
- - "0.118518"
605
+ - "0.086686"
606
606
  cache-control:
607
607
  - max-age=0, private, must-revalidate
608
608
  content-length:
@@ -612,8 +612,8 @@ http_interactions:
612
612
  content-type:
613
613
  - application/xml; charset=utf-8
614
614
  set-cookie:
615
- - _front_session_id=5bf7f7538d18506400e1081810dc1c1c; domain=.iss.ndl.go.jp; path=/; expires=Thu, 07-Jun-2012 13:39:42 GMT; HttpOnly
616
- - serverid=1102; path=/
615
+ - _front_session_id=dfdbd2213e07e3aa4dbb75a35d02e1da; domain=.iss.ndl.go.jp; path=/; expires=Sat, 02-Jun-2012 16:28:30 GMT; HttpOnly
616
+ - serverid=1101; path=/
617
617
  vary:
618
618
  - Accept-Encoding,User-Agent
619
619
  connection:
@@ -679,7 +679,7 @@ http_interactions:
679
679
  Y3JpcHRpb24+CiAgICA8L2l0ZW0+CiAgPC9jaGFubmVsPgo8L3Jzcz4K
680
680
 
681
681
  http_version: "1.0"
682
- recorded_at: Thu, 07 Jun 2012 12:39:43 GMT
682
+ recorded_at: Sat, 02 Jun 2012 15:28:30 GMT
683
683
  - request:
684
684
  method: get
685
685
  uri: http://iss.ndl.go.jp/books/R100000002-I000010712584-00.rdf
@@ -697,7 +697,7 @@ http_interactions:
697
697
  message: OK
698
698
  headers:
699
699
  date:
700
- - Thu, 07 Jun 2012 12:39:42 GMT
700
+ - Sat, 02 Jun 2012 15:28:30 GMT
701
701
  server:
702
702
  - Apache
703
703
  x-powered-by:
@@ -707,7 +707,7 @@ http_interactions:
707
707
  x-ua-compatible:
708
708
  - IE=Edge,chrome=1
709
709
  x-runtime:
710
- - "0.918968"
710
+ - "0.892157"
711
711
  cache-control:
712
712
  - max-age=0, private, must-revalidate
713
713
  content-length:
@@ -717,8 +717,8 @@ http_interactions:
717
717
  content-type:
718
718
  - application/rdf+xml; charset=utf-8
719
719
  set-cookie:
720
- - _front_session_id=0ea752e083d0c700c523bbee26d499fc; domain=.iss.ndl.go.jp; path=/; expires=Thu, 07-Jun-2012 13:39:43 GMT; HttpOnly
721
- - serverid=1105; path=/
720
+ - _front_session_id=26fdffc6b12b561c67c3656670a6d93c; domain=.iss.ndl.go.jp; path=/; expires=Sat, 02-Jun-2012 16:28:31 GMT; HttpOnly
721
+ - serverid=1101; path=/
722
722
  vary:
723
723
  - Accept-Encoding,User-Agent
724
724
  connection:
@@ -1136,5 +1136,5 @@ http_interactions:
1136
1136
  PC9yZGY6UkRGPg==
1137
1137
 
1138
1138
  http_version: "1.0"
1139
- recorded_at: Thu, 07 Jun 2012 12:39:44 GMT
1139
+ recorded_at: Sat, 02 Jun 2012 15:28:31 GMT
1140
1140
  recorded_with: VCR 2.2.0
@@ -1,4 +1,5 @@
1
1
  class Notifier < ActionMailer::Base
2
+ include Resque::Mailer
2
3
  if LibraryGroup.site_config.try(:url)
3
4
  uri = Addressable::URI.parse(LibraryGroup.site_config.url)
4
5
  default_url_options[:host] = uri.host
@@ -8,7 +9,8 @@ class Notifier < ActionMailer::Base
8
9
  default_url_options[:port] = configatron.enju.web_port_number if configatron.enju.web_port_number != 80
9
10
  end
10
11
 
11
- def message_notification(message)
12
+ def message_notification(message_id)
13
+ message = Message.find(message_id)
12
14
  I18n.locale = message.receiver.locale.try(:to_sym) || I18n.default_locale
13
15
  from = "#{LibraryGroup.system_name(message.receiver.locale)} <#{LibraryGroup.site_config.email}>"
14
16
  if message.subject
@@ -26,7 +28,9 @@ class Notifier < ActionMailer::Base
26
28
  mail(:from => from, :to => message.receiver.email, :subject => subject)
27
29
  end
28
30
 
29
- def manifestation_info(user, manifestation)
31
+ def manifestation_info(user_id, manifestation_id)
32
+ user = User.find(user_id)
33
+ manifestation = Manifestation.find(manifestation_id)
30
34
  from = "#{LibraryGroup.system_name(user.locale)} <#{LibraryGroup.site_config.email}>"
31
35
  subject = "#{manifestation.original_title} : #{LibraryGroup.system_name(user.locale)}"
32
36
  @user = user
@@ -0,0 +1 @@
1
+ Resque::Mailer.excluded_environments = [:test, :cucumber]
Binary file
Binary file
@@ -1,6 +1,4 @@
1
1
  require 'plugins'
2
- require 'enju_leaf/sru'
3
- require 'enju_leaf/openurl'
4
2
  require 'enju_leaf/calculate_stat'
5
3
  require 'enju_library'
6
4
  require 'enju_circulation'
@@ -0,0 +1,3 @@
1
+ isbn library_short_name
2
+ invalid
3
+ 9784873113647
@@ -0,0 +1,11 @@
1
+ "item_identifier"
2
+ "00001"
3
+ "00002"
4
+ "00003"
5
+ "00004"
6
+ "00005"
7
+ "00006"
8
+ "00007"
9
+ "00008"
10
+ "00009"
11
+ "00010"
@@ -0,0 +1,4 @@
1
+ item_identifier original_title creator publisher subject acquired_at
2
+ "00001" たなべ// こうすけ test1 test1// test2
3
+ "00002" test2
4
+ "00003" テスト3 2012-01-01
@@ -0,0 +1,19 @@
1
+ manifestation_identifier original_title note title_transcription title_alternative periodical series_statement_identifier series_title series_title_transcription creator creator_transcription publisher publisher_transcription pub_date volume_number_string edition isbn issn manifestation_price item_price height shelf item_identifier nbn lccn subject budget_type bookstore dummy
2
+ 資料ID タイトル 注記 タイトルよみ 代替タイトル 定期刊行物フラグ シリーズ番号 シリーズタイトル シリーズタイトルよみ 著者 著者よみ 出版者 出版者よみ 出版日 巻 版 isbn issn 販売価格 受入価格 高さ 書架名 個別資料ID nbn lccn 件名 インポート省略
3
+ test1 ○ identifierなし、item_identifierなし test てすと test2 invalid
4
+ test2 ○ identifierなし、item_identifierあり test||author//test1||illustrator 2001 10101 Public fund Example store
5
+ 101 test3 × ダミー test test2 Public fund Example store 適当な値
6
+ 101 test3 ○ identifierあり、item_identifierなし 主シリーズ//副シリーズ//1 しゅしりーず//ふくしりーず//いち test test2
7
+ 102 test4 ○ identifierあり、item_identifierあり test1 test 2001-1 10102
8
+ 101 “test 5” △ identifier重複、item_identifier非重複 test1||author//test2||illustrator てすと1//てすと2 test 10103 Example store
9
+ 102 test6 × identifier重複、item_identifier重複 test test3 10101
10
+ test7 ○ ISBN不正、タイトルあり、所蔵情報あり 2001-1-1 9000000000000 first_shelf 10104 Public fund
11
+ × ISBN不正、タイトルなし 22222222 10105
12
+ test8 ○ ISBNなし、所蔵情報あり test test4//test5 てすと4//てすと5 1000 0 first_shelf 11111
13
+ test9 × item_identifier重複 11111
14
+ ○ ISBN重複(シリーズ情報あり)、item_identifierなし 4798002062
15
+ △ ISBN重複(シリーズ情報なし)、item_identifier非重複 4798002062 11112
16
+ × ISBN重複、item_identifier重複 4798002062 11111
17
+ × ISBN重複(13桁)、item_identifierなし 978-4798002064
18
+ 103 "ダブル""クォート""を含む資料" ○ ダブルクォートを含む資料
19
+ 104 test10 ○ TSV中にタイトルがあれば他の項目もTSVファイル優先 test3 test4 4797327030
@@ -0,0 +1,19 @@
1
+ manifestation_identifier original_title note title_transcription title_alternative periodical series_statement_identifier series_title series_title_transcription creator creator_transcription publisher publisher_transcription pub_date volume_number_string edition isbn issn manifestation_price item_price height shelf item_identifier nbn lccn subject budget_type bookstore dummy
2
+ ����ID �^�C�g�� ���L �^�C�g����� ��փ^�C�g�� ������s���t���O �V���[�Y�ԍ� �V���[�Y�^�C�g�� �V���[�Y�^�C�g����� ���� ���҂�� �o�Ŏ� �o�Ŏ҂�� �o�œ� �� �� isbn issn �̔����i ������i ���� ���˖� �•ʎ���ID nbn lccn ���� �C���|�[�g�ȗ�
3
+ test1 �� identifier�Ȃ��Aitem_identifier�Ȃ� test �Ă��� test2 invalid
4
+ test2 �� identifier�Ȃ��Aitem_identifier���� test||author//test1||illustrator 2001 10101 Public fund Example store
5
+ 101 test3 �~ �_�~�[ test test2 Public fund Example store �K���Ȓl
6
+ 101 test3 �� identifier����Aitem_identifier�Ȃ� ��V���[�Y//���V���[�Y//1 ���サ��[��//�ӂ�����[��//���� test test2
7
+ 102 test4 �� identifier����Aitem_identifier���� test1 test 2001-1 10102
8
+ 101 �gtest 5�h �� identifier�d���Aitem_identifier��d�� test1||author//test2||illustrator ����1//����2 test 10103 Example store
9
+ 102 test6 �~ identifier�d���Aitem_identifier�d�� test test3 10101
10
+ test7 �� ISBN�s���A�^�C�g������A������񂠂� 2001-1-1 9000000000000 first_shelf 10104 Public fund
11
+ �~ ISBN�s���A�^�C�g���Ȃ� 22222222 10105
12
+ test8 �� ISBN�Ȃ��A������񂠂� test test4//test5 �Ă���4//�Ă���5 1000 0 first_shelf 11111
13
+ test9 �~ item_identifier�d�� 11111
14
+ �� ISBN�d���i�V���[�Y��񂠂�j�Aitem_identifier�Ȃ� 4798002062
15
+ �� ISBN�d���i�V���[�Y���Ȃ��j�Aitem_identifier��d�� 4798002062 11112
16
+ �~ ISBN�d���Aitem_identifier�d�� 4798002062 11111
17
+ �~ ISBN�d���i13���j�Aitem_identifier�Ȃ� 978-4798002064
18
+ 103 "�_�u��""�N�H�[�g""���܂ގ���" �� �_�u���N�H�[�g���܂ގ���
19
+ 104 test10 �� TSV���Ƀ^�C�g��������Α��̍��ڂ�TSV�t�@�C���D�� test3 test4 4797327030
@@ -60,7 +60,12 @@
60
60
  <fieldType name="rand" class="solr.RandomSortField" omitNorms="true"/>
61
61
  <!-- *** This fieldType is used by Sunspot! *** -->
62
62
  <fieldType name="text" class="solr.TextField" omitNorms="false">
63
- <analyzer>
63
+ <analyzer type="index" class="org.apache.lucene.analysis.cjk.CJKAnalyzer">
64
+ <tokenizer class="solr.StandardTokenizerFactory"/>
65
+ <filter class="solr.StandardFilterFactory"/>
66
+ <filter class="solr.LowerCaseFilterFactory"/>
67
+ </analyzer>
68
+ <analyzer type="query" class="org.apache.lucene.analysis.cjk.CJKAnalyzer">
64
69
  <tokenizer class="solr.StandardTokenizerFactory"/>
65
70
  <filter class="solr.StandardFilterFactory"/>
66
71
  <filter class="solr.LowerCaseFilterFactory"/>
@@ -235,4 +240,5 @@
235
240
  <!-- copyField commands copy one field to another at the time a document
236
241
  is added to the index. It's used either to index the same field differently,
237
242
  or to add multiple fields to the same field for easier/faster searching. -->
243
+ <copyField source="*_text" dest="text" />
238
244
  </schema>
@@ -0,0 +1,5 @@
1
+ ����idtype
2
+ class_nametitle_smconnect_title_sconnect_creator_sconnect_publisher_sisbn_smcarrier_type_s
3
+ language_s created_at_d updated_at_ddate_of_publication_dmsort_date_of_publication_drequired_role_id_irepository_content_b sort_title_s periodical_bperiodical_master_b reservable_b
4
+ title_texttext btitle_text isbn_textvolume_number_imissue_number_impatron_type_id_i name_text
5
+ position_imanifestation_ids_imseries_statement_id_i
@@ -0,0 +1 @@
1
+ NRM�||t|||||y|y||t|||||y|y���||�||�|�|||qu||||||
File without changes
@@ -411,7 +411,7 @@ manifestation_00114:
411
411
  price:
412
412
  manifestation_identifier:
413
413
  depth:
414
- date_of_publication: 2001-03-20
414
+ pub_date: 2001-03-20
415
415
  access_address:
416
416
  id: 114
417
417
  height:
@@ -441,7 +441,7 @@ manifestation_00116:
441
441
  price:
442
442
  manifestation_identifier:
443
443
  depth:
444
- date_of_publication: 1991-12-24
444
+ pub_date: 1991-12-24
445
445
  access_address:
446
446
  id: 116
447
447
  height:
@@ -501,7 +501,7 @@ manifestation_00120:
501
501
  price:
502
502
  manifestation_identifier:
503
503
  depth:
504
- date_of_publication: 2000-10-01
504
+ pub_date: 2000-10-01
505
505
  access_address:
506
506
  id: 120
507
507
  height:
@@ -1581,7 +1581,7 @@ manifestation_00192:
1581
1581
  price:
1582
1582
  manifestation_identifier:
1583
1583
  depth:
1584
- date_of_publication: 2007-04-27
1584
+ pub_date: 2007-04-27
1585
1585
  access_address:
1586
1586
  id: 192
1587
1587
  height:
@@ -1597,7 +1597,7 @@ manifestation_00193:
1597
1597
  price:
1598
1598
  manifestation_identifier:
1599
1599
  depth:
1600
- date_of_publication: 2007-02-01
1600
+ pub_date: 2007-02-01
1601
1601
  access_address:
1602
1602
  id: 193
1603
1603
  height:
@@ -1642,7 +1642,7 @@ manifestation_00196:
1642
1642
  price:
1643
1643
  manifestation_identifier:
1644
1644
  depth:
1645
- date_of_publication: 2006-08-05
1645
+ pub_date: 2006-08-05
1646
1646
  access_address:
1647
1647
  id: 196
1648
1648
  height:
@@ -18,6 +18,13 @@ describe Manifestation, :solr => true do
18
18
  manifestation.date_of_publication.should eq Time.zone.parse('2000-01-01')
19
19
  end
20
20
 
21
+ it "should set volume_number" do
22
+ manifestation = FactoryGirl.create(:manifestation, :volume_number_string => '第1巻', :issue_number_string => '20号分冊1', :edition_string => '第3版')
23
+ manifestation.volume_number.should eq 1
24
+ manifestation.issue_number.should eq 20
25
+ manifestation.edition.should eq 3
26
+ end
27
+
21
28
  it "should search title in openurl" do
22
29
  openurl = Openurl.new({:title => "プログラミング"})
23
30
  results = openurl.search
@@ -140,7 +147,7 @@ describe Manifestation, :solr => true do
140
147
  #TODO ソート基準が入手しやすさの場合の処理
141
148
  end
142
149
 
143
- it "should accept rangs in sru" do
150
+ it "should accept ranges in sru" do
144
151
  sru = Sru.new({:query => "from = 1993-02-24 AND until = 2006-08-06 AND title=プログラミング"})
145
152
  sru.search
146
153
  sru.manifestations.size.should eq 2