Sha256: 10949a14291cbb95457c8b5a6942509fec125793a3ba37f6c2e5a8c3a271cdbe

Contents?: true

Size: 831 Bytes

Versions: 4

Compression:

Stored size: 831 Bytes

Contents

require 'mediashelf/active_fedora_helper'
class GetController < ApplicationController
    include MediaShelf::ActiveFedoraHelper
    include Hydra::RepositoryController
    include Hydra::AssetsControllerHelper
    helper :downloads
    
    def show
      fedora_object = ActiveFedora::Base.load_instance(params[:id])
      
      respond_to do |format|
        format.html { send_datastream downloadables( fedora_object, :canonical=>true ) }
        format.pdf { send_datastream downloadables( fedora_object, :canonical=>true, :mime_type=>"application/pdf" ) }
        format.jp2 do 
          canonical_jp2 = downloadables( fedora_object, :canonical=>true, :mime_type=>"image/jp2" )
          jp2_content_url = "#{canonical_jp2.url}/content"
          send_datastream canonical_jp2
        end
      end
      
    end
    
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
hydra-head-3.2.0.pre3 app/controllers/get_controller.rb
hydra-head-3.2.0.pre2 app/controllers/get_controller.rb
hydra-head-3.2.0.pre1 app/controllers/get_controller.rb
hydra-head-3.1.5 app/controllers/get_controller.rb