geoblacklight_admin 0.3.2 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -0
  3. data/app/controllers/admin/ids_controller.rb +3 -0
  4. data/app/controllers/admin/imports_controller.rb +2 -2
  5. data/app/helpers/geoblacklight_admin_helper.rb +30 -0
  6. data/app/jobs/bulk_action_collect_documents.rb +11 -0
  7. data/app/jobs/geoblacklight_admin/store_image_job.rb +12 -0
  8. data/app/models/asset.rb +13 -0
  9. data/app/models/bulk_action.rb +8 -5
  10. data/app/models/bulk_actions/change_publication_state.rb +21 -0
  11. data/app/models/concerns/geoblacklight_admin/publication_state_search_behavior.rb +26 -0
  12. data/app/models/document/date_validator.rb +46 -0
  13. data/app/models/document.rb +114 -2
  14. data/app/models/element.rb +1 -0
  15. data/app/services/geoblacklight_admin/image_service/dynamic_map_layer.rb +15 -0
  16. data/app/services/geoblacklight_admin/image_service/iiif.rb +17 -0
  17. data/app/services/geoblacklight_admin/image_service/image_map_layer.rb +17 -0
  18. data/app/services/geoblacklight_admin/image_service/tiled_map_layer.rb +15 -0
  19. data/app/services/geoblacklight_admin/image_service/wms.rb +28 -0
  20. data/app/services/geoblacklight_admin/image_service.rb +238 -0
  21. data/app/services/geoblacklight_admin/item_viewer.rb +31 -0
  22. data/app/uploaders/asset_uploader.rb +31 -0
  23. data/app/views/admin/document_assets/index.html.erb +13 -1
  24. data/app/views/admin/documents/_document.html.erb +1 -1
  25. data/app/views/admin/documents/_document_kithe.html.erb +47 -0
  26. data/app/views/admin/documents/_form_nav.html.erb +1 -1
  27. data/app/views/admin/documents/_form_nav_kithe.html.erb +30 -0
  28. data/app/views/admin/documents/_result_facets.html.erb +26 -2
  29. data/app/views/admin/documents/index.html.erb +4 -8
  30. data/app/views/admin/documents/versions.html.erb +1 -1
  31. data/app/views/admin/imports/show.html.erb +35 -9
  32. data/app/views/admin/shared/_navbar.html.erb +6 -6
  33. data/db/migrate/20231106215104_bulk_action_sti.rb +10 -0
  34. data/lib/generators/geoblacklight_admin/config_generator.rb +33 -3
  35. data/{app/controllers/admin → lib/generators/geoblacklight_admin/templates}/api_controller.rb +4 -1
  36. data/lib/generators/geoblacklight_admin/templates/config/initializers/shrine.rb +3 -2
  37. data/lib/generators/geoblacklight_admin/templates/config/settings.yml +4 -1
  38. data/lib/generators/geoblacklight_admin/templates/views/_index_split_default.html.erb +27 -0
  39. data/lib/geoblacklight_admin/version.rb +1 -1
  40. data/lib/tasks/geoblacklight_admin/images.rake +30 -0
  41. metadata +22 -3
@@ -136,10 +136,13 @@ module Admin
136
136
  # Publication State
137
137
  config.add_facet_field Settings.FIELDS.B1G_PUBLICATION_STATE, label: "Publication State", limit: 8, collapse: false
138
138
 
139
+ # Import ID
140
+ config.add_facet_field Settings.FIELDS.B1G_IMPORT_ID, label: "Import ID", show: false
141
+
139
142
  # Resouce Class
140
143
  config.add_facet_field Settings.FIELDS.RESOURCE_CLASS, label: "Resource Class", limit: 8
141
144
 
142
- # Contributor
145
+ # Provider
143
146
  config.add_facet_field Settings.FIELDS.PROVIDER, label: "Provider", limit: 15
144
147
 
145
148
  # Accrual Method
@@ -2,8 +2,9 @@ require "shrine"
2
2
  require "shrine/storage/file_system"
3
3
 
4
4
  Shrine.storages = {
5
- cache: Shrine::Storage::FileSystem.new("public", prefix: "uploads/cache"), # temporary
6
- store: Shrine::Storage::FileSystem.new("public", prefix: "uploads") # permanent
5
+ cache: Shrine::Storage::FileSystem.new("public", prefix: "uploads/cache"), # temporary
6
+ store: Shrine::Storage::FileSystem.new("public", prefix: "uploads"), # permanent
7
+ kithe_derivatives: Shrine::Storage::FileSystem.new("public", prefix: "derivatives") # permanent
7
8
  }
8
9
 
9
10
  Shrine.plugin :activerecord
@@ -91,6 +91,7 @@ FIELDS:
91
91
  :B1G_CODE: 'b1g_code_s'
92
92
  :B1G_CHILD_RECORD: 'b1g_child_record_b'
93
93
  :B1G_GEOMG_ID: 'geomg_id_s'
94
+ :B1G_IMPORT_ID: 'b1g_geom_import_id_ssi'
94
95
 
95
96
  # Institution deployed at
96
97
  INSTITUTION: 'Stanford'
@@ -290,4 +291,6 @@ HELP_TEXT:
290
291
  # Enable catalog#show sidebar static map for items with the following viewer protocols
291
292
  SIDEBAR_STATIC_MAP:
292
293
  - 'iiif'
293
- - 'iiif_manifest'
294
+ - 'iiif_manifest'
295
+
296
+ GBLSI_THUMBNAIL_FIELD: 'b1g_image_ss'
@@ -0,0 +1,27 @@
1
+ <% # header bar for doc items in index view -%>
2
+ <%= content_tag :div, class: 'documentHeader row mb-4', data: { layer_id: document.id, geom: document.geometry.geojson } do %>
3
+ <div class='col-md-12'>
4
+ <div class='row'>
5
+ <div class='thumbnail'>
6
+ <div class='status-icons mb-2'>
7
+ <%= render partial: 'header_icons', locals: { document: document } %>
8
+ </div>
9
+ <% if document&.model&.thumbnail %>
10
+ <%= image_tag document.model.thumbnail.file_url(:thumb_mini) %>
11
+ <% end %>
12
+ </div>
13
+ <div class='col'>
14
+ <h3 class="h6 index_title text-span">
15
+ <% counter = document_counter_with_offset(document_counter) %>
16
+ <span class="document-counter">
17
+ <%= t('blacklight.search.documents.counter', :counter => counter) if counter %>
18
+ </span>
19
+ <%= link_to_document document, counter: counter, itemprop: "name" %>
20
+ </h3>
21
+ <small>
22
+ <%= geoblacklight_present(:index_fields_display, document) %>
23
+ </small>
24
+ </div>
25
+ </div>
26
+ </div>
27
+ <% end %>
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GeoblacklightAdmin
4
- VERSION = "0.3.2"
4
+ VERSION = "0.4.0"
5
5
  end
@@ -0,0 +1,30 @@
1
+ require "csv"
2
+
3
+ namespace :geoblacklight_admin do
4
+ namespace :images do
5
+ desc "Harvest image for specific document"
6
+ task harvest_doc_id: :environment do
7
+ GeoblacklightAdmin::StoreImageJob.perform_later(ENV["DOC_ID"])
8
+ end
9
+
10
+ desc "Harvest all images"
11
+ task harvest_all: :environment do
12
+ query = "*:*"
13
+ index = Geoblacklight::SolrDocument.index
14
+ results = index.send_and_receive(index.blacklight_config.solr_path,
15
+ q: query,
16
+ fl: "*",
17
+ rows: 100_000_000)
18
+ # num_found = results.response[:numFound]
19
+ # doc_counter = 0
20
+ results.docs.each do |document|
21
+ sleep(1)
22
+ begin
23
+ GeoblacklightAdmin::StoreImageJob.perform_later(document["id"])
24
+ rescue Blacklight::Exceptions::RecordNotFound
25
+ next
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geoblacklight_admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Larson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-23 00:00:00.000000000 Z
11
+ date: 2023-12-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_storage_validations
@@ -749,7 +749,6 @@ files:
749
749
  - app/channels/export_channel.rb
750
750
  - app/controllers/admin/admin_controller.rb
751
751
  - app/controllers/admin/advanced_search_controller.rb
752
- - app/controllers/admin/api_controller.rb
753
752
  - app/controllers/admin/bookmarks_controller.rb
754
753
  - app/controllers/admin/bulk_actions_controller.rb
755
754
  - app/controllers/admin/document_accesses_controller.rb
@@ -772,6 +771,7 @@ files:
772
771
  - app/helpers/import_documents_helper.rb
773
772
  - app/helpers/mappings_helper.rb
774
773
  - app/indexers/document_indexer.rb
774
+ - app/jobs/bulk_action_collect_documents.rb
775
775
  - app/jobs/bulk_action_revert_document_job.rb
776
776
  - app/jobs/bulk_action_revert_job.rb
777
777
  - app/jobs/bulk_action_run_document_job.rb
@@ -779,6 +779,7 @@ files:
779
779
  - app/jobs/export_job.rb
780
780
  - app/jobs/export_json_bulk_job.rb
781
781
  - app/jobs/export_json_job.rb
782
+ - app/jobs/geoblacklight_admin/store_image_job.rb
782
783
  - app/jobs/import_document_job.rb
783
784
  - app/jobs/import_run_job.rb
784
785
  - app/models/active_storage_attachment.rb
@@ -786,6 +787,7 @@ files:
786
787
  - app/models/admin/bookmark.rb
787
788
  - app/models/api_search_builder.rb
788
789
  - app/models/application_record.rb
790
+ - app/models/asset.rb
789
791
  - app/models/blacklight_api.rb
790
792
  - app/models/blacklight_api_facets.rb
791
793
  - app/models/blacklight_api_ids.rb
@@ -795,10 +797,13 @@ files:
795
797
  - app/models/bulk_action_document_transition.rb
796
798
  - app/models/bulk_action_state_machine.rb
797
799
  - app/models/bulk_action_transition.rb
800
+ - app/models/bulk_actions/change_publication_state.rb
801
+ - app/models/concerns/geoblacklight_admin/publication_state_search_behavior.rb
798
802
  - app/models/document.rb
799
803
  - app/models/document/bbox_validator.rb
800
804
  - app/models/document/controlled_lists.rb
801
805
  - app/models/document/date_range_validator.rb
806
+ - app/models/document/date_validator.rb
802
807
  - app/models/document/geom_validator.rb
803
808
  - app/models/document/reference.rb
804
809
  - app/models/document_access.rb
@@ -835,7 +840,15 @@ files:
835
840
  - app/services/export_csv_document_downloads_service.rb
836
841
  - app/services/export_csv_service.rb
837
842
  - app/services/export_json_service.rb
843
+ - app/services/geoblacklight_admin/image_service.rb
844
+ - app/services/geoblacklight_admin/image_service/dynamic_map_layer.rb
845
+ - app/services/geoblacklight_admin/image_service/iiif.rb
846
+ - app/services/geoblacklight_admin/image_service/image_map_layer.rb
847
+ - app/services/geoblacklight_admin/image_service/tiled_map_layer.rb
848
+ - app/services/geoblacklight_admin/image_service/wms.rb
849
+ - app/services/geoblacklight_admin/item_viewer.rb
838
850
  - app/services/zip_file_generator.rb
851
+ - app/uploaders/asset_uploader.rb
839
852
  - app/views/admin/advanced_search/facets.json.jbuilder
840
853
  - app/views/admin/advanced_search/index.json.jbuilder
841
854
  - app/views/admin/api/_field.json.jbuilder
@@ -879,11 +892,13 @@ files:
879
892
  - app/views/admin/documents/_document.html.erb
880
893
  - app/views/admin/documents/_document_bookmark.html.erb
881
894
  - app/views/admin/documents/_document_fields.html.erb
895
+ - app/views/admin/documents/_document_kithe.html.erb
882
896
  - app/views/admin/documents/_form.html.erb
883
897
  - app/views/admin/documents/_form_control.html.erb
884
898
  - app/views/admin/documents/_form_group.html.erb
885
899
  - app/views/admin/documents/_form_header.html.erb
886
900
  - app/views/admin/documents/_form_nav.html.erb
901
+ - app/views/admin/documents/_form_nav_kithe.html.erb
887
902
  - app/views/admin/documents/_json_aardvark.jbuilder
888
903
  - app/views/admin/documents/_json_btaa_aardvark.jbuilder
889
904
  - app/views/admin/documents/_json_file.jbuilder
@@ -979,6 +994,7 @@ files:
979
994
  - config/locales/simple_form.en.yml
980
995
  - config/routes.rb
981
996
  - db/migrate/20230316183001_add_geoblacklight_admin_gem.rb
997
+ - db/migrate/20231106215104_bulk_action_sti.rb
982
998
  - db/seeds.rb
983
999
  - db/seeds_elements.csv
984
1000
  - db/seeds_elements.numbers
@@ -992,6 +1008,7 @@ files:
992
1008
  - lib/generators/geoblacklight_admin/models_generator.rb
993
1009
  - lib/generators/geoblacklight_admin/templates/_show_sidebar.html.erb
994
1010
  - lib/generators/geoblacklight_admin/templates/_user_util_links.html.erb
1011
+ - lib/generators/geoblacklight_admin/templates/api_controller.rb
995
1012
  - lib/generators/geoblacklight_admin/templates/config/database.yml
996
1013
  - lib/generators/geoblacklight_admin/templates/config/geomg_aardvark_schema.json
997
1014
  - lib/generators/geoblacklight_admin/templates/config/initializers/devise.rb
@@ -1047,11 +1064,13 @@ files:
1047
1064
  - lib/generators/geoblacklight_admin/templates/solr/conf/xslt/example_atom.xsl
1048
1065
  - lib/generators/geoblacklight_admin/templates/solr/conf/xslt/example_rss.xsl
1049
1066
  - lib/generators/geoblacklight_admin/templates/solr/conf/xslt/luke.xsl
1067
+ - lib/generators/geoblacklight_admin/templates/views/_index_split_default.html.erb
1050
1068
  - lib/generators/geoblacklight_admin/views_generator.rb
1051
1069
  - lib/geoblacklight_admin.rb
1052
1070
  - lib/geoblacklight_admin/engine.rb
1053
1071
  - lib/geoblacklight_admin/version.rb
1054
1072
  - lib/tasks/geoblacklight_admin.rake
1073
+ - lib/tasks/geoblacklight_admin/images.rake
1055
1074
  homepage: https://github.com/geobtaa/geoblacklight_admin
1056
1075
  licenses:
1057
1076
  - MIT