Batch Actions - OregonDigital/hyrax-migrator GitHub Wiki

# set the batchname
batchname = 'b1'

# ingest (note that for ingest, batchname can be an array of names)
b = Hyrax::Migrator::Services::BagIngestService.new(batchname)
b.ingest

# update, for now metadata only
middleware = {actor_stack: ['Hyrax::Migrator::Actors::CrosswalkMetadataActor', 'Hyrax::Migrator::Actors::UpdateWorkActor', 'Hyrax::Migrator::Actors::TerminalActor']}
b = Hyrax::Migrator::Services::BatchUpdateService.new(batchname, {middleware_config: middleware })
b.update

# write report after a batch ingest
b = Hyrax::Migrator::Services::BatchReporterService.new(batchname)
b.write_report

# For default list of verifiers, should be defined in the Hyrax::Migrator.config
b = Hyrax::Migrator::Services::BatchVerificationService.new(batchname)
b.verify

# For custom list of verifiers, eg LabelsExist only
b = Hyrax::Migrator::Services::BatchVerificationService.new(batchname, {verify_services: ['Hyrax::Migrator::Services::VerifyLabelsExistService']})
b.verify

# write report after running batch verification
b = Hyrax::Migrator::Services::BatchReporterService.new(batchname, {data_list:[:verification]})
b.write_report
# or
b.screen_report
⚠️ **GitHub.com Fallback** ⚠️