dor-services 8.4.0 → 8.5.0

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
  SHA256:
3
- metadata.gz: 211ce0eefc758823b5dced495a74a980025d82884639a720a30ff97f20179cf6
4
- data.tar.gz: f21f78c40a74231051b08762cea0c4c49f7cb47663ec5c6b9f24bc4189fef4f0
3
+ metadata.gz: 61f15c16dd2f9137b47772916d0a6e44cbb374c88e4370e891ff51e8338feaf3
4
+ data.tar.gz: fe8b53c9d1f31e4dd3e1f3ab91878a4d2f8e2cd999332e31d2d4004e4e4f152f
5
5
  SHA512:
6
- metadata.gz: 36a41ca02293ad622536768705b960ffa68bacb291cf6ef787b3181fcf0b5222050f29b0f5fd23ad350ba64a815cbcce9ddcb37c71004ebfc8cc96c1f666c527
7
- data.tar.gz: ab9e98f31624be15f00701d24184e357014c2e5f9f0fdc3d7042293610fe6939b1323865bd882733638f98e2584df2749ac209e8e07770f30efa43273e1de9e7
6
+ metadata.gz: 1abaab49ac04961de4ee7a95ef5e3b9c10cb0fe331da1c88f20989c11cda7705878deb346bd7d1c16aac1ded1e0b2564138a3a043ad0a0d7c5931a76cf800b95
7
+ data.tar.gz: 06f071e7d3e82b8bd2bac465b3667a2b09a010160f0cfe4ca847af56b906d5bcccb4a5c8eafe19ef0b470a73f3e62e7fc7b09ec981dc9be7144429fca5f9b0e3
@@ -70,7 +70,7 @@ module Dor
70
70
  alias source_id= sourceId=
71
71
 
72
72
  def tags
73
- ng_xml.search('//tag').collect(&:content)
73
+ tag
74
74
  end
75
75
 
76
76
  # helper method to get just the content type tag
@@ -88,6 +88,11 @@ module Dor
88
88
  end
89
89
  end
90
90
 
91
+ # @param [Array<String>] values
92
+ def other_ids=(values)
93
+ values.each { |value| add_otherId(value) }
94
+ end
95
+
91
96
  def add_otherId(other_id)
92
97
  ng_xml_will_change!
93
98
  (name, val) = other_id.split(/:/, 2)
@@ -12,7 +12,6 @@ module Dor
12
12
  # @return [Hash] the partial solr document for releasable concerns
13
13
  def to_solr
14
14
  solr_doc = {}
15
-
16
15
  # TODO: sort of worried about the performance impact in bulk reindex
17
16
  # situations, since released_for recurses all parent collections. jmartin 2015-07-14
18
17
  released_for.each do |release_target, release_info|
@@ -118,7 +118,11 @@ module Dor
118
118
 
119
119
  delegate :full_title, :stanford_mods, to: :descMetadata
120
120
  delegate :rights, to: :rightsMetadata
121
- delegate :catkey, :catkey=, :previous_catkeys, :tags, :content_type_tag, :source_id, :source_id=, to: :identityMetadata
121
+ delegate :catkey, :catkey=, :source_id, :source_id=,
122
+ :objectId, :objectId=, :objectCreator, :objectCreator=,
123
+ :objectLabel, :objectLabel=, :objectType, :objectType=,
124
+ :other_ids=, :otherId, :tag=, :tags,
125
+ :previous_catkeys, :content_type_tag, to: :identityMetadata
122
126
 
123
127
  def read_rights=(rights)
124
128
  rightsMetadata.set_read_rights(rights)
@@ -175,29 +175,6 @@ module Dor
175
175
  nil # We're out of tags, no applicable ones
176
176
  end
177
177
 
178
- # This function calls purl and gets a list of all release tags currently in purl. It then compares to the list you have generated.
179
- # Any tag that is on purl, but not in the newly generated list is added to the new list with a value of false.
180
- # @param new_tags [Hash{String => Boolean}] all new tags in the form of !{"Project" => Boolean}
181
- # @return [Hash] same form as new_tags, with all missing tags not in new_tags, but in current_tag_names, added in with a Boolean value of false
182
- def add_tags_from_purl(new_tags)
183
- missing_tags = release_tags_from_purl.map(&:downcase) - new_tags.keys.map(&:downcase)
184
- Honeybadger.notify("Found missing release tags on PURL for #{pid}: #{missing_tags.inspect}") if missing_tags.present? && defined? Honeybadger
185
-
186
- missing_tags.each do |missing_tag|
187
- new_tags[missing_tag.capitalize] = { 'release' => false }
188
- end
189
- new_tags
190
- end
191
-
192
- # Pull all release nodes from the public xml obtained via the purl query
193
- # @param doc [Nokogiri::HTML::Document] The druid of the object you want
194
- # @return [Array] An array containing all the release tags
195
- def release_tags_from_purl_xml(doc)
196
- nodes = doc.xpath('//publicObject/releaseData').children
197
- # We only want the nodes with a name that isn't text
198
- nodes.reject { |n| n.name.nil? || n.name.casecmp('text') == 0 }.map { |n| n.attr('to') }.uniq
199
- end
200
-
201
178
  attr_reader :item
202
179
  end
203
180
  end
@@ -6,6 +6,7 @@ module Dor
6
6
  # Determine projects in which an item is released
7
7
  # @param [String] pid identifier of the item to get the release tags for
8
8
  def initialize(pid:, purl_host:)
9
+ Deprecation.warn(self, "Dor::ReleaseTags::Purl is deprecated and will be removed in dor-services 9.0. (it's moving to dor-services-app)")
9
10
  @pid = pid
10
11
  @purl_host = purl_host
11
12
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Dor
4
4
  # Adds and removes collections to and from objects
5
- # Collections are added as Compollections and Sets.
5
+ # Collections are added as Collections and Sets.
6
6
  class CollectionService
7
7
  def initialize(obj)
8
8
  @obj = obj
@@ -10,6 +10,7 @@ module Dor
10
10
  end
11
11
 
12
12
  def initialize(item)
13
+ Deprecation.warn(self, "Dor::ReleaseTagService is deprecated and will be removed in dor-services 9.0. (it's moving to dor-services-app)")
13
14
  @identity_metadata_service = ReleaseTags::IdentityMetadata.new(item)
14
15
  @purl_service = ReleaseTags::Purl.new(pid: item.pid, purl_host: Dor::Config.stacks.document_cache_host)
15
16
  end
data/lib/dor/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dor
4
- VERSION = '8.4.0'
4
+ VERSION = '8.5.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dor-services
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.4.0
4
+ version: 8.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Klein
@@ -20,7 +20,7 @@ authors:
20
20
  autorequire:
21
21
  bindir: bin
22
22
  cert_chain: []
23
- date: 2020-02-05 00:00:00.000000000 Z
23
+ date: 2020-02-06 00:00:00.000000000 Z
24
24
  dependencies:
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: active-fedora