geoblacklight 0.7.0 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/Rakefile +19 -19
  4. data/app/assets/stylesheets/geoblacklight/_geoblacklight.scss +2 -0
  5. data/app/assets/stylesheets/geoblacklight/modules/coderay.scss +147 -0
  6. data/app/assets/stylesheets/geoblacklight/modules/icon-customization.scss +5 -1
  7. data/app/assets/stylesheets/geoblacklight/modules/metadata.scss +5 -0
  8. data/app/assets/stylesheets/geoblacklight/modules/results.scss +1 -0
  9. data/app/assets/stylesheets/geoblacklight/modules/toolbar.scss +6 -0
  10. data/app/controllers/download_controller.rb +5 -5
  11. data/app/views/catalog/_downloads.html.erb +48 -0
  12. data/app/views/catalog/_home_text.html.erb +6 -6
  13. data/app/views/catalog/_index_split_default.html.erb +2 -2
  14. data/app/views/catalog/_metadata.html.erb +12 -0
  15. data/app/views/catalog/_search_form_no_navbar.html.erb +2 -2
  16. data/app/views/catalog/metadata.html.erb +1 -0
  17. data/app/views/catalog/metadata.js.erb +7 -0
  18. data/app/views/catalog/{web_services.html → web_services.html.erb} +0 -0
  19. data/config/locales/geoblacklight.en.yml +3 -0
  20. data/geoblacklight.gemspec +1 -0
  21. data/lib/generators/geoblacklight/templates/catalog_controller.rb +2 -0
  22. data/lib/generators/geoblacklight/templates/settings.yml +7 -1
  23. data/lib/geoblacklight.rb +1 -0
  24. data/lib/geoblacklight/controller_override.rb +4 -0
  25. data/lib/geoblacklight/download.rb +70 -58
  26. data/lib/geoblacklight/download/geojson_download.rb +19 -17
  27. data/lib/geoblacklight/download/geotiff_download.rb +17 -15
  28. data/lib/geoblacklight/download/hgl_download.rb +15 -13
  29. data/lib/geoblacklight/download/kmz_download.rb +14 -12
  30. data/lib/geoblacklight/download/shapefile_download.rb +14 -12
  31. data/lib/geoblacklight/engine.rb +1 -0
  32. data/lib/geoblacklight/metadata.rb +41 -0
  33. data/lib/geoblacklight/routes.rb +1 -0
  34. data/lib/geoblacklight/solr_document.rb +7 -1
  35. data/lib/geoblacklight/version.rb +1 -1
  36. data/lib/tasks/configure_solr.rake +36 -0
  37. data/lib/tasks/geoblacklight.rake +0 -6
  38. data/spec/controllers/download_controller_spec.rb +1 -1
  39. data/spec/features/download_layer_spec.rb +3 -3
  40. data/spec/features/metadata_panel_spec.rb +22 -0
  41. data/spec/fixtures/solr_documents/actual-papermap1.json +0 -1
  42. data/spec/fixtures/solr_documents/actual-point1.json +0 -1
  43. data/spec/fixtures/solr_documents/actual-polygon1.json +1 -2
  44. data/spec/fixtures/solr_documents/actual-raster1.json +1 -2
  45. data/spec/fixtures/solr_documents/harvard_raster.json +1 -2
  46. data/spec/fixtures/solr_documents/public_iiif_princeton.json +0 -1
  47. data/spec/fixtures/solr_documents/public_polygon_mit.json +1 -6
  48. data/spec/fixtures/solr_documents/restricted-line.json +1 -2
  49. data/spec/lib/geoblacklight/download/geojson_download_spec.rb +9 -4
  50. data/spec/lib/geoblacklight/download/geotiff_download_spec.rb +9 -4
  51. data/spec/lib/geoblacklight/download/hgl_download_spec.rb +8 -3
  52. data/spec/lib/geoblacklight/download/kmz_download_spec.rb +9 -4
  53. data/spec/lib/geoblacklight/download/shapefile_download_spec.rb +9 -4
  54. data/spec/lib/geoblacklight/download_spec.rb +3 -3
  55. data/spec/lib/geoblacklight/metadata_spec.rb +25 -0
  56. metadata +29 -4
  57. data/app/views/catalog/_show_tools.html.erb +0 -63
@@ -12,6 +12,7 @@ module Geoblacklight
12
12
  get 'download/file/:id' => 'download#file', as: :download_file
13
13
  get 'download/hgl/:id' => 'download#hgl', as: :download_hgl
14
14
  get "#{primary_resource}/:id/web_services" => "#{primary_resource}#web_services", as: "web_services_#{primary_resource}"
15
+ get "#{primary_resource}/:id/metadata" => "#{primary_resource}#metadata", as: "metadata_#{primary_resource}"
15
16
  end
16
17
  end
17
18
  end
@@ -52,7 +52,13 @@ module Geoblacklight
52
52
  end
53
53
 
54
54
  def bounding_box_as_wsen
55
- get(Settings.GEOMETRY_FIELD.to_sym)
55
+ s = get(Settings.GEOMETRY_FIELD.to_sym)
56
+ if s =~ /^\s*ENVELOPE\(\s*([-\.\d]+)\s*,\s*([-\.\d]+)\s*,\s*([-\.\d]+)\s*,\s*([-\.\d]+)\s*\)\s*$/
57
+ w, s, e, n = $1, $4, $2, $3
58
+ return "#{w} #{s} #{e} #{n}"
59
+ else
60
+ return s # as-is, not a WKT
61
+ end
56
62
  end
57
63
  ##
58
64
  # Provides a convenience method to access a SolrDocument's References
@@ -1,3 +1,3 @@
1
1
  module Geoblacklight
2
- VERSION = '0.7.0'
2
+ VERSION = '0.7.1'
3
3
  end
@@ -0,0 +1,36 @@
1
+ require 'rails/generators'
2
+ require 'generators/geoblacklight/install_generator'
3
+ require 'geoblacklight'
4
+ require 'open-uri'
5
+
6
+ namespace :geoblacklight do
7
+ desc 'Copies the default SOLR config for the included Solr'
8
+ task :configure_solr do
9
+ files_urls = [
10
+ {
11
+ url: 'https://raw.githubusercontent.com/geoblacklight/geoblacklight-schema/v0.3.0/conf/schema.xml',
12
+ file: 'schema.xml'
13
+ },
14
+ {
15
+ url: 'https://raw.githubusercontent.com/geoblacklight/geoblacklight-schema/v0.3.0/conf/solrconfig.xml',
16
+ file: 'solrconfig.xml'
17
+ }
18
+ ]
19
+ files_urls.each do |item|
20
+ puts item.inspect
21
+ begin
22
+ open(item[:url]) do |io|
23
+ IO.copy_stream(io, "jetty/solr/blacklight-core/conf/#{item[:file]}")
24
+ end
25
+ rescue Exception => e
26
+ abort "Unable to download #{item[:file]} from #{item[:url]} #{e.message}"
27
+ end
28
+ end
29
+ end
30
+
31
+ # Leaving this task in for backwards compatibility
32
+ desc 'Runs geoblacklight:configure_solr, you should just use geoblacklight:configure_solr'
33
+ task :configure_jetty do
34
+ Rake::Task['geoblacklight:configure_solr'].invoke
35
+ end
36
+ end
@@ -2,12 +2,6 @@ require 'rails/generators'
2
2
  require 'generators/geoblacklight/install_generator'
3
3
 
4
4
  namespace :geoblacklight do
5
- desc "Copies the default SOLR config for the included Solr"
6
- task :configure_jetty do
7
- system 'curl -o jetty/solr/blacklight-core/conf/schema.xml https://raw.githubusercontent.com/geoblacklight/geoblacklight-schema/master/conf/schema.xml'
8
- system 'curl -o jetty/solr/blacklight-core/conf/solrconfig.xml https://raw.githubusercontent.com/geoblacklight/geoblacklight-schema/master/conf/solrconfig.xml'
9
- end
10
-
11
5
  namespace :solr do
12
6
  desc "Put sample data into solr"
13
7
  task :seed => :environment do
@@ -33,7 +33,7 @@ describe Geoblacklight::DownloadController, type: :controller do
33
33
  end
34
34
  describe '#hgl' do
35
35
  it 'should request file' do
36
- expect_any_instance_of(HglDownload).to receive(:get).and_return('success')
36
+ expect_any_instance_of(Geoblacklight::HglDownload).to receive(:get).and_return('success')
37
37
  get :hgl, id: 'harvard-g7064-s2-1834-k3', email: 'foo@example.com'
38
38
  expect(response.status).to eq 200
39
39
  end
@@ -2,13 +2,13 @@ require 'spec_helper'
2
2
 
3
3
  feature 'Download layer' do
4
4
  scenario 'clicking initial shapefile download button should trigger download', js: true do
5
- expect_any_instance_of(ShapefileDownload).to receive(:get).and_return('mit-us-ma-e25zcta5dct-2000-shapefile.zip')
5
+ expect_any_instance_of(Geoblacklight::ShapefileDownload).to receive(:get).and_return('mit-us-ma-e25zcta5dct-2000-shapefile.zip')
6
6
  visit catalog_path('mit-us-ma-e25zcta5dct-2000')
7
7
  find('a', text: 'Download Shapefile').click
8
8
  expect(page).to have_css('a', text: 'Your file mit-us-ma-e25zcta5dct-2000-shapefile.zip is ready for download')
9
9
  end
10
10
  scenario 'clicking kmz download button should trigger download', js: true do
11
- expect_any_instance_of(KmzDownload).to receive(:get).and_return('mit-us-ma-e25zcta5dct-2000-kmz.kmz')
11
+ expect_any_instance_of(Geoblacklight::KmzDownload).to receive(:get).and_return('mit-us-ma-e25zcta5dct-2000-kmz.kmz')
12
12
  visit catalog_path('mit-us-ma-e25zcta5dct-2000')
13
13
  find('button.download-dropdown-toggle').click
14
14
  find('a', text: 'Download KMZ').click
@@ -48,7 +48,7 @@ feature 'Download layer' do
48
48
  expect(page).to have_css('#hglRequest')
49
49
  end
50
50
  scenario 'submitting email form should trigger HGL request', js: true do
51
- expect_any_instance_of(HglDownload).to receive(:get).and_return('success')
51
+ expect_any_instance_of(Geoblacklight::HglDownload).to receive(:get).and_return('success')
52
52
  visit catalog_path('harvard-g7064-s2-1834-k3')
53
53
  find('a', text: 'Download GeoTIFF').click
54
54
  within '#hglRequest' do
@@ -0,0 +1,22 @@
1
+ require 'spec_helper'
2
+
3
+ feature 'Metadata tools' do
4
+ feature 'when metadata references are available', js: :true do
5
+ scenario 'shows up in tools' do
6
+ visit catalog_path 'stanford-cg357zz0321'
7
+ expect(page).to have_css 'li.metadata a', text: 'Metadata'
8
+ click_link 'Metadata'
9
+ within '.modal-body' do
10
+ expect(page).to have_css 'div.label', text: 'MODS'
11
+ expect(page).to have_css 'div.CodeRay', count: 2
12
+ expect(page).to have_css 'div.label', text: 'ISO 19139'
13
+ end
14
+ end
15
+ end
16
+ feature 'when metadata references are not available' do
17
+ scenario 'is not in tools' do
18
+ visit catalog_path 'mit-us-ma-e25zcta5dct-2000'
19
+ expect(page).to_not have_css 'li.metadata a', text: 'Metadata'
20
+ end
21
+ end
22
+ end
@@ -20,7 +20,6 @@
20
20
  "layer_id_s": "MIT:001145244",
21
21
  "layer_geom_type_s": "Paper Map",
22
22
  "layer_modified_dt": "2014-12-04T21:32:59Z",
23
- "solr_bbox": "-13.0 49.0 4.0 62.0",
24
23
  "solr_geom": "ENVELOPE(-13.0, 4.0, 62.0, 49.0)",
25
24
  "solr_year_i": 1996
26
25
  }
@@ -21,7 +21,6 @@
21
21
  "layer_id_s": "Columbia:Columbia.landinfo_global_aet",
22
22
  "layer_geom_type_s": "Point",
23
23
  "layer_modified_dt": "2014-12-12T19:54:57Z",
24
- "solr_bbox": "-179.5 -56.0 180.0 83.0",
25
24
  "solr_geom": "ENVELOPE(-179.5, 180.0, 83.0, -56.0)",
26
25
  "solr_year_i": 1996
27
26
  }
@@ -8,7 +8,7 @@
8
8
  "dc_rights_s": "Public",
9
9
  "dc_title_s": "100 Foot Grid Cambridge MA 2004",
10
10
  "dc_type_s": "Dataset",
11
- "dct_references_s": "{\"http://www.opengis.net/def/serviceType/ogc/wfs\":\"http://geoserver01.uit.tufts.edu/wfs\",\"http://www.opengis.net/def/serviceType/ogc/wms\":\"http://geoserver01.uit.tufts.edu/wms\",\"http://www.opengis.net/cat/csw/csdgm\":\"http://opengeometadata.stanford.edu/metadata/org.opengeoportal/sde:GISPORTAL.GISOWNER01.CAMBRIDGEGRID100_04/fgdc.xml\",\"http://www.w3.org/1999/xhtml\":\"http://opengeometadata.stanford.edu/metadata/org.opengeoportal/sde:GISPORTAL.GISOWNER01.CAMBRIDGEGRID100_04/fgdc.html\"}",
11
+ "dct_references_s": "{\"http://www.opengis.net/def/serviceType/ogc/wfs\":\"http://geoserver01.uit.tufts.edu/wfs\",\"http://www.opengis.net/def/serviceType/ogc/wms\":\"http://geoserver01.uit.tufts.edu/wms\",\"http://www.opengis.net/cat/csw/csdgm\":\"https://raw.githubusercontent.com/OpenGeoMetadata/edu.tufts/master/165/242/110/132/fgdc.xml\",\"http://www.w3.org/1999/xhtml\":\"http://opengeometadata.stanford.edu/metadata/org.opengeoportal/sde:GISPORTAL.GISOWNER01.CAMBRIDGEGRID100_04/fgdc.html\"}",
12
12
  "dct_temporal_sm": [
13
13
  "2004"
14
14
  ],
@@ -20,7 +20,6 @@
20
20
  "layer_id_s": "sde:GISPORTAL.GISOWNER01.CAMBRIDGEGRID100_04",
21
21
  "layer_geom_type_s": "Polygon",
22
22
  "layer_modified_dt": "2014-12-04T21:33:07Z",
23
- "solr_bbox": "-71.163984 42.34757 -71.052581 42.408316",
24
23
  "solr_geom": "ENVELOPE(-71.163984, -71.052581, 42.408316, 42.34757)",
25
24
  "solr_year_i": 2004
26
25
  }
@@ -5,7 +5,7 @@
5
5
  "dc_description_s": "This layer is a 10-color shaded relief GeoTIFF that contains high-resolution bathymetric data collected from the Elkhorn Slough region of Monterey Bay, California. The survey for Elkhorn Slough was conducted 8/12/2005 - 8/15/2005. Elkhorn Slough, one of the largest remaining coastal wetlands in California, has been directly subjected to tidal scour since the opening of Moss Landing Harbor in 1946. This erosion endangers the habitat of several rare and endangered species and disrupts the wetland ecosystem as a whole. In 2003, the Seafloor Mapping Lab of California State University, Monterey Bay created the most detailed bathymetry model of the Slough to date using a combination of multi-beam sonar, single-beam sonar and aerial photography. This layer was created as part of the California Seafloor Mapping Project.This project was conducted to determine changes in the pattern of erosion and deposition in Elkhorn Slough since surveys conducted in 1993, 2001 and 2003. Marine data offered here represent the efforts of a comprehensive state waters mapping program for California launched by the California State Coastal Conservancy, Ocean Protection Council, Department of Fish and Game, and the NOAA National Marine Sanctuary Program. The ultimate goal is the creation of a high-resolution 1:24,000 scale geologic and habitat base map series covering all of California's 14,500 km2 state waters out to the 3 mile limit, and support of the state's Marine Life Protection Act Initiative (MLPA) goal to create a statewide network of Marine Protected Areas (MPAs). This statewide project requires, involves and leverages expertise from industry, resource management agencies and academia. The tiered mapping campaign involves the use of state-of-the-art sonar, LIDAR (aerial laser) and video seafloor mapping technologies; computer aided classification and visualization; expert geologic and habitat interpretations codified into strip maps spanning California's land/sea boundary; and the creation of an online, publicly accessible data repository for the dissemination of all mapping products.\n",
6
6
  "dc_rights_s": "Restricted",
7
7
  "dct_provenance_s": "Stanford",
8
- "dct_references_s": "{\"http://schema.org/url\":\"http://purl.stanford.edu/dp018hs9766\",\"http://schema.org/downloadUrl\":\"http://stacks.stanford.edu/file/druid:dp018hs9766/data.zip\",\"http://www.loc.gov/mods/v3\":\"http://purl.stanford.edu/dp018hs9766.mods\",\"http://www.isotc211.org/schemas/2005/gmd/\":\"http://opengeometadata.stanford.edu/metadata/edu.stanford.purl/druid:dp018hs9766/iso19139.xml\",\"http://www.w3.org/1999/xhtml\":\"http://opengeometadata.stanford.edu/metadata/edu.stanford.purl/druid:dp018hs9766/default.html\",\"http://www.opengis.net/def/serviceType/ogc/wcs\":\"http://kurma-podd1.stanford.edu/geoserver/wcs\",\"http://www.opengis.net/def/serviceType/ogc/wms\":\"http://kurma-podd1.stanford.edu/geoserver/wms\"}",
8
+ "dct_references_s": "{\"http://schema.org/url\":\"http://purl.stanford.edu/dp018hs9766\",\"http://schema.org/downloadUrl\":\"http://stacks.stanford.edu/file/druid:dp018hs9766/data.zip\",\"http://www.loc.gov/mods/v3\":\"http://purl.stanford.edu/dp018hs9766.mods\",\"http://www.isotc211.org/schemas/2005/gmd/\":\"https://raw.githubusercontent.com/OpenGeoMetadata/edu.stanford.purl/master/dp/018/hs/9766/iso19139.xml\",\"http://www.w3.org/1999/xhtml\":\"http://opengeometadata.stanford.edu/metadata/edu.stanford.purl/druid:dp018hs9766/default.html\",\"http://www.opengis.net/def/serviceType/ogc/wcs\":\"http://kurma-podd1.stanford.edu/geoserver/wcs\",\"http://www.opengis.net/def/serviceType/ogc/wms\":\"http://kurma-podd1.stanford.edu/geoserver/wms\"}",
9
9
  "layer_id_s": "druid:dp018hs9766",
10
10
  "layer_slug_s": "stanford-dp018hs9766",
11
11
  "layer_geom_type_s": "Raster",
@@ -39,6 +39,5 @@
39
39
  "georss_box_s": "36.8085911 -121.7948738 36.8606925 -121.7389503",
40
40
  "georss_polygon_s": "36.8085911 -121.7948738 36.8606925 -121.7948738 36.8606925 -121.7389503 36.8085911 -121.7389503 36.8085911 -121.7948738",
41
41
  "solr_geom": "ENVELOPE(-121.7948738, -121.7389503, 36.8606925, 36.8085911)",
42
- "solr_bbox": "-121.7948738 36.8085911 -121.7389503 36.8606925",
43
42
  "solr_year_i": 2005
44
43
  }
@@ -26,7 +26,7 @@
26
26
  ],
27
27
  "dc_title_s": "Saint Petersburg Region, Russia, 1834 (Raster Image)",
28
28
  "dc_type_s": "Dataset",
29
- "dct_references_s": "{\"http://schema.org/DownloadAction\":\"http://hgl.harvard.edu:8080/HGL/HGLOpenDelivery\",\"http://www.opengis.net/def/serviceType/ogc/wcs\":\"http://hgl.harvard.edu:8080/geoserver/wcs\",\"http://www.opengis.net/def/serviceType/ogc/wms\":\"http://hgl.harvard.edu:8080/geoserver/wms\"}",
29
+ "dct_references_s": "{\"http://schema.org/DownloadAction\":\"http://hgl.harvard.edu:8080/HGL/HGLOpenDelivery\",\"http://www.opengis.net/def/serviceType/ogc/wcs\":\"http://hgl.harvard.edu:8080/geoserver/wcs\",\"http://www.opengis.net/def/serviceType/ogc/wms\":\"http://hgl.harvard.edu:8080/geoserver/wms\",\"http://www.opengis.net/cat/csw/csdgm\":\"https://raw.githubusercontent.com/OpenGeoMetadata/edu.harvard/master/217/121/227/77/fgdc.xml\"}",
30
30
  "dct_spatial_sm": [
31
31
  "Russia Saint Petersburg"
32
32
  ],
@@ -41,7 +41,6 @@
41
41
  "layer_id_s": "cite:SDE2.G7064_S2_1834_K3",
42
42
  "layer_geom_type_s": "Raster",
43
43
  "layer_modified_dt": "2014-05-27T18:09:36Z",
44
- "solr_bbox": "30.013108 59.669749 30.875309 60.041712",
45
44
  "solr_geom": "ENVELOPE(30.013108, 30.875309, 60.041712, 59.669749)",
46
45
  "solr_year_i": 1834,
47
46
  "solr_issued_dt": "2000-01-01T00:00:00Z"
@@ -32,7 +32,6 @@
32
32
  "layer_id_s": "02870w62c",
33
33
  "layer_geom_type_s": "Raster",
34
34
  "layer_modified_dt": "2014-10-09T18:00:18Z",
35
- "solr_bbox": "-76.3394 38.6693 -72.1916 46.5798",
36
35
  "solr_geom": "ENVELOPE(-76.3394, -72.1916, 46.5798, 38.6693)",
37
36
  "solr_year_i": 1778
38
37
  }
@@ -36,12 +36,7 @@
36
36
  "layer_id_s": "sde:SDE_DATA.US_MA_E25ZCTA5DCT_2000",
37
37
  "layer_geom_type_s": "Polygon",
38
38
  "layer_modified_dt": "2014-05-27T18:09:34Z",
39
- "solr_bbox": "-73.533237 41.230345 -69.898565 42.888068",
40
- "solr_ne_pt": "42.888068,-69.898565",
41
- "solr_sw_pt": "41.230345,-73.533237",
42
39
  "solr_geom": "ENVELOPE(-73.533237, -69.898565, 42.888068, 41.230345)",
43
40
  "solr_year_i": 2000,
44
- "solr_issued_dt": "2000-01-01T00:00:00Z",
45
- "solr_wms_url": "http://arrowsmith.mit.edu:8080/geoserver/wms",
46
- "solr_wfs_url": "http://arrowsmith.mit.edu:8080/geoserver/wfs"
41
+ "solr_issued_dt": "2000-01-01T00:00:00Z"
47
42
  }
@@ -5,7 +5,7 @@
5
5
  "dc_description_s": "This line shapefile contains contours that were derived from a mosiac of 10 meter digital elevation models for the extent of the Russian River basin, located in Sonoma and Mendocino Counties, California.This layer can be used for watershed analysis and planning in the Russian River region of California.",
6
6
  "dc_rights_s": "Restricted",
7
7
  "dct_provenance_s": "Stanford",
8
- "dct_references_s": "{\"http://schema.org/url\":\"http://purl.stanford.edu/cg357zz0321\",\"http://schema.org/downloadUrl\":\"http://stacks.stanford.edu/file/druid:cg357zz0321/data.zip\",\"http://www.loc.gov/mods/v3\":\"http://purl.stanford.edu/cg357zz0321.mods\",\"http://www.isotc211.org/schemas/2005/gmd/\":\"http://opengeometadata.stanford.edu/metadata/edu.stanford.purl/druid:cg357zz0321/iso19139.xml\",\"http://www.w3.org/1999/xhtml\":\"http://opengeometadata.stanford.edu/metadata/edu.stanford.purl/druid:cg357zz0321/default.html\",\"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\"}",
8
+ "dct_references_s": "{\"http://schema.org/url\":\"http://purl.stanford.edu/cg357zz0321\",\"http://schema.org/downloadUrl\":\"http://stacks.stanford.edu/file/druid:cg357zz0321/data.zip\",\"http://www.loc.gov/mods/v3\":\"http://purl.stanford.edu/cg357zz0321.mods\",\"http://www.isotc211.org/schemas/2005/gmd/\":\"https://raw.githubusercontent.com/OpenGeoMetadata/edu.stanford.purl/master/cg/357/zz/0321/iso19139.xml\",\"http://www.w3.org/1999/xhtml\":\"http://opengeometadata.stanford.edu/metadata/edu.stanford.purl/druid:cg357zz0321/default.html\",\"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\"}",
9
9
  "layer_id_s": "druid:cg357zz0321",
10
10
  "layer_slug_s": "stanford-cg357zz0321",
11
11
  "layer_geom_type_s": "Line",
@@ -38,6 +38,5 @@
38
38
  "georss_box_s": "38.302994 -123.387366 39.398403 -122.52958",
39
39
  "georss_polygon_s": "38.302994 -123.387366 39.398403 -123.387366 39.398403 -122.52958 38.302994 -122.52958 38.302994 -123.387366",
40
40
  "solr_geom": "ENVELOPE(-123.387366, -122.52958, 39.398403, 38.302994)",
41
- "solr_bbox": "-123.387366 38.302994 -122.52958 39.398403",
42
41
  "solr_year_i": 2002
43
42
  }
@@ -1,14 +1,19 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe GeojsonDownload do
4
- let(:document) { SolrDocument.new(layer_slug_s: 'test', solr_wfs_url: 'http://www.example.com/wfs', layer_id_s: 'stanford-test', solr_bbox: '-180 -90 180 90') }
5
- let(:download) { GeojsonDownload.new(document) }
3
+ describe Geoblacklight::GeojsonDownload do
4
+ let(:document) { SolrDocument.new(layer_slug_s: 'test', solr_wfs_url: 'http://www.example.com/wfs', layer_id_s: 'stanford-test', solr_geom: 'ENVELOPE(-180, 180, 90, -90)') }
5
+ let(:download) { Geoblacklight::GeojsonDownload.new(document) }
6
6
  describe '#initialize' do
7
7
  it 'should initialize as a GeojsonDownload object with specific options' do
8
- expect(download).to be_an GeojsonDownload
8
+ expect(download).to be_an Geoblacklight::GeojsonDownload
9
9
  options = download.instance_variable_get(:@options)
10
10
  expect(options[:content_type]).to eq 'application/json'
11
11
  expect(options[:request_params][:typeName]).to eq 'stanford-test'
12
12
  end
13
+ it 'should merge custom options' do
14
+ download = Geoblacklight::GeojsonDownload.new(document, timeout: 33)
15
+ options = download.instance_variable_get(:@options)
16
+ expect(options[:timeout]).to eq 33
17
+ end
13
18
  end
14
19
  end
@@ -1,15 +1,20 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe GeotiffDownload do
4
- let(:document) { SolrDocument.new(layer_slug_s: 'test', layer_id_s: 'stanford-test', solr_bbox: '-180 -90 180 90') }
5
- let(:download) { GeotiffDownload.new(document) }
3
+ describe Geoblacklight::GeotiffDownload do
4
+ let(:document) { SolrDocument.new(layer_slug_s: 'test', layer_id_s: 'stanford-test', solr_geom: 'ENVELOPE(-180, 180, 90, -90)') }
5
+ let(:download) { Geoblacklight::GeotiffDownload.new(document) }
6
6
  describe '#initialize' do
7
7
  it 'should initialize as a GeotiffDownload object with specific options' do
8
- expect(download).to be_an GeotiffDownload
8
+ expect(download).to be_an Geoblacklight::GeotiffDownload
9
9
  options = download.instance_variable_get(:@options)
10
10
  expect(options[:content_type]).to eq 'image/geotiff'
11
11
  expect(options[:request_params][:layers]).to eq 'stanford-test'
12
12
  expect(options[:reflect]).to be_truthy
13
13
  end
14
+ it 'should merge custom options' do
15
+ download = Geoblacklight::GeotiffDownload.new(document, timeout: 33)
16
+ options = download.instance_variable_get(:@options)
17
+ expect(options[:timeout]).to eq 33
18
+ end
14
19
  end
15
20
  end
@@ -1,14 +1,19 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe HglDownload do
3
+ describe Geoblacklight::HglDownload do
4
4
  let(:document) { SolrDocument.new(layer_slug_s: 'test', layer_id_s: 'cite:harvard-test') }
5
- let(:download) { HglDownload.new(document, 'foo@example.com') }
5
+ let(:download) { Geoblacklight::HglDownload.new(document, 'foo@example.com') }
6
6
  describe '#initialize' do
7
7
  it 'should initialize as an HglDownload object with specific options' do
8
- expect(download).to be_an HglDownload
8
+ expect(download).to be_an Geoblacklight::HglDownload
9
9
  options = download.instance_variable_get(:@options)
10
10
  expect(options[:request_params]['LayerName']).to eq 'harvard-test'
11
11
  expect(options[:request_params]['UserEmail']).to eq 'foo@example.com'
12
12
  end
13
+ it 'should merge custom options' do
14
+ download = Geoblacklight::HglDownload.new(document, 'foo@example.com', timeout: 33)
15
+ options = download.instance_variable_get(:@options)
16
+ expect(options[:timeout]).to eq 33
17
+ end
13
18
  end
14
19
  end
@@ -1,15 +1,20 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe KmzDownload do
4
- let(:document) { SolrDocument.new(layer_slug_s: 'test', solr_wfs_url: 'http://www.example.com/wfs', layer_id_s: 'stanford-test', solr_bbox: '-180 -90 180 90') }
5
- let(:download) { KmzDownload.new(document) }
3
+ describe Geoblacklight::KmzDownload do
4
+ let(:document) { SolrDocument.new(layer_slug_s: 'test', solr_wfs_url: 'http://www.example.com/wfs', layer_id_s: 'stanford-test', solr_geom: 'ENVELOPE(-180, 180, 90, -90)') }
5
+ let(:download) { Geoblacklight::KmzDownload.new(document) }
6
6
  describe '#initialize' do
7
7
  it 'should initialize as a KmzDownload object with specific options' do
8
- expect(download).to be_an KmzDownload
8
+ expect(download).to be_an Geoblacklight::KmzDownload
9
9
  options = download.instance_variable_get(:@options)
10
10
  expect(options[:content_type]).to eq 'application/vnd.google-earth.kmz'
11
11
  expect(options[:request_params][:layers]).to eq 'stanford-test'
12
12
  expect(options[:request_params][:bbox]).to eq '-180, -90, 180, 90'
13
13
  end
14
+ it 'should merge custom options' do
15
+ download = Geoblacklight::KmzDownload.new(document, timeout: 33)
16
+ options = download.instance_variable_get(:@options)
17
+ expect(options[:timeout]).to eq 33
18
+ end
14
19
  end
15
20
  end
@@ -1,14 +1,19 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe ShapefileDownload do
4
- let(:document) { SolrDocument.new(layer_slug_s: 'test', solr_wfs_url: 'http://www.example.com/wfs', layer_id_s: 'stanford-test', solr_bbox: '-180 -90 180 90') }
5
- let(:download) { ShapefileDownload.new(document) }
3
+ describe Geoblacklight::ShapefileDownload do
4
+ let(:document) { SolrDocument.new(layer_slug_s: 'test', solr_wfs_url: 'http://www.example.com/wfs', layer_id_s: 'stanford-test', solr_geom: 'ENVELOPE(-180, 180, 90, -90)') }
5
+ let(:download) { Geoblacklight::ShapefileDownload.new(document) }
6
6
  describe '#initialize' do
7
7
  it 'should initialize as a ShapefileDownload object with specific options' do
8
- expect(download).to be_an ShapefileDownload
8
+ expect(download).to be_an Geoblacklight::ShapefileDownload
9
9
  options = download.instance_variable_get(:@options)
10
10
  expect(options[:content_type]).to eq 'application/zip'
11
11
  expect(options[:request_params][:typeName]).to eq 'stanford-test'
12
12
  end
13
+ it 'should merge custom options' do
14
+ download = Geoblacklight::ShapefileDownload.new(document, timeout: 33)
15
+ options = download.instance_variable_get(:@options)
16
+ expect(options[:timeout]).to eq 33
17
+ end
13
18
  end
14
19
  end
@@ -1,16 +1,16 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe Download do
3
+ describe Geoblacklight::Download do
4
4
  let(:response) { double('response') }
5
5
  let(:get) { double('get') }
6
6
  let(:body) { double('body') }
7
7
  let(:document) { SolrDocument.new(layer_slug_s: 'test', dct_references_s: {'http://www.opengis.net/def/serviceType/ogc/wms' => 'http://www.example.com/wms'}.to_json) }
8
8
  let(:options) { { type: 'shapefile', extension: 'zip', service_type: 'wms', content_type: 'application/zip' } }
9
- let(:download) { Download.new(document, options) }
9
+ let(:download) { Geoblacklight::Download.new(document, options) }
10
10
 
11
11
  describe '#initialize' do
12
12
  it 'should initialize as a Download object' do
13
- expect(download).to be_an Download
13
+ expect(download).to be_an Geoblacklight::Download
14
14
  end
15
15
  end
16
16
  describe '#file_name' do
@@ -0,0 +1,25 @@
1
+ require 'spec_helper'
2
+
3
+ describe Geoblacklight::Metadata do
4
+ let(:response) { double('response') }
5
+ let(:get) { double('get') }
6
+ let(:opengeometadata) {
7
+ Geoblacklight::Metadata.new(
8
+ Geoblacklight::Reference.new(
9
+ ['http://www.loc.gov/mods/v3', 'http://purl.stanford.edu/cg357zz0321.mods']
10
+ )
11
+ )
12
+ }
13
+ describe '#retrieve_metadata' do
14
+ it 'returns response from an endpoint url' do
15
+ expect(response).to receive(:get).and_return(get)
16
+ expect(Faraday).to receive(:new).with(url: 'http://purl.stanford.edu/cg357zz0321.mods').and_return(response)
17
+ opengeometadata.retrieve_metadata
18
+ end
19
+ it 'returns nil when a connection error' do
20
+ expect(response).to receive(:get).and_return(Faraday::Error::ConnectionFailed)
21
+ expect(Faraday).to receive(:new).with(url: 'http://purl.stanford.edu/cg357zz0321.mods').and_return(response)
22
+ opengeometadata.retrieve_metadata
23
+ end
24
+ end
25
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geoblacklight
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Graves
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2015-02-23 00:00:00.000000000 Z
14
+ date: 2015-03-03 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: blacklight
@@ -97,6 +97,20 @@ dependencies:
97
97
  - - ">="
98
98
  - !ruby/object:Gem::Version
99
99
  version: '0'
100
+ - !ruby/object:Gem::Dependency
101
+ name: coderay
102
+ requirement: !ruby/object:Gem::Requirement
103
+ requirements:
104
+ - - ">="
105
+ - !ruby/object:Gem::Version
106
+ version: '0'
107
+ type: :runtime
108
+ prerelease: false
109
+ version_requirements: !ruby/object:Gem::Requirement
110
+ requirements:
111
+ - - ">="
112
+ - !ruby/object:Gem::Version
113
+ version: '0'
100
114
  - !ruby/object:Gem::Dependency
101
115
  name: bundler
102
116
  requirement: !ruby/object:Gem::Requirement
@@ -269,12 +283,14 @@ files:
269
283
  - app/assets/stylesheets/geoblacklight/_geoblacklight.scss
270
284
  - app/assets/stylesheets/geoblacklight/_styles.scss
271
285
  - app/assets/stylesheets/geoblacklight/application.scss
286
+ - app/assets/stylesheets/geoblacklight/modules/coderay.scss
272
287
  - app/assets/stylesheets/geoblacklight/modules/geosearch.scss
273
288
  - app/assets/stylesheets/geoblacklight/modules/home.scss
274
289
  - app/assets/stylesheets/geoblacklight/modules/icon-customization.scss
275
290
  - app/assets/stylesheets/geoblacklight/modules/icons.scss
276
291
  - app/assets/stylesheets/geoblacklight/modules/item.scss
277
292
  - app/assets/stylesheets/geoblacklight/modules/layer_opacity.scss
293
+ - app/assets/stylesheets/geoblacklight/modules/metadata.scss
278
294
  - app/assets/stylesheets/geoblacklight/modules/mixins.scss
279
295
  - app/assets/stylesheets/geoblacklight/modules/results.scss
280
296
  - app/assets/stylesheets/geoblacklight/modules/search_widgets.scss
@@ -285,21 +301,24 @@ files:
285
301
  - app/helpers/geoblacklight_helper.rb
286
302
  - app/views/catalog/_document_action.html.erb
287
303
  - app/views/catalog/_document_split.html.erb
304
+ - app/views/catalog/_downloads.html.erb
288
305
  - app/views/catalog/_facet_tag_item.html.erb
289
306
  - app/views/catalog/_facet_tag_layout.html.erb
290
307
  - app/views/catalog/_home_text.html.erb
291
308
  - app/views/catalog/_icon_facet.html.erb
292
309
  - app/views/catalog/_index_split_default.html.erb
310
+ - app/views/catalog/_metadata.html.erb
293
311
  - app/views/catalog/_search_form_no_navbar.html.erb
294
312
  - app/views/catalog/_show_default.html.erb
295
313
  - app/views/catalog/_show_default_attribute_table.html.erb
296
314
  - app/views/catalog/_show_default_viewer_container.html.erb
297
315
  - app/views/catalog/_show_header_default.html.erb
298
- - app/views/catalog/_show_tools.html.erb
299
316
  - app/views/catalog/_upper_metadata.html.erb
300
317
  - app/views/catalog/_web_services.html.erb
301
318
  - app/views/catalog/index.html.erb
302
- - app/views/catalog/web_services.html
319
+ - app/views/catalog/metadata.html.erb
320
+ - app/views/catalog/metadata.js.erb
321
+ - app/views/catalog/web_services.html.erb
303
322
  - app/views/catalog/web_services.js.erb
304
323
  - app/views/download/hgl.html.erb
305
324
  - app/views/shared/_header_navbar.html.erb
@@ -327,6 +346,7 @@ files:
327
346
  - lib/geoblacklight/engine.rb
328
347
  - lib/geoblacklight/exceptions.rb
329
348
  - lib/geoblacklight/item_viewer.rb
349
+ - lib/geoblacklight/metadata.rb
330
350
  - lib/geoblacklight/reference.rb
331
351
  - lib/geoblacklight/references.rb
332
352
  - lib/geoblacklight/routes.rb
@@ -335,6 +355,7 @@ files:
335
355
  - lib/geoblacklight/view_helper_override.rb
336
356
  - lib/geoblacklight/wms_layer.rb
337
357
  - lib/geoblacklight/wms_layer/feature_info_response.rb
358
+ - lib/tasks/configure_solr.rake
338
359
  - lib/tasks/geoblacklight.rake
339
360
  - spec/controllers/catalog_controller_spec.rb
340
361
  - spec/controllers/download_controller_spec.rb
@@ -345,6 +366,7 @@ files:
345
366
  - spec/features/layer_inspection_spec.rb
346
367
  - spec/features/layer_preview_spec.rb
347
368
  - spec/features/layer_with_no_references_spec.rb
369
+ - spec/features/metadata_panel_spec.rb
348
370
  - spec/features/saved_searches_spec.rb
349
371
  - spec/features/search_bar_spec.rb
350
372
  - spec/features/show_page_metadata_spec.rb
@@ -367,6 +389,7 @@ files:
367
389
  - spec/lib/geoblacklight/download/shapefile_download_spec.rb
368
390
  - spec/lib/geoblacklight/download_spec.rb
369
391
  - spec/lib/geoblacklight/item_viewer_spec.rb
392
+ - spec/lib/geoblacklight/metadata_spec.rb
370
393
  - spec/lib/geoblacklight/references_spec.rb
371
394
  - spec/lib/geoblacklight/solr_document_spec.rb
372
395
  - spec/lib/geoblacklight/view_helper_override_spec.rb
@@ -416,6 +439,7 @@ test_files:
416
439
  - spec/features/layer_inspection_spec.rb
417
440
  - spec/features/layer_preview_spec.rb
418
441
  - spec/features/layer_with_no_references_spec.rb
442
+ - spec/features/metadata_panel_spec.rb
419
443
  - spec/features/saved_searches_spec.rb
420
444
  - spec/features/search_bar_spec.rb
421
445
  - spec/features/show_page_metadata_spec.rb
@@ -438,6 +462,7 @@ test_files:
438
462
  - spec/lib/geoblacklight/download/shapefile_download_spec.rb
439
463
  - spec/lib/geoblacklight/download_spec.rb
440
464
  - spec/lib/geoblacklight/item_viewer_spec.rb
465
+ - spec/lib/geoblacklight/metadata_spec.rb
441
466
  - spec/lib/geoblacklight/references_spec.rb
442
467
  - spec/lib/geoblacklight/solr_document_spec.rb
443
468
  - spec/lib/geoblacklight/view_helper_override_spec.rb