Sha256: c4f7d7099d1d6afc71a2b346abdbe7299425668caef7529b567e4e647ef6a8e5

Contents?: true

Size: 1.46 KB

Versions: 15

Compression:

Stored size: 1.46 KB

Contents

class BatchController < ApplicationController
  include Hydra::Controller::ControllerBehavior
  include Hydra::Controller::UploadBehavior
  include Sufia::Noid # for normalize_identifier method
  layout "sufia-one-column"

  before_filter :has_access?
  prepend_before_filter :normalize_identifier, :only=>[:edit, :show, :update, :destroy]

  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

  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

  protected

  # override this method if you need to initialize more complex RDF assertions (b-nodes)
  def initialize_fields(file)
    file.initialize_fields
  end

  ActiveSupport::Deprecation.deprecate_methods(BatchController, :initialize_fields)
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
sufia-3.7.2 app/controllers/batch_controller.rb
sufia-3.7.1 app/controllers/batch_controller.rb
sufia-3.7.0 app/controllers/batch_controller.rb
sufia-3.6.1 app/controllers/batch_controller.rb
sufia-3.6.0 app/controllers/batch_controller.rb
sufia-3.5.0 app/controllers/batch_controller.rb
sufia-3.4.0 app/controllers/batch_controller.rb
sufia-3.4.0.rc4 app/controllers/batch_controller.rb
sufia-3.4.0.rc3 app/controllers/batch_controller.rb
sufia-3.3.1 app/controllers/batch_controller.rb
sufia-3.4.0.rc2 app/controllers/batch_controller.rb
sufia-3.4.0.rc1 app/controllers/batch_controller.rb
sufia-3.3.0 app/controllers/batch_controller.rb
sufia-3.2.1 app/controllers/batch_controller.rb
sufia-3.1.3 app/controllers/batch_controller.rb