Class: BulkArchivalObjectUpdaterController

Inherits:
ApplicationController show all
Defined in:
frontend/app/controllers/bulk_archival_object_updater_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#archivesspace, can_access?, permission_mappings, set_access_control

Instance Method Details

#downloadObject



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'frontend/app/controllers/bulk_archival_object_updater_controller.rb', line 9

def download
  uri = "/bulk_archival_object_updater/repositories/#{session[:repo_id]}/generate_spreadsheet"
  args = {
    'uri[]' => JSON.parse(params[:selected]),
    'resource_uri' => params[:resource],
    'min_subrecords' => params[:min_subrecords],
    'extra_subrecords' => params[:extra_subrecords],
    'min_notes' => params[:min_notes],
    'selected_columns[]' => params.to_unsafe_hash.map {|param, value|
      if param.to_s =~ /\Aupdate_select_(.*)/ && value == 'on'
        $1
      end
    }.compact
  }

  generate_spreadsheet(uri, args)
end

#download_formObject



4
5
6
7
# File 'frontend/app/controllers/bulk_archival_object_updater_controller.rb', line 4

def download_form
  @uri = params[:resource]
  @tree = escape_xml_characters(load_tree)
end