dor-services 6.1.1 → 6.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dor/datastreams/administrative_metadata_ds.rb +1 -1
- data/lib/dor/datastreams/identity_metadata_ds.rb +1 -1
- data/lib/dor/models/concerns/identifiable.rb +1 -1
- data/lib/dor/services/datastream_builder.rb +1 -1
- data/lib/dor/services/indexing_service.rb +1 -1
- data/lib/dor/services/public_desc_metadata_service.rb +1 -5
- data/lib/dor/services/registration_service.rb +9 -1
- data/lib/dor/services/sdr_ingest_service.rb +2 -2
- data/lib/dor/services/thumbnail_service.rb +1 -1
- data/lib/dor/services/version_service.rb +2 -2
- data/lib/dor/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e359d29da0952d875926e1ceec8e723725e8ca5df391e38c3ad1fe4543549941
|
4
|
+
data.tar.gz: 2c074e133cb69bab37024057414521d2be3b31ff4b9773bfb693bba7b25e13a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f0b239aaaca59b055c5b4792d271334d2e9e7b55b2c08e606465f14037a5cb40f2cd516e18cad4f7dbe8f4e76fbfb9bf06f2e7ee29ea6eb45869953b74e8492
|
7
|
+
data.tar.gz: 970cb2f715414d67c487fdf2ec2ff409ad55c4d73230c630d37724fa44b7ca6893c6007eaa3800d897f4ac3e4ce11b82e426514555c92cd9c1c7bd1672f459ec
|
@@ -161,7 +161,7 @@ module Dor
|
|
161
161
|
end
|
162
162
|
|
163
163
|
# set a single default workflow
|
164
|
-
# @param
|
164
|
+
# @param wf_name [String] the name of the workflow, ex. 'digitizationWF'
|
165
165
|
def default_workflow=(wf_name)
|
166
166
|
raise ArgumentError, 'Must have a valid workflow for default' if wf_name.blank?
|
167
167
|
|
@@ -43,7 +43,7 @@ module Dor
|
|
43
43
|
node ? [node['source'], node.text].join(':') : nil
|
44
44
|
end
|
45
45
|
|
46
|
-
# @param [String, Nil] value
|
46
|
+
# @param [String, Nil] value The value to set or a nil/empty string to delete sourceId node
|
47
47
|
# @return [String, Nil] The same value, as per Ruby convention for assignment operators
|
48
48
|
# @note The actual values assigned will have leading/trailing whitespace stripped.
|
49
49
|
def sourceId=(value)
|
@@ -62,7 +62,7 @@ module Dor
|
|
62
62
|
end
|
63
63
|
|
64
64
|
# Convenience method to set the catkey
|
65
|
-
# @param [String]
|
65
|
+
# @param [String] val the new source identifier
|
66
66
|
# @return [String] same value, as per Ruby assignment convention
|
67
67
|
def catkey=(val)
|
68
68
|
# if there was already a catkey in the record, store that in the "previous" spot (assuming there is no change)
|
@@ -40,6 +40,7 @@ module Dor
|
|
40
40
|
|
41
41
|
attr_reader :datastream, :force, :object, :required, :filename
|
42
42
|
|
43
|
+
# @return [String] datastream name (dsid)
|
43
44
|
def datastream_name
|
44
45
|
datastream.dsid
|
45
46
|
end
|
@@ -72,7 +73,6 @@ module Dor
|
|
72
73
|
end
|
73
74
|
|
74
75
|
# Tries to find a file for the datastream.
|
75
|
-
# @param [String] datastream name of a datastream
|
76
76
|
# @return [String, nil] path to datastream or nil
|
77
77
|
def find_metadata_file
|
78
78
|
druid = DruidTools::Druid.new(object.pid, Dor::Config.stacks.local_workspace_root)
|
@@ -39,7 +39,7 @@ module Dor
|
|
39
39
|
end
|
40
40
|
|
41
41
|
# Use the dor-indexing-app service to reindex a pid
|
42
|
-
# @param [String]
|
42
|
+
# @param [String] pid the druid
|
43
43
|
# @raise [ReindexError] on failure
|
44
44
|
def self.reindex_pid_remotely(pid)
|
45
45
|
pid = "druid:#{pid}" unless pid =~ /^druid:/
|
@@ -10,6 +10,7 @@ module Dor
|
|
10
10
|
@object = object
|
11
11
|
end
|
12
12
|
|
13
|
+
# @return [Nokogiri::XML::Document] A copy of the descriptiveMetadata of the object, to be modified
|
13
14
|
def doc
|
14
15
|
@doc ||= object.descMetadata.ng_xml.dup(NOKOGIRI_DEEP_COPY)
|
15
16
|
end
|
@@ -40,8 +41,6 @@ module Dor
|
|
40
41
|
end
|
41
42
|
|
42
43
|
# Create MODS accessCondition statements from rightsMetadata
|
43
|
-
# @param [Nokogiri::XML::Document] doc Document representing the descriptiveMetadata of the object
|
44
|
-
# @note this method modifies the passed in doc
|
45
44
|
def add_access_conditions!
|
46
45
|
# clear out any existing accessConditions
|
47
46
|
doc.xpath('//mods:accessCondition', 'mods' => 'http://www.loc.gov/mods/v3').each(&:remove)
|
@@ -80,7 +79,6 @@ module Dor
|
|
80
79
|
end
|
81
80
|
|
82
81
|
# expand constituent relations into relatedItem references -- see JUMBO-18
|
83
|
-
# @param [Nokogiri::XML] doc public MODS XML being built
|
84
82
|
# @return [Void]
|
85
83
|
def add_constituent_relations!
|
86
84
|
object.public_relationships.search('//rdf:RDF/rdf:Description/fedora:isConstituentOf',
|
@@ -116,9 +114,7 @@ module Dor
|
|
116
114
|
|
117
115
|
# Adds to desc metadata a relatedItem with information about the collection this object belongs to.
|
118
116
|
# For use in published mods and mods-to-DC conversion.
|
119
|
-
# @param [Nokogiri::XML::Document] doc A copy of the descriptiveMetadata of the object, to be modified
|
120
117
|
# @return [Void]
|
121
|
-
# @note this method modifies the passed in doc
|
122
118
|
def add_collection_reference!
|
123
119
|
collections = object.public_relationships.search('//rdf:RDF/rdf:Description/fedora:isMemberOfCollection',
|
124
120
|
'fedora' => 'info:fedora/fedora-system:def/relations-external#',
|
@@ -112,7 +112,7 @@ module Dor
|
|
112
112
|
workflow_priority = params[:workflow_priority] ? params[:workflow_priority].to_i : 0
|
113
113
|
|
114
114
|
seed_datastreams(Array(params[:seed_datastream]), new_item)
|
115
|
-
Array(params[:initiate_workflow])
|
115
|
+
initiate_workflow(workflows: Array(params[:initiate_workflow]), item: new_item, priority: workflow_priority)
|
116
116
|
|
117
117
|
new_item.class.ancestors.select { |x| x.respond_to?(:to_class_uri) && x != ActiveFedora::Base }.each do |parent_class|
|
118
118
|
new_item.add_relationship(:has_model, parent_class.to_class_uri)
|
@@ -179,6 +179,14 @@ module Dor
|
|
179
179
|
end
|
180
180
|
end
|
181
181
|
|
182
|
+
def initiate_workflow(workflows:, item:, priority:)
|
183
|
+
workflows.each do |workflow_id|
|
184
|
+
Dor::CreateWorkflowService.create_workflow(item, name: workflow_id,
|
185
|
+
create_ds: !item.new_record?,
|
186
|
+
priority: priority)
|
187
|
+
end
|
188
|
+
end
|
189
|
+
|
182
190
|
def build_desc_metadata_from_label(new_item, label)
|
183
191
|
builder = Nokogiri::XML::Builder.new do |xml|
|
184
192
|
xml.mods(Dor::DescMetadataDS::MODS_HEADER_CONFIG) do
|
@@ -7,7 +7,7 @@ module Dor
|
|
7
7
|
# as that is the only robot that uses it. See also preservable concern.
|
8
8
|
class SdrIngestService
|
9
9
|
# @param [Dor::Item] dor_item The representation of the digital object
|
10
|
-
# @param [String]
|
10
|
+
# @param [String] _agreement_id deprecated, included for backward compatability with common-accessoning
|
11
11
|
# @return [void] Create the Moab/bag manifests for new version, export data to BagIt bag, kick off the SDR preservation workflow
|
12
12
|
def self.transfer(dor_item, _agreement_id = nil)
|
13
13
|
druid = dor_item.pid
|
@@ -37,7 +37,7 @@ module Dor
|
|
37
37
|
bagger.create_tagfiles
|
38
38
|
verify_bag_structure(bag_dir)
|
39
39
|
# start SDR preservation workflow (but do not create the workflows datastream)
|
40
|
-
|
40
|
+
CreateWorkflowService.create_workflow(dor_item, name: 'preservationIngestWF', create_ds: false)
|
41
41
|
rescue Exception => e
|
42
42
|
raise Dor::Exception, "Error exporting new object version to bag: #{e.message}"
|
43
43
|
end
|
@@ -26,7 +26,7 @@ module Dor
|
|
26
26
|
{ image_type: 'external', finder: "/contentMetadata/resource[@type='page' or @type='image']/externalFile[#{MIME_TYPE_FINDER}]" }
|
27
27
|
].freeze
|
28
28
|
|
29
|
-
# @
|
29
|
+
# @param [Dor::Item] object
|
30
30
|
def initialize(object)
|
31
31
|
@object = object
|
32
32
|
end
|
@@ -37,9 +37,9 @@ module Dor
|
|
37
37
|
k = :create_workflows_ds
|
38
38
|
if opts.key?(k)
|
39
39
|
# During local development, Hydrus (or another app w/ local Fedora) does not want to initialize workflows datastream.
|
40
|
-
|
40
|
+
CreateWorkflowService.create_workflow(work, name: 'versioningWF', create_ds: opts[k])
|
41
41
|
else
|
42
|
-
|
42
|
+
CreateWorkflowService.create_workflow(work, name: 'versioningWF')
|
43
43
|
end
|
44
44
|
|
45
45
|
vmd_upd_info = opts[:vers_md_upd_info]
|
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: 6.1.
|
4
|
+
version: 6.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Klein
|
@@ -90,14 +90,14 @@ dependencies:
|
|
90
90
|
requirements:
|
91
91
|
- - "~>"
|
92
92
|
- !ruby/object:Gem::Version
|
93
|
-
version: 0.4
|
93
|
+
version: '0.4'
|
94
94
|
type: :runtime
|
95
95
|
prerelease: false
|
96
96
|
version_requirements: !ruby/object:Gem::Requirement
|
97
97
|
requirements:
|
98
98
|
- - "~>"
|
99
99
|
- !ruby/object:Gem::Version
|
100
|
-
version: 0.4
|
100
|
+
version: '0.4'
|
101
101
|
- !ruby/object:Gem::Dependency
|
102
102
|
name: equivalent-xml
|
103
103
|
requirement: !ruby/object:Gem::Requirement
|