uc3-dmp-id 0.0.128 → 0.0.130

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 18be2194ff897e9c5ebca4913b8d6b10feb1ef7554d41ee7657a8785ec042ec9
4
- data.tar.gz: a4dfe517fc697e7e67a96f2f06571b7a2a9edf750de572da1a749b7cfc3b6885
3
+ metadata.gz: 31d34f3534a7e775dc8d3fe10b6f5a33c3255e1eb5df0bbd9e1b58068f45bceb
4
+ data.tar.gz: b2b848d9bcc32b6c4c443a5ceeb886bd5f399fa52cfba8b4099fc97359c42c0e
5
5
  SHA512:
6
- metadata.gz: 91805e7dddf4e6283de8c8c11398f08058fe9cb4046e59c1a7d7b72b0c783ce68ed102e8e6ac2ec79fc1e987102461f635ad07c6f09c0721c4e95420fa5165af
7
- data.tar.gz: '07680effbf1748bbcfdc528c937b0de657ceb167f5c2a714a558fb974106cdcec60141b3ede5c43b0dd722b7b19cdd3969cb31ac096a1ab31124692e18f5b842'
6
+ metadata.gz: ea3cda475f42e31b8dfb96250c865fc8dae00684c5e99aff635d1789cacb4c17bec265bbd8c9cccbc0286ed4590877607ca8048c18471ab3f06e375008e92c84
7
+ data.tar.gz: 538d5e733bb99a7c0c997dfd40d6b2baa917fcb80570c78abe9bdb111f5eec339a62189795ff003326a2368b3f0fe4c2f74c651d77c7a81c916d687d62437d9e
@@ -92,6 +92,19 @@ module Uc3DmpId
92
92
  # Publish the change to the EventBridge
93
93
  publisher = Uc3DmpEventBridge::Publisher.new
94
94
  publisher.publish(source: 'DmpCreator', dmp: json, logger: logger)
95
+
96
+ # Determine if there are any related identifiers that we should try to fetch a citation for
97
+ citable_identifiers = Helper.citable_related_identifiers(related_identifiers: json)
98
+ return true if citable_identifiers.empty?
99
+
100
+ # Process each citation individually because they can be slow to fetch
101
+ citable_identifiers.each do |identifier|
102
+ citer_detail = {
103
+ PK: json['PK'],
104
+ dmproadmap_related_identifier: identifier
105
+ }
106
+ publisher.publish(source: 'DmpCreator', dmp: json, event_type: 'Citation Fetch', detail: citer_detail, logger: logger)
107
+ end
95
108
  true
96
109
  end
97
110
  end
@@ -141,6 +141,26 @@ module Uc3DmpId
141
141
  # Publish the change to the EventBridge
142
142
  publisher = Uc3DmpEventBridge::Publisher.new
143
143
  publisher.publish(source: 'DmpUpdater', dmp: json, logger: logger)
144
+
145
+ # Determine if there are any related identifiers that we should try to fetch a citation for
146
+ citable_identifiers = Helper.citable_related_identifiers(related_identifiers: json)
147
+
148
+ puts "CITATION BIT:"
149
+ puts citable_identifiers
150
+
151
+ return true if citable_identifiers.empty?
152
+
153
+ # Process each citation individually because they can be slow to fetch
154
+ citable_identifiers.each do |identifier|
155
+ citer_detail = {
156
+ PK: json['PK'],
157
+ dmproadmap_related_identifier: identifier
158
+ }
159
+
160
+ puts "SENDING MESSAGE To BRIDGE FOR: #{identifier['identifier']}"
161
+
162
+ publisher.publish(source: 'DmpUpdater', dmp: json, event_type: 'Citation Fetch', detail: citer_detail, logger: logger)
163
+ end
144
164
  true
145
165
  end
146
166
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uc3DmpId
4
- VERSION = '0.0.128'
4
+ VERSION = '0.0.130'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uc3-dmp-id
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.128
4
+ version: 0.0.130
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Riley