Class: Robots::SdrRepo::SdrIngest::RegisterSdr

Inherits:
Robots::SdrRepo::SdrRobot show all
Defined in:
lib/sdr_ingest/register_sdr.rb

Overview

A robot for creating Sedora objects and workflow datastreams unless they exist

Instance Method Summary collapse

Methods inherited from Robots::SdrRepo::SdrRobot

#create_workflow_rows, #get_workflow_status, #get_workflow_xml, #process_item, #transmit, #update_workflow_error_status, #update_workflow_status

Constructor Details

#initialize(opts = {}) ⇒ RegisterSdr

set workflow name, step name, log location, log severity level


16
17
18
# File 'lib/sdr_ingest/register_sdr.rb', line 16

def initialize(opts = {})
  super(self.class.workflow_name, self.class.step_name, opts)
end

Instance Method Details

#perform(druid) ⇒ void


23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/sdr_ingest/register_sdr.rb', line 23

def perform(druid)
  LyberCore::Log.debug("( #{__FILE__} : #{__LINE__} ) Enter perform")
  druid=druid
  accession_status = get_workflow_status('dor', druid, 'accessionWF', 'sdr-ingest-transfer')
  unless accession_status == 'completed'
    raise ItemError.new("accessionWF:sdr-ingest-transfer status is #{accession_status}")
  end
  # Create a step (table row) in the current workflow instance for robots not yet in workflow template
  if self.class.workflow_name ==  'sdrIngestWF'
    opts = {:lane_id => 'default'}
    # TODO: Fedora update for /config/workflows/sdrIngestWF/workflowDefinition.xml
    #update_workflow_status('sdr', druid, 'sdrIngestWF', 'update-catalog', 'waiting', 0, opts)
    #update_workflow_status('sdr', druid, 'sdrIngestWF', 'create-replica', 'waiting', 0, opts)
    #update_workflow_status('sdr', druid, 'sdrIngestWF', 'ingest-cleanup', 'waiting', 0, opts)
  end
end

#verification_files(druid) ⇒ Object


45
46
47
48
# File 'lib/sdr_ingest/register_sdr.rb', line 45

def verification_files(druid)
  files = []
  files
end

#verification_queries(druid) ⇒ Object


40
41
42
43
# File 'lib/sdr_ingest/register_sdr.rb', line 40

def verification_queries(druid)
  queries = []
  queries
end