Sha256: f4c807a583325fbc31ffe772ead49484c9a871e43f9dcc225bc013850253e157

Contents?: true

Size: 647 Bytes

Versions: 2

Compression:

Stored size: 647 Bytes

Contents

module Geoblacklight
  # Extends Blacklight::Solr::Document for GeoBlacklight specific functionalit
  module SolrDocument
    extend Blacklight::Solr::Document

    def available?
      public? || same_institution?
    end

    def public?
      get(:dc_rights_s) == 'Public'
    end

    def downloadable?
      get(:solr_wfs_url) && get(:solr_wms_url) && available?
    end

    def download_types
      [{ label: 'Shapefile', type: 'shapefile' }, { label: 'KMZ', type: 'kmz' }]
    end

    def same_institution?
      get(:dct_provenance_s) == Settings.Institution
    end

    def itemtype
      "http://schema.org/Dataset"
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
geoblacklight-0.0.4 lib/geoblacklight/solr_document.rb
geoblacklight-0.0.3 lib/geoblacklight/solr_document.rb