Sha256: 0e5f3ad549a009ea160dba05757d143e131946802c32c04428416e565bcd2b95

Contents?: true

Size: 964 Bytes

Versions: 121

Compression:

Stored size: 964 Bytes

Contents

require "active-fedora"
require "active_fedora_finders"
class JP2ImageAggregator < ResourceAggregator

  has_datastream :name => "SOURCE", :type=>::ActiveFedora::Datastream, :mimeType=>"image/jp2", :controlGroup=>'E'

  def route_as
    "zoomingimage"
  end

  def index_type_label
    "PART"
  end

  def to_solr(solr_doc = Hash.new, opts={})
    solr_doc = super
    source = self.datastreams["SOURCE"]
    source.profile
    if source.controlGroup == 'E'
      solr_doc["rft_id_ss"] = source.dsLocation
    else
      rc = ActiveFedora::RubydoraConnection.instance.connection
      url = rc.config["url"]
      uri = URI::parse(url)
      url = "#{uri.scheme}://#{uri.host}:#{uri.port}/fedora/objects/#{pid}/datastreams/SOURCE/content"
      solr_doc["rft_id_ss"] = url
    end
    solr_doc
  end
  
  def thumbnail_info
    {:url => "#{ActiveFedora.fedora_config[:url]}/objects/#{pid}/methods/ldpd:sdef.Image/getView?max=250", :mime => 'image/jpeg'}
  end
end

Version data entries

121 entries across 121 versions & 2 rubygems

Version Path
cul_hydra-1.8.0 app/models/jp2_image_aggregator.rb
cul_hydra-1.7.6 app/models/jp2_image_aggregator.rb
cul_hydra-1.7.5 app/models/jp2_image_aggregator.rb
cul_hydra-1.7.4 app/models/jp2_image_aggregator.rb
cul_hydra-1.7.3 app/models/jp2_image_aggregator.rb
cul_hydra-1.7.2 app/models/jp2_image_aggregator.rb
cul_hydra-1.7.1 app/models/jp2_image_aggregator.rb
cul_hydra-1.7.0 app/models/jp2_image_aggregator.rb
cul_hydra-1.6.4 app/models/jp2_image_aggregator.rb
cul_hydra-1.6.2 app/models/jp2_image_aggregator.rb
cul_hydra-1.6.1 app/models/jp2_image_aggregator.rb
cul_hydra-1.6.0 app/models/jp2_image_aggregator.rb
cul_hydra-1.5.3 app/models/jp2_image_aggregator.rb
cul_hydra-1.5.2 app/models/jp2_image_aggregator.rb
cul_hydra-1.5.1 app/models/jp2_image_aggregator.rb
cul_hydra-1.5.0 app/models/jp2_image_aggregator.rb
cul_hydra-1.4.18 app/models/jp2_image_aggregator.rb
cul_hydra-1.4.17 app/models/jp2_image_aggregator.rb
cul_hydra-1.4.16 app/models/jp2_image_aggregator.rb
cul_hydra-1.4.15 app/models/jp2_image_aggregator.rb