dor-services 4.13.1 → 4.13.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.
- data/lib/dor/models/versionable.rb +12 -4
- data/lib/dor/version.rb +1 -1
- metadata +2 -2
@@ -12,6 +12,7 @@ module Dor
|
|
12
12
|
# @param [Hash] opts optional params
|
13
13
|
# @option opts [Boolean] :assume_accessioned If true, does not check whether object has been accessioned.
|
14
14
|
# @option opts [Boolean] :create_workflows_ds If false, initialize_workflow() will not initialize the workflows datastream.
|
15
|
+
# @option opts [Hash] :vers_md_upd_info If present, used to add to the events datastream and set the desc and significance on the versionMetadata datastream
|
15
16
|
# @raise [Dor::Exception] if the object hasn't been accessioned, or if a version is already opened
|
16
17
|
def open_new_version(opts = {})
|
17
18
|
# During local development, we need a way to open a new version
|
@@ -24,10 +25,10 @@ module Dor
|
|
24
25
|
raise Dor::Exception, 'Object currently being accessioned' if(Dor::WorkflowService.get_active_lifecycle('dor', pid, 'submitted'))
|
25
26
|
|
26
27
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
28
|
+
vmd_ds = datastreams['versionMetadata']
|
29
|
+
vmd_ds.increment_version
|
30
|
+
vmd_ds.content = vmd_ds.ng_xml.to_s
|
31
|
+
vmd_ds.save unless self.new_object?
|
31
32
|
|
32
33
|
k = :create_workflows_ds
|
33
34
|
if opts.has_key?(k)
|
@@ -37,6 +38,13 @@ module Dor
|
|
37
38
|
else
|
38
39
|
initialize_workflow('versioningWF')
|
39
40
|
end
|
41
|
+
|
42
|
+
vmd_upd_info = opts[:vers_md_upd_info]
|
43
|
+
if vmd_upd_info
|
44
|
+
datastreams['events'].add_event("open", vmd_upd_info[:opening_user_name], "Version #{vmd_ds.current_version_id.to_s} opened")
|
45
|
+
vmd_ds.update_current_version({:description => vmd_upd_info[:description], :significance => vmd_upd_info[:significance].to_sym})
|
46
|
+
save
|
47
|
+
end
|
40
48
|
end
|
41
49
|
|
42
50
|
def current_version
|
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.13.
|
4
|
+
version: 4.13.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ authors:
|
|
13
13
|
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
|
-
date: 2014-
|
16
|
+
date: 2014-09-12 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: active-fedora
|