geoblacklight_sidecar_images 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.coveralls.yml +1 -0
- data/.gitignore +17 -0
- data/.rspec +1 -0
- data/.rubocop.yml +80 -0
- data/.travis.yml +29 -0
- data/Gemfile +47 -0
- data/LICENSE +201 -0
- data/README.md +45 -0
- data/Rakefile +37 -0
- data/app/assets/config/geoblacklight_sidecar_images_manifest.js +2 -0
- data/app/assets/images/geoblacklight_sidecar_images/.keep +0 -0
- data/app/assets/javascripts/geoblacklight_sidecar_images/application.js +13 -0
- data/app/assets/stylesheets/geoblacklight_sidecar_images/application.css +15 -0
- data/app/controllers/geoblacklight_sidecar_images/application_controller.rb +5 -0
- data/app/helpers/geoblacklight_sidecar_images/application_helper.rb +4 -0
- data/app/jobs/geoblacklight_sidecar_images/application_job.rb +4 -0
- data/app/mailers/geoblacklight_sidecar_images/application_mailer.rb +6 -0
- data/app/models/geoblacklight_sidecar_images/application_record.rb +5 -0
- data/app/views/layouts/geoblacklight_sidecar_images/application.html.erb +14 -0
- data/config/routes.rb +2 -0
- data/db/migrate/20180118203155_create_solr_document_sidecars.rb +12 -0
- data/geoblacklight_sidecar_images.gemspec +37 -0
- data/lib/generators/geoblacklight_sidecar_images/assets_generator.rb +31 -0
- data/lib/generators/geoblacklight_sidecar_images/example_docs_generator.rb +18 -0
- data/lib/generators/geoblacklight_sidecar_images/install_generator.rb +58 -0
- data/lib/generators/geoblacklight_sidecar_images/jobs_generator.rb +27 -0
- data/lib/generators/geoblacklight_sidecar_images/models_generator.rb +60 -0
- data/lib/generators/geoblacklight_sidecar_images/services_generator.rb +19 -0
- data/lib/generators/geoblacklight_sidecar_images/templates/assets/images/thumbnail-image.png +0 -0
- data/lib/generators/geoblacklight_sidecar_images/templates/assets/images/thumbnail-line.png +0 -0
- data/lib/generators/geoblacklight_sidecar_images/templates/assets/images/thumbnail-mixed.png +0 -0
- data/lib/generators/geoblacklight_sidecar_images/templates/assets/images/thumbnail-multipoint.png +0 -0
- data/lib/generators/geoblacklight_sidecar_images/templates/assets/images/thumbnail-paper-map.png +0 -0
- data/lib/generators/geoblacklight_sidecar_images/templates/assets/images/thumbnail-point.png +0 -0
- data/lib/generators/geoblacklight_sidecar_images/templates/assets/images/thumbnail-polygon.png +0 -0
- data/lib/generators/geoblacklight_sidecar_images/templates/assets/images/thumbnail-raster.png +0 -0
- data/lib/generators/geoblacklight_sidecar_images/templates/assets/javascripts/geoblacklight.js +9 -0
- data/lib/generators/geoblacklight_sidecar_images/templates/assets/stylesheets/geoblacklight.scss +3 -0
- data/lib/generators/geoblacklight_sidecar_images/templates/jobs/store_image_job.rb +8 -0
- data/lib/generators/geoblacklight_sidecar_images/templates/models/concerns/wms_rewrite_concern.rb +20 -0
- data/lib/generators/geoblacklight_sidecar_images/templates/models/solr_document_sidecar.rb +16 -0
- data/lib/generators/geoblacklight_sidecar_images/templates/services/image_service.rb +193 -0
- data/lib/generators/geoblacklight_sidecar_images/templates/services/image_service/dynamic_map_layer.rb +11 -0
- data/lib/generators/geoblacklight_sidecar_images/templates/services/image_service/iiif.rb +13 -0
- data/lib/generators/geoblacklight_sidecar_images/templates/services/image_service/image_map_layer.rb +13 -0
- data/lib/generators/geoblacklight_sidecar_images/templates/services/image_service/tiled_map_layer.rb +11 -0
- data/lib/generators/geoblacklight_sidecar_images/templates/services/image_service/wms.rb +24 -0
- data/lib/generators/geoblacklight_sidecar_images/templates/uploaders/image_uploader.rb +53 -0
- data/lib/generators/geoblacklight_sidecar_images/templates/views/catalog/_index_split_default.html.erb +27 -0
- data/lib/generators/geoblacklight_sidecar_images/uploaders_generator.rb +19 -0
- data/lib/generators/geoblacklight_sidecar_images/views_generator.rb +21 -0
- data/lib/geoblacklight_sidecar_images.rb +5 -0
- data/lib/geoblacklight_sidecar_images/engine.rb +5 -0
- data/lib/geoblacklight_sidecar_images/version.rb +3 -0
- data/lib/tasks/geoblacklight_sidecar_images_tasks.rake +76 -0
- 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/solr/conf/protwords.txt +21 -0
- data/solr/conf/schema.xml +190 -0
- data/solr/conf/scripts.conf +24 -0
- data/solr/conf/solrconfig.xml +243 -0
- data/solr/conf/spellings.txt +2 -0
- data/solr/conf/stopwords.txt +58 -0
- data/solr/conf/stopwords_en.txt +58 -0
- data/solr/conf/synonyms.txt +31 -0
- 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/fixtures/files/actual-papermap1.json +23 -0
- data/spec/fixtures/files/actual-point1.json +24 -0
- data/spec/fixtures/files/actual-polygon1.json +23 -0
- data/spec/fixtures/files/actual-raster1.json +37 -0
- data/spec/fixtures/files/baruch_ancestor1.json +46 -0
- data/spec/fixtures/files/baruch_ancestor2.json +46 -0
- data/spec/fixtures/files/baruch_documentation_download.json +49 -0
- data/spec/fixtures/files/esri-dynamic-layer-all-layers.json +36 -0
- data/spec/fixtures/files/esri-dynamic-layer-single-layer.json +37 -0
- data/spec/fixtures/files/esri-feature-layer.json +33 -0
- data/spec/fixtures/files/esri-image-map-layer.json +21 -0
- data/spec/fixtures/files/esri-tiled_map_layer.json +22 -0
- data/spec/fixtures/files/esri-wms-layer.json +33 -0
- data/spec/fixtures/files/harvard_raster.json +44 -0
- data/spec/fixtures/files/no_spatial.json +21 -0
- data/spec/fixtures/files/public_direct_download.json +28 -0
- data/spec/fixtures/files/public_iiif_princeton.json +36 -0
- data/spec/fixtures/files/public_polygon_mit.json +39 -0
- data/spec/fixtures/files/restricted-line.json +36 -0
- data/spec/fixtures/files/umich_iiif_jpg.json +28 -0
- data/spec/fixtures/files/umn_iiif_jpg.json +30 -0
- data/spec/fixtures/files/umn_metro_result1.json +37 -0
- data/spec/fixtures/files/umn_metro_result2.json +35 -0
- data/spec/fixtures/files/umn_state_result1.json +31 -0
- data/spec/fixtures/files/umn_state_result2.json +36 -0
- data/spec/models/solr_document_sidecar_spec.rb +13 -0
- data/spec/models/solr_document_spec.rb +14 -0
- data/spec/rails_helper.rb +59 -0
- data/spec/services/image_service_spec.rb +31 -0
- data/spec/spec_helper.rb +5 -0
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +33 -0
- data/template.rb +13 -0
- metadata +395 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: cfcec3b4ccabd5199870f71065581b36519871d9
|
4
|
+
data.tar.gz: 4a9fa25df1b4e570956a310b6af83bde3339086c
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 421f88d57ffd7309e4e08749385d2396b8b89339a9ef2d995051e42e8154c2d3e17f9248148df083e4f24c5827181eb822458baf9553b089c4289cfa9d344510
|
7
|
+
data.tar.gz: 003e322064e9e82393311c9445efd8205687634c12524054bc99df7e0340ab03181424d46763972b9b4265fd76db0537c3bddf10d3efa728911f2431ba9289cc
|
data/.coveralls.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
service_name: travis-ci
|
data/.gitignore
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
.bundle/
|
2
|
+
log/*.log
|
3
|
+
pkg/
|
4
|
+
Gemfile.lock
|
5
|
+
coverage
|
6
|
+
.rvmrc
|
7
|
+
jetty
|
8
|
+
tmp
|
9
|
+
spec/internal
|
10
|
+
spec/test_app/db/*.sqlite3
|
11
|
+
spec/test_app/db/*.sqlite3-journal
|
12
|
+
spec/test_app/log/*.log
|
13
|
+
spec/test_app/node_modules/
|
14
|
+
spec/test_app/yarn-error.log
|
15
|
+
spec/test_app/storage/
|
16
|
+
spec/test_app/tmp/
|
17
|
+
.internal_test_app
|
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--color
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,80 @@
|
|
1
|
+
Rails:
|
2
|
+
Enabled: true
|
3
|
+
|
4
|
+
AllCops:
|
5
|
+
DisplayCopNames: true
|
6
|
+
|
7
|
+
Include:
|
8
|
+
- '**/Gemfile'
|
9
|
+
- '**/Rakefile'
|
10
|
+
|
11
|
+
Exclude:
|
12
|
+
- 'db/**/*'
|
13
|
+
- 'vendor/**/*'
|
14
|
+
- '.internal_test_app/**/*'
|
15
|
+
- 'lib/generators/geoblacklight/templates/**/*'
|
16
|
+
- 'geoblacklight_sidecar_images.gemspec'
|
17
|
+
- 'lib/generators/geoblacklight_sidecar_images/install_generator.rb'
|
18
|
+
- 'lib/tasks/geoblacklight_sidecar_images_tasks.rake'
|
19
|
+
- 'template.rb'
|
20
|
+
- Gemfile
|
21
|
+
|
22
|
+
Metrics/LineLength:
|
23
|
+
Max: 100
|
24
|
+
Exclude:
|
25
|
+
- 'spec/**/*'
|
26
|
+
- 'Rakefile'
|
27
|
+
- 'lib/generators/geoblacklight_sidecar_images/templates/services/image_service.rb'
|
28
|
+
|
29
|
+
# TODO: Refactor large methods.
|
30
|
+
Metrics/ClassLength:
|
31
|
+
Exclude:
|
32
|
+
- 'lib/generators/geoblacklight_sidecar_images/templates/services/image_service.rb'
|
33
|
+
|
34
|
+
Metrics/AbcSize:
|
35
|
+
Max: 28
|
36
|
+
|
37
|
+
Metrics/MethodLength:
|
38
|
+
Max: 16
|
39
|
+
|
40
|
+
# TODO: Add top-level class and module documentation.
|
41
|
+
Style/Documentation:
|
42
|
+
Enabled: false
|
43
|
+
|
44
|
+
# Overrides method in blacklight. Must use method name.
|
45
|
+
Style/PredicateName:
|
46
|
+
Exclude:
|
47
|
+
- 'lib/geoblacklight/view_helper_override.rb'
|
48
|
+
|
49
|
+
RSpec/FilePath:
|
50
|
+
Enabled: false
|
51
|
+
|
52
|
+
# Rubocop bug causes view specs to fail.
|
53
|
+
# https://github.com/nevir/rubocop-rspec/issues/47
|
54
|
+
RSpec/DescribeClass:
|
55
|
+
Enabled: false
|
56
|
+
|
57
|
+
# geoblacklight references in solr_document_spec are
|
58
|
+
# difficult to mock because of the use of 'method_missing'.
|
59
|
+
# https://relishapp.com/rspec/rspec-mocks/docs/verifying-doubles/dynamic-classes
|
60
|
+
RSpec/AnyInstance:
|
61
|
+
Exclude:
|
62
|
+
- 'spec/models/concerns/geoblacklight/solr_document_spec.rb'
|
63
|
+
|
64
|
+
Style/SignalException:
|
65
|
+
EnforcedStyle: semantic
|
66
|
+
|
67
|
+
Style/StringLiterals:
|
68
|
+
Description: Checks if uses of quotes match the configured preference.
|
69
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-string-literals
|
70
|
+
Enabled: true
|
71
|
+
EnforcedStyle: single_quotes
|
72
|
+
|
73
|
+
Style/DotPosition:
|
74
|
+
Description: Checks the position of the dot in multi-line method calls.
|
75
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains
|
76
|
+
Enabled: true
|
77
|
+
EnforcedStyle: leading
|
78
|
+
SupportedStyles:
|
79
|
+
- leading
|
80
|
+
- trailing
|
data/.travis.yml
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
dist: trusty
|
2
|
+
addons:
|
3
|
+
chrome: stable
|
4
|
+
language: ruby
|
5
|
+
sudo: false
|
6
|
+
|
7
|
+
notifications:
|
8
|
+
email: false
|
9
|
+
|
10
|
+
rvm:
|
11
|
+
- 2.4.3
|
12
|
+
|
13
|
+
matrix:
|
14
|
+
include:
|
15
|
+
- rvm: 2.3.6
|
16
|
+
env: "RAILS_VERSION=5.0.6"
|
17
|
+
|
18
|
+
before_install:
|
19
|
+
- gem update --system
|
20
|
+
- gem install bundler
|
21
|
+
- google-chrome-stable --headless --disable-gpu --remote-debugging-port=9222 http://localhost &
|
22
|
+
|
23
|
+
env:
|
24
|
+
- "RAILS_VERSION=5.1.4 "
|
25
|
+
|
26
|
+
global_env:
|
27
|
+
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true
|
28
|
+
|
29
|
+
jdk: oraclejdk8
|
data/Gemfile
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
# Declare your gem's dependencies in geoblacklight_sidecar_images.gemspec.
|
4
|
+
# Bundler will treat runtime dependencies like base dependencies, and
|
5
|
+
# development dependencies will be added by default to the :development group.
|
6
|
+
|
7
|
+
# Please see geoblacklight_sidecar_images.gemspec for dependency information.
|
8
|
+
gemspec
|
9
|
+
|
10
|
+
# Declare any dependencies that are still in development here instead of in
|
11
|
+
# your gemspec. These might include edge Rails or gems from your path or
|
12
|
+
# Git. Remember to move these dependencies to your gemspec before releasing
|
13
|
+
# your gem to rubygems.org.
|
14
|
+
|
15
|
+
group :development, :test do
|
16
|
+
# Peg simplecov to < 0.8 until this is resolved:
|
17
|
+
# https://github.com/colszowka/simplecov/issues/281
|
18
|
+
gem 'coveralls', require: false
|
19
|
+
gem 'rubocop', '0.53.0', require: false
|
20
|
+
end
|
21
|
+
|
22
|
+
# To use a debugger
|
23
|
+
# gem 'byebug', group: [:development, :test]
|
24
|
+
|
25
|
+
# BEGIN ENGINE_CART BLOCK
|
26
|
+
# engine_cart: 1.2.0
|
27
|
+
# engine_cart stanza: 0.10.0
|
28
|
+
# the below comes from engine_cart, a gem used to test this Rails engine gem in the context of a Rails app.
|
29
|
+
file = File.expand_path('Gemfile', ENV['ENGINE_CART_DESTINATION'] || ENV['RAILS_ROOT'] || File.expand_path('.internal_test_app', File.dirname(__FILE__)))
|
30
|
+
|
31
|
+
if File.exist?(file)
|
32
|
+
begin
|
33
|
+
eval_gemfile file
|
34
|
+
rescue Bundler::GemfileError => e
|
35
|
+
Bundler.ui.warn '[EngineCart] Skipping Rails application dependencies:'
|
36
|
+
Bundler.ui.warn e.message
|
37
|
+
end
|
38
|
+
else
|
39
|
+
Bundler.ui.warn "[EngineCart] Unable to find test application dependencies in #{file}, using placeholder dependencies"
|
40
|
+
|
41
|
+
gem 'aasm'
|
42
|
+
gem 'carrierwave'
|
43
|
+
gem 'geoblacklight', '~> 1.7'
|
44
|
+
gem 'mini_magick'
|
45
|
+
gem 'rails', '>= 4.2', '< 6'
|
46
|
+
end
|
47
|
+
# END ENGINE_CART BLOCK
|
data/LICENSE
ADDED
@@ -0,0 +1,201 @@
|
|
1
|
+
Apache License
|
2
|
+
Version 2.0, January 2004
|
3
|
+
http://www.apache.org/licenses/
|
4
|
+
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
6
|
+
|
7
|
+
1. Definitions.
|
8
|
+
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
11
|
+
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
13
|
+
the copyright owner that is granting the License.
|
14
|
+
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
16
|
+
other entities that control, are controlled by, or are under common
|
17
|
+
control with that entity. For the purposes of this definition,
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
19
|
+
direction or management of such entity, whether by contract or
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
22
|
+
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
24
|
+
exercising permissions granted by this License.
|
25
|
+
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
27
|
+
including but not limited to software source code, documentation
|
28
|
+
source, and configuration files.
|
29
|
+
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
31
|
+
transformation or translation of a Source form, including but
|
32
|
+
not limited to compiled object code, generated documentation,
|
33
|
+
and conversions to other media types.
|
34
|
+
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
36
|
+
Object form, made available under the License, as indicated by a
|
37
|
+
copyright notice that is included in or attached to the work
|
38
|
+
(an example is provided in the Appendix below).
|
39
|
+
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
46
|
+
the Work and Derivative Works thereof.
|
47
|
+
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
49
|
+
the original version of the Work and any modifications or additions
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
61
|
+
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
64
|
+
subsequently incorporated within the Work.
|
65
|
+
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
72
|
+
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
78
|
+
where such license applies only to those patent claims licensable
|
79
|
+
by such Contributor that are necessarily infringed by their
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
82
|
+
institute patent litigation against any entity (including a
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
85
|
+
or contributory patent infringement, then any patent licenses
|
86
|
+
granted to You under this License for that Work shall terminate
|
87
|
+
as of the date such litigation is filed.
|
88
|
+
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
91
|
+
modifications, and in Source or Object form, provided that You
|
92
|
+
meet the following conditions:
|
93
|
+
|
94
|
+
(a) You must give any other recipients of the Work or
|
95
|
+
Derivative Works a copy of this License; and
|
96
|
+
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
98
|
+
stating that You changed the files; and
|
99
|
+
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
102
|
+
attribution notices from the Source form of the Work,
|
103
|
+
excluding those notices that do not pertain to any part of
|
104
|
+
the Derivative Works; and
|
105
|
+
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
108
|
+
include a readable copy of the attribution notices contained
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
111
|
+
of the following places: within a NOTICE text file distributed
|
112
|
+
as part of the Derivative Works; within the Source form or
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
114
|
+
within a display generated by the Derivative Works, if and
|
115
|
+
wherever such third-party notices normally appear. The contents
|
116
|
+
of the NOTICE file are for informational purposes only and
|
117
|
+
do not modify the License. You may add Your own attribution
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
120
|
+
that such additional attribution notices cannot be construed
|
121
|
+
as modifying the License.
|
122
|
+
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
124
|
+
may provide additional or different license terms and conditions
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
128
|
+
the conditions stated in this License.
|
129
|
+
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
133
|
+
this License, without any additional terms or conditions.
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
135
|
+
the terms of any separate license agreement you may have executed
|
136
|
+
with Licensor regarding such Contributions.
|
137
|
+
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
140
|
+
except as required for reasonable and customary use in describing the
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
142
|
+
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
152
|
+
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
158
|
+
incidental, or consequential damages of any character arising as a
|
159
|
+
result of this License or out of the use or inability to use the
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
162
|
+
other commercial damages or losses), even if such Contributor
|
163
|
+
has been advised of the possibility of such damages.
|
164
|
+
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
168
|
+
or other liability obligations and/or rights consistent with this
|
169
|
+
License. However, in accepting such obligations, You may act only
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
174
|
+
of your accepting any such warranty or additional liability.
|
175
|
+
|
176
|
+
END OF TERMS AND CONDITIONS
|
177
|
+
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
179
|
+
|
180
|
+
To apply the Apache License to your work, attach the following
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
182
|
+
replaced with your own identifying information. (Don't include
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
184
|
+
comment syntax for the file format. We also recommend that a
|
185
|
+
file or class name and description of purpose be included on the
|
186
|
+
same "printed page" as the copyright notice for easier
|
187
|
+
identification within third-party archives.
|
188
|
+
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
190
|
+
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
192
|
+
you may not use this file except in compliance with the License.
|
193
|
+
You may obtain a copy of the License at
|
194
|
+
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
196
|
+
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
200
|
+
See the License for the specific language governing permissions and
|
201
|
+
limitations under the License.
|
data/README.md
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
# GeoBlacklight Sidecar Images
|
2
|
+
|
3
|
+
[![Build Status](https://travis-ci.org/ewlarson/geoblacklight_sidecar_images.svg?branch=master)](https://travis-ci.org/ewlarson/geoblacklight_sidecar_images)
|
4
|
+
[![Maintainability](https://api.codeclimate.com/v1/badges/88c14165af5459963011/maintainability)](https://codeclimate.com/github/ewlarson/geoblacklight_sidecar_images/maintainability)
|
5
|
+
[![Coverage Status](https://coveralls.io/repos/github/ewlarson/geoblacklight_sidecar_images/badge.svg?branch=master)](https://coveralls.io/github/ewlarson/geoblacklight_sidecar_images?branch=master)
|
6
|
+
|
7
|
+
Store local copies of remote imagery in GeoBlacklight.
|
8
|
+
|
9
|
+
## Description
|
10
|
+
This GeoBlacklight plugin helps capture remote images from geo web services and save them locally. It borrows the concept of a [SolrDocumentSidecar](https://github.com/projectblacklight/spotlight/blob/master/app/models/spotlight/solr_document_sidecar.rb) from [Spotlight](https://github.com/projectblacklight/spotlight), to have an ActiveRecord-based "sidecar" to match each non-AR SolrDocument. This allows us to use [carrierwave](https://github.com/carrierwaveuploader/carrierwave) to attach images to our documents.
|
11
|
+
|
12
|
+
## Requirements
|
13
|
+
|
14
|
+
* [Blacklight](https://github.com/projectblacklight/blacklight/)
|
15
|
+
* [GeoBlacklight](https://github.com/geoblacklight/geoblacklight)
|
16
|
+
* [ImageMagick](https://github.com/ImageMagick/ImageMagick)
|
17
|
+
|
18
|
+
## Installation
|
19
|
+
|
20
|
+
Forthcoming
|
21
|
+
|
22
|
+
## Development
|
23
|
+
|
24
|
+
bundle exec rake ci
|
25
|
+
cd .internal_test_app/
|
26
|
+
rake geoblacklight:server
|
27
|
+
|
28
|
+
### Ingest Test Documents
|
29
|
+
rake geoblacklight_sidecar_images:sample_data:ingest['<FULL_PATH_TO>/geoblacklight_sidecar_images/spec/fixtures/files']
|
30
|
+
|
31
|
+
### Cache images
|
32
|
+
|
33
|
+
#### All Thumbnails
|
34
|
+
rake geoblacklight_sidecar_images:images:precache_all
|
35
|
+
|
36
|
+
#### Individual Thumbnail
|
37
|
+
rake geoblacklight_sidecar_images:images:precache_id['minnesota-iiif-jpg-83f4648a-125c-4000-a12f-aba2b432e7cd']
|
38
|
+
|
39
|
+
## TODOs
|
40
|
+
|
41
|
+
* 0.0.1 - Initial gem
|
42
|
+
* 0.1.0 - Forgo attaching placeholder imagery
|
43
|
+
* 0.2.0 - Prioritize local thumbnail solr field
|
44
|
+
* 0.3.0 - Add Statesman (state machine library)
|
45
|
+
* Future - Rails 5.2 branch / ActionStorage
|
data/Rakefile
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
begin
|
2
|
+
require 'bundler/setup'
|
3
|
+
rescue LoadError
|
4
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
5
|
+
end
|
6
|
+
|
7
|
+
Bundler::GemHelper.install_tasks
|
8
|
+
|
9
|
+
require 'solr_wrapper'
|
10
|
+
|
11
|
+
require 'rspec/core/rake_task'
|
12
|
+
RSpec::Core::RakeTask.new(:spec)
|
13
|
+
|
14
|
+
require 'rubocop/rake_task'
|
15
|
+
RuboCop::RakeTask.new(:rubocop)
|
16
|
+
|
17
|
+
require 'engine_cart/rake_task'
|
18
|
+
EngineCart.fingerprint_proc = EngineCart.rails_fingerprint_proc
|
19
|
+
require 'geoblacklight_sidecar_images/version'
|
20
|
+
|
21
|
+
EngineCart.fingerprint_proc = EngineCart.rails_fingerprint_proc
|
22
|
+
|
23
|
+
task ci: ['engine_cart:generate'] do
|
24
|
+
ENV['environment'] = 'test'
|
25
|
+
|
26
|
+
SolrWrapper.wrap(port: '8983') do |solr|
|
27
|
+
solr.with_collection(name: 'blacklight-core', dir: File.join(__dir__, 'solr', 'conf')) do
|
28
|
+
# Fixtures here
|
29
|
+
# Rake::Task['spotlight:fixtures'].invoke
|
30
|
+
|
31
|
+
# run the tests
|
32
|
+
Rake::Task['spec'].invoke
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
task default: %i[rubocop ci]
|