discovery-indexer 3.1.1 → 3.1.2

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
  SHA1:
3
- metadata.gz: 25a0a48ac397020000b95fb292de28584181ca40
4
- data.tar.gz: 5ba560e9f28f17dcf4b2064665b7f8f7de8f16ed
3
+ metadata.gz: f9500cea5fc23bf3f9281dcbebaf3206d17a5e2b
4
+ data.tar.gz: d26bac28f037d4b3c57d67b16fdd3f751c1832ad
5
5
  SHA512:
6
- metadata.gz: 4513362016f7de023eb305e6067570a33ad97d15aa8ca86521023a5ce436eaca6ac15216b2080ee52a973ec72e5410fc6f6562dd6481f64cda9525d20bf5a98b
7
- data.tar.gz: 4155ed95d2de09fc5843a7813cb0a8c9f3a5e50901fad5091cffe82fda0f4d85235f762a5cf6270c913a762d36b916ebaa2994982141f3954e13638a02509ce7
6
+ metadata.gz: 5c283bf550cc80de910e26539b4d301c4f7a6813e2470d3aeae40aaa80ca3db3b9825f25377108ca3135c269156679bd46dea6b8a10fff1703fda00abb80fd7e
7
+ data.tar.gz: c896a1b7cc7290d21582b264d89e26ebf09c23051af736411115f6f8f0bea34f9b4015ee2ef4e796811567289055dca608c983b43f35b79ed1f34f604fb9e173
@@ -80,19 +80,23 @@ module DiscoveryIndexer
80
80
  # @example
81
81
  # "oo000oo0001%2Fpc0065_b08_f10_i031.jp2"
82
82
  attr_accessor :encoded_thumb
83
-
83
+
84
84
  # @!attribute [rw] sw_image_ids
85
- # @return [Array] a list of the image ids and corresponding druids with %2F
85
+ # @return [Array] a list of the image ids and corresponding druids
86
86
  # separator from the file and externalFile tags in the content_metadata
87
87
  # specifically for Searchworks
88
88
  # @example
89
- # ["xx888yy9999%2Fpc0065_b08_f10_i031.jp2","aa111bb2222%2Fpc0065_b08_f10_i032.jp2"]
89
+ # ["xx888yy9999/pc0065_b08_f10_i031.jp2","aa111bb2222/pc0065_b08_f10_i032.jp2"]
90
90
  attr_accessor :sw_image_ids
91
91
 
92
92
  # @!attribute [rw] catkey
93
93
  # @return [String] the catkey attribute in identity_metadata
94
94
  attr_accessor :catkey
95
95
 
96
+ # @!attribute [rw] previous_catkeys
97
+ # @return [Array] the previous catkey attribute in identity_metadata
98
+ attr_accessor :previous_catkeys
99
+
96
100
  # @!attribute [rw] barcode
97
101
  # @return [String] the barcode attribute in identity_metadata
98
102
  attr_accessor :barcode
@@ -35,6 +35,7 @@ module DiscoveryIndexer
35
35
  purlxml_model.image_ids = parse_image_ids
36
36
  purlxml_model.sw_image_ids = parse_sw_image_ids
37
37
  purlxml_model.catkey = parse_catkey
38
+ purlxml_model.previous_catkeys = parse_previous_catkeys
38
39
  purlxml_model.barcode = parse_barcode
39
40
  purlxml_model.label = parse_label
40
41
  purlxml_model.copyright = parse_copyright
@@ -160,7 +161,7 @@ module DiscoveryIndexer
160
161
  end
161
162
  end
162
163
 
163
- # the thumbnail in publicXML properly URI encoded, including the slash separator
164
+ # the thumbnail in publicXML properly URI encoded, including the slash separator
164
165
  # @return [String] thumb filename with druid prepended, e.g. oo000oo0001%2Ffilename%20withspace.jp2
165
166
  def parse_encoded_thumb
166
167
  thumb=parse_thumb
@@ -169,7 +170,7 @@ module DiscoveryIndexer
169
170
  thumb_filename=thumb.split(/[a-zA-Z]{2}[0-9]{3}[a-zA-Z]{2}[0-9]{4}[\/]/).last # everything after the druid
170
171
  "#{thumb_druid}%2F#{URI.escape(thumb_filename)}"
171
172
  end
172
-
173
+
173
174
  # the druid and id attribute of resource/file and objectId and fileId of the
174
175
  # resource/externalFile elements that match the image, page, or thumb resource type, including extension
175
176
  # Also, prepends the corresponding druid and / specifically for Searchworks use
@@ -209,6 +210,11 @@ module DiscoveryIndexer
209
210
  get_value(@purlxml_ng_doc.xpath("/publicObject/identityMetadata/otherId[@name='catkey']"))
210
211
  end
211
212
 
213
+ # @return previous catkey values from the DOR identity_metadata as an array, or empty array if there are no previous catkeys
214
+ def parse_previous_catkeys
215
+ @purlxml_ng_doc.xpath("/publicObject/identityMetadata/otherId[@name='previous_catkey']").map { |node| node.content }
216
+ end
217
+
212
218
  # @return barcode value from the DOR identity_metadata, or nil if there is no barcode
213
219
  def parse_barcode
214
220
  get_value(@purlxml_ng_doc.xpath("/publicObject/identityMetadata/otherId[@name='barcode']"))
@@ -1,3 +1,3 @@
1
1
  module DiscoveryIndexer
2
- VERSION = '3.1.1'
2
+ VERSION = '3.1.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: discovery-indexer
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.1
4
+ version: 3.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ahmed AlSum
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-10-10 00:00:00.000000000 Z
12
+ date: 2017-03-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri
@@ -232,7 +232,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
232
232
  version: '0'
233
233
  requirements: []
234
234
  rubyforge_project:
235
- rubygems_version: 2.6.7
235
+ rubygems_version: 2.6.10
236
236
  signing_key:
237
237
  specification_version: 4
238
238
  summary: Shared library for the basic discovery indexing operation for Stanford DLSS.