uc3-dmp-id 0.0.95 → 0.0.97
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 +3 -3
- data/lib/uc3-dmp-id/version.rb +1 -1
- data/lib/uc3-dmp-id/versioner.rb +3 -3
- 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: 1b18b3d95b39f2da88fa37724c6fda10a5b52ca9f12c846a931d2437c2d765ba
|
4
|
+
data.tar.gz: bf97c7cd424030c19c720fff5011f9f6605aa375d6c9bf0f962f4ffd10174742
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 791986d2bf6e7382ad4f1bf84a7e4c6c7d501609a1dfe4d0d3aec0d3554496a5637231db298a01481ec18f0e1055b82c95158cd203a53a6aecbbf8ba4ddb6109
|
7
|
+
data.tar.gz: f0baea87de3fb99225c98bbce5df28adf9ef32fc90593c32334d5094acf2314ea5c9d01d53088bbf1bc5529cdd9f496061aa8544b40687f7624cdde7991e59a0
|
data/lib/uc3-dmp-id/updater.rb
CHANGED
@@ -40,7 +40,7 @@ module Uc3DmpId
|
|
40
40
|
raise UpdaterError, MSG_DMP_UNABLE_TO_VERSION if resp.nil?
|
41
41
|
|
42
42
|
# Send the updates to EZID, notify the provenance and download the PDF if applicable
|
43
|
-
_post_process(json: dmp, logger: logger)
|
43
|
+
_post_process(provenance: provenance, json: dmp, logger: logger)
|
44
44
|
# Return the new version record
|
45
45
|
logger.info(message: "Updated DMP ID: #{p_key}") if logger.respond_to?(:debug)
|
46
46
|
Helper.cleanse_dmp_json(json: JSON.parse({ dmp: new_version }.to_json))
|
@@ -90,11 +90,11 @@ module Uc3DmpId
|
|
90
90
|
|
91
91
|
# Once the DMP has been updated, we need to register it's DMP ID and download any PDF if applicable
|
92
92
|
# -------------------------------------------------------------------------
|
93
|
-
def _post_process(json:, logger: nil)
|
93
|
+
def _post_process(provenance:, json:, logger: nil)
|
94
94
|
return false unless json.is_a?(Hash)
|
95
95
|
|
96
96
|
# Indicate whether or not the updater is the provenance system
|
97
|
-
json['dmphub_updater_is_provenance'] =
|
97
|
+
json['dmphub_updater_is_provenance'] = provenance['PK'] == json['dmphub_provenance_id']
|
98
98
|
# Publish the change to the EventBridge
|
99
99
|
publisher = Uc3DmpEventBridge::Publisher.new
|
100
100
|
publisher.publish(source: 'DmpUpdater', dmp: json, logger: logger)
|
data/lib/uc3-dmp-id/version.rb
CHANGED
data/lib/uc3-dmp-id/versioner.rb
CHANGED
@@ -36,16 +36,16 @@ module Uc3DmpId
|
|
36
36
|
puts "Provenance: #{provenance}, PK: #{p_key}"
|
37
37
|
puts dmp
|
38
38
|
|
39
|
-
return nil unless p_key.is_a?(String) && !p_key.strip.empty? && _versionable?(p_key: p_key, dmp: latest_version)
|
39
|
+
return nil unless p_key.is_a?(String) && !p_key.strip.empty? && _versionable?(p_key: p_key, dmp: latest_version['dmp'])
|
40
40
|
|
41
41
|
client = Uc3DmpDynamo::Client.new if client.nil?
|
42
42
|
|
43
43
|
owner = latest_version['dmphub_provenance_id']
|
44
44
|
updater = provenance['PK']
|
45
|
-
prior = _generate_version(client: client, latest_version: latest_version, owner: owner, updater: updater)
|
45
|
+
prior = _generate_version(client: client, latest_version: latest_version['dmp'], owner: owner, updater: updater)
|
46
46
|
return nil if prior.nil?
|
47
47
|
|
48
|
-
args = { owner: owner, updater: updater, base: prior, mods: dmp, logger: logger }
|
48
|
+
args = { owner: owner, updater: updater, base: prior, mods: dmp['dmp'], logger: logger }
|
49
49
|
logger.debug(message: "#{SOURCE} record prior to splicing", details: dmp) if logger.respond_to?(:debug)
|
50
50
|
|
51
51
|
# If the system of provenance is making the change then just use the
|