Class: Tasks::Sources::DocumentsPackagerController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Tasks::Sources::DocumentsPackagerController
- Includes:
- TaskControllerConfiguration, PackagerController
- Defined in:
- app/controllers/tasks/sources/documents_packager_controller.rb
Constant Summary
Constants included from PackagerController
PackagerController::DEFAULT_MAX_MB, PackagerController::MAX_MAX_MB, PackagerController::MIN_MAX_MB
Instance Method Summary collapse
-
#download ⇒ Object
POST /tasks/sources/documents_packager/download.
-
#index ⇒ Object
GET /tasks/sources/documents_packager.
- #packager ⇒ Object private
-
#preview ⇒ Object
POST /tasks/sources/documents_packager/preview.json.
- #set_query_params ⇒ Object private
Methods included from PackagerController
#build_zip_filename, #download_packager, #preview_packager, #requested_max_bytes
Methods included from TaskControllerConfiguration
Instance Method Details
#download ⇒ Object
POST /tasks/sources/documents_packager/download
20 21 22 23 24 25 26 27 |
# File 'app/controllers/tasks/sources/documents_packager_controller.rb', line 20 def download download_packager( packager: packager, group_index: params[:group].to_i, empty_message: 'No sources queued.', filename_prefix: 'TaxonWorks-sources_download' ) end |
#index ⇒ Object
GET /tasks/sources/documents_packager
8 9 |
# File 'app/controllers/tasks/sources/documents_packager_controller.rb', line 8 def index end |
#packager ⇒ Object (private)
37 38 39 40 41 42 |
# File 'app/controllers/tasks/sources/documents_packager_controller.rb', line 37 def packager @packager ||= Export::Packagers::Documents.new( query_params: @query_params, project_id: sessions_current_project_id ) end |
#preview ⇒ Object
POST /tasks/sources/documents_packager/preview.json
12 13 14 15 16 17 |
# File 'app/controllers/tasks/sources/documents_packager_controller.rb', line 12 def preview preview_packager( packager: packager, payload_key: :sources ) end |
#set_query_params ⇒ Object (private)
31 32 33 34 35 |
# File 'app/controllers/tasks/sources/documents_packager_controller.rb', line 31 def set_query_params raw = params[:source_id] ids = raw.is_a?(ActionController::Parameters) ? raw.values : Array.wrap(raw).compact @query_params = ids.any? ? { source_id: ids }.with_indifferent_access : {} end |