dor-services 4.6.6.1 → 4.6.6.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,6 +6,7 @@ module Dor
6
6
  set_terminology do |t|
7
7
  t.root :path => 'contentMetadata', :index_as => [:not_searchable]
8
8
  t.contentType :path => '/contentMetadata/@type', :index_as => [:not_searchable]
9
+ t.stacks :path=> '/contentMetadata/@stacks', :index_as => [:not_searchable]
9
10
  t.resource(:index_as => [:not_searchable]) do
10
11
  t.id_ :path => { :attribute => 'id' }
11
12
  t.sequence :path => { :attribute => 'sequence' }#, :data_type => :integer
@@ -9,8 +9,9 @@ module Dor
9
9
  def shelve
10
10
  # retrieve the differences between the current contentMetadata and the previously ingested version
11
11
  shelve_diff = get_shelve_diff
12
+ stacks_object_pathname = get_stacks_location
12
13
  # determine the location of the object's files in the stacks area
13
- stacks_druid = DruidTools::StacksDruid.new id, Config.stacks.local_stacks_root
14
+ stacks_druid = DruidTools::StacksDruid.new id, stacks_object_pathname
14
15
  stacks_object_pathname = Pathname(stacks_druid.path)
15
16
  # determine the location of the object's content files in the workspace area
16
17
  workspace_druid = DruidTools::Druid.new(id,Config.stacks.local_workspace_root)
@@ -41,6 +42,23 @@ module Dor
41
42
  content_pathname = Pathname(workspace_druid.find_filelist_parent('content', filelist))
42
43
  content_pathname
43
44
  end
44
-
45
+
46
+
47
+ # get the stack location based on the contentMetadata stacks attribute
48
+ # or using the default value from the config file if it doesn't exist
49
+ def get_stacks_location
50
+
51
+ contentMetadataDS = self.datastreams['contentMetadata']
52
+ unless contentMetadataDS.nil? or contentMetadataDS.stacks.length == 0
53
+ stacks_location = contentMetadataDS.stacks[0]
54
+ if stacks_location.start_with?"/" #Absolute stacks path
55
+ return stacks_location
56
+ else
57
+ raise "stacks attribute for item: "+self.id+ " contentMetadata should start with /. The current value is "+stacks_location
58
+ end
59
+ end
60
+ return Config.stacks.local_stacks_root #Default stacks
61
+
62
+ end
45
63
  end
46
64
  end
@@ -106,6 +106,7 @@ module Dor
106
106
  stacks_pathname.delete if (file_signature != moab_signature)
107
107
  end
108
108
  unless stacks_pathname.exist?
109
+ stacks_pathname.parent.mkpath
109
110
  FileUtils.cp workspace_pathname.to_s, stacks_pathname.to_s
110
111
  return true
111
112
  end
data/lib/dor/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Dor
2
- VERSION = '4.6.6.1'
2
+ VERSION = '4.6.6.2'
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.6.6.1
4
+ version: 4.6.6.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-06-10 00:00:00.000000000 Z
16
+ date: 2014-06-13 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: active-fedora
@@ -342,7 +342,10 @@ dependencies:
342
342
  requirements:
343
343
  - - ~>
344
344
  - !ruby/object:Gem::Version
345
- version: '1.5'
345
+ version: 1.5.0
346
+ - - ! '>='
347
+ - !ruby/object:Gem::Version
348
+ version: 1.5.1
346
349
  type: :runtime
347
350
  prerelease: false
348
351
  version_requirements: !ruby/object:Gem::Requirement
@@ -350,7 +353,10 @@ dependencies:
350
353
  requirements:
351
354
  - - ~>
352
355
  - !ruby/object:Gem::Version
353
- version: '1.5'
356
+ version: 1.5.0
357
+ - - ! '>='
358
+ - !ruby/object:Gem::Version
359
+ version: 1.5.1
354
360
  - !ruby/object:Gem::Dependency
355
361
  name: druid-tools
356
362
  requirement: !ruby/object:Gem::Requirement