geoblacklight_admin 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/.editorconfig +18 -0
- data/.gitignore +75 -0
- data/.standard.yml +4 -0
- data/Gemfile +59 -0
- data/LICENSE +21 -0
- data/README.md +84 -0
- data/Rakefile +72 -0
- data/app/assets/images/.keep +0 -0
- data/app/assets/images/aerial_photo.jpg +0 -0
- data/app/assets/images/archive-solid.svg +1 -0
- data/app/assets/images/bookmark-regular.svg +1 -0
- data/app/assets/images/bookmark-solid.svg +1 -0
- data/app/assets/images/btaa-logo.jpg +0 -0
- data/app/assets/images/cloud-download-alt-solid.svg +1 -0
- data/app/assets/images/file-import-solid.svg +1 -0
- data/app/assets/images/trash-alt-solid.svg +1 -0
- data/app/assets/javascripts/geoblacklight_admin/chosen.js +4 -0
- data/app/assets/javascripts/geoblacklight_admin/date_range_picker.js +173 -0
- data/app/assets/javascripts/geoblacklight_admin/datepicker.js +22 -0
- data/app/assets/javascripts/geoblacklight_admin/elements.js +38 -0
- data/app/assets/javascripts/geoblacklight_admin/exports.js +3 -0
- data/app/assets/javascripts/geoblacklight_admin/fields.js +11 -0
- data/app/assets/javascripts/geoblacklight_admin/geoblacklight_admin.js +2 -0
- data/app/assets/javascripts/geoblacklight_admin/inputmask.js +4 -0
- data/app/assets/javascripts/geoblacklight_admin/locale.js +5 -0
- data/app/assets/javascripts/geoblacklight_admin/sortable.js +2544 -0
- data/app/assets/javascripts/geoblacklight_admin/tooltips.js +3 -0
- data/app/assets/javascripts/geoblacklight_admin/truncate.js +4 -0
- data/app/assets/javascripts/geoblacklight_admin.js +40 -0
- data/app/assets/stylesheets/geoblacklight_admin/_core.scss +47 -0
- data/app/assets/stylesheets/geoblacklight_admin/modules/_autocomplete.scss +32 -0
- data/app/assets/stylesheets/geoblacklight_admin/modules/_blazer.scss +3 -0
- data/app/assets/stylesheets/geoblacklight_admin/modules/_code.scss +3 -0
- data/app/assets/stylesheets/geoblacklight_admin/modules/_datepicker.scss +477 -0
- data/app/assets/stylesheets/geoblacklight_admin/modules/_elements.scss +3 -0
- data/app/assets/stylesheets/geoblacklight_admin/modules/_forms.scss +28 -0
- data/app/assets/stylesheets/geoblacklight_admin/modules/_icons.scss +15 -0
- data/app/assets/stylesheets/geoblacklight_admin/modules/_nav.scss +9 -0
- data/app/assets/stylesheets/geoblacklight_admin/modules/_tables.scss +4 -0
- data/app/assets/stylesheets/geoblacklight_admin/modules/_toasts.scss +7 -0
- data/app/assets/stylesheets/geoblacklight_admin/modules/_visibility.scss +3 -0
- data/app/assets/stylesheets/geoblacklight_admin/settings/_variables.scss +1 -0
- data/app/channels/export_channel.rb +12 -0
- data/app/controllers/admin/admin_controller.rb +16 -0
- data/app/controllers/admin/advanced_search_controller.rb +365 -0
- data/app/controllers/admin/api_controller.rb +386 -0
- data/app/controllers/admin/bookmarks_controller.rb +68 -0
- data/app/controllers/admin/bulk_actions_controller.rb +94 -0
- data/app/controllers/admin/concerns/.keep +0 -0
- data/app/controllers/admin/concerns/upload_util.rb +8 -0
- data/app/controllers/admin/document_accesses_controller.rb +125 -0
- data/app/controllers/admin/document_assets_controller.rb +198 -0
- data/app/controllers/admin/document_downloads_controller.rb +127 -0
- data/app/controllers/admin/documents_controller.rb +219 -0
- data/app/controllers/admin/elements_controller.rb +81 -0
- data/app/controllers/admin/form_elements_controller.rb +81 -0
- data/app/controllers/admin/ids_controller.rb +379 -0
- data/app/controllers/admin/import_documents_controller.rb +18 -0
- data/app/controllers/admin/imports_controller.rb +105 -0
- data/app/controllers/admin/mappings_controller.rb +95 -0
- data/app/controllers/admin/notifications_controller.rb +51 -0
- data/app/controllers/admin/search_controller.rb +10 -0
- data/app/controllers/admin/users_controller.rb +10 -0
- data/app/helpers/bulk_actions_helper.rb +9 -0
- data/app/helpers/document_helper.rb +60 -0
- data/app/helpers/form_input_helper.rb +73 -0
- data/app/helpers/geoblacklight_admin_helper.rb +118 -0
- data/app/helpers/import_documents_helper.rb +5 -0
- data/app/helpers/mappings_helper.rb +27 -0
- data/app/indexers/document_indexer.rb +34 -0
- data/app/jobs/bulk_action_revert_document_job.rb +49 -0
- data/app/jobs/bulk_action_revert_job.rb +25 -0
- data/app/jobs/bulk_action_run_document_job.rb +42 -0
- data/app/jobs/bulk_action_run_job.rb +27 -0
- data/app/jobs/export_job.rb +72 -0
- data/app/jobs/export_json_job.rb +120 -0
- data/app/jobs/import_document_job.rb +25 -0
- data/app/jobs/import_run_job.rb +33 -0
- data/app/models/active_storage_attachment.rb +5 -0
- data/app/models/active_storage_blob.rb +5 -0
- data/app/models/api_search_builder.rb +12 -0
- data/app/models/application_record.rb +6 -0
- data/app/models/blacklight_api.rb +93 -0
- data/app/models/blacklight_api_facets.rb +15 -0
- data/app/models/blacklight_api_ids.rb +103 -0
- data/app/models/bookmark.rb +17 -0
- data/app/models/bulk_action.rb +88 -0
- data/app/models/bulk_action_document.rb +22 -0
- data/app/models/bulk_action_document_state_machine.rb +16 -0
- data/app/models/bulk_action_document_transition.rb +19 -0
- data/app/models/bulk_action_state_machine.rb +16 -0
- data/app/models/bulk_action_transition.rb +26 -0
- data/app/models/concerns/.keep +0 -0
- data/app/models/document/bbox_validator.rb +70 -0
- data/app/models/document/controlled_lists.rb +104 -0
- data/app/models/document/date_range_validator.rb +63 -0
- data/app/models/document/geom_validator.rb +117 -0
- data/app/models/document/reference.rb +107 -0
- data/app/models/document.rb +264 -0
- data/app/models/document_access.rb +35 -0
- data/app/models/document_download.rb +35 -0
- data/app/models/document_state_machine.rb +14 -0
- data/app/models/document_transition.rb +26 -0
- data/app/models/element.rb +90 -0
- data/app/models/form_control.rb +2 -0
- data/app/models/form_element.rb +19 -0
- data/app/models/form_feature.rb +2 -0
- data/app/models/form_group.rb +2 -0
- data/app/models/form_header.rb +2 -0
- data/app/models/geoblacklight_admin/field_mappings_btaa_aardvark.rb +379 -0
- data/app/models/geoblacklight_admin/field_mappings_gblv1.rb +344 -0
- data/app/models/geoblacklight_admin/iso_language_codes.rb +515 -0
- data/app/models/geoblacklight_admin/schema.rb +194 -0
- data/app/models/geoblacklight_admin.rb +3 -0
- data/app/models/import/csv_duplicates_validator.rb +36 -0
- data/app/models/import/csv_header_validator.rb +24 -0
- data/app/models/import.rb +186 -0
- data/app/models/import_btaa.rb +91 -0
- data/app/models/import_btaa_aardvark.rb +109 -0
- data/app/models/import_document.rb +34 -0
- data/app/models/import_document_state_machine.rb +12 -0
- data/app/models/import_document_transition.rb +19 -0
- data/app/models/import_gblv1.rb +92 -0
- data/app/models/import_state_machine.rb +16 -0
- data/app/models/import_transition.rb +26 -0
- data/app/models/mapping.rb +10 -0
- data/app/models/notification.rb +9 -0
- data/app/models/user.rb +26 -0
- data/app/notifications/export_notification.rb +30 -0
- data/app/services/export_csv_document_access_links_service.rb +47 -0
- data/app/services/export_csv_document_downloads_service.rb +47 -0
- data/app/services/export_csv_service.rb +44 -0
- data/app/services/export_json_service.rb +35 -0
- data/app/services/zip_file_generator.rb +56 -0
- data/app/views/admin/advanced_search/facets.json.jbuilder +80 -0
- data/app/views/admin/advanced_search/index.json.jbuilder +90 -0
- data/app/views/admin/api/_field.json.jbuilder +10 -0
- data/app/views/admin/api/fetch.json.jbuilder +86 -0
- data/app/views/admin/api/index.json.jbuilder +90 -0
- data/app/views/admin/bookmarks/_bookmark.json.jbuilder +4 -0
- data/app/views/admin/bookmarks/create.js.erb +7 -0
- data/app/views/admin/bookmarks/destroy.js.erb +7 -0
- data/app/views/admin/bookmarks/index.html.erb +21 -0
- data/app/views/admin/bookmarks/index.json.jbuilder +3 -0
- data/app/views/admin/bulk_actions/_bulk_action.json.jbuilder +4 -0
- data/app/views/admin/bulk_actions/_form.html.erb +17 -0
- data/app/views/admin/bulk_actions/edit.html.erb +6 -0
- data/app/views/admin/bulk_actions/index.html.erb +54 -0
- data/app/views/admin/bulk_actions/index.json.jbuilder +3 -0
- data/app/views/admin/bulk_actions/new.html.erb +5 -0
- data/app/views/admin/bulk_actions/show.html.erb +100 -0
- data/app/views/admin/bulk_actions/show.json.jbuilder +3 -0
- data/app/views/admin/devise/confirmations/new.html.erb +16 -0
- data/app/views/admin/devise/invitations/edit.html.erb +15 -0
- data/app/views/admin/devise/invitations/new.html.erb +15 -0
- data/app/views/admin/devise/mailer/invitation_instructions.html.erb +11 -0
- data/app/views/admin/devise/mailer/invitation_instructions.text.erb +11 -0
- data/app/views/admin/devise/passwords/edit.html.erb +26 -0
- data/app/views/admin/devise/passwords/new.html.erb +16 -0
- data/app/views/admin/devise/registrations/edit.html.erb +35 -0
- data/app/views/admin/devise/registrations/new.html.erb +30 -0
- data/app/views/admin/devise/sessions/new.html.erb +28 -0
- data/app/views/admin/devise/shared/_links.html.erb +27 -0
- data/app/views/admin/devise/unlocks/new.html.erb +16 -0
- data/app/views/admin/document_accesses/_document_access.json.jbuilder +4 -0
- data/app/views/admin/document_accesses/_form.html.erb +17 -0
- data/app/views/admin/document_accesses/destroy_all.html.erb +70 -0
- data/app/views/admin/document_accesses/edit.html.erb +5 -0
- data/app/views/admin/document_accesses/import.html.erb +70 -0
- data/app/views/admin/document_accesses/index.html.erb +74 -0
- data/app/views/admin/document_accesses/index.json.jbuilder +3 -0
- data/app/views/admin/document_accesses/new.html.erb +6 -0
- data/app/views/admin/document_accesses/show.html.erb +19 -0
- data/app/views/admin/document_accesses/show.json.jbuilder +3 -0
- data/app/views/admin/document_assets/display_attach_form.html.erb +44 -0
- data/app/views/admin/document_assets/index.html.erb +65 -0
- data/app/views/admin/document_downloads/_document_download.json.jbuilder +4 -0
- data/app/views/admin/document_downloads/_form.html.erb +15 -0
- data/app/views/admin/document_downloads/destroy_all.html.erb +70 -0
- data/app/views/admin/document_downloads/edit.html.erb +6 -0
- data/app/views/admin/document_downloads/import.html.erb +74 -0
- data/app/views/admin/document_downloads/index.html.erb +70 -0
- data/app/views/admin/document_downloads/index.json.jbuilder +3 -0
- data/app/views/admin/document_downloads/new.html.erb +5 -0
- data/app/views/admin/document_downloads/show.html.erb +24 -0
- data/app/views/admin/document_downloads/show.json.jbuilder +3 -0
- data/app/views/admin/documents/_document.html.erb +29 -0
- data/app/views/admin/documents/_document_bookmark.html.erb +17 -0
- data/app/views/admin/documents/_document_fields.html.erb +24 -0
- data/app/views/admin/documents/_form.html.erb +49 -0
- data/app/views/admin/documents/_form_control.html.erb +86 -0
- data/app/views/admin/documents/_form_group.html.erb +1 -0
- data/app/views/admin/documents/_form_header.html.erb +1 -0
- data/app/views/admin/documents/_form_nav.html.erb +21 -0
- data/app/views/admin/documents/_json_aardvark.jbuilder +47 -0
- data/app/views/admin/documents/_json_btaa_aardvark.jbuilder +16 -0
- data/app/views/admin/documents/_json_gbl_v1.jbuilder +32 -0
- data/app/views/admin/documents/_result_facets.html.erb +35 -0
- data/app/views/admin/documents/_result_pagination.html.erb +21 -0
- data/app/views/admin/documents/_result_selected_options.html.erb +54 -0
- data/app/views/admin/documents/_result_selection_options.html.erb +10 -0
- data/app/views/admin/documents/_result_toggle.html.erb +13 -0
- data/app/views/admin/documents/edit.html.erb +7 -0
- data/app/views/admin/documents/features/_assets.html.erb +3 -0
- data/app/views/admin/documents/features/_institutional_access_links.html.erb +3 -0
- data/app/views/admin/documents/features/_multiple_download_links.html.erb +27 -0
- data/app/views/admin/documents/fetch.json_aardvark.jbuilder +9 -0
- data/app/views/admin/documents/fetch.json_btaa_aardvark.jbuilder +9 -0
- data/app/views/admin/documents/fetch.json_gbl_v1.jbuilder +9 -0
- data/app/views/admin/documents/index.html.erb +49 -0
- data/app/views/admin/documents/index.json_aardvark.jbuilder +9 -0
- data/app/views/admin/documents/index.json_btaa_aardvark.jbuilder +9 -0
- data/app/views/admin/documents/index.json_gbl_v1.jbuilder +9 -0
- data/app/views/admin/documents/show.json_aardvark.jbuilder +3 -0
- data/app/views/admin/documents/show.json_btaa_aardvark.jbuilder +3 -0
- data/app/views/admin/documents/show.json_gbl_v1.jbuilder +3 -0
- data/app/views/admin/documents/versions.html.erb +110 -0
- data/app/views/admin/elements/_element.json.jbuilder +2 -0
- data/app/views/admin/elements/_form.html.erb +45 -0
- data/app/views/admin/elements/edit.html.erb +6 -0
- data/app/views/admin/elements/index.html.erb +68 -0
- data/app/views/admin/elements/index.json.jbuilder +1 -0
- data/app/views/admin/elements/new.html.erb +5 -0
- data/app/views/admin/elements/show.html.erb +121 -0
- data/app/views/admin/elements/show.json.jbuilder +1 -0
- data/app/views/admin/form_elements/_form.html.erb +46 -0
- data/app/views/admin/form_elements/_form_element.json.jbuilder +2 -0
- data/app/views/admin/form_elements/edit.html.erb +6 -0
- data/app/views/admin/form_elements/index.html.erb +49 -0
- data/app/views/admin/form_elements/index.json.jbuilder +1 -0
- data/app/views/admin/form_elements/new.html.erb +5 -0
- data/app/views/admin/form_elements/show.html.erb +19 -0
- data/app/views/admin/form_elements/show.json.jbuilder +1 -0
- data/app/views/admin/ids/fetch.json.jbuilder +86 -0
- data/app/views/admin/ids/index.json.jbuilder +41 -0
- data/app/views/admin/import_documents/show.html.haml +20 -0
- data/app/views/admin/imports/_form.html.erb +27 -0
- data/app/views/admin/imports/_import.json.jbuilder +4 -0
- data/app/views/admin/imports/_show_failed_tab.html.erb +37 -0
- data/app/views/admin/imports/_show_success_tab.html.erb +31 -0
- data/app/views/admin/imports/edit.html.erb +8 -0
- data/app/views/admin/imports/index.html.erb +56 -0
- data/app/views/admin/imports/index.json.jbuilder +3 -0
- data/app/views/admin/imports/new.html.erb +7 -0
- data/app/views/admin/imports/show.html.erb +123 -0
- data/app/views/admin/imports/show.json.jbuilder +3 -0
- data/app/views/admin/layouts/application.html.erb +30 -0
- data/app/views/admin/layouts/blazer/application.html.erb +23 -0
- data/app/views/admin/layouts/mailer.html.erb +13 -0
- data/app/views/admin/layouts/mailer.text.erb +1 -0
- data/app/views/admin/mappings/_form.html.erb +17 -0
- data/app/views/admin/mappings/_mapping.json.jbuilder +4 -0
- data/app/views/admin/mappings/edit.html.erb +6 -0
- data/app/views/admin/mappings/index.html.erb +37 -0
- data/app/views/admin/mappings/index.json.jbuilder +3 -0
- data/app/views/admin/mappings/new.html.erb +5 -0
- data/app/views/admin/mappings/show.html.erb +27 -0
- data/app/views/admin/mappings/show.json.jbuilder +3 -0
- data/app/views/admin/notifications/_notification.html.haml +31 -0
- data/app/views/admin/notifications/index.html.erb +54 -0
- data/app/views/admin/notifications/update.js.erb +7 -0
- data/app/views/admin/search/index.html.erb +38 -0
- data/app/views/admin/shared/_flash_messages.html.erb +5 -0
- data/app/views/admin/shared/_footer.html.erb +56 -0
- data/app/views/admin/shared/_js_behaviors.html.erb +147 -0
- data/app/views/admin/shared/_navbar.html.erb +78 -0
- data/app/views/admin/shared/_navbar_blazer.html.erb +42 -0
- data/app/views/admin/shared/_schema_timestamp.html.erb +16 -0
- data/app/views/admin/shared/_toast.html.erb +13 -0
- data/app/views/admin/users/index.html.erb +21 -0
- data/config/authorities/formats.yml +25 -0
- data/config/authorities/languages.yml +50 -0
- data/config/authorities/resource_type.yml +82 -0
- data/config/blazer.yml +79 -0
- data/config/gbl_v1_schema.json +118 -0
- data/config/geomg_aardvark_schema.json +211 -0
- data/config/geomg_schema.json +123 -0
- data/config/locales/devise.en.yml +65 -0
- data/config/locales/devise_invitable.en.yml +31 -0
- data/config/locales/documents.en.yml +189 -0
- data/config/locales/en.yml +51 -0
- data/config/locales/geoblacklight.en.yml +178 -0
- data/config/locales/simple_form.en.yml +31 -0
- data/config/routes.rb +162 -0
- data/db/migrate/20230316183001_add_geoblacklight_admin.rb +399 -0
- data/db/seeds.rb +26 -0
- data/db/seeds_elements.csv +56 -0
- data/db/seeds_elements.numbers +0 -0
- data/db/seeds_form_elements.csv +71 -0
- data/db/seeds_form_elements.numbers +0 -0
- data/db/structure.sql +816 -0
- data/geoblacklight_admin.gemspec +67 -0
- data/lib/generators/geoblacklight_admin/config_generator.rb +336 -0
- data/lib/generators/geoblacklight_admin/example_docs_generator.rb +18 -0
- data/lib/generators/geoblacklight_admin/helpers_generator.rb +18 -0
- data/lib/generators/geoblacklight_admin/install_generator.rb +60 -0
- data/lib/generators/geoblacklight_admin/jobs_generator.rb +21 -0
- data/lib/generators/geoblacklight_admin/models_generator.rb +23 -0
- data/lib/generators/geoblacklight_admin/templates/.env.development.example +28 -0
- data/lib/generators/geoblacklight_admin/templates/.solr_wrapper.yml +7 -0
- data/lib/generators/geoblacklight_admin/templates/_user_util_links.html.erb +30 -0
- data/lib/generators/geoblacklight_admin/templates/config/database.yml +18 -0
- data/lib/generators/geoblacklight_admin/templates/config/geomg_aardvark_schema.json +211 -0
- data/lib/generators/geoblacklight_admin/templates/config/initializers/geoblacklight_admin.rb +25 -0
- data/lib/generators/geoblacklight_admin/templates/config/initializers/kithe.rb +31 -0
- data/lib/generators/geoblacklight_admin/templates/config/initializers/pagy.rb +158 -0
- data/lib/generators/geoblacklight_admin/templates/config/initializers/statesman.rb +7 -0
- data/lib/generators/geoblacklight_admin/templates/javascript/channels/consumer.js +6 -0
- data/lib/generators/geoblacklight_admin/templates/javascript/channels/export_channel.js +30 -0
- data/lib/generators/geoblacklight_admin/templates/javascript/channels/index.js +5 -0
- data/lib/generators/geoblacklight_admin/templates/javascript/controllers/application_controller.js +17 -0
- data/lib/generators/geoblacklight_admin/templates/javascript/controllers/document_controller.js +26 -0
- data/lib/generators/geoblacklight_admin/templates/javascript/controllers/index.js +10 -0
- data/lib/generators/geoblacklight_admin/templates/javascript/controllers/results_controller.js +310 -0
- data/lib/generators/geoblacklight_admin/templates/javascript/packs/application.js +23 -0
- data/lib/generators/geoblacklight_admin/templates/javascript/src/js/admin/qa_autocomplete.js +1134 -0
- data/lib/generators/geoblacklight_admin/templates/package.json +32 -0
- data/lib/generators/geoblacklight_admin/templates/solr/README-geoblacklight-solr-development.txt +3 -0
- data/lib/generators/geoblacklight_admin/templates/solr/conf/_rest_managed.json +3 -0
- data/lib/generators/geoblacklight_admin/templates/solr/conf/admin-extra.html +31 -0
- data/lib/generators/geoblacklight_admin/templates/solr/conf/core.properties +5 -0
- data/lib/generators/geoblacklight_admin/templates/solr/conf/elevate.xml +36 -0
- data/lib/generators/geoblacklight_admin/templates/solr/conf/mapping-ISOLatin1Accent.txt +246 -0
- data/lib/generators/geoblacklight_admin/templates/solr/conf/protwords.txt +21 -0
- data/lib/generators/geoblacklight_admin/templates/solr/conf/schema.xml +229 -0
- data/lib/generators/geoblacklight_admin/templates/solr/conf/scripts.conf +24 -0
- data/lib/generators/geoblacklight_admin/templates/solr/conf/solrconfig.xml +266 -0
- data/lib/generators/geoblacklight_admin/templates/solr/conf/spellings.txt +2 -0
- data/lib/generators/geoblacklight_admin/templates/solr/conf/stopwords.txt +58 -0
- data/lib/generators/geoblacklight_admin/templates/solr/conf/stopwords_en.txt +58 -0
- data/lib/generators/geoblacklight_admin/templates/solr/conf/synonyms.txt +43 -0
- data/lib/generators/geoblacklight_admin/templates/solr/conf/xslt/example.xsl +132 -0
- data/lib/generators/geoblacklight_admin/templates/solr/conf/xslt/example_atom.xsl +67 -0
- data/lib/generators/geoblacklight_admin/templates/solr/conf/xslt/example_rss.xsl +66 -0
- data/lib/generators/geoblacklight_admin/templates/solr/conf/xslt/luke.xsl +337 -0
- data/lib/generators/geoblacklight_admin/templates/solr/snapshots/.keep +0 -0
- data/lib/generators/geoblacklight_admin/views_generator.rb +19 -0
- data/lib/geoblacklight_admin/engine.rb +20 -0
- data/lib/geoblacklight_admin/version.rb +5 -0
- data/lib/geoblacklight_admin.rb +7 -0
- data/lib/tasks/.keep +0 -0
- data/lib/tasks/geoblacklight_admin.rake +209 -0
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +35 -0
- data/template.rb +16 -0
- metadata +1037 -0
@@ -0,0 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# ImportRunJob class
|
4
|
+
class ImportRunJob < ApplicationJob
|
5
|
+
queue_as :default
|
6
|
+
|
7
|
+
def perform(import)
|
8
|
+
data = CSV.parse(import.csv_file.download.force_encoding("UTF-8"), headers: true)
|
9
|
+
|
10
|
+
data.each do |doc|
|
11
|
+
extract_hash = doc.to_h
|
12
|
+
|
13
|
+
converted_data = import.convert_data(extract_hash)
|
14
|
+
|
15
|
+
kithe_document = {
|
16
|
+
title: converted_data[GeoblacklightAdmin::Schema.instance.solr_fields[:title]],
|
17
|
+
json_attributes: converted_data,
|
18
|
+
friendlier_id: converted_data[GeoblacklightAdmin::Schema.instance.solr_fields[:id]],
|
19
|
+
import_id: import.id
|
20
|
+
}
|
21
|
+
|
22
|
+
# Capture document for import attempt
|
23
|
+
import_document = ImportDocument.create(kithe_document)
|
24
|
+
|
25
|
+
# Add import document to background job queue
|
26
|
+
ImportDocumentJob.perform_later(import_document)
|
27
|
+
rescue => e
|
28
|
+
logger.debug "\n\nCANNOT IMPORT: #{extract_hash.inspect}"
|
29
|
+
logger.debug "Error: #{e.inspect}\n\n"
|
30
|
+
next
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
class ApiSearchBuilder < Blacklight::SearchBuilder
|
2
|
+
include Blacklight::Solr::SearchBuilderBehavior
|
3
|
+
include BlacklightAdvancedSearch::AdvancedSearchBuilder
|
4
|
+
# include B1gDateRangeQueryConcern::RangeLimitBuilder
|
5
|
+
|
6
|
+
self.default_processor_chain += [:add_advanced_parse_q_to_solr, :add_advanced_search_to_solr]
|
7
|
+
|
8
|
+
# Remove GBL Spatial, otherwise it will hide all suppressed docs
|
9
|
+
# from API search results
|
10
|
+
#
|
11
|
+
# include Geoblacklight::SpatialSearchBehavior
|
12
|
+
end
|
@@ -0,0 +1,93 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# BlacklightApi
|
4
|
+
class BlacklightApi
|
5
|
+
include HTTParty
|
6
|
+
default_timeout 300
|
7
|
+
|
8
|
+
base_uri BLACKLIGHT_JSON_API
|
9
|
+
|
10
|
+
def initialize(**args)
|
11
|
+
defaults = {
|
12
|
+
q: "*",
|
13
|
+
page: 1,
|
14
|
+
sort: "score+desc%2C+dc_title_sort+asc",
|
15
|
+
rows: 20
|
16
|
+
}
|
17
|
+
|
18
|
+
@options = defaults.merge(**args)
|
19
|
+
append_facets(@options[:f], @options)
|
20
|
+
append_daterange(@options[:f], @options)
|
21
|
+
@options.compact!
|
22
|
+
end
|
23
|
+
|
24
|
+
def fetch
|
25
|
+
@fetch ||= self.class.get("/", query: @options)
|
26
|
+
end
|
27
|
+
|
28
|
+
def results
|
29
|
+
fetch["data"]
|
30
|
+
end
|
31
|
+
|
32
|
+
def facets
|
33
|
+
fetch["included"]&.filter_map { |s| s if s["type"] == "facet" }
|
34
|
+
end
|
35
|
+
|
36
|
+
def sorts
|
37
|
+
fetch["included"].filter_map { |s| s if s["type"] == "sort" }
|
38
|
+
end
|
39
|
+
|
40
|
+
def meta
|
41
|
+
fetch["meta"]
|
42
|
+
end
|
43
|
+
|
44
|
+
def links
|
45
|
+
fetch["links"]
|
46
|
+
end
|
47
|
+
|
48
|
+
def load_all
|
49
|
+
results.map { |result| Document.find_by(friendlier_id: result["id"]) }
|
50
|
+
end
|
51
|
+
|
52
|
+
def pluck(field)
|
53
|
+
load_all.pluck(field.to_sym)
|
54
|
+
end
|
55
|
+
|
56
|
+
private
|
57
|
+
|
58
|
+
def append_facets(facets, options)
|
59
|
+
options[:f] = facets if facets.present?
|
60
|
+
options
|
61
|
+
end
|
62
|
+
|
63
|
+
def prep_daterange(daterange)
|
64
|
+
start_date, end_date = daterange.split(" - ")
|
65
|
+
start_date = Date
|
66
|
+
.strptime(start_date, "%m/%d/%Y")
|
67
|
+
.beginning_of_day
|
68
|
+
.to_time
|
69
|
+
.strftime("%Y-%m-%dT%H:%M:%S")
|
70
|
+
|
71
|
+
end_date = Date
|
72
|
+
.strptime(end_date, "%m/%d/%Y")
|
73
|
+
.end_of_day
|
74
|
+
.to_time
|
75
|
+
.strftime("%Y-%m-%dT%H:%M:%S")
|
76
|
+
|
77
|
+
[start_date, end_date]
|
78
|
+
end
|
79
|
+
|
80
|
+
def append_daterange(_daterange, options)
|
81
|
+
return if options[:daterange].nil?
|
82
|
+
|
83
|
+
unless options[:daterange].empty?
|
84
|
+
start_date, end_date = prep_daterange(options[:daterange])
|
85
|
+
if options[:f].present?
|
86
|
+
options[:f][:date_created_drsim] = "[#{start_date} TO #{end_date}]"
|
87
|
+
else
|
88
|
+
options[:f] = {date_created_drsim: "[#{start_date} TO #{end_date}]"}
|
89
|
+
end
|
90
|
+
end
|
91
|
+
options
|
92
|
+
end
|
93
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# BlacklightApiFacets
|
4
|
+
class BlacklightApiFacets
|
5
|
+
include HTTParty
|
6
|
+
base_uri BLACKLIGHT_JSON_API_FACETS
|
7
|
+
|
8
|
+
def fetch
|
9
|
+
@fetch ||= self.class.get("/", query: {})
|
10
|
+
end
|
11
|
+
|
12
|
+
def facets
|
13
|
+
fetch["included"].filter_map { |s| s if s["type"] == "facet" } if fetch["included"].present?
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,103 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# BlacklightApi
|
4
|
+
class BlacklightApiIds
|
5
|
+
include HTTParty
|
6
|
+
default_timeout 300
|
7
|
+
|
8
|
+
base_uri BLACKLIGHT_JSON_API_IDS
|
9
|
+
|
10
|
+
def initialize(args = {})
|
11
|
+
defaults = {
|
12
|
+
q: "*",
|
13
|
+
page: 1,
|
14
|
+
sort: "score+desc%2C+dc_title_sort+asc",
|
15
|
+
rows: 1000
|
16
|
+
}
|
17
|
+
|
18
|
+
@options = defaults.merge(**args)
|
19
|
+
append_facets(@options[:f], @options)
|
20
|
+
append_daterange(@options[:f], @options)
|
21
|
+
@options.compact!
|
22
|
+
end
|
23
|
+
|
24
|
+
def fetch
|
25
|
+
Rails.logger.debug { "BlacklightApiIds > fetch > query: #{@options.inspect}" }
|
26
|
+
|
27
|
+
@fetch ||= self.class.get("/", query: @options)
|
28
|
+
end
|
29
|
+
|
30
|
+
def results
|
31
|
+
fetch["data"]
|
32
|
+
end
|
33
|
+
|
34
|
+
def facets
|
35
|
+
fetch["included"]&.filter_map { |s| s if s["type"] == "facet" }
|
36
|
+
end
|
37
|
+
|
38
|
+
def sorts
|
39
|
+
fetch["included"].filter_map { |s| s if s["type"] == "sort" }
|
40
|
+
end
|
41
|
+
|
42
|
+
def meta
|
43
|
+
fetch["meta"]
|
44
|
+
end
|
45
|
+
|
46
|
+
def links
|
47
|
+
fetch["links"]
|
48
|
+
end
|
49
|
+
|
50
|
+
def load_all
|
51
|
+
results.map { |result| Document.find_by(friendlier_id: result["id"]) }
|
52
|
+
end
|
53
|
+
|
54
|
+
def pluck(field)
|
55
|
+
load_all.pluck(field.to_sym)
|
56
|
+
end
|
57
|
+
|
58
|
+
private
|
59
|
+
|
60
|
+
def append_facets(facets, options)
|
61
|
+
options[:f] = facets if facets.present?
|
62
|
+
options
|
63
|
+
end
|
64
|
+
|
65
|
+
def prep_daterange(daterange)
|
66
|
+
start_date, end_date = daterange.split(" - ")
|
67
|
+
start_date = Date
|
68
|
+
.strptime(start_date, "%m/%d/%Y")
|
69
|
+
.beginning_of_day
|
70
|
+
.to_time
|
71
|
+
.strftime("%Y-%m-%dT%H:%M:%S")
|
72
|
+
|
73
|
+
end_date = Date
|
74
|
+
.strptime(end_date, "%m/%d/%Y")
|
75
|
+
.end_of_day
|
76
|
+
.to_time
|
77
|
+
.strftime("%Y-%m-%dT%H:%M:%S")
|
78
|
+
|
79
|
+
[start_date, end_date]
|
80
|
+
end
|
81
|
+
|
82
|
+
def append_daterange(_daterange, options)
|
83
|
+
Rails.logger.debug { "BlacklightApiIds > Append daterange (start): #{options.inspect}" }
|
84
|
+
|
85
|
+
return if options[:daterange].nil?
|
86
|
+
|
87
|
+
unless options[:daterange].empty?
|
88
|
+
start_date, end_date = prep_daterange(options[:daterange])
|
89
|
+
|
90
|
+
Rails.logger.debug { "BlacklightApiIds > Prep daterange: #{start_date.inspect} TO #{end_date.inspect}}" }
|
91
|
+
|
92
|
+
if options[:f].present?
|
93
|
+
options[:f][:date_created_drsim] = "[#{start_date} TO #{end_date}]"
|
94
|
+
else
|
95
|
+
options[:f] = {date_created_drsim: "[#{start_date} TO #{end_date}]"}
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
Rails.logger.debug { "BlacklightApiIds > Append daterange (end): #{options.inspect}" }
|
100
|
+
|
101
|
+
options
|
102
|
+
end
|
103
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Bookmark
|
4
|
+
class Bookmark < ApplicationRecord
|
5
|
+
belongs_to :user, polymorphic: true
|
6
|
+
belongs_to :document, polymorphic: true
|
7
|
+
|
8
|
+
def document_type
|
9
|
+
value = super if defined?(super)
|
10
|
+
value &&= value.constantize
|
11
|
+
value || default_document_type
|
12
|
+
end
|
13
|
+
|
14
|
+
def default_document_type
|
15
|
+
SolrDocument
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,88 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "uri"
|
4
|
+
require "cgi"
|
5
|
+
|
6
|
+
# BulkAction
|
7
|
+
class BulkAction < ApplicationRecord
|
8
|
+
# Callbacks
|
9
|
+
after_create_commit :collect_documents
|
10
|
+
|
11
|
+
# Associations
|
12
|
+
has_many :documents, class_name: "BulkActionDocument", autosave: false, dependent: :destroy
|
13
|
+
|
14
|
+
has_many :bulk_action_transitions, autosave: false, dependent: :destroy
|
15
|
+
|
16
|
+
# Validations
|
17
|
+
validates :scope, :field_name, :field_value, presence: true
|
18
|
+
|
19
|
+
# States
|
20
|
+
include Statesman::Adapters::ActiveRecordQueries[
|
21
|
+
transition_class: BulkActionTransition,
|
22
|
+
initial_state: :created
|
23
|
+
]
|
24
|
+
|
25
|
+
def state_machine
|
26
|
+
@state_machine ||= BulkActionStateMachine.new(self, transition_class: BulkActionTransition)
|
27
|
+
end
|
28
|
+
|
29
|
+
def run!
|
30
|
+
# @TODO: guard this call for validation?
|
31
|
+
|
32
|
+
# Queue Job
|
33
|
+
BulkActionRunJob.perform_later(self)
|
34
|
+
|
35
|
+
# Capture State
|
36
|
+
# state_machine.transition_to!(:imported)
|
37
|
+
# save
|
38
|
+
end
|
39
|
+
|
40
|
+
def check_run_state
|
41
|
+
return if state_machine.current_state == "complete"
|
42
|
+
|
43
|
+
state_machine.transition_to!(:complete) if documents.in_state(:queued).blank?
|
44
|
+
end
|
45
|
+
|
46
|
+
def revert!
|
47
|
+
# Queue Revert Job
|
48
|
+
BulkActionRevertJob.perform_later(self)
|
49
|
+
end
|
50
|
+
|
51
|
+
private
|
52
|
+
|
53
|
+
def collect_documents
|
54
|
+
cgi = CGI.unescape(scope)
|
55
|
+
uri = URI.parse(cgi)
|
56
|
+
if uri.path.include?("fetch")
|
57
|
+
fetch_documents(uri)
|
58
|
+
else
|
59
|
+
api_documents(uri)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
def fetch_documents(uri)
|
64
|
+
qargs = Rack::Utils.parse_nested_query(uri.query)
|
65
|
+
fetch_documents = Document.where(friendlier_id: qargs["ids"])
|
66
|
+
create_documents(fetch_documents)
|
67
|
+
end
|
68
|
+
|
69
|
+
def api_documents(uri)
|
70
|
+
qargs = Rack::Utils.parse_nested_query(uri.query)
|
71
|
+
query_params = {q: qargs["q"], f: qargs["f"], page: qargs["page"], rows: 1_000_000}
|
72
|
+
api_documents = BlacklightApiIds.new(**query_params)
|
73
|
+
create_documents(api_documents.load_all)
|
74
|
+
end
|
75
|
+
|
76
|
+
def create_documents(documents)
|
77
|
+
documents.collect do |doc|
|
78
|
+
BulkActionDocument.create(
|
79
|
+
document_id: doc.id,
|
80
|
+
friendlier_id: doc.friendlier_id,
|
81
|
+
version: doc.current_version,
|
82
|
+
bulk_action_id: id
|
83
|
+
)
|
84
|
+
rescue
|
85
|
+
logger.debug("BULK ACTION BAD DOC: #{doc.inspect}")
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# BulkActionDocument class
|
4
|
+
class BulkActionDocument < ApplicationRecord
|
5
|
+
has_many :bulk_action_document_transitions, autosave: false, dependent: :destroy
|
6
|
+
|
7
|
+
include Statesman::Adapters::ActiveRecordQueries[
|
8
|
+
transition_class: BulkActionDocumentTransition,
|
9
|
+
initial_state: :queued
|
10
|
+
]
|
11
|
+
|
12
|
+
def state_machine
|
13
|
+
@state_machine ||= BulkActionDocumentStateMachine.new(self, transition_class: BulkActionDocumentTransition)
|
14
|
+
end
|
15
|
+
|
16
|
+
# @TODO: Needed?
|
17
|
+
def to_hash
|
18
|
+
{
|
19
|
+
friendlier_id: friendlier_id
|
20
|
+
}
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# BulkActionDocument Statesman
|
4
|
+
class BulkActionDocumentStateMachine
|
5
|
+
include Statesman::Machine
|
6
|
+
|
7
|
+
state :created, initial: true
|
8
|
+
state :queued
|
9
|
+
state :success
|
10
|
+
state :failed
|
11
|
+
|
12
|
+
transition from: :created, to: %i[queued success]
|
13
|
+
transition from: :queued, to: %i[queued success failed]
|
14
|
+
transition from: :success, to: %i[queued success failed]
|
15
|
+
transition from: :failed, to: %i[queued success failed]
|
16
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Add BulkActionDocument Statesman Transitions
|
4
|
+
class BulkActionDocumentTransition < ApplicationRecord
|
5
|
+
include Statesman::Adapters::ActiveRecordTransition
|
6
|
+
|
7
|
+
belongs_to :bulk_action_document, inverse_of: :bulk_action_document_transitions
|
8
|
+
|
9
|
+
after_destroy :update_most_recent, if: :most_recent?
|
10
|
+
|
11
|
+
private
|
12
|
+
|
13
|
+
def update_most_recent
|
14
|
+
last_transition = bulk_action_document.bulk_action_document_transitions.order(:sort_key).last
|
15
|
+
return if last_transition.blank?
|
16
|
+
|
17
|
+
last_transition.update_column(:most_recent, true)
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# BulkAction Statesman
|
4
|
+
class BulkActionStateMachine
|
5
|
+
include Statesman::Machine
|
6
|
+
|
7
|
+
state :created, initial: true
|
8
|
+
state :queued
|
9
|
+
state :complete
|
10
|
+
state :failed
|
11
|
+
state :reverted
|
12
|
+
|
13
|
+
transition from: :created, to: %i[queued complete failed]
|
14
|
+
transition from: :queued, to: %i[created queued complete failed]
|
15
|
+
transition from: :complete, to: %i[queued reverted]
|
16
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Add BulkAction Statesman Transitions
|
4
|
+
class BulkActionTransition < ApplicationRecord
|
5
|
+
include Statesman::Adapters::ActiveRecordTransition
|
6
|
+
|
7
|
+
# If your transition table doesn't have the default `updated_at` timestamp column,
|
8
|
+
# you'll need to configure the `updated_timestamp_column` option, setting it to
|
9
|
+
# another column name (e.g. `:updated_on`) or `nil`.
|
10
|
+
#
|
11
|
+
# self.updated_timestamp_column = :updated_on
|
12
|
+
# self.updated_timestamp_column = nil
|
13
|
+
|
14
|
+
belongs_to :bulk_action, inverse_of: :bulk_action_transitions
|
15
|
+
|
16
|
+
after_destroy :update_most_recent, if: :most_recent?
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def update_most_recent
|
21
|
+
last_transition = bulk_action.bulk_action_transitions.order(:sort_key).last
|
22
|
+
return if last_transition.blank?
|
23
|
+
|
24
|
+
last_transition.update_column(:most_recent, true)
|
25
|
+
end
|
26
|
+
end
|
File without changes
|
@@ -0,0 +1,70 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Bbox Validation
|
4
|
+
#
|
5
|
+
# ex. Bad X value
|
6
|
+
# -100096.7909 is not in boundary
|
7
|
+
# Rect(minX=-180.0,maxX=180.0,minY=-90.0,maxY=90.0)
|
8
|
+
# input: ENVELOPE(-100096.7909,-90.0574,43.9474,39.9655)
|
9
|
+
class Document
|
10
|
+
# BboxValidator
|
11
|
+
class BboxValidator < ActiveModel::Validator
|
12
|
+
def validate(record)
|
13
|
+
# Assume true for empty values
|
14
|
+
valid_geom = true
|
15
|
+
|
16
|
+
# Sane for W,S,E,N?
|
17
|
+
proper_bounding_box(record, valid_geom) unless record.send(GeoblacklightAdmin::Schema.instance.solr_fields[:bounding_box]).nil?
|
18
|
+
|
19
|
+
valid_geom
|
20
|
+
end
|
21
|
+
|
22
|
+
def proper_bounding_box(record, valid_geom)
|
23
|
+
# Min/Max
|
24
|
+
min_max = [-180.0, -90.0, 180.0, 90.0]
|
25
|
+
|
26
|
+
# "W,S,E,N" to [W,S,E,N]
|
27
|
+
unless record.send(GeoblacklightAdmin::Schema.instance.solr_fields[:bounding_box]).split(",").nil?
|
28
|
+
geom = record.send(GeoblacklightAdmin::Schema.instance.solr_fields[:bounding_box]).split(",")
|
29
|
+
|
30
|
+
if geom.empty?
|
31
|
+
valid_geom = true
|
32
|
+
elsif geom.size != 4
|
33
|
+
valid_geom = false
|
34
|
+
record.errors.add(GeoblacklightAdmin::Schema.instance.solr_fields[:bounding_box], "invalid W,S,E,N syntax")
|
35
|
+
# W
|
36
|
+
elsif geom[0].to_f < min_max[0]
|
37
|
+
valid_geom = false
|
38
|
+
record.errors.add(GeoblacklightAdmin::Schema.instance.solr_fields[:bounding_box], "invalid minX present")
|
39
|
+
# S
|
40
|
+
elsif geom[1].to_f < min_max[1]
|
41
|
+
valid_geom = false
|
42
|
+
record.errors.add(GeoblacklightAdmin::Schema.instance.solr_fields[:bounding_box], "invalid minY present")
|
43
|
+
# E
|
44
|
+
elsif geom[2].to_f > min_max[2]
|
45
|
+
valid_geom = false
|
46
|
+
record.errors.add(GeoblacklightAdmin::Schema.instance.solr_fields[:bounding_box], "invalid maX present")
|
47
|
+
# N
|
48
|
+
elsif geom[3].to_f > min_max[3]
|
49
|
+
valid_geom = false
|
50
|
+
record.errors.add(GeoblacklightAdmin::Schema.instance.solr_fields[:bounding_box], "invalid maxY present")
|
51
|
+
# Solr - maxY must be >= minY
|
52
|
+
elsif geom[1].to_f >= geom[3].to_f
|
53
|
+
valid_geom = false
|
54
|
+
record.errors.add(GeoblacklightAdmin::Schema.instance.solr_fields[:bounding_box], "maxY must be >= minY")
|
55
|
+
end
|
56
|
+
|
57
|
+
# Reject ENVELOPE(-118.00.0000,-88.00.0000,51.00.0000,42.00.0000
|
58
|
+
# - Double period float-ish things?
|
59
|
+
geom.each do |val|
|
60
|
+
if val.count(".") >= 2
|
61
|
+
valid_geom = false
|
62
|
+
record.errors.add(GeoblacklightAdmin::Schema.instance.solr_fields[:bounding_box], "invalid ENVELOPE(W,E,N,S) syntax - found multiple periods in a coordinate value.")
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
valid_geom
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
@@ -0,0 +1,104 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Constants for various controlled lists for Document attributes.
|
4
|
+
#
|
5
|
+
# _Removing_ values from here may require data migration in your existing db.
|
6
|
+
#
|
7
|
+
# ## Display lables via i18n
|
8
|
+
# These are the values actually stored in the DB. Display-translated values can be
|
9
|
+
# provided via a poorly documented built-in feature of Rails i18n.
|
10
|
+
#
|
11
|
+
# If you put an I18n value in your locale file (eg config/locales/en.yml) at:
|
12
|
+
# activerecord:
|
13
|
+
# attributes:
|
14
|
+
# work/format:
|
15
|
+
# image: "Really great image"
|
16
|
+
#
|
17
|
+
# Then you can look it up with Work.human_attribute_name("format.image"). It even
|
18
|
+
# does some superclass lookup for you if you have an inheritance hieararchy.
|
19
|
+
#
|
20
|
+
# ## Some lists elsewhere
|
21
|
+
# Controlled values for specific sub-model classes (like Creator) can be found
|
22
|
+
# within them, not here. This is only for primitive attributes on Work. (But should
|
23
|
+
# we move sub-model lists here too?)
|
24
|
+
class Document
|
25
|
+
class ControlledLists
|
26
|
+
PUBLICATION_STATE = %w[draft published unpublished].freeze
|
27
|
+
|
28
|
+
ACCESS_RIGHTS = %w[Public Restricted].freeze
|
29
|
+
|
30
|
+
LAYER_GEOM_TYPES = %w[Point Line Polygon Image Raster Mixed Table Vector].freeze
|
31
|
+
|
32
|
+
B1G_STATUS = %w[Active Inactive Unknown].freeze
|
33
|
+
|
34
|
+
ACCRUAL_PERIODICITY = [
|
35
|
+
"Annual",
|
36
|
+
"Semiannual",
|
37
|
+
"Quarterly",
|
38
|
+
"Monthly",
|
39
|
+
"Irregular",
|
40
|
+
"As Needed",
|
41
|
+
"Once",
|
42
|
+
"Never"
|
43
|
+
].freeze
|
44
|
+
|
45
|
+
RESOURCE_CLASS = [
|
46
|
+
"Maps",
|
47
|
+
"Datasets",
|
48
|
+
"Imagery",
|
49
|
+
"Collections",
|
50
|
+
"Websites",
|
51
|
+
"Web services",
|
52
|
+
"Other"
|
53
|
+
].freeze
|
54
|
+
|
55
|
+
SCHEMA_PROVIDER = [
|
56
|
+
"Indiana University",
|
57
|
+
"University of Illinois Urbana-Champaign",
|
58
|
+
"University of Iowa",
|
59
|
+
"University of Maryland",
|
60
|
+
"University of Minnesota",
|
61
|
+
"Michigan State University",
|
62
|
+
"University of Michigan",
|
63
|
+
"Pennsylvania State University",
|
64
|
+
"Purdue University",
|
65
|
+
"University of Wisconsin - Madison",
|
66
|
+
"The Ohio State University",
|
67
|
+
"University of Chicago",
|
68
|
+
"University of Nebraska-Lincoln"
|
69
|
+
].freeze
|
70
|
+
|
71
|
+
THEME = [
|
72
|
+
"Agriculture",
|
73
|
+
"Biology",
|
74
|
+
"Boundaries",
|
75
|
+
"Climate",
|
76
|
+
"Economy",
|
77
|
+
"Elevation",
|
78
|
+
"Environment",
|
79
|
+
"Events",
|
80
|
+
"Geology",
|
81
|
+
"Health",
|
82
|
+
"Imagery",
|
83
|
+
"Inland waters",
|
84
|
+
"Land cover",
|
85
|
+
"Location",
|
86
|
+
"Military",
|
87
|
+
"Oceans",
|
88
|
+
"Property",
|
89
|
+
"Society",
|
90
|
+
"Structure",
|
91
|
+
"Transportation",
|
92
|
+
"Utilities"
|
93
|
+
].freeze
|
94
|
+
|
95
|
+
TYPE = [
|
96
|
+
"Image",
|
97
|
+
"Dataset",
|
98
|
+
"Service",
|
99
|
+
"Interactive Resource",
|
100
|
+
"Physical Object",
|
101
|
+
"Collection"
|
102
|
+
].freeze
|
103
|
+
end
|
104
|
+
end
|