dor-services 4.6.8 → 4.7.0
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/config/dev_console_env.rb +0 -1
- data/config/dev_console_env.rb.example +0 -1
- data/lib/dor/services/cleanup_service.rb +42 -0
- data/lib/dor/version.rb +1 -1
- metadata +10 -4
data/config/dev_console_env.rb
CHANGED
@@ -18,6 +18,24 @@ module Dor
|
|
18
18
|
cleanup_export(druid)
|
19
19
|
end
|
20
20
|
|
21
|
+
# Tries to remove any exsitence of the object in our systems
|
22
|
+
# Does the following:
|
23
|
+
# - Removes item from Dor/Fedora/Solr
|
24
|
+
# - Removes content from dor workspace
|
25
|
+
# - Removes content from assembly workspace
|
26
|
+
# - Removes content from sdr export area
|
27
|
+
# - Removes content from stacks
|
28
|
+
# - Removes content from purl
|
29
|
+
# - Removes active workflows
|
30
|
+
# @param [String] druid id of the object you wish to remove
|
31
|
+
def self.nuke!(druid)
|
32
|
+
cleanup_by_druid druid
|
33
|
+
cleanup_stacks druid
|
34
|
+
cleanup_purl_doc_cache druid
|
35
|
+
remove_active_workflows druid
|
36
|
+
delete_from_dor druid
|
37
|
+
end
|
38
|
+
|
21
39
|
# @param [String] druid The identifier for the object whose data is to be removed
|
22
40
|
# @param [String] base The base directory to delete from
|
23
41
|
# @return [void] remove the object's data files from the workspace area
|
@@ -42,6 +60,30 @@ module Dor
|
|
42
60
|
pathname.rmtree if pathname.exist?
|
43
61
|
end
|
44
62
|
|
63
|
+
def self.cleanup_stacks(druid)
|
64
|
+
DruidTools::StacksDruid.new(druid, Config.stacks.local_storage_root).prune!
|
65
|
+
end
|
66
|
+
|
67
|
+
def self.cleanup_purl_doc_cache(druid)
|
68
|
+
DruidTools::PurlDruid.new(druid, Config.stacks.local_document_cache_root).prune!
|
69
|
+
end
|
70
|
+
|
71
|
+
def self.remove_active_workflows(druid)
|
72
|
+
%w(dor sdr).each do |repo|
|
73
|
+
dor_wfs = Dor::WorkflowService.get_workflows(druid, repo)
|
74
|
+
dor_wfs.each { |wf| Dor::WorkflowService.delete_workflow(repo, druid, wf) }
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
# Delete an object from DOR.
|
79
|
+
#
|
80
|
+
# @param [string] pid the druid
|
81
|
+
def self.delete_from_dor(pid)
|
82
|
+
Dor::Config.fedora.client["objects/#{pid}"].delete
|
83
|
+
Dor::SearchService.solr.delete_by_id(pid)
|
84
|
+
Dor::SearchService.solr.commit
|
85
|
+
end
|
86
|
+
|
45
87
|
end
|
46
88
|
|
47
89
|
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.
|
4
|
+
version: 4.7.0
|
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-
|
16
|
+
date: 2014-06-06 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.
|
345
|
+
version: '1.7'
|
346
|
+
- - ! '>='
|
347
|
+
- !ruby/object:Gem::Version
|
348
|
+
version: 1.7.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.
|
356
|
+
version: '1.7'
|
357
|
+
- - ! '>='
|
358
|
+
- !ruby/object:Gem::Version
|
359
|
+
version: 1.7.1
|
354
360
|
- !ruby/object:Gem::Dependency
|
355
361
|
name: druid-tools
|
356
362
|
requirement: !ruby/object:Gem::Requirement
|