Class: BatchController

Inherits:
ApplicationController
  • Object
show all
Includes:
Hydra::Controller::ControllerBehavior, Hydra::Controller::UploadBehavior, Sufia::Noid
Defined in:
app/controllers/batch_controller.rb

Instance Method Summary collapse

Instance Method Details

#editObject



10
11
12
13
14
15
16
# File 'app/controllers/batch_controller.rb', line 10

def edit
  @batch =  Batch.find_or_create(params[:id])
  @generic_file = GenericFile.new
  @generic_file.creator = current_user.name
  @generic_file.title =  @batch.generic_files.map(&:label)
  @generic_file.initialize_fields
end

#updateObject



18
19
20
21
22
23
24
25
26
# File 'app/controllers/batch_controller.rb', line 18

def update
  authenticate_user!
  @batch =  Batch.find_or_create(params[:id])
  @batch.status="processing"
  @batch.save
  Sufia.queue.push(BatchUpdateJob.new(current_user.user_key, params))
  flash[:notice] = 'Your files are being processed by ' + t('sufia.product_name') + ' in the background. The metadata and access controls you specified are being applied. Files will be marked <span class="label label-important" title="Private">Private</span> until this process is complete (shouldn\'t take too long, hang in there!). You may need to refresh your dashboard to see these updates.'
  redirect_to sufia.dashboard_index_path
end