uc3-dmp-id 0.1.83 → 0.1.84
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/creator.rb +1 -0
- data/lib/uc3-dmp-id/updater.rb +8 -5
- data/lib/uc3-dmp-id/version.rb +1 -1
- data/lib/uc3-dmp-id/versioner.rb +1 -0
- 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: 84ab313258ffa4f817fd7fae592fe73c08fc048535ed7b475ea384ac0f27172e
|
4
|
+
data.tar.gz: 9af6e617d3ee17eb2b1fd86f2f262922d97f4743af45fa54107c5ef5785e5ff7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c827105e6a001abf89cca3a72a4ff426128855628b37ae695219a0fbbd67f1824abd8fe9166fa1647df07528782bd8f2e1f6a216a27f7c6dc25a9c2e74fe3129
|
7
|
+
data.tar.gz: 9122ecb1c1ab63cddec4196cb6dc9d97a3fb5a25fb8f92b89f5b299b7507f31d5ebf6e7898113ce1a80f22ba810542d786d20ba9c44a07d43c4115d9d6db87dc
|
data/lib/uc3-dmp-id/creator.rb
CHANGED
@@ -53,6 +53,7 @@ module Uc3DmpId
|
|
53
53
|
annotated['registered'] = annotated['created'] if annotated['registered'].nil?
|
54
54
|
|
55
55
|
# Create the item
|
56
|
+
annotated.delete('dmphub_modifications')
|
56
57
|
resp = client.put_item(json: annotated, logger:)
|
57
58
|
raise CreatorError, Helper::MSG_DMP_NO_DMP_ID if resp.nil?
|
58
59
|
|
data/lib/uc3-dmp-id/updater.rb
CHANGED
@@ -52,11 +52,8 @@ module Uc3DmpId
|
|
52
52
|
# Process the incoming payload
|
53
53
|
payload = _process_modifications(owner:, updater:, version:, payload:, logger:)
|
54
54
|
|
55
|
-
# Ensure we've deleted the dmphub_mods!!!!
|
56
|
-
payload.delete('dmphub_modifications')
|
57
|
-
payload.delete(:dmphub_modifications)
|
58
55
|
# Save the changes
|
59
|
-
resp = client.put_item(json: payload, logger:)
|
56
|
+
resp = client.put_item(json: _purge_mods(payload:), logger:)
|
60
57
|
raise UpdaterError, Helper::MSG_DMP_UNABLE_TO_VERSION if resp.nil?
|
61
58
|
|
62
59
|
# Send the updates to EZID
|
@@ -103,7 +100,7 @@ module Uc3DmpId
|
|
103
100
|
|
104
101
|
# Save the changes without creating a new version!
|
105
102
|
logger&.debug(message: "DMP After narrative attachment", details: dmp)
|
106
|
-
resp = client.put_item(json: dmp, logger:)
|
103
|
+
resp = client.put_item(json: _purge_mods(payload: dmp), logger:)
|
107
104
|
raise UpdaterError, Helper::MSG_DMP_UNABLE_TO_VERSION if resp.nil?
|
108
105
|
|
109
106
|
logger&.debug(message: "Added DMP ID narrative for PK: #{p_key}, Narrative: #{url}")
|
@@ -113,6 +110,12 @@ module Uc3DmpId
|
|
113
110
|
|
114
111
|
private
|
115
112
|
|
113
|
+
def _purge_mods(payload:)
|
114
|
+
# Ensure we've deleted the dmphub_mods!!!!
|
115
|
+
payload.delete('dmphub_modifications')
|
116
|
+
payload.delete(:dmphub_modifications)
|
117
|
+
end
|
118
|
+
|
116
119
|
# Check to make sure the incoming JSON is valid, the DMP ID requested matches the DMP ID in the JSON
|
117
120
|
# rubocop:disable Metrics/AbcSize
|
118
121
|
def _updateable?(provenance:, p_key:, latest_version: {}, mods: {})
|
data/lib/uc3-dmp-id/version.rb
CHANGED
data/lib/uc3-dmp-id/versioner.rb
CHANGED