geoblacklight 3.3.0 → 4.0.0.pre.alpha.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +34 -28
- data/.rubocop.yml +5 -0
- data/.rubocop_todo.yml +11 -6
- data/README.md +1 -1
- data/Rakefile +7 -8
- data/app/assets/images/blacklight/michigan-state-university.svg +6 -0
- data/app/assets/images/blacklight/pennsylvania-state-university.svg +6 -0
- data/app/assets/images/blacklight/purdue-university.svg +6 -0
- data/app/assets/images/blacklight/the-ohio-state-university.svg +7 -0
- data/app/assets/images/blacklight/university-of-chicago.svg +6 -0
- data/app/assets/images/blacklight/university-of-illinois-urbana-champaign.svg +6 -0
- data/app/assets/images/blacklight/university-of-iowa.svg +5 -0
- data/app/assets/images/blacklight/university-of-maryland.svg +5 -0
- data/app/assets/images/blacklight/university-of-michigan.svg +5 -0
- data/app/assets/images/blacklight/university-of-minnesota.svg +5 -0
- data/app/assets/images/blacklight/university-of-nebraska-lincoln.svg +8 -0
- data/app/assets/images/blacklight/university-of-wisconsin-madison.svg +5 -0
- data/app/assets/stylesheets/geoblacklight/modules/icon-customization.scss +41 -0
- data/app/assets/stylesheets/geoblacklight/modules/toolbar.scss +6 -0
- data/app/components/geoblacklight/homepage_feature_facet_component.html.erb +11 -0
- data/app/components/geoblacklight/homepage_feature_facet_component.rb +13 -0
- data/{lib → app/helpers}/geoblacklight/geoblacklight_helper_behavior.rb +6 -4
- data/app/helpers/geoblacklight_helper.rb +1 -22
- data/app/models/concerns/geoblacklight/solr_document/citation.rb +2 -2
- data/app/models/concerns/geoblacklight/solr_document.rb +4 -4
- data/app/models/concerns/geoblacklight/spatial_search_behavior.rb +3 -3
- data/app/views/catalog/_arcgis.html.erb +1 -1
- data/app/views/catalog/_data_dictionary.html.erb +1 -2
- data/app/views/catalog/_downloads_primary.html.erb +1 -1
- data/app/views/catalog/_header_icons.html.erb +1 -1
- data/app/views/catalog/_home_text.html.erb +7 -29
- data/app/views/catalog/_show_header_default.html.erb +1 -1
- data/app/views/relation/_relations.html.erb +15 -0
- data/app/views/relation/index.html.erb +4 -16
- data/app/views/relation/index.json.jbuilder +6 -2
- data/config/initializers/new_gbl_settings_defaults_3_4.yml +6 -0
- data/config/initializers/rails_config.rb +0 -4
- data/config/locales/geoblacklight.en.yml +8 -0
- data/geoblacklight.gemspec +1 -1
- data/lib/generators/geoblacklight/templates/catalog_controller.rb +82 -35
- data/lib/generators/geoblacklight/templates/settings.gbl_v1.yml +195 -0
- data/lib/generators/geoblacklight/templates/settings.yml +87 -22
- data/lib/geoblacklight/download/geojson_download.rb +1 -1
- data/lib/geoblacklight/download/geotiff_download.rb +1 -1
- data/lib/geoblacklight/download/hgl_download.rb +1 -1
- data/lib/geoblacklight/download/kmz_download.rb +1 -1
- data/lib/geoblacklight/download/shapefile_download.rb +1 -1
- data/lib/geoblacklight/engine.rb +0 -2
- data/lib/geoblacklight/geometry.rb +18 -3
- data/lib/geoblacklight/references.rb +1 -1
- data/lib/geoblacklight/relation/ancestors.rb +4 -3
- data/lib/geoblacklight/relation/descendants.rb +4 -3
- data/lib/geoblacklight/relation/relation_response.rb +21 -6
- data/lib/geoblacklight/version.rb +1 -1
- data/lib/geoblacklight/view_helper_override.rb +1 -1
- data/lib/geoblacklight.rb +0 -1
- data/schema/{geoblacklight-schema.json → geoblacklight-schema-1.0.json} +1 -1
- data/schema/geoblacklight-schema-aardvark.json +211 -0
- data/solr/conf/schema.xml +38 -30
- data/solr/conf/solrconfig.xml +15 -15
- data/spec/components/geoblacklight/homepage_feature_facet_component_spec.rb +39 -0
- data/spec/config/initializers/rails_config_spec.rb +9 -8
- data/spec/controllers/catalog_controller_spec.rb +6 -6
- data/spec/features/download_layer_spec.rb +1 -1
- data/spec/features/esri_viewer_spec.rb +1 -1
- data/spec/features/home_page_spec.rb +4 -4
- data/spec/features/layer_opacity_spec.rb +1 -0
- data/spec/features/metadata_panel_spec.rb +1 -1
- data/spec/features/missing_metadata_spec.rb +2 -2
- data/spec/features/relations_spec.rb +2 -2
- data/spec/features/search_results_map_spec.rb +2 -1
- data/spec/features/search_results_overlap_ratio_spec.rb +2 -2
- data/spec/features/split_view.html.erb_spec.rb +15 -11
- data/spec/fixtures/solr_documents/README.md +48 -36
- data/spec/fixtures/solr_documents/actual-papermap1.json +41 -18
- data/spec/fixtures/solr_documents/actual-point1.json +47 -27
- data/spec/fixtures/solr_documents/actual-polygon1.json +43 -18
- data/spec/fixtures/solr_documents/actual-raster1.json +52 -23
- data/spec/fixtures/solr_documents/all-relationships.json +48 -0
- data/spec/fixtures/solr_documents/baruch_ancestor1.json +62 -37
- data/spec/fixtures/solr_documents/baruch_ancestor2.json +62 -37
- data/spec/fixtures/solr_documents/baruch_documentation_download.json +60 -34
- data/spec/fixtures/solr_documents/bbox-spans-180.json +34 -16
- data/spec/fixtures/solr_documents/cornell_html_metadata.json +46 -26
- data/spec/fixtures/solr_documents/esri-dynamic-layer-all-layers.json +43 -25
- data/spec/fixtures/solr_documents/esri-dynamic-layer-single-layer.json +45 -28
- data/spec/fixtures/solr_documents/esri-feature-layer.json +44 -34
- data/spec/fixtures/solr_documents/esri-image-map-layer.json +45 -31
- data/spec/fixtures/solr_documents/esri-tiled_map_layer.json +42 -17
- data/spec/fixtures/solr_documents/esri-wms-layer.json +46 -21
- data/spec/fixtures/solr_documents/harvard_raster.json +55 -36
- data/spec/fixtures/solr_documents/iiif-eastern-hemisphere.json +35 -22
- data/spec/fixtures/solr_documents/index-map-polygon-no-downloadurl.json +48 -27
- data/spec/fixtures/solr_documents/index-map-polygon.json +48 -27
- data/spec/fixtures/solr_documents/index-map-stanford.json +54 -25
- data/spec/fixtures/solr_documents/index_map_point.json +54 -26
- data/spec/fixtures/solr_documents/metadata_no_geom.json +27 -0
- data/spec/fixtures/solr_documents/metadata_no_provider.json +39 -0
- data/spec/fixtures/solr_documents/multiple-downloads.json +33 -20
- data/spec/fixtures/solr_documents/no_locn_geometry.json +25 -0
- data/spec/fixtures/solr_documents/no_spatial.json +37 -19
- data/spec/fixtures/solr_documents/oembed.json +34 -17
- data/spec/fixtures/solr_documents/princeton-child1.json +45 -28
- data/spec/fixtures/solr_documents/princeton-child2.json +45 -28
- data/spec/fixtures/solr_documents/princeton-child3.json +45 -28
- data/spec/fixtures/solr_documents/princeton-child4.json +45 -28
- data/spec/fixtures/solr_documents/princeton-parent.json +46 -23
- data/spec/fixtures/solr_documents/public_direct_download.json +48 -21
- data/spec/fixtures/solr_documents/public_iiif_princeton.json +49 -24
- data/spec/fixtures/solr_documents/public_polygon_mit.json +31 -15
- data/spec/fixtures/solr_documents/restricted-line.json +52 -21
- data/spec/fixtures/solr_documents/the-related-record.json +27 -0
- data/spec/fixtures/solr_documents/tms.json +33 -17
- data/spec/fixtures/solr_documents/umn_metro_result1.json +44 -28
- data/spec/fixtures/solr_documents/umn_state_result1.json +44 -26
- data/spec/fixtures/solr_documents/umn_state_result2.json +45 -24
- data/spec/fixtures/solr_documents/uva_slug_colon.json +43 -20
- data/spec/{lib → helpers}/geoblacklight/geoblacklight_helper_behavior_spec.rb +1 -0
- data/spec/helpers/geoblacklight_helper_spec.rb +0 -19
- data/spec/lib/geoblacklight/download/geojson_download_spec.rb +1 -1
- data/spec/lib/geoblacklight/download/geotiff_download_spec.rb +1 -1
- data/spec/lib/geoblacklight/download/hgl_download_spec.rb +1 -1
- data/spec/lib/geoblacklight/download/kmz_download_spec.rb +1 -1
- data/spec/lib/geoblacklight/download/shapefile_download_spec.rb +1 -1
- data/spec/lib/geoblacklight/download_spec.rb +1 -1
- data/spec/lib/geoblacklight/geometry_spec.rb +15 -4
- data/spec/lib/geoblacklight/references_spec.rb +2 -2
- data/spec/lib/geoblacklight/relation/ancestors_spec.rb +3 -3
- data/spec/lib/geoblacklight/relation/descendants_spec.rb +3 -3
- data/spec/lib/geoblacklight/relation/relation_response_spec.rb +32 -17
- data/spec/models/concerns/geoblacklight/solr_document_spec.rb +4 -4
- data/spec/spec_helper.rb +2 -0
- data/spec/support/view_component_capybara_test_helpers.rb +8 -0
- metadata +41 -29
- data/app/views/catalog/_document_action.html.erb +0 -6
- data/app/views/catalog/_facet_tag_item.html.erb +0 -3
- data/app/views/catalog/_facet_tag_layout.html.erb +0 -2
- data/app/views/relation/_ancestors.html.erb +0 -8
- data/app/views/relation/_descendants.html.erb +0 -15
- data/config/initializers/new_gbl_settings_defaults_3_3.yml +0 -10
- data/schema/format-values.md +0 -50
- data/schema/geoblacklight-schema-deprecated.md +0 -39
- data/schema/geoblacklight-schema.md +0 -323
- data/schema/geometry-type-values.md +0 -11
- data/schema/references.md +0 -23
- data/schema/schema-commentary.md +0 -198
- data/schema/subjects.md +0 -41
- data/schema/type-values.md +0 -10
- data/spec/fixtures/solr_documents/metadata_no_dct_provenance_s.json +0 -30
- data/spec/fixtures/solr_documents/metadata_no_layer_geom_type_s.json +0 -17
- data/spec/fixtures/solr_documents/metadata_no_solr_geom.json +0 -23
@@ -26,21 +26,6 @@ module GeoblacklightHelper
|
|
26
26
|
)
|
27
27
|
end
|
28
28
|
|
29
|
-
def download_link_direct(text, document)
|
30
|
-
link_to(
|
31
|
-
text,
|
32
|
-
document.direct_download[:download],
|
33
|
-
'contentUrl' => document.direct_download[:download],
|
34
|
-
class: ['btn', 'btn-default', 'download', 'download-original'],
|
35
|
-
data: {
|
36
|
-
download: 'trigger',
|
37
|
-
download_type: 'direct',
|
38
|
-
download_id: document.id
|
39
|
-
}
|
40
|
-
)
|
41
|
-
end
|
42
|
-
deprecation_deprecate download_link_direct: 'Use download_link_file instead'
|
43
|
-
|
44
29
|
def download_link_hgl(text, document)
|
45
30
|
link_to(
|
46
31
|
text,
|
@@ -91,12 +76,6 @@ module GeoblacklightHelper
|
|
91
76
|
truncate(Array(args[:value]).flatten.join(' '), length: 150)
|
92
77
|
end
|
93
78
|
|
94
|
-
def render_facet_tags(facet)
|
95
|
-
render_facet_limit(facets_from_request(facet).first,
|
96
|
-
partial: 'facet_tag_item',
|
97
|
-
layout: 'facet_tag_layout')
|
98
|
-
end
|
99
|
-
|
100
79
|
##
|
101
80
|
# Returns an SVG icon or empty HTML span element
|
102
81
|
# @return [SVG or HTML tag]
|
@@ -280,7 +259,7 @@ module GeoblacklightHelper
|
|
280
259
|
icon_name = icon if icon_name.blank?
|
281
260
|
icon_options = {}
|
282
261
|
icon_options = { classes: 'svg_tooltip' } if Settings.USE_GEOM_FOR_RELATIONS_ICON
|
283
|
-
geoblacklight_icon(icon_name, icon_options)
|
262
|
+
geoblacklight_icon(icon_name, **icon_options)
|
284
263
|
end
|
285
264
|
|
286
265
|
## Returns the data-map attribute value used as the JS map selector
|
@@ -18,11 +18,11 @@ module Geoblacklight
|
|
18
18
|
private
|
19
19
|
|
20
20
|
def issued
|
21
|
-
fetch(Settings.FIELDS.
|
21
|
+
fetch(Settings.FIELDS.DATE_ISSUED, nil)
|
22
22
|
end
|
23
23
|
|
24
24
|
def format
|
25
|
-
fetch(Settings.FIELDS.
|
25
|
+
fetch(Settings.FIELDS.FORMAT, nil)
|
26
26
|
end
|
27
27
|
end
|
28
28
|
end
|
@@ -48,7 +48,7 @@ module Geoblacklight
|
|
48
48
|
end
|
49
49
|
|
50
50
|
def same_institution?
|
51
|
-
fetch(Settings.FIELDS.
|
51
|
+
fetch(Settings.FIELDS.PROVIDER, '').casecmp(Settings.INSTITUTION.downcase).zero?
|
52
52
|
end
|
53
53
|
|
54
54
|
def iiif_download
|
@@ -72,7 +72,7 @@ module Geoblacklight
|
|
72
72
|
end
|
73
73
|
|
74
74
|
def geom_field
|
75
|
-
fetch(Settings.FIELDS.
|
75
|
+
fetch(Settings.FIELDS.SPATIAL_EXTENT, '')
|
76
76
|
end
|
77
77
|
|
78
78
|
def geometry
|
@@ -84,7 +84,7 @@ module Geoblacklight
|
|
84
84
|
end
|
85
85
|
|
86
86
|
def file_format
|
87
|
-
fetch(Settings.FIELDS.
|
87
|
+
fetch(Settings.FIELDS.FORMAT)
|
88
88
|
end
|
89
89
|
|
90
90
|
##
|
@@ -100,7 +100,7 @@ module Geoblacklight
|
|
100
100
|
private
|
101
101
|
|
102
102
|
def rights_field_data
|
103
|
-
fetch(Settings.FIELDS.
|
103
|
+
fetch(Settings.FIELDS.ACCESS_RIGHTS, '')
|
104
104
|
end
|
105
105
|
|
106
106
|
def method_missing(method, *args, &block)
|
@@ -16,9 +16,9 @@ module Geoblacklight
|
|
16
16
|
def add_spatial_params(solr_params)
|
17
17
|
if blacklight_params[:bbox]
|
18
18
|
solr_params[:bq] ||= []
|
19
|
-
solr_params[:bq] << "#{Settings.FIELDS.
|
19
|
+
solr_params[:bq] << "#{Settings.FIELDS.SPATIAL_EXTENT}:\"IsWithin(#{envelope_bounds})\"#{boost}"
|
20
20
|
solr_params[:fq] ||= []
|
21
|
-
solr_params[:fq] << "#{Settings.FIELDS.
|
21
|
+
solr_params[:fq] << "#{Settings.FIELDS.SPATIAL_EXTENT}:\"Intersects(#{envelope_bounds})\""
|
22
22
|
|
23
23
|
if Settings.OVERLAP_RATIO_BOOST
|
24
24
|
solr_params[:bf] ||= []
|
@@ -62,7 +62,7 @@ module Geoblacklight
|
|
62
62
|
|
63
63
|
# Do not suppress action_documents method calls for individual documents
|
64
64
|
# ex. CatalogController#web_services (exportable views)
|
65
|
-
return if solr_params[:q]&.include?("{!lucene}#{Settings.FIELDS.
|
65
|
+
return if solr_params[:q]&.include?("{!lucene}#{Settings.FIELDS.ID}:")
|
66
66
|
|
67
67
|
solr_params[:fq] ||= []
|
68
68
|
solr_params[:fq] << "-#{Settings.FIELDS.SUPPRESSED}: true"
|
@@ -1,6 +1,5 @@
|
|
1
1
|
<% if document.data_dictionary_download.present? %>
|
2
2
|
<%= link_to document.data_dictionary_download[:data_dictionary] do %>
|
3
|
-
<%= geoblacklight_icon('book', aria_hidden: true) %>
|
4
|
-
<%= t('geoblacklight.references.data_dictionary') %>
|
3
|
+
<%= geoblacklight_icon('book', aria_hidden: true) %><%= t('geoblacklight.references.data_dictionary') %>
|
5
4
|
<% end %>
|
6
5
|
<% end %>
|
@@ -8,7 +8,7 @@
|
|
8
8
|
<% end %>
|
9
9
|
<% end %>
|
10
10
|
<% if document.direct_download[:download].is_a? String %>
|
11
|
-
<%= render partial: 'download_link', locals: { download_link:
|
11
|
+
<%= render partial: 'download_link', locals: { download_link: download_link_file(download_text(document.file_format), document.id, document.direct_download[:download]['url']) } %>
|
12
12
|
<% end %>
|
13
13
|
<% end %>
|
14
14
|
|
@@ -1,3 +1,3 @@
|
|
1
1
|
<%= geoblacklight_icon(document[Settings.FIELDS.GEOM_TYPE], classes: 'svg_tooltip') %>
|
2
|
-
<%= geoblacklight_icon(document[Settings.FIELDS.
|
2
|
+
<%= geoblacklight_icon(document[Settings.FIELDS.PROVIDER], classes: 'svg_tooltip') %>
|
3
3
|
<%= geoblacklight_icon(document[Settings.FIELDS.RIGHTS], classes: 'svg_tooltip') %>
|
@@ -3,41 +3,19 @@
|
|
3
3
|
<div class='col-sm'>
|
4
4
|
<%= content_tag :h3, t('geoblacklight.home.category_heading') %>
|
5
5
|
<div class='row'>
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
</div>
|
10
|
-
<%= content_tag :h4, t('geoblacklight.home.institution') %>
|
11
|
-
<%= render_facet_tags [Settings.FIELDS.PROVENANCE] %>
|
12
|
-
</div>
|
13
|
-
<div class='category-block col-sm'>
|
14
|
-
<div class='category-icon'>
|
15
|
-
<%= geoblacklight_icon('arrow-circle-down') %>
|
16
|
-
</div>
|
17
|
-
<%= content_tag :h4, t('geoblacklight.home.data_type') %>
|
18
|
-
<%= render_facet_tags [Settings.FIELDS.GEOM_TYPE] %>
|
19
|
-
</div>
|
6
|
+
<%= render(Geoblacklight::HomepageFeatureFacetComponent.new(icon: 'home', label: 'geoblacklight.home.institution', facet_field: Settings.FIELDS.PROVIDER, response: @response)) %>
|
7
|
+
|
8
|
+
<%= render(Geoblacklight::HomepageFeatureFacetComponent.new(icon: 'arrow-circle-down', label: 'geoblacklight.home.data_type', facet_field: Settings.FIELDS.RESOURCE_TYPE, response: @response)) %>
|
20
9
|
</div>
|
21
10
|
<div class='row'>
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
</div>
|
26
|
-
<%= content_tag :h4, t('geoblacklight.home.placename') %>
|
27
|
-
<%= render_facet_tags [Settings.FIELDS.SPATIAL_COVERAGE] %>
|
28
|
-
</div>
|
29
|
-
<div class='category-block col-sm'>
|
30
|
-
<div class='category-icon'>
|
31
|
-
<%= geoblacklight_icon('tags') %>
|
32
|
-
</div>
|
33
|
-
<%= content_tag :h4, t('geoblacklight.home.subject') %>
|
34
|
-
<%= render_facet_tags [Settings.FIELDS.SUBJECT] %>
|
35
|
-
</div>
|
11
|
+
<%= render(Geoblacklight::HomepageFeatureFacetComponent.new(icon: 'globe', label: 'geoblacklight.home.placename', facet_field: Settings.FIELDS.SPATIAL_COVERAGE, response: @response)) %>
|
12
|
+
|
13
|
+
<%= render(Geoblacklight::HomepageFeatureFacetComponent.new(icon: 'tags', label: 'geoblacklight.home.subject', facet_field: Settings.FIELDS.SUBJECT, response: @response)) %>
|
36
14
|
</div>
|
37
15
|
</div>
|
38
16
|
<div class='col-sm'>
|
39
17
|
<%= content_tag :h3, t('geoblacklight.home.map_heading') %>
|
40
|
-
<%= content_tag :div, '', id: 'map', aria: { label: t('geoblacklight.map.label') }, data: { map: 'home', 'catalog-path'=> search_catalog_path , 'map-
|
18
|
+
<%= content_tag :div, '', id: 'map', aria: { label: t('geoblacklight.map.label') }, data: { map: 'home', 'catalog-path'=> search_catalog_path , 'map-geom' => Settings.HOMEPAGE_MAP_GEOM, basemap: geoblacklight_basemap, leaflet_options: leaflet_options } %>
|
41
19
|
</div>
|
42
20
|
</div>
|
43
21
|
<div id="geoblacklight-version" class="text-right">
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<% @relations.send(rel)['docs'][0..2].each do |entry| %>
|
2
|
+
<li class="list-group-item border-bottom-0">
|
3
|
+
<%= link_to solr_document_path(entry[Settings.FIELDS.ID]) do %>
|
4
|
+
<%= relations_icon(entry, value.icon) unless value.icon.nil? %>
|
5
|
+
<%= entry[Settings.FIELDS.TITLE] %>
|
6
|
+
<% end %>
|
7
|
+
</li>
|
8
|
+
<% end %>
|
9
|
+
<% unless (@relations.send(rel)['numFound'].to_i <= 3) %>
|
10
|
+
<li class="list-group-item border-bottom-0">
|
11
|
+
<%= link_to search_catalog_path({f: {"#{Settings.FIELDS.SOURCE}" => [@relations.link_id]}}) do %>
|
12
|
+
<%= t('geoblacklight.relations.browse_all', count: @relations.send(rel)['numFound']) %>
|
13
|
+
<% end %>
|
14
|
+
</li>
|
15
|
+
<% end %>
|
@@ -1,24 +1,12 @@
|
|
1
|
-
|
2
|
-
<% unless @relations.
|
1
|
+
<%- Settings.RELATIONSHIPS_SHOWN.each do |rel, value| %>
|
2
|
+
<% unless @relations.send(rel)['numFound'].to_i.zero? %>
|
3
3
|
<div class="card relations">
|
4
4
|
<div class="card-header">
|
5
|
-
<h2 class="mb-0 h6"><%= t(
|
5
|
+
<h2 class="mb-0 h6"><%= t("#{value.label}") %></h2>
|
6
6
|
</div>
|
7
7
|
|
8
8
|
<ul class="list-group list-group-flush">
|
9
|
-
<%= render '
|
10
|
-
</ul>
|
11
|
-
</div>
|
12
|
-
<% end %>
|
13
|
-
|
14
|
-
<% unless @relations.descendants['numFound'].to_i.zero? %>
|
15
|
-
<div class="card relations">
|
16
|
-
<div class="card-header">
|
17
|
-
<h2 class="mb-0 h6"><%= t('geoblacklight.relations.descendant') %></h2>
|
18
|
-
</div>
|
19
|
-
|
20
|
-
<ul class="list-group list-group-flush">
|
21
|
-
<%= render 'descendants' %>
|
9
|
+
<%= render partial: 'relations', locals: { rel: rel, value: value } %>
|
22
10
|
</ul>
|
23
11
|
</div>
|
24
12
|
<% end %>
|
@@ -1,4 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
|
3
|
-
json.descendants @relations.descendants
|
2
|
+
|
4
3
|
json.current_doc @relations.search_id
|
4
|
+
json.relations do
|
5
|
+
Settings.RELATIONSHIPS_SHOWN.each do |key, _value|
|
6
|
+
json.set! key.downcase.to_s, @relations.send(key) unless @relations.send(key)['numFound'].to_i.zero?
|
7
|
+
end
|
8
|
+
end
|
@@ -0,0 +1,6 @@
|
|
1
|
+
# New GeoBlacklight v3.4
|
2
|
+
# Homepage Map Geometry
|
3
|
+
# Leave null to default to entire world
|
4
|
+
# Add a stringified GeoJSON object to scope initial render (example from UMass)
|
5
|
+
HOMEPAGE_MAP_GEOM: null
|
6
|
+
# HOMEPAGE_MAP_GEOM: '{"type":"Polygon","coordinates":[[[-73.58,42.93],[-73.58,41.20],[-69.90,41.20],[-69.90,42.93]]]}'
|
@@ -68,6 +68,14 @@ en:
|
|
68
68
|
relations:
|
69
69
|
ancestor: 'Source Datasets'
|
70
70
|
descendant: 'Derived Datasets'
|
71
|
+
member_of: 'Belongs to collection...'
|
72
|
+
part_of: 'Is part of...'
|
73
|
+
relation: 'Related Records'
|
74
|
+
replaces: 'Item replaces...'
|
75
|
+
replaced_by: 'Item replaced by...'
|
76
|
+
source: 'Source Datasets'
|
77
|
+
version_of: 'Version of...'
|
78
|
+
|
71
79
|
browse_all: "Browse all %{count} records..."
|
72
80
|
metadata:
|
73
81
|
toggle_summary: 'Toggle summary'
|
data/geoblacklight.gemspec
CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.required_rubygems_version = '>= 2.5.2'
|
21
21
|
|
22
22
|
spec.add_dependency 'rails', '>= 5.2.4', '< 6.2'
|
23
|
-
spec.add_dependency 'blacklight', '~> 7.
|
23
|
+
spec.add_dependency 'blacklight', '~> 7.8'
|
24
24
|
spec.add_dependency 'config'
|
25
25
|
spec.add_dependency 'faraday', '~> 1.0'
|
26
26
|
spec.add_dependency 'faraday_middleware', '~> 1.0.0.rc1'
|
@@ -29,9 +29,13 @@ class CatalogController < ApplicationController
|
|
29
29
|
#
|
30
30
|
config.default_document_solr_params = {
|
31
31
|
:qt => 'document',
|
32
|
-
:q => "{!raw f=#{Settings.FIELDS.
|
32
|
+
:q => "{!raw f=#{Settings.FIELDS.ID} v=$id}"
|
33
33
|
}
|
34
34
|
|
35
|
+
# GeoBlacklight Defaults
|
36
|
+
# * Adds the "map" split view for catalog#index
|
37
|
+
config.view.split(partials: ['index'])
|
38
|
+
config.view.delete_field('list')
|
35
39
|
|
36
40
|
# solr field configuration for search results/index views
|
37
41
|
# config.index.show_link = 'title_display'
|
@@ -76,7 +80,6 @@ class CatalogController < ApplicationController
|
|
76
80
|
# config.add_facet_field 'lc_1letter_facet', :label => 'Call Number'
|
77
81
|
# config.add_facet_field 'subject_geo_facet', :label => 'Region'
|
78
82
|
# config.add_facet_field 'solr_bbox', :fq => "solr_bbox:IsWithin(-88,26,-79,36)", :label => 'Spatial'
|
79
|
-
|
80
83
|
# config.add_facet_field 'example_pivot_field', :label => 'Pivot Field', :pivot => ['format', 'language_facet']
|
81
84
|
|
82
85
|
# config.add_facet_field 'example_query_facet_field', :label => 'Publish Date', :query => {
|
@@ -85,63 +88,62 @@ class CatalogController < ApplicationController
|
|
85
88
|
# :years_25 => { :label => 'within 25 Years', :fq => "pub_date:[#{Time.now.year - 25 } TO *]" }
|
86
89
|
# }
|
87
90
|
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
91
|
+
|
92
|
+
#FACETS
|
93
|
+
|
94
|
+
#DEFAULT FACETS
|
95
|
+
#to add additional facets, use the keys defined in the settings.yml file
|
96
|
+
config.add_facet_field Settings.FIELDS.INDEX_YEAR, :label => 'Year', :limit => 10
|
92
97
|
config.add_facet_field Settings.FIELDS.SPATIAL_COVERAGE, :label => 'Place', :limit => 8
|
93
|
-
config.add_facet_field Settings.FIELDS.
|
98
|
+
config.add_facet_field Settings.FIELDS.ACCESS_RIGHTS, label: 'Access', limit: 8, partial: "icon_facet"
|
99
|
+
config.add_facet_field Settings.FIELDS.RESOURCE_CLASS, label: 'Resource Class', :limit => 8
|
100
|
+
config.add_facet_field Settings.FIELDS.RESOURCE_TYPE, label: 'Resource Type', :limit => 8
|
101
|
+
config.add_facet_field Settings.FIELDS.FORMAT, :label => 'Format', :limit => 8
|
102
|
+
config.add_facet_field Settings.FIELDS.SUBJECT, :label => 'Subject', :limit => 8
|
103
|
+
config.add_facet_field Settings.FIELDS.ISO_TOPIC_CATEGORY, :label => 'Theme', :limit => 8
|
104
|
+
config.add_facet_field Settings.FIELDS.CREATOR, :label => 'Creator', :limit => 8
|
105
|
+
config.add_facet_field Settings.FIELDS.PUBLISHER, :label => 'Publisher', :limit => 8
|
106
|
+
config.add_facet_field Settings.FIELDS.PROVIDER, label: 'Provider', limit: 8, partial: "icon_facet"
|
107
|
+
config.add_facet_field Settings.FIELDS.GEOREFERENCED, :label => 'Georeferenced', :limit => 3
|
108
|
+
config.add_facet_field Settings.FIELDS.SOURCE, :label => 'Collection', :limit => 8, :show => false
|
94
109
|
|
95
|
-
config.add_facet_field Settings.FIELDS.YEAR, :label => 'Year', :limit => 10
|
96
110
|
|
97
|
-
config.add_facet_field Settings.FIELDS.RIGHTS, label: 'Access', limit: 8, partial: "icon_facet"
|
98
|
-
config.add_facet_field Settings.FIELDS.GEOM_TYPE, label: 'Data type', limit: 8, partial: "icon_facet"
|
99
|
-
config.add_facet_field Settings.FIELDS.FILE_FORMAT, :label => 'Format', :limit => 8
|
100
|
-
config.add_facet_field Settings.FIELDS.SOURCE, show: false
|
101
111
|
|
102
112
|
# Have BL send all facet field names to Solr, which has been the default
|
103
113
|
# previously. Simply remove these lines if you'd rather use Solr request
|
104
114
|
# handler defaults, or have no facets.
|
105
115
|
config.add_facet_fields_to_solr_request!
|
106
116
|
|
117
|
+
|
118
|
+
#SEARCH RESULTS FIELDS
|
119
|
+
|
107
120
|
# solr fields to be displayed in the index (search results) view
|
108
121
|
# The ordering of the field names is the order of the display
|
109
|
-
# config.add_index_field
|
110
|
-
# config.add_index_field 'title_vern_display', :label => 'Title:'
|
111
|
-
# config.add_index_field 'author_display', :label => 'Author:'
|
112
|
-
# config.add_index_field 'author_vern_display', :label => 'Author:'
|
113
|
-
# config.add_index_field 'format', :label => 'Format:'
|
114
|
-
# config.add_index_field 'language_facet', :label => 'Language:'
|
115
|
-
# config.add_index_field 'published_display', :label => 'Published:'
|
116
|
-
# config.add_index_field 'published_vern_display', :label => 'Published:'
|
117
|
-
# config.add_index_field 'lc_callnum_display', :label => 'Call number:'
|
118
|
-
|
119
|
-
# config.add_index_field 'dc_title_t', :label => 'Display Name:'
|
120
|
-
# config.add_index_field Settings.FIELDS.PROVENANCE, :label => 'Institution:'
|
122
|
+
# config.add_index_field Settings.FIELDS.PROVIDER, :label => 'Institution:'
|
121
123
|
# config.add_index_field Settings.FIELDS.RIGHTS, :label => 'Access:'
|
122
124
|
# # config.add_index_field 'Area', :label => 'Area:'
|
123
125
|
# config.add_index_field Settings.FIELDS.SUBJECT, :label => 'Keywords:'
|
124
|
-
config.add_index_field Settings.FIELDS.
|
126
|
+
config.add_index_field Settings.FIELDS.INDEX_YEAR
|
125
127
|
config.add_index_field Settings.FIELDS.CREATOR
|
126
128
|
config.add_index_field Settings.FIELDS.DESCRIPTION, helper_method: :snippit
|
127
129
|
config.add_index_field Settings.FIELDS.PUBLISHER
|
128
130
|
|
129
|
-
|
131
|
+
#ITEM VIEW FIELDS
|
130
132
|
|
131
133
|
# solr fields to be displayed in the show (single result) view
|
132
134
|
# The ordering of the field names is the order of the display
|
133
|
-
#
|
134
135
|
# item_prop: [String] property given to span with Schema.org item property
|
135
136
|
# link_to_search: [Boolean] that can be passed to link to a facet search
|
136
137
|
# helper_method: [Symbol] method that can be used to render the value
|
137
|
-
|
138
|
+
|
139
|
+
#DEFAULT FIELDS
|
140
|
+
config.add_show_field Settings.FIELDS.CREATOR, label: 'Creator(s)', itemprop: 'creator'
|
138
141
|
config.add_show_field Settings.FIELDS.DESCRIPTION, label: 'Description', itemprop: 'description', helper_method: :render_value_as_truncate_abstract
|
139
142
|
config.add_show_field Settings.FIELDS.PUBLISHER, label: 'Publisher', itemprop: 'publisher'
|
140
|
-
config.add_show_field Settings.FIELDS.PART_OF, label: 'Collection', itemprop: 'isPartOf'
|
141
143
|
config.add_show_field Settings.FIELDS.SPATIAL_COVERAGE, label: 'Place(s)', itemprop: 'spatial', link_to_facet: true
|
142
144
|
config.add_show_field Settings.FIELDS.SUBJECT, label: 'Subject(s)', itemprop: 'keywords', link_to_facet: true
|
143
|
-
config.add_show_field Settings.FIELDS.
|
144
|
-
config.add_show_field Settings.FIELDS.
|
145
|
+
config.add_show_field Settings.FIELDS.TEMPORAL_COVERAGE, label: 'Year', itemprop: 'temporal'
|
146
|
+
config.add_show_field Settings.FIELDS.PROVIDER, label: 'Provider', link_to_facet: true
|
145
147
|
config.add_show_field(
|
146
148
|
Settings.FIELDS.REFERENCES,
|
147
149
|
label: 'More details at',
|
@@ -150,6 +152,50 @@ class CatalogController < ApplicationController
|
|
150
152
|
helper_method: :render_references_url
|
151
153
|
)
|
152
154
|
|
155
|
+
# OPTIONAL FIELDS
|
156
|
+
#optional fields to add to the item view display
|
157
|
+
|
158
|
+
# config.add_show_field Settings.FIELDS.ACCESS_RIGHTS, label: 'Access Rights', itemprop: 'access_rights'
|
159
|
+
# config.add_show_field Settings.FIELDS.ALTERNATIVE_TITLE, label: 'Alternative Title', itemprop: 'alt_title'
|
160
|
+
# config.add_show_field Settings.FIELDS.CENTROID, label: 'Centroid', itemprop: 'centroid'
|
161
|
+
# config.add_show_field Settings.FIELDS.CREATOR, label: 'Creator(s)', itemprop: 'creator'
|
162
|
+
# config.add_show_field Settings.FIELDS.DATE_ISSUED, label: 'Date Issued', itemprop: 'issued'
|
163
|
+
# config.add_show_field Settings.FIELDS.DATE_RANGE, label: 'Date Range', itemprop: 'date_range'
|
164
|
+
# config.add_show_field Settings.FIELDS.DESCRIPTION, label: 'Description', itemprop: 'description', helper_method: :render_value_as_truncate_abstract
|
165
|
+
# config.add_show_field Settings.FIELDS.FORMAT, label: 'Format', itemprop: 'format'
|
166
|
+
# config.add_show_field Settings.FIELDS.FILE_SIZE, label: 'File Size', itemprop: 'file_size'
|
167
|
+
# config.add_show_field Settings.FIELDS.GEOREFERENCED, label: 'Georeferenced', itemprop: 'georeferenced'
|
168
|
+
# config.add_show_field Settings.FIELDS.ID, label: 'ID', itemprop: 'id'
|
169
|
+
# config.add_show_field Settings.FIELDS.IDENTIFIER, label: 'Identifier', itemprop: 'identifier'
|
170
|
+
# config.add_show_field Settings.FIELDS.INDEX_YEAR, label: 'Year', itemprop: 'year'
|
171
|
+
# config.add_show_field Settings.FIELDS.IS_PART_OF, label: 'Is Part Of', itemprop: 'is_part_of'
|
172
|
+
# config.add_show_field Settings.FIELDS.IS_REPLACED_BY, label: 'Is Replaced By', itemprop: 'is_replaced_by'
|
173
|
+
# config.add_show_field Settings.FIELDS.ISO_TOPIC_CATEGORY, label: 'Theme', itemprop: 'theme'
|
174
|
+
# config.add_show_field Settings.FIELDS.KEYWORD, label: 'Keyword(s)', itemprop: 'keyword'
|
175
|
+
# config.add_show_field Settings.FIELDS.LANGUAGE, label: 'Language', itemprop: 'language'
|
176
|
+
# config.add_show_field Settings.FIELDS.LICENSE, label: 'License', itemprop: 'license'
|
177
|
+
# config.add_show_field Settings.FIELDS.MEMBER_OF, label: 'Member Of', itemprop: 'member_of'
|
178
|
+
# config.add_show_field Settings.FIELDS.METADATA_VERSION, label: 'Metadata Version', itemprop: 'metadata_version'
|
179
|
+
# config.add_show_field Settings.FIELDS.MODIFIED, label: 'Date Modified', itemprop: 'modified'
|
180
|
+
# config.add_show_field Settings.FIELDS.OVERLAP_FIELD, label: 'Overlap BBox', itemprop: 'overlap_field'
|
181
|
+
# config.add_show_field Settings.FIELDS.PUBLISHER, label: 'Publisher', itemprop: 'publisher'
|
182
|
+
# config.add_show_field Settings.FIELDS.PROVIDER, label: 'Provider', itemprop: 'provider'
|
183
|
+
# config.add_show_field Settings.FIELDS.REFERENCES, label: 'References', itemprop: 'references'
|
184
|
+
# config.add_show_field Settings.FIELDS.RELATION, label: 'Relation', itemprop: 'relation'
|
185
|
+
# config.add_show_field Settings.FIELDS.REPLACES, label: 'Replaces', itemprop: 'replaces'
|
186
|
+
# config.add_show_field Settings.FIELDS.RESOURCE_CLASS, label: 'Resource Class', itemprop: 'class'
|
187
|
+
# config.add_show_field Settings.FIELDS.RESOURCE_TYPE, label: 'Resource Type', itemprop: 'type'
|
188
|
+
# config.add_show_field Settings.FIELDS.RIGHTS, label: 'Rights', itemprop: 'rights'
|
189
|
+
# config.add_show_field Settings.FIELDS.RIGHTS_HOLDER, label: 'Rights Holder', itemprop: 'rights_holder'
|
190
|
+
# config.add_show_field Settings.FIELDS.SPATIAL_COVERAGE, label: 'Place(s)', itemprop: 'spatial_coverage'
|
191
|
+
# config.add_show_field Settings.FIELDS.SPATIAL_EXTENT, label: 'Spatial Extent', itemprop: 'geometry'
|
192
|
+
# config.add_show_field Settings.FIELDS.SUBJECT, label: 'Subject', itemprop: 'subject'
|
193
|
+
# config.add_show_field Settings.FIELDS.SUPPRESSED, label: 'Suppressed', itemprop: 'suppresed'
|
194
|
+
# config.add_show_field Settings.FIELDS.TEMPORAL_COVERAGE, label: 'Temporal Coverage', itemprop: 'temporal'
|
195
|
+
# config.add_show_field Settings.FIELDS.TITLE, label: 'Title', itemprop: 'title'
|
196
|
+
# config.add_show_field Settings.FIELDS.VERSION, label: 'Version', itemprop: 'version'
|
197
|
+
# config.add_show_field Settings.FIELDS.WXS_IDENTIFIER, label: 'Web Service Layer', itemprop: 'wxs_identifier'
|
198
|
+
|
153
199
|
# "fielded" search configuration. Used by pulldown among other places.
|
154
200
|
# For supported keys in hash, see rdoc for Blacklight::SearchFields
|
155
201
|
#
|
@@ -222,10 +268,11 @@ class CatalogController < ApplicationController
|
|
222
268
|
# label in pulldown is followed by the name of the SOLR field to sort by and
|
223
269
|
# whether the sort is ascending or descending (it must be asc or desc
|
224
270
|
# except in the relevancy case).
|
225
|
-
config.add_sort_field 'score desc,
|
226
|
-
config.add_sort_field "#{Settings.FIELDS.
|
227
|
-
config.add_sort_field "#{Settings.FIELDS.
|
228
|
-
config.add_sort_field '
|
271
|
+
config.add_sort_field 'score desc, dct_title_sort asc', :label => 'Relevance'
|
272
|
+
config.add_sort_field "#{Settings.FIELDS.INDEX_YEAR} desc, dct_title_sort asc", :label => 'Year (Newest first)'
|
273
|
+
config.add_sort_field "#{Settings.FIELDS.INDEX_YEAR} asc, dct_title_sort asc", :label => 'Year (Oldest first)'
|
274
|
+
config.add_sort_field 'dct_title_sort asc', :label => 'Title (A-Z)'
|
275
|
+
config.add_sort_field 'dct_title_sort desc', :label => 'Title (Z-A)'
|
229
276
|
|
230
277
|
# If there are more than this many search results, no spelling ("did you
|
231
278
|
# mean") suggestion is offered.
|