geoblacklight_admin 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (346) hide show
  1. checksums.yaml +7 -0
  2. data/.editorconfig +18 -0
  3. data/.gitignore +75 -0
  4. data/.standard.yml +4 -0
  5. data/Gemfile +59 -0
  6. data/LICENSE +21 -0
  7. data/README.md +84 -0
  8. data/Rakefile +72 -0
  9. data/app/assets/images/.keep +0 -0
  10. data/app/assets/images/aerial_photo.jpg +0 -0
  11. data/app/assets/images/archive-solid.svg +1 -0
  12. data/app/assets/images/bookmark-regular.svg +1 -0
  13. data/app/assets/images/bookmark-solid.svg +1 -0
  14. data/app/assets/images/btaa-logo.jpg +0 -0
  15. data/app/assets/images/cloud-download-alt-solid.svg +1 -0
  16. data/app/assets/images/file-import-solid.svg +1 -0
  17. data/app/assets/images/trash-alt-solid.svg +1 -0
  18. data/app/assets/javascripts/geoblacklight_admin/chosen.js +4 -0
  19. data/app/assets/javascripts/geoblacklight_admin/date_range_picker.js +173 -0
  20. data/app/assets/javascripts/geoblacklight_admin/datepicker.js +22 -0
  21. data/app/assets/javascripts/geoblacklight_admin/elements.js +38 -0
  22. data/app/assets/javascripts/geoblacklight_admin/exports.js +3 -0
  23. data/app/assets/javascripts/geoblacklight_admin/fields.js +11 -0
  24. data/app/assets/javascripts/geoblacklight_admin/geoblacklight_admin.js +2 -0
  25. data/app/assets/javascripts/geoblacklight_admin/inputmask.js +4 -0
  26. data/app/assets/javascripts/geoblacklight_admin/locale.js +5 -0
  27. data/app/assets/javascripts/geoblacklight_admin/sortable.js +2544 -0
  28. data/app/assets/javascripts/geoblacklight_admin/tooltips.js +3 -0
  29. data/app/assets/javascripts/geoblacklight_admin/truncate.js +4 -0
  30. data/app/assets/javascripts/geoblacklight_admin.js +40 -0
  31. data/app/assets/stylesheets/geoblacklight_admin/_core.scss +47 -0
  32. data/app/assets/stylesheets/geoblacklight_admin/modules/_autocomplete.scss +32 -0
  33. data/app/assets/stylesheets/geoblacklight_admin/modules/_blazer.scss +3 -0
  34. data/app/assets/stylesheets/geoblacklight_admin/modules/_code.scss +3 -0
  35. data/app/assets/stylesheets/geoblacklight_admin/modules/_datepicker.scss +477 -0
  36. data/app/assets/stylesheets/geoblacklight_admin/modules/_elements.scss +3 -0
  37. data/app/assets/stylesheets/geoblacklight_admin/modules/_forms.scss +28 -0
  38. data/app/assets/stylesheets/geoblacklight_admin/modules/_icons.scss +15 -0
  39. data/app/assets/stylesheets/geoblacklight_admin/modules/_nav.scss +9 -0
  40. data/app/assets/stylesheets/geoblacklight_admin/modules/_tables.scss +4 -0
  41. data/app/assets/stylesheets/geoblacklight_admin/modules/_toasts.scss +7 -0
  42. data/app/assets/stylesheets/geoblacklight_admin/modules/_visibility.scss +3 -0
  43. data/app/assets/stylesheets/geoblacklight_admin/settings/_variables.scss +1 -0
  44. data/app/channels/export_channel.rb +12 -0
  45. data/app/controllers/admin/admin_controller.rb +16 -0
  46. data/app/controllers/admin/advanced_search_controller.rb +365 -0
  47. data/app/controllers/admin/api_controller.rb +386 -0
  48. data/app/controllers/admin/bookmarks_controller.rb +68 -0
  49. data/app/controllers/admin/bulk_actions_controller.rb +94 -0
  50. data/app/controllers/admin/concerns/.keep +0 -0
  51. data/app/controllers/admin/concerns/upload_util.rb +8 -0
  52. data/app/controllers/admin/document_accesses_controller.rb +125 -0
  53. data/app/controllers/admin/document_assets_controller.rb +198 -0
  54. data/app/controllers/admin/document_downloads_controller.rb +127 -0
  55. data/app/controllers/admin/documents_controller.rb +219 -0
  56. data/app/controllers/admin/elements_controller.rb +81 -0
  57. data/app/controllers/admin/form_elements_controller.rb +81 -0
  58. data/app/controllers/admin/ids_controller.rb +379 -0
  59. data/app/controllers/admin/import_documents_controller.rb +18 -0
  60. data/app/controllers/admin/imports_controller.rb +105 -0
  61. data/app/controllers/admin/mappings_controller.rb +95 -0
  62. data/app/controllers/admin/notifications_controller.rb +51 -0
  63. data/app/controllers/admin/search_controller.rb +10 -0
  64. data/app/controllers/admin/users_controller.rb +10 -0
  65. data/app/helpers/bulk_actions_helper.rb +9 -0
  66. data/app/helpers/document_helper.rb +60 -0
  67. data/app/helpers/form_input_helper.rb +73 -0
  68. data/app/helpers/geoblacklight_admin_helper.rb +118 -0
  69. data/app/helpers/import_documents_helper.rb +5 -0
  70. data/app/helpers/mappings_helper.rb +27 -0
  71. data/app/indexers/document_indexer.rb +34 -0
  72. data/app/jobs/bulk_action_revert_document_job.rb +49 -0
  73. data/app/jobs/bulk_action_revert_job.rb +25 -0
  74. data/app/jobs/bulk_action_run_document_job.rb +42 -0
  75. data/app/jobs/bulk_action_run_job.rb +27 -0
  76. data/app/jobs/export_job.rb +72 -0
  77. data/app/jobs/export_json_job.rb +120 -0
  78. data/app/jobs/import_document_job.rb +25 -0
  79. data/app/jobs/import_run_job.rb +33 -0
  80. data/app/models/active_storage_attachment.rb +5 -0
  81. data/app/models/active_storage_blob.rb +5 -0
  82. data/app/models/api_search_builder.rb +12 -0
  83. data/app/models/application_record.rb +6 -0
  84. data/app/models/blacklight_api.rb +93 -0
  85. data/app/models/blacklight_api_facets.rb +15 -0
  86. data/app/models/blacklight_api_ids.rb +103 -0
  87. data/app/models/bookmark.rb +17 -0
  88. data/app/models/bulk_action.rb +88 -0
  89. data/app/models/bulk_action_document.rb +22 -0
  90. data/app/models/bulk_action_document_state_machine.rb +16 -0
  91. data/app/models/bulk_action_document_transition.rb +19 -0
  92. data/app/models/bulk_action_state_machine.rb +16 -0
  93. data/app/models/bulk_action_transition.rb +26 -0
  94. data/app/models/concerns/.keep +0 -0
  95. data/app/models/document/bbox_validator.rb +70 -0
  96. data/app/models/document/controlled_lists.rb +104 -0
  97. data/app/models/document/date_range_validator.rb +63 -0
  98. data/app/models/document/geom_validator.rb +117 -0
  99. data/app/models/document/reference.rb +107 -0
  100. data/app/models/document.rb +264 -0
  101. data/app/models/document_access.rb +35 -0
  102. data/app/models/document_download.rb +35 -0
  103. data/app/models/document_state_machine.rb +14 -0
  104. data/app/models/document_transition.rb +26 -0
  105. data/app/models/element.rb +90 -0
  106. data/app/models/form_control.rb +2 -0
  107. data/app/models/form_element.rb +19 -0
  108. data/app/models/form_feature.rb +2 -0
  109. data/app/models/form_group.rb +2 -0
  110. data/app/models/form_header.rb +2 -0
  111. data/app/models/geoblacklight_admin/field_mappings_btaa_aardvark.rb +379 -0
  112. data/app/models/geoblacklight_admin/field_mappings_gblv1.rb +344 -0
  113. data/app/models/geoblacklight_admin/iso_language_codes.rb +515 -0
  114. data/app/models/geoblacklight_admin/schema.rb +194 -0
  115. data/app/models/geoblacklight_admin.rb +3 -0
  116. data/app/models/import/csv_duplicates_validator.rb +36 -0
  117. data/app/models/import/csv_header_validator.rb +24 -0
  118. data/app/models/import.rb +186 -0
  119. data/app/models/import_btaa.rb +91 -0
  120. data/app/models/import_btaa_aardvark.rb +109 -0
  121. data/app/models/import_document.rb +34 -0
  122. data/app/models/import_document_state_machine.rb +12 -0
  123. data/app/models/import_document_transition.rb +19 -0
  124. data/app/models/import_gblv1.rb +92 -0
  125. data/app/models/import_state_machine.rb +16 -0
  126. data/app/models/import_transition.rb +26 -0
  127. data/app/models/mapping.rb +10 -0
  128. data/app/models/notification.rb +9 -0
  129. data/app/models/user.rb +26 -0
  130. data/app/notifications/export_notification.rb +30 -0
  131. data/app/services/export_csv_document_access_links_service.rb +47 -0
  132. data/app/services/export_csv_document_downloads_service.rb +47 -0
  133. data/app/services/export_csv_service.rb +44 -0
  134. data/app/services/export_json_service.rb +35 -0
  135. data/app/services/zip_file_generator.rb +56 -0
  136. data/app/views/admin/advanced_search/facets.json.jbuilder +80 -0
  137. data/app/views/admin/advanced_search/index.json.jbuilder +90 -0
  138. data/app/views/admin/api/_field.json.jbuilder +10 -0
  139. data/app/views/admin/api/fetch.json.jbuilder +86 -0
  140. data/app/views/admin/api/index.json.jbuilder +90 -0
  141. data/app/views/admin/bookmarks/_bookmark.json.jbuilder +4 -0
  142. data/app/views/admin/bookmarks/create.js.erb +7 -0
  143. data/app/views/admin/bookmarks/destroy.js.erb +7 -0
  144. data/app/views/admin/bookmarks/index.html.erb +21 -0
  145. data/app/views/admin/bookmarks/index.json.jbuilder +3 -0
  146. data/app/views/admin/bulk_actions/_bulk_action.json.jbuilder +4 -0
  147. data/app/views/admin/bulk_actions/_form.html.erb +17 -0
  148. data/app/views/admin/bulk_actions/edit.html.erb +6 -0
  149. data/app/views/admin/bulk_actions/index.html.erb +54 -0
  150. data/app/views/admin/bulk_actions/index.json.jbuilder +3 -0
  151. data/app/views/admin/bulk_actions/new.html.erb +5 -0
  152. data/app/views/admin/bulk_actions/show.html.erb +100 -0
  153. data/app/views/admin/bulk_actions/show.json.jbuilder +3 -0
  154. data/app/views/admin/devise/confirmations/new.html.erb +16 -0
  155. data/app/views/admin/devise/invitations/edit.html.erb +15 -0
  156. data/app/views/admin/devise/invitations/new.html.erb +15 -0
  157. data/app/views/admin/devise/mailer/invitation_instructions.html.erb +11 -0
  158. data/app/views/admin/devise/mailer/invitation_instructions.text.erb +11 -0
  159. data/app/views/admin/devise/passwords/edit.html.erb +26 -0
  160. data/app/views/admin/devise/passwords/new.html.erb +16 -0
  161. data/app/views/admin/devise/registrations/edit.html.erb +35 -0
  162. data/app/views/admin/devise/registrations/new.html.erb +30 -0
  163. data/app/views/admin/devise/sessions/new.html.erb +28 -0
  164. data/app/views/admin/devise/shared/_links.html.erb +27 -0
  165. data/app/views/admin/devise/unlocks/new.html.erb +16 -0
  166. data/app/views/admin/document_accesses/_document_access.json.jbuilder +4 -0
  167. data/app/views/admin/document_accesses/_form.html.erb +17 -0
  168. data/app/views/admin/document_accesses/destroy_all.html.erb +70 -0
  169. data/app/views/admin/document_accesses/edit.html.erb +5 -0
  170. data/app/views/admin/document_accesses/import.html.erb +70 -0
  171. data/app/views/admin/document_accesses/index.html.erb +74 -0
  172. data/app/views/admin/document_accesses/index.json.jbuilder +3 -0
  173. data/app/views/admin/document_accesses/new.html.erb +6 -0
  174. data/app/views/admin/document_accesses/show.html.erb +19 -0
  175. data/app/views/admin/document_accesses/show.json.jbuilder +3 -0
  176. data/app/views/admin/document_assets/display_attach_form.html.erb +44 -0
  177. data/app/views/admin/document_assets/index.html.erb +65 -0
  178. data/app/views/admin/document_downloads/_document_download.json.jbuilder +4 -0
  179. data/app/views/admin/document_downloads/_form.html.erb +15 -0
  180. data/app/views/admin/document_downloads/destroy_all.html.erb +70 -0
  181. data/app/views/admin/document_downloads/edit.html.erb +6 -0
  182. data/app/views/admin/document_downloads/import.html.erb +74 -0
  183. data/app/views/admin/document_downloads/index.html.erb +70 -0
  184. data/app/views/admin/document_downloads/index.json.jbuilder +3 -0
  185. data/app/views/admin/document_downloads/new.html.erb +5 -0
  186. data/app/views/admin/document_downloads/show.html.erb +24 -0
  187. data/app/views/admin/document_downloads/show.json.jbuilder +3 -0
  188. data/app/views/admin/documents/_document.html.erb +29 -0
  189. data/app/views/admin/documents/_document_bookmark.html.erb +17 -0
  190. data/app/views/admin/documents/_document_fields.html.erb +24 -0
  191. data/app/views/admin/documents/_form.html.erb +49 -0
  192. data/app/views/admin/documents/_form_control.html.erb +86 -0
  193. data/app/views/admin/documents/_form_group.html.erb +1 -0
  194. data/app/views/admin/documents/_form_header.html.erb +1 -0
  195. data/app/views/admin/documents/_form_nav.html.erb +21 -0
  196. data/app/views/admin/documents/_json_aardvark.jbuilder +47 -0
  197. data/app/views/admin/documents/_json_btaa_aardvark.jbuilder +16 -0
  198. data/app/views/admin/documents/_json_gbl_v1.jbuilder +32 -0
  199. data/app/views/admin/documents/_result_facets.html.erb +35 -0
  200. data/app/views/admin/documents/_result_pagination.html.erb +21 -0
  201. data/app/views/admin/documents/_result_selected_options.html.erb +54 -0
  202. data/app/views/admin/documents/_result_selection_options.html.erb +10 -0
  203. data/app/views/admin/documents/_result_toggle.html.erb +13 -0
  204. data/app/views/admin/documents/edit.html.erb +7 -0
  205. data/app/views/admin/documents/features/_assets.html.erb +3 -0
  206. data/app/views/admin/documents/features/_institutional_access_links.html.erb +3 -0
  207. data/app/views/admin/documents/features/_multiple_download_links.html.erb +27 -0
  208. data/app/views/admin/documents/fetch.json_aardvark.jbuilder +9 -0
  209. data/app/views/admin/documents/fetch.json_btaa_aardvark.jbuilder +9 -0
  210. data/app/views/admin/documents/fetch.json_gbl_v1.jbuilder +9 -0
  211. data/app/views/admin/documents/index.html.erb +49 -0
  212. data/app/views/admin/documents/index.json_aardvark.jbuilder +9 -0
  213. data/app/views/admin/documents/index.json_btaa_aardvark.jbuilder +9 -0
  214. data/app/views/admin/documents/index.json_gbl_v1.jbuilder +9 -0
  215. data/app/views/admin/documents/show.json_aardvark.jbuilder +3 -0
  216. data/app/views/admin/documents/show.json_btaa_aardvark.jbuilder +3 -0
  217. data/app/views/admin/documents/show.json_gbl_v1.jbuilder +3 -0
  218. data/app/views/admin/documents/versions.html.erb +110 -0
  219. data/app/views/admin/elements/_element.json.jbuilder +2 -0
  220. data/app/views/admin/elements/_form.html.erb +45 -0
  221. data/app/views/admin/elements/edit.html.erb +6 -0
  222. data/app/views/admin/elements/index.html.erb +68 -0
  223. data/app/views/admin/elements/index.json.jbuilder +1 -0
  224. data/app/views/admin/elements/new.html.erb +5 -0
  225. data/app/views/admin/elements/show.html.erb +121 -0
  226. data/app/views/admin/elements/show.json.jbuilder +1 -0
  227. data/app/views/admin/form_elements/_form.html.erb +46 -0
  228. data/app/views/admin/form_elements/_form_element.json.jbuilder +2 -0
  229. data/app/views/admin/form_elements/edit.html.erb +6 -0
  230. data/app/views/admin/form_elements/index.html.erb +49 -0
  231. data/app/views/admin/form_elements/index.json.jbuilder +1 -0
  232. data/app/views/admin/form_elements/new.html.erb +5 -0
  233. data/app/views/admin/form_elements/show.html.erb +19 -0
  234. data/app/views/admin/form_elements/show.json.jbuilder +1 -0
  235. data/app/views/admin/ids/fetch.json.jbuilder +86 -0
  236. data/app/views/admin/ids/index.json.jbuilder +41 -0
  237. data/app/views/admin/import_documents/show.html.haml +20 -0
  238. data/app/views/admin/imports/_form.html.erb +27 -0
  239. data/app/views/admin/imports/_import.json.jbuilder +4 -0
  240. data/app/views/admin/imports/_show_failed_tab.html.erb +37 -0
  241. data/app/views/admin/imports/_show_success_tab.html.erb +31 -0
  242. data/app/views/admin/imports/edit.html.erb +8 -0
  243. data/app/views/admin/imports/index.html.erb +56 -0
  244. data/app/views/admin/imports/index.json.jbuilder +3 -0
  245. data/app/views/admin/imports/new.html.erb +7 -0
  246. data/app/views/admin/imports/show.html.erb +123 -0
  247. data/app/views/admin/imports/show.json.jbuilder +3 -0
  248. data/app/views/admin/layouts/application.html.erb +30 -0
  249. data/app/views/admin/layouts/blazer/application.html.erb +23 -0
  250. data/app/views/admin/layouts/mailer.html.erb +13 -0
  251. data/app/views/admin/layouts/mailer.text.erb +1 -0
  252. data/app/views/admin/mappings/_form.html.erb +17 -0
  253. data/app/views/admin/mappings/_mapping.json.jbuilder +4 -0
  254. data/app/views/admin/mappings/edit.html.erb +6 -0
  255. data/app/views/admin/mappings/index.html.erb +37 -0
  256. data/app/views/admin/mappings/index.json.jbuilder +3 -0
  257. data/app/views/admin/mappings/new.html.erb +5 -0
  258. data/app/views/admin/mappings/show.html.erb +27 -0
  259. data/app/views/admin/mappings/show.json.jbuilder +3 -0
  260. data/app/views/admin/notifications/_notification.html.haml +31 -0
  261. data/app/views/admin/notifications/index.html.erb +54 -0
  262. data/app/views/admin/notifications/update.js.erb +7 -0
  263. data/app/views/admin/search/index.html.erb +38 -0
  264. data/app/views/admin/shared/_flash_messages.html.erb +5 -0
  265. data/app/views/admin/shared/_footer.html.erb +56 -0
  266. data/app/views/admin/shared/_js_behaviors.html.erb +147 -0
  267. data/app/views/admin/shared/_navbar.html.erb +78 -0
  268. data/app/views/admin/shared/_navbar_blazer.html.erb +42 -0
  269. data/app/views/admin/shared/_schema_timestamp.html.erb +16 -0
  270. data/app/views/admin/shared/_toast.html.erb +13 -0
  271. data/app/views/admin/users/index.html.erb +21 -0
  272. data/config/authorities/formats.yml +25 -0
  273. data/config/authorities/languages.yml +50 -0
  274. data/config/authorities/resource_type.yml +82 -0
  275. data/config/blazer.yml +79 -0
  276. data/config/gbl_v1_schema.json +118 -0
  277. data/config/geomg_aardvark_schema.json +211 -0
  278. data/config/geomg_schema.json +123 -0
  279. data/config/locales/devise.en.yml +65 -0
  280. data/config/locales/devise_invitable.en.yml +31 -0
  281. data/config/locales/documents.en.yml +189 -0
  282. data/config/locales/en.yml +51 -0
  283. data/config/locales/geoblacklight.en.yml +178 -0
  284. data/config/locales/simple_form.en.yml +31 -0
  285. data/config/routes.rb +162 -0
  286. data/db/migrate/20230316183001_add_geoblacklight_admin.rb +399 -0
  287. data/db/seeds.rb +26 -0
  288. data/db/seeds_elements.csv +56 -0
  289. data/db/seeds_elements.numbers +0 -0
  290. data/db/seeds_form_elements.csv +71 -0
  291. data/db/seeds_form_elements.numbers +0 -0
  292. data/db/structure.sql +816 -0
  293. data/geoblacklight_admin.gemspec +67 -0
  294. data/lib/generators/geoblacklight_admin/config_generator.rb +336 -0
  295. data/lib/generators/geoblacklight_admin/example_docs_generator.rb +18 -0
  296. data/lib/generators/geoblacklight_admin/helpers_generator.rb +18 -0
  297. data/lib/generators/geoblacklight_admin/install_generator.rb +60 -0
  298. data/lib/generators/geoblacklight_admin/jobs_generator.rb +21 -0
  299. data/lib/generators/geoblacklight_admin/models_generator.rb +23 -0
  300. data/lib/generators/geoblacklight_admin/templates/.env.development.example +28 -0
  301. data/lib/generators/geoblacklight_admin/templates/.solr_wrapper.yml +7 -0
  302. data/lib/generators/geoblacklight_admin/templates/_user_util_links.html.erb +30 -0
  303. data/lib/generators/geoblacklight_admin/templates/config/database.yml +18 -0
  304. data/lib/generators/geoblacklight_admin/templates/config/geomg_aardvark_schema.json +211 -0
  305. data/lib/generators/geoblacklight_admin/templates/config/initializers/geoblacklight_admin.rb +25 -0
  306. data/lib/generators/geoblacklight_admin/templates/config/initializers/kithe.rb +31 -0
  307. data/lib/generators/geoblacklight_admin/templates/config/initializers/pagy.rb +158 -0
  308. data/lib/generators/geoblacklight_admin/templates/config/initializers/statesman.rb +7 -0
  309. data/lib/generators/geoblacklight_admin/templates/javascript/channels/consumer.js +6 -0
  310. data/lib/generators/geoblacklight_admin/templates/javascript/channels/export_channel.js +30 -0
  311. data/lib/generators/geoblacklight_admin/templates/javascript/channels/index.js +5 -0
  312. data/lib/generators/geoblacklight_admin/templates/javascript/controllers/application_controller.js +17 -0
  313. data/lib/generators/geoblacklight_admin/templates/javascript/controllers/document_controller.js +26 -0
  314. data/lib/generators/geoblacklight_admin/templates/javascript/controllers/index.js +10 -0
  315. data/lib/generators/geoblacklight_admin/templates/javascript/controllers/results_controller.js +310 -0
  316. data/lib/generators/geoblacklight_admin/templates/javascript/packs/application.js +23 -0
  317. data/lib/generators/geoblacklight_admin/templates/javascript/src/js/admin/qa_autocomplete.js +1134 -0
  318. data/lib/generators/geoblacklight_admin/templates/package.json +32 -0
  319. data/lib/generators/geoblacklight_admin/templates/solr/README-geoblacklight-solr-development.txt +3 -0
  320. data/lib/generators/geoblacklight_admin/templates/solr/conf/_rest_managed.json +3 -0
  321. data/lib/generators/geoblacklight_admin/templates/solr/conf/admin-extra.html +31 -0
  322. data/lib/generators/geoblacklight_admin/templates/solr/conf/core.properties +5 -0
  323. data/lib/generators/geoblacklight_admin/templates/solr/conf/elevate.xml +36 -0
  324. data/lib/generators/geoblacklight_admin/templates/solr/conf/mapping-ISOLatin1Accent.txt +246 -0
  325. data/lib/generators/geoblacklight_admin/templates/solr/conf/protwords.txt +21 -0
  326. data/lib/generators/geoblacklight_admin/templates/solr/conf/schema.xml +229 -0
  327. data/lib/generators/geoblacklight_admin/templates/solr/conf/scripts.conf +24 -0
  328. data/lib/generators/geoblacklight_admin/templates/solr/conf/solrconfig.xml +266 -0
  329. data/lib/generators/geoblacklight_admin/templates/solr/conf/spellings.txt +2 -0
  330. data/lib/generators/geoblacklight_admin/templates/solr/conf/stopwords.txt +58 -0
  331. data/lib/generators/geoblacklight_admin/templates/solr/conf/stopwords_en.txt +58 -0
  332. data/lib/generators/geoblacklight_admin/templates/solr/conf/synonyms.txt +43 -0
  333. data/lib/generators/geoblacklight_admin/templates/solr/conf/xslt/example.xsl +132 -0
  334. data/lib/generators/geoblacklight_admin/templates/solr/conf/xslt/example_atom.xsl +67 -0
  335. data/lib/generators/geoblacklight_admin/templates/solr/conf/xslt/example_rss.xsl +66 -0
  336. data/lib/generators/geoblacklight_admin/templates/solr/conf/xslt/luke.xsl +337 -0
  337. data/lib/generators/geoblacklight_admin/templates/solr/snapshots/.keep +0 -0
  338. data/lib/generators/geoblacklight_admin/views_generator.rb +19 -0
  339. data/lib/geoblacklight_admin/engine.rb +20 -0
  340. data/lib/geoblacklight_admin/version.rb +5 -0
  341. data/lib/geoblacklight_admin.rb +7 -0
  342. data/lib/tasks/.keep +0 -0
  343. data/lib/tasks/geoblacklight_admin.rake +209 -0
  344. data/spec/test_app_templates/lib/generators/test_app_generator.rb +35 -0
  345. data/template.rb +16 -0
  346. metadata +1037 -0
@@ -0,0 +1,3 @@
1
+ .hidden {
2
+ display: none;
3
+ }
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ # ExportChannel
4
+ class ExportChannel < ApplicationCable::Channel
5
+ def subscribed
6
+ stream_from "export_channel"
7
+ end
8
+
9
+ def unsubscribed
10
+ # Any cleanup needed when channel is unsubscribed
11
+ end
12
+ end
@@ -0,0 +1,16 @@
1
+ module Admin
2
+ class AdminController < ApplicationController
3
+ include Devise::Controllers::Helpers
4
+ include Pagy::Backend
5
+ layout 'admin/layouts/application'
6
+
7
+ before_action :authenticate_admin!
8
+
9
+ protected
10
+
11
+ def authenticate_admin!
12
+ authenticate_user!
13
+ redirect_to :somewhere, status: :forbidden unless current_user.admin?
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,365 @@
1
+ # -*- encoding : utf-8 -*-
2
+ require 'blacklight/catalog'
3
+
4
+ module Admin
5
+ class AdvancedSearchController < Admin::AdminController
6
+ include ::BlacklightAdvancedSearch::Controller
7
+ include ::BlacklightRangeLimit::ControllerOverride
8
+ include ::Blacklight::Catalog
9
+
10
+ configure_blacklight do |config|
11
+ # special search builder
12
+ config.search_builder_class = ApiSearchBuilder
13
+
14
+ # default advanced config values
15
+ config.advanced_search ||= Blacklight::OpenStructWithHashAccess.new
16
+
17
+ # Blacklight update to 7.0.0
18
+ config.add_results_document_tool(:bookmark, partial: 'bookmark_control', if: :render_bookmarks_control?)
19
+
20
+ config.add_results_collection_tool(:sort_widget)
21
+ config.add_results_collection_tool(:per_page_widget)
22
+ config.add_results_collection_tool(:view_type_group)
23
+
24
+ config.add_show_tools_partial(:bookmark, partial: 'bookmark_control', if: :render_bookmarks_control?)
25
+ config.add_show_tools_partial(:email, callback: :email_action, validator: :validate_email_params)
26
+ config.add_show_tools_partial(:sms, if: :render_sms_action?, callback: :sms_action, validator: :validate_sms_params)
27
+
28
+ config.add_nav_action(:bookmark, partial: 'blacklight/nav/bookmark', if: :render_bookmarks_control?)
29
+ # Blacklight update to 7.0.0
30
+
31
+ # Advanced config values
32
+ config.advanced_search ||= Blacklight::OpenStructWithHashAccess.new
33
+ config.advanced_search[:url_key] ||= 'advanced'
34
+ config.advanced_search[:query_parser] ||= 'edismax'
35
+ config.advanced_search[:form_solr_parameters] ||= {}
36
+ config.advanced_search[:form_solr_parameters]['facet.field'] ||= [Settings.FIELDS.PROVIDER, Settings.FIELDS.B1G_CODE, Settings.FIELDS.MEMBER_OF, Settings.FIELDS.IS_PART_OF, Settings.FIELDS.RESOURCE_CLASS, Settings.FIELDS.RESOURCE_TYPE, Settings.FIELDS.SUBJECT, Settings.FIELDS.THEME, Settings.FIELDS.FORMAT, Settings.FIELDS.SUPPRESSED, Settings.FIELDS.B1G_CHILD_RECORD, Settings.FIELDS.GEOREFERENCED]
37
+ config.advanced_search[:form_solr_parameters]['facet.query'] ||= ''
38
+ config.advanced_search[:form_solr_parameters]['facet.limit'] ||= -1
39
+ config.advanced_search[:form_solr_parameters]['facet.sort'] ||= 'index'
40
+
41
+ # Map views
42
+ config.view.mapview.partials = [:index]
43
+ config.view['split'].title = "List view"
44
+ config.view['mapview'].title = "Map view"
45
+
46
+ config.raw_endpoint.enabled = true
47
+
48
+ ## Default parameters to send to solr for all search-like requests. See also SolrHelper#solr_search_params
49
+ config.default_solr_params = {
50
+ :start => 0,
51
+ 'q.alt' => '*:*',
52
+ 'bf' => ["if(exists(#{Settings.FIELDS.B1G_CHILD_RECORD}),0,100)^0.5"],
53
+ 'admin.api' => true
54
+ }
55
+
56
+ config.default_per_page = 20 # Works!
57
+
58
+ ## Default parameters to send on single-document requests to Solr. These settings are the Blackligt defaults (see SolrHelper#solr_doc_params) or
59
+ ## parameters included in the Blacklight-jetty document requestHandler.
60
+ #
61
+ config.default_document_solr_params = {
62
+ :qt => 'document',
63
+ :q => "{!raw f=#{Settings.FIELDS.B1G_GEOMG_ID} v=$id}"
64
+ }
65
+
66
+ # config.search_builder_class = Geoblacklight::SearchBuilder
67
+
68
+ # solr field configuration for search results/index views
69
+ # config.index.show_link = 'title_display'
70
+ # config.index.record_display_type = 'format'
71
+
72
+ config.index.title_field = Settings.FIELDS.TITLE
73
+ config.index.document_presenter_class = Geoblacklight::DocumentPresenter
74
+
75
+ # solr field configuration for document/show views
76
+
77
+ config.show.display_type_field = 'format'
78
+
79
+ # Custom GeoBlacklight fields which currently map to GeoBlacklight-Schema
80
+ # v0.3.2
81
+ config.wxs_identifier_field = Settings.FIELDS.WXS_IDENTIFIER
82
+
83
+ # solr fields that will be treated as facets by the blacklight application
84
+ # The ordering of the field names is the order of the display
85
+ #
86
+ # Setting a limit will trigger Blacklight's 'more' facet values link.
87
+ # * If left unset, then all facet values returned by solr will be displayed.
88
+ # * If set to an integer, then "f.somefield.facet.limit" will be added to
89
+ # solr request, with actual solr request being +1 your configured limit --
90
+ # you configure the number of items you actually want _displayed_ in a page.
91
+ # * If set to 'true', then no additional parameters will be sent to solr,
92
+ # but any 'sniffed' request limit parameters will be used for paging, with
93
+ # paging at requested limit -1. Can sniff from facet.limit or
94
+ # f.specific_field.facet.limit solr request params. This 'true' config
95
+ # can be used if you set limits in :default_solr_params, or as defaults
96
+ # on the solr side in the request handler itself. Request handler defaults
97
+ # sniffing requires solr requests to be made with "echoParams=all", for
98
+ # app code to actually have it echo'd back to see it.
99
+ #
100
+ # :show may be set to false if you don't want the facet to be drawn in the
101
+ # facet bar
102
+ # config.add_facet_field 'format', :label => 'Format'
103
+ # config.add_facet_field 'pub_date', :label => 'Publication Year', :single => true
104
+ # config.add_facet_field 'subject_topic_facet', :label => 'Topic', :limit => 20
105
+ # config.add_facet_field 'language_facet', :label => 'Language', :limit => true
106
+ # config.add_facet_field 'lc_1letter_facet', :label => 'Call Number'
107
+ # config.add_facet_field 'subject_geo_facet', :label => 'Region'
108
+ # config.add_facet_field 'solr_bbox', :fq => "solr_bbox:IsWithin(-88,26,-79,36)", :label => 'Spatial'
109
+
110
+ # config.add_facet_field 'example_pivot_field', :label => 'Pivot Field', :pivot => ['format', 'language_facet']
111
+
112
+ ## FACETS
113
+ #
114
+ # Publication State
115
+ config.add_facet_field Settings.FIELDS.B1G_PUBLICATION_STATE, :label => 'Publication State', :limit => 8, collapse: false
116
+
117
+ # Resouce Class
118
+ config.add_facet_field Settings.FIELDS.RESOURCE_CLASS, label: 'Resource Class', limit: 8
119
+
120
+ # Contributor
121
+ config.add_facet_field Settings.FIELDS.PROVIDER, label: 'Provider', limit: 15
122
+
123
+ # Accrual Method
124
+ config.add_facet_field Settings.FIELDS.B1G_ACCRUAL_METHOD, :label => 'Accrual Method'
125
+
126
+ # Public/Restricted
127
+ config.add_facet_field Settings.FIELDS.ACCESS_RIGHTS, :label => 'Public/Restricted'
128
+
129
+ # ADVANCED SEARCH
130
+ #
131
+ # Code
132
+ config.add_facet_field Settings.FIELDS.B1G_CODE, label: 'Code', limit: 1000
133
+
134
+ # Is Part Of
135
+ config.add_facet_field Settings.FIELDS.IS_PART_OF, label: 'Is Part Of', limit: 1000
136
+
137
+ # Member Of
138
+ config.add_facet_field Settings.FIELDS.MEMBER_OF, label: 'Member Of', limit: 1000
139
+
140
+ # Resource Type
141
+ config.add_facet_field Settings.FIELDS.RESOURCE_TYPE, label: 'Resource Type', limit: 1000
142
+
143
+ # Subject
144
+ config.add_facet_field Settings.FIELDS.SUBJECT, label: 'Subject', limit: 1000
145
+
146
+ # Theme
147
+ config.add_facet_field Settings.FIELDS.THEME, label: 'Theme', limit: 1000
148
+
149
+ # Format
150
+ config.add_facet_field Settings.FIELDS.FORMAT, label: 'Format', limit: 1000
151
+
152
+ # Suppressed
153
+ config.add_facet_field Settings.FIELDS.SUPPRESSED, label: 'Suppressed'
154
+
155
+ # Child Record
156
+ config.add_facet_field Settings.FIELDS.B1G_CHILD_RECORD, label: 'Child Record'
157
+
158
+ # Georeferenced
159
+ config.add_facet_field Settings.FIELDS.GEOREFERENCED, label: 'Georeferenced'
160
+
161
+ # Have BL send all facet field names to Solr, which has been the default
162
+ # previously. Simply remove these lines if you'd rather use Solr request
163
+ # handler defaults, or have no facets.
164
+ config.add_facet_fields_to_solr_request!
165
+
166
+ # solr fields to be displayed in the index (search results) view
167
+ # The ordering of the field names is the order of the display
168
+ # config.add_index_field 'title_display', :label => 'Title:'
169
+ # config.add_index_field 'title_vern_display', :label => 'Title:'
170
+ # config.add_index_field 'author_display', :label => 'Author:'
171
+ # config.add_index_field 'author_vern_display', :label => 'Author:'
172
+ # config.add_index_field 'format', :label => 'Format:'
173
+ # config.add_index_field 'language_facet', :label => 'Language:'
174
+ # config.add_index_field 'published_display', :label => 'Published:'
175
+ # config.add_index_field 'published_vern_display', :label => 'Published:'
176
+ # config.add_index_field 'lc_callnum_display', :label => 'Call number:'
177
+
178
+ config.add_index_field Settings.FIELDS.TITLE, :label => 'Title:'
179
+ config.add_index_field Settings.FIELDS.B1G_GEOMG_ID, :label => 'Identifier:'
180
+ config.add_index_field Settings.FIELDS.PROVIDER, :label => 'Institution:'
181
+ config.add_index_field Settings.FIELDS.ACCESS_RIGHTS, :label => 'Access:'
182
+ config.add_index_field Settings.FIELDS.SUBJECT, :label => 'Keywords:'
183
+ config.add_index_field Settings.FIELDS.CENTROID, :label => 'Centroid:'
184
+ config.add_index_field Settings.FIELDS.INDEX_YEAR
185
+ config.add_index_field Settings.FIELDS.CREATOR
186
+ config.add_index_field Settings.FIELDS.DESCRIPTION, helper_method: :snippit
187
+ config.add_index_field Settings.FIELDS.PUBLISHER
188
+ config.add_index_field Settings.FIELDS.SUPPRESSED, :label => 'Suppressed:'
189
+
190
+ # solr fields to be displayed in the show (single result) view
191
+ # The ordering of the field names is the order of the display
192
+ #
193
+ # item_prop: [String] property given to span with Schema.org item property
194
+ # link_to_facet: [Boolean] that can be passed to link to a facet search
195
+ # helper_method: [Symbol] method that can be used to render the value
196
+ config.add_show_field Settings.FIELDS.CREATOR, label: 'Creator', itemprop: 'creator'
197
+ config.add_show_field Settings.FIELDS.DESCRIPTION, label: 'Description', itemprop: 'description', helper_method: :render_value_as_truncate_abstract
198
+ config.add_show_field Settings.FIELDS.PUBLISHER, label: 'Publisher', itemprop: 'publisher', link_to_facet: true
199
+ config.add_show_field Settings.FIELDS.SPATIAL_COVERAGE, label: 'Place', itemprop: 'spatial', link_to_facet: true, helper_method: :render_placenames_as_truncate_abstract
200
+ config.add_show_field Settings.FIELDS.SUBJECT, label: 'Subject', itemprop: 'keywords', link_to_facet: true
201
+ config.add_show_field Settings.FIELDS.RESOURCE_TYPE, label: 'Type', itemprop: 'keywords', link_to_facet: true
202
+ config.add_show_field Settings.FIELDS.DATE_ISSUED, label: 'Date Published', itemprop: 'keywords', link_to_facet: true
203
+ config.add_show_field Settings.FIELDS.TEMPORAL_COVERAGE, label: 'Temporal Coverage', itemprop: 'temporal'
204
+ config.add_show_field Settings.FIELDS.PROVIDER, label: 'Contributed by', link_to_facet: true
205
+ config.add_show_field Settings.FIELDS.RIGHTS, label: 'Access Rights'
206
+
207
+ # "fielded" search configuration. Used by pulldown among other places.
208
+ # For supported keys in hash, see rdoc for Blacklight::SearchFields
209
+ #
210
+ # Search fields will inherit the :qt solr request handler from
211
+ # config[:default_solr_parameters], OR can specify a different one
212
+ # with a :qt key/value. Below examples inherit, except for subject
213
+ # that specifies the same :qt as default for our own internal
214
+ # testing purposes.
215
+ #
216
+ # The :key is what will be used to identify this BL search field internally,
217
+ # as well as in URLs -- so changing it after deployment may break bookmarked
218
+ # urls. A display label will be automatically calculated from the :key,
219
+ # or can be specified manually to be different.
220
+
221
+ # This one uses all the defaults set by the solr request handler. Which
222
+ # solr request handler? The one set in config[:default_solr_parameters][:qt],
223
+ # since we aren't specifying it otherwise.
224
+
225
+ config.add_search_field('all_fields') do |field|
226
+ field.include_in_advanced_search = false
227
+ field.label = 'All Fields'
228
+ end
229
+
230
+ config.add_search_field('keyword') do |field|
231
+ field.include_in_simple_select = false
232
+ field.qt = 'search'
233
+ field.label = 'Keyword'
234
+ field.solr_local_parameters = {
235
+ qf: '$qf',
236
+ pf: '$pf'
237
+ }
238
+ end
239
+
240
+ config.add_search_field('title') do |field|
241
+ field.include_in_simple_select = false
242
+ field.qt = 'search'
243
+ field.label = 'Title'
244
+ field.solr_local_parameters = {
245
+ qf: '$title_qf',
246
+ pf: '$title_pf'
247
+ }
248
+ end
249
+
250
+ config.add_search_field('placename') do |field|
251
+ field.include_in_simple_select = false
252
+ field.qt = 'search'
253
+ field.label = 'Place'
254
+ field.solr_local_parameters = {
255
+ qf: '$placename_qf',
256
+ pf: '$placename_pf'
257
+ }
258
+ end
259
+
260
+ config.add_search_field('publisher') do |field|
261
+ field.include_in_simple_select = false
262
+ field.qt = 'search'
263
+ field.label = 'Publisher/Creator'
264
+ field.solr_local_parameters = {
265
+ qf: '$publisher_qf',
266
+ pf: '$publisher_pf'
267
+ }
268
+ end
269
+
270
+ # "sort results by" select (pulldown)
271
+ # label in pulldown is followed by the name of the SOLR field to sort by and
272
+ # whether the sort is ascending or descending (it must be asc or desc
273
+ # except in the relevancy case).
274
+ config.add_sort_field 'score desc, dct_title_sort asc', :label => 'Relevance'
275
+ config.add_sort_field "#{Settings.FIELDS.INDEX_YEAR} desc, dct_title_sort asc", :label => 'Year (Newest first)'
276
+ config.add_sort_field "#{Settings.FIELDS.INDEX_YEAR} asc, dct_title_sort asc", :label => 'Year (Oldest first)'
277
+ config.add_sort_field 'dct_title_sort asc', :label => 'Title (A-Z)'
278
+ config.add_sort_field 'dct_title_sort desc', :label => 'Title (Z-A)'
279
+
280
+ # If there are more than this many search results, no spelling ("did you
281
+ # mean") suggestion is offered.
282
+ config.spell_max = 5
283
+
284
+ # Custom tools for GeoBlacklight
285
+ config.add_show_tools_partial :more_details, partial: 'more_details', if: proc { |_context, _config, options| options[:document] && (!options[:document].references.nil? & !options[:document].references.url.nil?)}
286
+ config.add_show_tools_partial :metadata, if: proc { |_context, _config, options| options[:document] && (Settings.METADATA_SHOWN & options[:document].references.refs.map(&:type).map(&:to_s)).any? }
287
+ config.add_show_tools_partial :web_services, if: proc { |_context, _config, options| options[:document] && (Settings.WEBSERVICES_SHOWN & options[:document].references.refs.map(&:type).map(&:to_s)).any? }
288
+ config.add_show_tools_partial :exports, partial: 'exports', if: proc { |_context, _config, options| options[:document] }
289
+ config.add_show_tools_partial :data_dictionary, partial: 'data_dictionary', if: proc { |_context, _config, options| options[:document] && options[:document].data_dictionary_download.present?}
290
+ config.add_show_tools_partial(:citation)
291
+ config.add_show_tools_partial(:access_links, partial: 'access_links', if: proc { |_context, _config, options| options[:document] && options[:document].access_links.present?})
292
+
293
+ # Remove nav actions
294
+ config.add_nav_action(:bookmark, partial: 'blacklight/nav/bookmark', if: false)
295
+
296
+ # Remove show tools
297
+ config.show.partials.delete(:show_header)
298
+ config.show.partials.delete(:show)
299
+
300
+ config.show.display_type_field = 'format'
301
+ config.show.partials << 'show_header'
302
+ config.show.partials << 'show_default_viewer_container'
303
+ config.show.partials << 'show_default_viewer_information'
304
+ config.show.partials << 'show_default_attribute_table'
305
+ config.show.partials << 'show'
306
+
307
+
308
+ config.show.document_actions.delete(:email)
309
+ config.show.document_actions.delete(:bookmark)
310
+ config.show.document_actions.delete(:sms)
311
+
312
+ # Configure basemap provider for GeoBlacklight maps (uses https only basemap
313
+ # providers with open licenses)
314
+ # Valid basemaps include:
315
+ # 'mapquest' http://developer.mapquest.com/web/products/open/map
316
+ # 'positron' http://cartodb.com/basemaps/
317
+ # 'darkMatter' http://cartodb.com/basemaps/
318
+ config.basemap_provider = 'esri'
319
+ config.max_per_page = 100000
320
+
321
+ # Configuration for autocomplete suggestor
322
+ config.autocomplete_enabled = true
323
+ config.autocomplete_path = 'suggest'
324
+ end
325
+
326
+ # Administrative view of document
327
+ # - Sidecar Image
328
+ # - URIs
329
+ def admin
330
+ deprecated_response, @document = search_service.fetch(params[:id])
331
+ end
332
+
333
+ # Administrative view for array of document ids
334
+ # - bookmarks
335
+ def fetch
336
+ @response, deprecated_document_list = search_service.fetch(params[:id])
337
+
338
+ respond_to do |format|
339
+ format.json do
340
+ @presenter = Blacklight::JsonPresenter.new(@response,
341
+ blacklight_config)
342
+ end
343
+ end
344
+ end
345
+
346
+ # Administrative view of adv search facets
347
+ def facets
348
+ # We want to find the facets available for the current search, but:
349
+ # * IGNORING current query (add in facets_for_advanced_search_form filter)
350
+ # * IGNORING current advanced search facets (remove add_advanced_search_to_solr filter)
351
+ @response, _ = search_service.search_results do |search_builder|
352
+ search_builder.except(:add_advanced_search_to_solr).append(:facets_for_advanced_search_form)
353
+ end
354
+
355
+ @response
356
+
357
+ respond_to do |format|
358
+ format.json do
359
+ @presenter = Blacklight::JsonPresenter.new(@response,
360
+ blacklight_config)
361
+ end
362
+ end
363
+ end
364
+ end
365
+ end