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_scv_hydra-0.22.9.6 app/models/jp2_image_aggregator.rb
cul_scv_hydra-0.22.9.5 app/models/jp2_image_aggregator.rb
cul_scv_hydra-0.22.9.4 app/models/jp2_image_aggregator.rb
cul_scv_hydra-0.22.9.3 app/models/jp2_image_aggregator.rb
cul_scv_hydra-0.22.9.2 app/models/jp2_image_aggregator.rb
cul_scv_hydra-0.22.9.1 app/models/jp2_image_aggregator.rb
cul_scv_hydra-0.22.9 app/models/jp2_image_aggregator.rb
cul_scv_hydra-0.22.8 app/models/jp2_image_aggregator.rb
cul_scv_hydra-0.22.7 app/models/jp2_image_aggregator.rb
cul_scv_hydra-0.22.6 app/models/jp2_image_aggregator.rb
cul_scv_hydra-0.22.5 app/models/jp2_image_aggregator.rb
cul_scv_hydra-0.22.4 app/models/jp2_image_aggregator.rb
cul_scv_hydra-0.22.3 app/models/jp2_image_aggregator.rb
cul_scv_hydra-0.22.2 app/models/jp2_image_aggregator.rb
cul_scv_hydra-0.22.1 app/models/jp2_image_aggregator.rb
cul_scv_hydra-0.22.0 app/models/jp2_image_aggregator.rb
cul_scv_hydra-0.21.8 app/models/jp2_image_aggregator.rb
cul_scv_hydra-0.21.7 app/models/jp2_image_aggregator.rb
cul_scv_hydra-0.21.6 app/models/jp2_image_aggregator.rb
cul_scv_hydra-0.21.5 app/models/jp2_image_aggregator.rb