geoblacklight 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +15 -0
  2. data/.gitignore +19 -0
  3. data/.gitmodules +5 -0
  4. data/Gemfile +11 -0
  5. data/LICENSE.txt +13 -0
  6. data/README.md +103 -0
  7. data/Rakefile +44 -0
  8. data/app/assets/images/blacklight/logo.png +0 -0
  9. data/app/assets/images/geoblacklight/src_berkeley.png +0 -0
  10. data/app/assets/images/geoblacklight/src_cambridge.png +0 -0
  11. data/app/assets/images/geoblacklight/src_harvard.png +0 -0
  12. data/app/assets/images/geoblacklight/src_maryland.png +0 -0
  13. data/app/assets/images/geoblacklight/src_massgis.png +0 -0
  14. data/app/assets/images/geoblacklight/src_mit.png +0 -0
  15. data/app/assets/images/geoblacklight/src_princeton.png +0 -0
  16. data/app/assets/images/geoblacklight/src_stanford.png +0 -0
  17. data/app/assets/images/geoblacklight/src_tufts.png +0 -0
  18. data/app/assets/images/geoblacklight/src_un.png +0 -0
  19. data/app/assets/images/geoblacklight/type_arc.png +0 -0
  20. data/app/assets/images/geoblacklight/type_dot.png +0 -0
  21. data/app/assets/images/geoblacklight/type_library.png +0 -0
  22. data/app/assets/images/geoblacklight/type_map.png +0 -0
  23. data/app/assets/images/geoblacklight/type_polygon.png +0 -0
  24. data/app/assets/images/geoblacklight/type_raster.png +0 -0
  25. data/app/assets/javascripts/geoblacklight/application.js +2 -0
  26. data/app/assets/javascripts/geoblacklight/geoblacklight.js +4 -0
  27. data/app/assets/javascripts/geoblacklight/modules/map-home.js +25 -0
  28. data/app/assets/javascripts/geoblacklight/modules/map-results.js +72 -0
  29. data/app/assets/javascripts/geoblacklight/modules/map-view.js +211 -0
  30. data/app/controllers/download_controller.rb +107 -0
  31. data/app/controllers/wms_controller.rb +81 -0
  32. data/app/helpers/geoblacklight_helper.rb +91 -0
  33. data/app/views/catalog/_document_list.html.erb +12 -0
  34. data/app/views/catalog/_home_text.html.erb +40 -0
  35. data/app/views/catalog/_index_header_default.html.erb +59 -0
  36. data/app/views/catalog/_show_default.html.erb +68 -0
  37. data/app/views/catalog/_show_sidebar.html.erb +76 -0
  38. data/geoblacklight.gemspec +36 -0
  39. data/lib/generators/geoblacklight/install_generator.rb +46 -0
  40. data/lib/generators/geoblacklight/templates/catalog_controller.rb +217 -0
  41. data/lib/generators/geoblacklight/templates/geoblacklight.css.scss +79 -0
  42. data/lib/generators/geoblacklight/templates/geoblacklight.js +1 -0
  43. data/lib/geoblacklight.rb +5 -0
  44. data/lib/geoblacklight/config.rb +0 -0
  45. data/lib/geoblacklight/engine.rb +15 -0
  46. data/lib/geoblacklight/fixtures_indexer.rb +34 -0
  47. data/lib/geoblacklight/version.rb +3 -0
  48. data/lib/tasks/geoblacklight.rake +13 -0
  49. data/spec/fixtures/geoblacklight_schema/transformed.json +53 -0
  50. data/spec/spec_helper.rb +37 -0
  51. data/spec/test_app_templates/lib/generators/test_app_generator.rb +23 -0
  52. metadata +299 -0
@@ -0,0 +1 @@
1
+ //= require geoblacklight/application
@@ -0,0 +1,5 @@
1
+ require "geoblacklight/engine"
2
+
3
+ module Geoblacklight
4
+ require 'geoblacklight/config'
5
+ end
File without changes
@@ -0,0 +1,15 @@
1
+ require 'blacklight'
2
+ require 'leaflet-rails'
3
+ require 'httparty'
4
+ require 'font-awesome-rails'
5
+
6
+ module Geoblacklight
7
+ class Engine < ::Rails::Engine
8
+
9
+ # GeoblacklightHelper is needed by all helpers, so we inject it
10
+ # into action view base here.
11
+ initializer 'geoblacklight.helpers' do |app|
12
+ ActionView::Base.send :include, GeoblacklightHelper
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,34 @@
1
+ require "#{Rails.root}/spec/fixtures/geoblacklight_schema"
2
+
3
+ class FixturesIndexer
4
+ def self.run
5
+ FixturesIndexer.new.run
6
+ end
7
+ def initialize
8
+ @solr = Blacklight.solr
9
+ end
10
+ def run
11
+ index
12
+ commit
13
+ end
14
+ def fixtures
15
+ @fixtures ||= JSON::parse(File.read("#{Rails.root}/spec/fixtures/geoblacklight_schema/transformed.json"))
16
+ # @fixtures ||= file_list.map do |file|
17
+ # fixture_template = ERB.new(File.read(file))
18
+ # rendered_template = fixture_template.result(binding)
19
+ # YAML::load rendered_template
20
+ # end
21
+ end
22
+ def file_list
23
+ # data = JSON::parse(File.read("#{Rails.root}/spec/fixtures/geoblacklight_schema/transformed.json"))
24
+ # @file_list ||= Dir["#{Rails.root}/spec/fixtures/solr_documents/*.yml"]
25
+ end
26
+
27
+ private
28
+ def index
29
+ @solr.add fixtures
30
+ end
31
+ def commit
32
+ @solr.commit
33
+ end
34
+ end
@@ -0,0 +1,3 @@
1
+ module Geoblacklight
2
+ VERSION = "0.0.2"
3
+ end
@@ -0,0 +1,13 @@
1
+ require 'rails/generators'
2
+ require 'generators/geoblacklight/install_generator'
3
+
4
+ namespace :geoblacklight do
5
+ namespace :solr do
6
+ desc "Put sample data into solr"
7
+ task :seed => :environment do
8
+ docs = JSON::parse(File.read("#{Rails.root}/spec/fixtures/geoblacklight_schema/selected.json"))
9
+ Blacklight.solr.add docs
10
+ Blacklight.solr.commit
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,53 @@
1
+ [{
2
+ "uuid": "http://purl.stanford.edu/bw938nk9584",
3
+ "dc_description_s": "This polygon dataset shows post-delimitation state Legislative Assembly constituency boundaries and data relating to the 2008 Assembly elections for the State of Tripura, India. Map includes data for 60 constituencies. Includes attribute data on election parties, candidates, voters, and results. This layer is part of the Poll Map of India which includes parliamentary constituency boundaries for India, Assembly constituency boundaries for all states, and data relating to the past national elections for each State of India.; This data can be used for election analysis, forecasting, and mapping: Enables profiling of individual constituencies, permits historical analysis of the data, and helps predictive estimate of the impact of regional and state-wise electorate swings on the performance of political parties. These data are intended for researchers, students, and policy makers for reference and mapping purposes, and may be used for basic applications such as viewing, querying, and map output production.; ",
4
+ "dc_format_s": "Shapefile",
5
+ "dc_identifier_s": "http://purl.stanford.edu/bw938nk9584",
6
+ "dc_language_s": "English",
7
+ "dc_publisher_s": "ML InfoMap (Firm)",
8
+ "dc_rights_s": "Restricted",
9
+ "dc_subject_sm": [
10
+ "Elections",
11
+ "Political Parties",
12
+ "Voting",
13
+ "Politics and government",
14
+ "Boundaries",
15
+ "Society"
16
+ ],
17
+ "dc_title_s": "Tripura, India: Post Delimitation State Assembly Constituency Boundaries and Election Data, 2008",
18
+ "dc_type_s": "Dataset",
19
+ "dct_isPartOf_sm": [
20
+ "My Collection"
21
+ ],
22
+ "dct_references_sm": "{\"@context\":\"http://github.com/OSGeo/Cat-Interop\",\"http://www.opengis.net/def/serviceType/ogc/wfs\":\"http://geowebservices-restricted.stanford.edu/geoserver/wfs\",\"http://www.opengis.net/def/serviceType/ogc/wms\":\"http://geowebservices-restricted.stanford.edu/geoserver/wms\",\"http://library.stanford.edu/iiif/image-api/1.1/context.json\":\"http://purl.stanford.edu/bw938nk9584.iiif\",\"http://schema.org/thumbnailUrl\":\"http://purl.stanford.edu/bw938nk9584.jpg\",\"http://schema.org/url\":\"http://purl.stanford.edu/bw938nk9584\",\"http://www.isotc211.org/schemas/2005/gmd/\":\"http://purl.stanford.edu/bw938nk9584.iso19139\",\"http://www.loc.gov/mods/v3\":\"http://purl.stanford.edu/bw938nk9584.mods\"}",
23
+ "dct_spatial_sm": [
24
+ "Tripura",
25
+ "Belonia",
26
+ "Dharmanagar",
27
+ "Kalyanpur",
28
+ "Khowai",
29
+ "Badharghat",
30
+ "Pabiachhara",
31
+ "Salgarh",
32
+ "Surma",
33
+ "Town Bordowali",
34
+ "Simna"
35
+ ],
36
+ "dct_temporal_sm": [
37
+ "2008"
38
+ ],
39
+ "dct_issued_s": "2000",
40
+ "dct_provenance_s": "Stanford",
41
+ "georss_box_s": "22.948088 91.153656 24.521009 92.334389",
42
+ "georss_polygon_s": "24.521009 91.153656 24.521009 92.334389 22.948088 92.334389 22.948088 91.153656 24.521009 91.153656",
43
+ "layer_slug_s": "stanford-bw938nk9584",
44
+ "layer_id_s": "druid:bw938nk9584",
45
+ "layer_geom_type_s": "Polygon",
46
+ "solr_bbox": "91.153656 22.948088 92.334389 24.521009",
47
+ "solr_ne_pt": "24.521009,92.334389",
48
+ "solr_sw_pt": "22.948088,91.153656",
49
+ "solr_year_i": 2008,
50
+ "solr_issued_dt": "2000-01-01T00:00:00Z",
51
+ "solr_wms_url": "http://geowebservices-restricted.stanford.edu/geoserver/wms",
52
+ "solr_wfs_url": "http://geowebservices-restricted.stanford.edu/geoserver/wfs"
53
+ }]
@@ -0,0 +1,37 @@
1
+ ENV["RAILS_ENV"] ||= 'test'
2
+
3
+ require 'engine_cart'
4
+ EngineCart.load_application!
5
+
6
+ require 'capybara/poltergeist'
7
+ Capybara.javascript_driver = :poltergeist
8
+
9
+ Capybara.register_driver :poltergeist do |app|
10
+ options = {}
11
+
12
+ options[:timeout] = 120 if RUBY_PLATFORM == "java"
13
+
14
+ Capybara::Poltergeist::Driver.new(app, options)
15
+ end
16
+
17
+ if ENV["COVERAGE"] or ENV["CI"]
18
+ require 'simplecov'
19
+ require 'coveralls'
20
+
21
+ SimpleCov.formatter = Coveralls::SimpleCov::Formatter
22
+ SimpleCov.start do
23
+ add_filter "/spec/"
24
+ end
25
+ end
26
+
27
+
28
+ require 'Geoblacklight'
29
+
30
+ require 'rspec/rails'
31
+ require 'rspec/autorun'
32
+ require 'capybara/rspec'
33
+
34
+
35
+ RSpec.configure do |config|
36
+
37
+ end
@@ -0,0 +1,23 @@
1
+ require 'rails/generators'
2
+
3
+ class TestAppGenerator < Rails::Generators::Base
4
+ source_root "./spec/test_app_templates"
5
+
6
+ def add_gems
7
+ gem 'blacklight', ">= 5.4.0"
8
+ Bundler.with_clean_env do
9
+ run "bundle install"
10
+ end
11
+ end
12
+
13
+ def run_blacklight_generator
14
+ say_status("warning", "GENERATING BL", :yellow)
15
+
16
+ generate 'blacklight:install'
17
+ end
18
+
19
+ def install_engine
20
+ generate 'geoblacklight:install'
21
+ end
22
+
23
+ end
metadata ADDED
@@ -0,0 +1,299 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: geoblacklight
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: ruby
6
+ authors:
7
+ - Darren Hardy
8
+ - Jack Reed
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2014-07-02 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rails
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ~>
19
+ - !ruby/object:Gem::Version
20
+ version: 4.0.0
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ~>
26
+ - !ruby/object:Gem::Version
27
+ version: 4.0.0
28
+ - !ruby/object:Gem::Dependency
29
+ name: blacklight
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ~>
33
+ - !ruby/object:Gem::Version
34
+ version: 5.4.0
35
+ type: :runtime
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ~>
40
+ - !ruby/object:Gem::Version
41
+ version: 5.4.0
42
+ - !ruby/object:Gem::Dependency
43
+ name: bootstrap-sass
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ~>
47
+ - !ruby/object:Gem::Version
48
+ version: '3.0'
49
+ type: :runtime
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ~>
54
+ - !ruby/object:Gem::Version
55
+ version: '3.0'
56
+ - !ruby/object:Gem::Dependency
57
+ name: leaflet-rails
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ~>
61
+ - !ruby/object:Gem::Version
62
+ version: 0.7.3
63
+ type: :runtime
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ~>
68
+ - !ruby/object:Gem::Version
69
+ version: 0.7.3
70
+ - !ruby/object:Gem::Dependency
71
+ name: blacklight_range_limit
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ~>
75
+ - !ruby/object:Gem::Version
76
+ version: 5.0.1
77
+ type: :runtime
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ~>
82
+ - !ruby/object:Gem::Version
83
+ version: 5.0.1
84
+ - !ruby/object:Gem::Dependency
85
+ name: font-awesome-rails
86
+ requirement: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ~>
89
+ - !ruby/object:Gem::Version
90
+ version: 4.1.0.0
91
+ type: :runtime
92
+ prerelease: false
93
+ version_requirements: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - ~>
96
+ - !ruby/object:Gem::Version
97
+ version: 4.1.0.0
98
+ - !ruby/object:Gem::Dependency
99
+ name: httparty
100
+ requirement: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - ~>
103
+ - !ruby/object:Gem::Version
104
+ version: 0.13.1
105
+ type: :runtime
106
+ prerelease: false
107
+ version_requirements: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - ~>
110
+ - !ruby/object:Gem::Version
111
+ version: 0.13.1
112
+ - !ruby/object:Gem::Dependency
113
+ name: bundler
114
+ requirement: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - ~>
117
+ - !ruby/object:Gem::Version
118
+ version: '1.5'
119
+ type: :development
120
+ prerelease: false
121
+ version_requirements: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - ~>
124
+ - !ruby/object:Gem::Version
125
+ version: '1.5'
126
+ - !ruby/object:Gem::Dependency
127
+ name: rake
128
+ requirement: !ruby/object:Gem::Requirement
129
+ requirements:
130
+ - - ~>
131
+ - !ruby/object:Gem::Version
132
+ version: 10.3.2
133
+ type: :development
134
+ prerelease: false
135
+ version_requirements: !ruby/object:Gem::Requirement
136
+ requirements:
137
+ - - ~>
138
+ - !ruby/object:Gem::Version
139
+ version: 10.3.2
140
+ - !ruby/object:Gem::Dependency
141
+ name: rspec-rails
142
+ requirement: !ruby/object:Gem::Requirement
143
+ requirements:
144
+ - - ~>
145
+ - !ruby/object:Gem::Version
146
+ version: 3.0.1
147
+ type: :development
148
+ prerelease: false
149
+ version_requirements: !ruby/object:Gem::Requirement
150
+ requirements:
151
+ - - ~>
152
+ - !ruby/object:Gem::Version
153
+ version: 3.0.1
154
+ - !ruby/object:Gem::Dependency
155
+ name: jettywrapper
156
+ requirement: !ruby/object:Gem::Requirement
157
+ requirements:
158
+ - - ~>
159
+ - !ruby/object:Gem::Version
160
+ version: 1.7.0
161
+ type: :development
162
+ prerelease: false
163
+ version_requirements: !ruby/object:Gem::Requirement
164
+ requirements:
165
+ - - ~>
166
+ - !ruby/object:Gem::Version
167
+ version: 1.7.0
168
+ - !ruby/object:Gem::Dependency
169
+ name: engine_cart
170
+ requirement: !ruby/object:Gem::Requirement
171
+ requirements:
172
+ - - ~>
173
+ - !ruby/object:Gem::Version
174
+ version: 0.3.4
175
+ type: :development
176
+ prerelease: false
177
+ version_requirements: !ruby/object:Gem::Requirement
178
+ requirements:
179
+ - - ~>
180
+ - !ruby/object:Gem::Version
181
+ version: 0.3.4
182
+ - !ruby/object:Gem::Dependency
183
+ name: capybara
184
+ requirement: !ruby/object:Gem::Requirement
185
+ requirements:
186
+ - - ~>
187
+ - !ruby/object:Gem::Version
188
+ version: 2.3.0
189
+ type: :development
190
+ prerelease: false
191
+ version_requirements: !ruby/object:Gem::Requirement
192
+ requirements:
193
+ - - ~>
194
+ - !ruby/object:Gem::Version
195
+ version: 2.3.0
196
+ - !ruby/object:Gem::Dependency
197
+ name: poltergeist
198
+ requirement: !ruby/object:Gem::Requirement
199
+ requirements:
200
+ - - ~>
201
+ - !ruby/object:Gem::Version
202
+ version: 1.5.0
203
+ type: :development
204
+ prerelease: false
205
+ version_requirements: !ruby/object:Gem::Requirement
206
+ requirements:
207
+ - - ~>
208
+ - !ruby/object:Gem::Version
209
+ version: 1.5.0
210
+ description: GeoBlacklight started at Stanford and its goal is to provide a world-class
211
+ discovery platform for geospatial (GIS) holdings. It is an open collaborative project
212
+ aiming to build off of the successes of the Blacklight Solr-powered discovery interface
213
+ and the multi-institutional OpenGeoportal federated metadata sharing communities.
214
+ email:
215
+ - drh@stanford.edu
216
+ - pjreed@stanford.edu
217
+ executables: []
218
+ extensions: []
219
+ extra_rdoc_files: []
220
+ files:
221
+ - .gitignore
222
+ - .gitmodules
223
+ - Gemfile
224
+ - LICENSE.txt
225
+ - README.md
226
+ - Rakefile
227
+ - app/assets/images/blacklight/logo.png
228
+ - app/assets/images/geoblacklight/src_berkeley.png
229
+ - app/assets/images/geoblacklight/src_cambridge.png
230
+ - app/assets/images/geoblacklight/src_harvard.png
231
+ - app/assets/images/geoblacklight/src_maryland.png
232
+ - app/assets/images/geoblacklight/src_massgis.png
233
+ - app/assets/images/geoblacklight/src_mit.png
234
+ - app/assets/images/geoblacklight/src_princeton.png
235
+ - app/assets/images/geoblacklight/src_stanford.png
236
+ - app/assets/images/geoblacklight/src_tufts.png
237
+ - app/assets/images/geoblacklight/src_un.png
238
+ - app/assets/images/geoblacklight/type_arc.png
239
+ - app/assets/images/geoblacklight/type_dot.png
240
+ - app/assets/images/geoblacklight/type_library.png
241
+ - app/assets/images/geoblacklight/type_map.png
242
+ - app/assets/images/geoblacklight/type_polygon.png
243
+ - app/assets/images/geoblacklight/type_raster.png
244
+ - app/assets/javascripts/geoblacklight/application.js
245
+ - app/assets/javascripts/geoblacklight/geoblacklight.js
246
+ - app/assets/javascripts/geoblacklight/modules/map-home.js
247
+ - app/assets/javascripts/geoblacklight/modules/map-results.js
248
+ - app/assets/javascripts/geoblacklight/modules/map-view.js
249
+ - app/controllers/download_controller.rb
250
+ - app/controllers/wms_controller.rb
251
+ - app/helpers/geoblacklight_helper.rb
252
+ - app/views/catalog/_document_list.html.erb
253
+ - app/views/catalog/_home_text.html.erb
254
+ - app/views/catalog/_index_header_default.html.erb
255
+ - app/views/catalog/_show_default.html.erb
256
+ - app/views/catalog/_show_sidebar.html.erb
257
+ - geoblacklight.gemspec
258
+ - lib/generators/geoblacklight/install_generator.rb
259
+ - lib/generators/geoblacklight/templates/catalog_controller.rb
260
+ - lib/generators/geoblacklight/templates/geoblacklight.css.scss
261
+ - lib/generators/geoblacklight/templates/geoblacklight.js
262
+ - lib/geoblacklight.rb
263
+ - lib/geoblacklight/config.rb
264
+ - lib/geoblacklight/engine.rb
265
+ - lib/geoblacklight/fixtures_indexer.rb
266
+ - lib/geoblacklight/version.rb
267
+ - lib/tasks/geoblacklight.rake
268
+ - spec/fixtures/geoblacklight_schema/transformed.json
269
+ - spec/spec_helper.rb
270
+ - spec/test_app_templates/lib/generators/test_app_generator.rb
271
+ homepage: http://github.com/sul-dlss/geoblacklight
272
+ licenses:
273
+ - Apache 2.0
274
+ metadata: {}
275
+ post_install_message:
276
+ rdoc_options: []
277
+ require_paths:
278
+ - lib
279
+ required_ruby_version: !ruby/object:Gem::Requirement
280
+ requirements:
281
+ - - ! '>='
282
+ - !ruby/object:Gem::Version
283
+ version: '0'
284
+ required_rubygems_version: !ruby/object:Gem::Requirement
285
+ requirements:
286
+ - - ! '>='
287
+ - !ruby/object:Gem::Version
288
+ version: '0'
289
+ requirements: []
290
+ rubyforge_project:
291
+ rubygems_version: 2.2.2
292
+ signing_key:
293
+ specification_version: 4
294
+ summary: A discovery platform for geospatial holdings
295
+ test_files:
296
+ - spec/fixtures/geoblacklight_schema/transformed.json
297
+ - spec/spec_helper.rb
298
+ - spec/test_app_templates/lib/generators/test_app_generator.rb
299
+ has_rdoc: