geoblacklight 1.0.3 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -1
- data/.solr_wrapper +6 -0
- data/.travis.yml +18 -4
- data/README.md +2 -4
- data/Rakefile +58 -35
- data/app/assets/javascripts/geoblacklight/geoblacklight.js +1 -1
- data/app/assets/stylesheets/geoblacklight/modules/icon-customization.scss +5 -1
- data/app/assets/stylesheets/geoblacklight/modules/toolbar.scss +6 -0
- data/app/helpers/carto_helper.rb +36 -0
- data/app/helpers/geoblacklight_helper.rb +10 -9
- data/app/models/concerns/geoblacklight/solr_document.rb +1 -1
- data/app/models/concerns/geoblacklight/solr_document/carto.rb +28 -0
- data/app/views/catalog/_exports.html.erb +3 -3
- data/config/initializers/rails_config.rb +1 -1
- data/config/locales/geoblacklight.en.yml +1 -0
- data/geoblacklight.gemspec +9 -8
- data/lib/generators/geoblacklight/install_generator.rb +8 -14
- data/lib/generators/geoblacklight/templates/settings.yml +2 -2
- data/lib/geoblacklight/engine.rb +2 -1
- data/lib/geoblacklight/version.rb +1 -1
- data/lib/geoblacklight/view_helper_override.rb +1 -0
- data/lib/geoblacklight/wms_layer.rb +1 -1
- data/lib/tasks/geoblacklight.rake +19 -1
- data/schema/geoblacklight-schema.json +21 -23
- data/schema/geoblacklight-schema.md +10 -8
- data/solr/conf/_rest_managed.json +3 -0
- data/solr/conf/admin-extra.html +31 -0
- data/solr/conf/elevate.xml +36 -0
- data/solr/conf/mapping-ISOLatin1Accent.txt +246 -0
- data/{schema/solr → solr}/conf/protwords.txt +0 -0
- data/{schema/solr → solr}/conf/schema.xml +2 -4
- data/solr/conf/scripts.conf +24 -0
- data/{schema/solr → solr}/conf/solrconfig.xml +17 -6
- data/solr/conf/spellings.txt +2 -0
- data/solr/conf/stopwords.txt +58 -0
- data/solr/conf/stopwords_en.txt +58 -0
- data/{schema/solr → solr}/conf/synonyms.txt +31 -29
- data/solr/conf/xslt/example.xsl +132 -0
- data/solr/conf/xslt/example_atom.xsl +67 -0
- data/solr/conf/xslt/example_rss.xsl +66 -0
- data/solr/conf/xslt/luke.xsl +337 -0
- data/spec/controllers/catalog_controller_spec.rb +1 -1
- data/spec/controllers/download_controller_spec.rb +14 -8
- data/spec/features/configurable_basemap_spec.rb +0 -1
- data/spec/features/exports_spec.rb +4 -4
- data/spec/fixtures/solr_documents/esri-image-map-layer.json +2 -2
- data/spec/helpers/carto_helper_spec.rb +11 -0
- data/spec/helpers/geoblacklight_helpers_spec.rb +0 -8
- data/spec/models/concerns/geoblacklight/solr_document/{carto_db_spec.rb → carto_spec.rb} +6 -6
- data/spec/spec_helper.rb +8 -1
- data/spec/support/backport_test_helpers.rb +45 -0
- data/spec/test_app_templates/solr_documents +1 -0
- data/template.rb +1 -1
- metadata +88 -52
- data/app/models/concerns/geoblacklight/solr_document/carto_db.rb +0 -15
- data/config/jetty.yml +0 -6
- data/lib/generators/geoblacklight/templates/config/jetty.yml +0 -10
- data/lib/tasks/configure_solr.rake +0 -14
- data/schema/solr/conf/stopwords_en.txt +0 -34
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b2b4e8cdd2abd133e663a53e4ffd289a4a3a985c
|
4
|
+
data.tar.gz: 5d78163437e30eb35a0ef6fa0a88ed8d8fe77a7c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3516a9bcb20e42d49bad3ce0c4661a30a8b954da619f01372f36fe7e3ce8eb8b99bea0288a99fe2a13ddea48dad4cfa4cf5a42478589966e68b9f73fe093cc89
|
7
|
+
data.tar.gz: adf65bf73c7c7f56cfdca331beba85c47e71115e032177be4b8c7fe8858d468532778ecbe370f67095ed8aa573734f557c1eec7ebf2a53c65c67442a94176599
|
data/.gitignore
CHANGED
data/.solr_wrapper
ADDED
data/.travis.yml
CHANGED
@@ -1,12 +1,26 @@
|
|
1
|
-
cache: bundler
|
2
1
|
language: ruby
|
3
2
|
sudo: false
|
3
|
+
|
4
4
|
notifications:
|
5
5
|
email: false
|
6
6
|
|
7
7
|
rvm:
|
8
|
-
- 2.1
|
8
|
+
- 2.3.1
|
9
|
+
|
10
|
+
matrix:
|
11
|
+
include:
|
12
|
+
- rvm: 2.3.1
|
13
|
+
env: "RAILS_VERSION=4.2.6"
|
14
|
+
- rvm: 2.2.5
|
15
|
+
env: "RAILS_VERSION=5.0.0"
|
16
|
+
|
17
|
+
before_install:
|
18
|
+
- gem install bundler
|
9
19
|
|
10
20
|
env:
|
11
|
-
|
12
|
-
|
21
|
+
- "RAILS_VERSION=5.0.0"
|
22
|
+
|
23
|
+
global_env:
|
24
|
+
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true
|
25
|
+
|
26
|
+
jdk: oraclejdk8
|
data/README.md
CHANGED
@@ -17,13 +17,11 @@ Creating a new GeoBlacklight application from the template
|
|
17
17
|
$ rails new app-name -m https://raw.githubusercontent.com/geoblacklight/geoblacklight/master/template.rb
|
18
18
|
```
|
19
19
|
|
20
|
-
To
|
20
|
+
To launch app:
|
21
21
|
|
22
22
|
```
|
23
23
|
$ cd app-name
|
24
|
-
$ rake
|
25
|
-
$ rake jetty:unzip
|
26
|
-
$ rake geoblacklight:configure_solr
|
24
|
+
$ rake geoblacklight:server
|
27
25
|
```
|
28
26
|
|
29
27
|
Or install with [Docker](https://github.com/geoblacklight/geoblacklight-docker)
|
data/Rakefile
CHANGED
@@ -1,22 +1,18 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
require 'rubygems'
|
3
|
+
require 'rails'
|
1
4
|
begin
|
2
|
-
require 'bundler/gem_tasks'
|
3
5
|
require 'bundler/setup'
|
4
6
|
rescue LoadError
|
5
7
|
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
6
8
|
end
|
7
9
|
|
8
|
-
|
9
|
-
ZIP_URL = "https://github.com/projectblacklight/blacklight-jetty/archive/v#{BLACKLIGHT_JETTY_VERSION}.zip".freeze
|
10
|
-
APP_ROOT = File.dirname(__FILE__)
|
11
|
-
|
12
|
-
require 'rspec/core/rake_task'
|
10
|
+
require 'solr_wrapper'
|
13
11
|
require 'engine_cart/rake_task'
|
14
|
-
require '
|
12
|
+
require 'rspec/core/rake_task'
|
15
13
|
require 'rubocop/rake_task'
|
16
14
|
|
17
|
-
|
18
|
-
|
19
|
-
task default: :ci
|
15
|
+
EngineCart.fingerprint_proc = EngineCart.rails_fingerprint_proc
|
20
16
|
|
21
17
|
desc 'Run style checker'
|
22
18
|
RuboCop::RakeTask.new(:rubocop) do |task|
|
@@ -29,38 +25,65 @@ task spec: :rubocop do
|
|
29
25
|
RSpec::Core::RakeTask.new(:spec)
|
30
26
|
end
|
31
27
|
|
32
|
-
desc 'Load fixtures'
|
33
|
-
task fixtures: ['engine_cart:generate'] do
|
34
|
-
EngineCart.within_test_app do
|
35
|
-
system 'rake geoblacklight:solr:seed RAILS_ENV=test'
|
36
|
-
system 'rake geoblacklight:downloads:mkdir'
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
28
|
desc 'Run Teaspoon JavaScript tests'
|
41
29
|
task :teaspoon do
|
42
30
|
system('teaspoon --require=.internal_test_app/spec/teaspoon_env.rb')
|
43
31
|
end
|
44
32
|
|
45
|
-
desc '
|
46
|
-
task :
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
33
|
+
desc 'Run test suite'
|
34
|
+
task ci: ['geoblacklight:generate'] do
|
35
|
+
SolrWrapper.wrap do |solr|
|
36
|
+
solr.with_collection(name: 'blacklight-core', dir: File.join(File.expand_path('.', File.dirname(__FILE__)), 'solr', 'conf')) do
|
37
|
+
within_test_app do
|
38
|
+
system 'RAILS_ENV=test rake geoblacklight:index:seed'
|
39
|
+
end
|
40
|
+
Rake::Task['geoblacklight:coverage'].invoke
|
41
|
+
end
|
42
|
+
end
|
43
|
+
# Run JavaScript tests
|
44
|
+
Rake::Task['teaspoon'].invoke
|
45
|
+
end
|
46
|
+
|
47
|
+
namespace :geoblacklight do
|
48
|
+
desc 'Run tests with coverage'
|
49
|
+
task :coverage do
|
50
|
+
ENV['COVERAGE'] = 'true'
|
51
|
+
Rake::Task['spec'].invoke
|
52
|
+
end
|
53
|
+
|
54
|
+
desc 'Create the test rails app'
|
55
|
+
task generate: ['engine_cart:generate'] do
|
56
|
+
end
|
57
|
+
|
58
|
+
namespace :internal do
|
59
|
+
task seed: ['engine_cart:generate'] do
|
60
|
+
within_test_app do
|
61
|
+
system 'bundle exec rake geoblacklight:index:seed'
|
62
|
+
system 'bundle exec rake geoblacklight:downloads:mkdir'
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
54
66
|
|
55
|
-
|
56
|
-
|
67
|
+
desc 'Run Solr and GeoBlacklight for interactive development'
|
68
|
+
task :server, [:rails_server_args] do |_t, args|
|
69
|
+
if File.exist? EngineCart.destination
|
70
|
+
within_test_app do
|
71
|
+
system 'bundle update'
|
72
|
+
end
|
73
|
+
else
|
74
|
+
Rake::Task['engine_cart:generate'].invoke
|
75
|
+
end
|
57
76
|
|
58
|
-
|
59
|
-
|
77
|
+
SolrWrapper.wrap(port: '8983') do |solr|
|
78
|
+
solr.with_collection(name: 'blacklight-core', dir: File.join(File.expand_path('.', File.dirname(__FILE__)), 'solr', 'conf')) do
|
79
|
+
Rake::Task['geoblacklight:internal:seed'].invoke
|
80
|
+
|
81
|
+
within_test_app do
|
82
|
+
system "bundle exec rails s #{args[:rails_server_args]}"
|
83
|
+
end
|
84
|
+
end
|
60
85
|
end
|
61
|
-
# Run JavaScript tests
|
62
|
-
Rake::Task['teaspoon'].invoke
|
63
|
-
else
|
64
|
-
system('rake ci RAILS_ENV=test')
|
65
86
|
end
|
66
87
|
end
|
88
|
+
|
89
|
+
task default: [:ci]
|
@@ -42,7 +42,11 @@
|
|
42
42
|
@extend .fa, .fa-file-text-o;
|
43
43
|
}
|
44
44
|
|
45
|
-
.geoblacklight-
|
45
|
+
.geoblacklight-carto {
|
46
46
|
@extend .fa, .fa-map-marker;
|
47
47
|
}
|
48
48
|
|
49
|
+
// DEPRECATED: Will be removed in GeoBlacklight v2.0
|
50
|
+
.geoblacklight-cartodb {
|
51
|
+
@extend .geoblacklight-cartodb;
|
52
|
+
}
|
@@ -0,0 +1,36 @@
|
|
1
|
+
module CartoHelper
|
2
|
+
##
|
3
|
+
# Creates a Carto OneClick link link, using the configuration link
|
4
|
+
# @param [String] file_link
|
5
|
+
# @return [String]
|
6
|
+
def carto_link(file_link)
|
7
|
+
params = URI.encode_www_form(
|
8
|
+
file: file_link,
|
9
|
+
provider: carto_provider,
|
10
|
+
logo: Settings.APPLICATION_LOGO_URL
|
11
|
+
)
|
12
|
+
carto_oneclick_host + '?' + params
|
13
|
+
end
|
14
|
+
|
15
|
+
##
|
16
|
+
# Removes blank space from provider to accomodate Carto OneClick
|
17
|
+
#
|
18
|
+
def carto_provider
|
19
|
+
application_name.delete(' ')
|
20
|
+
end
|
21
|
+
|
22
|
+
private
|
23
|
+
|
24
|
+
##
|
25
|
+
# Method used to access setting and provide deprecation warnings to migrate
|
26
|
+
def carto_oneclick_host
|
27
|
+
if Settings.CARTODB_ONECLICK_LINK.present?
|
28
|
+
Deprecation.warn(
|
29
|
+
GeoblacklightHelper,
|
30
|
+
'Settings.CARTODB_ONECLICK_LINK is deprecated and will be removed in ' \
|
31
|
+
'Geoblacklight 2.0.0, use Settings.CARTO_ONECLICK_LINK instead'
|
32
|
+
)
|
33
|
+
end
|
34
|
+
Settings.CARTO_ONECLICK_LINK || Settings.CARTODB_ONECLICK_LINK
|
35
|
+
end
|
36
|
+
end
|
@@ -1,4 +1,7 @@
|
|
1
1
|
module GeoblacklightHelper
|
2
|
+
extend Deprecation
|
3
|
+
self.deprecation_horizon = 'Geoblacklight 2.0.0'
|
4
|
+
|
2
5
|
def sms_helper
|
3
6
|
content_tag(:i, '', class: 'fa fa-mobile fa-fw') + ' ' + t('blacklight.tools.sms')
|
4
7
|
end
|
@@ -103,23 +106,21 @@ module GeoblacklightHelper
|
|
103
106
|
|
104
107
|
##
|
105
108
|
# Removes blank space from provider to accomodate CartoDB OneClick
|
106
|
-
#
|
109
|
+
# @deprecated Use {#carto_provider} instead.
|
107
110
|
def cartodb_provider
|
108
|
-
|
111
|
+
carto_provider
|
109
112
|
end
|
113
|
+
deprecation_deprecate cartodb_provider: 'use GeoblacklightHelper#carto_provider instead'
|
110
114
|
|
111
115
|
##
|
112
|
-
# Creates a
|
116
|
+
# Creates a Carto OneClick link link, using the configuration link
|
113
117
|
# @param [String] file_link
|
114
118
|
# @return [String]
|
119
|
+
# @deprecated Use {#carto_link} instead.
|
115
120
|
def cartodb_link(file_link)
|
116
|
-
|
117
|
-
file: file_link,
|
118
|
-
provider: cartodb_provider,
|
119
|
-
logo: Settings.APPLICATION_LOGO_URL
|
120
|
-
)
|
121
|
-
Settings.CARTODB_ONECLICK_LINK + '?' + params
|
121
|
+
carto_link(file_link)
|
122
122
|
end
|
123
|
+
deprecation_deprecate carto_link: 'use GeoblacklightHelper#carto_link instead'
|
123
124
|
|
124
125
|
##
|
125
126
|
# Renders the partials for a Geoblacklight::Reference in the web services
|
@@ -4,7 +4,7 @@ module Geoblacklight
|
|
4
4
|
extend Blacklight::Solr::Document
|
5
5
|
|
6
6
|
include Geoblacklight::SolrDocument::Finder
|
7
|
-
include Geoblacklight::SolrDocument::
|
7
|
+
include Geoblacklight::SolrDocument::Carto
|
8
8
|
include Geoblacklight::SolrDocument::Inspection
|
9
9
|
|
10
10
|
delegate :download_types, to: :references
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module Geoblacklight
|
2
|
+
module SolrDocument
|
3
|
+
##
|
4
|
+
# Module for providing external Carto download references for a document
|
5
|
+
module Carto
|
6
|
+
extend Deprecation
|
7
|
+
self.deprecation_horizon = 'Geoblacklight 2.0.0'
|
8
|
+
##
|
9
|
+
# Returns a url to a file that should be used with CartoDB integration
|
10
|
+
# @return [String]
|
11
|
+
# @deprecated Use {#carto_reference} instead
|
12
|
+
def cartodb_reference
|
13
|
+
carto_reference
|
14
|
+
end
|
15
|
+
deprecation_deprecate(
|
16
|
+
cartodb_reference: 'use Geoblacklight::SolrDocument::Carto#carto_reference instead'
|
17
|
+
)
|
18
|
+
|
19
|
+
##
|
20
|
+
# Returns a url to a file that should be used with CartoDB integration
|
21
|
+
# @return [String]
|
22
|
+
def carto_reference
|
23
|
+
return unless public? && download_types.try(:[], :geojson).present?
|
24
|
+
Geoblacklight::GeojsonDownload.new(self).url_with_params
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<% document ||= @document %>
|
2
|
-
<% if document.
|
3
|
-
<%= link_to(
|
4
|
-
<span class='geoblacklight geoblacklight-
|
2
|
+
<% if document.carto_reference.present? %>
|
3
|
+
<%= link_to(carto_link(document.carto_reference), target: '_blank') do %>
|
4
|
+
<span class='geoblacklight geoblacklight-carto'></span><%= t('geoblacklight.tools.open_carto') %>
|
5
5
|
<% end %>
|
6
6
|
<% end %>
|
data/geoblacklight.gemspec
CHANGED
@@ -18,21 +18,22 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ['lib']
|
20
20
|
|
21
|
+
spec.add_dependency 'rails', '>= 4.2.0', '< 6'
|
21
22
|
spec.add_dependency 'blacklight', '~> 6.3'
|
22
23
|
spec.add_dependency 'leaflet-rails', '~> 0.7.3'
|
23
24
|
spec.add_dependency 'font-awesome-rails'
|
24
|
-
spec.add_dependency '
|
25
|
+
spec.add_dependency 'config'
|
25
26
|
spec.add_dependency 'faraday'
|
26
27
|
spec.add_dependency 'coderay'
|
27
28
|
spec.add_dependency 'geoblacklight-icons', '>= 0.2'
|
29
|
+
spec.add_dependency 'deprecation'
|
28
30
|
|
29
|
-
spec.add_development_dependency '
|
30
|
-
spec.add_development_dependency '
|
31
|
-
spec.add_development_dependency 'rspec-rails', '~> 3.
|
32
|
-
spec.add_development_dependency 'jettywrapper', '>= 2.0'
|
31
|
+
spec.add_development_dependency 'solr_wrapper'
|
32
|
+
spec.add_development_dependency 'rails-controller-testing'
|
33
|
+
spec.add_development_dependency 'rspec-rails', '~> 3.1'
|
33
34
|
spec.add_development_dependency 'engine_cart', '~> 0.10'
|
34
|
-
spec.add_development_dependency 'capybara', '
|
35
|
-
spec.add_development_dependency 'poltergeist'
|
35
|
+
spec.add_development_dependency 'capybara', '>= 2.5.0'
|
36
|
+
spec.add_development_dependency 'poltergeist'
|
36
37
|
spec.add_development_dependency 'factory_girl_rails'
|
37
|
-
spec.add_development_dependency 'database_cleaner'
|
38
|
+
spec.add_development_dependency 'database_cleaner', '~> 1.3'
|
38
39
|
end
|
@@ -4,13 +4,12 @@ module Geoblacklight
|
|
4
4
|
class Install < Rails::Generators::Base
|
5
5
|
source_root File.expand_path('../templates', __FILE__)
|
6
6
|
|
7
|
-
class_option :jettywrapper,
|
8
|
-
type: :boolean,
|
9
|
-
default: false,
|
10
|
-
desc: 'Use jettywrapper to download and control Jetty'
|
11
|
-
|
12
7
|
desc 'Install Geoblacklight'
|
13
8
|
|
9
|
+
def add_solr_wrapper
|
10
|
+
generate 'blacklight:solr5'
|
11
|
+
end
|
12
|
+
|
14
13
|
def mount_geoblacklight_engine
|
15
14
|
route "mount Geoblacklight::Engine => 'geoblacklight'"
|
16
15
|
end
|
@@ -36,15 +35,6 @@ module Geoblacklight
|
|
36
35
|
EOF
|
37
36
|
end
|
38
37
|
|
39
|
-
def install_jettywrapper
|
40
|
-
return unless options[:jettywrapper]
|
41
|
-
copy_file 'config/jetty.yml'
|
42
|
-
|
43
|
-
append_to_file 'Rakefile',
|
44
|
-
"\nZIP_URL = \"https://github.com/projectblacklight/blacklight-jetty/archive/v4.10.3.zip\"\n" \
|
45
|
-
"require 'jettywrapper'\n"
|
46
|
-
end
|
47
|
-
|
48
38
|
def assets
|
49
39
|
copy_file 'geoblacklight.scss', 'app/assets/stylesheets/geoblacklight.scss'
|
50
40
|
copy_file 'geoblacklight.js', 'app/assets/javascripts/geoblacklight.js'
|
@@ -62,6 +52,10 @@ module Geoblacklight
|
|
62
52
|
copy_file 'settings.yml', 'config/settings.yml'
|
63
53
|
end
|
64
54
|
|
55
|
+
def solr_config
|
56
|
+
directory '../../../../solr', 'solr'
|
57
|
+
end
|
58
|
+
|
65
59
|
def include_geoblacklight_solrdocument
|
66
60
|
inject_into_file 'app/models/solr_document.rb', after: 'include Blacklight::Solr::Document' do
|
67
61
|
"\n include Geoblacklight::SolrDocument"
|