bulkrax 8.2.1 → 8.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/concerns/bulkrax/datatables_behavior.rb +1 -1
- data/app/factories/bulkrax/object_factory.rb +4 -1
- data/app/jobs/bulkrax/delete_file_set_job.rb +2 -2
- data/app/jobs/bulkrax/export_work_job.rb +1 -1
- data/app/models/bulkrax/status.rb +1 -1
- data/app/models/concerns/bulkrax/export_behavior.rb +8 -4
- data/app/parsers/bulkrax/csv_parser.rb +5 -2
- data/app/parsers/bulkrax/parser_export_record_set.rb +1 -1
- data/db/migrate/20241203010707_entry_error_denormalization.rb +7 -0
- data/db/migrate/20241205212513_faster_first_entry.rb +7 -0
- data/lib/bulkrax/version.rb +1 -1
- data/lib/tasks/bulkrax_tasks.rake +1 -1
- metadata +7 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: efd4c183d72156bd32a32eb0e160485f1dc46c67630f6835db761bb93ab3b16b
|
4
|
+
data.tar.gz: 05c58dccdae7e285db479602490dd3be7429405f931a18aede0accbd4eec3503
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e64eecf68566f81c2d105640b71b8b6834e4c32fc18a416f0c026883387a257f913ad82ad676826b6a744a352edbce4a21aa82a304b23f2583f2c15a97f72078
|
7
|
+
data.tar.gz: 9c4ce4f1b4d36c5dcb031ce0a8ecb6617c0114dbc891384d3de5fe6e5ee42b04761001d269d22d6b54c616aaf3cf793e461187d0e17fd20c3a025a907c20fb4e
|
@@ -132,7 +132,7 @@ module Bulkrax
|
|
132
132
|
status_message: status_message_for(e),
|
133
133
|
type: e.type,
|
134
134
|
updated_at: e.updated_at,
|
135
|
-
errors: e.
|
135
|
+
errors: e.status_message == 'Failed' ? view_context.link_to(e.error_class, view_context.item_entry_path(item, e)) : "",
|
136
136
|
actions: entry_util_links(e, item)
|
137
137
|
}
|
138
138
|
end
|
@@ -10,11 +10,11 @@ module Bulkrax
|
|
10
10
|
om = parent.ordered_members.to_a
|
11
11
|
om.delete(file_set)
|
12
12
|
parent.ordered_members = om
|
13
|
-
|
13
|
+
parent.save
|
14
|
+
elsif parent&.respond_to?(:member_ids)
|
14
15
|
parent.member_ids.delete(file_set.id)
|
15
16
|
Hyrax.persister.save(resource: parent)
|
16
17
|
end
|
17
|
-
parent.save
|
18
18
|
end
|
19
19
|
|
20
20
|
super
|
@@ -26,7 +26,7 @@ module Bulkrax
|
|
26
26
|
end
|
27
27
|
# rubocop:enable Rails/SkipsModelValidations
|
28
28
|
end
|
29
|
-
return entry if exporter_run.enqueued_records.positive?
|
29
|
+
return entry if exporter_run.reload.enqueued_records.positive?
|
30
30
|
|
31
31
|
if exporter_run.failed_records.positive?
|
32
32
|
exporter_run.exporter.set_status_info('Complete (with failures)')
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
module Bulkrax
|
4
4
|
class Status < ApplicationRecord
|
5
|
-
belongs_to :statusable, polymorphic: true, denormalize: { fields: %i[status_message], if: :latest? }
|
5
|
+
belongs_to :statusable, polymorphic: true, denormalize: { fields: %i[status_message error_class], if: :latest? }
|
6
6
|
belongs_to :runnable, polymorphic: true
|
7
7
|
serialize :error_backtrace, Array
|
8
8
|
|
@@ -26,11 +26,15 @@ module Bulkrax
|
|
26
26
|
|
27
27
|
# Prepend the file_set id to ensure a unique filename and also one that is not longer than 255 characters
|
28
28
|
def filename(file_set)
|
29
|
-
# NOTE: Will this work with Valkyrie?
|
30
29
|
return if file_set.original_file.blank?
|
31
|
-
|
32
|
-
|
33
|
-
|
30
|
+
if file_set.original_file.respond_to?(:original_filename) # valkyrie
|
31
|
+
fn = file_set.original_file.original_filename
|
32
|
+
mime = ::Marcel::MimeType.for(file_set.original_file.file.io)
|
33
|
+
else # original non valkyrie version
|
34
|
+
fn = file_set.original_file.file_name.first
|
35
|
+
mime = ::Marcel::MimeType.for(declared_type: file_set.original_file.mime_type)
|
36
|
+
end
|
37
|
+
ext_mime = ::Marcel::MimeType.for(name: fn)
|
34
38
|
if fn.include?(file_set.id) || importerexporter.metadata_only?
|
35
39
|
filename = "#{fn}.#{mime.to_sym}"
|
36
40
|
filename = fn if mime.to_s == ext_mime.to_s
|
@@ -244,7 +244,10 @@ module Bulkrax
|
|
244
244
|
record = Bulkrax.object_factory.find(identifier)
|
245
245
|
return unless record
|
246
246
|
|
247
|
-
file_sets =
|
247
|
+
file_sets = Array.wrap(record) if record.file_set?
|
248
|
+
if file_sets.nil? # for valkyrie
|
249
|
+
file_sets = record.respond_to?(:file_sets) ? record.file_sets : record.members&.select(&:file_set?)
|
250
|
+
end
|
248
251
|
file_sets << record.thumbnail if exporter.include_thumbnails && record.thumbnail.present? && record.work?
|
249
252
|
file_sets.each do |fs|
|
250
253
|
path = File.join(exporter_export_path, folder_count, 'files')
|
@@ -252,7 +255,7 @@ module Bulkrax
|
|
252
255
|
file = filename(fs)
|
253
256
|
next if file.blank? || fs.original_file.blank?
|
254
257
|
|
255
|
-
io = open(fs.original_file.uri)
|
258
|
+
io = fs.original_file.respond_to?(:uri) ? open(fs.original_file.uri) : fs.original_file.file.io
|
256
259
|
File.open(File.join(path, file), 'wb') do |f|
|
257
260
|
f.write(io.read)
|
258
261
|
f.close
|
@@ -173,7 +173,7 @@ module Bulkrax
|
|
173
173
|
# @see https://github.com/samvera/hyrax/blob/64c0bbf0dc0d3e1b49f040b50ea70d177cc9d8f6/app/indexers/hyrax/work_indexer.rb#L15-L18
|
174
174
|
def file_sets
|
175
175
|
@file_sets ||= ParserExportRecordSet.in_batches(candidate_file_set_ids) do |batch_of_ids|
|
176
|
-
fsq = "has_model_ssim
|
176
|
+
fsq = "has_model_ssim:\"#{Bulkrax.file_model_internal_resource.demodulize}\" AND id:(\"" + batch_of_ids.join('" OR "') + "\")"
|
177
177
|
fsq += extra_filters if extra_filters.present?
|
178
178
|
Bulkrax.object_factory.query(
|
179
179
|
fsq,
|
@@ -0,0 +1,7 @@
|
|
1
|
+
class EntryErrorDenormalization < ActiveRecord::Migration[5.1]
|
2
|
+
def change
|
3
|
+
add_column :bulkrax_entries, :error_class, :string unless column_exists?(:bulkrax_entries, :error_class)
|
4
|
+
add_column :bulkrax_importers, :error_class, :string unless column_exists?(:bulkrax_importers, :error_class)
|
5
|
+
add_column :bulkrax_exporters, :error_class, :string unless column_exists?(:bulkrax_exporters, :error_class)
|
6
|
+
end
|
7
|
+
end
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
class FasterFirstEntry < ActiveRecord::Migration[5.2]
|
3
|
+
def change
|
4
|
+
add_index :bulkrax_entries, [:importerexporter_id, :importerexporter_type, :id], name: 'index_bulkrax_entries_on_importerexporter_id_type_and_id' unless index_exists?(:bulkrax_entries, [:importerexporter_id, :importerexporter_type, :id],
|
5
|
+
name: 'index_bulkrax_entries_on_importerexporter_id_type_and_id')
|
6
|
+
end
|
7
|
+
end
|
data/lib/bulkrax/version.rb
CHANGED
@@ -9,7 +9,7 @@ namespace :bulkrax do
|
|
9
9
|
progress_mark: ' ',
|
10
10
|
remainder_mark: "\u{FF65}")
|
11
11
|
Bulkrax::Status.latest_by_statusable.includes(:statusable).find_each do |status|
|
12
|
-
status.statusable.update(status_message: status.status_message)
|
12
|
+
status.statusable.update(status_message: status.status_message, error_class: status.error_class)
|
13
13
|
@progress.increment
|
14
14
|
end
|
15
15
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bulkrax
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 8.2.
|
4
|
+
version: 8.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rob Kaufman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-12-
|
11
|
+
date: 2024-12-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: 0.6.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
40
|
+
version: 0.6.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: coderay
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -486,6 +486,8 @@ files:
|
|
486
486
|
- db/migrate/20240823173525_add_error_tracking_to_pending_relationships.rb
|
487
487
|
- db/migrate/20240916182737_add_last_imported_at_to_bulkrax_importers.rb
|
488
488
|
- db/migrate/20240916182823_add_next_import_at_to_bulkrax_importers.rb
|
489
|
+
- db/migrate/20241203010707_entry_error_denormalization.rb
|
490
|
+
- db/migrate/20241205212513_faster_first_entry.rb
|
489
491
|
- lib/bulkrax.rb
|
490
492
|
- lib/bulkrax/engine.rb
|
491
493
|
- lib/bulkrax/entry_spec_helper.rb
|
@@ -518,7 +520,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
518
520
|
- !ruby/object:Gem::Version
|
519
521
|
version: '0'
|
520
522
|
requirements: []
|
521
|
-
rubygems_version: 3.4
|
523
|
+
rubygems_version: 3.1.4
|
522
524
|
signing_key:
|
523
525
|
specification_version: 4
|
524
526
|
summary: Import and export tool for Hyrax and Hyku
|