Module: Geoblacklight::SolrDocument

Extended by:
ActiveSupport::Concern, Blacklight::Solr::Document
Includes:
Arcgis, Citation, Finder, Inspection
Defined in:
app/models/concerns/geoblacklight/solr_document.rb,
app/models/concerns/geoblacklight/solr_document/arcgis.rb,
app/models/concerns/geoblacklight/solr_document/finder.rb,
app/models/concerns/geoblacklight/solr_document/citation.rb,
app/models/concerns/geoblacklight/solr_document/inspection.rb

Overview

Extends Blacklight::Solr::Document for GeoBlacklight specific functionality

Defined Under Namespace

Modules: Arcgis, Citation, Finder, Inspection

Instance Method Summary collapse

Methods included from Citation

#geoblacklight_citation

Methods included from Arcgis

#arcgis_urls

Methods included from Inspection

#inspectable?

Methods included from Finder

#blacklight_solr

Instance Method Details

#available?Boolean

Returns:

  • (Boolean)


35
36
37
# File 'app/models/concerns/geoblacklight/solr_document.rb', line 35

def available?
  public? || same_institution?
end

#data_dictionary_downloadObject



71
72
73
# File 'app/models/concerns/geoblacklight/solr_document.rb', line 71

def data_dictionary_download
  references.data_dictionary.to_hash if references.data_dictionary.present?
end

#direct_downloadObject



55
56
57
# File 'app/models/concerns/geoblacklight/solr_document.rb', line 55

def direct_download
  references.download.to_hash if references.download.present?
end

#downloadable?Boolean

Returns:

  • (Boolean)


47
48
49
# File 'app/models/concerns/geoblacklight/solr_document.rb', line 47

def downloadable?
  (direct_download || download_types.present? || iiif_download) && available?
end

#external_urlObject



75
76
77
# File 'app/models/concerns/geoblacklight/solr_document.rb', line 75

def external_url
  references.url&.endpoint
end

#geometryObject



87
88
89
# File 'app/models/concerns/geoblacklight/solr_document.rb', line 87

def geometry
  @geometry ||= Geoblacklight::Geometry.new(geom_field)
end

#iiif_downloadObject



67
68
69
# File 'app/models/concerns/geoblacklight/solr_document.rb', line 67

def iiif_download
  references.iiif.to_hash if references.iiif.present?
end

#item_viewerObject



79
80
81
# File 'app/models/concerns/geoblacklight/solr_document.rb', line 79

def item_viewer
  ItemViewer.new(references)
end

#itemtypeObject



83
84
85
# File 'app/models/concerns/geoblacklight/solr_document.rb', line 83

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

#oembedObject



59
60
61
# File 'app/models/concerns/geoblacklight/solr_document.rb', line 59

def oembed
  references.oembed.endpoint if references.oembed.present?
end

#public?Boolean

Returns:

  • (Boolean)


39
40
41
# File 'app/models/concerns/geoblacklight/solr_document.rb', line 39

def public?
  rights_field_data&.casecmp?("public")
end

#referencesObject



51
52
53
# File 'app/models/concerns/geoblacklight/solr_document.rb', line 51

def references
  References.new(self)
end

#restricted?Boolean

Returns:

  • (Boolean)


43
44
45
# File 'app/models/concerns/geoblacklight/solr_document.rb', line 43

def restricted?
  !rights_field_data || rights_field_data.casecmp?("restricted")
end

#same_institution?Boolean

Returns:

  • (Boolean)


63
64
65
# File 'app/models/concerns/geoblacklight/solr_document.rb', line 63

def same_institution?
  provider&.casecmp?(Geoblacklight.configuration.institution.downcase)
end