enju_biblio 0.3.11 → 0.3.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/agent_import_results_controller.rb +1 -1
- data/app/controllers/agents_controller.rb +0 -6
- data/app/controllers/items_controller.rb +15 -10
- data/app/controllers/manifestations_controller.rb +68 -76
- data/app/controllers/resource_import_results_controller.rb +2 -2
- data/app/controllers/series_statements_controller.rb +0 -6
- data/app/helpers/manifestations_helper.rb +8 -8
- data/app/models/agent.rb +10 -1
- data/app/models/form_of_work.rb +1 -1
- data/app/models/frequency.rb +1 -1
- data/app/models/identifier.rb +1 -1
- data/app/models/import_request.rb +2 -3
- data/app/models/item.rb +6 -6
- data/app/models/item_custom_value.rb +1 -1
- data/app/models/manifestation.rb +10 -18
- data/app/models/manifestation_custom_value.rb +1 -1
- data/app/models/resource_import_file.rb +8 -4
- data/app/views/agent_import_results/{index.txt.ruby → index.text.ruby} +0 -0
- data/app/views/agent_relationship_types/index.html.erb +3 -3
- data/app/views/agents/index.rss.builder +2 -2
- data/app/views/items/_item.json.jbuilder +17 -0
- data/app/views/items/index.json.jbuilder +5 -0
- data/app/views/items/index.text.ruby +13 -0
- data/app/views/items/show.html.erb +125 -125
- data/app/views/items/show.json.jbuilder +1 -0
- data/app/views/layouts/agents.html.erb +2 -2
- data/app/views/layouts/manifestations.html.erb +2 -2
- data/app/views/manifestations/_carrier_type_facet.html.erb +1 -1
- data/app/views/manifestations/_classification_facet.html.erb +2 -2
- data/app/views/manifestations/_export_list.html.erb +4 -4
- data/app/views/manifestations/_form.html.erb +3 -3
- data/app/views/manifestations/_language_facet.html.erb +1 -1
- data/app/views/manifestations/_library_facet.html.erb +1 -1
- data/app/views/manifestations/_pub_year_facet.html.erb +1 -1
- data/app/views/manifestations/_reservable_facet.html.erb +2 -2
- data/app/views/manifestations/_show_detail_librarian.html.erb +12 -8
- data/app/views/manifestations/_show_detail_user.html.erb +12 -8
- data/app/views/manifestations/_title.html.erb +1 -1
- data/app/views/manifestations/index.html.erb +7 -7
- data/app/views/manifestations/index.rdf.builder +2 -2
- data/app/views/manifestations/index.rss.builder +2 -2
- data/app/views/manifestations/index.text.ruby +13 -0
- data/app/views/manifestations/{show.txt.ruby → show.text.ruby} +0 -0
- data/app/views/resource_import_results/{index.txt.ruby → index.text.ruby} +0 -0
- data/lib/enju_biblio/version.rb +1 -1
- data/lib/enju_biblio.rb +0 -2
- data/spec/controllers/items_controller_spec.rb +41 -0
- data/spec/controllers/manifestations_controller_spec.rb +2 -21
- data/spec/fixtures/items.yml +1 -0
- data/spec/fixtures/manifestations.yml +1 -0
- data/spec/models/manifestation_spec.rb +11 -66
- data/spec/models/resource_import_file_spec.rb +18 -0
- data/spec/system/items_spec.rb +6 -0
- data/spec/views/agent_import_results/{index.txt.ruby_spec.rb → index.text.ruby_spec.rb} +1 -1
- data/spec/views/items/index.json.jbuilder_spec.rb +15 -0
- data/spec/views/items/show.json.jbuilder_spec.rb +15 -0
- data/spec/views/manifestations/index.html.erb_spec.rb +1 -1
- data/spec/views/manifestations/index.rdf.builder_spec.rb +0 -1
- data/spec/views/manifestations/{index.txt.ruby_spec.rb → index.text.ruby_spec.rb} +1 -1
- data/spec/views/manifestations/{show.txt.ruby_spec.rb → show.text.ruby_spec.rb} +1 -1
- data/spec/views/resource_import_results/{index.txt.ruby_spec.rb → index.text.ruby_spec.rb} +1 -1
- metadata +37 -34
- data/app/views/items/index.txt.erb +0 -4
- data/app/views/manifestations/explain.sru +0 -9
- data/app/views/manifestations/index.sru.builder +0 -101
- data/app/views/manifestations/index.txt.ruby +0 -7
- data/lib/enju_biblio/porta_cql.rb +0 -282
- data/lib/enju_biblio/sru.rb +0 -85
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: enju_biblio
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kosuke Tanabe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-03-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: enju_library
|
@@ -128,28 +128,28 @@ dependencies:
|
|
128
128
|
requirements:
|
129
129
|
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: 1.3.
|
131
|
+
version: 1.3.5
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: 1.3.
|
138
|
+
version: 1.3.5
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: enju_subject
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
143
|
- - "~>"
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version: 0.3.
|
145
|
+
version: 0.3.2
|
146
146
|
type: :development
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
150
|
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version: 0.3.
|
152
|
+
version: 0.3.2
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: enju_inventory
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
@@ -170,42 +170,42 @@ dependencies:
|
|
170
170
|
requirements:
|
171
171
|
- - "~>"
|
172
172
|
- !ruby/object:Gem::Version
|
173
|
-
version: 0.3.
|
173
|
+
version: 0.3.1
|
174
174
|
type: :development
|
175
175
|
prerelease: false
|
176
176
|
version_requirements: !ruby/object:Gem::Requirement
|
177
177
|
requirements:
|
178
178
|
- - "~>"
|
179
179
|
- !ruby/object:Gem::Version
|
180
|
-
version: 0.3.
|
180
|
+
version: 0.3.1
|
181
181
|
- !ruby/object:Gem::Dependency
|
182
182
|
name: enju_message
|
183
183
|
requirement: !ruby/object:Gem::Requirement
|
184
184
|
requirements:
|
185
185
|
- - "~>"
|
186
186
|
- !ruby/object:Gem::Version
|
187
|
-
version: 0.3.
|
187
|
+
version: 0.3.4
|
188
188
|
type: :development
|
189
189
|
prerelease: false
|
190
190
|
version_requirements: !ruby/object:Gem::Requirement
|
191
191
|
requirements:
|
192
192
|
- - "~>"
|
193
193
|
- !ruby/object:Gem::Version
|
194
|
-
version: 0.3.
|
194
|
+
version: 0.3.4
|
195
195
|
- !ruby/object:Gem::Dependency
|
196
196
|
name: enju_event
|
197
197
|
requirement: !ruby/object:Gem::Requirement
|
198
198
|
requirements:
|
199
199
|
- - "~>"
|
200
200
|
- !ruby/object:Gem::Version
|
201
|
-
version: 0.3.
|
201
|
+
version: 0.3.5
|
202
202
|
type: :development
|
203
203
|
prerelease: false
|
204
204
|
version_requirements: !ruby/object:Gem::Requirement
|
205
205
|
requirements:
|
206
206
|
- - "~>"
|
207
207
|
- !ruby/object:Gem::Version
|
208
|
-
version: 0.3.
|
208
|
+
version: 0.3.5
|
209
209
|
- !ruby/object:Gem::Dependency
|
210
210
|
name: enju_ndl
|
211
211
|
requirement: !ruby/object:Gem::Requirement
|
@@ -282,14 +282,14 @@ dependencies:
|
|
282
282
|
requirements:
|
283
283
|
- - "~>"
|
284
284
|
- !ruby/object:Gem::Version
|
285
|
-
version: '
|
285
|
+
version: '5.0'
|
286
286
|
type: :development
|
287
287
|
prerelease: false
|
288
288
|
version_requirements: !ruby/object:Gem::Requirement
|
289
289
|
requirements:
|
290
290
|
- - "~>"
|
291
291
|
- !ruby/object:Gem::Version
|
292
|
-
version: '
|
292
|
+
version: '5.0'
|
293
293
|
- !ruby/object:Gem::Dependency
|
294
294
|
name: factory_bot_rails
|
295
295
|
requirement: !ruby/object:Gem::Requirement
|
@@ -431,7 +431,7 @@ dependencies:
|
|
431
431
|
- !ruby/object:Gem::Version
|
432
432
|
version: '0'
|
433
433
|
- !ruby/object:Gem::Dependency
|
434
|
-
name:
|
434
|
+
name: annotate
|
435
435
|
requirement: !ruby/object:Gem::Requirement
|
436
436
|
requirements:
|
437
437
|
- - ">="
|
@@ -445,7 +445,7 @@ dependencies:
|
|
445
445
|
- !ruby/object:Gem::Version
|
446
446
|
version: '0'
|
447
447
|
- !ruby/object:Gem::Dependency
|
448
|
-
name:
|
448
|
+
name: puma
|
449
449
|
requirement: !ruby/object:Gem::Requirement
|
450
450
|
requirements:
|
451
451
|
- - ">="
|
@@ -637,7 +637,7 @@ files:
|
|
637
637
|
- app/views/agent_import_mailer/failed.en.text
|
638
638
|
- app/views/agent_import_mailer/failed.ja.text.erb
|
639
639
|
- app/views/agent_import_results/index.html.erb
|
640
|
-
- app/views/agent_import_results/index.
|
640
|
+
- app/views/agent_import_results/index.text.ruby
|
641
641
|
- app/views/agent_import_results/show.html.erb
|
642
642
|
- app/views/agent_merge_lists/_form.html.erb
|
643
643
|
- app/views/agent_merge_lists/edit.html.erb
|
@@ -746,6 +746,7 @@ files:
|
|
746
746
|
- app/views/item_custom_properties/new.html.erb
|
747
747
|
- app/views/item_custom_properties/show.html.erb
|
748
748
|
- app/views/items/_form.html.erb
|
749
|
+
- app/views/items/_item.json.jbuilder
|
749
750
|
- app/views/items/_observe_field.html.erb
|
750
751
|
- app/views/items/_shelf_picture.html+phone.erb
|
751
752
|
- app/views/items/_shelf_picture.html.erb
|
@@ -753,10 +754,12 @@ files:
|
|
753
754
|
- app/views/items/edit.html.erb
|
754
755
|
- app/views/items/index.html+phone.erb
|
755
756
|
- app/views/items/index.html.erb
|
756
|
-
- app/views/items/index.
|
757
|
+
- app/views/items/index.json.jbuilder
|
758
|
+
- app/views/items/index.text.ruby
|
757
759
|
- app/views/items/new.html.erb
|
758
760
|
- app/views/items/show.html+phone.erb
|
759
761
|
- app/views/items/show.html.erb
|
762
|
+
- app/views/items/show.json.jbuilder
|
760
763
|
- app/views/languages/_form.html.erb
|
761
764
|
- app/views/languages/edit.html.erb
|
762
765
|
- app/views/languages/index.html.erb
|
@@ -853,7 +856,6 @@ files:
|
|
853
856
|
- app/views/manifestations/_title.html.erb
|
854
857
|
- app/views/manifestations/edit.html.erb
|
855
858
|
- app/views/manifestations/error.xml
|
856
|
-
- app/views/manifestations/explain.sru
|
857
859
|
- app/views/manifestations/index.atom.builder
|
858
860
|
- app/views/manifestations/index.html+phone.erb
|
859
861
|
- app/views/manifestations/index.html.erb
|
@@ -862,8 +864,7 @@ files:
|
|
862
864
|
- app/views/manifestations/index.opds.builder
|
863
865
|
- app/views/manifestations/index.rdf.builder
|
864
866
|
- app/views/manifestations/index.rss.builder
|
865
|
-
- app/views/manifestations/index.
|
866
|
-
- app/views/manifestations/index.txt.ruby
|
867
|
+
- app/views/manifestations/index.text.ruby
|
867
868
|
- app/views/manifestations/new.html.erb
|
868
869
|
- app/views/manifestations/show.html+phone.erb
|
869
870
|
- app/views/manifestations/show.html.erb
|
@@ -871,7 +872,7 @@ files:
|
|
871
872
|
- app/views/manifestations/show.json.jbuilder
|
872
873
|
- app/views/manifestations/show.mods.builder
|
873
874
|
- app/views/manifestations/show.rdf.builder
|
874
|
-
- app/views/manifestations/show.
|
875
|
+
- app/views/manifestations/show.text.ruby
|
875
876
|
- app/views/medium_of_performances/_form.html.erb
|
876
877
|
- app/views/medium_of_performances/edit.html.erb
|
877
878
|
- app/views/medium_of_performances/index.html.erb
|
@@ -942,7 +943,7 @@ files:
|
|
942
943
|
- app/views/resource_import_results/_list.html.erb
|
943
944
|
- app/views/resource_import_results/_list_lines.html.erb
|
944
945
|
- app/views/resource_import_results/index.html.erb
|
945
|
-
- app/views/resource_import_results/index.
|
946
|
+
- app/views/resource_import_results/index.text.ruby
|
946
947
|
- app/views/resource_import_results/show.html.erb
|
947
948
|
- app/views/series_statement_merge_lists/_form.html.erb
|
948
949
|
- app/views/series_statement_merge_lists/edit.html.erb
|
@@ -1079,8 +1080,6 @@ files:
|
|
1079
1080
|
- lib/enju_biblio.rb
|
1080
1081
|
- lib/enju_biblio/engine.rb
|
1081
1082
|
- lib/enju_biblio/openurl.rb
|
1082
|
-
- lib/enju_biblio/porta_cql.rb
|
1083
|
-
- lib/enju_biblio/sru.rb
|
1084
1083
|
- lib/enju_biblio/version.rb
|
1085
1084
|
- lib/generators/enju_biblio/setup/USAGE
|
1086
1085
|
- lib/generators/enju_biblio/setup/setup_generator.rb
|
@@ -1599,7 +1598,7 @@ files:
|
|
1599
1598
|
- spec/system/manifestations_spec.rb
|
1600
1599
|
- spec/system/series_statements_spec.rb
|
1601
1600
|
- spec/views/agent_import_results/index.html.erb_spec.rb
|
1602
|
-
- spec/views/agent_import_results/index.
|
1601
|
+
- spec/views/agent_import_results/index.text.ruby_spec.rb
|
1603
1602
|
- spec/views/agent_import_results/show.html.erb_spec.rb
|
1604
1603
|
- spec/views/agent_types/edit.html.erb_spec.rb
|
1605
1604
|
- spec/views/agent_types/index.html.erb_spec.rb
|
@@ -1622,16 +1621,18 @@ files:
|
|
1622
1621
|
- spec/views/item_custom_properties/new.html.erb_spec.rb
|
1623
1622
|
- spec/views/item_custom_properties/show.html.erb_spec.rb
|
1624
1623
|
- spec/views/items/index.html.erb_spec.rb
|
1624
|
+
- spec/views/items/index.json.jbuilder_spec.rb
|
1625
|
+
- spec/views/items/show.json.jbuilder_spec.rb
|
1625
1626
|
- spec/views/manifestation_custom_properties/edit.html.erb_spec.rb
|
1626
1627
|
- spec/views/manifestation_custom_properties/index.html.erb_spec.rb
|
1627
1628
|
- spec/views/manifestation_custom_properties/new.html.erb_spec.rb
|
1628
1629
|
- spec/views/manifestation_custom_properties/show.html.erb_spec.rb
|
1629
1630
|
- spec/views/manifestations/index.html.erb_spec.rb
|
1630
1631
|
- spec/views/manifestations/index.rdf.builder_spec.rb
|
1631
|
-
- spec/views/manifestations/index.
|
1632
|
+
- spec/views/manifestations/index.text.ruby_spec.rb
|
1632
1633
|
- spec/views/manifestations/show.html.erb_spec.rb
|
1633
1634
|
- spec/views/manifestations/show.json.jbuilder_spec.rb
|
1634
|
-
- spec/views/manifestations/show.
|
1635
|
+
- spec/views/manifestations/show.text.ruby_spec.rb
|
1635
1636
|
- spec/views/owns/edit.html.erb_spec.rb
|
1636
1637
|
- spec/views/owns/index.html.erb_spec.rb
|
1637
1638
|
- spec/views/owns/new.html.erb_spec.rb
|
@@ -1659,7 +1660,7 @@ files:
|
|
1659
1660
|
- spec/views/resource_import_files/index.html.erb_spec.rb
|
1660
1661
|
- spec/views/resource_import_files/show.html.erb_spec.rb
|
1661
1662
|
- spec/views/resource_import_results/index.html.erb_spec.rb
|
1662
|
-
- spec/views/resource_import_results/index.
|
1663
|
+
- spec/views/resource_import_results/index.text.ruby_spec.rb
|
1663
1664
|
- spec/views/resource_import_results/show.html.erb_spec.rb
|
1664
1665
|
- spec/views/series_statement_merge_lists/edit.html.erb_spec.rb
|
1665
1666
|
- spec/views/series_statement_merge_lists/index.html.erb_spec.rb
|
@@ -1692,7 +1693,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1692
1693
|
- !ruby/object:Gem::Version
|
1693
1694
|
version: '0'
|
1694
1695
|
requirements: []
|
1695
|
-
rubygems_version: 3.1.
|
1696
|
+
rubygems_version: 3.1.6
|
1696
1697
|
signing_key:
|
1697
1698
|
specification_version: 4
|
1698
1699
|
summary: enju_biblio plugin
|
@@ -1994,11 +1995,11 @@ test_files:
|
|
1994
1995
|
- spec/factories/agent.rb
|
1995
1996
|
- spec/factories/role.rb
|
1996
1997
|
- spec/factories/basket.rb
|
1997
|
-
- spec/views/manifestations/show.
|
1998
|
+
- spec/views/manifestations/show.text.ruby_spec.rb
|
1998
1999
|
- spec/views/manifestations/show.json.jbuilder_spec.rb
|
1999
2000
|
- spec/views/manifestations/index.rdf.builder_spec.rb
|
2000
2001
|
- spec/views/manifestations/index.html.erb_spec.rb
|
2001
|
-
- spec/views/manifestations/index.
|
2002
|
+
- spec/views/manifestations/index.text.ruby_spec.rb
|
2002
2003
|
- spec/views/manifestations/show.html.erb_spec.rb
|
2003
2004
|
- spec/views/creates/new.html.erb_spec.rb
|
2004
2005
|
- spec/views/creates/edit.html.erb_spec.rb
|
@@ -2023,7 +2024,7 @@ test_files:
|
|
2023
2024
|
- spec/views/create_types/index.html.erb_spec.rb
|
2024
2025
|
- spec/views/create_types/show.html.erb_spec.rb
|
2025
2026
|
- spec/views/agent_import_results/index.html.erb_spec.rb
|
2026
|
-
- spec/views/agent_import_results/index.
|
2027
|
+
- spec/views/agent_import_results/index.text.ruby_spec.rb
|
2027
2028
|
- spec/views/agent_import_results/show.html.erb_spec.rb
|
2028
2029
|
- spec/views/resource_export_files/new.html.erb_spec.rb
|
2029
2030
|
- spec/views/resource_export_files/edit.html.erb_spec.rb
|
@@ -2033,7 +2034,9 @@ test_files:
|
|
2033
2034
|
- spec/views/item_custom_properties/edit.html.erb_spec.rb
|
2034
2035
|
- spec/views/item_custom_properties/index.html.erb_spec.rb
|
2035
2036
|
- spec/views/item_custom_properties/show.html.erb_spec.rb
|
2037
|
+
- spec/views/items/show.json.jbuilder_spec.rb
|
2036
2038
|
- spec/views/items/index.html.erb_spec.rb
|
2039
|
+
- spec/views/items/index.json.jbuilder_spec.rb
|
2037
2040
|
- spec/views/series_statement_merge_lists/new.html.erb_spec.rb
|
2038
2041
|
- spec/views/series_statement_merge_lists/edit.html.erb_spec.rb
|
2039
2042
|
- spec/views/series_statement_merge_lists/index.html.erb_spec.rb
|
@@ -2059,7 +2062,7 @@ test_files:
|
|
2059
2062
|
- spec/views/import_requests/index.html.erb_spec.rb
|
2060
2063
|
- spec/views/import_requests/show.html.erb_spec.rb
|
2061
2064
|
- spec/views/resource_import_results/index.html.erb_spec.rb
|
2062
|
-
- spec/views/resource_import_results/index.
|
2065
|
+
- spec/views/resource_import_results/index.text.ruby_spec.rb
|
2063
2066
|
- spec/views/resource_import_results/show.html.erb_spec.rb
|
2064
2067
|
- spec/views/manifestation_custom_properties/new.html.erb_spec.rb
|
2065
2068
|
- spec/views/manifestation_custom_properties/edit.html.erb_spec.rb
|
@@ -1,4 +0,0 @@
|
|
1
|
-
title,isbn item_identifier call_number created_at
|
2
|
-
<%- @items.each do |item| -%>
|
3
|
-
"<%=h item.manifestation.original_title.gsub(/"/, '""') if item.manifestation -%>" <%=h item.manifestation.identifier_contents(:isbn).join("; ") %> <%=h item.item_identifier -%> <%=h item.call_number -%> <%=h item.created_at %><%= "\n" -%>
|
4
|
-
<%- end -%>
|
@@ -1,9 +0,0 @@
|
|
1
|
-
<sru:explainResponse xmlns:sru="http://www.loc.gov/zing/srw/">
|
2
|
-
<sru:version>1.2</sru:version>
|
3
|
-
<sru:record>
|
4
|
-
<sru:recordPacking>XML</sru:recordPacking>
|
5
|
-
<sru:recordSchema>http://explain.z3950.org/dtd/2.1/</sru:recordSchema>
|
6
|
-
<sru:recordData>
|
7
|
-
</sru:recordData>
|
8
|
-
</sru:record>
|
9
|
-
</sru:explainResponse>
|
@@ -1,101 +0,0 @@
|
|
1
|
-
if @sru
|
2
|
-
unless @sru.extra_response_data.empty?
|
3
|
-
@extra_response = true
|
4
|
-
@facets = @sru.extra_response_data[:facets]
|
5
|
-
@dpid = @sru.extra_response_data[:dpid]
|
6
|
-
@webget = @sru.extra_response_data[:webget]
|
7
|
-
@digitalize = @sru.extra_response_data[:digitalize]
|
8
|
-
@porta_type = @sru.extra_response_data[:porta_type]
|
9
|
-
@payment = @sru.extra_response_data[:payment]
|
10
|
-
@ndc = @sru.extra_response_data[:ndc]
|
11
|
-
@date = @sru.extra_response_data[:date]
|
12
|
-
end
|
13
|
-
|
14
|
-
@version = @sru.version
|
15
|
-
@packing = @sru.packing
|
16
|
-
@number_of_records = @manifestations.total_count
|
17
|
-
@next_record_position = @sru.start + @manifestations.limit_value
|
18
|
-
end
|
19
|
-
|
20
|
-
def search_retrieve_response!(xml)
|
21
|
-
xml.searchRetrieveResponse xmlns: "http://www.loc.gov/zing/srw/" do
|
22
|
-
xml.version @version
|
23
|
-
xml.numberOfRecords @number_of_records
|
24
|
-
extra_response_data!(xml) if @extra_response
|
25
|
-
xml.records do
|
26
|
-
@manifestations.each_with_index do |rec, idx|
|
27
|
-
xml.record do
|
28
|
-
record!(xml, rec, idx + 1)
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
xml.nextRecordPosition @next_record_position
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
def extra_response_data!(xml)
|
37
|
-
xml.extraResponseData do
|
38
|
-
xml.facets @facets do
|
39
|
-
lst_tag!(xml, "REPOSITORY_NO", 'dcndl_porta:dpid', @dpid)
|
40
|
-
lst_tag!(xml, "WEBGET_TYPE", 'dcndl_porta:type.Web-get', @webget)
|
41
|
-
lst_tag!(xml, "DIGITALIZE_TYPE", 'dcndl_porta:type.Digitalize', @digitalize)
|
42
|
-
lst_tag!(xml, "PORTA_TYPE", 'dcndl_porta:PORTAType', @porta_type)
|
43
|
-
lst_tag!(xml, "PAYMENT_TYPE", 'dcndl_porta:type.Payment', @payment)
|
44
|
-
lst_tag!(xml, "NDC", 'int', @ndc)
|
45
|
-
lst_tag!(xml, "ISSUED_DATE", 'int', @date)
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
def lst_tag!(xml, lst_name, tag_name, hash)
|
51
|
-
xml.lst name: lst_name do
|
52
|
-
value_sort(hash).each do |item|
|
53
|
-
xml.tag! tag_name, {name: item[0]}, item[1]
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
|
-
def record!(xml, rec, position)
|
59
|
-
xml.recordSchema 'info:srw/schema/1/dc-v1.1'
|
60
|
-
xml.recordPacking @packing
|
61
|
-
xml.recordData{|x| x << (/\Axml\Z/io =~ @packing ? get_record(rec) : CGI::escapeHTML(get_record(rec)))}
|
62
|
-
xml.recordPosition position
|
63
|
-
end
|
64
|
-
|
65
|
-
def get_record(manifestation)
|
66
|
-
xml = Builder::XmlMarkup.new
|
67
|
-
xml.tag! 'srw_dc:dc',
|
68
|
-
'xmlns:dc' => "http://purl.org/dc/elements/1.1/",
|
69
|
-
'xmlns:srw_dc' => "info:srw/schema/1/dc-v1.1",
|
70
|
-
'xmlns:xsi' => "http://www.w3.org/2001/XMLSchema-instance",
|
71
|
-
'xsi:schemaLocation' => "info:srw/schema/1/dc-v1.1 http://www.loc.gov/standards/sru/dc-schema.xsd" do
|
72
|
-
cache([manifestation, fragment: 'index_sru', role: current_user_role_name, locale: @locale]) do
|
73
|
-
xml.tag! 'dc:title', manifestation.original_title
|
74
|
-
manifestation.creators.readable_by(current_user).each do |agent|
|
75
|
-
xml.tag! 'dc:creator', agent.full_name
|
76
|
-
end
|
77
|
-
manifestation.contributors.each do |agent|
|
78
|
-
xml.tag! 'dc:contributor', agent.full_name
|
79
|
-
end
|
80
|
-
manifestation.publishers.each do |agent|
|
81
|
-
xml.tag! 'dc:publisher', agent.full_name
|
82
|
-
end
|
83
|
-
if defined?(EnjuSubject)
|
84
|
-
manifestation.subjects.each do |subject|
|
85
|
-
xml.tag! "dc:subject", subject.term
|
86
|
-
end
|
87
|
-
end
|
88
|
-
xml.tag! 'dc:description', manifestation.description
|
89
|
-
end
|
90
|
-
end
|
91
|
-
end
|
92
|
-
|
93
|
-
def value_sort(hash)
|
94
|
-
hash.to_a.sort do |a, b|
|
95
|
-
(b[1] <=> a[1]) * 2 + (a[0] <=> b[0])
|
96
|
-
end
|
97
|
-
end
|
98
|
-
|
99
|
-
xml = Builder::XmlMarkup.new indent: 2
|
100
|
-
xml.instruct! directive_tag=:xml, encoding: 'UTF-8'
|
101
|
-
search_retrieve_response!(xml)
|