Sha256: 2186747502a6562107cdc490e168d63eaa6554b8a9118a3ab065339d87b58c05

Contents?: true

Size: 752 Bytes

Versions: 3

Compression:

Stored size: 752 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).downcase == 'public'
    end

    def restricted?
      get(:dc_rights_s).downcase == 'restricted'
    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).downcase == Settings.INSTITUTION.downcase
    end

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
geoblacklight-0.0.7 lib/geoblacklight/solr_document.rb
geoblacklight-0.0.6 lib/geoblacklight/solr_document.rb
geoblacklight-0.0.5 lib/geoblacklight/solr_document.rb