Class: Pageflow::Editor::FileImportController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Pageflow::Editor::FileImportController
- Defined in:
- app/controllers/pageflow/editor/file_import_controller.rb
Overview
This controller handles file import requests and pass them to appropriate file importer
Instance Method Summary collapse
Instance Method Details
#files_meta_data ⇒ Object
14 15 16 17 |
# File 'app/controllers/pageflow/editor/file_import_controller.rb', line 14 def result = file_importer. file_importer_credentials, selected_files render json: {data: result} end |
#search ⇒ Object
9 10 11 12 |
# File 'app/controllers/pageflow/editor/file_import_controller.rb', line 9 def search result = file_importer.search file_importer_credentials, search_query render json: {data: result} end |
#start_import_job ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'app/controllers/pageflow/editor/file_import_controller.rb', line 19 def start_import_job entry = DraftEntry.find(entry_name) result = [] selected_files.each do |key, file| file = key if file.nil? file = file.permit(:file_name, :rights, :content_type, :file_size, :url, configuration: :alt) entry_file, import_model = create_import_model entry, file FileImportJob.perform_later import_model.id, file_importer_credentials result.push file_response(entry_file, file) end render json: {data: result} end |