geoblacklight 2.4.0 → 3.3.0
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 +142 -0
- data/.gitignore +8 -0
- data/.rubocop.yml +24 -23
- data/.rubocop_todo.yml +398 -12
- data/README.md +3 -3
- data/Rakefile +13 -4
- data/app/assets/images/favicon.ico +0 -0
- data/app/assets/javascripts/geoblacklight/downloaders/downloader.js +1 -1
- data/app/assets/javascripts/geoblacklight/geoblacklight.js +18 -1
- data/app/assets/javascripts/geoblacklight/modules/bookmarks.js +43 -0
- data/app/assets/javascripts/geoblacklight/modules/metadata_download_button.js +6 -1
- data/app/assets/javascripts/geoblacklight/modules/results.js +7 -8
- data/app/assets/javascripts/geoblacklight/modules/svg_tooltips.js +31 -0
- data/app/assets/javascripts/geoblacklight/modules/util.js +5 -0
- data/app/assets/javascripts/geoblacklight/viewers/esri.js +3 -3
- data/app/assets/javascripts/geoblacklight/viewers/esri/tiled_map_layer.js +1 -1
- data/app/assets/javascripts/geoblacklight/viewers/index_map.js +1 -1
- data/app/assets/javascripts/geoblacklight/viewers/map.js +12 -2
- data/app/assets/javascripts/geoblacklight/viewers/tms.js +10 -0
- data/app/assets/javascripts/geoblacklight/viewers/wms.js +3 -3
- data/app/assets/stylesheets/geoblacklight/geoblacklight.scss +2 -0
- data/app/assets/stylesheets/geoblacklight/modules/_base.scss +33 -0
- data/app/assets/stylesheets/geoblacklight/{_blacklight_overrides.scss → modules/_blacklight_overrides.scss} +1 -1
- data/app/assets/stylesheets/geoblacklight/{_styles.scss → modules/_styles.scss} +1 -0
- data/app/assets/stylesheets/geoblacklight/modules/downloads.scss +37 -54
- data/app/assets/stylesheets/geoblacklight/modules/item.scss +1 -0
- data/app/assets/stylesheets/geoblacklight/modules/results.scss +17 -29
- data/app/assets/stylesheets/geoblacklight/modules/sidebar.scss +12 -42
- data/app/assets/stylesheets/geoblacklight/modules/toolbar.scss +17 -59
- data/app/controllers/download_controller.rb +12 -12
- data/app/controllers/relation_controller.rb +1 -0
- data/app/controllers/wms_controller.rb +1 -0
- data/app/helpers/arcgis_helper.rb +1 -0
- data/app/helpers/blacklight_helper.rb +1 -0
- data/app/helpers/carto_helper.rb +1 -0
- data/app/helpers/geoblacklight_helper.rb +37 -72
- data/app/models/concerns/geoblacklight/solr_document.rb +15 -19
- data/app/models/concerns/geoblacklight/solr_document/arcgis.rb +2 -1
- data/app/models/concerns/geoblacklight/solr_document/carto.rb +1 -13
- data/app/models/concerns/geoblacklight/solr_document/citation.rb +1 -0
- data/app/models/concerns/geoblacklight/solr_document/finder.rb +1 -0
- data/app/models/concerns/geoblacklight/solr_document/inspection.rb +2 -1
- data/app/models/concerns/geoblacklight/spatial_search_behavior.rb +6 -4
- data/app/presenters/geoblacklight/document_presenter.rb +2 -1
- data/app/views/catalog/_arcgis.html.erb +4 -0
- data/app/views/catalog/_carto.html.erb +4 -0
- data/app/views/catalog/_document_split.html.erb +1 -1
- data/app/views/catalog/_downloads_primary.html.erb +8 -1
- data/app/views/catalog/_header_icons.html.erb +3 -3
- data/app/views/catalog/_home_text.html.erb +3 -0
- data/app/views/catalog/_index_split_default.html.erb +21 -21
- data/app/views/catalog/_show_default_viewer_container.html.erb +1 -1
- data/app/views/download/hgl.html.erb +13 -11
- data/app/views/relation/_ancestors.html.erb +3 -6
- data/app/views/relation/_descendants.html.erb +4 -7
- data/app/views/relation/index.html.erb +20 -8
- data/app/views/relation/index.json.jbuilder +2 -1
- data/app/views/shared/_header_navbar.html.erb +0 -2
- data/babel.config.json +4 -0
- data/bin/coverage.rb +36 -0
- data/config/initializers/new_gbl_settings_defaults_3_3.yml +10 -0
- data/config/initializers/rails_config.rb +5 -0
- data/config/locales/geoblacklight.en.yml +7 -2
- data/geoblacklight.gemspec +7 -9
- data/jest.config.js +25 -0
- data/lib/generators/geoblacklight/assets_generator.rb +46 -0
- data/lib/generators/geoblacklight/install_generator.rb +4 -10
- data/lib/generators/geoblacklight/templates/assets/_blacklight.scss +1 -0
- data/lib/generators/geoblacklight/templates/assets/_customizations.scss +28 -0
- data/{app/assets/stylesheets/geoblacklight/application.scss → lib/generators/geoblacklight/templates/assets/_geoblacklight.scss} +0 -1
- data/lib/generators/geoblacklight/templates/assets/application.scss +7 -0
- data/lib/generators/geoblacklight/templates/{geoblacklight.js → assets/geoblacklight.js} +0 -0
- data/lib/generators/geoblacklight/templates/catalog_controller.rb +5 -3
- data/lib/generators/geoblacklight/templates/settings.yml +20 -17
- data/lib/generators/geoblacklight/webpacker_generator.rb +1 -0
- data/lib/geoblacklight.rb +2 -2
- data/lib/geoblacklight/bounding_box.rb +2 -1
- data/lib/geoblacklight/catalog_helper_override.rb +1 -0
- data/lib/geoblacklight/constants.rb +2 -0
- data/lib/geoblacklight/download.rb +2 -1
- data/lib/geoblacklight/download/geojson_download.rb +1 -0
- data/lib/geoblacklight/download/geotiff_download.rb +1 -0
- data/lib/geoblacklight/download/hgl_download.rb +1 -0
- data/lib/geoblacklight/download/kmz_download.rb +3 -2
- data/lib/geoblacklight/download/shapefile_download.rb +1 -0
- data/lib/geoblacklight/engine.rb +2 -2
- data/lib/geoblacklight/exceptions.rb +1 -0
- data/lib/geoblacklight/geoblacklight_helper_behavior.rb +1 -0
- data/lib/geoblacklight/geometry.rb +70 -0
- data/lib/geoblacklight/item_viewer.rb +6 -1
- data/lib/geoblacklight/metadata.rb +1 -0
- data/lib/geoblacklight/metadata/base.rb +2 -7
- data/lib/geoblacklight/metadata/fgdc.rb +1 -0
- data/lib/geoblacklight/metadata/html.rb +2 -2
- data/lib/geoblacklight/metadata/iso19139.rb +1 -0
- data/lib/geoblacklight/metadata_transformer.rb +1 -0
- data/lib/geoblacklight/metadata_transformer/base.rb +1 -0
- data/lib/geoblacklight/metadata_transformer/fgdc.rb +1 -0
- data/lib/geoblacklight/metadata_transformer/iso19139.rb +1 -0
- data/lib/geoblacklight/reference.rb +1 -0
- data/lib/geoblacklight/references.rb +7 -3
- data/lib/geoblacklight/relation/ancestors.rb +3 -2
- data/lib/geoblacklight/relation/descendants.rb +2 -1
- data/lib/geoblacklight/relation/relation_response.rb +2 -1
- data/lib/geoblacklight/routes.rb +1 -0
- data/lib/geoblacklight/routes/downloadable.rb +1 -0
- data/lib/geoblacklight/routes/exportable.rb +1 -0
- data/lib/geoblacklight/routes/wms.rb +1 -0
- data/lib/geoblacklight/version.rb +2 -1
- data/lib/geoblacklight/view_helper_override.rb +1 -0
- data/lib/geoblacklight/wms_layer.rb +2 -4
- data/lib/geoblacklight/wms_layer/feature_info_response.rb +1 -0
- data/lib/tasks/geoblacklight.rake +38 -32
- data/package.json +17 -1
- data/setupJest.js +14 -0
- data/solr/conf/schema.xml +1 -3
- data/spec/config/initializers/rails_config_spec.rb +14 -0
- data/spec/controllers/catalog_controller_spec.rb +7 -6
- data/spec/controllers/download_controller_spec.rb +1 -0
- data/spec/controllers/relation_controller_spec.rb +1 -0
- data/spec/controllers/wms_controller_spec.rb +1 -0
- data/spec/factories/user.rb +1 -0
- data/spec/features/bookmarks_spec.rb +1 -0
- data/spec/features/configurable_basemap_spec.rb +1 -0
- data/spec/features/data_dictionary_download_spec.rb +1 -0
- data/spec/features/download_layer_spec.rb +2 -1
- data/spec/features/empty_search_spec.rb +1 -0
- data/spec/features/esri_viewer_spec.rb +1 -5
- data/spec/features/exports_spec.rb +4 -12
- data/spec/features/help_text_spec.rb +1 -0
- data/spec/features/home_page_spec.rb +6 -0
- data/spec/features/iiif_viewer_spec.rb +1 -0
- data/spec/features/index_map_spec.rb +1 -0
- data/spec/features/layer_inspection_spec.rb +1 -0
- data/spec/features/layer_opacity_spec.rb +1 -0
- data/spec/features/layer_preview_spec.rb +1 -0
- data/spec/features/layer_with_no_references_spec.rb +1 -0
- data/spec/features/linkified_attribute_table_spec.rb +1 -0
- data/spec/features/metadata_panel_spec.rb +1 -0
- data/spec/features/missing_metadata_spec.rb +1 -0
- data/spec/features/multiple_downloads_spec.rb +15 -0
- data/spec/features/oembed_spec.rb +1 -0
- data/spec/features/relations_spec.rb +10 -29
- data/spec/features/saved_searches_spec.rb +1 -0
- data/spec/features/search_bar_spec.rb +1 -0
- data/spec/features/search_results_map_spec.rb +1 -6
- data/spec/features/search_results_overlap_ratio_spec.rb +6 -5
- data/spec/features/search_spec.rb +1 -0
- data/spec/features/show_page_metadata_spec.rb +1 -0
- data/spec/features/sms_spec.rb +1 -0
- data/spec/features/split_view.html.erb_spec.rb +3 -2
- data/spec/features/suppressed_records_spec.rb +1 -0
- data/spec/features/tms_spec.rb +10 -0
- data/spec/features/web_services_modal_spec.rb +1 -0
- data/spec/fixtures/solr_documents/multiple-downloads.json +30 -0
- data/spec/fixtures/solr_documents/public_iiif_princeton.json +1 -1
- data/spec/fixtures/solr_documents/tms.json +29 -0
- data/spec/helpers/arcgis_helper_spec.rb +1 -0
- data/spec/helpers/carto_helper_spec.rb +1 -0
- data/spec/helpers/geoblacklight_helper_spec.rb +73 -14
- data/spec/javascripts/geoblacklight_spec.js +0 -6
- data/spec/javascripts/metadata_download_button_spec.js +5 -3
- data/spec/javascripts/util_spec.js +2 -4
- data/spec/lib/geoblacklight/bounding_box_spec.rb +1 -0
- data/spec/lib/geoblacklight/document_presenter_spec.rb +3 -2
- data/spec/lib/geoblacklight/download/geojson_download_spec.rb +1 -0
- data/spec/lib/geoblacklight/download/geotiff_download_spec.rb +1 -0
- data/spec/lib/geoblacklight/download/hgl_download_spec.rb +1 -0
- data/spec/lib/geoblacklight/download/kmz_download_spec.rb +3 -2
- data/spec/lib/geoblacklight/download/shapefile_download_spec.rb +1 -0
- data/spec/lib/geoblacklight/download_spec.rb +3 -2
- data/spec/lib/geoblacklight/geoblacklight_helper_behavior_spec.rb +1 -0
- data/spec/lib/geoblacklight/geometry_spec.rb +48 -0
- data/spec/lib/geoblacklight/item_viewer_spec.rb +13 -0
- data/spec/lib/geoblacklight/metadata/base_spec.rb +1 -0
- data/spec/lib/geoblacklight/metadata/html_spec.rb +1 -0
- data/spec/lib/geoblacklight/metadata_spec.rb +1 -0
- data/spec/lib/geoblacklight/metadata_transformer/base_spec.rb +3 -2
- data/spec/lib/geoblacklight/metadata_transformer/fgdc_spec.rb +3 -2
- data/spec/lib/geoblacklight/metadata_transformer/iso19139_spec.rb +3 -2
- data/spec/lib/geoblacklight/metadata_transformer_spec.rb +4 -3
- data/spec/lib/geoblacklight/reference_spec.rb +1 -0
- data/spec/lib/geoblacklight/references_spec.rb +3 -4
- data/spec/lib/geoblacklight/relation/ancestors_spec.rb +2 -1
- data/spec/lib/geoblacklight/relation/descendants_spec.rb +2 -1
- data/spec/lib/geoblacklight/relation/relation_response_spec.rb +1 -0
- data/spec/lib/geoblacklight/view_helper_override_spec.rb +1 -0
- data/spec/lib/geoblacklight/wms_layer/feature_info_response_spec.rb +5 -4
- data/spec/lib/geoblacklight/wms_layer_spec.rb +1 -0
- data/spec/models/concerns/geoblacklight/solr_document/carto_spec.rb +1 -20
- data/spec/models/concerns/geoblacklight/solr_document/citation_spec.rb +1 -0
- data/spec/models/concerns/geoblacklight/solr_document/finder_spec.rb +1 -0
- data/spec/models/concerns/geoblacklight/solr_document/inspection_spec.rb +1 -0
- data/spec/models/concerns/geoblacklight/solr_document_spec.rb +1 -0
- data/spec/models/concerns/geoblacklight/spatial_search_behavior_spec.rb +15 -2
- data/spec/routing/catalog_routing_spec.rb +1 -0
- data/spec/spec_helper.rb +12 -9
- data/spec/support/backport_test_helpers.rb +1 -0
- data/spec/support/features.rb +1 -0
- data/spec/support/features/session_helpers.rb +1 -0
- data/spec/support/fixtures.rb +1 -0
- data/spec/tasks/geoblacklight_spec.rb +4 -3
- data/spec/test_app_templates/Gemfile.extra +1 -0
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +2 -8
- data/spec/views/catalog/_document_split.html.erb_spec.rb +2 -1
- data/spec/views/catalog/_index_split.html.erb_spec.rb +2 -1
- data/spec/views/catalog/_results_pagination.html.erb_spec.rb +1 -0
- data/spec/views/catalog/_show_downloads.html.erb_spec.rb +1 -0
- data/spec/views/catalog/_show_tools.html.erb_spec.rb +3 -5
- data/template.rb +4 -2
- metadata +74 -78
- data/.circleci/config.yml +0 -164
- data/app/assets/stylesheets/geoblacklight/_geoblacklight.scss +0 -36
- data/app/assets/stylesheets/geoblacklight/modules/relations.scss +0 -15
- data/app/views/catalog/_exports.html.erb +0 -3
- data/app/views/catalog/_show_tools.html.erb +0 -25
- data/lib/generators/geoblacklight/templates/geoblacklight.scss +0 -4
- data/spec/javascripts/spec_helper.js +0 -32
- data/spec/lib/geoblacklight/controller_override_spec.rb +0 -1
- data/spec/teaspoon_env.rb +0 -213
- data/vendor/assets/javascripts/readmore.js +0 -0
- data/vendor/assets/javascripts/readmore.min.js +0 -0
@@ -0,0 +1,10 @@
|
|
1
|
+
# New GeoBlacklight v3.3 Solr field mappings
|
2
|
+
FIELDS:
|
3
|
+
:IDENTIFIER: 'dc_identifier_s'
|
4
|
+
:LANGUAGE: 'dc_language_s'
|
5
|
+
:LAYER_MODIFIED: 'layer_modified_dt'
|
6
|
+
:OVERLAP_FIELD: 'solr_bboxtype'
|
7
|
+
:SOURCE: 'dc_source_sm'
|
8
|
+
:SUPPRESSED: 'suppressed_b'
|
9
|
+
:TYPE: 'dc_type_s'
|
10
|
+
:UNIQUE_KEY: 'layer_slug_s'
|
@@ -29,6 +29,7 @@ en:
|
|
29
29
|
data_type: 'Data type'
|
30
30
|
placename: 'Placename'
|
31
31
|
subject: 'Subject'
|
32
|
+
version: 'GeoBlacklight version %{version}'
|
32
33
|
tools:
|
33
34
|
login_to_view: 'Login to View and Download'
|
34
35
|
open_carto: 'Open in Carto'
|
@@ -63,12 +64,13 @@ en:
|
|
63
64
|
data_dictionary: 'Documentation'
|
64
65
|
services: 'Web services'
|
65
66
|
services_close: 'Close'
|
67
|
+
tms: 'Tile Map Service'
|
66
68
|
relations:
|
67
69
|
ancestor: 'Source Datasets'
|
68
|
-
descendant: 'Derived Datasets
|
70
|
+
descendant: 'Derived Datasets'
|
69
71
|
browse_all: "Browse all %{count} records..."
|
70
|
-
title: 'Data Relations'
|
71
72
|
metadata:
|
73
|
+
toggle_summary: 'Toggle summary'
|
72
74
|
view_metadata: 'View Metadata'
|
73
75
|
more_details: 'More details at'
|
74
76
|
metadata_error: 'The metadata view for selected schema is not available'
|
@@ -103,6 +105,9 @@ en:
|
|
103
105
|
tiled_map_layer:
|
104
106
|
title: ArcGIS Tiled Map Layer
|
105
107
|
content: An ArcGIS Tiled Map Layer Service displays set of web-accessible tiles that reside on a server.
|
108
|
+
tms:
|
109
|
+
title: Tile Map Service
|
110
|
+
content: A Tile Map Service displays georeferenced map tiles as an image on a map.
|
106
111
|
wms:
|
107
112
|
title: Web Map Service (WMS)
|
108
113
|
content: A Web Map Service displays a geospatial dataset as map images.
|
data/geoblacklight.gemspec
CHANGED
@@ -19,31 +19,29 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.require_paths = ['lib']
|
20
20
|
spec.required_rubygems_version = '>= 2.5.2'
|
21
21
|
|
22
|
-
spec.add_dependency 'rails', '
|
22
|
+
spec.add_dependency 'rails', '>= 5.2.4', '< 6.2'
|
23
23
|
spec.add_dependency 'blacklight', '~> 7.0'
|
24
|
-
spec.add_dependency 'font-awesome-rails'
|
25
24
|
spec.add_dependency 'config'
|
26
25
|
spec.add_dependency 'faraday', '~> 1.0'
|
27
26
|
spec.add_dependency 'faraday_middleware', '~> 1.0.0.rc1'
|
28
27
|
spec.add_dependency 'coderay'
|
29
|
-
spec.add_dependency 'geoblacklight-icons', '>= 0.2'
|
30
28
|
spec.add_dependency 'deprecation'
|
31
29
|
spec.add_dependency 'geo_combine', '~> 0.4'
|
32
30
|
spec.add_dependency 'mime-types'
|
33
31
|
spec.add_dependency 'handlebars_assets'
|
34
|
-
spec.add_dependency '
|
32
|
+
spec.add_dependency 'rgeo-geojson'
|
35
33
|
|
36
34
|
spec.add_development_dependency 'solr_wrapper'
|
37
35
|
spec.add_development_dependency 'rails-controller-testing'
|
38
|
-
spec.add_development_dependency 'rspec-rails'
|
36
|
+
spec.add_development_dependency 'rspec-rails'
|
39
37
|
spec.add_development_dependency 'engine_cart', '~> 2.0'
|
40
38
|
spec.add_development_dependency 'capybara', '>= 2.5.0'
|
41
39
|
spec.add_development_dependency 'webdrivers'
|
42
40
|
spec.add_development_dependency 'factory_bot_rails'
|
43
41
|
spec.add_development_dependency 'database_cleaner', '~> 1.3'
|
44
|
-
spec.add_development_dependency '
|
45
|
-
spec.add_development_dependency 'coveralls'
|
46
|
-
spec.add_development_dependency 'simplecov', '~> 0.16'
|
42
|
+
spec.add_development_dependency 'simplecov', '~> 0.17.1'
|
47
43
|
spec.add_development_dependency 'foreman'
|
48
|
-
spec.add_development_dependency '
|
44
|
+
spec.add_development_dependency 'rubocop', '~> 1.10'
|
45
|
+
spec.add_development_dependency 'rubocop-rails', '~> 2.9'
|
46
|
+
spec.add_development_dependency 'rubocop-rspec', '~> 2.2'
|
49
47
|
end
|
data/jest.config.js
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
const util = require('util');
|
2
|
+
const exec = util.promisify(require('child_process').exec);
|
3
|
+
|
4
|
+
module.exports = async () => {
|
5
|
+
console.log('Getting asset pipeline lookup path from Rails');
|
6
|
+
const { stdout, stderr } = await exec('bundle exec rake geoblacklight:asset_paths');
|
7
|
+
if (stderr) {
|
8
|
+
console.error(stderr);
|
9
|
+
}
|
10
|
+
const paths = stdout.trim().split('\n');
|
11
|
+
return {
|
12
|
+
moduleDirectories: [
|
13
|
+
'node_modules',
|
14
|
+
'spec/javascripts',
|
15
|
+
...paths,
|
16
|
+
],
|
17
|
+
rootDir: './',
|
18
|
+
setupFilesAfterEnv: [
|
19
|
+
'<rootDir>/setupJest.js',
|
20
|
+
],
|
21
|
+
testMatch: [
|
22
|
+
'<rootDir>/spec/javascripts/**/*_spec.js',
|
23
|
+
],
|
24
|
+
};
|
25
|
+
};
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'rails/generators'
|
4
|
+
|
5
|
+
module Geoblacklight
|
6
|
+
class AssetsGenerator < Rails::Generators::Base
|
7
|
+
source_root File.expand_path('templates', __dir__)
|
8
|
+
|
9
|
+
desc <<-DESCRIPTION
|
10
|
+
This generator makes the following changes to your application:
|
11
|
+
1. Copies GBL javascript into the application
|
12
|
+
2. Removes stock Rails and Blacklight stylesheets from the application
|
13
|
+
3. Copies GBL stylesheets into the local application
|
14
|
+
4. Sets asset initializer values into the local application
|
15
|
+
DESCRIPTION
|
16
|
+
|
17
|
+
def add_javascript
|
18
|
+
copy_file 'assets/geoblacklight.js', 'app/assets/javascripts/geoblacklight.js'
|
19
|
+
|
20
|
+
if Rails.version.to_i == 6
|
21
|
+
append_to_file 'app/assets/javascripts/application.js',
|
22
|
+
"\n// Required by GeoBlacklight\n//= require geoblacklight"
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def remove_stylesheets
|
27
|
+
remove_file 'app/assets/stylesheets/application.css'
|
28
|
+
remove_file 'app/assets/stylesheets/blacklight.scss'
|
29
|
+
end
|
30
|
+
|
31
|
+
def add_stylesheets
|
32
|
+
copy_file 'assets/application.scss', 'app/assets/stylesheets/application.scss'
|
33
|
+
copy_file 'assets/_blacklight.scss', 'app/assets/stylesheets/_blacklight.scss'
|
34
|
+
copy_file 'assets/_customizations.scss', 'app/assets/stylesheets/_customizations.scss'
|
35
|
+
copy_file 'assets/_geoblacklight.scss', 'app/assets/stylesheets/_geoblacklight.scss'
|
36
|
+
end
|
37
|
+
|
38
|
+
def add_initializers
|
39
|
+
append_to_file 'config/initializers/assets.rb',
|
40
|
+
"\nRails.application.config.assets.precompile += %w( favicon.ico )\n"
|
41
|
+
|
42
|
+
append_to_file 'config/initializers/assets.rb',
|
43
|
+
"\nRails.application.config.assets.paths << Rails.root.join('vendor', 'assets', 'images')\n"
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require 'rails/generators'
|
2
3
|
|
3
4
|
module Geoblacklight
|
@@ -30,15 +31,8 @@ module Geoblacklight
|
|
30
31
|
inject_into_file 'config/routes.rb', routes, before: /^end/
|
31
32
|
end
|
32
33
|
|
33
|
-
def
|
34
|
-
|
35
|
-
copy_file 'geoblacklight.js', 'app/assets/javascripts/geoblacklight.js'
|
36
|
-
|
37
|
-
append_to_file 'config/initializers/assets.rb',
|
38
|
-
"\nRails.application.config.assets.precompile += %w( favicon.ico )\n"
|
39
|
-
|
40
|
-
append_to_file 'config/initializers/assets.rb',
|
41
|
-
"\nRails.application.config.assets.paths << Rails.root.join('vendor', 'assets', 'images')\n"
|
34
|
+
def generate_assets
|
35
|
+
generate 'geoblacklight:assets'
|
42
36
|
end
|
43
37
|
|
44
38
|
def create_blacklight_catalog
|
@@ -62,7 +56,7 @@ module Geoblacklight
|
|
62
56
|
|
63
57
|
def add_unique_key
|
64
58
|
inject_into_file 'app/models/solr_document.rb', after: "# self.unique_key = 'id'" do
|
65
|
-
"\n self.unique_key =
|
59
|
+
"\n self.unique_key = Settings.FIELDS.UNIQUE_KEY"
|
66
60
|
end
|
67
61
|
end
|
68
62
|
|
@@ -0,0 +1 @@
|
|
1
|
+
@import 'blacklight/blacklight';
|
@@ -0,0 +1,28 @@
|
|
1
|
+
// Local Application Customizations
|
2
|
+
|
3
|
+
// Set Header Logo
|
4
|
+
$logo-image: image_url('blacklight/logo.svg') !default;
|
5
|
+
|
6
|
+
.navbar-brand { /* The main logo image for the Blacklight instance */
|
7
|
+
@if $logo-image {
|
8
|
+
background: transparent $logo-image no-repeat top left;
|
9
|
+
}
|
10
|
+
}
|
11
|
+
|
12
|
+
// Optional
|
13
|
+
// Override default Bootstrap variables here
|
14
|
+
|
15
|
+
// Example: Bootstrap Colors
|
16
|
+
$blue: #007bff !default;
|
17
|
+
$indigo: #6610f2 !default;
|
18
|
+
$purple: #6f42c1 !default;
|
19
|
+
$pink: #e83e8c !default;
|
20
|
+
$red: #dc3545 !default;
|
21
|
+
$orange: #fd7e14 !default;
|
22
|
+
$yellow: #ffc107 !default;
|
23
|
+
$green: #28a745 !default;
|
24
|
+
$teal: #20c997 !default;
|
25
|
+
$cyan: #17a2b8 !default;
|
26
|
+
|
27
|
+
// Example: Bootstrap Link color
|
28
|
+
$link-color: $blue;
|
File without changes
|
@@ -29,7 +29,7 @@ class CatalogController < ApplicationController
|
|
29
29
|
#
|
30
30
|
config.default_document_solr_params = {
|
31
31
|
:qt => 'document',
|
32
|
-
:q =>
|
32
|
+
:q => "{!raw f=#{Settings.FIELDS.UNIQUE_KEY} v=$id}"
|
33
33
|
}
|
34
34
|
|
35
35
|
|
@@ -97,6 +97,7 @@ class CatalogController < ApplicationController
|
|
97
97
|
config.add_facet_field Settings.FIELDS.RIGHTS, label: 'Access', limit: 8, partial: "icon_facet"
|
98
98
|
config.add_facet_field Settings.FIELDS.GEOM_TYPE, label: 'Data type', limit: 8, partial: "icon_facet"
|
99
99
|
config.add_facet_field Settings.FIELDS.FILE_FORMAT, :label => 'Format', :limit => 8
|
100
|
+
config.add_facet_field Settings.FIELDS.SOURCE, show: false
|
100
101
|
|
101
102
|
# Have BL send all facet field names to Solr, which has been the default
|
102
103
|
# previously. Simply remove these lines if you'd rather use Solr request
|
@@ -245,8 +246,9 @@ class CatalogController < ApplicationController
|
|
245
246
|
# Custom tools for GeoBlacklight
|
246
247
|
config.add_show_tools_partial :web_services, if: proc { |_context, _config, options| options[:document] && (Settings.WEBSERVICES_SHOWN & options[:document].references.refs.map(&:type).map(&:to_s)).any? }
|
247
248
|
config.add_show_tools_partial :metadata, if: proc { |_context, _config, options| options[:document] && (Settings.METADATA_SHOWN & options[:document].references.refs.map(&:type).map(&:to_s)).any? }
|
248
|
-
config.add_show_tools_partial :
|
249
|
-
config.add_show_tools_partial :
|
249
|
+
config.add_show_tools_partial :carto, partial: 'carto', if: proc { |_context, _config, options| options[:document] && options[:document].carto_reference.present? }
|
250
|
+
config.add_show_tools_partial :arcgis, partial: 'arcgis', if: proc { |_context, _config, options| options[:document] && options[:document].arcgis_urls.present? }
|
251
|
+
config.add_show_tools_partial :data_dictionary, partial: 'data_dictionary', if: proc { |_context, _config, options| options[:document] && options[:document].data_dictionary_download.present? }
|
250
252
|
|
251
253
|
# Configure basemap provider for GeoBlacklight maps (uses https only basemap
|
252
254
|
# providers with open licenses)
|
@@ -4,12 +4,6 @@ APPLICATION_LOGO_URL: 'http://geoblacklight.org/images/geoblacklight-logo.png'
|
|
4
4
|
# Carto OneClick Service https://carto.com/engine/open-in-carto/
|
5
5
|
CARTO_ONECLICK_LINK: 'http://oneclick.carto.com/'
|
6
6
|
|
7
|
-
# Hide Carto export link
|
8
|
-
# CARTO_HIDE: true
|
9
|
-
|
10
|
-
# Hide ArcGIS export link
|
11
|
-
# ARCGIS_HIDE: true
|
12
|
-
|
13
7
|
# ArcGIS Online Base URL
|
14
8
|
ARCGIS_BASE_URL: 'https://www.arcgis.com/home/webmap/viewer.html'
|
15
9
|
|
@@ -27,24 +21,31 @@ OVERLAP_RATIO_BOOST: '2'
|
|
27
21
|
|
28
22
|
# Solr field mappings
|
29
23
|
FIELDS:
|
24
|
+
:CREATOR: 'dc_creator_sm'
|
25
|
+
:DESCRIPTION: 'dc_description_s'
|
30
26
|
:FILE_FORMAT: 'dc_format_s'
|
27
|
+
:GEOM_TYPE: 'layer_geom_type_s'
|
31
28
|
:GEOMETRY: 'solr_geom'
|
32
|
-
:
|
33
|
-
:
|
29
|
+
:IDENTIFIER: 'dc_identifier_s'
|
30
|
+
:ISSUED: 'dct_issued_s'
|
31
|
+
:LANGUAGE: 'dc_language_s'
|
32
|
+
:LAYER_MODIFIED: 'layer_modified_dt'
|
33
|
+
:OVERLAP_FIELD: 'solr_bboxtype'
|
34
|
+
:PART_OF: 'dct_isPartOf_sm'
|
35
|
+
:PUBLISHER: 'dc_publisher_s'
|
34
36
|
:PROVENANCE: 'dct_provenance_s'
|
35
|
-
:
|
37
|
+
:REFERENCES: 'dct_references_s'
|
38
|
+
:RIGHTS: 'dc_rights_s'
|
36
39
|
:SPATIAL_COVERAGE: 'dct_spatial_sm'
|
37
40
|
:SUBJECT: 'dc_subject_sm'
|
38
|
-
:
|
39
|
-
:
|
40
|
-
:CREATOR: 'dc_creator_sm'
|
41
|
-
:DESCRIPTION: 'dc_description_s'
|
42
|
-
:PUBLISHER: 'dc_publisher_s'
|
43
|
-
:PART_OF: 'dct_isPartOf_sm'
|
41
|
+
:SOURCE: 'dc_source_sm'
|
42
|
+
:SUPPRESSED: 'suppressed_b'
|
44
43
|
:TEMPORAL: 'dct_temporal_sm'
|
45
44
|
:TITLE: 'dc_title_s'
|
46
|
-
:
|
47
|
-
:
|
45
|
+
:TYPE: 'dc_type_s'
|
46
|
+
:UNIQUE_KEY: 'layer_slug_s'
|
47
|
+
:WXS_IDENTIFIER: 'layer_id_s'
|
48
|
+
:YEAR: 'solr_year_i'
|
48
49
|
|
49
50
|
# Institution deployed at
|
50
51
|
INSTITUTION: 'Stanford'
|
@@ -68,6 +69,7 @@ USE_GEOM_FOR_RELATIONS_ICON: false
|
|
68
69
|
# Web services shown in tool panel
|
69
70
|
WEBSERVICES_SHOWN:
|
70
71
|
- 'wms'
|
72
|
+
- 'tms'
|
71
73
|
- 'wfs'
|
72
74
|
- 'iiif'
|
73
75
|
- 'feature_layer'
|
@@ -128,4 +130,5 @@ HELP_TEXT:
|
|
128
130
|
- 'index_map'
|
129
131
|
- 'tiled_map_layer'
|
130
132
|
- 'wms'
|
133
|
+
- 'tms'
|
131
134
|
- 'oembed'
|
data/lib/geoblacklight.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require 'active_support/dependencies'
|
2
3
|
require 'geoblacklight/engine'
|
3
4
|
|
@@ -5,9 +6,9 @@ module Geoblacklight
|
|
5
6
|
require 'geoblacklight/bounding_box'
|
6
7
|
require 'geoblacklight/catalog_helper_override'
|
7
8
|
require 'geoblacklight/constants'
|
8
|
-
# require 'geoblacklight/controller_override'
|
9
9
|
require 'geoblacklight/exceptions'
|
10
10
|
require 'geoblacklight/geoblacklight_helper_behavior'
|
11
|
+
require 'geoblacklight/geometry'
|
11
12
|
require 'geoblacklight/view_helper_override'
|
12
13
|
require 'geoblacklight/item_viewer'
|
13
14
|
require 'geoblacklight/wms_layer'
|
@@ -35,7 +36,6 @@ module Geoblacklight
|
|
35
36
|
require 'geoblacklight/relation/relation_response'
|
36
37
|
|
37
38
|
def self.inject!
|
38
|
-
# CatalogController.send(:include, Geoblacklight::ControllerOverride)
|
39
39
|
CatalogController.send(:include, Geoblacklight::CatalogHelperOverride)
|
40
40
|
CatalogController.send(:include, Geoblacklight::ViewHelperOverride)
|
41
41
|
CatalogController.send(:helper, Geoblacklight::ViewHelperOverride) unless
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module Geoblacklight
|
2
3
|
##
|
3
4
|
# Transforms and parses a bounding box for various formats
|
@@ -27,7 +28,7 @@ module Geoblacklight
|
|
27
28
|
# @param [String] bbox as "W S E N"
|
28
29
|
# @return [Geoblacklight::BoundingBox]
|
29
30
|
def self.from_rectangle(rectangle)
|
30
|
-
rectangle_array = rectangle.split
|
31
|
+
rectangle_array = rectangle.split
|
31
32
|
message = 'Bounding box should be a string in Solr rectangle syntax e.g."W S E N"'
|
32
33
|
fail Geoblacklight::Exceptions::WrongBoundingBoxFormat, message if rectangle_array.count != 4
|
33
34
|
new(
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module Geoblacklight
|
2
3
|
# Module to declare application level constants and lookup hash
|
3
4
|
module Constants
|
@@ -15,6 +16,7 @@ module Geoblacklight
|
|
15
16
|
wcs: 'http://www.opengis.net/def/serviceType/ogc/wcs',
|
16
17
|
wfs: 'http://www.opengis.net/def/serviceType/ogc/wfs',
|
17
18
|
wms: 'http://www.opengis.net/def/serviceType/ogc/wms',
|
19
|
+
tms: 'https://wiki.osgeo.org/wiki/Tile_Map_Service_Specification',
|
18
20
|
hgl: 'http://schema.org/DownloadAction',
|
19
21
|
feature_layer: 'urn:x-esri:serviceType:ArcGIS#FeatureLayer',
|
20
22
|
tiled_map_layer: 'urn:x-esri:serviceType:ArcGIS#TiledMapLayer',
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module Geoblacklight
|
2
3
|
class Download
|
3
4
|
def initialize(document, options = {})
|
@@ -14,7 +15,7 @@ module Geoblacklight
|
|
14
15
|
end
|
15
16
|
|
16
17
|
def self.file_path
|
17
|
-
Settings.DOWNLOAD_PATH ||
|
18
|
+
Settings.DOWNLOAD_PATH || Rails.root.join('tmp', 'cache', 'downloads')
|
18
19
|
end
|
19
20
|
|
20
21
|
def file_path_and_name
|