dor-services 4.22.1 → 4.22.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 +8 -8
- data/lib/dor/models/describable.rb +2 -0
- data/lib/dor/models/presentable.rb +4 -3
- data/lib/dor/models/publishable.rb +1 -0
- data/lib/dor/models/workflow_object.rb +10 -11
- data/lib/dor/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
!binary "U0hBMQ==":
|
|
3
3
|
metadata.gz: !binary |-
|
|
4
|
-
|
|
4
|
+
NDYxZTA5OWZlY2Y4ZGE5ZjM2NzY5NTgwYjk2YzRmZTNkYjYwNGY5Ng==
|
|
5
5
|
data.tar.gz: !binary |-
|
|
6
|
-
|
|
6
|
+
MWNiNTFmZTMzYjJjOTExNDhiNTJkODI4OTg3NDNmZDAzMDMwYzUxZQ==
|
|
7
7
|
SHA512:
|
|
8
8
|
metadata.gz: !binary |-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
NjZlZWJkYzUwMTEyNmVhNDg5YjNiMzVlYTE2MThiYzNjYTVkM2RkMDU4ZWFh
|
|
10
|
+
OTFiZDcxZjA5NDU5Y2JlYTc3Y2IxMzg1ZGY1OWZmM2ZiYzFhNTgwYzMxOWM1
|
|
11
|
+
ZGNhNWRiMGQyNjI5MDE4Mzk1NWVlYmQ3NDdhODA4YWUwNzg2MWI=
|
|
12
12
|
data.tar.gz: !binary |-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
YzlkNWU5ODMyYjZlMzg2M2IzYTFiMThlOGQ4OWY0OTE4NmI2MDIzNTVkNDcx
|
|
14
|
+
NTMwMjViM2Q4OTA3N2FjNTEyNmE1MDMxMTg0Njg5MjYzMjZkODk5MTY4ZDQ4
|
|
15
|
+
YjMxOTUxN2VlNjRmYWM5YzI5NmNkZTJkYzQ1MDY2YWFiNzE5Mzc=
|
|
@@ -63,6 +63,7 @@ module Dor
|
|
|
63
63
|
add_metadata 'Contributor', '//oai_dc:dc/dc:contributor', metadata, pub_obj_doc
|
|
64
64
|
add_metadata 'Publisher', '//oai_dc:dc/dc:publisher', metadata, pub_obj_doc
|
|
65
65
|
add_metadata 'Date', '//oai_dc:dc/dc:date', metadata, pub_obj_doc
|
|
66
|
+
add_metadata 'PublishVersion', '/publicObject/@publishVersion', metadata, pub_obj_doc
|
|
66
67
|
|
|
67
68
|
# Save off the first dc:description without displayLabel
|
|
68
69
|
if(desc = pub_obj_doc.at_xpath('//oai_dc:dc/dc:description[not(@displayLabel)]', DC_NS))
|
|
@@ -81,9 +82,9 @@ module Dor
|
|
|
81
82
|
count = 0
|
|
82
83
|
pub_obj_doc.xpath('/publicObject/contentMetadata/resource[@type="image" or @type="page"]').each do |res_node|
|
|
83
84
|
count += 1
|
|
84
|
-
img_file_name = res_node.at_xpath('file/@id').text.split('.').first
|
|
85
|
-
height = res_node.at_xpath('file/imageData/@height').text.to_i
|
|
86
|
-
width = res_node.at_xpath('file/imageData/@width').text.to_i
|
|
85
|
+
img_file_name = res_node.at_xpath('file[@mimetype="image/jp2"]/@id').text.split('.').first
|
|
86
|
+
height = res_node.at_xpath('file[@mimetype="image/jp2"]/imageData/@height').text.to_i
|
|
87
|
+
width = res_node.at_xpath('file[@mimetype="image/jp2"]/imageData/@width').text.to_i
|
|
87
88
|
stacks_uri = "#{Dor::Config.stacks.url}/image/iiif/#{id}%2F#{img_file_name}"
|
|
88
89
|
|
|
89
90
|
canv = IIIF::Presentation::Canvas.new
|
|
@@ -39,6 +39,7 @@ module Dor
|
|
|
39
39
|
pub = Nokogiri::XML("<publicObject/>").root
|
|
40
40
|
pub['id'] = pid
|
|
41
41
|
pub['published'] = Time.now.xmlschema
|
|
42
|
+
pub['publishVersion'] = 'dor-services/' + Dor::VERSION
|
|
42
43
|
release_xml=Nokogiri(self.generate_release_xml).xpath('//release')
|
|
43
44
|
|
|
44
45
|
im=self.datastreams['identityMetadata'].ng_xml.clone
|
|
@@ -5,13 +5,13 @@ module Dor
|
|
|
5
5
|
include Identifiable
|
|
6
6
|
include SolrDocHelper
|
|
7
7
|
include Governable
|
|
8
|
-
@@xml_cache
|
|
8
|
+
@@xml_cache = {}
|
|
9
9
|
@@repo_cache = {}
|
|
10
10
|
|
|
11
11
|
has_object_type 'workflow'
|
|
12
12
|
has_metadata :name => "workflowDefinition", :type => Dor::WorkflowDefinitionDs, :label => 'Workflow Definition'
|
|
13
13
|
|
|
14
|
-
def self.find_by_name(name, opts={})
|
|
14
|
+
def self.find_by_name(name, opts = {})
|
|
15
15
|
Dor.find_all(%{objectType_t:"#{self.object_type}" workflow_name_s:"#{name}"}, opts).first
|
|
16
16
|
end
|
|
17
17
|
|
|
@@ -21,8 +21,7 @@ module Dor
|
|
|
21
21
|
# @param [String] name the name of the workflow
|
|
22
22
|
# @return [String] the initial workflow xml
|
|
23
23
|
def self.initial_workflow(name)
|
|
24
|
-
return @@xml_cache[name] if
|
|
25
|
-
|
|
24
|
+
return @@xml_cache[name] if @@xml_cache.include?(name)
|
|
26
25
|
self.find_and_cache_workflow_xml_and_repo name
|
|
27
26
|
@@xml_cache[name]
|
|
28
27
|
end
|
|
@@ -32,8 +31,7 @@ module Dor
|
|
|
32
31
|
# @param [String] name the name of the workflow
|
|
33
32
|
# @return [String] the initial workflow xml
|
|
34
33
|
def self.initial_repo(name)
|
|
35
|
-
return @@repo_cache[name] if
|
|
36
|
-
|
|
34
|
+
return @@repo_cache[name] if @@repo_cache.include?(name)
|
|
37
35
|
self.find_and_cache_workflow_xml_and_repo name
|
|
38
36
|
@@repo_cache[name]
|
|
39
37
|
end
|
|
@@ -42,16 +40,16 @@ module Dor
|
|
|
42
40
|
datastreams['workflowDefinition']
|
|
43
41
|
end
|
|
44
42
|
|
|
45
|
-
def graph
|
|
43
|
+
def graph(*args)
|
|
46
44
|
self.definition.graph *args
|
|
47
45
|
end
|
|
48
46
|
|
|
49
|
-
def to_solr
|
|
47
|
+
def to_solr(solr_doc = {}, *args)
|
|
50
48
|
super solr_doc, *args
|
|
51
49
|
client = Dor::WorkflowService.workflow_resource
|
|
52
50
|
xml = client["workflow_archive?repository=#{definition.repo}&workflow=#{definition.name}&count-only=true"].get
|
|
53
51
|
count = Nokogiri::XML(xml).at_xpath('/objects/@count').value
|
|
54
|
-
add_solr_value(solr_doc,"#{definition.name}_archived",count
|
|
52
|
+
add_solr_value(solr_doc, "#{definition.name}_archived", count, :integer, [:displayable])
|
|
55
53
|
solr_doc
|
|
56
54
|
end
|
|
57
55
|
|
|
@@ -63,12 +61,13 @@ module Dor
|
|
|
63
61
|
|
|
64
62
|
# Searches DOR for the workflow definition object. It then caches the workflow repository and xml
|
|
65
63
|
# @param [String] name the name of the workflow
|
|
64
|
+
# @return [Object] a Dor::xxxx object, e.g. a Dor::Item object
|
|
66
65
|
def self.find_and_cache_workflow_xml_and_repo(name)
|
|
67
66
|
wobj = find_by_name(name)
|
|
68
67
|
raise "Failed to find workflow via find_by_name('#{name}')" if wobj.nil?
|
|
69
|
-
wf_xml = wobj.generate_initial_workflow
|
|
70
68
|
@@repo_cache[name] = wobj.definition.repo
|
|
71
|
-
@@xml_cache[name]
|
|
69
|
+
@@xml_cache[name] = wobj.generate_initial_workflow
|
|
70
|
+
wobj
|
|
72
71
|
end
|
|
73
72
|
|
|
74
73
|
end
|
data/lib/dor/version.rb
CHANGED
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.
|
|
4
|
+
version: 4.22.2
|
|
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-
|
|
15
|
+
date: 2015-09-30 00:00:00.000000000 Z
|
|
16
16
|
dependencies:
|
|
17
17
|
- !ruby/object:Gem::Dependency
|
|
18
18
|
name: active-fedora
|