bulkrax 3.0.0 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/jobs/bulkrax/create_relationships_job.rb +10 -12
- data/app/jobs/bulkrax/export_work_job.rb +1 -0
- data/app/models/bulkrax/exporter.rb +2 -1
- data/app/models/bulkrax/importer.rb +1 -1
- data/app/models/concerns/bulkrax/import_behavior.rb +2 -0
- data/app/parsers/bulkrax/csv_parser.rb +1 -1
- data/lib/bulkrax/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7810d87388103e4ff6d160e6acb64a492dcfcf16a23f93ad6848f6cc97f2d9db
|
4
|
+
data.tar.gz: 75bee56959564774f20cda642b6c732cd9cb8a4fbd19222222fbac429effc949
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74297cb60a695e46fa97389b6a9a23124c816304d636267e72585a286f370c923aefe0e10727d3a215fc8d7a1eefa579cb84cd3b84b8e8f65a72619c0c10176e
|
7
|
+
data.tar.gz: 57e62164db12eb01bbfa200d612ecd0439099e257d760009b289644e93fd043e7edc3f95c08f023fed2746abfc2c57fac996b542abc0cf724794dc78bc422ddc
|
@@ -82,18 +82,18 @@ module Bulkrax
|
|
82
82
|
# Work-Collection membership is added to the child as member_of_collection_ids
|
83
83
|
# This is adding the reverse relationship, from the child to the parent
|
84
84
|
def collection_parent_work_child
|
85
|
-
child_records[:works].
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
85
|
+
child_work_ids = child_records[:works].map(&:id)
|
86
|
+
parent_record.reindex_extent = Hyrax::Adapters::NestingIndexAdapter::LIMITED_REINDEX
|
87
|
+
|
88
|
+
parent_record.add_member_objects(child_work_ids)
|
89
|
+
ImporterRun.find(importer_run_id).increment!(:processed_relationships, child_work_ids.count) # rubocop:disable Rails/SkipsModelValidations
|
90
90
|
end
|
91
91
|
|
92
92
|
# Collection-Collection membership is added to the as member_ids
|
93
93
|
def collection_parent_collection_child
|
94
94
|
child_records[:collections].each do |child_record|
|
95
95
|
::Hyrax::Collections::NestedCollectionPersistenceService.persist_nested_collection_for(parent: parent_record, child: child_record)
|
96
|
-
|
96
|
+
ImporterRun.find(importer_run_id).increment!(:processed_relationships) # rubocop:disable Rails/SkipsModelValidations
|
97
97
|
end
|
98
98
|
end
|
99
99
|
|
@@ -103,14 +103,12 @@ module Bulkrax
|
|
103
103
|
child_records[:works].each_with_index do |child_record, i|
|
104
104
|
records_hash[i] = { id: child_record.id }
|
105
105
|
end
|
106
|
-
attrs = {
|
107
|
-
|
108
|
-
}
|
109
|
-
parent_record.reindex_extent = Hyrax::Adapters::NestingIndexAdapter::LIMITED_REINDEX if parent_record.respond_to?(:reindex_extent)
|
106
|
+
attrs = { work_members_attributes: records_hash }
|
107
|
+
parent_record.try(:reindex_extent=, Hyrax::Adapters::NestingIndexAdapter::LIMITED_REINDEX)
|
110
108
|
env = Hyrax::Actors::Environment.new(parent_record, Ability.new(user), attrs)
|
109
|
+
|
111
110
|
Hyrax::CurationConcern.actor.update(env)
|
112
|
-
|
113
|
-
Bulkrax::ImporterRun.find(importer_run_id).increment!(:processed_relationships) # rubocop:disable Rails/SkipsModelValidations
|
111
|
+
ImporterRun.find(importer_run_id).increment!(:processed_relationships, child_records[:works].count) # rubocop:disable Rails/SkipsModelValidations
|
114
112
|
end
|
115
113
|
|
116
114
|
def reschedule(parent_identifier:, importer_run_id:)
|
@@ -96,7 +96,8 @@ module Bulkrax
|
|
96
96
|
end
|
97
97
|
|
98
98
|
def current_run
|
99
|
-
|
99
|
+
total = self.limit || parser.total
|
100
|
+
@current_run ||= self.exporter_runs.create!(total_work_entries: total, enqueued_records: total)
|
100
101
|
end
|
101
102
|
|
102
103
|
def last_run
|
@@ -142,7 +142,7 @@ module Bulkrax
|
|
142
142
|
|
143
143
|
def import_objects(types_array = nil)
|
144
144
|
self.only_updates ||= false
|
145
|
-
types = types_array || %w[work
|
145
|
+
types = types_array || %w[collection work file_set relationship]
|
146
146
|
if parser.class == Bulkrax::CsvParser
|
147
147
|
parser.create_objects(types)
|
148
148
|
else
|
@@ -270,7 +270,7 @@ module Bulkrax
|
|
270
270
|
# Changed to grep as wc -l counts blank lines, and ignores the final unescaped line (which may or may not contain data)
|
271
271
|
def total
|
272
272
|
@total = importer.parser_fields['total'] || 0 if importer?
|
273
|
-
@total =
|
273
|
+
@total = limit || current_record_ids.count if exporter?
|
274
274
|
|
275
275
|
return @total || 0
|
276
276
|
rescue StandardError
|
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: 3.0.
|
4
|
+
version: 3.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rob Kaufman
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-05-
|
11
|
+
date: 2022-05-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -382,7 +382,7 @@ homepage: https://github.com/samvera-labs/bulkrax
|
|
382
382
|
licenses:
|
383
383
|
- Apache-2.0
|
384
384
|
metadata: {}
|
385
|
-
post_install_message:
|
385
|
+
post_install_message:
|
386
386
|
rdoc_options: []
|
387
387
|
require_paths:
|
388
388
|
- lib
|
@@ -397,8 +397,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
397
397
|
- !ruby/object:Gem::Version
|
398
398
|
version: '0'
|
399
399
|
requirements: []
|
400
|
-
rubygems_version: 3.1.
|
401
|
-
signing_key:
|
400
|
+
rubygems_version: 3.1.4
|
401
|
+
signing_key:
|
402
402
|
specification_version: 4
|
403
403
|
summary: Import and export tool for Hyrax and Hyku
|
404
404
|
test_files: []
|