Class: Dor::DeleteService

Inherits:
Object
  • Object
show all
Defined in:
lib/dor/services/delete_service.rb

Overview

Remove all traces of the object’s data files from the workspace and export areas

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(druid) ⇒ DeleteService

Returns a new instance of DeleteService.



20
21
22
# File 'lib/dor/services/delete_service.rb', line 20

def initialize(druid)
  @druid = druid
end

Class Method Details

.destroy(druid) ⇒ Object

Tries to remove any exsitence of the object in our systems

Does the following:
- Removes item from Fedora/Solr
- Removes content from dor workspace
- Removes content from assembly workspace
- Removes content from sdr export area
- Removes content from stacks
- Removes content from purl
- Removes active workflows

Parameters:

  • druid (String)

    id of the object you wish to remove



16
17
18
# File 'lib/dor/services/delete_service.rb', line 16

def self.destroy(druid)
  new(druid).destroy
end

Instance Method Details

#destroyObject



24
25
26
27
28
29
30
# File 'lib/dor/services/delete_service.rb', line 24

def destroy
  CleanupService.cleanup_by_druid druid
  cleanup_stacks
  cleanup_purl_doc_cache
  remove_active_workflows
  delete_from_dor
end