moab-versioning 4.2.0 → 4.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/moab/bagger.rb +17 -19
- data/lib/moab/config.rb +5 -6
- data/lib/moab/deposit_bag_validator.rb +2 -4
- data/lib/moab/exceptions.rb +0 -5
- data/lib/moab/file_group.rb +13 -17
- data/lib/moab/file_group_difference.rb +15 -19
- data/lib/moab/file_group_difference_subset.rb +2 -4
- data/lib/moab/file_instance.rb +3 -8
- data/lib/moab/file_instance_difference.rb +2 -6
- data/lib/moab/file_inventory.rb +18 -22
- data/lib/moab/file_inventory_difference.rb +3 -7
- data/lib/moab/file_manifestation.rb +3 -6
- data/lib/moab/file_signature.rb +45 -33
- data/lib/moab/signature_catalog.rb +13 -16
- data/lib/moab/signature_catalog_entry.rb +3 -7
- data/lib/moab/storage_object.rb +28 -31
- data/lib/moab/storage_object_validator.rb +28 -70
- data/lib/moab/storage_object_version.rb +47 -50
- data/lib/moab/storage_repository.rb +17 -21
- data/lib/moab/storage_services.rb +12 -14
- data/lib/moab/utc_time.rb +18 -19
- data/lib/moab/verification_result.rb +26 -37
- data/lib/moab/version_metadata.rb +1 -5
- data/lib/moab/version_metadata_entry.rb +2 -6
- data/lib/moab/version_metadata_event.rb +2 -7
- data/lib/serializer/manifest.rb +6 -10
- data/lib/serializer/serializable.rb +23 -27
- data/lib/stanford/active_fedora_object.rb +0 -4
- data/lib/stanford/content_inventory.rb +49 -52
- data/lib/stanford/dor_metadata.rb +5 -8
- data/lib/stanford/storage_object_validator.rb +1 -2
- data/lib/stanford/storage_repository.rb +0 -4
- data/lib/stanford/storage_services.rb +6 -10
- metadata +2 -2
@@ -2,7 +2,6 @@ require 'moab/stanford'
|
|
2
2
|
require 'druid-tools'
|
3
3
|
|
4
4
|
module Stanford
|
5
|
-
|
6
5
|
# A class to represent the SDR repository store
|
7
6
|
#
|
8
7
|
# ====Data Model
|
@@ -11,7 +10,6 @@ module Stanford
|
|
11
10
|
# @note Copyright (c) 2012 by The Board of Trustees of the Leland Stanford Junior University.
|
12
11
|
# All rights reserved. See {file:LICENSE.rdoc} for details.
|
13
12
|
class StorageRepository < Moab::StorageRepository
|
14
|
-
|
15
13
|
# @param object_id [String] The identifier of the digital object
|
16
14
|
# @return [String] The branch segment of the object storage path
|
17
15
|
def storage_branch(object_id)
|
@@ -40,7 +38,5 @@ module Stanford
|
|
40
38
|
raise syntax_msg unless DruidTools::Druid.valid?(identifier, true)
|
41
39
|
DruidTools::Druid.new(identifier, true).tree.join(File::SEPARATOR)
|
42
40
|
end
|
43
|
-
|
44
41
|
end
|
45
|
-
|
46
42
|
end
|
@@ -1,10 +1,8 @@
|
|
1
1
|
require 'moab/stanford'
|
2
2
|
|
3
3
|
module Stanford
|
4
|
-
|
5
4
|
# An interface class to support access to SDR storage via a RESTful server
|
6
5
|
class StorageServices < Moab::StorageServices
|
7
|
-
|
8
6
|
# @return [StorageRepository] an instance of the interface to SDR storage
|
9
7
|
@@repository = Stanford::StorageRepository.new
|
10
8
|
|
@@ -15,7 +13,7 @@ module Stanford
|
|
15
13
|
# contentMetadata (all|preserve|publish|shelve)
|
16
14
|
# @param base_version [Integer] The ID of the version whose inventory is the basis of, if nil use latest version
|
17
15
|
# @return [FileInventoryDifference] The report of differences between the content metadata and the specified version
|
18
|
-
def self.compare_cm_to_version(new_content_metadata, object_id, subset, base_version=nil)
|
16
|
+
def self.compare_cm_to_version(new_content_metadata, object_id, subset, base_version = nil)
|
19
17
|
new_inventory = Stanford::ContentInventory.new.inventory_from_cm(new_content_metadata, object_id, subset)
|
20
18
|
begin
|
21
19
|
# ObjectNotFoundException is raised if the object does not exist in storage
|
@@ -26,7 +24,7 @@ module Stanford
|
|
26
24
|
rescue Moab::ObjectNotFoundException, Moab::FileNotFoundException
|
27
25
|
# Create a skeletal FileInventory object, containing no file entries
|
28
26
|
storage_object = Moab::StorageObject.new(object_id, 'dummy')
|
29
|
-
base_version = Moab::StorageObjectVersion.new(storage_object,0)
|
27
|
+
base_version = Moab::StorageObjectVersion.new(storage_object, 0)
|
30
28
|
base_inventory = base_version.file_inventory('version')
|
31
29
|
end
|
32
30
|
diff = Moab::FileInventoryDifference.new.compare(base_inventory, new_inventory)
|
@@ -39,7 +37,7 @@ module Stanford
|
|
39
37
|
# @param object_id [String] The digital object identifier of the object whose signature catalog is to be used
|
40
38
|
# @param version_id [Integer] The ID of the version whose signature catalog is to be used, if nil use latest version
|
41
39
|
# @return [FileInventory] The versionAddtions report showing which files are new or modified in the content metadata
|
42
|
-
def self.cm_version_additions(new_content_metadata, object_id, version_id=nil)
|
40
|
+
def self.cm_version_additions(new_content_metadata, object_id, version_id = nil)
|
43
41
|
new_inventory = Stanford::ContentInventory.new.inventory_from_cm(new_content_metadata, object_id, 'preserve')
|
44
42
|
begin
|
45
43
|
# ObjectNotFoundException is raised if the object does not exist in storage
|
@@ -48,7 +46,7 @@ module Stanford
|
|
48
46
|
signature_catalog = storage_object_version.signature_catalog
|
49
47
|
rescue Moab::ObjectNotFoundException
|
50
48
|
storage_object = Moab::StorageObject.new(object_id, 'dummy')
|
51
|
-
base_version = Moab::StorageObjectVersion.new(storage_object,0)
|
49
|
+
base_version = Moab::StorageObjectVersion.new(storage_object, 0)
|
52
50
|
signature_catalog = base_version.signature_catalog
|
53
51
|
end
|
54
52
|
signature_catalog.version_additions(new_inventory)
|
@@ -57,12 +55,10 @@ module Stanford
|
|
57
55
|
# @param object_id [String] The digital object identifier of the object whose contentMetadata is to be remediated
|
58
56
|
# @param version_id [Integer] The ID of the version whose file data is to be used, if nil use latest version
|
59
57
|
# @return [String] Returns a remediated copy of the contentMetadata with fixity data filled in
|
60
|
-
def self.cm_remediate(object_id, version_id=nil)
|
58
|
+
def self.cm_remediate(object_id, version_id = nil)
|
61
59
|
cm = self.retrieve_file('metadata', 'contentMetadata.xml', object_id, version_id)
|
62
60
|
group = self.retrieve_file_group('content', object_id, version_id)
|
63
|
-
Stanford::ContentInventory.new.remediate_content_metadata(cm,group)
|
61
|
+
Stanford::ContentInventory.new.remediate_content_metadata(cm, group)
|
64
62
|
end
|
65
|
-
|
66
63
|
end
|
67
|
-
|
68
64
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: moab-versioning
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.2.
|
4
|
+
version: 4.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Darren Weber
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2018-
|
14
|
+
date: 2018-04-10 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: confstruct
|