uc3-dmp-id 0.0.57 → 0.0.59
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/uc3-dmp-id/updater.rb +5 -8
- data/lib/uc3-dmp-id/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a7f1d4153e4af1ce9ef49c831f2c65d995e177100def3bfc473c10e25647cbf4
|
4
|
+
data.tar.gz: 18d148667df1d518ed423d087d9732c28142691a77ecb74a42e54de2ad544615
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f698bfcb7fff04d14481a5a7e4e4c500fe76e88bdbfe13f1791111fc0c0bffa26751786d9ee647774fc1c6a1a1b6675daa27d158c32479bdc387500b535a2b47
|
7
|
+
data.tar.gz: bc0e02218ed69278a5fa3b3a479b396d8b344505809cd4a4a2938bbe4afde9e1db80ec0776e0bac03dd794d04169b52e8ba078534b00d11ed64b387d2a541503
|
data/lib/uc3-dmp-id/updater.rb
CHANGED
@@ -49,16 +49,16 @@ module Uc3DmpId
|
|
49
49
|
# Don't continue if nothing has changed!
|
50
50
|
raise UpdaterError, MSG_DMP_NOT_FOUND if dmp.nil?
|
51
51
|
|
52
|
-
puts "Found DMP:"
|
53
|
-
puts dmp
|
54
|
-
|
55
52
|
errs = _updateable?(provenance: provenance, p_key: p_key, json: dmp['dmp'])
|
56
53
|
raise UpdaterError, errs if errs.is_a?(Array) && errs.any?
|
57
54
|
|
58
55
|
# Add the DMPHub specific attributes
|
59
|
-
|
56
|
+
owner_org = dmp['dmp']['dmphub_owner_org']
|
57
|
+
annotated = Helper.annotate_dmp_json(provenance: provenance, owner_org: owner_org, p_key: p_key, json: dmp['dmp'])
|
60
58
|
annotated['dmproadmap_related_identifiers'] = [] if annotated['dmproadmap_related_identifiers'].nil?
|
61
|
-
annotated << {
|
59
|
+
annotated['dmproadmap_related_identifiers'] << {
|
60
|
+
descriptor: 'is_metadata_for', work_type: 'output_management_plan', type: 'url', identifier: url
|
61
|
+
}
|
62
62
|
|
63
63
|
puts "Attached:"
|
64
64
|
puts annotated
|
@@ -78,9 +78,6 @@ puts annotated
|
|
78
78
|
errs = Validator.validate(mode: 'author', json: json)
|
79
79
|
return errs.join(', ') if errs.is_a?(Array) && errs.any? && errs.first != Validator::MSG_VALID_JSON
|
80
80
|
|
81
|
-
puts "Prov: #{provenance['PK']}, PK IN: #{p_key}, DMP ID: #{json.fetch('dmp_id', {})['identifier']}, PK: #{json['PK']}"
|
82
|
-
puts "Processed DMP ID: '#{Helper.dmp_id_to_pk(json: dmp_id)}' == '#{p_key}'"
|
83
|
-
|
84
81
|
# Fail if the provenance is not defined
|
85
82
|
return [MSG_DMP_FORBIDDEN] unless provenance.is_a?(Hash) && !provenance['PK'].nil?
|
86
83
|
|
data/lib/uc3-dmp-id/version.rb
CHANGED