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: f52b28b53930c0204458dbfb40709475be9ae4bf
4
- data.tar.gz: 4da8fc233fd01452375a83f61b674db283ebc699
3
+ metadata.gz: 73747d4603387e4d1eaf62e58ac7546f363c43ab
4
+ data.tar.gz: 3787b5ec988f6ad56317f58045247e184abb7d37
5
5
  SHA512:
6
- metadata.gz: 7121eb02f4b7bbc39602e700998acd052488252876f28d98ef6aca4afcfd14caacaff09b170727651a559fbb482aed3a0d42f17e464eebd7b5051749d675c4c0
7
- data.tar.gz: ad3d409b1a6eef57973011a66da9884349cecaafdd1570d90814aecc366f68505ff743e78526448ac386ba5b05096f185189f85c2de6b6120a89c30df5c07f73
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.datastreams.include?(datastream.name) &&
171
- repo_object.datastreams[datastream.name].has_content?
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.datastreams[datastream.name].validate_checksum! datastream.checksum, datastream.checksum_type
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.pid.eql?(repo_object_id) &&
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.descMetadata.values(term)
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.datastreams[datastream[:name]].is_a? ActiveFedora::RDFDatastream
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.datastreams[datastream[:name]].content = ds_content
234
+ repo_object.attached_files[datastream[:name]].content = ds_content
235
235
  when BatchObjectDatastream::PAYLOAD_TYPE_FILENAME
236
- if repo_object.datastreams[datastream[:name]].is_a? ActiveFedora::RDFDatastream
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.datastreams.keys
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.pid}"
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.pid)
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) }
@@ -1,5 +1,5 @@
1
1
  module Ddr
2
2
  module Batch
3
- VERSION = "2.0.0.beta.5"
3
+ VERSION = "2.0.0.beta.6"
4
4
  end
5
5
  end
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.5
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-08 00:00:00.000000000 Z
12
+ date: 2016-03-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails