ddr-batch 2.0.0.beta.5 → 2.0.0.beta.6
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 73747d4603387e4d1eaf62e58ac7546f363c43ab
|
4
|
+
data.tar.gz: 3787b5ec988f6ad56317f58045247e184abb7d37
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b43787906e4b2a0ef85305f28b6af85fdfa85ebbf05431bf2e24a7017a04fe41f391ddec66556c144bd3807c7f42f52cce001b7a25b8b716ed5e2e5c6ab80c7a
|
7
|
+
data.tar.gz: 659690a12708499ff7ae8c7e45b7907ab62c789e5b89c07d9f374ac7c0257a8b0843210fadd96ee893e02394af2487b478bf7a6e7be10f74cd0d9f89e96977e2
|
@@ -167,8 +167,8 @@ module Ddr::Batch
|
|
167
167
|
end
|
168
168
|
|
169
169
|
def verify_datastream(repo_object, datastream)
|
170
|
-
if repo_object.
|
171
|
-
repo_object.
|
170
|
+
if repo_object.attached_files.include?(datastream.name) &&
|
171
|
+
repo_object.attached_files[datastream.name].has_content?
|
172
172
|
VERIFICATION_PASS
|
173
173
|
else
|
174
174
|
VERIFICATION_FAIL
|
@@ -176,7 +176,7 @@ module Ddr::Batch
|
|
176
176
|
end
|
177
177
|
|
178
178
|
def verify_datastream_external_checksum(repo_object, datastream)
|
179
|
-
repo_object.
|
179
|
+
repo_object.attached_files[datastream.name].validate_checksum! datastream.checksum, datastream.checksum_type
|
180
180
|
return VERIFICATION_PASS
|
181
181
|
rescue Ddr::Models::ChecksumInvalid
|
182
182
|
return VERIFICATION_FAIL
|
@@ -199,7 +199,7 @@ module Ddr::Batch
|
|
199
199
|
relationship_object_class = Ddr::Utils.reflection_object_class(relationship_reflection)
|
200
200
|
relationship_object = repo_object.send(relationship.name)
|
201
201
|
if !relationship_object.nil? &&
|
202
|
-
relationship_object.
|
202
|
+
relationship_object.id.eql?(repo_object_id) &&
|
203
203
|
relationship_object.is_a?(relationship_object_class)
|
204
204
|
VERIFICATION_PASS
|
205
205
|
else
|
@@ -219,7 +219,7 @@ module Ddr::Batch
|
|
219
219
|
|
220
220
|
def clear_attributes(repo_object, attribute)
|
221
221
|
Ddr::Models::DescriptiveMetadata.unqualified_names.each do |term|
|
222
|
-
repo_object.desc_metadata.set_values(term, nil) if repo_object.
|
222
|
+
repo_object.desc_metadata.set_values(term, nil) if repo_object.desc_metadata.values(term)
|
223
223
|
end
|
224
224
|
return repo_object
|
225
225
|
end
|
@@ -228,12 +228,12 @@ module Ddr::Batch
|
|
228
228
|
case datastream[:payload_type]
|
229
229
|
when BatchObjectDatastream::PAYLOAD_TYPE_BYTES
|
230
230
|
ds_content = datastream[:payload]
|
231
|
-
if repo_object.
|
231
|
+
if repo_object.attached_files[datastream[:name]].is_a? ActiveFedora::RDFDatastream
|
232
232
|
ds_content = set_rdf_subject(repo_object, ds_content)
|
233
233
|
end
|
234
|
-
repo_object.
|
234
|
+
repo_object.attached_files[datastream[:name]].content = ds_content
|
235
235
|
when BatchObjectDatastream::PAYLOAD_TYPE_FILENAME
|
236
|
-
if repo_object.
|
236
|
+
if repo_object.attached_files[datastream[:name]].is_a? ActiveFedora::RDFDatastream
|
237
237
|
ds_content = set_rdf_subject(repo_object, File.read(datastream[:payload]))
|
238
238
|
mime_type = "application/n-triples"
|
239
239
|
else
|
@@ -9,7 +9,7 @@ module Ddr::Batch
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def model_datastream_keys
|
12
|
-
model.constantize.new.
|
12
|
+
model.constantize.new.attached_files.keys
|
13
13
|
end
|
14
14
|
|
15
15
|
def process(user, opts = {})
|
@@ -31,7 +31,7 @@ module Ddr::Batch
|
|
31
31
|
repo_object = create_repository_object
|
32
32
|
if !repo_object.nil? && !repo_object.new_record?
|
33
33
|
ingest_outcome_detail = []
|
34
|
-
ingest_outcome_detail << "Ingested #{model} #{identifier} into #{repo_object.
|
34
|
+
ingest_outcome_detail << "Ingested #{model} #{identifier} into #{repo_object.id}"
|
35
35
|
Ddr::Events::IngestionEvent.new.tap do |event|
|
36
36
|
event.object = repo_object
|
37
37
|
event.user = user
|
@@ -76,7 +76,7 @@ module Ddr::Batch
|
|
76
76
|
begin
|
77
77
|
repo_object = model.constantize.new(:id => repo_pid)
|
78
78
|
repo_object.save(validate: false)
|
79
|
-
update_attributes(:pid => repo_object.
|
79
|
+
update_attributes(:pid => repo_object.id)
|
80
80
|
batch_object_attributes.each { |a| repo_object = add_attribute(repo_object, a) }
|
81
81
|
batch_object_datastreams.each { |d| repo_object = populate_datastream(repo_object, d) }
|
82
82
|
batch_object_relationships.each { |r| repo_object = add_relationship(repo_object, r) }
|
data/lib/ddr/batch/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ddr-batch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0.beta.
|
4
|
+
version: 2.0.0.beta.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jim Coble
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-03-
|
12
|
+
date: 2016-03-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|