enju_biblio 0.1.0.pre56 → 0.1.0.pre57
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_files_controller.rb +1 -1
- data/app/controllers/agent_import_results_controller.rb +30 -6
- data/app/controllers/agent_relationship_types_controller.rb +74 -4
- data/app/controllers/agent_relationships_controller.rb +92 -10
- data/app/controllers/agent_types_controller.rb +74 -3
- data/app/controllers/carrier_types_controller.rb +1 -1
- data/app/controllers/content_types_controller.rb +74 -4
- data/app/controllers/countries_controller.rb +66 -4
- data/app/controllers/create_types_controller.rb +74 -3
- data/app/controllers/extents_controller.rb +74 -4
- data/app/controllers/form_of_works_controller.rb +74 -4
- data/app/controllers/frequencies_controller.rb +74 -4
- data/app/controllers/identifier_types_controller.rb +4 -5
- data/app/controllers/import_requests_controller.rb +1 -1
- data/app/controllers/languages_controller.rb +66 -4
- data/app/controllers/licenses_controller.rb +74 -3
- data/app/controllers/manifestation_relationship_types_controller.rb +74 -3
- data/app/controllers/manifestation_relationships_controller.rb +92 -9
- data/app/controllers/medium_of_performances_controller.rb +74 -3
- data/app/controllers/picture_files_controller.rb +34 -10
- data/app/controllers/produce_types_controller.rb +74 -3
- data/app/controllers/realize_types_controller.rb +74 -3
- data/app/controllers/resource_import_files_controller.rb +2 -1
- data/app/controllers/resource_import_results_controller.rb +31 -11
- data/app/models/agent_import_file.rb +1 -1
- data/app/models/agent_import_result.rb +0 -2
- data/app/models/carrier_type.rb +1 -1
- data/app/models/identifier.rb +5 -0
- data/app/models/item.rb +1 -1
- data/app/models/manifestation.rb +13 -8
- data/app/models/resource_import_file.rb +73 -79
- data/app/views/agent_import_files/index.html.erb +1 -0
- data/app/views/agent_relationship_types/index.html.erb +5 -4
- data/app/views/agent_types/index.html.erb +5 -4
- data/app/views/carrier_types/index.html.erb +2 -1
- data/app/views/content_types/index.html.erb +1 -0
- data/app/views/countries/show.html.erb +5 -0
- data/app/views/create_types/index.html.erb +5 -4
- data/app/views/extents/index.html.erb +2 -1
- data/app/views/form_of_works/index.html.erb +2 -1
- data/app/views/frequencies/index.html.erb +2 -1
- data/app/views/identifier_types/index.html.erb +12 -5
- data/app/views/import_requests/index.html.erb +1 -0
- data/app/views/items/show.html.erb +3 -7
- data/app/views/languages/_form.html.erb +19 -4
- data/app/views/languages/index.html.erb +6 -5
- data/app/views/languages/show.html.erb +19 -4
- data/app/views/layouts/manifestations.html.erb +2 -1
- data/app/views/licenses/index.html.erb +2 -1
- data/app/views/manifestation_relationship_types/index.html.erb +5 -4
- data/app/views/manifestations/_call_number.html.erb +1 -1
- data/app/views/manifestations/_edit_detail.html.erb +4 -1
- data/app/views/manifestations/_form.html.erb +5 -5
- data/app/views/manifestations/_show_detail_librarian.html.erb +8 -3
- data/app/views/manifestations/_show_detail_user.html.erb +8 -3
- data/app/views/medium_of_performances/index.html.erb +2 -1
- data/app/views/notifier/manifestation_info.en.text.erb +1 -1
- data/app/views/notifier/manifestation_info.ja.text.erb +1 -1
- data/app/views/picture_files/_index.html.erb +1 -0
- data/app/views/picture_files/_index_agent.html.erb +1 -0
- data/app/views/picture_files/_index_manifestation.html.erb +1 -0
- data/app/views/picture_files/show.html.erb +15 -7
- data/app/views/produce_types/index.html.erb +5 -4
- data/app/views/realize_types/index.html.erb +5 -4
- data/app/views/resource_import_files/index.html.erb +1 -0
- data/app/views/series_statements/_index.html.erb +1 -0
- data/app/views/series_statements/_index_series_statement_merge_list.html.erb +1 -0
- data/config/locales/translation_en.yml +70 -1
- data/config/locales/translation_ja.yml +77 -8
- data/db/migrate/20140817155043_add_extent_of_text_to_manifestation.rb +5 -0
- data/lib/enju_biblio/biblio_helper.rb +13 -0
- data/lib/enju_biblio/engine.rb +0 -2
- data/lib/enju_biblio/version.rb +1 -1
- data/lib/generators/enju_biblio/setup/templates/db/fixtures/content_types.yml +1 -1
- data/lib/generators/enju_biblio/setup/templates/db/fixtures/identifier_types.yml +24 -3
- data/lib/tasks/enju_biblio_tasks.rake +2 -0
- data/lib/tasks/identifier_type.rb +12 -0
- data/lib/tasks/item.rb +1 -1
- data/spec/cassette_library/ResourceImportFile/when_its_mode_is_create_/when_it_is_written_in_utf-8/should_send_message_when_import_is_completed.yml +433 -0
- data/spec/controllers/agent_import_files_controller_spec.rb +35 -35
- data/spec/controllers/agent_import_results_controller_spec.rb +11 -11
- data/spec/controllers/agent_relationship_types_controller_spec.rb +51 -51
- data/spec/controllers/agent_relationships_controller_spec.rb +53 -53
- data/spec/controllers/agent_types_controller_spec.rb +15 -15
- data/spec/controllers/agents_controller_spec.rb +96 -96
- data/spec/controllers/carrier_types_controller_spec.rb +15 -15
- data/spec/controllers/content_types_controller_spec.rb +15 -15
- data/spec/controllers/countries_controller_spec.rb +25 -25
- data/spec/controllers/create_types_controller_spec.rb +15 -15
- data/spec/controllers/creates_controller_spec.rb +50 -50
- data/spec/controllers/donates_controller_spec.rb +49 -49
- data/spec/controllers/extents_controller_spec.rb +15 -15
- data/spec/controllers/form_of_works_controller_spec.rb +15 -15
- data/spec/controllers/frequencies_controller_spec.rb +6 -6
- data/spec/controllers/identifier_types_controller_spec.rb +15 -15
- data/spec/controllers/import_requests_controller_spec.rb +50 -50
- data/spec/controllers/items_controller_spec.rb +72 -72
- data/spec/controllers/languages_controller_spec.rb +18 -18
- data/spec/controllers/licenses_controller_spec.rb +15 -15
- data/spec/controllers/manifestation_relationship_types_controller_spec.rb +51 -51
- data/spec/controllers/manifestation_relationships_controller_spec.rb +53 -53
- data/spec/controllers/manifestations_controller_spec.rb +108 -108
- data/spec/controllers/medium_of_performances_controller_spec.rb +15 -15
- data/spec/controllers/owns_controller_spec.rb +52 -52
- data/spec/controllers/picture_files_controller_spec.rb +52 -52
- data/spec/controllers/produce_types_controller_spec.rb +15 -15
- data/spec/controllers/produces_controller_spec.rb +50 -50
- data/spec/controllers/realize_types_controller_spec.rb +15 -15
- data/spec/controllers/realizes_controller_spec.rb +51 -51
- data/spec/controllers/resource_export_files_controller_spec.rb +38 -38
- data/spec/controllers/resource_import_files_controller_spec.rb +38 -38
- data/spec/controllers/resource_import_results_controller_spec.rb +15 -15
- data/spec/controllers/series_statements_controller_spec.rb +54 -54
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/schema.rb +2 -3
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/private/system/resource_import_files/resource_imports/000/000/004/original/resource_import_file_sample1.tsv +19 -19
- data/spec/dummy/private/system/resource_import_files/resource_imports/000/000/004/original/resource_import_file_sample2.tsv +19 -19
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140818-53863-1jz1wlr.txt +147 -0
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140818-55246-1rvhs1s.txt +147 -0
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140818-60268-1psjqua.txt +147 -0
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140818-60996-1cy28m2.txt +147 -0
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140818-67507-19qjhj3.txt +147 -0
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140818-69234-1cllrec.txt +147 -0
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140818-76875-1os6joy.txt +147 -0
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140819-1148-136brhb.txt +147 -0
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140819-473-1c326dm.txt +147 -0
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140819-93795-1x882ik.txt +147 -0
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140819-94274-1xr9d9e.txt +147 -0
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140819-94643-1fjcept.txt +147 -0
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140819-97947-mfqh5b.txt +147 -0
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140819-98488-126cvb4.txt +147 -0
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140819-98849-1lg47mm.txt +147 -0
- data/spec/dummy/solr/test/data/index/segments.gen +0 -0
- data/spec/dummy/solr/test/data/index/segments_5ur +0 -0
- data/spec/dummy/solr/test/data/tlog/tlog.0000000000000007580 +0 -0
- data/spec/dummy/solr/test/data/tlog/tlog.0000000000000007581 +0 -0
- data/spec/dummy/solr/test/data/tlog/tlog.0000000000000007582 +0 -0
- data/spec/dummy/solr/test/data/tlog/tlog.0000000000000007583 +0 -0
- data/spec/dummy/solr/test/data/tlog/tlog.0000000000000007584 +0 -0
- data/spec/dummy/solr/test/data/tlog/tlog.0000000000000007585 +0 -0
- data/spec/dummy/tmp/cache/ACB/B20/manifestation_search_total +0 -0
- data/spec/dummy/tmp/cache/stdout +2554 -0
- data/spec/dummy/tmp/pids/redis-test.pid +1 -1
- data/spec/fixtures/agent_import_results.yml +0 -3
- data/spec/fixtures/carrier_types.yml +16 -16
- data/spec/fixtures/content_types.yml +78 -29
- data/spec/fixtures/frequencies.yml +32 -62
- data/spec/fixtures/manifestations.yml +1 -1
- data/spec/models/agent_import_result_spec.rb +0 -2
- data/spec/models/manifestation_spec.rb +1 -1
- data/spec/models/resource_import_file_spec.rb +30 -3
- data/spec/views/manifestations/show.html.erb_spec.rb +1 -1
- metadata +68 -103
- data/app/views/picture_files/_index_event.html.erb +0 -53
- data/app/views/picture_files/_index_shelf.html.erb +0 -53
- data/db/migrate/20121116033446_add_doi_to_manifestation.rb +0 -6
- data/spec/dummy/solr/test/data/index/_20i.fdt +0 -0
- data/spec/dummy/solr/test/data/index/_20i.fdx +0 -0
- data/spec/dummy/solr/test/data/index/_20i.fnm +0 -0
- data/spec/dummy/solr/test/data/index/_20i.nvd +0 -0
- data/spec/dummy/solr/test/data/index/_20i.nvm +0 -0
- data/spec/dummy/solr/test/data/index/_20i.si +0 -0
- data/spec/dummy/solr/test/data/index/_20i_Lucene41_0.doc +0 -0
- data/spec/dummy/solr/test/data/index/_20i_Lucene41_0.pos +0 -0
- data/spec/dummy/solr/test/data/index/_20i_Lucene41_0.tim +0 -0
- data/spec/dummy/solr/test/data/index/_20i_Lucene41_0.tip +0 -0
- data/spec/dummy/solr/test/data/index/_20j.fdt +0 -0
- data/spec/dummy/solr/test/data/index/_20j.fdx +0 -0
- data/spec/dummy/solr/test/data/index/_20j.fnm +0 -0
- data/spec/dummy/solr/test/data/index/_20j.nvd +0 -0
- data/spec/dummy/solr/test/data/index/_20j.nvm +0 -0
- data/spec/dummy/solr/test/data/index/_20j.si +0 -0
- data/spec/dummy/solr/test/data/index/_20j_Lucene41_0.doc +0 -0
- data/spec/dummy/solr/test/data/index/_20j_Lucene41_0.pos +0 -0
- data/spec/dummy/solr/test/data/index/_20j_Lucene41_0.tim +0 -0
- data/spec/dummy/solr/test/data/index/_20j_Lucene41_0.tip +0 -0
- data/spec/dummy/solr/test/data/index/_20k.fdt +0 -0
- data/spec/dummy/solr/test/data/index/_20k.fdx +0 -0
- data/spec/dummy/solr/test/data/index/_20k.fnm +0 -0
- data/spec/dummy/solr/test/data/index/_20k.nvd +0 -0
- data/spec/dummy/solr/test/data/index/_20k.nvm +0 -0
- data/spec/dummy/solr/test/data/index/_20k.si +0 -0
- data/spec/dummy/solr/test/data/index/_20k_Lucene41_0.doc +0 -0
- data/spec/dummy/solr/test/data/index/_20k_Lucene41_0.pos +0 -0
- data/spec/dummy/solr/test/data/index/_20k_Lucene41_0.tim +0 -0
- data/spec/dummy/solr/test/data/index/_20k_Lucene41_0.tip +0 -0
- data/spec/dummy/solr/test/data/index/segments_2uc +0 -0
- data/spec/dummy/solr/test/data/tlog/tlog.0000000000000003680 +0 -0
- data/spec/dummy/solr/test/data/tlog/tlog.0000000000000003681 +0 -0
- data/spec/dummy/solr/test/data/tlog/tlog.0000000000000003682 +0 -0
@@ -6,7 +6,7 @@ class ResourceImportFile < ActiveRecord::Base
|
|
6
6
|
:default_shelf_id, :library_id
|
7
7
|
default_scope {order('resource_import_files.id DESC')}
|
8
8
|
scope :not_imported, -> {in_state(:pending)}
|
9
|
-
scope :stucked, -> {in_state(:pending).where('created_at < ?', 1.hour.ago)}
|
9
|
+
scope :stucked, -> {in_state(:pending).where('resource_import_files.created_at < ?', 1.hour.ago)}
|
10
10
|
|
11
11
|
if Setting.uploaded_file.storage == :s3
|
12
12
|
has_attached_file :resource_import, storage: :s3, s3_credentials: "#{Setting.amazon}",
|
@@ -86,14 +86,14 @@ class ResourceImportFile < ActiveRecord::Base
|
|
86
86
|
unless manifestation
|
87
87
|
if row['doi'].present?
|
88
88
|
doi = URI.parse(row['doi']).path.gsub(/^\//, "")
|
89
|
-
manifestation =
|
89
|
+
manifestation = Identifier.where(body: doi, identifier_type_id: IdentifierType.where(name: 'doi').first_or_create.id).first.try(:manifestation)
|
90
90
|
end
|
91
91
|
end
|
92
92
|
|
93
93
|
unless manifestation
|
94
94
|
if row['jpno'].present?
|
95
95
|
jpno = row['jpno'].to_s.strip
|
96
|
-
manifestation = Identifier.where(body:
|
96
|
+
manifestation = Identifier.where(body: jpno, identifier_type_id: IdentifierType.where(name: 'jpno').first_or_create.id).first.try(:manifestation)
|
97
97
|
end
|
98
98
|
end
|
99
99
|
|
@@ -195,13 +195,6 @@ class ResourceImportFile < ActiveRecord::Base
|
|
195
195
|
manifestation
|
196
196
|
end
|
197
197
|
|
198
|
-
def self.import_item(manifestation, options)
|
199
|
-
item = Item.new(options)
|
200
|
-
item.shelf = Shelf.web unless item.shelf
|
201
|
-
item.manifestation = manifestation
|
202
|
-
item
|
203
|
-
end
|
204
|
-
|
205
198
|
def import_marc(marc_type)
|
206
199
|
file = File.open(self.resource_import.path)
|
207
200
|
case marc_type
|
@@ -283,13 +276,16 @@ class ResourceImportFile < ActiveRecord::Base
|
|
283
276
|
item.binded_at = binded_at if binded_at
|
284
277
|
|
285
278
|
item_columns = %w(
|
286
|
-
call_number item_price
|
279
|
+
call_number item_price
|
287
280
|
binding_item_identifier binding_call_number binded_at
|
288
281
|
)
|
289
282
|
item_columns.each do |column|
|
290
283
|
item.assign_attributes(:"#{column}" => row[column], as: :admin)
|
291
284
|
end
|
292
285
|
|
286
|
+
item.note = row['item_note'] if row['item_note'].present?
|
287
|
+
item.url = row['item_url'] if row['item_url'].present?
|
288
|
+
|
293
289
|
if row['include_supplements']
|
294
290
|
if %w(t true).include?(row['include_supplements'].downcase.strip)
|
295
291
|
item.include_supplements = true
|
@@ -374,18 +370,21 @@ class ResourceImportFile < ActiveRecord::Base
|
|
374
370
|
header_columns = %w(
|
375
371
|
original_title manifestation_identifier item_identifier shelf note
|
376
372
|
title_transcription title_alternative title_alternative_transcription
|
377
|
-
periodical manifestation_id publication_place
|
373
|
+
periodical manifestation_id publication_place carrier_type
|
378
374
|
series_statement_identifier series_original_title series_creator_string
|
379
|
-
series_title_transcription
|
375
|
+
series_title_transcription series_volume_number_string
|
376
|
+
series_title_subseries series_title_subseries_transcription
|
377
|
+
creator creator_transcription publisher
|
380
378
|
publisher_transcription pub_date creator creator_transcription
|
381
379
|
contributor contributor_transcription description access_address
|
382
|
-
volume_number_string
|
383
|
-
edition serial_number isbn issn manifestation_price
|
380
|
+
volume_number volume_number_string issue_number issue_number_string
|
381
|
+
edition edition_string serial_number isbn issn manifestation_price
|
384
382
|
width height depth number_of_pages jpno lccn budget_type bookstore
|
385
|
-
language fulltext_content required_role doi
|
383
|
+
language fulltext_content required_role doi content_type frequency
|
384
|
+
extent_of_text start_page end_page
|
386
385
|
statement_of_responsibility acquired_at call_number circulation_status
|
387
|
-
binding_item_identifier binding_call_number binded_at
|
388
|
-
use_restriction include_supplements
|
386
|
+
binding_item_identifier binding_call_number binded_at item_price
|
387
|
+
use_restriction include_supplements item_note item_url
|
389
388
|
dummy
|
390
389
|
)
|
391
390
|
if defined?(EnjuSubject)
|
@@ -439,7 +438,7 @@ class ResourceImportFile < ActiveRecord::Base
|
|
439
438
|
budget_type = BudgetType.where(name: row['budget_type'].to_s.strip).first
|
440
439
|
acquired_at = Time.zone.parse(row['acquired_at']) rescue nil
|
441
440
|
binded_at = Time.zone.parse(row['binded_at']) rescue nil
|
442
|
-
item =
|
441
|
+
item = Item.new(
|
443
442
|
manifestation_id: manifestation.id,
|
444
443
|
item_identifier: row['item_identifier'],
|
445
444
|
price: row['item_price'],
|
@@ -447,8 +446,11 @@ class ResourceImportFile < ActiveRecord::Base
|
|
447
446
|
acquired_at: acquired_at,
|
448
447
|
binding_item_identifier: row['binding_item_identifier'],
|
449
448
|
binding_call_number: row['binding_call_number'],
|
450
|
-
binded_at: binded_at
|
451
|
-
|
449
|
+
binded_at: binded_at,
|
450
|
+
url: row['item_url'],
|
451
|
+
note: row['item_note']
|
452
|
+
)
|
453
|
+
item.manifestation = manifestation
|
452
454
|
if defined?(EnjuCirculation)
|
453
455
|
circulation_status = CirculationStatus.where(name: row['circulation_status'].to_s.strip).first || CirculationStatus.where(name: 'In Process').first
|
454
456
|
item.circulation_status = circulation_status
|
@@ -461,6 +463,7 @@ class ResourceImportFile < ActiveRecord::Base
|
|
461
463
|
item.bookstore = bookstore
|
462
464
|
item.budget_type = budget_type
|
463
465
|
item.shelf = shelf
|
466
|
+
item.shelf = Shelf.web unless item.shelf
|
464
467
|
|
465
468
|
if %w(t true).include?(row['include_supplements'].to_s.downcase.strip)
|
466
469
|
item.include_supplements = true
|
@@ -504,25 +507,16 @@ class ResourceImportFile < ActiveRecord::Base
|
|
504
507
|
end
|
505
508
|
|
506
509
|
# TODO: 小数点以下の表現
|
507
|
-
width = NKF.nkf('-eZ1', row['width'].to_s).gsub(/\D/, '').to_i
|
508
|
-
height = NKF.nkf('-eZ1', row['height'].to_s).gsub(/\D/, '').to_i
|
509
|
-
depth = NKF.nkf('-eZ1', row['depth'].to_s).gsub(/\D/, '').to_i
|
510
|
-
end_page = NKF.nkf('-eZ1', row['number_of_pages'].to_s).gsub(/\D/, '').to_i
|
511
510
|
language = Language.where(name: row['language'].to_s.strip.camelize).first
|
512
|
-
language = Language.where(:
|
513
|
-
language = Language.where(:
|
511
|
+
language = Language.where(iso_639_2: row['language'].to_s.strip.downcase).first unless language
|
512
|
+
language = Language.where(iso_639_1: row['language'].to_s.strip.downcase).first unless language
|
514
513
|
|
515
514
|
carrier_type = CarrierType.where(name: row['carrier_type'].to_s.strip).first
|
515
|
+
content_type = ContentType.where(name: row['content_type'].to_s.strip).first
|
516
|
+
frequency = Frequency.where(name: row['frequency'].to_s.strip).first
|
516
517
|
|
517
518
|
identifier = set_identifier(row)
|
518
519
|
|
519
|
-
if end_page >= 1
|
520
|
-
start_page = 1
|
521
|
-
else
|
522
|
-
start_page = nil
|
523
|
-
end_page = nil
|
524
|
-
end
|
525
|
-
|
526
520
|
if %w(t true).include?(row['fulltext_content'].to_s.downcase.strip)
|
527
521
|
fulltext_content = true
|
528
522
|
end
|
@@ -561,9 +555,6 @@ class ResourceImportFile < ActiveRecord::Base
|
|
561
555
|
work.subjects = subjects.uniq unless subjects.empty?
|
562
556
|
end
|
563
557
|
end
|
564
|
-
if row['volume_number'].present?
|
565
|
-
volume_number = row['volume_number'].to_s.tr('0-9', '0-9').to_i
|
566
|
-
end
|
567
558
|
|
568
559
|
attributes = {
|
569
560
|
:original_title => title[:original_title],
|
@@ -571,31 +562,34 @@ class ResourceImportFile < ActiveRecord::Base
|
|
571
562
|
:title_alternative => title[:title_alternative],
|
572
563
|
:title_alternative_transcription => title[:title_alternative_transcription],
|
573
564
|
:pub_date => row['pub_date'],
|
574
|
-
:
|
565
|
+
:volume_number => row['volume_number'],
|
566
|
+
:volume_number_string => row['volume_number_string'],
|
567
|
+
:issue_number => row['issue_number'],
|
575
568
|
:issue_number_string => row['issue_number_string'],
|
576
569
|
:serial_number => row['serial_number'],
|
577
570
|
:edition => row['edition'],
|
578
571
|
:edition_string => row['edition_string'],
|
579
|
-
:width => width,
|
580
|
-
:depth => depth,
|
581
|
-
:height => height,
|
572
|
+
:width => row['width'],
|
573
|
+
:depth => row['depth'],
|
574
|
+
:height => row['height'],
|
582
575
|
:price => row['manifestation_price'],
|
583
576
|
:description => row['description'],
|
584
577
|
#:description_transcription => row['description_transcription'],
|
585
578
|
:note => row['note'],
|
586
579
|
:statement_of_responsibility => row['statement_of_responsibility'],
|
587
|
-
:start_page => start_page,
|
588
|
-
:end_page => end_page,
|
589
580
|
:access_address => row['access_address'],
|
590
581
|
:manifestation_identifier => row['manifestation_identifier'],
|
591
582
|
:fulltext_content => fulltext_content,
|
592
|
-
:publication_place => row['publication_place']
|
583
|
+
:publication_place => row['publication_place'],
|
584
|
+
:extent_of_text => row['extent_of_text'],
|
585
|
+
:start_page => row['start_page'],
|
586
|
+
:end_page => row['end_page']
|
593
587
|
}.delete_if{|key, value| value.nil?}
|
588
|
+
|
594
589
|
manifestation = self.class.import_manifestation(expression, publisher_agents, attributes,
|
595
590
|
{
|
596
591
|
edit_mode: options[:edit_mode]
|
597
592
|
})
|
598
|
-
manifestation.volume_number = volume_number if volume_number
|
599
593
|
|
600
594
|
required_role = Role.where(name: row['required_role_name'].to_s.strip.camelize).first
|
601
595
|
if required_role and row['required_role_name'].present?
|
@@ -611,38 +605,44 @@ class ResourceImportFile < ActiveRecord::Base
|
|
611
605
|
end
|
612
606
|
|
613
607
|
manifestation.carrier_type = carrier_type if carrier_type
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
manifestation.identifiers << v if v.valid?
|
619
|
-
end
|
620
|
-
end
|
608
|
+
manifestation.manifestation_content_type = content_type if content_type
|
609
|
+
manifestation.frequency = frequency if frequency
|
610
|
+
#manifestation.start_page = row[:start_page].to_i if row[:start_page]
|
611
|
+
#manifestation.end_page = row[:end_page].to_i if row[:end_page]
|
621
612
|
|
622
613
|
if row['series_original_title'].to_s.strip.present?
|
623
614
|
Manifestation.transaction do
|
624
615
|
if manifestation.series_statements.exists?
|
625
616
|
manifestation.series_statements.delete_all
|
626
617
|
end
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
618
|
+
if row['series_original_title']
|
619
|
+
series_statement = SeriesStatement.new(
|
620
|
+
:original_title => row['series_original_title'],
|
621
|
+
:title_transcription => row['series_title_transcription'],
|
622
|
+
:title_subseries => row['series_title_subseries'],
|
623
|
+
:title_subseries_transcription => row['series_title_subseries_transcription'],
|
624
|
+
:volume_number_string => row['series_volume_number_string'],
|
625
|
+
:creator_string => row['series_creator_string'],
|
626
|
+
)
|
627
|
+
series_statement.manifestation = manifestation
|
628
|
+
series_statement.save!
|
629
|
+
end
|
639
630
|
end
|
640
631
|
end
|
641
632
|
|
642
|
-
if
|
643
|
-
|
644
|
-
|
645
|
-
|
633
|
+
if manifestation.save
|
634
|
+
Manifestation.transaction do
|
635
|
+
manifestation.identifiers.delete_all if manifestation.identifiers.exists?
|
636
|
+
identifier.each do |k, v|
|
637
|
+
manifestation.identifiers << v if v.valid?
|
638
|
+
end
|
639
|
+
end
|
640
|
+
|
641
|
+
if defined?(EnjuSubject)
|
642
|
+
classifications = import_classification(row)
|
643
|
+
if classifications.present?
|
644
|
+
manifestation.classifications << classifications
|
645
|
+
end
|
646
646
|
end
|
647
647
|
end
|
648
648
|
|
@@ -663,17 +663,11 @@ class ResourceImportFile < ActiveRecord::Base
|
|
663
663
|
|
664
664
|
def set_identifier(row)
|
665
665
|
identifier = {}
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
identifier[:jpno] = Identifier.new(body: row['jpno'])
|
672
|
-
identifier[:jpno].identifier_type = IdentifierType.where(name: 'jpno').first_or_create
|
673
|
-
end
|
674
|
-
if row['issn']
|
675
|
-
identifier[:issn] = Identifier.new(body: row['issn'])
|
676
|
-
identifier[:issn].identifier_type = IdentifierType.where(name: 'issn').first_or_create
|
666
|
+
%w(isbn issn doi jpno).each do |id_type|
|
667
|
+
if row["#{id_type}"].present?
|
668
|
+
identifier[:"#{id_type}"] = Identifier.new(body: row["#{id_type}"])
|
669
|
+
identifier[:"#{id_type}"].identifier_type = IdentifierType.where(name: id_type).first_or_create
|
670
|
+
end
|
677
671
|
end
|
678
672
|
identifier
|
679
673
|
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
<div id="content_detail" class="ui-corner-all ui-widget-content">
|
2
2
|
<h1 class="title"><%= t('page.listing', model: t('activerecord.models.agent_import_file')) -%></h1>
|
3
3
|
<div id="content_list">
|
4
|
+
<p id="notice"><%= notice %></p>
|
4
5
|
|
5
6
|
<table class="table table-striped index">
|
6
7
|
<tr>
|
@@ -1,6 +1,7 @@
|
|
1
|
-
<div id="agent_relationship_detail" class="ui-corner-all ui-widget-
|
1
|
+
<div id="agent_relationship_detail" class="ui-corner-all ui-widget-content">
|
2
2
|
<h1 class="title"><%= t('page.listing', model: t('activerecord.models.agent_relationship_type')) -%></h1>
|
3
|
-
<div id="
|
3
|
+
<div id="content_list">
|
4
|
+
<p id="notice"><%= notice %></p>
|
4
5
|
|
5
6
|
<table class="table table-striped index">
|
6
7
|
<tr>
|
@@ -42,9 +43,9 @@
|
|
42
43
|
</div>
|
43
44
|
</div>
|
44
45
|
|
45
|
-
<div id="submenu" class="ui-corner-all ui-widget-
|
46
|
+
<div id="submenu" class="ui-corner-all ui-widget-content">
|
46
47
|
<ul>
|
47
|
-
<%- if can? :create,
|
48
|
+
<%- if can? :create, AgentRelationshipType -%>
|
48
49
|
<li><%= link_to t('page.new', model: t('activerecord.models.agent_relationship_type')), new_agent_relationship_type_path -%></li>
|
49
50
|
<%- end -%>
|
50
51
|
</ul>
|
@@ -1,6 +1,7 @@
|
|
1
|
-
<div id="agent_detail" class="ui-corner-all ui-widget-
|
1
|
+
<div id="agent_detail" class="ui-corner-all ui-widget-content">
|
2
2
|
<h1 class="title"><%= t('page.listing', model: t('activerecord.models.agent_type')) -%></h1>
|
3
|
-
<div id="
|
3
|
+
<div id="content_list">
|
4
|
+
<p id="notice"><%= notice %></p>
|
4
5
|
|
5
6
|
<table class="table table-striped index">
|
6
7
|
<tr>
|
@@ -42,9 +43,9 @@
|
|
42
43
|
</div>
|
43
44
|
</div>
|
44
45
|
|
45
|
-
<div id="submenu" class="ui-corner-all ui-widget-
|
46
|
+
<div id="submenu" class="ui-corner-all ui-widget-content">
|
46
47
|
<ul>
|
47
|
-
<%- if can? :create,
|
48
|
+
<%- if can? :create, AgentType -%>
|
48
49
|
<li><%= link_to t('page.new', model: t('activerecord.models.agent_type')), new_agent_type_path -%></li>
|
49
50
|
<%- end -%>
|
50
51
|
</ul>
|
@@ -1,6 +1,7 @@
|
|
1
1
|
<div id="content_detail" class="ui-corner-all ui-widget-content">
|
2
2
|
<h1 class="title"><%= t('page.listing', model: t('activerecord.models.carrier_type')) -%></h1>
|
3
3
|
<div id="content_list">
|
4
|
+
<p id="notice"><%= notice %></p>
|
4
5
|
|
5
6
|
<table class="table table-striped index">
|
6
7
|
<tr>
|
@@ -44,7 +45,7 @@
|
|
44
45
|
|
45
46
|
<div id="submenu" class="ui-corner-all ui-widget-content">
|
46
47
|
<ul>
|
47
|
-
<%- if can? :create,
|
48
|
+
<%- if can? :create, CarrierType -%>
|
48
49
|
<li><%= link_to t('page.new', model: t('activerecord.models.carrier_type')), new_carrier_type_path -%></li>
|
49
50
|
<%- end -%>
|
50
51
|
</ul>
|
@@ -1,6 +1,7 @@
|
|
1
1
|
<div id="content_detail" class="ui-corner-all ui-widget-content">
|
2
2
|
<h1 class="title"><%= t('page.listing', model: t('activerecord.models.content_type')) -%></h1>
|
3
3
|
<div id="content_list">
|
4
|
+
<p id="notice"><%= notice %></p>
|
4
5
|
|
5
6
|
<table class="table table-striped index">
|
6
7
|
<tr>
|
@@ -1,6 +1,7 @@
|
|
1
|
-
<div id="create_detail" class="ui-corner-all ui-widget-
|
1
|
+
<div id="create_detail" class="ui-corner-all ui-widget-content">
|
2
2
|
<h1 class="title"><%= t('page.listing', model: t('activerecord.models.create_type')) -%></h1>
|
3
|
-
<div id="
|
3
|
+
<div id="content_list">
|
4
|
+
<p id="notice"><%= notice %></p>
|
4
5
|
|
5
6
|
<table class="table table-striped index">
|
6
7
|
<tr>
|
@@ -42,9 +43,9 @@
|
|
42
43
|
</div>
|
43
44
|
</div>
|
44
45
|
|
45
|
-
<div id="submenu" class="ui-corner-all ui-widget-
|
46
|
+
<div id="submenu" class="ui-corner-all ui-widget-content">
|
46
47
|
<ul>
|
47
|
-
<%- if can? :create,
|
48
|
+
<%- if can? :create, CreateType -%>
|
48
49
|
<li><%= link_to t('page.new', model: t('activerecord.models.create_type')), new_create_type_path -%></li>
|
49
50
|
<%- end -%>
|
50
51
|
</ul>
|
@@ -1,6 +1,7 @@
|
|
1
1
|
<div id="content_detail" class="ui-corner-all ui-widget-content">
|
2
2
|
<h1 class="title"><%= t('page.listing', model: t('activerecord.models.extent')) -%></h1>
|
3
3
|
<div id="content_list">
|
4
|
+
<p id="notice"><%= notice %></p>
|
4
5
|
|
5
6
|
<table class="table table-striped index">
|
6
7
|
<tr>
|
@@ -44,7 +45,7 @@
|
|
44
45
|
|
45
46
|
<div id="submenu" class="ui-corner-all ui-widget-content">
|
46
47
|
<ul>
|
47
|
-
<%- if can? :create,
|
48
|
+
<%- if can? :create, Extent -%>
|
48
49
|
<li><%= link_to t('page.new', model: t('activerecord.models.extent')), new_extent_path -%></li>
|
49
50
|
<%- end -%>
|
50
51
|
</ul>
|
@@ -1,6 +1,7 @@
|
|
1
1
|
<div id="content_detail" class="ui-corner-all ui-widget-content">
|
2
2
|
<h1 class="title"><%= t('page.listing', model: t('activerecord.models.form_of_work')) -%></h1>
|
3
3
|
<div id="content_list">
|
4
|
+
<p id="notice"><%= notice %></p>
|
4
5
|
|
5
6
|
<table class="table table-striped index">
|
6
7
|
<tr>
|
@@ -44,7 +45,7 @@
|
|
44
45
|
|
45
46
|
<div id="submenu" class="ui-corner-all ui-widget-content">
|
46
47
|
<ul>
|
47
|
-
<%- if can? :create,
|
48
|
+
<%- if can? :create, FormOfWork -%>
|
48
49
|
<li><%= link_to t('page.new', model: t('activerecord.models.form_of_work')), new_form_of_work_path -%></li>
|
49
50
|
<%- end -%>
|
50
51
|
</ul>
|
@@ -1,6 +1,7 @@
|
|
1
1
|
<div id="content_detail" class="ui-corner-all ui-widget-content">
|
2
2
|
<h1 class="title"><%= t('page.listing', model: t('activerecord.models.frequency')) -%></h1>
|
3
3
|
<div id="content_list">
|
4
|
+
<p id="notice"><%= notice %></p>
|
4
5
|
|
5
6
|
<table class="table table-striped index">
|
6
7
|
<tr>
|
@@ -44,7 +45,7 @@
|
|
44
45
|
|
45
46
|
<div id="submenu" class="ui-corner-all ui-widget-content">
|
46
47
|
<ul>
|
47
|
-
<%- if can? :create,
|
48
|
+
<%- if can? :create, Frequency -%>
|
48
49
|
<li><%= link_to t('page.new', model: t('activerecord.models.frequency')), new_frequency_path -%></li>
|
49
50
|
<%- end -%>
|
50
51
|
</ul>
|
@@ -1,13 +1,17 @@
|
|
1
1
|
<div id="content_detail" class="ui-corner-all ui-widget-content">
|
2
2
|
<h1 class="title"><%= t('page.listing', model: t('activerecord.models.identifier_type')) -%></h1>
|
3
3
|
<div id="content_list">
|
4
|
+
<p id="notice"><%= notice %></p>
|
4
5
|
|
5
6
|
<table class="table table-striped index">
|
6
7
|
<tr>
|
7
8
|
<th id="position"></th>
|
8
9
|
<th><%= t('activerecord.attributes.identifier_type.name') -%></th>
|
9
|
-
<th
|
10
|
-
|
10
|
+
<th>
|
11
|
+
<%= t('activerecord.attributes.identifier_type.display_name') -%>
|
12
|
+
/
|
13
|
+
<%= t('activerecord.attributes.identifier_type.note') -%>
|
14
|
+
</th>
|
11
15
|
<th></th>
|
12
16
|
</tr>
|
13
17
|
|
@@ -18,9 +22,12 @@
|
|
18
22
|
<%= move_position(identifier_type) -%>
|
19
23
|
<%- end -%>
|
20
24
|
</td>
|
21
|
-
<td><%=
|
22
|
-
<td
|
23
|
-
|
25
|
+
<td><%= identifier_type.name -%></td>
|
26
|
+
<td>
|
27
|
+
<%= link_to identifier_type.display_name.localize, identifier_type -%>
|
28
|
+
<br />
|
29
|
+
<%= identifier_type.note %>
|
30
|
+
</td>
|
24
31
|
<td>
|
25
32
|
<%- if can? :update, identifier_type -%>
|
26
33
|
<%= link_to t('page.edit'), edit_identifier_type_path(identifier_type) -%>
|
@@ -1,6 +1,7 @@
|
|
1
1
|
<div id="content_detail" class="ui-corner-all ui-widget-content">
|
2
2
|
<h1 class="title"><%= t('page.listing', model: t('activerecord.models.import_request')) -%></h1>
|
3
3
|
<div id="content_list">
|
4
|
+
<p id="notice"><%= notice %></p>
|
4
5
|
|
5
6
|
<table class="table table-striped index">
|
6
7
|
<tr>
|
@@ -133,11 +133,7 @@
|
|
133
133
|
<ul>
|
134
134
|
<li><%= back_to_index(flash[:page_info]) -%></li>
|
135
135
|
<% if can? :update, @item %>
|
136
|
-
|
137
|
-
<li><%= link_to t('page.edit'), edit_library_shelf_item_path(@shelf.library, @shelf, @item) -%></li>
|
138
|
-
<%- else -%>
|
139
|
-
<li><%= link_to t('page.edit'), edit_item_path(@item) -%></li>
|
140
|
-
<%- end -%>
|
136
|
+
<li><%= link_to t('page.edit'), edit_item_path(@item) -%></li>
|
141
137
|
<% end %>
|
142
138
|
<% if defined?(EnjuInterLibraryLoan) %>
|
143
139
|
<li><%= link_to t('page.listing', model: t('activerecord.models.inter_library_loan')), item_inter_library_loans_path(@item) -%></li>
|
@@ -151,8 +147,8 @@
|
|
151
147
|
<%- end -%>
|
152
148
|
<% end %>
|
153
149
|
<% if defined?(EnjuCirculation) %>
|
154
|
-
<li><%= link_to t('page.listing', model: t('activerecord.models.lending_policy')),
|
155
|
-
<li><%= link_to t('page.checkout_history'),
|
150
|
+
<li><%= link_to t('page.listing', model: t('activerecord.models.lending_policy')), lending_policies_path(item_id: @item.id) -%></li>
|
151
|
+
<li><%= link_to t('page.checkout_history'), checkouts_path(item_id: @item.id) -%></li>
|
156
152
|
<% end %>
|
157
153
|
</ul>
|
158
154
|
</div>
|
@@ -2,13 +2,13 @@
|
|
2
2
|
<%= f.error_messages %>
|
3
3
|
|
4
4
|
<div class="field">
|
5
|
-
<%= f.label :
|
6
|
-
<%=
|
5
|
+
<%= f.label :name %>:<br />
|
6
|
+
<%= @language.name %>
|
7
7
|
</div>
|
8
8
|
|
9
9
|
<div class="field">
|
10
|
-
<%= f.label :
|
11
|
-
<%=
|
10
|
+
<%= f.label :native_name %><br />
|
11
|
+
<%= f.text_field :native_name %>
|
12
12
|
</div>
|
13
13
|
|
14
14
|
<div class="field">
|
@@ -16,6 +16,21 @@
|
|
16
16
|
<%= f.text_area :display_name, class: 'resource_textarea' %>
|
17
17
|
</div>
|
18
18
|
|
19
|
+
<div class="field">
|
20
|
+
<%= f.label :iso_639_1 %><br />
|
21
|
+
<%= f.text_field :iso_639_1 %>
|
22
|
+
</div>
|
23
|
+
|
24
|
+
<div class="field">
|
25
|
+
<%= f.label :iso_639_2 %><br />
|
26
|
+
<%= f.text_field :iso_639_2 %>
|
27
|
+
</div>
|
28
|
+
|
29
|
+
<div class="field">
|
30
|
+
<%= f.label :iso_639_3 %><br />
|
31
|
+
<%= f.text_field :iso_639_3 %>
|
32
|
+
</div>
|
33
|
+
|
19
34
|
<div class="field">
|
20
35
|
<%= f.label :note %><br />
|
21
36
|
<%= f.text_area :note, class: 'resource_textarea' %>
|
@@ -1,16 +1,17 @@
|
|
1
1
|
<div id="content_detail" class="ui-corner-all ui-widget-content">
|
2
2
|
<h1 class="title"><%= t('page.listing', model: t('activerecord.models.language')) -%></h1>
|
3
3
|
<div id="content_list">
|
4
|
+
<p id="notice"><%= notice %></p>
|
4
5
|
|
5
6
|
<table class="table table-striped index">
|
6
7
|
<tr>
|
7
8
|
<th id="position"></th>
|
8
|
-
<th><%= t('activerecord.attributes.language.native_name') -%></th>
|
9
9
|
<th><%= t('activerecord.attributes.language.name') -%></th>
|
10
|
+
<th><%= t('activerecord.attributes.language.native_name') -%></th>
|
10
11
|
<th><%= t('activerecord.attributes.language.display_name') -%></th>
|
11
|
-
<th><%= '
|
12
|
-
<th><%= '
|
13
|
-
<th><%= '
|
12
|
+
<th><%= 'ISO 639-1' -%></th>
|
13
|
+
<th><%= 'ISO 639-2' -%></th>
|
14
|
+
<th><%= 'ISO 639-3' -%></th>
|
14
15
|
<th></th>
|
15
16
|
</tr>
|
16
17
|
|
@@ -21,8 +22,8 @@
|
|
21
22
|
<%= move_position(language) -%>
|
22
23
|
<%- end -%>
|
23
24
|
</td>
|
24
|
-
<td><%= language.native_name -%></td>
|
25
25
|
<td><%= language.name -%></td>
|
26
|
+
<td><%= language.native_name -%></td>
|
26
27
|
<td><%= link_to language.display_name.localize, language -%></td>
|
27
28
|
<td><%= language.iso_639_1 -%></td>
|
28
29
|
<td><%= language.iso_639_2 -%></td>
|
@@ -4,13 +4,13 @@
|
|
4
4
|
<p id="notice"><%= notice %></p>
|
5
5
|
|
6
6
|
<p>
|
7
|
-
<strong><%= t('activerecord.attributes.language.
|
8
|
-
<%= @language.
|
7
|
+
<strong><%= t('activerecord.attributes.language.name') -%>:</strong>
|
8
|
+
<%= @language.name -%>
|
9
9
|
</p>
|
10
10
|
|
11
11
|
<p>
|
12
|
-
<strong><%= t('activerecord.attributes.language.
|
13
|
-
<%= @language.
|
12
|
+
<strong><%= t('activerecord.attributes.language.native_name') -%>:</strong>
|
13
|
+
<%= @language.native_name -%>
|
14
14
|
</p>
|
15
15
|
|
16
16
|
<p>
|
@@ -18,6 +18,21 @@
|
|
18
18
|
<%= @language.display_name.localize -%>
|
19
19
|
</p>
|
20
20
|
|
21
|
+
<p>
|
22
|
+
<strong>ISO 639-1:</strong>
|
23
|
+
<td><%= language.iso_639_1 -%></td>
|
24
|
+
</p>
|
25
|
+
|
26
|
+
<p>
|
27
|
+
<strong>ISO 639-2:</strong>
|
28
|
+
<td><%= language.iso_639_2 -%></td>
|
29
|
+
</p>
|
30
|
+
|
31
|
+
<p>
|
32
|
+
<strong>ISO 639-3:</strong>
|
33
|
+
<td><%= language.iso_639_3 -%></td>
|
34
|
+
</p>
|
35
|
+
|
21
36
|
<p>
|
22
37
|
<strong><%= t('activerecord.attributes.language.note') -%>:</strong>
|
23
38
|
<%= @language.note -%>
|