dor-services 5.1.0 → 5.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +13 -5
- data/config/dev_console_env.rb +45 -32
- data/lib/dor-services.rb +52 -49
- data/lib/dor/datastreams/administrative_metadata_ds.rb +2 -2
- data/lib/dor/datastreams/content_metadata_ds.rb +114 -144
- data/lib/dor/datastreams/default_object_rights_ds.rb +10 -12
- data/lib/dor/datastreams/desc_metadata_ds.rb +4 -4
- data/lib/dor/datastreams/events_ds.rb +8 -8
- data/lib/dor/datastreams/identity_metadata_ds.rb +40 -23
- data/lib/dor/datastreams/rights_metadata_ds.rb +109 -0
- data/lib/dor/datastreams/role_metadata_ds.rb +4 -4
- data/lib/dor/datastreams/simple_dublin_core_ds.rb +6 -6
- data/lib/dor/datastreams/version_metadata_ds.rb +29 -10
- data/lib/dor/models/admin_policy_object.rb +3 -3
- data/lib/dor/models/describable.rb +5 -4
- data/lib/dor/models/editable.rb +29 -33
- data/lib/dor/models/embargoable.rb +1 -12
- data/lib/dor/models/governable.rb +4 -27
- data/lib/dor/models/identifiable.rb +60 -58
- data/lib/dor/models/item.rb +5 -9
- data/lib/dor/models/presentable.rb +15 -2
- data/lib/dor/models/processable.rb +34 -30
- data/lib/dor/models/publishable.rb +5 -14
- data/lib/dor/models/{releasable.rb → releaseable.rb} +59 -15
- data/lib/dor/models/rightsable.rb +25 -0
- data/lib/dor/models/versionable.rb +6 -3
- data/lib/dor/models/workflow_object.rb +4 -4
- data/lib/dor/services/cleanup_reset_service.rb +1 -2
- data/lib/dor/services/cleanup_service.rb +1 -1
- data/lib/dor/services/registration_service.rb +0 -3
- data/lib/dor/services/sdr_ingest_service.rb +1 -1
- data/lib/dor/services/search_service.rb +1 -1
- data/lib/dor/utils/sdr_client.rb +23 -0
- data/lib/dor/version.rb +1 -1
- data/lib/dor/workflow/document.rb +23 -22
- data/lib/tasks/rdoc.rake +4 -4
- metadata +113 -96
- data/config/environments/development.rb +0 -84
- data/config/environments/development.rb.old +0 -84
- data/config/environments/test.rb +0 -84
- data/lib/tasks/dor.rake +0 -39
@@ -6,7 +6,7 @@ module Dor
|
|
6
6
|
DC_NS = {"dc"=>"http://purl.org/dc/elements/1.1/", "oai_dc"=>"http://www.openarchives.org/OAI/2.0/oai_dc/"}
|
7
7
|
|
8
8
|
def iiif_presentation_manifest_needed? pub_obj_doc
|
9
|
-
if(pub_obj_doc.at_xpath('/publicObject/contentMetadata[@type
|
9
|
+
if(pub_obj_doc.at_xpath('/publicObject/contentMetadata[contains(@type,"image") or contains(@type,"map")]/resource[@type="image"]'))
|
10
10
|
return true
|
11
11
|
elsif(pub_obj_doc.at_xpath('/publicObject/contentMetadata[@type="book"]/resource[@type="page"]'))
|
12
12
|
return true
|
@@ -32,6 +32,14 @@ module Dor
|
|
32
32
|
'@id' => "#{purl_base_uri}/iiif/manifest.json",
|
33
33
|
'label' => lbl,
|
34
34
|
'attribution' => 'Provided by the Stanford University Libraries',
|
35
|
+
'logo' => {
|
36
|
+
'@id' => "http://stacks.stanford.edu/image/iiif/wy534zh7137%2FSULAIR_rosette/full/400,/0/default.jpg",
|
37
|
+
'service' => {
|
38
|
+
'@context' => "http://iiif.io/api/image/2/context.json",
|
39
|
+
'@id' => "http://stacks.stanford.edu/image/iiif/wy534zh7137%2FSULAIR_rosette",
|
40
|
+
'profile' => "http://iiif.io/api/image/2/level1.json"
|
41
|
+
}
|
42
|
+
},
|
35
43
|
'seeAlso' => {
|
36
44
|
'@id' => "#{purl_base_uri}.mods",
|
37
45
|
'format' => 'application/mods+xml'
|
@@ -80,7 +88,12 @@ module Dor
|
|
80
88
|
|
81
89
|
canv = IIIF::Presentation::Canvas.new
|
82
90
|
canv['@id'] = "#{purl_base_uri}/canvas/canvas-#{count}"
|
83
|
-
|
91
|
+
label_node = res_node.at_xpath('label')
|
92
|
+
if label_node
|
93
|
+
canv.label = label_node.text
|
94
|
+
else
|
95
|
+
canv.label = "image"
|
96
|
+
end
|
84
97
|
canv.height = height
|
85
98
|
canv.width = width
|
86
99
|
|
@@ -106,6 +106,7 @@ module Dor
|
|
106
106
|
Dor::WorkflowService.get_milestones('dor',self.pid)
|
107
107
|
end
|
108
108
|
|
109
|
+
# @return [Hash] including :current_version, :status_code and :status_time
|
109
110
|
def status_info()
|
110
111
|
current_version = '1'
|
111
112
|
begin
|
@@ -139,8 +140,10 @@ module Dor
|
|
139
140
|
return {:current_version => current_version, :status_code => status_code, :status_time => status_time}
|
140
141
|
end
|
141
142
|
|
143
|
+
# @param [Boolean] include_time
|
144
|
+
# @return [String] single composed status from status_info
|
142
145
|
def status(include_time=false)
|
143
|
-
status_info_hash = status_info
|
146
|
+
status_info_hash = status_info()
|
144
147
|
current_version, status_code, status_time = status_info_hash[:current_version], status_info_hash[:status_code], status_info_hash[:status_time]
|
145
148
|
|
146
149
|
#use the translation table to get the appropriate verbage for the latest step
|
@@ -149,6 +152,13 @@ module Dor
|
|
149
152
|
return result
|
150
153
|
end
|
151
154
|
|
155
|
+
# return the text translation of the status code, minus any trailing parenthetical explanation
|
156
|
+
# e.g. 'In accessioning (described)' and 'In accessioning (described, published)' both come back
|
157
|
+
# as 'In accessioning'
|
158
|
+
def simplified_status_code_disp_txt(status_code)
|
159
|
+
return STATUS_CODE_DISP_TXT[status_code].gsub(/\(.*\)$/, '').strip
|
160
|
+
end
|
161
|
+
|
152
162
|
def to_solr(solr_doc=Hash.new, *args)
|
153
163
|
super(solr_doc, *args)
|
154
164
|
sortable_milestones = {}
|
@@ -171,38 +181,34 @@ module Dor
|
|
171
181
|
timestamp = milestone[:at].utc.xmlschema
|
172
182
|
sortable_milestones[milestone[:milestone]] ||= []
|
173
183
|
sortable_milestones[milestone[:milestone]] << timestamp
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
add_solr_value(solr_doc, 'lifecycle', "#{milestone[:milestone]}:#{timestamp};#{milestone[:version]}", :string, [:displayable])
|
184
|
+
milestone[:version] ||= current_version
|
185
|
+
solr_doc['lifecycle_ssim'] ||= []
|
186
|
+
solr_doc['lifecycle_ssim'] << milestone[:milestone]
|
187
|
+
add_solr_value(solr_doc, 'lifecycle', "#{milestone[:milestone]}:#{timestamp};#{milestone[:version]}", :symbol)
|
179
188
|
end
|
180
189
|
|
181
190
|
sortable_milestones.each do |milestone, unordered_dates|
|
182
191
|
dates = unordered_dates.sort
|
183
|
-
#create the
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
#for future faceting
|
192
|
-
add_solr_value(solr_doc, "#{milestone}_earliest", dates.first, :date, [:searchable, :facetable])
|
193
|
-
add_solr_value(solr_doc, "#{milestone}_latest", dates.last, :date, [:searchable, :facetable])
|
192
|
+
#create the published_dttsi and published_day fields and the like
|
193
|
+
dates.each do |date|
|
194
|
+
solr_doc["#{milestone}_dttsim"] ||= []
|
195
|
+
solr_doc["#{milestone}_dttsim"] << date unless solr_doc["#{milestone}_dttsim"].include?(date)
|
196
|
+
end
|
197
|
+
#fields for OAI havester to sort on: _dttsi is trie date +stored +indexed (single valued, i.e. sortable)
|
198
|
+
solr_doc["#{milestone}_earliest_dttsi"] = dates.first
|
199
|
+
solr_doc["#{milestone}_latest_dttsi" ] = dates.last
|
194
200
|
end
|
195
|
-
|
201
|
+
solr_doc["status_ssi"] = status # status is singular (i.e. the current one)
|
202
|
+
solr_doc["current_version_isi"] = current_version.to_i
|
203
|
+
solr_doc["modified_latest_dttsi"] = self.modified_date.to_datetime.utc.strftime('%FT%TZ')
|
204
|
+
add_solr_value(solr_doc, "rights", rights, :string, [:symbol]) if self.respond_to? :rights
|
196
205
|
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
add_solr_value(solr_doc, "last_modified_day", self.modified_date.to_s.split('T').first, :string, [ :facetable ])
|
204
|
-
add_solr_value(solr_doc, "rights", rights, :string, [:facetable]) if self.respond_to? :rights
|
205
|
-
solr_doc
|
206
|
+
status_info_hash = status_info()
|
207
|
+
status_code = status_info_hash[:status_code]
|
208
|
+
add_solr_value(solr_doc, 'processing_status_text', simplified_status_code_disp_txt(status_code), :string, [:stored_sortable])
|
209
|
+
solr_doc['processing_status_code_isi'] = status_code # no _isi in Solrizer's default descriptors
|
210
|
+
|
211
|
+
return solr_doc
|
206
212
|
end
|
207
213
|
|
208
214
|
# Initilizes workflow for the object in the workflow service
|
@@ -213,13 +219,11 @@ module Dor
|
|
213
219
|
# @param [Integer] priority the workflow's priority level
|
214
220
|
def initialize_workflow(name, create_ds=true, priority=0)
|
215
221
|
priority = workflows.current_priority if priority == 0
|
216
|
-
opts = { :create_ds => create_ds }
|
222
|
+
opts = { :create_ds => create_ds, :lane_id => default_workflow_lane }
|
217
223
|
opts[:priority] = priority if(priority > 0)
|
218
|
-
opts[:lane_id] = default_workflow_lane
|
219
224
|
Dor::WorkflowService.create_workflow(Dor::WorkflowObject.initial_repo(name), self.pid, name, Dor::WorkflowObject.initial_workflow(name), opts)
|
220
225
|
end
|
221
226
|
|
222
|
-
|
223
227
|
private
|
224
228
|
#handles formating utc date/time to human readable
|
225
229
|
# XXX: bad form to hardcode TZ here. Code smell abounds.
|
@@ -8,17 +8,7 @@ module Dor
|
|
8
8
|
include Describable
|
9
9
|
include Itemizable
|
10
10
|
include Presentable
|
11
|
-
|
12
|
-
included do
|
13
|
-
has_metadata :name => "rightsMetadata", :type => ActiveFedora::OmDatastream, :label => 'Rights Metadata'
|
14
|
-
end
|
15
|
-
|
16
|
-
def build_rightsMetadata_datastream(ds)
|
17
|
-
content_ds = self.admin_policy_object.datastreams['defaultObjectRights']
|
18
|
-
ds.dsLabel = 'Rights Metadata'
|
19
|
-
ds.ng_xml = content_ds.ng_xml.clone
|
20
|
-
ds.content = ds.ng_xml.to_xml
|
21
|
-
end
|
11
|
+
include Rightsable
|
22
12
|
|
23
13
|
def public_relationships
|
24
14
|
include_elements = ['fedora:isMemberOf','fedora:isMemberOfCollection']
|
@@ -43,7 +33,7 @@ module Dor
|
|
43
33
|
|
44
34
|
im=self.datastreams['identityMetadata'].ng_xml.clone
|
45
35
|
im.search('//release').each {|node| node.remove} # remove any <release> tags from public xml which have full history
|
46
|
-
im.root.add_child(release_xml)
|
36
|
+
im.root.add_child(release_xml)
|
47
37
|
|
48
38
|
pub.add_child(im.root) # add in modified identityMetadata datastream
|
49
39
|
pub.add_child(self.datastreams['contentMetadata'].public_xml.root.clone)
|
@@ -53,7 +43,8 @@ module Dor
|
|
53
43
|
pub.add_child(rels.clone) unless rels.nil? # TODO: Should never be nil in practice; working around an ActiveFedora quirk for testing
|
54
44
|
pub.add_child(self.generate_dublin_core.root.clone)
|
55
45
|
@public_xml_doc = pub # save this for possible IIIF Presentation manifest
|
56
|
-
pub.add_child(Nokogiri(self.generate_release_xml).root.clone)
|
46
|
+
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
|
47
|
+
#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
|
57
48
|
new_pub = Nokogiri::XML(pub.to_xml) { |x| x.noblanks }
|
58
49
|
new_pub.encoding = 'UTF-8'
|
59
50
|
new_pub.to_xml
|
@@ -89,4 +80,4 @@ module Dor
|
|
89
80
|
end
|
90
81
|
end
|
91
82
|
|
92
|
-
end
|
83
|
+
end
|
@@ -2,21 +2,43 @@ require 'open-uri'
|
|
2
2
|
require 'retries'
|
3
3
|
|
4
4
|
module Dor
|
5
|
-
module
|
5
|
+
module Releaseable
|
6
6
|
extend ActiveSupport::Concern
|
7
7
|
include Itemizable
|
8
|
+
|
9
|
+
#Add release tags to an item and initialize the item release workflow
|
10
|
+
#
|
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}
|
12
|
+
#
|
13
|
+
#@raise [ArgumentError] Raised if the tags are improperly supplied
|
14
|
+
#
|
15
|
+
#
|
16
|
+
def add_release_nodes_and_start_releaseWF(release_tags)
|
17
|
+
release_tags = [release_tags] unless release_tags.class == Array
|
18
|
+
|
19
|
+
#Add in each tag
|
20
|
+
release_tags.each do |r_tag|
|
21
|
+
self.add_release_node(r_tag[:release],r_tag)
|
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')
|
29
|
+
end
|
8
30
|
|
9
|
-
#Generate XML structure for inclusion to Purl
|
31
|
+
#Generate XML structure for inclusion to Purl
|
10
32
|
#
|
11
33
|
#@return [String] The XML release node as a string, with ReleaseDigest as the root document
|
12
34
|
def generate_release_xml
|
13
35
|
builder = Nokogiri::XML::Builder.new do |xml|
|
14
|
-
xml.
|
36
|
+
xml.releaseData {
|
15
37
|
self.released_for.each do |project,released_value|
|
16
38
|
xml.release(released_value["release"],:to=>project)
|
17
39
|
end
|
18
|
-
}
|
19
|
-
|
40
|
+
}
|
41
|
+
end
|
20
42
|
return builder.to_xml
|
21
43
|
end
|
22
44
|
|
@@ -91,7 +113,7 @@ module Dor
|
|
91
113
|
#@return [Hash] the combined hash with uniquiness enforced
|
92
114
|
def combine_two_release_tag_hashes(hash_one, hash_two)
|
93
115
|
hash_two.keys.each do |key|
|
94
|
-
hash_one[key] = hash_two[key] if hash_one[key]
|
116
|
+
hash_one[key] = hash_two[key] if hash_one[key] == nil
|
95
117
|
hash_one[key] = (hash_one[key] + hash_two[key]).uniq if hash_one[key] != nil
|
96
118
|
end
|
97
119
|
return hash_one
|
@@ -161,9 +183,9 @@ module Dor
|
|
161
183
|
#@return [Boolean] true or false if it applies (not true or false if it is released, that is the release_tag data)
|
162
184
|
def does_release_tag_apply(release_tag, admin_tags=false)
|
163
185
|
#Is the tag global or restricted
|
164
|
-
return true if release_tag['tag']
|
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
|
165
187
|
|
166
|
-
admin_tags = self.tags
|
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
|
167
189
|
return admin_tags.include?(release_tag['tag'])
|
168
190
|
end
|
169
191
|
|
@@ -256,17 +278,24 @@ module Dor
|
|
256
278
|
#
|
257
279
|
#@return [Nokogiri::XML::Element] the tag added if successful
|
258
280
|
#
|
259
|
-
#@raise [
|
281
|
+
#@raise [ArgumentError] Raised if attributes are improperly supplied
|
260
282
|
#
|
261
283
|
#@params tag [Boolean] True or false for the release node
|
262
284
|
#@params attrs [hash] A hash of any attributes to be placed onto the tag
|
285
|
+
#Timestamp will be calculated by the function, if no displayType is passed in, it will default to file
|
286
|
+
#
|
263
287
|
#@example
|
264
|
-
# item.add_tag(true,:release,{:tag=>'Fitch : Batch2',:what=>'self',:to=>'Searchworks',:who=>'petucket'})
|
288
|
+
# item.add_tag(true,:release,{:tag=>'Fitch : Batch2',:what=>'self',:to=>'Searchworks',:who=>'petucket', :displayType='filmstrip'})
|
265
289
|
def add_release_node(release, attrs={})
|
266
290
|
identity_metadata_ds = self.identityMetadata
|
267
|
-
attrs[:when] = Time.now.utc.iso8601 if attrs[:when]
|
291
|
+
attrs[:when] = Time.now.utc.iso8601 if attrs[:when].nil? #add the timestamp
|
292
|
+
attrs[:displayType] = 'file' if attrs[:displayType].nil? #default to file is no display type is passed
|
268
293
|
valid_release_attributes(release, attrs)
|
269
294
|
|
295
|
+
#Remove the old displayType and then add the one for this tag
|
296
|
+
remove_displayTypes
|
297
|
+
identity_metadata_ds.add_value(:displayType, attrs[:displayType], {})
|
298
|
+
|
270
299
|
return identity_metadata_ds.add_value(:release, release.to_s, attrs)
|
271
300
|
end
|
272
301
|
|
@@ -282,15 +311,15 @@ module Dor
|
|
282
311
|
[:who, :to, :what].each do |check_attr|
|
283
312
|
raise ArgumentError, "#{check_attr} not supplied as a String" if attrs[check_attr].class != String
|
284
313
|
end
|
285
|
-
|
314
|
+
|
286
315
|
what_correct = false
|
287
316
|
['self', 'collection'].each do |allowed_what_value|
|
288
317
|
what_correct = true if attrs[:what] == allowed_what_value
|
289
318
|
end
|
290
319
|
raise ArgumentError, ":what must be self or collection" if ! what_correct
|
291
|
-
|
292
320
|
raise ArgumentError, "the value set for this tag is not a boolean" if !!tag != tag
|
293
|
-
|
321
|
+
raise ArgumentError, ":displayType must be passed in as a String" unless attrs[:displayType].class == String
|
322
|
+
|
294
323
|
validate_tag_format(attrs[:tag]) if attrs[:tag] != nil #Will Raise exception if invalid tag
|
295
324
|
return true
|
296
325
|
end
|
@@ -387,10 +416,25 @@ module Dor
|
|
387
416
|
tags_currently_in_purl = self.get_release_tags_from_purl
|
388
417
|
missing_tags = tags_currently_in_purl.map(&:downcase) - new_tags.keys.map(&:downcase)
|
389
418
|
missing_tags.each do |missing_tag|
|
390
|
-
new_tags[missing_tag.capitalize] = false
|
419
|
+
new_tags[missing_tag.capitalize] = {"release"=>false}
|
391
420
|
end
|
392
421
|
return new_tags
|
393
422
|
end
|
394
423
|
|
424
|
+
def to_solr(solr_doc=Hash.new, *args)
|
425
|
+
super(solr_doc, *args)
|
426
|
+
|
427
|
+
#TODO: sort of worried about the performance impact in bulk reindex
|
428
|
+
# situations, since released_for recurses all parent collections. jmartin 2015-07-14
|
429
|
+
released_for().each { |key, val|
|
430
|
+
add_solr_value(solr_doc, "released_to", key, :symbol, []) if val
|
431
|
+
}
|
432
|
+
|
433
|
+
#TODO: need to solrize whether item is released to purl? does released_for
|
434
|
+
# return that? logic is: "True when there is a published lifecycle and Access
|
435
|
+
# Rights is anything but Dark"
|
436
|
+
|
437
|
+
return solr_doc
|
438
|
+
end
|
395
439
|
end
|
396
440
|
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Dor
|
2
|
+
module Rightsable
|
3
|
+
extend ActiveSupport::Concern
|
4
|
+
|
5
|
+
included do
|
6
|
+
has_metadata :name => 'rightsMetadata', :type => Dor::RightsMetadataDS, :label => 'Rights metadata'
|
7
|
+
end
|
8
|
+
|
9
|
+
def build_rightsMetadata_datastream(ds)
|
10
|
+
content_ds = self.admin_policy_object.datastreams['defaultObjectRights']
|
11
|
+
ds.dsLabel = 'Rights Metadata'
|
12
|
+
ds.ng_xml = content_ds.ng_xml.clone
|
13
|
+
ds.content = ds.ng_xml.to_xml
|
14
|
+
end
|
15
|
+
|
16
|
+
def world_doc
|
17
|
+
return Nokogiri::XML::Builder.new do |xml|
|
18
|
+
xml.access(:type => 'read') {
|
19
|
+
xml.machine { xml.world }
|
20
|
+
}
|
21
|
+
end.doc
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
@@ -1,8 +1,9 @@
|
|
1
|
+
require 'dor/utils/sdr_client'
|
2
|
+
|
1
3
|
module Dor
|
2
4
|
module Versionable
|
3
5
|
extend ActiveSupport::Concern
|
4
|
-
include Processable
|
5
|
-
include Upgradable
|
6
|
+
include Processable # implies Upgradable
|
6
7
|
|
7
8
|
included do
|
8
9
|
has_metadata :name => 'versionMetadata', :type => Dor::VersionMetadataDS, :label => 'Version Metadata', :autocreate => true
|
@@ -24,8 +25,10 @@ module Dor
|
|
24
25
|
raise Dor::Exception, 'Object already opened for versioning' if(new_version_open?)
|
25
26
|
raise Dor::Exception, 'Object currently being accessioned' if(Dor::WorkflowService.get_active_lifecycle('dor', pid, 'submitted'))
|
26
27
|
|
28
|
+
sdr_version = Sdr::Client.current_version pid
|
29
|
+
|
27
30
|
vmd_ds = datastreams['versionMetadata']
|
28
|
-
vmd_ds.
|
31
|
+
vmd_ds.sync_then_increment_version sdr_version
|
29
32
|
vmd_ds.content = vmd_ds.ng_xml.to_s
|
30
33
|
vmd_ds.save unless self.new_object?
|
31
34
|
|
@@ -12,7 +12,7 @@ module Dor
|
|
12
12
|
has_metadata :name => "workflowDefinition", :type => Dor::WorkflowDefinitionDs, :label => 'Workflow Definition'
|
13
13
|
|
14
14
|
def self.find_by_name(name, opts={})
|
15
|
-
Dor.find_all(%{#{Solrizer.solr_name "objectType", :
|
15
|
+
Dor.find_all(%{#{Solrizer.solr_name "objectType", :symbol}:"#{self.object_type}" #{Solrizer.solr_name "workflow_name", :symbol}:"#{name}"}, opts).first
|
16
16
|
end
|
17
17
|
|
18
18
|
# Searches for the workflow definition object in DOR, then
|
@@ -51,7 +51,7 @@ module Dor
|
|
51
51
|
client = Dor::WorkflowService.workflow_resource
|
52
52
|
xml = client["workflow_archive?repository=#{definition.repo}&workflow=#{definition.name}&count-only=true"].get
|
53
53
|
count = Nokogiri::XML(xml).at_xpath('/objects/@count').value
|
54
|
-
|
54
|
+
solr_doc["#{definition.name}_archived_isi"] = count
|
55
55
|
solr_doc
|
56
56
|
end
|
57
57
|
|
@@ -62,7 +62,7 @@ module Dor
|
|
62
62
|
alias_method :generate_intial_workflow, :generate_initial_workflow
|
63
63
|
|
64
64
|
# Searches DOR for the workflow definition object. It then caches the workflow repository and xml
|
65
|
-
# @param [String]
|
65
|
+
# @param [String] name the name of the workflow
|
66
66
|
def self.find_and_cache_workflow_xml_and_repo name
|
67
67
|
wobj = self.find_by_name(name)
|
68
68
|
wf_xml = wobj.generate_initial_workflow
|
@@ -71,4 +71,4 @@ module Dor
|
|
71
71
|
end
|
72
72
|
|
73
73
|
end
|
74
|
-
end
|
74
|
+
end
|
@@ -43,8 +43,7 @@ module Dor
|
|
43
43
|
end
|
44
44
|
|
45
45
|
|
46
|
-
# @param [String]
|
47
|
-
# @param [String] base The base directory to delete from
|
46
|
+
# @param [String] base_druid_tree The base directory to delete from
|
48
47
|
# @param [Integer] last_version The last version that the data should be removed until version 1
|
49
48
|
# @return [void] prepares a list of reset directories that should be removed
|
50
49
|
def self.get_reset_dir_list(last_version, base_druid_tree)
|
@@ -61,7 +61,7 @@ module Dor
|
|
61
61
|
end
|
62
62
|
|
63
63
|
def self.cleanup_stacks(druid)
|
64
|
-
DruidTools::StacksDruid.new(druid, Config.stacks.
|
64
|
+
DruidTools::StacksDruid.new(druid, Config.stacks.local_stacks_root).prune!
|
65
65
|
end
|
66
66
|
|
67
67
|
def self.cleanup_purl_doc_cache(druid)
|