dor-services 4.22.2 → 4.22.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NDYxZTA5OWZlY2Y4ZGE5ZjM2NzY5NTgwYjk2YzRmZTNkYjYwNGY5Ng==
4
+ NjI5NzlkM2JlOTJlYTIwYzM2YTg1MWY4ZWE1MTQyMzZiMmQ0YmM5Yw==
5
5
  data.tar.gz: !binary |-
6
- MWNiNTFmZTMzYjJjOTExNDhiNTJkODI4OTg3NDNmZDAzMDMwYzUxZQ==
6
+ N2VmNmU5NTRhYjY0MDgyYjBmNWVjMjgzNTcyODVkNjA1OGFjMmRiYQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NjZlZWJkYzUwMTEyNmVhNDg5YjNiMzVlYTE2MThiYzNjYTVkM2RkMDU4ZWFh
10
- OTFiZDcxZjA5NDU5Y2JlYTc3Y2IxMzg1ZGY1OWZmM2ZiYzFhNTgwYzMxOWM1
11
- ZGNhNWRiMGQyNjI5MDE4Mzk1NWVlYmQ3NDdhODA4YWUwNzg2MWI=
9
+ M2VhNWZiNGNjMWZiZDY1NGUyOWZhZDZlZDFmZWFlYTIzNTRlZDA3MzI2OTA1
10
+ MWQ3ZWUzOTQwMzUxYTBlZmIzZDcyMzNkMDA1ZTEzYWI2NjdmZmI0MTczYWVm
11
+ MGFkN2Q3MDIwYzRlNmEwMzg1YWJjYWI3ZTc1ZjdjNWExOWM1ZWI=
12
12
  data.tar.gz: !binary |-
13
- YzlkNWU5ODMyYjZlMzg2M2IzYTFiMThlOGQ4OWY0OTE4NmI2MDIzNTVkNDcx
14
- NTMwMjViM2Q4OTA3N2FjNTEyNmE1MDMxMTg0Njg5MjYzMjZkODk5MTY4ZDQ4
15
- YjMxOTUxN2VlNjRmYWM5YzI5NmNkZTJkYzQ1MDY2YWFiNzE5Mzc=
13
+ Y2E5NzY0NGZhYjk1ZWVmOGNiYzliYWE3Nzc1NmVhNTY1ZWEzODMwZTVhZDQ5
14
+ YTMyZDk5ODU2MDNiMTJiOTljYzMyNzE0ZjZlN2E2NDc0OWMzYTZmY2NhMmIw
15
+ ZmY4OGEzYjBmMjBlNDRkMjhlMTJmNWJmYWZmMjYwMTg1MTNjMWE=
@@ -56,11 +56,9 @@ module Dor
56
56
  :sw_all_search_facet_facet => stanford_mods_record.text
57
57
 
58
58
  }
59
- if doc_hash
60
- solr_doc = solr_doc.merge(doc_hash)
61
- end
59
+ solr_doc.merge!(doc_hash) if doc_hash
62
60
  end
63
61
  solr_doc
64
62
  end
65
63
  end
66
- end
64
+ end
@@ -10,21 +10,21 @@ module Dor
10
10
  include Presentable
11
11
 
12
12
  included do
13
- has_metadata :name => "rightsMetadata", :type => ActiveFedora::OmDatastream, :label => 'Rights Metadata'
13
+ has_metadata name: 'rightsMetadata', type: ActiveFedora::OmDatastream, label: 'Rights Metadata'
14
14
  end
15
15
 
16
16
  def build_rightsMetadata_datastream(ds)
17
- content_ds = self.admin_policy_object.datastreams['defaultObjectRights']
17
+ content_ds = admin_policy_object.datastreams['defaultObjectRights']
18
18
  ds.dsLabel = 'Rights Metadata'
19
19
  ds.ng_xml = content_ds.ng_xml.clone
20
20
  ds.content = ds.ng_xml.to_xml
21
21
  end
22
22
 
23
23
  def public_relationships
24
- include_elements = ['fedora:isMemberOf','fedora:isMemberOfCollection']
25
- rels_doc = Nokogiri::XML(self.datastreams['RELS-EXT'].content)
26
- rels_doc.xpath('/rdf:RDF/rdf:Description/*', { 'rdf' => 'http://www.w3.org/1999/02/22-rdf-syntax-ns#' }).each do |rel|
27
- unless include_elements.include?([rel.namespace.prefix,rel.name].join(':'))
24
+ include_elements = ['fedora:isMemberOf', 'fedora:isMemberOfCollection']
25
+ rels_doc = Nokogiri::XML(datastreams['RELS-EXT'].content)
26
+ rels_doc.xpath('/rdf:RDF/rdf:Description/*', 'rdf' => 'http://www.w3.org/1999/02/22-rdf-syntax-ns#').each do |rel|
27
+ unless include_elements.include?([rel.namespace.prefix, rel.name].join(':'))
28
28
  rel.next_sibling.remove if rel.next_sibling.content.strip.empty?
29
29
  rel.remove
30
30
  end
@@ -32,31 +32,30 @@ module Dor
32
32
  rels_doc
33
33
  end
34
34
 
35
- #Generate the public .xml for a PURL page.
36
- #@return [xml] The public xml for the item
37
- #
35
+ # Generate the public .xml for a PURL page.
36
+ # @return [xml] The public xml for the item
38
37
  def public_xml
39
- pub = Nokogiri::XML("<publicObject/>").root
38
+ pub = Nokogiri::XML('<publicObject/>').root
40
39
  pub['id'] = pid
41
40
  pub['published'] = Time.now.xmlschema
42
41
  pub['publishVersion'] = 'dor-services/' + Dor::VERSION
43
- release_xml=Nokogiri(self.generate_release_xml).xpath('//release')
42
+ release_xml = Nokogiri(generate_release_xml).xpath('//release')
44
43
 
45
- im=self.datastreams['identityMetadata'].ng_xml.clone
46
- im.search('//release').each {|node| node.remove} # remove any <release> tags from public xml which have full history
47
- im.root.add_child(release_xml)
44
+ im = datastreams['identityMetadata'].ng_xml.clone
45
+ im.search('//release').each(&:remove) # remove any <release> tags from public xml which have full history
48
46
 
49
47
  pub.add_child(im.root) # add in modified identityMetadata datastream
50
- pub.add_child(self.datastreams['contentMetadata'].public_xml.root.clone)
51
- pub.add_child(self.datastreams['rightsMetadata'].ng_xml.root.clone)
48
+ pub.add_child(datastreams['contentMetadata'].public_xml.root.clone)
49
+ pub.add_child(datastreams['rightsMetadata'].ng_xml.root.clone)
52
50
 
53
51
  rels = public_relationships.root
54
52
  pub.add_child(rels.clone) unless rels.nil? # TODO: Should never be nil in practice; working around an ActiveFedora quirk for testing
55
- pub.add_child(self.generate_dublin_core.root.clone)
53
+ pub.add_child(generate_dublin_core.root.clone)
56
54
  @public_xml_doc = pub # save this for possible IIIF Presentation manifest
57
- pub.add_child(Nokogiri(self.generate_release_xml).root.clone) unless release_xml.children.size == 0 #If there are no release_tags, this prevents an empty <releaseData/> from being added
58
- #Note we cannot base this on if an individual object has release tags or not, because the collection may cause one to be generated for an item, so we need to calculate it and then look at the final result
59
- new_pub = Nokogiri::XML(pub.to_xml) { |x| x.noblanks }
55
+ pub.add_child(Nokogiri(generate_release_xml).root.clone) unless release_xml.children.size == 0 # If there are no release_tags, this prevents an empty <releaseData/> from being added
56
+ # Note we cannot base this on if an individual object has release tags or not, because the collection may cause one to be generated for an item,
57
+ # so we need to calculate it and then look at the final result.s
58
+ new_pub = Nokogiri::XML(pub.to_xml, &:noblanks)
60
59
  new_pub.encoding = 'UTF-8'
61
60
  new_pub.to_xml
62
61
  end
@@ -65,30 +64,26 @@ module Dor
65
64
  # otherwise, it prunes the object's metadata from the document cache
66
65
  def publish_metadata
67
66
  rights = datastreams['rightsMetadata'].ng_xml.clone.remove_namespaces!
68
- if(rights.at_xpath("//rightsMetadata/access[@type='discover']/machine/world"))
69
- dc_xml = self.generate_dublin_core.to_xml {|config| config.no_declaration}
67
+ if rights.at_xpath("//rightsMetadata/access[@type='discover']/machine/world")
68
+ dc_xml = generate_dublin_core.to_xml(&:no_declaration)
70
69
  DigitalStacksService.transfer_to_document_store(pid, dc_xml, 'dc')
71
- DigitalStacksService.transfer_to_document_store(pid, self.datastreams['identityMetadata'].to_xml, 'identityMetadata')
72
- DigitalStacksService.transfer_to_document_store(pid, self.datastreams['contentMetadata'].to_xml, 'contentMetadata')
73
- DigitalStacksService.transfer_to_document_store(pid, self.datastreams['rightsMetadata'].to_xml, 'rightsMetadata')
70
+ DigitalStacksService.transfer_to_document_store(pid, datastreams['identityMetadata'].to_xml, 'identityMetadata')
71
+ DigitalStacksService.transfer_to_document_store(pid, datastreams['contentMetadata'].to_xml, 'contentMetadata')
72
+ DigitalStacksService.transfer_to_document_store(pid, datastreams['rightsMetadata'].to_xml, 'rightsMetadata')
74
73
  DigitalStacksService.transfer_to_document_store(pid, public_xml, 'public')
75
- if self.metadata_format == 'mods'
76
- DigitalStacksService.transfer_to_document_store(pid, self.generate_public_desc_md, 'mods')
77
- end
78
- if iiif_presentation_manifest_needed? @public_xml_doc
79
- DigitalStacksService.transfer_to_document_store(pid, build_iiif_manifest(@public_xml_doc), 'manifest')
80
- end
74
+ DigitalStacksService.transfer_to_document_store(pid, generate_public_desc_md, 'mods') if metadata_format == 'mods'
75
+ DigitalStacksService.transfer_to_document_store(pid, build_iiif_manifest(@public_xml_doc), 'manifest') if iiif_presentation_manifest_needed? @public_xml_doc
81
76
  else
82
77
  # Clear out the document cache for this item
83
78
  DigitalStacksService.prune_purl_dir pid
84
79
  end
85
80
  end
86
- #call the dor services app to have it publish the metadata
81
+
82
+ # Call dor services app to have it publish the metadata
87
83
  def publish_metadata_remotely
88
- dor_services = RestClient::Resource.new(Config.dor_services.url+"/v1/objects/#{pid}/publish")
84
+ dor_services = RestClient::Resource.new(Config.dor_services.url + "/v1/objects/#{pid}/publish")
89
85
  dor_services.post ''
90
86
  dor_services.url
91
87
  end
92
88
  end
93
-
94
89
  end
@@ -5,7 +5,7 @@ module Dor
5
5
  module Releaseable
6
6
  extend ActiveSupport::Concern
7
7
  include Itemizable
8
-
8
+
9
9
  #Add release tags to an item and initialize the item release workflow
10
10
  #
11
11
  #@params release_tags [Hash or Array] Either a hash of a single release tag. Each tag should be in the form of {:tag=>'Fitch : Batch2',:what=>'self',:to=>'Searchworks',:who=>'petucket', :release=>true/false}
@@ -14,18 +14,16 @@ module Dor
14
14
  #
15
15
  #
16
16
  def add_release_nodes_and_start_releaseWF(release_tags)
17
- release_tags = [release_tags] if release_tags.class != Array
18
-
19
- #Add in each tag
17
+ release_tags = [release_tags] unless release_tags.is_a?(Array)
18
+
19
+ # Add in each tag
20
20
  release_tags.each do |r_tag|
21
21
  self.add_release_node(r_tag[:release],r_tag)
22
22
  end
23
-
24
- #Save the item to dor so the robots work with the latest data
25
- self.save
26
-
27
- #Intialize the release workflow
28
- self.initialize_workflow('releaseWF')
23
+
24
+ # Save item to dor so the robots work with the latest data
25
+ save
26
+ initialize_workflow('releaseWF')
29
27
  end
30
28
 
31
29
  #Generate XML structure for inclusion to Purl
@@ -34,56 +32,51 @@ module Dor
34
32
  def generate_release_xml
35
33
  builder = Nokogiri::XML::Builder.new do |xml|
36
34
  xml.releaseData {
37
- self.released_for.each do |project,released_value|
38
- xml.release(released_value["release"],:to=>project)
39
- end
40
- }
41
- end
42
- return builder.to_xml
35
+ released_for.each do |project, released_value|
36
+ xml.release(released_value['release'], :to => project)
37
+ end
38
+ }
39
+ end
40
+ builder.to_xml
43
41
  end
44
-
42
+
45
43
  #Determine which projects an item is released for
46
44
  #
47
45
  #@return [Hash] all namespaces in the form of {"Project" => Boolean}
48
46
  def released_for
49
47
  released_hash = {}
50
-
51
- #Get release tags on the item itself
52
- release_tags_on_this_item = self.release_nodes
53
-
54
- #Get any self tags on this item
55
- self_release_tags = self.get_self_release_tags(release_tags_on_this_item)
56
-
57
- #Get the most recent self tag for all targets and save their result since most recent self always trumps any other non self tags
58
- latest_self_tags = self.get_newest_release_tag(self_release_tags)
48
+ # Get release tags on the item itself
49
+ release_tags_on_this_item = release_nodes
50
+
51
+ # Get any self tags on this item
52
+ self_release_tags = get_self_release_tags(release_tags_on_this_item)
53
+
54
+ # Get the most recent self tag for all targets and save their result since most recent self always trumps any other non self tags
55
+ latest_self_tags = get_newest_release_tag(self_release_tags)
59
56
  latest_self_tags.keys.each do |target|
60
57
  released_hash[target] = self.clean_release_tag_for_purl(latest_self_tags[target])
61
58
  end
62
-
63
- #With Self Tags Resolved We Now need to deal with tags on all sets this object is part of
64
-
65
- potential_applicable_release_tags = {} #This will be where we store all tags that apply, regardless of their timestamp
66
-
67
- #Get all release tags on the item and strip out the what = self ones, we've already processed all the self tags on this item
68
- potential_applicable_release_tags = get_tags_for_what_value(self.get_release_tags_for_item_and_all_governing_sets, 'collection')
69
-
70
- administrative_tags = self.tags #Get them once here and pass them down
71
-
72
- #We now have the keys for all potential releases, we need to check the tags and the most recent time stamp with an explicit true or false wins, in a nil case, the lack of an explicit false tag we do nothing
73
- (potential_applicable_release_tags.keys-released_hash.keys).each do |key| #don't bother checking the ones already added to the release hash, they were added due to a self tag and that has won
59
+
60
+ # With Self Tags Resolved We Now need to deal with tags on all sets this object is part of
61
+ potential_applicable_release_tags = {} # This will be where we store all tags that apply, regardless of their timestamp
62
+
63
+ # Get all release tags on the item and strip out the what = self ones, we've already processed all the self tags on this item
64
+ potential_applicable_release_tags = get_tags_for_what_value(get_release_tags_for_item_and_all_governing_sets, 'collection')
65
+ administrative_tags = tags # Get them once here and pass them down
66
+
67
+ # We now have the keys for all potential releases, we need to check the tags: the most recent timestamp with an explicit true or false wins.
68
+ # In a nil case, the lack of an explicit false tag we do nothing.
69
+ (potential_applicable_release_tags.keys - released_hash.keys).each do |key| # don't bother checking if already added to the release hash, they were added due to a self tag so that has won
74
70
  latest_applicable_tag_for_key = latest_applicable_release_tag_in_array(potential_applicable_release_tags[key], administrative_tags)
75
- if latest_applicable_tag_for_key != nil #We have a valid tag, record it
76
- released_hash[key] = self.clean_release_tag_for_purl(latest_applicable_tag_for_key)
71
+ unless latest_applicable_tag_for_key.nil? # We have a valid tag, record it
72
+ released_hash[key] = clean_release_tag_for_purl(latest_applicable_tag_for_key)
77
73
  end
78
-
79
74
  end
80
-
81
- #See what the application is currently released for on Purl. If something is released in purl but not listed here, it needs to be added as a false
82
- released_hash = self.add_tags_from_purl(released_hash)
83
-
84
- return released_hash
75
+
76
+ # See what the application is currently released for on Purl. If something is released in purl but not listed here, it needs to be added as a false
77
+ add_tags_from_purl(released_hash)
85
78
  end
86
-
79
+
87
80
  #Take a hash of tags as obtained via Dor::Item.release_tags and returns all self tags
88
81
  #
89
82
  #@param tags [Hash] a hash of tags obtained via Dor::Item.release_tags or matching format
@@ -92,25 +85,25 @@ module Dor
92
85
  def get_self_release_tags(tags)
93
86
  return get_tags_for_what_value(tags, 'self')
94
87
  end
95
-
88
+
96
89
  #Take an item and get all of its release tags and all tags on collections it is a member of it
97
90
  #
98
91
  #
99
92
  #@return [Hash] a hash of all tags
100
93
  def get_release_tags_for_item_and_all_governing_sets
101
- return_tags = self.release_nodes || {}
102
- self.collections.each do |collection|
103
- return_tags = combine_two_release_tag_hashes(return_tags, Dor::Item.find(collection.id).get_release_tags_for_item_and_all_governing_sets) #this will function recurvisely so parents of parents are found
94
+ return_tags = release_nodes || {}
95
+ collections.each do |collection|
96
+ return_tags = combine_two_release_tag_hashes(return_tags, Dor::Item.find(collection.id).get_release_tags_for_item_and_all_governing_sets) # recurvise so parents of parents are found
104
97
  end
105
- return return_tags
98
+ return return_tags
106
99
  end
107
-
100
+
108
101
  #Take two hashes of tags and combine them, will not overwrite but will enforce uniqueness of the tags
109
102
  #
110
103
  #@param hash_one [Hash] a hash of tags obtained via Dor::Item.release_tags or matching format
111
104
  #@param hash_two [Hash] a hash of tags obtained via Dor::Item.release_tags or matching format
112
105
  #
113
- #@return [Hash] the combined hash with uniquiness enforced
106
+ #@return [Hash] the combined hash with uniquiness enforced
114
107
  def combine_two_release_tag_hashes(hash_one, hash_two)
115
108
  hash_two.keys.each do |key|
116
109
  hash_one[key] = hash_two[key] if hash_one[key] == nil
@@ -118,7 +111,7 @@ module Dor
118
111
  end
119
112
  return hash_one
120
113
  end
121
-
114
+
122
115
  #Take a hash of tags and return all tags with the matching what target
123
116
  #
124
117
  #@param tags [Hash] a hash of tags obtained via Dor::Item.release_tags or matching format
@@ -128,40 +121,28 @@ module Dor
128
121
  def get_tags_for_what_value(tags, what_target)
129
122
  return_hash = {}
130
123
  tags.keys.each do |key|
131
- self_tags = tags[key].select{|tag| tag['what'] == what_target.downcase}
124
+ self_tags = tags[key].select {|tag| tag['what'] == what_target.downcase}
132
125
  return_hash[key] = self_tags if self_tags.size > 0
133
126
  end
134
127
  return return_hash
135
128
  end
136
-
129
+
137
130
  #Take a hash of tags as obtained via Dor::Item.release_tags and returns the newest tag for each namespace
138
131
  #
139
132
  #@params tags [Hash] a hash of tags obtained via Dor::Item.release_tags or matching format
140
133
  #
141
134
  #@return [Hash] a hash of latest tags for each to value
142
135
  def get_newest_release_tag(tags)
143
- return_hash = {}
144
- tags.keys.each do |key|
145
- latest_for_key = newest_release_tag_in_an_array(tags[key])
146
- return_hash[key] = latest_for_key
147
- end
148
- return return_hash
136
+ Hash[tags.map {|key, val| [key, newest_release_tag_in_an_array(val)]}]
149
137
  end
150
-
151
- #Take a tag and return only the attributes we want to put into purl
152
- #
153
- #@param tag [Hash] a tag
154
- #
155
- #@return [Hash] a hash of the attributes we want for purl
138
+
139
+ # Take a tag and return only the attributes we want to put into purl
140
+ # @param tag [Hash] a tag
141
+ # @return [Hash] a hash of the attributes we want for purl
156
142
  def clean_release_tag_for_purl(tag)
157
- for_purl = ['release']
158
- return_hash = {}
159
- for_purl.each do |attr|
160
- return_hash[attr] = tag[attr]
161
- end
162
- return return_hash
143
+ {'release' => tag['release']}
163
144
  end
164
-
145
+
165
146
  #Takes an array of release tags and returns the most recent one
166
147
  #
167
148
  #@params tags [Array] an array of hashes, with the hashes being release tags
@@ -174,21 +155,18 @@ module Dor
174
155
  end
175
156
  return latest_tag_in_array
176
157
  end
177
-
178
- #Takes a tag and returns true or false if it applies to the specific item
179
- #
180
- #@param release_tag [Hash] the tag in a hashed form
181
- #@param Optional admin_tags [Array] the administrative tags on an item, if not supplied it will attempt to retrieve them
182
- #
183
- #@return [Boolean] true or false if it applies (not true or false if it is released, that is the release_tag data)
184
- def does_release_tag_apply(release_tag, admin_tags=false)
185
- #Is the tag global or restricted
186
- return true if release_tag['tag'] == nil #there is no specific tag specificied, so that means this tag is global to all members of the collection, it applies, return true
187
-
188
- admin_tags = self.tags if ! admin_tags #We use false instead of [], since an item can have no admin_tags that which point we'd be passing down this variable as [] and would not an attempt to retrieve it
189
- return admin_tags.include?(release_tag['tag'])
158
+
159
+ # Takes a tag and returns true or false if it applies to the specific item
160
+ # @param release_tag [Hash] the tag in a hashed form
161
+ # @param admin_tags [Array] the administrative tags on an item, if not supplied it will attempt to retrieve them
162
+ # @return [Boolean] true or false if it applies (not true or false if it is released, that is the release_tag data)
163
+ def does_release_tag_apply(release_tag, admin_tags = false)
164
+ # Is the tag global or restricted
165
+ return true if release_tag['tag'].nil? # no specific tag specificied means this tag is global to all members of the collection
166
+ admin_tags = tags unless admin_tags # We use false instead of [], since an item can have no admin_tags at which point we'd be passing this var as [] and would not attempt to retrieve it
167
+ admin_tags.include?(release_tag['tag'])
190
168
  end
191
-
169
+
192
170
  #Takes an array of release tags and returns the most recent one that applies to this item
193
171
  #
194
172
  #@param release_tags [Array] an array of release tags in hashed form
@@ -197,17 +175,16 @@ module Dor
197
175
  #@return [Hash] the tag
198
176
  def latest_applicable_release_tag_in_array(release_tags, admin_tags)
199
177
  newest_tag = newest_release_tag_in_an_array(release_tags)
200
- return newest_tag if does_release_tag_apply(newest_tag, admin_tags) #Return true if we have it
201
-
202
- #The latest tag wasn't applicable, slice it off and try again
203
- #This could be optimized by reordering on the timestamp and just running down it instead of constantly resorting, at least if we end up getting numerous release tags on an item
178
+ return newest_tag if does_release_tag_apply(newest_tag, admin_tags)
179
+
180
+ # The latest tag wasn't applicable, slice it off and try again
181
+ # This could be optimized by reordering on the timestamp and just running down it instead of constantly resorting, at least if we end up getting numerous release tags on an item
204
182
  release_tags.slice!(release_tags.index(newest_tag))
205
-
206
- return latest_applicable_release_tag_in_array(release_tags, admin_tags) if release_tags.size > 0 #Try again after dropping the one that wasn't applicable
207
-
208
- return nil #We're out of tags, no applicable ones
183
+
184
+ return latest_applicable_release_tag_in_array(release_tags, admin_tags) if release_tags.size > 0 # Try again after dropping the inapplicable
185
+ nil # We're out of tags, no applicable ones
209
186
  end
210
-
187
+
211
188
  #helper method to get the release tags as a nodeset
212
189
  #
213
190
  #@return [Nokogiri::XML::NodeSet] of all release tags and their attributes
@@ -233,55 +210,31 @@ module Dor
233
210
  def release_tag_node_to_hash(rtag)
234
211
  to = 'to'
235
212
  release = 'release'
236
- when_word = 'when' #TODO: Make to and when_word load from some config file instead of hardcoded here
213
+ when_word = 'when' # TODO: Make to and when_word load from some config file instead of hardcoded here
237
214
  attrs = rtag.attributes
238
215
  return_hash = { :to => attrs[to].value }
239
- attrs.tap { |a| a.delete(to)}
240
- attrs[release] = rtag.text.downcase == "true" #save release as a boolean
216
+ attrs.tap { |a| a.delete(to) }
217
+ attrs[release] = rtag.text.downcase == 'true' #save release as a boolean
241
218
  return_hash[:attrs] = attrs
242
219
 
243
- #convert all the attrs beside :to to strings, they are currently Nokogiri::XML::Attr
244
- (return_hash[:attrs].keys-[to]).each do |a|
245
- return_hash[:attrs][a] = return_hash[:attrs][a].to_s if a != release
220
+ # convert all the attrs beside :to to strings, they are currently Nokogiri::XML::Attr
221
+ (return_hash[:attrs].keys - [to]).each do |a|
222
+ return_hash[:attrs][a] = return_hash[:attrs][a].to_s if a != release
246
223
  end
247
224
 
248
225
  return_hash[:attrs][when_word] = Time.parse(return_hash[:attrs][when_word]) #convert when to a datetime
249
-
250
- return return_hash
226
+ return_hash
251
227
  end
252
-
253
- #Determine if the supplied tag is a valid release tag that meets all requirements
254
- #
255
- #@raises [RuntimeError] Raises an error of the first fault in the release tag
256
- #
257
- #@return [Boolean] Returns true if no errors found
258
- #
259
- #@params attrs [hash] A hash of attributes for the tag, must contain: :when, a ISO 8601 timestamp; :who, to identify who or what added the tag; and :to, a string identifying the release target
260
- def valid_release_attributes_and_tag(tag, attrs={})
261
- raise ArgumentError, ":when is not iso8601" if attrs[:when].match('\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z') == nil
262
- [:who, :to, :what].each do |check_attr|
263
- raise ArgumentError, "#{check_attr} not supplied as a String" if attrs[check_attr].class != String
264
- end
265
228
 
266
- what_correct = false
267
- ['self', 'collection'].each do |allowed_what_value|
268
- what_correct = true if attrs[:what] == allowed_what_value
269
- end
270
- raise ArgumentError, ":what must be self or collection" if ! what_correct
271
- raise ArgumentError, "the value set for this tag is not a boolean" if !!tag != tag
272
- validate_tag_format(attrs[:tag]) if attrs[:tag] != nil #Will Raise exception if invalid tag
273
- return true
274
- end
275
-
276
229
  #Add a release node for the item
277
230
  #Will use the current time to add in the timestamp if you do not supply a timestamp, you can supply a timestap for correcting history, etc if desired
278
231
  #
279
- #@return [Nokogiri::XML::Element] the tag added if successful
232
+ #@return [Nokogiri::XML::Element] the tag added if successful
280
233
  #
281
234
  #@raise [ArgumentError] Raised if attributes are improperly supplied
282
235
  #
283
236
  #@params tag [Boolean] True or false for the release node
284
- #@params attrs [hash] A hash of any attributes to be placed onto the tag
237
+ #@params attrs [hash] A hash of any attributes to be placed onto the tag
285
238
  #Timestamp will be calculated by the function, if no displayType is passed in, it will default to file
286
239
  #
287
240
  #@example
@@ -291,21 +244,20 @@ module Dor
291
244
  attrs[:when] = Time.now.utc.iso8601 if attrs[:when].nil? #add the timestamp
292
245
  attrs[:displayType] = 'file' if attrs[:displayType].nil? #default to file is no display type is passed
293
246
  valid_release_attributes(release, attrs)
294
-
295
- #Remove the old displayType and then add the one for this tag
247
+
248
+ # Remove the old displayType and then add the one for this tag
296
249
  remove_displayTypes
297
250
  identity_metadata_ds.add_value(:displayType, attrs[:displayType], {})
298
-
299
- return identity_metadata_ds.add_value(:release, release.to_s, attrs)
251
+ identity_metadata_ds.add_value(:release, release.to_s, attrs)
300
252
  end
301
253
 
302
254
  #Determine if the supplied tag is a valid release node that meets all requirements
303
255
  #
304
256
  #@raises [ArgumentError] Raises an error of the first fault in the release tag
305
257
  #
306
- #@return [Boolean] Returns true if no errors found
258
+ #@return [Boolean] Returns true if no errors found
307
259
  #
308
- #@params attrs [hash] A hash of attributes for the tag, must contain :when, a ISO 8601 timestamp and :who to identify who or what added the tag, :to,
260
+ #@params attrs [hash] A hash of attributes for the tag, must contain :when, a ISO 8601 timestamp and :who to identify who or what added the tag, :to,
309
261
  def valid_release_attributes(tag, attrs={})
310
262
  raise ArgumentError, ":when is not iso8601" if attrs[:when].match('\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z') == nil
311
263
  [:who, :to, :what].each do |check_attr|
@@ -316,12 +268,12 @@ module Dor
316
268
  ['self', 'collection'].each do |allowed_what_value|
317
269
  what_correct = true if attrs[:what] == allowed_what_value
318
270
  end
319
- raise ArgumentError, ":what must be self or collection" if ! what_correct
320
- raise ArgumentError, "the value set for this tag is not a boolean" if !!tag != tag
321
- raise ArgumentError, ":displayType must be passed in as a String" unless attrs[:displayType].class == String
322
-
323
- validate_tag_format(attrs[:tag]) if attrs[:tag] != nil #Will Raise exception if invalid tag
324
- return true
271
+ raise ArgumentError, ':what must be self or collection' unless what_correct
272
+ raise ArgumentError, 'the value set for this tag is not a boolean' if !!tag != tag
273
+ raise ArgumentError, ':displayType must be passed in as a String' unless attrs[:displayType].class == String
274
+
275
+ validate_tag_format(attrs[:tag]) unless attrs[:tag].nil? # Will Raise exception if invalid tag
276
+ true
325
277
  end
326
278
 
327
279
  #helper method to get the release nodes as a nodeset
@@ -335,12 +287,12 @@ module Dor
335
287
  if return_hash[hashed_node[:to]] != nil
336
288
  return_hash[hashed_node[:to]] << hashed_node[:attrs]
337
289
  else
338
- return_hash[hashed_node[:to]] = [hashed_node[:attrs]]
290
+ return_hash[hashed_node[:to]] = [hashed_node[:attrs]]
339
291
  end
340
292
  end
341
293
  return return_hash
342
294
  end
343
-
295
+
344
296
  #Get a list of all release nodes found in a purl document
345
297
  #
346
298
  #@params druid [String]
@@ -351,19 +303,21 @@ module Dor
351
303
  #
352
304
  #@return [Nokogiri::HTML::Document] the parsed xml for the druid or an empty document if no purl is found
353
305
  def get_xml_from_purl
354
- handler = Proc.new do |exception, attempt_number, total_delay|
355
- #We assume a 404 means the document has never been published before and thus has no purl
356
- #The strip is needed before the actual message is "404 "
357
- return Nokogiri::HTML::Document.new if exception.message.strip == "404"
358
- end
306
+ url = form_purl_url
307
+ handler = Proc.new do |exception, attempt_number, total_delay|
308
+ # We assume a 404 means the document has never been published before and thus has no purl
309
+ Dor.logger.warn "[Attempt #{attempt_number}] GET #{url} -- #{exception.class}: #{exception.message}; #{total_delay} seconds elapsed."
310
+ raise exception unless exception.is_a? OpenURI::HTTPError
311
+ return Nokogiri::HTML::Document.new if exception.io.status[0] == '404'
312
+ end
359
313
 
360
- with_retries(:max_retries => 5, :base_sleep_seconds => 3, :max_sleep_seconds=> 5, :rescue => OpenURI::HTTPError, :handler => handler) {
361
- #If you change the method used for opening the webpage, you can change the :rescue param to handle the new method's errors
362
- return Nokogiri::HTML(open(self.form_purl_url))
363
- }
364
-
314
+ with_retries(:max_retries => 3, :base_sleep_seconds => 3, :max_sleep_seconds => 5, :handler => handler) do |attempt|
315
+ # If you change the method used for opening the webpage, you can change the :rescue param to handle the new method's errors
316
+ Dor.logger.info "[Attempt #{attempt}] GET #{url}"
317
+ return Nokogiri::HTML(OpenURI.open_uri(url))
318
+ end
365
319
  end
366
-
320
+
367
321
  #Since purl does not use the druid: prefix but much of dor does, use this function to strip the druid: if needed
368
322
  #
369
323
  #@return [String] the druid sans the druid: or if there was no druid: prefix, the entire string you passed
@@ -372,54 +326,58 @@ module Dor
372
326
  return self.id.split(druid_prefix)[1] if self.id.split(druid_prefix).size > 1
373
327
  return druid
374
328
  end
375
-
376
- #Take the and create the entire purl url that will usable for the open method in open-uri, returns http
377
- #
378
- #params druid [String], the druid without or without the driud prefix
379
- #
380
- #return [String], the full url
329
+
330
+ # Take the and create the entire purl url that will usable for the open method in open-uri, returns https
331
+ # @return [String] the full url
381
332
  def form_purl_url
382
- prefix = "http://"
383
- return prefix + Dor::Config.stacks.document_cache_host + "/#{self.remove_druid_prefix}.xml"
333
+ 'https://' + Dor::Config.stacks.document_cache_host + "/#{remove_druid_prefix}.xml"
384
334
  end
385
-
335
+
386
336
  #Pull all release nodes from the public xml obtained via the purl query
387
337
  #
388
338
  #@params druid [Nokogiri::HTML::Document] The druid of the object you want
389
339
  #
390
- #@return [Array] An array containing all the release tags
340
+ #@return [Array] An array containing all the release tags
391
341
  def get_release_tags_from_purl_xml(doc)
392
- nodes = doc.xpath("//html/body/publicobject/releasedata").children
393
- #We only want the nodes with a name that isn't text
394
- return_array = []
395
- nodes.each do |n|
396
- return_array << n.attr('to') if n.name != nil and n.name.downcase != "text"
397
- end
398
- return return_array.uniq
342
+ nodes = doc.xpath('//html/body/publicobject/releasedata').children
343
+ # We only want the nodes with a name that isn't text
344
+ nodes.reject {|n| n.name.nil? || n.name.downcase == 'text'}.map {|n| n.attr('to')}.uniq
399
345
  end
400
-
346
+
401
347
  #Pull all release nodes from the public xml obtained via the purl query
402
348
  #
403
- #@return [Array] An array containing all the release tags
349
+ #@return [Array] An array containing all the release tags
404
350
  def get_release_tags_from_purl
405
351
  xml = self.get_xml_from_purl
406
352
  return self.get_release_tags_from_purl_xml(xml)
407
353
  end
408
-
409
- #This function calls purl and gets a list of all release tags currently in purl. It then compares to the list you have generated.
410
- #Any tag that is on purl, but not in the newly generated list is added to the new list with a value of false.
411
- #
412
- #params new_tags [Hash] a hash of all new tags in the form of {Project => Boolean}, where Project is a string
413
- #
414
- #return [Hash], a hash in the 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
415
- def add_tags_from_purl(new_tags)
416
- tags_currently_in_purl = self.get_release_tags_from_purl
417
- missing_tags = tags_currently_in_purl.map(&:downcase) - new_tags.keys.map(&:downcase)
354
+
355
+ # This function calls purl and gets a list of all release tags currently in purl. It then compares to the list you have generated.
356
+ # Any tag that is on purl, but not in the newly generated list is added to the new list with a value of false.
357
+ # @param new_tags [Hash{String => Boolean}] all new tags in the form of !{"Project" => Boolean}
358
+ # @return [Hash], a hash in the 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
359
+ def add_tags_from_purl(new_tags)
360
+ tags_currently_in_purl = get_release_tags_from_purl
361
+ missing_tags = tags_currently_in_purl.map(&:downcase) - new_tags.keys.map(&:downcase)
418
362
  missing_tags.each do |missing_tag|
419
363
  new_tags[missing_tag.capitalize] = {"release"=>false}
420
364
  end
421
365
  return new_tags
422
366
  end
423
367
 
368
+ def to_solr(solr_doc = {}, *args)
369
+ super(solr_doc, *args)
370
+
371
+ # TODO: sort of worried about the performance impact in bulk reindex
372
+ # situations, since released_for recurses all parent collections. jmartin 2015-07-14
373
+ released_for().each { |key, val|
374
+ add_solr_value(solr_doc, 'released_to', key, :symbol, []) if val
375
+ }
376
+
377
+ # TODO: need to solrize whether item is released to purl? does released_for return that?
378
+ # logic is: "True when there is a published lifecycle and Access Rights is anything but Dark"
379
+
380
+ solr_doc
381
+ end
424
382
  end
425
383
  end
data/lib/dor/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Dor
2
- VERSION = '4.22.2'
2
+ VERSION = '4.22.3'
3
3
  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: 4.22.2
4
+ version: 4.22.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Klein
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2015-09-30 00:00:00.000000000 Z
15
+ date: 2015-10-14 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: active-fedora
@@ -540,10 +540,7 @@ files:
540
540
  - bin/dor-indexer
541
541
  - bin/dor-indexerd
542
542
  - config/certs/README
543
- - config/certs/robots-dor-dev.crt
544
- - config/certs/robots-dor-dev.key
545
543
  - config/config_defaults.yml
546
- - config/dev_console_env.rb
547
544
  - config/dev_console_env.rb.example
548
545
  - config/predicate_mappings.yml
549
546
  - lib/dor-services.rb
@@ -646,7 +643,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
646
643
  version: 1.3.6
647
644
  requirements: []
648
645
  rubyforge_project:
649
- rubygems_version: 2.2.2
646
+ rubygems_version: 2.4.8
650
647
  signing_key:
651
648
  specification_version: 4
652
649
  summary: Ruby implmentation of DOR services used by the SULAIR Digital Library
@@ -1,29 +0,0 @@
1
- -----BEGIN CERTIFICATE-----
2
- MIIE9zCCAt8CCQCcUJVDTu7rTjAN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oZmck5EoVSm
22
- HS3Asqggp6yA9djtrCfNC5icr4VsaLfku5nKJQ4t4bLxkGhNmBCejwSA/S09+x9O
23
- Wu0JX3zR3y+IMczQ+tRGmNiU5qXhCJ4fbQHSeGqIN3Io7h/RR6E/QlJU59RrRG/a
24
- SjqAV+ECgYEA2mA5VFK3jECnLde+biEaXidIOuBMcqaP0VG6sBwz2wTGSTBE1WkG
25
- 6prCD0McWVAgDTm3MMKxeuMaoW5eEi83+G+CywLaTBpc8Hz7qgRhBpKhRirCfHMW
26
- EfQV5k32vEGoSI+eG8zcGb9mwDeb/EWXAMGXrx2YuYFu7txtwC2mZXc=
27
- -----END RSA PRIVATE KEY-----
@@ -1,77 +0,0 @@
1
- cert_dir = File.join(File.dirname(__FILE__), 'certs')
2
-
3
- Dor::Config.configure do
4
-
5
- ssl do
6
- cert_file File.join(cert_dir, 'robots-dor-dev.crt')
7
- key_file File.join(cert_dir, 'robots-dor-dev.key')
8
- key_pass ''
9
- end
10
-
11
- suri do
12
- mint_ids true
13
- id_namespace 'druid'
14
- url 'https://lyberservices-dev.stanford.edu'
15
- user 'labware'
16
- pass 'lyberteam'
17
- end
18
-
19
- metadata do
20
- exist.url 'http://viewer:l3l%40nd@lyberapps-dev.stanford.edu/exist/rest/'
21
- catalog.url 'http://lyberservices-prod.stanford.edu/catalog/mods'
22
- end
23
-
24
- stacks do
25
- document_cache_host 'purl-dev.stanford.edu'
26
- local_stacks_root '/stacks'
27
- local_document_cache_root '/purl/document_cache'
28
- local_workspace_root '/dor/workspace'
29
- end
30
-
31
- solrizer.url 'http://sul-solr.stanford.edu/solr/argo_test'
32
- fedora.url 'https://sul-dor-test.stanford.edu/fedora'
33
- workflow.url 'https://lyberservices-dev.stanford.edu/workflow/'
34
- dor_services.url 'https://dorAdmin:dorAdmin@sul-lyberservices-dev.stanford.edu/dor'
35
-
36
- cleanup do
37
- local_workspace_root '/dor/workspace'
38
- local_export_home '/dor/export'
39
- end
40
-
41
- sdr do
42
- url 'https://sdrAdmin:sdrAdmin@sdr-services-test.stanford.edu/sdr/'
43
- local_workspace_root '/dor/workspace'
44
- local_export_home '/dor/export'
45
- datastreams do
46
- administrativeMetadata 'optional'
47
- contentMetadata 'optional'
48
- descMetadata 'required'
49
- defaultObjectRights 'optional'
50
- events 'optional'
51
- embargoMetadata 'optional'
52
- identityMetadata 'required'
53
- provenanceMetadata 'required'
54
- relationshipMetadata 'required'
55
- rightsMetadata 'optional'
56
- roleMetadata 'optional'
57
- sourceMetadata 'optional'
58
- technicalMetadata 'optional'
59
- versionMetadata 'required'
60
- workflows 'optional'
61
- end
62
- end
63
-
64
- accessioning_robot_sleep_time 30
65
-
66
- end
67
-
68
- #WORKFLOW_URI = 'http://lyberservices-test.stanford.edu/workflow'
69
-
70
- # Constants for Dor::WorkflowService
71
- #module Dor
72
- # CREATE_WORKFLOW = DOR_CREATE_WORKFLOW = true
73
- # WF_URI = 'http://lyberservices-test.stanford.edu/workflow'
74
- #end
75
-
76
- # External application locations
77
- JHOVE_HOME = File.join(ENV['HOME'], 'jhoveToolkit')