bulkrax 9.3.4 → 9.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +11 -1
- data/app/assets/javascripts/bulkrax/application.js +2 -1
- data/app/assets/javascripts/bulkrax/bulkrax.js +13 -4
- data/app/assets/javascripts/bulkrax/bulkrax_utils.js +96 -0
- data/app/assets/javascripts/bulkrax/datatables.js +1 -0
- data/app/assets/javascripts/bulkrax/entries.js +17 -10
- data/app/assets/javascripts/bulkrax/importers.js.erb +9 -2
- data/app/assets/javascripts/bulkrax/importers_stepper.js +2420 -0
- data/app/assets/stylesheets/bulkrax/application.css +1 -1
- data/app/assets/stylesheets/bulkrax/import_export.scss +9 -2
- data/app/assets/stylesheets/bulkrax/stepper/_header.scss +83 -0
- data/app/assets/stylesheets/bulkrax/stepper/_mixins.scss +26 -0
- data/app/assets/stylesheets/bulkrax/stepper/_navigation.scss +103 -0
- data/app/assets/stylesheets/bulkrax/stepper/_responsive.scss +46 -0
- data/app/assets/stylesheets/bulkrax/stepper/_review.scss +92 -0
- data/app/assets/stylesheets/bulkrax/stepper/_settings.scss +106 -0
- data/app/assets/stylesheets/bulkrax/stepper/_success.scss +26 -0
- data/app/assets/stylesheets/bulkrax/stepper/_summary.scss +171 -0
- data/app/assets/stylesheets/bulkrax/stepper/_upload.scss +339 -0
- data/app/assets/stylesheets/bulkrax/stepper/_validation.scss +237 -0
- data/app/assets/stylesheets/bulkrax/stepper/_variables.scss +46 -0
- data/app/assets/stylesheets/bulkrax/stepper.scss +32 -0
- data/app/controllers/bulkrax/guided_imports_controller.rb +175 -0
- data/app/controllers/bulkrax/importers_controller.rb +34 -28
- data/app/controllers/concerns/bulkrax/guided_import_demo_scenarios.rb +201 -0
- data/app/controllers/concerns/bulkrax/importer_file_handler.rb +217 -0
- data/app/factories/bulkrax/object_factory.rb +3 -2
- data/app/factories/bulkrax/valkyrie_object_factory.rb +61 -17
- data/app/jobs/bulkrax/export_work_job.rb +1 -3
- data/app/jobs/bulkrax/importer_job.rb +11 -4
- data/app/models/bulkrax/csv_entry.rb +27 -7
- data/app/models/bulkrax/entry.rb +4 -0
- data/app/models/bulkrax/importer.rb +31 -1
- data/app/models/concerns/bulkrax/has_matchers.rb +2 -2
- data/app/models/concerns/bulkrax/importer_exporter_behavior.rb +6 -5
- data/app/parsers/bulkrax/application_parser.rb +31 -5
- data/app/parsers/bulkrax/csv_parser.rb +42 -10
- data/app/parsers/concerns/bulkrax/csv_parser/csv_template_generation.rb +73 -0
- data/app/parsers/concerns/bulkrax/csv_parser/csv_validation.rb +133 -0
- data/app/parsers/concerns/bulkrax/csv_parser/csv_validation_helpers.rb +282 -0
- data/app/parsers/concerns/bulkrax/csv_parser/csv_validation_hierarchy.rb +96 -0
- data/app/services/bulkrax/csv_template/column_builder.rb +60 -0
- data/app/services/bulkrax/csv_template/column_descriptor.rb +58 -0
- data/app/services/bulkrax/csv_template/csv_builder.rb +83 -0
- data/app/services/bulkrax/csv_template/explanation_builder.rb +57 -0
- data/app/services/bulkrax/csv_template/field_analyzer.rb +56 -0
- data/app/services/bulkrax/csv_template/file_path_generator.rb +47 -0
- data/app/services/bulkrax/csv_template/file_validator.rb +68 -0
- data/app/services/bulkrax/csv_template/mapping_manager.rb +55 -0
- data/app/services/bulkrax/csv_template/model_loader.rb +50 -0
- data/app/services/bulkrax/csv_template/row_builder.rb +35 -0
- data/app/services/bulkrax/csv_template/schema_analyzer.rb +70 -0
- data/app/services/bulkrax/csv_template/split_formatter.rb +44 -0
- data/app/services/bulkrax/csv_template/value_determiner.rb +68 -0
- data/app/services/bulkrax/stepper_response_formatter.rb +347 -0
- data/app/services/bulkrax/validation_error_csv_builder.rb +99 -0
- data/app/validators/bulkrax/csv_row/child_reference.rb +56 -0
- data/app/validators/bulkrax/csv_row/circular_reference.rb +71 -0
- data/app/validators/bulkrax/csv_row/controlled_vocabulary.rb +74 -0
- data/app/validators/bulkrax/csv_row/duplicate_identifier.rb +63 -0
- data/app/validators/bulkrax/csv_row/missing_source_identifier.rb +31 -0
- data/app/validators/bulkrax/csv_row/parent_reference.rb +59 -0
- data/app/validators/bulkrax/csv_row/required_values.rb +64 -0
- data/app/views/bulkrax/entries/_parsed_metadata.html.erb +1 -1
- data/app/views/bulkrax/entries/_raw_metadata.html.erb +1 -1
- data/app/views/bulkrax/entries/show.html.erb +6 -6
- data/app/views/bulkrax/exporters/_form.html.erb +19 -43
- data/app/views/bulkrax/exporters/edit.html.erb +2 -2
- data/app/views/bulkrax/exporters/index.html.erb +5 -5
- data/app/views/bulkrax/exporters/new.html.erb +3 -5
- data/app/views/bulkrax/exporters/show.html.erb +3 -3
- data/app/views/bulkrax/guided_imports/new.html.erb +567 -0
- data/app/views/bulkrax/importers/_bagit_fields.html.erb +9 -9
- data/app/views/bulkrax/importers/_browse_everything.html.erb +1 -1
- data/app/views/bulkrax/importers/_csv_fields.html.erb +11 -11
- data/app/views/bulkrax/importers/_edit_form_buttons.html.erb +23 -23
- data/app/views/bulkrax/importers/_edit_item_buttons.html.erb +2 -2
- data/app/views/bulkrax/importers/_file_uploader.html.erb +3 -3
- data/app/views/bulkrax/importers/_form.html.erb +4 -5
- data/app/views/bulkrax/importers/_oai_fields.html.erb +8 -18
- data/app/views/bulkrax/importers/_xml_fields.html.erb +13 -13
- data/app/views/bulkrax/importers/edit.html.erb +2 -2
- data/app/views/bulkrax/importers/index.html.erb +19 -14
- data/app/views/bulkrax/importers/new.html.erb +10 -9
- data/app/views/bulkrax/importers/show.html.erb +23 -7
- data/app/views/bulkrax/importers/upload_corrected_entries.html.erb +6 -6
- data/app/views/bulkrax/shared/_bulkrax_errors.html.erb +11 -11
- data/app/views/bulkrax/shared/_bulkrax_field_mapping.html.erb +3 -3
- data/config/i18n-tasks.yml +195 -0
- data/config/locales/bulkrax.de.yml +504 -0
- data/config/locales/bulkrax.en.yml +487 -28
- data/config/locales/bulkrax.es.yml +504 -0
- data/config/locales/bulkrax.fr.yml +504 -0
- data/config/locales/bulkrax.it.yml +504 -0
- data/config/locales/bulkrax.pt-BR.yml +504 -0
- data/config/locales/bulkrax.zh.yml +503 -0
- data/config/routes.rb +10 -0
- data/lib/bulkrax/data/demo_scenarios.json +2235 -0
- data/lib/bulkrax/version.rb +1 -1
- data/lib/bulkrax.rb +31 -3
- data/lib/tasks/bulkrax_tasks.rake +0 -102
- metadata +55 -3
- /data/{app/services → lib}/wings/custom_queries/find_by_source_identifier.rb +0 -0
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
<div class='csv_fields'>
|
|
2
2
|
<%= fi.input :visibility,
|
|
3
|
-
label: '
|
|
3
|
+
label: t('bulkrax.importer.csv.labels.default_visibility'),
|
|
4
4
|
collection: [
|
|
5
|
-
['
|
|
6
|
-
['
|
|
7
|
-
['
|
|
5
|
+
[t('bulkrax.importer.csv.visibility.public'), 'open'],
|
|
6
|
+
[t('bulkrax.importer.csv.visibility.private'), 'restricted'],
|
|
7
|
+
[t('bulkrax.importer.csv.visibility.institution'), 'authenticated']
|
|
8
8
|
],
|
|
9
9
|
selected: importer.parser_fields['visibility'] || 'open',
|
|
10
10
|
input_html: { class: 'form-control' },
|
|
11
|
-
hint: '
|
|
11
|
+
hint: t('bulkrax.importer.hints.default_visibility')
|
|
12
12
|
%>
|
|
13
13
|
<% if defined?(::Hyrax) %>
|
|
14
14
|
<% rights_statements = Hyrax.config.rights_statement_service_class.new %>
|
|
@@ -20,12 +20,12 @@
|
|
|
20
20
|
input_html: { class: 'form-control' },
|
|
21
21
|
required: false
|
|
22
22
|
%>
|
|
23
|
-
<%= fi.input :override_rights_statement, as: :boolean, hint: '
|
|
23
|
+
<%= fi.input :override_rights_statement, as: :boolean, hint: t('bulkrax.importer.hints.override_rights_statement'), input_html: { checked: (importer.parser_fields['override_rights_statement'] == "1") } %>
|
|
24
24
|
<% end %>
|
|
25
|
-
<h4
|
|
25
|
+
<h4><%= t('bulkrax.importer.csv.add_csv_to_import') %></h4>
|
|
26
26
|
<%# accept a single file upload; data files and bags will need to be added another way %>
|
|
27
|
-
<% file_style_list = ['
|
|
28
|
-
<% file_style_list << '
|
|
27
|
+
<% file_style_list = [t('bulkrax.importer.csv.file_style.upload'), t('bulkrax.importer.csv.file_style.server_path')] %>
|
|
28
|
+
<% file_style_list << t('bulkrax.importer.csv.file_style.existing_entries') unless importer.new_record? %>
|
|
29
29
|
<%= fi.input :file_style, collection: file_style_list, as: :radio_buttons, label: false %>
|
|
30
30
|
|
|
31
31
|
<div id='file_upload'>
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
</div>
|
|
46
46
|
|
|
47
47
|
<% if defined?(::Hyrax) && Hyrax.config.browse_everything? %>
|
|
48
|
-
<h4
|
|
49
|
-
<p
|
|
48
|
+
<h4><%= t('bulkrax.importer.csv.add_files_to_import') %></h4>
|
|
49
|
+
<p><%= t('bulkrax.importer.csv.add_files_hint') %></p>
|
|
50
50
|
<%= render 'browse_everything', form: form %>
|
|
51
51
|
<% end %>
|
|
52
52
|
<br />
|
|
@@ -2,45 +2,45 @@
|
|
|
2
2
|
<div class="modal-dialog" role="document">
|
|
3
3
|
<div class="modal-content">
|
|
4
4
|
<div class="modal-body">
|
|
5
|
-
<h5
|
|
5
|
+
<h5><%= t('bulkrax.importer.edit_form.modal_title') %></h5>
|
|
6
6
|
<hr />
|
|
7
7
|
|
|
8
8
|
<% if @importer.importer_runs.blank? %>
|
|
9
|
-
<p
|
|
10
|
-
<%= form.button :submit, value: '
|
|
9
|
+
<p><%= t('bulkrax.importer.edit_form.update_only_hint') %></p>
|
|
10
|
+
<%= form.button :submit, value: t('helpers.action.importer.update'), class: 'btn btn-primary' %>
|
|
11
11
|
<hr />
|
|
12
|
-
<p
|
|
13
|
-
<%= form.button :submit, value: '
|
|
12
|
+
<p><%= t('bulkrax.importer.edit_form.update_and_import_hint') %></p>
|
|
13
|
+
<%= form.button :submit, value: t('helpers.action.importer.update_and_import'), class: 'btn btn-primary' %>
|
|
14
14
|
<% elsif @importer.parser_klass.include?('Oai') %>
|
|
15
|
-
<p
|
|
16
|
-
<%= form.button :submit, value: '
|
|
15
|
+
<p><%= t('bulkrax.importer.edit_form.update_only_no_update_hint') %></p>
|
|
16
|
+
<%= form.button :submit, value: t('helpers.action.importer.update'), class: 'btn btn-primary' %>
|
|
17
17
|
<hr />
|
|
18
|
-
<p
|
|
19
|
-
<%= form.button :submit, value: '
|
|
18
|
+
<p><%= t('bulkrax.importer.edit_form.update_and_harvest_hint') %></p>
|
|
19
|
+
<%= form.button :submit, value: t('helpers.action.importer.update_and_harvest_updated'), class: 'btn btn-primary' %>
|
|
20
20
|
<hr />
|
|
21
|
-
<p
|
|
22
|
-
<%= form.button :submit, value: '
|
|
21
|
+
<p><%= t('bulkrax.importer.edit_form.update_and_re_harvest_hint') %></p>
|
|
22
|
+
<%= form.button :submit, value: t('helpers.action.importer.update_and_re_harvest'), class: 'btn btn-primary' %>
|
|
23
23
|
<% else %>
|
|
24
|
-
<p
|
|
25
|
-
<%= form.button :submit, value: '
|
|
24
|
+
<p><%= t('bulkrax.importer.edit_form.update_only_no_update_hint') %></p>
|
|
25
|
+
<%= form.button :submit, value: t('helpers.action.importer.update'), class: 'btn btn-primary' %>
|
|
26
26
|
<hr />
|
|
27
|
-
<p
|
|
28
|
-
<%= form.button :submit, value: '
|
|
27
|
+
<p><%= t('bulkrax.importer.edit_form.update_metadata_hint') %></p>
|
|
28
|
+
<%= form.button :submit, value: t('helpers.action.importer.update_metadata'), class: 'btn btn-primary' %>
|
|
29
29
|
<hr />
|
|
30
|
-
<p
|
|
31
|
-
<%= form.button :submit, value: '
|
|
30
|
+
<p><%= t('bulkrax.importer.edit_form.update_metadata_and_files_hint') %></p>
|
|
31
|
+
<%= form.button :submit, value: t('helpers.action.importer.update_metadata_and_files'), class: 'btn btn-primary' %>
|
|
32
32
|
<hr />
|
|
33
|
-
<p
|
|
33
|
+
<p><%= t('bulkrax.importer.edit_form.update_and_replace_files_hint') %></p>
|
|
34
34
|
<%= form.button :submit,
|
|
35
|
-
value: '
|
|
35
|
+
value: t('helpers.action.importer.update_and_replace_files'),
|
|
36
36
|
class: 'btn btn-primary',
|
|
37
|
-
data: {confirm:
|
|
37
|
+
data: {confirm: t('helpers.action.importer.update_and_replace_files_confirm')} %>
|
|
38
38
|
<hr />
|
|
39
|
-
<p
|
|
39
|
+
<p><%= t('bulkrax.importer.edit_form.remove_and_rerun_hint') %></p>
|
|
40
40
|
<%= form.button :submit,
|
|
41
|
-
value: '
|
|
41
|
+
value: t('helpers.action.importer.remove_and_rerun'),
|
|
42
42
|
class: 'btn btn-primary',
|
|
43
|
-
data: {confirm:
|
|
43
|
+
data: {confirm: t('helpers.action.importer.remove_and_rerun_confirm')} %>
|
|
44
44
|
|
|
45
45
|
<% end %>
|
|
46
46
|
<hr />
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
<h5>Options for Updating an Entry</h5>
|
|
6
6
|
<hr />
|
|
7
7
|
<p>Rebuild metadata and files.</p>
|
|
8
|
-
<%= link_to '
|
|
8
|
+
<%= link_to t('helpers.action.importer.build'), item_entry_path(item, e), method: :patch, class: 'btn btn-primary' %>
|
|
9
9
|
<hr />
|
|
10
10
|
<p>Remove existing work and then recreate the works metadata and files.</p>
|
|
11
|
-
<%= link_to '
|
|
11
|
+
<%= link_to t('helpers.action.importer.remove_and_build'), item_entry_path(item, e, destroy_first: true), method: :patch, class: 'btn btn-primary' %>
|
|
12
12
|
</div>
|
|
13
13
|
<div class="modal-footer">
|
|
14
14
|
<button type="button" class="btn btn-default" data-dismiss="modal"><%= t('helpers.action.cancel') %></button>
|
|
@@ -9,12 +9,12 @@
|
|
|
9
9
|
accept="<%= accepted_file_types || 'text/csv,application/zip,application/gzip' %>" multiple />
|
|
10
10
|
<button type="button" class="btn btn-success" onclick="document.getElementById('addfiles').click();">
|
|
11
11
|
<span class="fa fa-plus"></span>
|
|
12
|
-
<span
|
|
12
|
+
<span><%= t('bulkrax.importer.file_uploader.add_files') %></span>
|
|
13
13
|
</button>
|
|
14
14
|
</div>
|
|
15
15
|
<button type="reset" id="file-upload-cancel-btn" class="btn btn-warning cancel">
|
|
16
16
|
<span class="fa fa-ban"></span>
|
|
17
|
-
<span
|
|
17
|
+
<span><%= t('bulkrax.importer.file_uploader.cancel_upload') %></span>
|
|
18
18
|
</button>
|
|
19
19
|
<span class="fileupload-process"></span>
|
|
20
20
|
</div>
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
</div>
|
|
32
32
|
</div>
|
|
33
33
|
<div class="dropzone">
|
|
34
|
-
|
|
34
|
+
<%= t('bulkrax.importer.file_uploader.dropzone') %>
|
|
35
35
|
</div>
|
|
36
36
|
<%= render 'hyrax/uploads/js_templates' %>
|
|
37
37
|
</div>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<div class="panel-body card-body">
|
|
2
2
|
<% if importer.errors.any? %>
|
|
3
3
|
<div id="error_explanation">
|
|
4
|
-
<h2><%=
|
|
4
|
+
<h2><%= t('bulkrax.importer.validations.errors_prohibited', count: importer.errors.count) %></h2>
|
|
5
5
|
|
|
6
6
|
<ul>
|
|
7
7
|
<% importer.errors.full_messages.each do |message| %>
|
|
@@ -19,17 +19,16 @@
|
|
|
19
19
|
|
|
20
20
|
<%= form.input :frequency, collection: form.object.class.frequency_enums, input_html: { class: 'form-control' } %>
|
|
21
21
|
|
|
22
|
-
<%= form.input :limit, as: :integer,
|
|
22
|
+
<%= form.input :limit, as: :integer, input_html: { class: 'form-control'} %>
|
|
23
23
|
|
|
24
|
-
<%= form.input :parser_klass, collection: Bulkrax.parsers.map {|p| [p[:name], p[:class_name], {'data-partial' => p[:partial]}]},
|
|
24
|
+
<%= form.input :parser_klass, collection: Bulkrax.parsers.map {|p| [p[:name], p[:class_name], {'data-partial' => p[:partial]}]}, input_html: { class: 'form-control' } %>
|
|
25
25
|
|
|
26
26
|
<%= form.fields_for :parser_fields do |fi| %>
|
|
27
27
|
<div class='parser_fields'>
|
|
28
|
-
<p
|
|
28
|
+
<p><%= t('simple_form.hints.importer.parser_fields') %></p>
|
|
29
29
|
<% Bulkrax.parsers.map {|p| p[:partial]}.uniq.each do |partial| %>
|
|
30
30
|
<%= render partial: partial, locals: {form: form, fi: fi, importer: importer} %>
|
|
31
31
|
<% end %>
|
|
32
32
|
</div>
|
|
33
33
|
<% end %>
|
|
34
|
-
|
|
35
34
|
</div>
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
<div class='oai_fields'>
|
|
2
2
|
<%= fi.input :base_url, as: :string, input_html: { value: importer.parser_fields['base_url'] } %>
|
|
3
3
|
|
|
4
|
-
<%= fi.input :metadata_prefix, as: :string, hint: '
|
|
4
|
+
<%= fi.input :metadata_prefix, as: :string, hint: t('bulkrax.importer.oai.hints.metadata_prefix'), input_html: { value: importer.parser_fields['metadata_prefix'] } %>
|
|
5
5
|
|
|
6
|
-
<%= fi.input :set, collection: [importer.parser_fields['set']], label: '
|
|
7
|
-
<button type="button" class="btn btn-default refresh-set-source"
|
|
6
|
+
<%= fi.input :set, collection: [importer.parser_fields['set']], label: t('bulkrax.importer.oai.labels.set'), selected: importer.parser_fields['set'] %>
|
|
7
|
+
<button type="button" class="btn btn-default refresh-set-source"><%= t('bulkrax.importer.oai.refresh_sets') %></button>
|
|
8
8
|
|
|
9
9
|
<%= fi.input :visibility,
|
|
10
10
|
collection: [
|
|
11
|
-
['
|
|
12
|
-
['
|
|
13
|
-
['
|
|
11
|
+
[t('bulkrax.importer.oai.visibility.public'), 'open'],
|
|
12
|
+
[t('bulkrax.importer.oai.visibility.private'), 'restricted'],
|
|
13
|
+
[t('bulkrax.importer.oai.visibility.institution'), 'authenticated']
|
|
14
14
|
],
|
|
15
15
|
selected: importer.parser_fields['visibility'] || 'open',
|
|
16
16
|
input_html: { class: 'form-control' }
|
|
@@ -26,20 +26,10 @@
|
|
|
26
26
|
input_html: { class: 'form-control' },
|
|
27
27
|
required: false
|
|
28
28
|
%>
|
|
29
|
-
<%= fi.input :override_rights_statement, as: :boolean, hint: '
|
|
29
|
+
<%= fi.input :override_rights_statement, as: :boolean, hint: t('bulkrax.importer.oai.hints.override_rights_statement'), input_html: { checked: (importer.parser_fields['override_rights_statement'] == "1") } %>
|
|
30
30
|
<% end %>
|
|
31
31
|
<%= fi.input :thumbnail_url, required: false, as: :string, input_html: { value: importer.parser_fields['thumbnail_url'] } %>
|
|
32
32
|
<div class="help-block well well-sm">
|
|
33
|
-
|
|
34
|
-
The Thumbnail URL allows for basic templating and substitution on any identified information in to the url. For example:
|
|
35
|
-
</p>
|
|
36
|
-
|
|
37
|
-
<p>
|
|
38
|
-
http://commons.ptsem.edu/?cover=<%= identifier.split(':').last %>&size=L
|
|
39
|
-
</p>
|
|
40
|
-
|
|
41
|
-
<p>
|
|
42
|
-
http://commons.ptsem.edu/?cover=<%= record.header.identifier.split(':').last %>&size=L
|
|
43
|
-
</p>
|
|
33
|
+
<%= t('bulkrax.importer.oai.hints.thumbnail_url_html').html_safe %>
|
|
44
34
|
</div>
|
|
45
35
|
</div>
|
|
@@ -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: '
|
|
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
|
-
['
|
|
17
|
-
['
|
|
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
|
|
23
|
+
<h4><%= t('bulkrax.importer.xml.labels.visibility') %></h4>
|
|
24
24
|
|
|
25
25
|
<%= fi.input :visibility,
|
|
26
26
|
collection: [
|
|
27
|
-
['
|
|
28
|
-
['
|
|
29
|
-
['
|
|
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: '
|
|
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
|
|
47
|
-
<p
|
|
48
|
-
<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: ['
|
|
52
|
-
(defined?(::Hyrax) && Hyrax.config.browse_everything? ? ['
|
|
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>
|
|
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
|
-
|
|
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,9 +1,14 @@
|
|
|
1
1
|
<% provide :page_header do %>
|
|
2
|
-
<h1><span class="fa fa-cloud-upload" aria-hidden="true"></span>
|
|
2
|
+
<h1><span class="fa fa-cloud-upload" aria-hidden="true"></span> <%= t('bulkrax.headings.importers') %></h1>
|
|
3
3
|
<div class="pull-right">
|
|
4
|
-
<%= link_to new_importer_path, class: 'btn btn-
|
|
4
|
+
<%= link_to new_importer_path, class: 'btn btn-secondary' do %>
|
|
5
5
|
<span class="fa fa-edit" aria-hidden="true"></span> <%= t(:'helpers.action.importer.new') %>
|
|
6
6
|
<% end %>
|
|
7
|
+
<% if Bulkrax.config.guided_import_enabled %>
|
|
8
|
+
<%= link_to guided_import_new_path, class: 'btn btn-primary' do %>
|
|
9
|
+
<span class="fa fa-edit" aria-hidden="true"></span> <%= t(:'helpers.action.importer.guided_import_new') %>
|
|
10
|
+
<% end %>
|
|
11
|
+
<% end %>
|
|
7
12
|
</div>
|
|
8
13
|
<% end %>
|
|
9
14
|
|
|
@@ -17,18 +22,18 @@
|
|
|
17
22
|
<table id='importers-table' class="table table-striped">
|
|
18
23
|
<thead>
|
|
19
24
|
<tr>
|
|
20
|
-
<th scope="col"
|
|
21
|
-
<th scope="col"
|
|
22
|
-
<th scope="col"
|
|
23
|
-
<th scope="col"
|
|
24
|
-
<th scope="col"
|
|
25
|
-
<th scope="col"
|
|
26
|
-
<th scope="col"
|
|
27
|
-
<th scope="col"
|
|
28
|
-
<th scope="col"
|
|
29
|
-
<th scope="col"
|
|
30
|
-
<th scope="col"
|
|
31
|
-
<th scope="col"
|
|
25
|
+
<th scope="col"><%= t('bulkrax.table_header.labels.name') %></th>
|
|
26
|
+
<th scope="col"><%= t('bulkrax.table_header.labels.status') %></th>
|
|
27
|
+
<th scope="col"><%= t('bulkrax.table_header.labels.last_run') %></th>
|
|
28
|
+
<th scope="col"><%= t('bulkrax.table_header.labels.next_run') %></th>
|
|
29
|
+
<th scope="col"><%= t('bulkrax.table_header.labels.entries_enqueued') %></th>
|
|
30
|
+
<th scope="col"><%= t('bulkrax.table_header.labels.entries_processed') %></th>
|
|
31
|
+
<th scope="col"><%= t('bulkrax.table_header.labels.entries_failed') %></th>
|
|
32
|
+
<th scope="col"><%= t('bulkrax.table_header.labels.entries_deleted_upstream') %></th>
|
|
33
|
+
<th scope="col"><%= t('bulkrax.table_header.labels.total_collection_entries') %></th>
|
|
34
|
+
<th scope="col"><%= t('bulkrax.table_header.labels.total_work_entries') %></th>
|
|
35
|
+
<th scope="col"><%= t('bulkrax.table_header.labels.total_file_set_entries') %></th>
|
|
36
|
+
<th scope="col"><%= t('bulkrax.table_header.labels.actions') %></th>
|
|
32
37
|
</tr>
|
|
33
38
|
</thead>
|
|
34
39
|
</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: :get, 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
|
-
<%=
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
<%=
|
|
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,26 @@
|
|
|
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
|
-
|
|
4
|
+
<% original_files = @importer.original_files %>
|
|
5
|
+
<% if original_files.any? %>
|
|
6
|
+
<% if original_files.size == 1 %>
|
|
7
|
+
<%= link_to t('helpers.action.importer.download_original_file'), importer_original_file_path(@importer.id, file_type: original_files.first[:type]), class: 'btn btn-primary text-nowrap', data: { turbolinks: false } %>
|
|
8
|
+
<% else %>
|
|
9
|
+
<div class="btn-group">
|
|
10
|
+
<button type="button" class="btn btn-primary dropdown-toggle text-nowrap" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
|
11
|
+
<%= t('helpers.action.importer.download_original_files') %> <span class="caret"></span>
|
|
12
|
+
</button>
|
|
13
|
+
<ul class="dropdown-menu">
|
|
14
|
+
<% original_files.each do |file| %>
|
|
15
|
+
<li><%= link_to file[:name], importer_original_file_path(@importer.id, file_type: file[:type]), data: { turbolinks: false } %></li>
|
|
16
|
+
<% end %>
|
|
17
|
+
</ul>
|
|
18
|
+
</div>
|
|
19
|
+
<% end %>
|
|
20
|
+
<% end %>
|
|
5
21
|
<% if @importer.failed_entries? %>
|
|
6
|
-
<%= link_to '
|
|
7
|
-
<%= link_to '
|
|
22
|
+
<%= link_to t('helpers.action.importer.export_errored_entries'), importer_export_errors_path(@importer.id), class: 'btn btn-primary text-nowrap', data: { turbolinks: false }%>
|
|
23
|
+
<%= 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
24
|
<% end %>
|
|
9
25
|
</div>
|
|
10
26
|
</div>
|
|
@@ -83,17 +99,17 @@
|
|
|
83
99
|
</div>
|
|
84
100
|
|
|
85
101
|
<p class="bulkrax-p-align">
|
|
86
|
-
<%= link_to '
|
|
102
|
+
<%= link_to t('helpers.action.importer.edit'), edit_importer_path(@importer) %>
|
|
87
103
|
|
|
|
88
|
-
<%= link_to '
|
|
104
|
+
<%= link_to t('helpers.action.importer.back'), importers_path %><br /><br />
|
|
89
105
|
</p>
|
|
90
106
|
|
|
91
107
|
<% if @importer.validate_only == true %>
|
|
92
108
|
<div class='pull-left'>
|
|
93
|
-
<%= button_to '
|
|
109
|
+
<%= button_to t('helpers.action.importer.continue'), importer_continue_path(@importer), method: :put, class: 'btn btn-primary' %>
|
|
94
110
|
</div>
|
|
95
111
|
<div class='pull-right'>
|
|
96
|
-
<%= button_to '
|
|
112
|
+
<%= button_to t('helpers.action.importer.discard'), @importer, method: :delete, data: { confirm: t('helpers.action.importer.discard_confirm') }, class: 'btn btn-primary' %>
|
|
97
113
|
</div>
|
|
98
114
|
<% end %>
|
|
99
115
|
</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>
|
|
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
|
-
|
|
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
|
-
|
|
10
|
+
<%= t('bulkrax.importer.upload_corrected_entries.click_here') %> <span class='fa fa-download'></span>
|
|
11
11
|
<% end %>
|
|
12
12
|
</p>
|
|
13
|
-
<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>
|
|
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, '
|
|
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
|
-
|
|
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"
|
|
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"
|
|
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
|
|
23
|
-
<strong
|
|
24
|
-
<strong
|
|
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
|
|
32
|
-
<strong
|
|
33
|
-
<strong
|
|
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
|
|
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
|
|
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
|
|
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"
|
|
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"
|
|
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">
|