geoblacklight 2.1.2 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (121) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +6 -0
  3. data/.gitignore +3 -1
  4. data/.rubocop.yml +3 -1
  5. data/.rubocop_todo.yml +7 -15
  6. data/README.md +5 -6
  7. data/app/assets/images/blacklight/arrow-circle-down.svg +4 -0
  8. data/app/assets/images/blacklight/baruch-cuny.svg +6 -0
  9. data/app/assets/images/blacklight/berkeley.svg +7 -0
  10. data/app/assets/images/blacklight/book.svg +6 -0
  11. data/app/assets/images/blacklight/bookmark.svg +6 -0
  12. data/app/assets/images/blacklight/cd-rom.svg +6 -0
  13. data/app/assets/images/blacklight/chicago.svg +7 -0
  14. data/app/assets/images/blacklight/columbia.svg +6 -0
  15. data/app/assets/images/blacklight/cornell.svg +8 -0
  16. data/app/assets/images/blacklight/dvd-rom.svg +6 -0
  17. data/app/assets/images/blacklight/email.svg +6 -0
  18. data/app/assets/images/blacklight/esri-globe.svg +34 -37
  19. data/app/assets/images/blacklight/geoblacklight-icons.json +2079 -0
  20. data/app/assets/images/blacklight/globe.svg +4 -0
  21. data/app/assets/images/blacklight/harvard.svg +6 -0
  22. data/app/assets/images/blacklight/home.svg +4 -0
  23. data/app/assets/images/blacklight/illinois.svg +7 -0
  24. data/app/assets/images/blacklight/image.svg +6 -0
  25. data/app/assets/images/blacklight/indiana.svg +6 -0
  26. data/app/assets/images/blacklight/iowa.svg +6 -0
  27. data/app/assets/images/blacklight/leaf.svg +6 -0
  28. data/app/assets/images/blacklight/lewis-clark.svg +8 -0
  29. data/app/assets/images/blacklight/line.svg +7 -0
  30. data/app/assets/images/blacklight/logo.svg +1 -0
  31. data/app/assets/images/blacklight/map-marker.svg +6 -0
  32. data/app/assets/images/blacklight/map.svg +6 -0
  33. data/app/assets/images/blacklight/maryland.svg +6 -0
  34. data/app/assets/images/blacklight/massgis.svg +6 -0
  35. data/app/assets/images/blacklight/metadata.svg +6 -0
  36. data/app/assets/images/blacklight/michigan-state.svg +7 -0
  37. data/app/assets/images/blacklight/michigan.svg +6 -0
  38. data/app/assets/images/blacklight/minnesota.svg +6 -0
  39. data/app/assets/images/blacklight/mit.svg +6 -0
  40. data/app/assets/images/blacklight/mixed.svg +8 -0
  41. data/app/assets/images/blacklight/multilinestring.svg +9 -0
  42. data/app/assets/images/blacklight/multipoint.svg +6 -0
  43. data/app/assets/images/blacklight/multipolygon.svg +9 -0
  44. data/app/assets/images/blacklight/nyu.svg +9 -0
  45. data/app/assets/images/blacklight/ohio-state.svg +8 -0
  46. data/app/assets/images/blacklight/pagelines-brands.svg +6 -0
  47. data/app/assets/images/blacklight/paper-map.svg +6 -0
  48. data/app/assets/images/blacklight/penn-state.svg +7 -0
  49. data/app/assets/images/blacklight/point.svg +6 -0
  50. data/app/assets/images/blacklight/polygon.svg +7 -0
  51. data/app/assets/images/blacklight/polyline.svg +9 -0
  52. data/app/assets/images/blacklight/princeton.svg +6 -0
  53. data/app/assets/images/blacklight/public.svg +6 -0
  54. data/app/assets/images/blacklight/purdue.svg +7 -0
  55. data/app/assets/images/blacklight/raster.svg +6 -0
  56. data/app/assets/images/blacklight/restricted.svg +6 -0
  57. data/app/assets/images/blacklight/sms.svg +6 -0
  58. data/app/assets/images/blacklight/stanford.svg +6 -0
  59. data/app/assets/images/blacklight/table.svg +6 -0
  60. data/app/assets/images/blacklight/tags.svg +4 -0
  61. data/app/assets/images/blacklight/texas.svg +6 -0
  62. data/app/assets/images/blacklight/tufts.svg +6 -0
  63. data/app/assets/images/blacklight/ucla.svg +6 -0
  64. data/app/assets/images/blacklight/uva.svg +6 -0
  65. data/app/assets/images/blacklight/web_services.svg +6 -0
  66. data/app/assets/images/blacklight/wisconsin.svg +6 -0
  67. data/app/assets/javascripts/geoblacklight/modules/help_text.js +7 -0
  68. data/app/assets/javascripts/geoblacklight/modules/item.js +1 -3
  69. data/app/assets/javascripts/geoblacklight/viewers/oembed.js +13 -0
  70. data/app/assets/stylesheets/geoblacklight/_blacklight_overrides.scss +9 -1
  71. data/app/assets/stylesheets/geoblacklight/modules/icon-customization.scss +49 -59
  72. data/app/assets/stylesheets/geoblacklight/modules/item.scss +4 -0
  73. data/app/assets/stylesheets/geoblacklight/modules/results.scss +22 -0
  74. data/app/assets/stylesheets/geoblacklight/modules/toolbar.scss +4 -0
  75. data/app/helpers/geoblacklight_helper.rb +91 -5
  76. data/app/models/concerns/geoblacklight/solr_document.rb +4 -0
  77. data/app/models/concerns/geoblacklight/spatial_search_behavior.rb +5 -0
  78. data/app/views/catalog/_data_dictionary.html.erb +3 -2
  79. data/app/views/catalog/_document_action.html.erb +1 -1
  80. data/app/views/catalog/_exports.html.erb +2 -10
  81. data/app/views/catalog/_home_text.html.erb +4 -4
  82. data/app/views/catalog/_show_default_viewer_container.html.erb +5 -0
  83. data/app/views/catalog/_show_header_default.html.erb +2 -4
  84. data/app/views/relation/_ancestors.html.erb +2 -1
  85. data/app/views/relation/_descendants.html.erb +2 -1
  86. data/app/views/shared/_header_navbar.html.erb +2 -0
  87. data/config/locales/geoblacklight.en.yml +88 -0
  88. data/geoblacklight.gemspec +1 -0
  89. data/lib/generators/geoblacklight/templates/geoblacklight.js +1 -1
  90. data/lib/generators/geoblacklight/templates/settings.yml +19 -0
  91. data/lib/geoblacklight/constants.rb +3 -2
  92. data/lib/geoblacklight/item_viewer.rb +5 -1
  93. data/lib/geoblacklight/metadata/base.rb +15 -10
  94. data/lib/geoblacklight/reference.rb +2 -1
  95. data/lib/geoblacklight/version.rb +1 -1
  96. data/package.json +4 -0
  97. data/schema/references.md +2 -1
  98. data/spec/features/exports_spec.rb +9 -0
  99. data/spec/features/help_text_spec.rb +8 -0
  100. data/spec/features/metadata_panel_spec.rb +51 -8
  101. data/spec/features/oembed_spec.rb +9 -0
  102. data/spec/features/search_results_map_spec.rb +1 -1
  103. data/spec/features/split_view.html.erb_spec.rb +1 -1
  104. data/spec/features/suppressed_records_spec.rb +14 -0
  105. data/spec/fixtures/fgdc/harvard-g7064-s2-1834-k3.xml +1 -0
  106. data/spec/fixtures/iso19139/stanford-cg357zz0321.xml +581 -0
  107. data/spec/fixtures/mods/fb897vt9938.mods +111 -0
  108. data/spec/fixtures/mods/stanford-cg357zz0321.mods +113 -0
  109. data/spec/fixtures/solr_documents/iiif-eastern-hemisphere.json +1 -1
  110. data/spec/fixtures/solr_documents/oembed.json +24 -0
  111. data/spec/helpers/geoblacklight_helper_spec.rb +30 -7
  112. data/spec/javascripts/geoblacklight_spec.js +4 -0
  113. data/spec/javascripts/metadata_download_button_spec.js +1 -1
  114. data/spec/lib/geoblacklight/metadata/base_spec.rb +18 -4
  115. data/spec/lib/geoblacklight/reference_spec.rb +30 -0
  116. data/spec/models/concerns/geoblacklight/solr_document_spec.rb +20 -0
  117. data/spec/spec_helper.rb +8 -5
  118. data/vendor/assets/javascripts/readmore.js +618 -0
  119. data/vendor/assets/javascripts/readmore.js.map +1 -0
  120. metadata +96 -3
  121. data/vendor/assets/javascripts/readmore.min.js +0 -11
@@ -0,0 +1,111 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <mods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.loc.gov/mods/v3" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" version="3.4" xsi:schemaLocation="http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-4.xsd">
3
+ <titleInfo>
4
+ <title>Dabao Kinbōzu, Maps Index</title>
5
+ </titleInfo>
6
+ <titleInfo>
7
+ <title type="alternative">Davao (Philippines), 1:50000 Maps Index</title>
8
+ </titleInfo>
9
+ <titleInfo>
10
+ <title displayLabel="Alternative title">Davao (Philippines), 1:50000 Maps Index</title>
11
+ </titleInfo>
12
+ <name type="corporate">
13
+ <namePart>Stanford Geospatial Center</namePart>
14
+ <role>
15
+ <roleTerm type="text" authority="marcrelator">creator</roleTerm>
16
+ </role>
17
+ </name>
18
+ <typeOfResource>cartographic</typeOfResource>
19
+ <typeOfResource>software, multimedia</typeOfResource>
20
+ <genre authority="lcgft" valueURI="http://id.loc.gov/authorities/genreForms/gf2011026297">Geospatial data</genre>
21
+ <genre authority="rdacontent" valueURI="http://rdvocab.info/termList/RDAContentType/1001">cartographic dataset</genre>
22
+ <originInfo>
23
+ <publisher>Stanford Digital Repository</publisher>
24
+ <place>
25
+ <placeTerm type="text">Stanford, California,</placeTerm>
26
+ </place>
27
+ <dateIssued encoding="w3cdtf" keyDate="yes">2016</dateIssued>
28
+ </originInfo>
29
+ <language>
30
+ <languageTerm authority="iso639-2b">eng</languageTerm>
31
+ </language>
32
+ <physicalDescription>
33
+ <form>Shapefile</form>
34
+ <extent>0.001</extent>
35
+ <digitalOrigin>born digital</digitalOrigin>
36
+ </physicalDescription>
37
+ <subject authority="EPSG" valueURI="http://opengis.net/def/crs/EPSG/0/4326" displayLabel="WGS84">
38
+ <cartographics>
39
+ <scale>Scale not given.</scale>
40
+ <projection>EPSG::4326</projection>
41
+ <coordinates>(E 125°--E 126°/N 7°20ʹ--N 6°40ʹ)</coordinates>
42
+ </cartographics>
43
+ </subject>
44
+ <abstract displayLabel="Abstract" lang="eng">This polygon shapefile is an index to 1:50000 scale maps of Davao (Philippines), titled 'Dabao Kinbōzu -- ダバオ近傍圖/Dabao Kinbōzu.’ This map series was originally produced by the Japanese Land Survey Department of the General Staff Headquarters in 1944. Stanford University Libraries holds a large collection of Japanese military and imperial maps, referred to as gaihōzu, or "maps of outer lands." These maps were produced starting in the early Meiji (1868-1912) era and the end of World War II by the Land Survey Department of the General Staff Headquarters, the former Japanese Army. The Library is in the process of scanning and making available all of the maps in the collection. To create this index, footprints were generated using the fishnet tool, and metadata were supplied for the digitized paper maps by Stanford University Libraries. After the footprints were created, the shapefile was trimmed and labeled according to the sources.</abstract>
45
+ <abstract displayLabel="Purpose" lang="eng">This layer provides an index map that can be used to locate individual scanned map sheets.</abstract>
46
+ <note displayLabel="Preferred citation" lang="eng">Stanford Geospatial Center. (2016). Dabao Kinbōzu, Maps Index. Stanford Digital Repository. Available at: http://purl.stanford.edu/fb897vt9938.</note>
47
+ <relatedItem type="isReferencedBy">
48
+ <titleInfo>
49
+ <title>Dabao Kinbōzu [cartographic material]</title>
50
+ </titleInfo>
51
+ </relatedItem>
52
+ <subject>
53
+ <topic authority="lcsh" authorityURI="http://id.loc.gov/authorities/subjects.html" lang="eng">Military maps</topic>
54
+ </subject>
55
+ <subject>
56
+ <topic authority="lcsh" authorityURI="http://id.loc.gov/authorities/subjects.html" lang="eng">Topographic maps</topic>
57
+ </subject>
58
+ <subject>
59
+ <topic authority="lcsh" authorityURI="http://id.loc.gov/authorities/subjects.html" lang="eng">Index maps</topic>
60
+ </subject>
61
+ <subject>
62
+ <topic authority="lcsh" authorityURI="http://id.loc.gov/authorities/subjects.html" lang="eng">Grids (Cartography)</topic>
63
+ </subject>
64
+ <subject>
65
+ <geographic lang="eng">Davao (Philippines)</geographic>
66
+ </subject>
67
+ <subject>
68
+ <temporal encoding="w3cdtf">1944</temporal>
69
+ </subject>
70
+ <subject>
71
+ <topic authority="ISO19115TopicCategory" authorityURI="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_TopicCategoryCode" valueURI="boundaries">Boundaries</topic>
72
+ </subject>
73
+ <subject>
74
+ <topic authority="ISO19115TopicCategory" authorityURI="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_TopicCategoryCode" valueURI="intelligenceMilitary">Military</topic>
75
+ </subject>
76
+ <location>
77
+ <url>http://purl.stanford.edu/fb897vt9938</url>
78
+ </location>
79
+ <recordInfo>
80
+ <recordContentSource>Stanford</recordContentSource>
81
+ <recordIdentifier>edu.stanford.purl:fb897vt9938</recordIdentifier>
82
+ <recordOrigin>This record was translated from ISO 19139 to MODS v.3 using an xsl transformation.</recordOrigin>
83
+ <languageOfCataloging>
84
+ <languageTerm authority="iso639-2b" type="code">eng</languageTerm>
85
+ </languageOfCataloging>
86
+ </recordInfo>
87
+ <extension displayLabel="geo">
88
+ <rdf:RDF xmlns:gml="http://www.opengis.net/gml/3.2/" xmlns:dc="http://purl.org/dc/elements/1.1/">
89
+ <rdf:Description rdf:about="http://purl.stanford.edu/fb897vt9938">
90
+ <dc:format>application/x-esri-shapefile; format=Shapefile</dc:format>
91
+ <dc:type>Dataset#Polygon</dc:type>
92
+ <gml:boundedBy>
93
+ <gml:Envelope gml:srsName="EPSG:4326">
94
+ <gml:lowerCorner>125.0 6.6666</gml:lowerCorner>
95
+ <gml:upperCorner>126.0 7.3333</gml:upperCorner>
96
+ </gml:Envelope>
97
+ </gml:boundedBy>
98
+ </rdf:Description>
99
+ </rdf:RDF>
100
+ </extension>
101
+ <relatedItem type="host">
102
+ <titleInfo>
103
+ <title>Topographic Map Indexes</title>
104
+ </titleInfo>
105
+ <location>
106
+ <url>https://purl.stanford.edu/ch237ht4777</url>
107
+ </location>
108
+ <typeOfResource collection="yes"/>
109
+ </relatedItem>
110
+ <accessCondition type="useAndReproduction">This item is in the public domain. There are no restrictions on use.</accessCondition>
111
+ </mods>
@@ -0,0 +1,113 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <mods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.loc.gov/mods/v3" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" version="3.4" xsi:schemaLocation="http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-4.xsd">
3
+ <titleInfo>
4
+ <title>10 Meter Contours: Russian River Basin, California</title>
5
+ </titleInfo>
6
+ <name type="corporate">
7
+ <namePart>United States. National Oceanic and Atmospheric Administration</namePart>
8
+ <role>
9
+ <roleTerm type="text" authority="marcrelator">creator</roleTerm>
10
+ </role>
11
+ </name>
12
+ <name type="corporate">
13
+ <namePart>Circuit Rider Productions</namePart>
14
+ <role>
15
+ <roleTerm type="text" authority="marcrelator">creator</roleTerm>
16
+ </role>
17
+ </name>
18
+ <typeOfResource>cartographic</typeOfResource>
19
+ <typeOfResource>software, multimedia</typeOfResource>
20
+ <genre authority="lcgft" valueURI="http://id.loc.gov/authorities/genreForms/gf2011026297">Geospatial data</genre>
21
+ <genre authority="rdacontent" valueURI="http://rdvocab.info/termList/RDAContentType/1001">cartographic dataset</genre>
22
+ <originInfo>
23
+ <publisher>Circuit Rider Productions</publisher>
24
+ <place>
25
+ <placeTerm type="text">Windsor, California, US</placeTerm>
26
+ </place>
27
+ <dateIssued encoding="w3cdtf" keyDate="yes">2002</dateIssued>
28
+ <dateValid encoding="w3cdtf">2002</dateValid>
29
+ </originInfo>
30
+ <language>
31
+ <languageTerm authority="iso639-2b">eng</languageTerm>
32
+ </language>
33
+ <physicalDescription>
34
+ <form>Shapefile</form>
35
+ <extent>74.767</extent>
36
+ <digitalOrigin>born digital</digitalOrigin>
37
+ </physicalDescription>
38
+ <subject>
39
+ <cartographics>
40
+ <scale>Scale not given.</scale>
41
+ <projection>Custom projection</projection>
42
+ <coordinates>(W 123°23ʹ15ʺ--W 122°31ʹ24ʺ/N 39°23ʹ55ʺ--N 38°18ʹ8ʺ)</coordinates>
43
+ </cartographics>
44
+ </subject>
45
+ <abstract displayLabel="Abstract" lang="eng">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.</abstract>
46
+ <abstract displayLabel="Purpose" lang="eng">This layer can be used for watershed analysis and planning in the Russian River region of California.</abstract>
47
+ <note displayLabel="Preferred citation" lang="eng">Circuit Rider Productions and National Oceanic and Atmospheric Administration (2002) 10 Meter Contours: Russian River Basin, California. Circuit Rider Productions.</note>
48
+ <note displayLabel="Supplemental information">The 7.5-minute digital elevation model (DEM) data are digital representations of cartographic information in a raster form. The DEMs consist of an array of elevations for ground positions at regularly spaced intervals. The data are produced in 7.5- by 7.5-minute blocks from either digitized cartographic map contour overlays of a scanned National Aerial Photography Program (NAPP) photographs. The DEM data are stored as profiles with a 10- or 30-meter square grid spacing along and between each profile. Approximate file sizes are 9.9 megabytes for a 10-meter resolution and 1.1 megabytes for a 30-meter horizontal resolution. Data profiles for this product do not always have the same number of elevations because of the variable angle between true north and grid north in the Universal Transverse Mercator (UTM)
49
+ projection coordinate system. The DEM data for 7.5-minute units correspond to the USGS 7.5-minute topographic quadrangle map series for all of the United States and its territories except Alaska.</note>
50
+ <subject>
51
+ <topic authority="lcsh" lang="eng">Contours (Cartography)</topic>
52
+ </subject>
53
+ <subject>
54
+ <geographic lang="eng" valueURI="http://sws.geonames.org/5397100/" authority="geonames" authorityURI="http://www.geonames.org/ontology#">Sonoma County (Calif.)</geographic>
55
+ </subject>
56
+ <subject>
57
+ <geographic lang="eng" valueURI="http://sws.geonames.org/5372163/" authority="geonames" authorityURI="http://www.geonames.org/ontology#">Mendocino County (Calif.)</geographic>
58
+ </subject>
59
+ <subject>
60
+ <temporal encoding="w3cdtf">2002</temporal>
61
+ </subject>
62
+ <subject>
63
+ <topic authority="ISO19115TopicCategory" authorityURI="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_TopicCategoryCode" valueURI="elevation">Elevation</topic>
64
+ </subject>
65
+ <subject>
66
+ <topic authority="ISO19115TopicCategory" authorityURI="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_TopicCategoryCode" valueURI="inlandWaters">Inland Waters</topic>
67
+ </subject>
68
+ <location>
69
+ <url>http://purl.stanford.edu/cg357zz0321</url>
70
+ </location>
71
+ <recordInfo>
72
+ <recordContentSource>Stanford</recordContentSource>
73
+ <recordIdentifier>edu.stanford.purl:cg357zz0321</recordIdentifier>
74
+ <recordOrigin>This record was translated from ISO 19139 to MODS v.3 using an xsl transformation.</recordOrigin>
75
+ <languageOfCataloging>
76
+ <languageTerm authority="iso639-2b" type="code">eng</languageTerm>
77
+ </languageOfCataloging>
78
+ </recordInfo>
79
+ <extension displayLabel="geo">
80
+ <rdf:RDF xmlns:gml="http://www.opengis.net/gml/3.2/" xmlns:dc="http://purl.org/dc/elements/1.1/">
81
+ <rdf:Description rdf:about="http://purl.stanford.edu/cg357zz0321">
82
+ <dc:format>application/x-esri-shapefile; format=Shapefile</dc:format>
83
+ <dc:type>Dataset#LineString</dc:type>
84
+ <gml:boundedBy>
85
+ <gml:Envelope gml:srsName="EPSG:4326">
86
+ <gml:lowerCorner>-123.387366 38.302994</gml:lowerCorner>
87
+ <gml:upperCorner>-122.52958 39.398403</gml:upperCorner>
88
+ </gml:Envelope>
89
+ </gml:boundedBy>
90
+ <dc:coverage rdf:resource="http://sws.geonames.org/5397100/" dc:language="eng" dc:title="Sonoma County (Calif.)"/>
91
+ <dc:coverage rdf:resource="http://sws.geonames.org/5372163/" dc:language="eng" dc:title="Mendocino County (Calif.)"/>
92
+ </rdf:Description>
93
+ </rdf:RDF>
94
+ </extension>
95
+ <subject authority="EPSG" valueURI="http://opengis.net/def/crs/EPSG/0/4326" displayLabel="WGS84">
96
+ <cartographics>
97
+ <scale>Scale not given.</scale>
98
+ <projection>EPSG::4326</projection>
99
+ <coordinates>W 123°23ʹ15ʺ--W 122°31ʹ46ʺ/N 39°23ʹ54ʺ--N 38°18ʹ11ʺ</coordinates>
100
+ </cartographics>
101
+ </subject>
102
+ <note displayLabel="WGS84 Cartographics">This layer is presented in the WGS84 coordinate system for web display purposes. Downloadable data are provided in native coordinate system or projection.</note>
103
+ <relatedItem type="host">
104
+ <titleInfo>
105
+ <title>Russian River watershed GIS</title>
106
+ </titleInfo>
107
+ <location>
108
+ <url>https://purl.stanford.edu/zt526qk7324</url>
109
+ </location>
110
+ <typeOfResource collection="yes"/>
111
+ </relatedItem>
112
+ <accessCondition type="useAndReproduction">These data are licensed by Stanford Libraries and are available to Stanford University affiliates only. Affiliates are limited to current faculty, staff and students. Non affiliates seeking access should contact the publisher directly. These data may not be reproduced or used for any purpose without permission.</accessCondition>
113
+ </mods>
@@ -14,7 +14,7 @@
14
14
  "Bowen, Emanuel (-1767)"
15
15
  ],
16
16
  "dct_provenance_s": "Minnesota",
17
- "dct_references_s": "{\"http://schema.org/url\":\"http://purl.umn.edu/200804\",\"http://schema.org/downloadUrl\":\"https://umedia.lib.umn.edu/sites/default/files/archive/113/image/tiff/1058396.tif\",\"http://iiif.io/api/image\":\"https://umedia.lib.umn.edu/fcgi-bin/iipsrv.fcgi?IIIF=sites/default/files/reference/113/image/jp2/1058396.jp2/info.json\"}",
17
+ "dct_references_s": "{\"http://schema.org/url\":\"http://purl.umn.edu/200804\",\"http://iiif.io/api/image\":\"https://cdm16022.contentdm.oclc.org/digital/iiif/p16022coll246/224/info.json\"}",
18
18
  "dct_isPartOf_sm": [
19
19
  "John R. Borchert Map Library"
20
20
  ],
@@ -0,0 +1,24 @@
1
+ {
2
+ "dc_identifier_s": "http://purl.stanford.edu/dc482zx1528",
3
+ "dc_title_s": "Jōshū Kusatsu Onsenzu",
4
+ "dc_description_s": "Publication date estimate from dealer description.",
5
+ "dc_rights_s": "Public",
6
+ "dct_provenance_s": "Stanford",
7
+ "dct_references_s": "{\"http://schema.org/url\":\"http://purl.stanford.edu/dc482zx1528\",\"https://oembed.com\":\"https://purl.stanford.edu/embed.json?&hide_title=true&url=https://purl.stanford.edu/dc482zx1528\"}",
8
+ "layer_slug_s": "stanford-dc482zx1528",
9
+ "layer_geom_type_s": "Image",
10
+ "dc_format_s": "JPEG",
11
+ "dc_language_s": "Japanese",
12
+ "dc_type_s": "Image",
13
+ "dc_publisher_s": "Kikyōya Genkichi han",
14
+ "dc_subject_sm": [
15
+ "Hot springs",
16
+ "Kusatsu-machi",
17
+ "Maps"
18
+ ],
19
+ "dct_spatial_sm": [
20
+ "Japan"
21
+ ],
22
+ "solr_geom": "ENVELOPE(138.523426, 138.630362, 36.656354, 36.597519)",
23
+ "geoblacklight_version": "1.0"
24
+ }
@@ -1,6 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe GeoblacklightHelper, type: :helper do
4
+ include BlacklightHelper
4
5
  include ActionView::Helpers::UrlHelper
5
6
  include ActionView::Helpers::TranslationHelper
6
7
  describe '#render_facet_links' do
@@ -16,24 +17,20 @@ describe GeoblacklightHelper, type: :helper do
16
17
  end
17
18
 
18
19
  describe '#geoblacklight_icon' do
19
- it 'replaces special characters, lowercases, and subs spaces for hyphens' do
20
- html = Capybara.string(geoblacklight_icon('TEst & 123'))
21
- expect(html).to have_css '.geoblacklight-test-123'
22
- end
23
20
  it 'supports in use cases' do
24
21
  {
25
22
  'Paper map' => 'paper-map',
26
23
  'Michigan State' => 'michigan-state',
27
24
  'CD ROM' => 'cd-rom',
28
25
  'Lewis & Clark' => 'lewis-clark'
29
- }.each do |key, value|
26
+ }.each_key do |key|
30
27
  html = Capybara.string(geoblacklight_icon(key))
31
- expect(html).to have_css ".geoblacklight-#{value}"
28
+ expect(html).to have_xpath "//*[local-name() = 'svg']"
32
29
  end
33
30
  end
34
31
  it 'handles nil values' do
35
32
  html = Capybara.string(geoblacklight_icon(nil))
36
- expect(html).to have_css '.geoblacklight-none'
33
+ expect(html).to have_css '.icon-missing'
37
34
  end
38
35
  end
39
36
 
@@ -303,4 +300,30 @@ describe GeoblacklightHelper, type: :helper do
303
300
  expect(helper.first_metadata?(document, metadata)).to be true
304
301
  end
305
302
  end
303
+
304
+ describe '#show_help_text?' do
305
+ let(:feature) { 'viewer_protocol' }
306
+ let(:translation_key) { 'wms' }
307
+
308
+ it 'confirms help text is available' do
309
+ expect(helper.show_help_text?(feature, translation_key)).to be true
310
+ end
311
+ end
312
+
313
+ describe '#render_help_text_entry' do
314
+ let(:feature) { 'viewer_protocol' }
315
+ let(:translation_key) { 'wms' }
316
+
317
+ context 'valid entry' do
318
+ it 'renders help text entry for the wms viewer protocol' do
319
+ expect(helper.render_help_text_entry(feature, translation_key)).to eq '<h3 class="help-text viewer_protocol h6"><a data-toggle="popover" data-title="Web Map Service (WMS)" data-content="A Web Map Service displays a geospatial dataset as map images.">Web Map Service (WMS)</a></h3>'
320
+ end
321
+ end
322
+
323
+ context 'invalid entry' do
324
+ it 'renders an empty span' do
325
+ expect(helper.render_help_text_entry('foo', 'bar')).to eq '<span class="help-text translation-missing"></span>'
326
+ end
327
+ end
328
+ end
306
329
  end
@@ -13,5 +13,9 @@ describe('GeoBlacklight', function() {
13
13
  it('MetadataDownloadButton is defined', function() {
14
14
  expect(GeoBlacklight.MetadataDownloadButton).toBeDefined();
15
15
  });
16
+
17
+ it ('Readmore is defined', function() {
18
+ expect(Readmore).toBeDefined();
19
+ });
16
20
  });
17
21
  });
@@ -2,7 +2,7 @@
2
2
 
3
3
  describe('MetadataDownloadButton', function() {
4
4
  describe('initialize', function() {
5
- fixture.set('<button id="foo" data-ref-endpoint="http://testdomain" data-ref-download="#bar">test element</button><a href="http://test2domain" id="bar">another test element</a>');
5
+ fixture.set('<button id="foo" data-ref-endpoint="http://testdomain" data-ref-download="#bar">test element</button><a href="http://testdomain" id="bar">another test element</a>');
6
6
 
7
7
  it('creates a new instance and sets the download button @href value', function() {
8
8
  var button = new GeoBlacklight.MetadataDownloadButton('#foo');
@@ -9,11 +9,11 @@ describe Geoblacklight::Metadata::Base do
9
9
  Geoblacklight::Reference.new(['http://www.loc.gov/mods/v3', 'http://purl.stanford.edu/cg357zz0321.mods'])
10
10
  end
11
11
 
12
- describe '#document' do
13
- before do
14
- allow(Faraday).to receive(:new).with(url: 'http://purl.stanford.edu/cg357zz0321.mods').and_return(connection)
15
- end
12
+ before do
13
+ allow(Faraday).to receive(:new).with(url: 'http://purl.stanford.edu/cg357zz0321.mods').and_return(connection)
14
+ end
16
15
 
16
+ describe '#document' do
17
17
  context 'with valid XML data at an endpoint URL' do
18
18
  before do
19
19
  allow(response).to receive(:status).and_return(200)
@@ -40,6 +40,20 @@ describe Geoblacklight::Metadata::Base do
40
40
  end
41
41
  end
42
42
 
43
+ context 'when attempts to connect to an endpoint URL raise an OpenSSL error' do
44
+ subject { metadata.document }
45
+
46
+ before do
47
+ expect(Geoblacklight.logger).to receive(:error).with(/dh key too small/)
48
+ allow(connection).to receive(:get).and_raise(OpenSSL::SSL::SSLError, 'dh key too small')
49
+ end
50
+
51
+ it 'returns nil when a connection error' do
52
+ expect(subject).to be_a Nokogiri::XML::Document
53
+ expect(subject.children.empty?).to be true
54
+ end
55
+ end
56
+
43
57
  describe '#blank?' do
44
58
  before do
45
59
  allow(Faraday).to receive(:new).with(url: 'http://purl.stanford.edu/cg357zz0321.mods').and_return(connection)
@@ -31,4 +31,34 @@ describe Geoblacklight::Reference do
31
31
  expect(typical_reference.to_hash).to eq wms: 'http://hgl.harvard.edu:8080/geoserver/wms'
32
32
  end
33
33
  end
34
+
35
+ describe 'reference' do
36
+ context 'key has one trailing slash' do
37
+ let(:iso19139_reference) do
38
+ described_class.new(['http://www.isotc211.org/schemas/2005/gmd/', 'https://raw.githubusercontent.com/OpenGeoMetadata/edu.stanford.purl/master/cg/357/zz/0321/iso19139.xml'])
39
+ end
40
+
41
+ it 'removes the trailing slash' do
42
+ expect(iso19139_reference.send(:uri)).to eq 'http://www.isotc211.org/schemas/2005/gmd'
43
+ end
44
+ end
45
+ context 'key does not have trailing slashes' do
46
+ let(:iso19139_reference) do
47
+ described_class.new(['http://www.isotc211.org/schemas/2005/gmd', 'https://raw.githubusercontent.com/OpenGeoMetadata/edu.stanford.purl/master/cg/357/zz/0321/iso19139.xml'])
48
+ end
49
+
50
+ it 'will return the key' do
51
+ expect(iso19139_reference.send(:uri)).to eq 'http://www.isotc211.org/schemas/2005/gmd'
52
+ end
53
+ end
54
+ context 'key has trailing slashes' do
55
+ let(:fgdc_reference) do
56
+ described_class.new(['http://www.opengis.net/cat/csw/csdgm////', 'https://raw.githubusercontent.com/OpenGeoMetadata/edu.harvard/master/217/121/227/77/fgdc.xml'])
57
+ end
58
+
59
+ it 'removes the trailing slashes' do
60
+ expect(fgdc_reference.send(:uri)).to eq 'http://www.opengis.net/cat/csw/csdgm'
61
+ end
62
+ end
63
+ end
34
64
  end
@@ -124,6 +124,26 @@ describe Geoblacklight::SolrDocument do
124
124
  end
125
125
  end
126
126
  end
127
+ describe '#oembed' do
128
+ describe 'with an oembed url' do
129
+ let(:document_attributes) do
130
+ {
131
+ references_field => {
132
+ 'https://oembed.com' => 'http://example.com/oembed?url=oembec.com/id123'
133
+ }.to_json
134
+ }
135
+ end
136
+ it 'returns a url string' do
137
+ expect(document.oembed).to eq('http://example.com/oembed?url=oembec.com/id123')
138
+ end
139
+ end
140
+ describe 'without an oembed url' do
141
+ let(:document_attributes) { {} }
142
+ it 'returns nil' do
143
+ expect(document.oembed).to be_nil
144
+ end
145
+ end
146
+ end
127
147
  describe 'iiif_download' do
128
148
  describe 'with a IIIF download' do
129
149
  let(:document_attributes) do