bulkrax 9.2.1 → 9.3.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/app/factories/bulkrax/valkyrie_object_factory.rb +12 -2
- data/app/jobs/bulkrax/create_relationships_job.rb +4 -1
- data/app/models/bulkrax/csv_entry.rb +6 -1
- data/app/models/bulkrax/entry.rb +9 -3
- data/app/models/bulkrax/exporter.rb +7 -2
- data/app/models/bulkrax/importer.rb +7 -2
- data/app/models/bulkrax/oai_entry.rb +5 -1
- data/app/models/bulkrax/rdf_entry.rb +5 -1
- data/app/models/bulkrax/status.rb +6 -1
- data/app/models/bulkrax/xml_entry.rb +5 -1
- data/lib/bulkrax/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b2230355bb1411a1ef0d5a17c70a957f87c88c0b1a5254fda5646eb89a07bc1
|
4
|
+
data.tar.gz: b8211fe255a2a094854b9a0174b3b2154de093c53f838befdc2c8f8246d7731b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 555612ee946fcf1b48a353f93e20fafbe3c04052f28c99e129f3af7a216022416d4fcc3a51dca25943d5c10b2a86355871e1a788b5ab3046093cdf808efa7644
|
7
|
+
data.tar.gz: 3fae6e18a3bd810446dc7fb0dc2486e283ad74f28bad18c75426cc5589386b1fa32e05210eb1367fead50acf0649b7de64dd52a9c208b2450002fb10ece33e0d
|
@@ -335,9 +335,19 @@ module Bulkrax
|
|
335
335
|
nil
|
336
336
|
end
|
337
337
|
|
338
|
+
# @note We perform the transaction against the *parent* here, because the FileSets are generated and updated in relationship with their parent, not in isolation
|
338
339
|
def create_file_set(attrs)
|
339
|
-
|
340
|
-
|
340
|
+
attrs = HashWithIndifferentAccess.new(attrs)
|
341
|
+
parent_object = find_record(attributes[related_parents_parsed_mapping].first, importer_run_id).last
|
342
|
+
perform_transaction_for(object: parent_object, attrs: {}) do
|
343
|
+
fs_attrs = attrs.merge(attributes).symbolize_keys
|
344
|
+
uploaded_files, = prep_fileset_content(attrs)
|
345
|
+
transactions['change_set.update_work']
|
346
|
+
.with_step_args(
|
347
|
+
'work_resource.add_file_sets' => { uploaded_files: uploaded_files, file_set_params: [fs_attrs] },
|
348
|
+
'work_resource.save_acl' => { permissions_params: [attrs.try('visibility') || 'open'].compact }
|
349
|
+
)
|
350
|
+
end
|
341
351
|
end
|
342
352
|
|
343
353
|
def create_work(attrs)
|
@@ -136,6 +136,7 @@ module Bulkrax
|
|
136
136
|
# When the parent is a collection, we save the relationship on each child.
|
137
137
|
# The parent does not need to be saved, as the relationship is stored on the child.
|
138
138
|
# but we do reindex the parent after all the children are added.
|
139
|
+
# rubocop:disable Layout/RescueEnsureAlignment
|
139
140
|
def process_parent_as_collection(parent_record:, parent_identifier:)
|
140
141
|
ActiveRecord::Base.uncached do
|
141
142
|
Bulkrax::PendingRelationship.where(parent_id: parent_identifier, importer_run_id: @importer_run_id)
|
@@ -151,7 +152,6 @@ module Bulkrax
|
|
151
152
|
@errors << e
|
152
153
|
end
|
153
154
|
end
|
154
|
-
|
155
155
|
# if collection members were added, we reindex the collection
|
156
156
|
# The collection members have already saved the relationships
|
157
157
|
# To index the parent, we want to make sure we have the latest version of the parent,
|
@@ -161,6 +161,7 @@ module Bulkrax
|
|
161
161
|
Bulkrax.object_factory.update_index(resources: [reloaded_parent])
|
162
162
|
Bulkrax.object_factory.publish(event: 'object.membership.updated', object: reloaded_parent, user: @user)
|
163
163
|
end
|
164
|
+
# rubocop:enable Layout/RescueEnsureAlignment
|
164
165
|
|
165
166
|
# When the parent is a work, we save the relationship on the parent.
|
166
167
|
# We prefer to save all of the member relationships and then save the parent once. Concurrent
|
@@ -168,6 +169,7 @@ module Bulkrax
|
|
168
169
|
# record while we are adding the children to it.
|
169
170
|
# However the locking appears to not be working so as a workaround we will save each member as we go,
|
170
171
|
# but only index the parent once at the end.
|
172
|
+
# rubocop:disable Layout/RescueEnsureAlignment
|
171
173
|
def process_parent_as_work(parent_record:, parent_identifier:)
|
172
174
|
conditionally_acquire_lock_for(parent_record.id.to_s) do
|
173
175
|
ActiveRecord::Base.uncached do
|
@@ -193,6 +195,7 @@ module Bulkrax
|
|
193
195
|
end
|
194
196
|
end
|
195
197
|
end
|
198
|
+
# rubocop:enable Layout/RescueEnsureAlignment
|
196
199
|
|
197
200
|
# NOTE: the child changes are saved in the object factory.
|
198
201
|
def add_to_collection(relationship:, parent_record:, ability:)
|
@@ -22,7 +22,12 @@ module Bulkrax
|
|
22
22
|
super(message)
|
23
23
|
end
|
24
24
|
end
|
25
|
-
|
25
|
+
|
26
|
+
if Rails.version < '7.1'
|
27
|
+
serialize :raw_metadata, Bulkrax::NormalizedJson
|
28
|
+
else
|
29
|
+
serialize :raw_metadata, coder: Bulkrax::NormalizedJson
|
30
|
+
end
|
26
31
|
|
27
32
|
def self.fields_from_data(data)
|
28
33
|
data.headers.flatten.compact.uniq
|
data/app/models/bulkrax/entry.rb
CHANGED
@@ -18,9 +18,15 @@ module Bulkrax
|
|
18
18
|
alias importer importerexporter
|
19
19
|
alias exporter importerexporter
|
20
20
|
|
21
|
-
|
22
|
-
|
23
|
-
|
21
|
+
if Rails.version < '7.1'
|
22
|
+
serialize :parsed_metadata, Bulkrax::NormalizedJson
|
23
|
+
# Do not serialize raw_metadata as so we can support xml or other formats
|
24
|
+
serialize :collection_ids, Array
|
25
|
+
else
|
26
|
+
serialize :parsed_metadata, coder: Bulkrax::NormalizedJson
|
27
|
+
# Do not serialize raw_metadata as so we can support xml or other formats
|
28
|
+
serialize :collection_ids, coder: YAML, type: Array
|
29
|
+
end
|
24
30
|
|
25
31
|
paginates_per 5
|
26
32
|
|
@@ -4,8 +4,13 @@ module Bulkrax
|
|
4
4
|
include Bulkrax::ImporterExporterBehavior
|
5
5
|
include Bulkrax::StatusInfo
|
6
6
|
|
7
|
-
|
8
|
-
|
7
|
+
if Rails.version < '7.1'
|
8
|
+
serialize :parser_fields, JSON
|
9
|
+
serialize :field_mapping, JSON
|
10
|
+
else
|
11
|
+
serialize :parser_fields, coder: JSON
|
12
|
+
serialize :field_mapping, coder: JSON
|
13
|
+
end
|
9
14
|
|
10
15
|
belongs_to :user
|
11
16
|
has_many :exporter_runs, dependent: :destroy
|
@@ -5,8 +5,13 @@ module Bulkrax
|
|
5
5
|
include Bulkrax::ImporterExporterBehavior
|
6
6
|
include Bulkrax::StatusInfo
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
if Rails.version < '7.1'
|
9
|
+
serialize :parser_fields, JSON
|
10
|
+
serialize :field_mapping, JSON
|
11
|
+
else
|
12
|
+
serialize :parser_fields, coder: JSON
|
13
|
+
serialize :field_mapping, coder: JSON
|
14
|
+
end
|
10
15
|
|
11
16
|
belongs_to :user
|
12
17
|
has_many :importer_runs, dependent: :destroy
|
@@ -2,7 +2,11 @@
|
|
2
2
|
|
3
3
|
module Bulkrax
|
4
4
|
class OaiEntry < Entry
|
5
|
-
|
5
|
+
if Rails.version < '7.1'
|
6
|
+
serialize :raw_metadata, Bulkrax::NormalizedJson
|
7
|
+
else
|
8
|
+
serialize :raw_metadata, coder: Bulkrax::NormalizedJson
|
9
|
+
end
|
6
10
|
|
7
11
|
delegate :record, to: :raw_record
|
8
12
|
|
@@ -3,7 +3,11 @@
|
|
3
3
|
unless ENV.fetch('BULKRAX_NO_RDF', 'false').to_s == 'true'
|
4
4
|
module Bulkrax
|
5
5
|
class RdfEntry < Entry
|
6
|
-
|
6
|
+
if Rails.version < '7.1'
|
7
|
+
serialize :raw_metadata, Bulkrax::NormalizedJson
|
8
|
+
else
|
9
|
+
serialize :raw_metadata, coder: Bulkrax::NormalizedJson
|
10
|
+
end
|
7
11
|
|
8
12
|
def self.read_data(path)
|
9
13
|
RDF::Reader.open(path)
|
@@ -4,7 +4,12 @@ module Bulkrax
|
|
4
4
|
class Status < ApplicationRecord
|
5
5
|
belongs_to :statusable, polymorphic: true, denormalize: { fields: %i[status_message error_class], if: :latest? }
|
6
6
|
belongs_to :runnable, polymorphic: true
|
7
|
-
|
7
|
+
|
8
|
+
if Rails.version < '7.1'
|
9
|
+
serialize :error_backtrace, Array
|
10
|
+
else
|
11
|
+
serialize :error_backtrace, coder: YAML, type: Array
|
12
|
+
end
|
8
13
|
|
9
14
|
scope :for_importers, -> { where(statusable_type: 'Bulkrax::Importer') }
|
10
15
|
scope :for_exporters, -> { where(statusable_type: 'Bulkrax::Exporter') }
|
@@ -3,7 +3,11 @@
|
|
3
3
|
module Bulkrax
|
4
4
|
# Generic XML Entry
|
5
5
|
class XmlEntry < Entry
|
6
|
-
|
6
|
+
if Rails.version < '7.1'
|
7
|
+
serialize :raw_metadata, Bulkrax::NormalizedJson
|
8
|
+
else
|
9
|
+
serialize :raw_metadata, coder: Bulkrax::NormalizedJson
|
10
|
+
end
|
7
11
|
|
8
12
|
def self.fields_from_data(data); end
|
9
13
|
|
data/lib/bulkrax/version.rb
CHANGED
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: 9.
|
4
|
+
version: 9.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rob Kaufman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-09-
|
11
|
+
date: 2025-09-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: 5.1.6
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version:
|
22
|
+
version: 8.0.0
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,7 +29,7 @@ dependencies:
|
|
29
29
|
version: 5.1.6
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version:
|
32
|
+
version: 8.0.0
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: bagit
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -527,7 +527,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
527
527
|
- !ruby/object:Gem::Version
|
528
528
|
version: '0'
|
529
529
|
requirements: []
|
530
|
-
rubygems_version: 3.
|
530
|
+
rubygems_version: 3.4.10
|
531
531
|
signing_key:
|
532
532
|
specification_version: 4
|
533
533
|
summary: Import and export tool for Hyrax and Hyku
|