app/controllers/download_controller.rb in geoblacklight-1.9.1 vs app/controllers/download_controller.rb in geoblacklight-2.0.0
- old
+ new
@@ -1,7 +1,8 @@
class DownloadController < ApplicationController
- include Blacklight::SearchHelper
+ # include Blacklight::SearchHelper
+ include Blacklight::Catalog
rescue_from Geoblacklight::Exceptions::ExternalDownloadFailed do |exception|
Geoblacklight.logger.error exception.message + ' ' + exception.url
flash[:danger] = view_context
.content_tag(:span,
@@ -16,11 +17,11 @@
format.html { render json: flash, response: response }
end
end
def show
- @response, @document = fetch params[:id]
+ @response, @document = search_service.fetch params[:id]
restricted_should_authenticate
response = check_type
validate response
respond_to do |format|
format.json { render json: flash, response: response }
@@ -28,16 +29,16 @@
end
end
def file
# Grab the solr document to check if it should be public or not
- @response, @document = fetch(file_name_to_id(params[:id]))
+ @response, @document = search_service.fetch(file_name_to_id(params[:id]))
restricted_should_authenticate
send_file download_file_path_and_name, x_sendfile: true
end
def hgl
- @response, @document = fetch params[:id]
+ @response, @document = search_service.fetch params[:id]
if params[:email]
response = Geoblacklight::HglDownload.new(@document, params[:email]).get
if response.nil?
flash[:danger] = t 'geoblacklight.download.error'
else