bulkrax 9.3.4 → 9.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/bulkrax/import_export.scss +9 -2
  3. data/app/controllers/bulkrax/importers_controller.rb +9 -0
  4. data/app/jobs/bulkrax/export_work_job.rb +1 -3
  5. data/app/services/bulkrax/sample_csv_service/column_builder.rb +58 -0
  6. data/app/services/bulkrax/sample_csv_service/column_descriptor.rb +56 -0
  7. data/app/services/bulkrax/sample_csv_service/csv_builder.rb +82 -0
  8. data/app/services/bulkrax/sample_csv_service/explanation_builder.rb +51 -0
  9. data/app/services/bulkrax/sample_csv_service/field_analyzer.rb +54 -0
  10. data/app/services/bulkrax/sample_csv_service/file_path_generator.rb +16 -0
  11. data/app/services/bulkrax/sample_csv_service/mapping_manager.rb +36 -0
  12. data/app/services/bulkrax/sample_csv_service/model_loader.rb +40 -0
  13. data/app/services/bulkrax/sample_csv_service/row_builder.rb +33 -0
  14. data/app/services/bulkrax/sample_csv_service/schema_analyzer.rb +69 -0
  15. data/app/services/bulkrax/sample_csv_service/split_formatter.rb +42 -0
  16. data/app/services/bulkrax/sample_csv_service/value_determiner.rb +67 -0
  17. data/app/services/bulkrax/sample_csv_service.rb +78 -0
  18. data/app/views/bulkrax/entries/_parsed_metadata.html.erb +1 -1
  19. data/app/views/bulkrax/entries/_raw_metadata.html.erb +1 -1
  20. data/app/views/bulkrax/entries/show.html.erb +6 -6
  21. data/app/views/bulkrax/exporters/_form.html.erb +19 -43
  22. data/app/views/bulkrax/exporters/edit.html.erb +2 -2
  23. data/app/views/bulkrax/exporters/index.html.erb +5 -5
  24. data/app/views/bulkrax/exporters/new.html.erb +3 -5
  25. data/app/views/bulkrax/exporters/show.html.erb +3 -3
  26. data/app/views/bulkrax/importers/_bagit_fields.html.erb +9 -9
  27. data/app/views/bulkrax/importers/_browse_everything.html.erb +1 -1
  28. data/app/views/bulkrax/importers/_csv_fields.html.erb +11 -11
  29. data/app/views/bulkrax/importers/_edit_form_buttons.html.erb +23 -23
  30. data/app/views/bulkrax/importers/_edit_item_buttons.html.erb +2 -2
  31. data/app/views/bulkrax/importers/_file_uploader.html.erb +3 -3
  32. data/app/views/bulkrax/importers/_form.html.erb +4 -5
  33. data/app/views/bulkrax/importers/_oai_fields.html.erb +8 -18
  34. data/app/views/bulkrax/importers/_xml_fields.html.erb +13 -13
  35. data/app/views/bulkrax/importers/edit.html.erb +2 -2
  36. data/app/views/bulkrax/importers/index.html.erb +13 -13
  37. data/app/views/bulkrax/importers/new.html.erb +10 -9
  38. data/app/views/bulkrax/importers/show.html.erb +7 -7
  39. data/app/views/bulkrax/importers/upload_corrected_entries.html.erb +6 -6
  40. data/app/views/bulkrax/shared/_bulkrax_errors.html.erb +11 -11
  41. data/app/views/bulkrax/shared/_bulkrax_field_mapping.html.erb +3 -3
  42. data/config/locales/bulkrax.en.yml +235 -2
  43. data/config/routes.rb +1 -0
  44. data/lib/bulkrax/version.rb +1 -1
  45. data/lib/bulkrax.rb +0 -3
  46. data/lib/tasks/bulkrax_tasks.rake +0 -102
  47. metadata +15 -2
@@ -7,26 +7,26 @@
7
7
  but if the namespaces ARE present, we remove them so we would need title
8
8
  %>
9
9
  <%= fi.input :record_element,
10
- hint: 'Provide the xml element name to use to identify the record, or records, eg. ROW - each record in the attached XML is wrapped in a <ROW> tag.',
10
+ hint: t('bulkrax.importer.xml.hints.record_element'),
11
11
  input_html: { value: importer.parser_fields['record_element'] }
12
12
  %>
13
13
 
14
14
  <%= fi.input :import_type,
15
15
  collection: [
16
- ['Single Work per Metadata File', 'single'],
17
- ['Multiple Works per Metadata File', 'multiple']
16
+ [t('bulkrax.importer.xml.import_type.single'), 'single'],
17
+ [t('bulkrax.importer.xml.import_type.multiple'), 'multiple']
18
18
  ],
19
19
  selected: importer.parser_fields['import_type'],
20
20
  input_html: { class: 'form-control' }
21
21
  %>
22
22
 
23
- <h4>Visiblity</h4>
23
+ <h4><%= t('bulkrax.importer.xml.labels.visibility') %></h4>
24
24
 
25
25
  <%= fi.input :visibility,
26
26
  collection: [
27
- ['Public', 'open'],
28
- ['Private', 'restricted'],
29
- ['Institution', 'authenticated']
27
+ [t('bulkrax.importer.xml.visibility.public'), 'open'],
28
+ [t('bulkrax.importer.xml.visibility.private'), 'restricted'],
29
+ [t('bulkrax.importer.xml.visibility.institution'), 'authenticated']
30
30
  ],
31
31
  selected: importer.parser_fields['visibility'] || 'open',
32
32
  input_html: { class: 'form-control' }
@@ -41,15 +41,15 @@
41
41
  item_helper: rights_statements.method(:include_current_value),
42
42
  input_html: { class: 'form-control' },
43
43
  required: false %>
44
- <%= fi.input :override_rights_statement, as: :boolean, hint: 'If checked, always use the selected rights statement. If unchecked, use rights or rights_statement from the record and only use the provided value if dc:rights is blank.', input_html: { checked: (importer.parser_fields['override_rights_statement'] == "1") } %>
44
+ <%= fi.input :override_rights_statement, as: :boolean, hint: t('bulkrax.importer.xml.hints.override_rights_statement'), input_html: { checked: (importer.parser_fields['override_rights_statement'] == "1") } %>
45
45
  <% end %>
46
- <h4>XML and files to Import:</h4>
47
- <p>File upload and Cloud File upload MUST be a either a single XML file (for metadata only import) OR a Zip file containing the XML files and data files, each in a separate folder.</p>
48
- <p>The Server Path can point to a folder containing XML files and data files to import, or direct to the XML file itself.</p>
46
+ <h4><%= t('bulkrax.importer.xml.labels.xml_and_files') %></h4>
47
+ <p><%= t('bulkrax.importer.xml.hints.file_upload_hint') %></p>
48
+ <p><%= t('bulkrax.importer.xml.hints.server_path_hint') %></p>
49
49
 
50
50
  <%= fi.input :file_style,
51
- collection: ['Upload a File', 'Specify a Path on the Server'] +
52
- (defined?(::Hyrax) && Hyrax.config.browse_everything? ? ['Add Cloud File'] : []),
51
+ collection: [t('bulkrax.importer.xml.file_style.upload'), t('bulkrax.importer.xml.file_style.server_path')] +
52
+ (defined?(::Hyrax) && Hyrax.config.browse_everything? ? [t('bulkrax.importer.xml.file_style.cloud')] : []),
53
53
  as: :radio_buttons, label: false %>
54
54
  <div id='file_upload'>
55
55
  <% if defined?(::Hyrax) %>
@@ -1,5 +1,5 @@
1
1
  <% provide :page_header do %>
2
- <h1><span class="fa fa-edit" aria-hidden="true"></span> Edit Importer</h1>
2
+ <h1><span class="fa fa-edit" aria-hidden="true"></span> <%= t('helpers.action.importer.edit_importer') %></h1>
3
3
  <% end %>
4
4
 
5
5
  <div class="row">
@@ -11,7 +11,7 @@
11
11
  <div class="panel-footer card-footer bulkrax-card-footer">
12
12
  <div class='pull-right'>
13
13
  <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#bulkraxModal">
14
- Update Importer
14
+ <%= t('helpers.action.importer.update') %>
15
15
  </button>
16
16
  <%= render 'edit_form_buttons', form: form %>
17
17
  <% cancel_path = form.object.persisted? ? importer_path(form.object) : importers_path %>
@@ -1,5 +1,5 @@
1
1
  <% provide :page_header do %>
2
- <h1><span class="fa fa-cloud-upload" aria-hidden="true"></span> Importers</h1>
2
+ <h1><span class="fa fa-cloud-upload" aria-hidden="true"></span> <%= t('bulkrax.headings.importers') %></h1>
3
3
  <div class="pull-right">
4
4
  <%= link_to new_importer_path, class: 'btn btn-primary' do %>
5
5
  <span class="fa fa-edit" aria-hidden="true"></span> <%= t(:'helpers.action.importer.new') %>
@@ -17,18 +17,18 @@
17
17
  <table id='importers-table' class="table table-striped">
18
18
  <thead>
19
19
  <tr>
20
- <th scope="col">Name</th>
21
- <th scope="col">Status</th>
22
- <th scope="col">Last Run</th>
23
- <th scope="col">Next Run</th>
24
- <th scope="col">Entries Enqueued</th>
25
- <th scope="col">Entries Processed</th>
26
- <th scope="col">Entries Failed</th>
27
- <th scope="col">Entries Deleted Upstream</th>
28
- <th scope="col">Total Collection Entries</th>
29
- <th scope="col">Total Work Entries</th>
30
- <th scope="col">Total File Set Entries</th>
31
- <th scope="col">Actions</th>
20
+ <th scope="col"><%= t('bulkrax.table_header.labels.name') %></th>
21
+ <th scope="col"><%= t('bulkrax.table_header.labels.status') %></th>
22
+ <th scope="col"><%= t('bulkrax.table_header.labels.last_run') %></th>
23
+ <th scope="col"><%= t('bulkrax.table_header.labels.next_run') %></th>
24
+ <th scope="col"><%= t('bulkrax.table_header.labels.entries_enqueued') %></th>
25
+ <th scope="col"><%= t('bulkrax.table_header.labels.entries_processed') %></th>
26
+ <th scope="col"><%= t('bulkrax.table_header.labels.entries_failed') %></th>
27
+ <th scope="col"><%= t('bulkrax.table_header.labels.entries_deleted_upstream') %></th>
28
+ <th scope="col"><%= t('bulkrax.table_header.labels.total_collection_entries') %></th>
29
+ <th scope="col"><%= t('bulkrax.table_header.labels.total_work_entries') %></th>
30
+ <th scope="col"><%= t('bulkrax.table_header.labels.total_file_set_entries') %></th>
31
+ <th scope="col"><%= t('bulkrax.table_header.labels.actions') %></th>
32
32
  </tr>
33
33
  </thead>
34
34
  </table>
@@ -1,24 +1,25 @@
1
1
  <% provide :page_header do %>
2
2
  <h1><span class="fa fa-edit" aria-hidden="true"></span> New Importer</h1>
3
3
  <% end %>
4
-
5
4
  <div class="row">
6
5
  <div class="col-md-12">
6
+ <% if defined?(Hyrax) %>
7
+ <div class="d-flex justify-content-end mr-2 me-2">
8
+ <%= button_to t('helpers.action.importer.generate_csv_template'), sample_csv_file_importers_path, method: :post, class: 'btn btn-default' %>
9
+ </div>
10
+ <% end %>
7
11
  <div class="panel card panel-default importer-form">
8
12
  <%= simple_form_for @importer, html: { multipart: true } do |form| %>
9
13
  <%= render 'form', importer: @importer, form: form %>
10
14
  <div class="panel-footer card-footer bulkrax-card-footer">
11
15
  <div class='pull-right'>
12
16
  <% if ENV['SHOW_CREATE_AND_VALIDATE'] == 'true' %>
13
- <%= form.button :submit, value: 'Create and Validate', class: 'btn btn-primary' %>
14
- |
15
- <% end %>
16
- <%= form.button :submit, value: 'Create and Import', class: 'btn btn-primary' %>
17
- |
18
- <%= form.button :submit, value: 'Create', class: 'btn btn-primary' %>
19
- |
17
+ <%= submit_tag t('helpers.action.importer.create_and_validate'), class: 'btn btn-default me-2' %>
18
+ <% end %>
19
+ <%= submit_tag t('helpers.action.importer.create_and_import'), class: 'btn btn-primary me-2' %>
20
+ <%= submit_tag t('helpers.action.importer.create'), class: 'btn btn-default' %>
20
21
  <% cancel_path = form.object.persisted? ? importer_path(form.object) : importers_path %>
21
- <%= link_to t('bulkrax.cancel'), cancel_path, class: 'btn btn-default ' %>
22
+ <%= link_to t('bulkrax.cancel'), cancel_path, class: 'btn btn-default' %>
22
23
  </div>
23
24
  </div>
24
25
  <% end %>
@@ -1,10 +1,10 @@
1
1
  <div class="col-xs-12 main-header d-flex justify-content-between align-items-center">
2
2
  <h1><span class="fa fa-cloud-upload" aria-hidden="true"></span> Importer: <%= @importer.name %></h1>
3
3
  <div class="pull-right">
4
- <%= link_to 'Download Original File', importer_original_file_path(@importer.id), class: 'btn btn-primary text-nowrap', data: { turbolinks: false } if @importer.original_file %>
4
+ <%= link_to t('helpers.action.importer.download_original_file'), importer_original_file_path(@importer.id), class: 'btn btn-primary text-nowrap', data: { turbolinks: false } if @importer.original_file %>
5
5
  <% if @importer.failed_entries? %>
6
- <%= link_to 'Export Errored Entries', importer_export_errors_path(@importer.id), class: 'btn btn-primary text-nowrap', data: { turbolinks: false }%>
7
- <%= link_to 'Upload Corrected Entries', importer_upload_corrected_entries_path(@importer.id), class: 'btn btn-primary text-nowrap' if @importer.parser.is_a?(Bulkrax::CsvParser) %>
6
+ <%= link_to t('helpers.action.importer.export_errored_entries'), importer_export_errors_path(@importer.id), class: 'btn btn-primary text-nowrap', data: { turbolinks: false }%>
7
+ <%= link_to t('helpers.action.importer.upload_corrected_entries'), importer_upload_corrected_entries_path(@importer.id), class: 'btn btn-primary text-nowrap' if @importer.parser.is_a?(Bulkrax::CsvParser) %>
8
8
  <% end %>
9
9
  </div>
10
10
  </div>
@@ -83,17 +83,17 @@
83
83
  </div>
84
84
 
85
85
  <p class="bulkrax-p-align">
86
- <%= link_to 'Edit', edit_importer_path(@importer) %>
86
+ <%= link_to t('helpers.action.importer.edit'), edit_importer_path(@importer) %>
87
87
  |
88
- <%= link_to 'Back', importers_path %><br /><br />
88
+ <%= link_to t('helpers.action.importer.back'), importers_path %><br /><br />
89
89
  </p>
90
90
 
91
91
  <% if @importer.validate_only == true %>
92
92
  <div class='pull-left'>
93
- <%= button_to 'Continue', importer_continue_path(@importer), method: :put, class: 'btn btn-primary' %>
93
+ <%= button_to t('helpers.action.importer.continue'), importer_continue_path(@importer), method: :put, class: 'btn btn-primary' %>
94
94
  </div>
95
95
  <div class='pull-right'>
96
- <%= button_to 'Discard', @importer, method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-primary' %>
96
+ <%= button_to t('helpers.action.importer.discard'), @importer, method: :delete, data: { confirm: t('helpers.action.importer.discard_confirm') }, class: 'btn btn-primary' %>
97
97
  </div>
98
98
  <% end %>
99
99
  </div>
@@ -1,16 +1,16 @@
1
1
  <div class='col-xs-12 main-header'>
2
- <h1><span class='fa fa-cloud-upload' aria-hidden='true'></span> Upload Corrected Entries: <%= @importer.name %></h1>
2
+ <h1><span class='fa fa-cloud-upload' aria-hidden='true'></span> <%= t('bulkrax.headings.upload_corrected_entries', name: @importer.name) %></h1>
3
3
  </div>
4
4
 
5
5
  <div class='panel card panel-default'>
6
6
  <div class='panel-body card-body'>
7
7
  <p>
8
- Upload <b>only</b> the corrected entries for the <b><%= @importer.name %></b> importer. To export failed entries for correction,
8
+ <%= t('bulkrax.importer.upload_corrected_entries.instructions_html', name: @importer.name).html_safe %>
9
9
  <%= link_to importer_export_errors_path(@importer.id) do %>
10
- click here <span class='fa fa-download'></span>
10
+ <%= t('bulkrax.importer.upload_corrected_entries.click_here') %> <span class='fa fa-download'></span>
11
11
  <% end %>
12
12
  </p>
13
- <p>Only CSV files are allowed.</p>
13
+ <p><%= t('bulkrax.importer.upload_corrected_entries.csv_only') %></p>
14
14
 
15
15
  <%= simple_form_for @importer, url: importer_upload_corrected_entries_file_path, method: :post, html: { multipart: true } do |f| %>
16
16
  <%= f.fields_for :parser_fields do |fi| %>
@@ -18,7 +18,7 @@
18
18
  <div class='fileupload-buttonbar hide-required-tag'>
19
19
  <%= fi.input 'file',
20
20
  as: :file,
21
- label: "<span class='fa fa-plus'></span><span> Add file...</span>".html_safe,
21
+ label: "<span class='fa fa-plus'></span><span> #{t('helpers.action.importer.add_file')}</span>".html_safe,
22
22
  label_html: {
23
23
  class: 'btn btn-success'
24
24
  },
@@ -30,7 +30,7 @@
30
30
  </div>
31
31
  <% end %>
32
32
  <div class='pull-right'>
33
- <%= f.button :submit, 'Import Corrected Works', class: 'btn btn-primary' %>
33
+ <%= f.button :submit, t('helpers.action.importer.import_corrected_works'), class: 'btn btn-primary' %>
34
34
  </div>
35
35
  <% end %>
36
36
  </div>
@@ -2,7 +2,7 @@
2
2
  <div class="accordion-container">
3
3
  <div class="accordion-heading" role="tab" id="error-trace-heading">
4
4
  <a class="accordion-title" role="button" data-toggle="collapse" data-target="#error-trace-show" aria-expanded="true" aria-controls="error-trace-show">
5
- Errors:
5
+ <%= t('bulkrax.shared.errors.errors_heading') %>
6
6
  </a>
7
7
  <a role="button" data-toggle="collapse" data-target="#error-trace-show" aria-expanded="true" aria-controls="error-trace-show">
8
8
  <div class="accordion-icon fa fa-times-circle" aria-hidden="true"></div>
@@ -13,24 +13,24 @@
13
13
  <div class="bulkrax-nav-tab-bottom-margin">
14
14
  <!-- Toggle buttons -->
15
15
  <div class="btn-group pull-right" role="group" aria-label="...">
16
- <button id="full-errors-tab" type="button" class="btn btn-default active"><a href="#bulkrax-full-toggle-1" aria-controls="bulkrax-full-toggle-1" role="tab" data-toggle="tab">Full</a></button>
17
- <button id="raw-errors-tab" type="button" class="btn btn-default"><a href="#bulkrax-raw-toggle-1" aria-controls="bulkrax-raw-toggle-1" role="tab" data-toggle="tab">Raw</a></button>
16
+ <button id="full-errors-tab" type="button" class="btn btn-default active"><a href="#bulkrax-full-toggle-1" aria-controls="bulkrax-full-toggle-1" role="tab" data-toggle="tab"><%= t('bulkrax.shared.errors.full') %></a></button>
17
+ <button id="raw-errors-tab" type="button" class="btn btn-default"><a href="#bulkrax-raw-toggle-1" aria-controls="bulkrax-raw-toggle-1" role="tab" data-toggle="tab"><%= t('bulkrax.shared.errors.raw') %></a></button>
18
18
  </div>
19
19
  <!-- Tab panes -->
20
20
  <div class="tab-content">
21
21
  <div role="tabpanel" class="tab-pane active" id="bulkrax-full-toggle-1">
22
- <strong>Errored at:</strong> <%= item.status_at %><br /><br />
23
- <strong>Error:</strong> <%= item.current_status.error_class %> - <%= item.current_status.error_message %><br /><br />
24
- <strong>Error Trace:</strong><br/><br />
22
+ <strong><%= t('bulkrax.shared.errors.errored_at') %></strong> <%= item.status_at %><br /><br />
23
+ <strong><%= t('bulkrax.shared.errors.error') %></strong> <%= item.current_status.error_class %> - <%= item.current_status.error_message %><br /><br />
24
+ <strong><%= t('bulkrax.shared.errors.error_trace') %></strong><br/><br />
25
25
  <% item.current_status.error_backtrace.each do |v| %>
26
26
  <%= coderay(v, { wrap: :page, css: :class, tab_width: 200, break_lines: true }) %>
27
27
  <br>
28
28
  <% end %>
29
29
  </div>
30
30
  <div role="tabpanel" class="tab-pane" id="bulkrax-raw-toggle-1">
31
- <strong>Errored at:</strong> <%= item.status_at %><br /><br />
32
- <strong>Error:</strong> <%= item.current_status.error_class %> - <%= item.current_status.error_message %><br /><br />
33
- <strong>Error Trace:</strong><br/><br />
31
+ <strong><%= t('bulkrax.shared.errors.errored_at') %></strong> <%= item.status_at %><br /><br />
32
+ <strong><%= t('bulkrax.shared.errors.error') %></strong> <%= item.current_status.error_class %> - <%= item.current_status.error_message %><br /><br />
33
+ <strong><%= t('bulkrax.shared.errors.error_trace') %></strong><br/><br />
34
34
  <% item.current_status.error_backtrace.each do |v| %>
35
35
  <%= coderay(v, { css: :class, tab_width: 0, break_lines: false }) %>
36
36
  <br>
@@ -43,10 +43,10 @@
43
43
  </div>
44
44
  <% elsif item.succeeded? %>
45
45
  <p class='bulkrax-p-align'>
46
- <strong>Succeeded At:</strong> <%= item.status_at %>
46
+ <strong><%= t('bulkrax.shared.errors.succeeded_at') %></strong> <%= item.status_at %>
47
47
  </p>
48
48
  <% else %>
49
49
  <p class='bulkrax-p-align'>
50
- <strong>Succeeded At:</strong> Item has not yet been <%= @importer.present? ? 'imported' : 'exported' %> successfully
50
+ <strong><%= t('bulkrax.shared.errors.succeeded_at') %></strong> <%= @importer.present? ? t('bulkrax.shared.errors.not_yet_imported') : t('bulkrax.shared.errors.not_yet_exported') %>
51
51
  </p>
52
52
  <% end %>
@@ -2,7 +2,7 @@
2
2
  <div class="accordion-container">
3
3
  <div class="accordion-heading" role="tab" id="field-mapping-show-heading">
4
4
  <a class="accordion-title" role="button" data-toggle="collapse" data-target="#field-mapping-show" aria-expanded="true" aria-controls="field-mapping-show">
5
- <strong>Field mapping:</strong>
5
+ <strong><%= t('bulkrax.shared.field_mapping.heading') %></strong>
6
6
  </a>
7
7
  <a role="button" data-toggle="collapse" data-target="#field-mapping-show" aria-expanded="true" aria-controls="field-mapping-show">
8
8
  <div class="accordion-icon fa fa-times-circle" aria-hidden="true"></div>
@@ -13,8 +13,8 @@
13
13
  <div class="bulkrax-nav-tab-bottom-margin">
14
14
  <!-- Toggle buttons -->
15
15
  <div class="btn-group pull-right" role="group" aria-label="...">
16
- <button type="button" class="btn btn-default"><a href="#bulkrax-full-toggle-2" aria-controls="bulkrax-full-toggle-2" role="tab" data-toggle="tab">Full</a></button>
17
- <button type="button" class="btn btn-default"><a href="#bulkrax-raw-toggle-2" aria-controls="bulkrax-raw-toggle-2" role="tab" data-toggle="tab">Raw</a></button>
16
+ <button type="button" class="btn btn-default"><a href="#bulkrax-full-toggle-2" aria-controls="bulkrax-full-toggle-2" role="tab" data-toggle="tab"><%= t('bulkrax.shared.field_mapping.full') %></a></button>
17
+ <button type="button" class="btn btn-default"><a href="#bulkrax-raw-toggle-2" aria-controls="bulkrax-raw-toggle-2" role="tab" data-toggle="tab"><%= t('bulkrax.shared.field_mapping.raw') %></a></button>
18
18
  </div>
19
19
  <!-- Tab panes -->
20
20
  <div class="tab-content">
@@ -1,15 +1,106 @@
1
1
  en:
2
+ simple_form:
3
+ labels:
4
+ importer:
5
+ name: "Name"
6
+ admin_set_id: "Administrative Set"
7
+ frequency: "Frequency"
8
+ limit: "Limit"
9
+ parser_klass: "Parser"
10
+ exporter:
11
+ name: "Name"
12
+ export_type: "Type of Export"
13
+ export_from: "Export From"
14
+ export_source_importer: "Importer"
15
+ export_source_collection: "Collection"
16
+ export_source_worktype: "Work Type"
17
+ limit: "Limit"
18
+ generated_metadata?: "Include Generated Metadata?"
19
+ include_thumbnails?: "Include Thumbnails?"
20
+ date_filter: "Filter By Date"
21
+ start_date: "Start Date"
22
+ finish_date: "End Date"
23
+ work_visibility: "Visibility"
24
+ workflow_status: "Status"
25
+ parser_klass: "Export Format"
26
+ defaults:
27
+ visibility: "Visibility"
28
+ rights_statement: "Rights Statement"
29
+ override_rights_statement: "Override Rights Statement"
30
+ file_style: "File Style"
31
+ import_file_path: "Import File Path"
32
+ base_url: "Base URL"
33
+ metadata_prefix: "Metadata Prefix"
34
+ metadata_format: "Metadata Format"
35
+ record_element: "Record Element"
36
+ import_type: "Import Type"
37
+ thumbnail_url: "Thumbnail URL"
38
+ set: "Set (source)"
39
+ hints:
40
+ importer:
41
+ admin_set_id: "Select the Administrative Set whose policies (such as workflow and access controls) should apply to these imports. If unsure, select the Default Administrative Set."
42
+ limit: "Enter any number to run only a subset of records. Leave blank or enter 0 to run all records."
43
+ name: "Any name to identify this importer"
44
+ frequency: "The frequency with which to run this importer"
45
+ parser_fields: "Specific fields for each parser are available only when a parser is selected"
46
+ exporter:
47
+ generated_metadata?: "These exported fields currently cannot be imported."
48
+ include_thumbnails?: "These exported fields currently cannot be imported."
49
+ limit: "Enter any number to run only a subset of records. Leave blank or enter 0 to run all records."
50
+ name: "Any name to identify this importer"
51
+ defaults:
52
+ override_rights_statement: "If checked, always use the selected rights statement. If unchecked, use rights or rights_statement from the record and only use the provided value if dc:rights is blank."
53
+ default_visibility: "If your CSV includes the visibility field, it will override the default setting."
54
+ metadata_prefix: "Such as oai_dc, dcterms or oai_qdc"
55
+ record_element: "Provide the xml element name to use to identify the record, or records, eg. ROW - each record in the attached XML is wrapped in a <ROW> tag."
2
56
  helpers:
3
57
  action:
4
58
  importer:
59
+ edit_importer: "Edit Importer"
5
60
  new: "New"
61
+ create: "Create"
62
+ create_and_import: "Create and Import"
63
+ create_and_validate: "Create and Validate"
64
+ generate_csv_template: "Generate CSV Import Template"
65
+ download_original_file: "Download Original File"
66
+ export_errored_entries: "Export Errored Entries"
67
+ upload_corrected_entries: "Upload Corrected Entries"
68
+ import_corrected_works: "Import Corrected Works"
69
+ add_file: "Add file..."
70
+ edit: "Edit"
71
+ back: "Back"
72
+ continue: "Continue"
73
+ discard: "Discard"
74
+ discard_confirm: "Are you sure?"
75
+ build: "Build"
76
+ remove_and_build: "Remove and then Build"
77
+ update: "Update Importer"
78
+ update_and_import: "Update and Import"
79
+ update_and_harvest_updated: "Update and Harvest Updated Items"
80
+ update_and_re_harvest: "Update and Re-Harvest All Items"
81
+ update_metadata: "Update Metadata"
82
+ update_metadata_and_files: "Update Metadata and Files"
83
+ update_and_replace_files: "Update and Replace Files"
84
+ update_and_replace_files_confirm: "Are you sure? This will remove all files before adding them from the import."
85
+ remove_and_rerun: "Remove and Rerun"
86
+ remove_and_rerun_confirm: "Are you sure? This will delete all the works and any associated files and relationships before re running."
6
87
  exporter:
7
88
  new: "New"
89
+ create: "Create"
90
+ create_and_export: "Create and Export"
91
+ download: "Download"
92
+ edit: "Edit"
93
+ back: "Back"
94
+ update: "Update Exporter"
95
+ update_and_re_export: "Update and Re-Export All Items"
8
96
  bulkrax:
9
97
  admin:
10
98
  sidebar:
11
99
  exporters: Exporters
12
100
  importers: Importers
101
+ headings:
102
+ importers: Importers
103
+ upload_corrected_entries: "Upload Corrected Entries: %{name}"
13
104
  cancel: "Cancel"
14
105
  exporter:
15
106
  labels:
@@ -51,9 +142,23 @@ en:
51
142
  hints:
52
143
  include_thumbnails: "These exported fields currently cannot be imported."
53
144
  generated_metadata: "These exported fields currently cannot be imported."
145
+ limit: "leave blank or 0 for all records"
146
+ prompts:
147
+ export_type: "Please select an export type"
148
+ export_from: "Please select an export source"
149
+ select_from_list: "Select from the list"
150
+ start_typing: "Start typing ..."
151
+ validations:
152
+ errors_prohibited:
153
+ one: "1 error prohibited this exporter from being saved:"
154
+ other: "%{count} errors prohibited this exporter from being saved:"
54
155
  importer:
156
+ validations:
157
+ errors_prohibited:
158
+ one: "1 error prohibited this importer from being saved:"
159
+ other: "%{count} errors prohibited this importer from being saved:"
55
160
  labels:
56
- admin_set: Admin set
161
+ admin_set: Administrative set
57
162
  collection_entries: Collection Entries
58
163
  entry_id: Entry ID
59
164
  exporter: Exporter
@@ -63,13 +168,129 @@ en:
63
168
  importer: Importer
64
169
  limit: Limit
65
170
  name: Name
66
- parser_klass: Parser klass
171
+ parser_klass: Parser
67
172
  total_collections: Total Collections
68
173
  total_file_sets: Total File Sets
69
174
  total_work_entries: Total Works
70
175
  type: Type
71
176
  user: User
72
177
  work_entries: Work Entries
178
+ xml:
179
+ hints:
180
+ record_element: "Provide the xml element name to use to identify the record, or records, eg. ROW - each record in the attached XML is wrapped in a <ROW> tag."
181
+ override_rights_statement: "If checked, always use the selected rights statement. If unchecked, use rights or rights_statement from the record and only use the provided value if dc:rights is blank."
182
+ file_upload_hint: "File upload and Cloud File upload MUST be a either a single XML file (for metadata only import) OR a Zip file containing the XML files and data files, each in a separate folder."
183
+ server_path_hint: "The Server Path can point to a folder containing XML files and data files to import, or direct to the XML file itself."
184
+ labels:
185
+ visibility: "Visibility"
186
+ xml_and_files: "XML and files to Import:"
187
+ import_type:
188
+ single: "Single Work per Metadata File"
189
+ multiple: "Multiple Works per Metadata File"
190
+ visibility:
191
+ public: "Public"
192
+ private: "Private"
193
+ institution: "Institution"
194
+ file_style:
195
+ upload: "Upload a File"
196
+ server_path: "Specify a Path on the Server"
197
+ cloud: "Add Cloud File"
198
+ oai:
199
+ hints:
200
+ metadata_prefix: "Such as oai_dc, dcterms or oai_qdc"
201
+ override_rights_statement: "If checked, always use the selected rights statement. If unchecked, use dc:rights from the record and only use the provided value if dc:rights is blank."
202
+ thumbnail_url_html: |
203
+ <p>
204
+ The Thumbnail URL allows for basic templating and substitution on any identified information in to the url. For example:
205
+ </p>
206
+ <p>
207
+ http://commons.ptsem.edu/?cover=&lt;&#37;= identifier.split(':').last &#37;&gt;&amp;size=L
208
+ </p>
209
+ <p>
210
+ http://commons.ptsem.edu/?cover=&lt;&#37;= record.header.identifier.split(':').last &#37;&gt;&amp;size=L
211
+ </p>
212
+ labels:
213
+ set: "Set (source)"
214
+ visibility:
215
+ public: "Public"
216
+ private: "Private"
217
+ institution: "Institution"
218
+ refresh_sets: "Refresh Sets"
219
+ bagit:
220
+ visibility:
221
+ public: "Public"
222
+ private: "Private"
223
+ institution: "Institution"
224
+ bags_to_import: "Bag or Bags to Import:"
225
+ file_upload_hint: "File upload and Cloud File upload must be a Zip file containing a single BagIt Bag, or a folder containing multiple BagIt Bags."
226
+ server_path_hint: "The Server Path can point to a BagIt Bag, a folder containing BagIt Bags, or a zip file containing either."
227
+ file_style:
228
+ upload: "Upload a File"
229
+ server_path: "Specify a Path on the Server"
230
+ cloud: "Add Cloud File"
231
+ hints:
232
+ override_rights_statement: "If checked, always use the selected rights statement. If unchecked, use rights or rights_statement from the record and only use the provided value if dc:rights is blank."
233
+ default_visibility: "If your CSV includes the visibility field, it will override the default setting."
234
+ browse_everything:
235
+ add_cloud_files: "Add Cloud Files"
236
+ edit_form:
237
+ modal_title: "Options for Updating the Importer"
238
+ update_only_hint: "Only update the values in the importer form. Do not import metadata or files for any works or collections."
239
+ update_only_no_update_hint: "Only update the values in the importer form. Do not update metadata or files for any works or collections."
240
+ update_and_import_hint: "Update the values in the importer form and run the importer for the first time."
241
+ update_and_harvest_hint: "Update the values in the importer form and update items that have changed at the source."
242
+ update_and_re_harvest_hint: "Update the values in the importer form and recreate all items from the source."
243
+ update_metadata_hint: "Update the values in the importer form and update the metadata for all works. Do not update any files."
244
+ update_metadata_and_files_hint: "Update the values in the importer form and update the metadata and files for all works. Creates new versions of the files and retains the old versions."
245
+ update_and_replace_files_hint: "Update the values in the importer form and update the metadata. Completely removes all files attached to works for this importer and recreates the files from scratch."
246
+ remove_and_rerun_hint: "Remove all works and then run the import again from a clean slate. This will remove all files and associations and any edits made since the last import will be lost."
247
+ csv:
248
+ labels:
249
+ default_visibility: "Default Visibility"
250
+ visibility:
251
+ public: "Public"
252
+ private: "Private"
253
+ institution: "Institution"
254
+ add_csv_to_import: "Add CSV or ZIP File to Import:"
255
+ file_style:
256
+ upload: "Upload a File"
257
+ server_path: "Specify a Path on the Server"
258
+ existing_entries: "Existing Entries"
259
+ add_files_to_import: "Add Files to Import:"
260
+ add_files_hint: "Choose files to upload. The filenames must be unique, and the filenames must be referenced in a column called 'file' in the accompanying CSV file."
261
+ file_uploader:
262
+ add_files: "Add Files"
263
+ cancel_upload: "Cancel Upload"
264
+ dropzone: "Drop files here to upload"
265
+ upload_corrected_entries:
266
+ instructions_html: "Upload <b>only</b> the corrected entries for the <b>%{name}</b> importer. To export failed entries for correction,"
267
+ click_here: "click here"
268
+ csv_only: "Only CSV files are allowed."
269
+ shared:
270
+ field_mapping:
271
+ heading: "Field mapping:"
272
+ full: "Full"
273
+ raw: "Raw"
274
+ errors:
275
+ errors_heading: "Errors:"
276
+ full: "Full"
277
+ raw: "Raw"
278
+ errored_at: "Errored at:"
279
+ error: "Error:"
280
+ error_trace: "Error Trace:"
281
+ succeeded_at: "Succeeded At:"
282
+ not_yet_imported: "Item has not yet been imported successfully"
283
+ not_yet_exported: "Item has not yet been exported successfully"
284
+ entry:
285
+ labels:
286
+ parsed_metadata: "Parsed Metadata"
287
+ raw_metadata: "Raw Metadata"
288
+ unknown: "Unknown"
289
+ item_link: "Item Link"
290
+ item_not_imported: "Item has not yet been imported successfully"
291
+ item_link_error: "Unable to retrieve item (%{message})"
292
+ item_no_association: "No item associated with this entry or class unknown"
293
+ record_link: "%{record_type} Link"
73
294
  table_header:
74
295
  labels:
75
296
  identifier: Identifier
@@ -80,3 +301,15 @@ en:
80
301
  errors: Errors
81
302
  status_set_at: Status Set At
82
303
  actions: Actions
304
+ name: Name
305
+ date_exported: Date Exported
306
+ downloadable_files: Downloadable Files
307
+ last_run: Last Run
308
+ next_run: Next Run
309
+ entries_enqueued: Entries Enqueued
310
+ entries_processed: Entries Processed
311
+ entries_failed: Entries Failed
312
+ entries_deleted_upstream: Entries Deleted Upstream
313
+ total_collection_entries: Total Collection Entries
314
+ total_work_entries: Total Work Entries
315
+ total_file_set_entries: Total File Set Entries
data/config/routes.rb CHANGED
@@ -17,6 +17,7 @@ Bulkrax::Engine.routes.draw do
17
17
  collection do
18
18
  get :importer_table
19
19
  post :external_sets
20
+ post :sample_csv_file
20
21
  end
21
22
  resources :entries, only: %i[show update destroy]
22
23
  get :upload_corrected_entries
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bulkrax
4
- VERSION = '9.3.4'
4
+ VERSION = '9.3.5'
5
5
  end
data/lib/bulkrax.rb CHANGED
@@ -180,7 +180,6 @@ module Bulkrax
180
180
  alias setup config
181
181
 
182
182
  def_delegators :@config,
183
- :api_definition,
184
183
  :api_definition=,
185
184
  :collection_model_class,
186
185
  :collection_model_internal_resource,
@@ -207,9 +206,7 @@ module Bulkrax
207
206
  :generated_metadata_mapping=,
208
207
  :import_path,
209
208
  :import_path=,
210
- :multi_value_element_join_on,
211
209
  :multi_value_element_join_on=,
212
- :multi_value_element_split_on,
213
210
  :multi_value_element_split_on=,
214
211
  :object_factory,
215
212
  :object_factory=,