hyrax 3.0.0.pre.rc2 → 3.0.0.pre.rc3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +5 -5
- data/.dassie/.env +4 -0
- data/.dassie/.gitignore +27 -0
- data/.dassie/Gemfile +57 -0
- data/.dassie/README.md +3 -0
- data/.dassie/Rakefile +6 -0
- data/.dassie/app/actors/hyrax/actors/generic_work_actor.rb +8 -0
- data/.dassie/app/actors/hyrax/actors/namespaced_works/nested_work_actor.rb +8 -0
- data/.dassie/app/assets/config/manifest.js +3 -0
- data/.dassie/app/assets/images/.keep +0 -0
- data/.dassie/app/assets/images/unauthorized.png +0 -0
- data/.dassie/app/assets/images/us_404.svg +91 -0
- data/.dassie/app/assets/javascripts/application.js +26 -0
- data/.dassie/app/assets/javascripts/blacklight_gallery.js +1 -0
- data/.dassie/app/assets/javascripts/cable.js +13 -0
- data/.dassie/app/assets/javascripts/channels/.keep +0 -0
- data/.dassie/app/assets/javascripts/openseadragon.js +2 -0
- data/.dassie/app/assets/stylesheets/application.css +16 -0
- data/.dassie/app/assets/stylesheets/hyrax.scss +17 -0
- data/.dassie/app/assets/stylesheets/openseadragon.css +3 -0
- data/.dassie/app/channels/application_cable/channel.rb +4 -0
- data/.dassie/app/channels/application_cable/connection.rb +4 -0
- data/.dassie/app/controllers/application_controller.rb +14 -0
- data/.dassie/app/controllers/catalog_controller.rb +300 -0
- data/.dassie/app/controllers/concerns/.keep +0 -0
- data/.dassie/app/controllers/hyrax/generic_works_controller.rb +14 -0
- data/.dassie/app/controllers/hyrax/monographs_controller.rb +17 -0
- data/.dassie/app/controllers/hyrax/namespaced_works/nested_works_controller.rb +14 -0
- data/.dassie/app/forms/hyrax/generic_work_form.rb +9 -0
- data/.dassie/app/forms/hyrax/namespaced_works/nested_work_form.rb +9 -0
- data/.dassie/app/forms/monograph_form.rb +20 -0
- data/.dassie/app/helpers/application_helper.rb +2 -0
- data/.dassie/app/helpers/hyrax_helper.rb +6 -0
- data/.dassie/app/indexers/generic_work_indexer.rb +18 -0
- data/.dassie/app/indexers/monograph_indexer.rb +16 -0
- data/.dassie/app/indexers/namespaced_works/nested_work_indexer.rb +18 -0
- data/.dassie/app/jobs/application_job.rb +2 -0
- data/.dassie/app/mailers/application_mailer.rb +4 -0
- data/.dassie/app/models/ability.rb +21 -0
- data/.dassie/app/models/application_record.rb +3 -0
- data/.dassie/app/models/collection.rb +8 -0
- data/.dassie/app/models/concerns/.keep +0 -0
- data/.dassie/app/models/file_set.rb +5 -0
- data/.dassie/app/models/generic_work.rb +14 -0
- data/.dassie/app/models/monograph.rb +8 -0
- data/.dassie/app/models/namespaced_works/nested_work.rb +16 -0
- data/.dassie/app/models/qa.rb +5 -0
- data/.dassie/app/models/qa/local_authority.rb +2 -0
- data/.dassie/app/models/qa/local_authority_entry.rb +3 -0
- data/.dassie/app/models/search_builder.rb +16 -0
- data/.dassie/app/models/solr_document.rb +28 -0
- data/.dassie/app/models/time_span.rb +22 -0
- data/.dassie/app/models/user.rb +26 -0
- data/.dassie/app/presenters/hyrax/generic_work_presenter.rb +6 -0
- data/.dassie/app/presenters/hyrax/namespaced_works/nested_work_presenter.rb +6 -0
- data/.dassie/app/views/hyrax/generic_works/_generic_work.html.erb +2 -0
- data/.dassie/app/views/hyrax/monographs/_monograph.html.erb +2 -0
- data/.dassie/app/views/hyrax/namespaced_works/nested_works/_nested_work.html.erb +2 -0
- data/.dassie/app/views/layouts/application.html.erb +15 -0
- data/.dassie/app/views/layouts/mailer.html.erb +13 -0
- data/.dassie/app/views/layouts/mailer.text.erb +1 -0
- data/.dassie/bin/bundle +3 -0
- data/.dassie/bin/rails +9 -0
- data/.dassie/bin/rake +9 -0
- data/.dassie/bin/setup +36 -0
- data/.dassie/bin/spring +17 -0
- data/.dassie/bin/update +31 -0
- data/.dassie/bin/yarn +11 -0
- data/.dassie/config.ru +5 -0
- data/.dassie/config/analytics.yml +6 -0
- data/.dassie/config/application.rb +22 -0
- data/.dassie/config/arkivo.yml +6 -0
- data/.dassie/config/authorities/licenses.yml +46 -0
- data/.dassie/config/authorities/resource_types.yml +41 -0
- data/.dassie/config/authorities/rights_statements.yml +37 -0
- data/.dassie/config/blacklight.yml +9 -0
- data/.dassie/config/boot.rb +4 -0
- data/.dassie/config/browse_everything_providers.yml +2 -0
- data/.dassie/config/cable.yml +10 -0
- data/.dassie/config/credentials.yml.enc +1 -0
- data/.dassie/config/environment.rb +5 -0
- data/.dassie/config/environments/development.rb +69 -0
- data/.dassie/config/environments/production.rb +94 -0
- data/.dassie/config/environments/test.rb +51 -0
- data/.dassie/config/fedora.yml +15 -0
- data/.dassie/config/initializers/arkivo_constraint.rb +12 -0
- data/.dassie/config/initializers/assets.rb +2 -0
- data/.dassie/config/initializers/clamav.rb +2 -0
- data/.dassie/config/initializers/cookies_serializer.rb +1 -0
- data/.dassie/config/initializers/devise.rb +13 -0
- data/.dassie/config/initializers/filter_parameter_logging.rb +1 -0
- data/.dassie/config/initializers/hydra_config.rb +6 -0
- data/.dassie/config/initializers/hyrax.rb +48 -0
- data/.dassie/config/initializers/mailboxer.rb +21 -0
- data/.dassie/config/initializers/mime_types.rb +4 -0
- data/.dassie/config/initializers/mini_magick.rb +6 -0
- data/.dassie/config/initializers/redis_config.rb +4 -0
- data/.dassie/config/initializers/riiif.rb +27 -0
- data/.dassie/config/initializers/simple_form.rb +28 -0
- data/.dassie/config/initializers/simple_form_bootstrap.rb +143 -0
- data/.dassie/config/initializers/wrap_parameters.rb +3 -0
- data/.dassie/config/locales/blacklight.en.yml +3 -0
- data/.dassie/config/locales/devise.en.yml +65 -0
- data/.dassie/config/locales/generic_work.de.yml +8 -0
- data/.dassie/config/locales/generic_work.en.yml +8 -0
- data/.dassie/config/locales/generic_work.es.yml +10 -0
- data/.dassie/config/locales/generic_work.fr.yml +8 -0
- data/.dassie/config/locales/generic_work.it.yml +8 -0
- data/.dassie/config/locales/generic_work.pt-BR.yml +8 -0
- data/.dassie/config/locales/generic_work.zh.yml +10 -0
- data/.dassie/config/locales/hyrax.de.yml +58 -0
- data/.dassie/config/locales/hyrax.en.yml +58 -0
- data/.dassie/config/locales/hyrax.es.yml +58 -0
- data/.dassie/config/locales/hyrax.fr.yml +58 -0
- data/.dassie/config/locales/hyrax.it.yml +58 -0
- data/.dassie/config/locales/hyrax.pt-BR.yml +58 -0
- data/.dassie/config/locales/hyrax.zh.yml +58 -0
- data/.dassie/config/locales/namespaced_works/nested_work.de.yml +8 -0
- data/.dassie/config/locales/namespaced_works/nested_work.en.yml +8 -0
- data/.dassie/config/locales/namespaced_works/nested_work.es.yml +10 -0
- data/.dassie/config/locales/namespaced_works/nested_work.fr.yml +8 -0
- data/.dassie/config/locales/namespaced_works/nested_work.it.yml +8 -0
- data/.dassie/config/locales/namespaced_works/nested_work.pt-BR.yml +8 -0
- data/.dassie/config/locales/namespaced_works/nested_work.zh.yml +10 -0
- data/.dassie/config/metadata/monograph.yaml +55 -0
- data/.dassie/config/metadata/sample_metadata.yaml +3 -0
- data/.dassie/config/puma.rb +6 -0
- data/.dassie/config/redis.yml +9 -0
- data/.dassie/config/role_map.yml +24 -0
- data/.dassie/config/routes.rb +35 -0
- data/.dassie/config/solr.yml +7 -0
- data/.dassie/config/spring.rb +6 -0
- data/.dassie/config/storage.yml +7 -0
- data/.dassie/config/tinymce.yml +12 -0
- data/.dassie/config/uv/uv-config.json +3 -0
- data/.dassie/config/uv/uv.html +87 -0
- data/.dassie/config/valkyrie_index.yml +12 -0
- data/.dassie/config/workflows/default_workflow.json +21 -0
- data/.dassie/config/workflows/mediated_deposit_workflow.json +76 -0
- data/.dassie/config/zotero.yml +6 -0
- data/.dassie/db/migrate/20200821212749_create_searches.blacklight.rb +17 -0
- data/.dassie/db/migrate/20200821212750_create_bookmarks.blacklight.rb +19 -0
- data/.dassie/db/migrate/20200821212751_add_polymorphic_type_to_bookmarks.blacklight.rb +9 -0
- data/.dassie/db/migrate/20200821212803_devise_create_users.rb +44 -0
- data/.dassie/db/migrate/20200821212806_add_devise_guests_to_users.rb +15 -0
- data/.dassie/db/migrate/20200821212828_create_version_committers.hyrax.rb +15 -0
- data/.dassie/db/migrate/20200821212829_create_checksum_audit_logs.hyrax.rb +19 -0
- data/.dassie/db/migrate/20200821212830_create_single_use_links.hyrax.rb +12 -0
- data/.dassie/db/migrate/20200821212831_add_social_to_users.hyrax.rb +13 -0
- data/.dassie/db/migrate/20200821212832_add_ldap_attrs_to_user.hyrax.rb +27 -0
- data/.dassie/db/migrate/20200821212833_add_avatars_to_users.hyrax.rb +15 -0
- data/.dassie/db/migrate/20200821212834_create_trophies.hyrax.rb +10 -0
- data/.dassie/db/migrate/20200821212835_add_linkedin_to_users.hyrax.rb +5 -0
- data/.dassie/db/migrate/20200821212836_create_tinymce_assets.hyrax.rb +8 -0
- data/.dassie/db/migrate/20200821212837_create_content_blocks.hyrax.rb +10 -0
- data/.dassie/db/migrate/20200821212838_create_featured_works.hyrax.rb +12 -0
- data/.dassie/db/migrate/20200821212839_add_external_key_to_content_blocks.hyrax.rb +6 -0
- data/.dassie/db/migrate/20200821212840_create_proxy_deposit_rights.hyrax.rb +10 -0
- data/.dassie/db/migrate/20200821212841_create_proxy_deposit_requests.hyrax.rb +15 -0
- data/.dassie/db/migrate/20200821212842_create_file_view_stats.hyrax.rb +12 -0
- data/.dassie/db/migrate/20200821212843_create_file_download_stats.hyrax.rb +12 -0
- data/.dassie/db/migrate/20200821212844_add_orcid_to_users.hyrax.rb +5 -0
- data/.dassie/db/migrate/20200821212845_create_user_stats.hyrax.rb +19 -0
- data/.dassie/db/migrate/20200821212846_create_work_view_stats.hyrax.rb +12 -0
- data/.dassie/db/migrate/20200821212847_add_works_to_user_stats.hyrax.rb +13 -0
- data/.dassie/db/migrate/20200821212848_change_trophy_generic_file_id_to_work_id.hyrax.rb +5 -0
- data/.dassie/db/migrate/20200821212849_change_proxy_deposit_generic_file_id_to_work_id.hyrax.rb +5 -0
- data/.dassie/db/migrate/20200821212850_change_audit_log_generic_file_id_to_file_set_id.hyrax.rb +5 -0
- data/.dassie/db/migrate/20200821212851_change_proxy_deposit_request_generic_file_id_to_work_id.hyrax.rb +5 -0
- data/.dassie/db/migrate/20200821212852_create_uploaded_files.hyrax.rb +10 -0
- data/.dassie/db/migrate/20200821212853_create_features.hyrax.rb +10 -0
- data/.dassie/db/migrate/20200821212854_create_operations.hyrax.rb +23 -0
- data/.dassie/db/migrate/20200821212855_change_featured_work_generic_file_id_to_work_id.hyrax.rb +6 -0
- data/.dassie/db/migrate/20200821212856_add_arkivo_to_users.hyrax.rb +8 -0
- data/.dassie/db/migrate/20200821212857_create_sipity.hyrax.rb +163 -0
- data/.dassie/db/migrate/20200821212858_create_sipity_workflow_methods.hyrax.rb +10 -0
- data/.dassie/db/migrate/20200821212859_create_permission_template.hyrax.rb +11 -0
- data/.dassie/db/migrate/20200821212860_create_permission_template_access.hyrax.rb +11 -0
- data/.dassie/db/migrate/20200821212861_add_release_to_permission_templates.hyrax.rb +6 -0
- data/.dassie/db/migrate/20200821212862_add_permission_template_to_sipity_workflow.hyrax.rb +26 -0
- data/.dassie/db/migrate/20200821212863_tidy_up_because_of_bad_exception.hyrax.rb +13 -0
- data/.dassie/db/migrate/20200821212864_add_allows_access_grant_to_workflow.hyrax.rb +5 -0
- data/.dassie/db/migrate/20200821212865_change_checksum_audit_log.hyrax.rb +18 -0
- data/.dassie/db/migrate/20200821212866_create_job_io_wrappers.hyrax.rb +15 -0
- data/.dassie/db/migrate/20200821212867_create_collection_types.hyrax.rb +17 -0
- data/.dassie/db/migrate/20200821212868_update_collection_type_column_names.hyrax.rb +9 -0
- data/.dassie/db/migrate/20200821212869_update_collection_type_column_options.hyrax.rb +17 -0
- data/.dassie/db/migrate/20200821212870_create_collection_branding_infos.hyrax.rb +15 -0
- data/.dassie/db/migrate/20200821212871_create_collection_type_participants.hyrax.rb +11 -0
- data/.dassie/db/migrate/20200821212872_rename_admin_set_id_to_source_id.hyrax.rb +5 -0
- data/.dassie/db/migrate/20200821212873_add_preferred_locale_to_users.hyrax.rb +5 -0
- data/.dassie/db/migrate/20200821212874_add_collection_type_sharing_options.hyrax.rb +5 -0
- data/.dassie/db/migrate/20200821212875_add_unique_constraint_to_permission_template_accesses.hyrax.rb +8 -0
- data/.dassie/db/migrate/20200821212876_add_branding_to_collection_type.hyrax.rb +5 -0
- data/.dassie/db/migrate/20200821212877_add_badge_color_to_collection_types.hyrax.rb +5 -0
- data/.dassie/db/migrate/20200821212878_update_single_use_links_column_names.hyrax.rb +6 -0
- data/.dassie/db/migrate/20200821212879_change_sipity_entity_specific_responsibility.hyrax.rb +9 -0
- data/.dassie/db/migrate/20200821212880_create_mailboxer.mailboxer_engine.rb +65 -0
- data/.dassie/db/migrate/20200821212881_add_conversation_optout.mailboxer_engine.rb +15 -0
- data/.dassie/db/migrate/20200821212882_add_missing_indices.mailboxer_engine.rb +20 -0
- data/.dassie/db/migrate/20200821212883_add_delivery_tracking_info_to_mailboxer_receipts.mailboxer_engine.rb +8 -0
- data/.dassie/db/migrate/20200821212884_create_qa_local_authorities.rb +10 -0
- data/.dassie/db/migrate/20200821212885_create_qa_local_authority_entries.rb +12 -0
- data/.dassie/db/migrate/20200821212902_create_minter_states.noid_rails_engine.rb +17 -0
- data/.dassie/db/migrate/20200821212903_rename_minter_state_random_to_rand.noid_rails_engine.rb +8 -0
- data/.dassie/db/schema.rb +563 -0
- data/.dassie/db/seeds.rb +14 -0
- data/.dassie/lib/assets/.keep +0 -0
- data/.dassie/lib/tasks/.keep +0 -0
- data/.dassie/log/.keep +0 -0
- data/.dassie/package.json +17 -0
- data/.dassie/public/404.html +67 -0
- data/.dassie/public/422.html +67 -0
- data/.dassie/public/500.html +66 -0
- data/.dassie/public/apple-touch-icon-precomposed.png +0 -0
- data/.dassie/public/apple-touch-icon.png +0 -0
- data/.dassie/public/favicon.ico +0 -0
- data/.dassie/public/robots.txt +1 -0
- data/.dassie/solr/conf/_rest_managed.json +3 -0
- data/.dassie/solr/conf/mapping-ISOLatin1Accent.txt +246 -0
- data/.dassie/solr/conf/schema.xml +367 -0
- data/.dassie/solr/conf/scripts.conf +24 -0
- data/.dassie/solr/conf/solrconfig.xml +208 -0
- data/.dassie/solr/conf/stopwords.txt +58 -0
- data/.dassie/solr/conf/stopwords_en.txt +58 -0
- data/.dassie/solr/conf/xslt/example.xsl +132 -0
- data/.dassie/solr/conf/xslt/example_atom.xsl +67 -0
- data/.dassie/solr/conf/xslt/example_rss.xsl +66 -0
- data/.dassie/solr/conf/xslt/luke.xsl +337 -0
- data/.dassie/solr/sample_solr_documents.yml +2692 -0
- data/.dassie/storage/.keep +0 -0
- data/.dassie/values.stage.yaml +7 -0
- data/.dassie/values.yaml +15 -0
- data/.dassie/vendor/.keep +0 -0
- data/.dockerignore +11 -0
- data/.env +26 -0
- data/.github/CODE_OF_CONDUCT.md +4 -4
- data/.github/CONTRIBUTING.md +1 -1
- data/.github/SUPPORT.md +13 -1
- data/.gitignore +1 -1
- data/.regen +1 -1
- data/.rubocop.yml +1 -0
- data/.rubocop_fixme.yml +4 -0
- data/CODE_OF_CONDUCT.md +4 -4
- data/CONTAINERS.md +148 -0
- data/CONTRIBUTING.md +1 -1
- data/Dockerfile +75 -0
- data/Gemfile +26 -35
- data/README.md +61 -288
- data/app/actors/hyrax/actors/attach_members_actor.rb +7 -5
- data/app/actors/hyrax/actors/base_actor.rb +0 -1
- data/app/actors/hyrax/actors/create_with_files_ordered_members_actor.rb +28 -28
- data/app/actors/hyrax/actors/create_with_remote_files_actor.rb +2 -3
- data/app/actors/hyrax/actors/create_with_remote_files_ordered_members_actor.rb +23 -28
- data/app/actors/hyrax/actors/default_admin_set_actor.rb +20 -21
- data/app/actors/hyrax/actors/file_actor.rb +32 -32
- data/app/actors/hyrax/actors/file_set_actor.rb +4 -15
- data/app/actors/hyrax/actors/initialize_workflow_actor.rb +8 -0
- data/app/actors/hyrax/actors/transfer_request_actor.rb +5 -0
- data/app/assets/javascripts/hyrax.js +1 -0
- data/app/assets/javascripts/hyrax/skip_to_content.js +15 -0
- data/app/assets/stylesheets/hyrax/_usage-stats.scss +1 -1
- data/app/authorities/qa/authorities/collections.rb +18 -8
- data/app/authorities/qa/authorities/find_works.rb +20 -5
- data/app/controllers/concerns/hyrax/collections_controller_behavior.rb +15 -6
- data/app/controllers/concerns/hyrax/works_controller_behavior.rb +62 -31
- data/app/controllers/hyrax/dashboard/collections_controller.rb +22 -12
- data/app/controllers/hyrax/dashboard/works_controller.rb +3 -4
- data/app/controllers/hyrax/file_sets_controller.rb +19 -10
- data/app/controllers/hyrax/homepage_controller.rb +11 -11
- data/app/controllers/hyrax/my/collections_controller.rb +5 -6
- data/app/controllers/hyrax/my/highlights_controller.rb +2 -3
- data/app/controllers/hyrax/my/shares_controller.rb +2 -3
- data/app/controllers/hyrax/my/works_controller.rb +1 -6
- data/app/controllers/hyrax/my_controller.rb +10 -2
- data/app/controllers/hyrax/permissions_controller.rb +1 -0
- data/app/controllers/hyrax/single_use_links_viewer_controller.rb +11 -5
- data/app/controllers/hyrax/users_controller.rb +5 -10
- data/app/forms/hyrax/forms/failed_submission_form_wrapper.rb +136 -0
- data/app/forms/hyrax/forms/resource_form.rb +8 -4
- data/app/helpers/hyrax/collections_helper.rb +1 -1
- data/app/helpers/hyrax/dashboard_helper_behavior.rb +7 -2
- data/app/helpers/hyrax/embargo_helper.rb +5 -1
- data/app/helpers/hyrax/hyrax_helper_behavior.rb +10 -5
- data/app/helpers/hyrax/lease_helper.rb +5 -1
- data/app/indexers/hyrax/pcdm_collection_indexer.rb +21 -0
- data/app/indexers/hyrax/resource_indexer.rb +3 -1
- data/app/indexers/hyrax/valkyrie_collection_indexer.rb +3 -12
- data/app/indexers/hyrax/valkyrie_indexer.rb +45 -17
- data/app/indexers/hyrax/valkyrie_work_indexer.rb +16 -0
- data/app/jobs/attach_files_to_work_job.rb +3 -41
- data/app/jobs/embargo_expiry_job.rb +15 -0
- data/app/jobs/event_job.rb +14 -7
- data/app/jobs/hyrax/application_job.rb +6 -1
- data/app/jobs/import_url_job.rb +11 -5
- data/app/jobs/inherit_permissions_job.rb +6 -25
- data/app/jobs/lease_expiry_job.rb +15 -0
- data/app/models/admin_set.rb +1 -1
- data/app/models/concerns/hyrax/ability.rb +192 -21
- data/app/models/concerns/hyrax/ability/admin_set_ability.rb +0 -5
- data/app/models/concerns/hyrax/collection_behavior.rb +7 -13
- data/app/models/concerns/hyrax/permissions/writable.rb +2 -2
- data/app/models/concerns/hyrax/solr_document/characterization.rb +35 -2
- data/app/models/concerns/hyrax/solr_document_behavior.rb +37 -5
- data/app/models/hyrax/change_set.rb +5 -1
- data/app/models/hyrax/collection_type.rb +59 -22
- data/app/models/hyrax/event.rb +5 -7
- data/app/models/hyrax/file_metadata.rb +15 -4
- data/app/models/hyrax/pcdm_collection.rb +13 -0
- data/app/models/hyrax/uploaded_file.rb +9 -2
- data/app/models/hyrax/{active_job_proxy.rb → valkyrie_global_id_proxy.rb} +6 -5
- data/app/models/hyrax/virus_scanner.rb +2 -1
- data/app/models/hyrax/work.rb +1 -1
- data/app/models/sipity.rb +6 -0
- data/app/models/sipity/entity.rb +1 -1
- data/app/models/sipity/workflow.rb +23 -3
- data/app/presenters/hyrax/admin/repository_object_presenter.rb +7 -2
- data/app/presenters/hyrax/collection_presenter.rb +1 -1
- data/app/presenters/hyrax/file_set_presenter.rb +3 -0
- data/app/presenters/hyrax/iiif_manifest_presenter.rb +3 -3
- data/app/presenters/hyrax/permission_badge.rb +1 -1
- data/app/presenters/hyrax/presenter_factory.rb +0 -2
- data/app/presenters/hyrax/select_collection_type_presenter.rb +16 -3
- data/app/presenters/hyrax/select_type_presenter.rb +3 -2
- data/app/presenters/hyrax/stats_usage_presenter.rb +0 -1
- data/app/presenters/hyrax/work_show_presenter.rb +1 -1
- data/app/renderers/hyrax/renderers/attribute_renderer.rb +16 -6
- data/app/search_builders/hyrax/README.md +3 -3
- data/app/search_builders/hyrax/admin_admin_set_member_search_builder.rb +8 -2
- data/app/search_builders/hyrax/collection_member_search_builder.rb +21 -7
- data/app/search_builders/hyrax/dashboard/managed_search_filters.rb +1 -1
- data/app/search_builders/hyrax/dashboard/nested_collections_search_builder.rb +1 -1
- data/app/search_builders/hyrax/embargo_search_builder.rb +0 -1
- data/app/search_builders/hyrax/filter_by_type.rb +3 -1
- data/app/search_builders/hyrax/lease_search_builder.rb +0 -1
- data/app/search_builders/hyrax/nested_collections_parent_search_builder.rb +12 -2
- data/app/search_builders/hyrax/search_builder.rb +1 -4
- data/app/search_builders/hyrax/search_filters.rb +0 -2
- data/app/services/hyrax/access_control_list.rb +33 -2
- data/app/services/hyrax/adapters/nesting_index_adapter.rb +26 -7
- data/app/services/hyrax/admin_set_member_service.rb +18 -4
- data/{lib/hyrax/callbacks/registry.rb → app/services/hyrax/callbacks.rb} +23 -0
- data/app/services/hyrax/change_content_depositor_service.rb +4 -1
- data/app/services/hyrax/collection_member_service.rb +5 -1
- data/app/services/hyrax/collection_types/permissions_service.rb +0 -2
- data/app/services/hyrax/collections/collection_member_service.rb +44 -64
- data/app/services/hyrax/collections/managed_collections_service.rb +15 -2
- data/app/services/hyrax/collections/migration_service.rb +9 -3
- data/app/services/hyrax/collections/nested_collection_persistence_service.rb +1 -1
- data/app/services/hyrax/collections/nested_collection_query_service.rb +39 -19
- data/app/services/hyrax/collections/permissions_service.rb +0 -1
- data/app/services/hyrax/collections_service.rb +12 -12
- data/app/services/hyrax/custom_queries/find_collections_by_type.rb +1 -1
- data/app/services/hyrax/custom_queries/navigators/child_collections_navigator.rb +14 -3
- data/app/services/hyrax/custom_queries/navigators/child_filesets_navigator.rb +14 -3
- data/app/services/hyrax/custom_queries/navigators/child_works_navigator.rb +10 -3
- data/app/services/hyrax/custom_queries/navigators/collection_members.rb +1 -0
- data/app/services/hyrax/custom_queries/navigators/find_files.rb +3 -0
- data/app/services/hyrax/database_migrator.rb +13 -10
- data/app/services/hyrax/default_middleware_stack.rb +0 -6
- data/app/services/hyrax/ensure_well_formed_admin_set_service.rb +27 -0
- data/app/services/hyrax/file_set_fixity_check_service.rb +16 -17
- data/app/services/hyrax/file_set_type_service.rb +55 -0
- data/app/services/hyrax/graph_exporter.rb +64 -8
- data/app/services/hyrax/list_source_exporter.rb +16 -34
- data/app/services/hyrax/listeners.rb +22 -0
- data/app/services/hyrax/listeners/proxy_deposit_listener.rb +20 -0
- data/app/services/hyrax/listeners/workflow_listener.rb +36 -0
- data/app/services/hyrax/multiple_membership_checker.rb +2 -1
- data/app/services/hyrax/quick_classification_query.rb +2 -3
- data/app/services/hyrax/resource_visibility_propagator.rb +1 -1
- data/app/services/hyrax/search_service.rb +108 -0
- data/app/services/hyrax/simple_schema_loader.rb +3 -1
- data/app/services/hyrax/statistics/depositors/summary.rb +0 -1
- data/app/services/hyrax/statistics/system_stats.rb +0 -1
- data/app/services/hyrax/thumbnail_path_service.rb +6 -1
- data/app/services/hyrax/time_service.rb +10 -0
- data/app/services/hyrax/versioning_service.rb +4 -28
- data/app/services/hyrax/work_uploads_handler.rb +166 -0
- data/app/services/hyrax/workflow/action_taken_service.rb +14 -1
- data/app/services/hyrax/workflow/grant_edit_to_depositor.rb +3 -1
- data/app/services/hyrax/workflow/permission_generator.rb +14 -9
- data/app/services/hyrax/workflow/workflow_action_service.rb +1 -1
- data/app/services/hyrax/workflow/workflow_factory.rb +12 -10
- data/app/services/hyrax/working_directory.rb +0 -1
- data/app/services/hyrax/works/managed_works_service.rb +14 -2
- data/app/views/_controls.html.erb +1 -1
- data/app/views/hyrax/admin/collection_types/index.html.erb +1 -1
- data/app/views/hyrax/base/_member.html.erb +1 -1
- data/app/views/hyrax/base/_representative_media.html.erb +1 -1
- data/app/views/hyrax/base/iiif_viewers/_universal_viewer.html.erb +1 -1
- data/app/views/hyrax/base/show.html.erb +2 -2
- data/app/views/hyrax/batch_select/_add_button.html.erb +1 -1
- data/app/views/hyrax/collections/_default_group.html.erb +2 -0
- data/app/views/hyrax/collections/show.html.erb +1 -1
- data/app/views/hyrax/dashboard/works/_default_group.html.erb +2 -0
- data/app/views/hyrax/embargoes/_list_expired_active_embargoes.html.erb +1 -1
- data/app/views/hyrax/leases/_list_expired_active_leases.html.erb +2 -1
- data/app/views/hyrax/my/works/_default_group.html.erb +2 -0
- data/app/views/layouts/hyrax.html.erb +0 -15
- data/bin/db-migrate-seed.sh +9 -0
- data/bin/db-wait.sh +14 -0
- data/bin/hyrax-entrypoint.sh +15 -0
- data/chart/fcrepo/.gitignore +2 -0
- data/chart/fcrepo/.helmignore +23 -0
- data/chart/fcrepo/Chart.yaml +11 -0
- data/chart/fcrepo/README.md +50 -0
- data/chart/fcrepo/templates/NOTES.txt +21 -0
- data/chart/fcrepo/templates/_helpers.tpl +68 -0
- data/chart/fcrepo/templates/configmap-env.yaml +19 -0
- data/chart/fcrepo/templates/deployment.yaml +109 -0
- data/chart/fcrepo/templates/ingress.yaml +41 -0
- data/chart/fcrepo/templates/pvc.yaml +20 -0
- data/chart/fcrepo/templates/secret.yaml +12 -0
- data/chart/fcrepo/templates/service.yaml +15 -0
- data/chart/fcrepo/templates/serviceaccount.yaml +12 -0
- data/chart/fcrepo/templates/tests/test-connection.yaml +15 -0
- data/chart/fcrepo/values.yaml +79 -0
- data/chart/hyrax/.gitignore +2 -0
- data/chart/hyrax/.helmignore +23 -0
- data/chart/hyrax/Chart.yaml +27 -0
- data/chart/hyrax/README.md +69 -0
- data/chart/hyrax/templates/NOTES.txt +21 -0
- data/chart/hyrax/templates/_helpers.tpl +92 -0
- data/chart/hyrax/templates/configmap-env.yaml +32 -0
- data/chart/hyrax/templates/deployment.yaml +79 -0
- data/chart/hyrax/templates/fcrepo-secret.yaml +13 -0
- data/chart/hyrax/templates/hpa.yaml +28 -0
- data/chart/hyrax/templates/ingress.yaml +41 -0
- data/chart/hyrax/templates/secrets.yaml +12 -0
- data/chart/hyrax/templates/service.yaml +15 -0
- data/chart/hyrax/templates/serviceaccount.yaml +12 -0
- data/chart/hyrax/templates/tests/test-connection.yaml +15 -0
- data/chart/hyrax/values.yaml +97 -0
- data/config/initializers/indexing_adapter_initializer.rb +7 -12
- data/config/initializers/listeners.rb +2 -0
- data/config/locales/hyrax.en.yml +1 -1
- data/config/metadata/basic_metadata.yaml +13 -0
- data/db/seeds.rb +20 -0
- data/docker-compose.yml +132 -0
- data/documentation/developing-your-hyrax-based-app.md +271 -0
- data/documentation/legacyREADME.md +336 -0
- data/documentation/note-about-versions.md +15 -0
- data/hyrax.gemspec +7 -8
- data/lib/generators/hyrax/templates/config/initializers/hyrax.rb +4 -6
- data/lib/generators/hyrax/templates/config/locales/hyrax.es.yml +1 -1
- data/lib/generators/hyrax/templates/db/seeds.rb +16 -14
- data/lib/generators/hyrax/templates/uv.html +1 -1
- data/lib/generators/hyrax/work_resource/templates/controller.rb.erb +0 -5
- data/lib/generators/hyrax/work_resource/templates/form.rb.erb +1 -1
- data/lib/generators/hyrax/work_resource/templates/work.html.erb_spec.rb.erb +3 -2
- data/lib/hyrax.rb +17 -0
- data/lib/hyrax/configuration.rb +340 -200
- data/lib/hyrax/event_store.rb +5 -0
- data/lib/hyrax/form_fields.rb +1 -1
- data/lib/hyrax/indexer.rb +19 -3
- data/lib/hyrax/publisher.rb +71 -2
- data/lib/hyrax/resource_sync/change_list_writer.rb +1 -1
- data/lib/hyrax/resource_sync/resource_list_writer.rb +1 -1
- data/lib/hyrax/schema.rb +2 -2
- data/lib/hyrax/specs/capybara.rb +98 -0
- data/lib/hyrax/specs/clamav.rb +15 -0
- data/lib/hyrax/specs/disable_animations_in_test_environment.rb +53 -0
- data/lib/hyrax/specs/engine_routes.rb +11 -0
- data/lib/hyrax/specs/shared_specs/change_set.rb +11 -0
- data/lib/hyrax/specs/shared_specs/factories/strategies/json_strategy.rb +13 -0
- data/lib/hyrax/specs/shared_specs/factories/strategies/valkyrie_resource.rb +0 -11
- data/lib/hyrax/specs/shared_specs/hydra_works.rb +6 -0
- data/lib/hyrax/specs/shared_specs/indexers.rb +22 -5
- data/lib/hyrax/specs/shared_specs/metadata.rb +64 -0
- data/lib/hyrax/specs/spy_listener.rb +52 -26
- data/lib/hyrax/transactions/container.rb +13 -1
- data/lib/hyrax/transactions/steps/add_file_sets.rb +35 -0
- data/lib/hyrax/transactions/steps/save.rb +10 -4
- data/lib/hyrax/transactions/steps/save_access_control.rb +29 -0
- data/lib/hyrax/transactions/steps/set_default_admin_set.rb +1 -1
- data/lib/hyrax/transactions/update_work.rb +3 -1
- data/lib/hyrax/transactions/work_create.rb +3 -1
- data/lib/hyrax/version.rb +1 -1
- data/lib/tasks/collection_type_global_id.rake +22 -0
- data/lib/tasks/default_admin_set.rake +5 -0
- data/lib/wings.rb +1 -1
- data/lib/wings/active_fedora_converter.rb +71 -123
- data/lib/wings/active_fedora_converter/default_work.rb +129 -0
- data/lib/wings/active_fedora_converter/nested_resource.rb +25 -0
- data/lib/wings/attribute_transformer.rb +28 -1
- data/lib/wings/converter_value_mapper.rb +70 -3
- data/lib/wings/model_registry.rb +4 -3
- data/lib/wings/model_transformer.rb +25 -7
- data/lib/wings/orm_converter.rb +19 -23
- data/lib/wings/services/custom_queries/find_collections_by_type.rb +1 -1
- data/lib/wings/services/custom_queries/find_file_metadata.rb +65 -38
- data/lib/wings/services/file_converter_service.rb +6 -55
- data/lib/wings/services/file_metadata_builder.rb +12 -8
- data/lib/wings/setup.rb +56 -9
- data/lib/wings/transformer_value_mapper.rb +1 -0
- data/lib/wings/valkyrie/metadata_adapter.rb +2 -2
- data/lib/wings/valkyrie/persister.rb +13 -14
- data/lib/wings/valkyrie/storage.rb +94 -0
- data/tasks/benchmark.rake +56 -0
- data/template.rb +1 -3
- metadata +346 -54
- data/lib/hyrax/callbacks.rb +0 -27
- data/lib/wings/hydra/pcdm/models/concerns/collection_valkyrie_behavior.rb +0 -28
- data/lib/wings/hydra/pcdm/models/concerns/object_valkyrie_behavior.rb +0 -28
- data/lib/wings/hydra/pcdm/models/concerns/pcdm_valkyrie_behavior.rb +0 -171
- data/lib/wings/hydra/works/models/concerns/collection_valkyrie_behavior.rb +0 -31
- data/lib/wings/hydra/works/models/concerns/file_set_valkyrie_behavior.rb +0 -31
- data/lib/wings/hydra/works/models/concerns/work_valkyrie_behavior.rb +0 -60
- data/lib/wings/models/concerns/collection_behavior.rb +0 -39
- data/lib/wings/models/multi_checksum.rb +0 -18
- data/lib/wings/services/id_converter_service.rb +0 -15
- data/lib/wings/valkyrie/storage/active_fedora.rb +0 -27
@@ -1,45 +1,27 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
module Hyrax
|
3
|
+
##
|
4
|
+
# @deprecated see Hyrax::GraphExporter::ListSourceExporter
|
5
|
+
#
|
3
6
|
# Retrieves the graph for an object with the internal triples removed
|
4
7
|
# and the uris translated to external uris.
|
5
|
-
class ListSourceExporter
|
8
|
+
class ListSourceExporter < GraphExporter::ListSourceExporter
|
9
|
+
##
|
6
10
|
# @param [String] id
|
7
11
|
# @param [ActionDispatch::Request] request the http request context
|
8
12
|
# @param [String] parent_url
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
+
# @param [String] hostname the current http host
|
14
|
+
def initialize(id, request, parent_url, hostname: nil)
|
15
|
+
Deprecation.warn("#{subject.class} is deprecated and replaced with the (private) Hyrax::GraphExporter::")
|
16
|
+
host = hostname || request.host
|
17
|
+
super(id: id, parent_url: parent_url, hostname: host)
|
13
18
|
end
|
14
19
|
|
15
|
-
|
16
|
-
|
17
|
-
#
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
private
|
23
|
-
|
24
|
-
def clean_graph_repository
|
25
|
-
Hydra::ContentNegotiation::CleanGraphRepository.new(connection, replacer)
|
26
|
-
end
|
27
|
-
|
28
|
-
def connection
|
29
|
-
@connection ||= CleanConnection.new(ActiveFedora.fedora.connection)
|
30
|
-
end
|
31
|
-
|
32
|
-
# This method is called once for each statement in the graph.
|
33
|
-
def replacer
|
34
|
-
lambda do |resource_id, _graph|
|
35
|
-
parent_id = Hyrax::Base.uri_to_id(parent_url)
|
36
|
-
return parent_url + resource_id.sub(parent_id, '') if resource_id.start_with?(parent_id)
|
37
|
-
Rails.application.routes.url_helpers.solr_document_url(resource_id, host: hostname)
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
def hostname
|
42
|
-
request.host
|
43
|
-
end
|
20
|
+
##
|
21
|
+
# @!attribute [r] request
|
22
|
+
# @deprecated use {#hostname} to access the host
|
23
|
+
# @return [ActionDispatch::Request]
|
24
|
+
attr_reader :request
|
25
|
+
deprecation_deprecate :request
|
44
26
|
end
|
45
27
|
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module Hyrax
|
3
|
+
# @note
|
4
|
+
# Did you encounter an exception similar to the following:
|
5
|
+
#
|
6
|
+
# "A copy of Hyrax::Listeners::ObjectLifecycleListener has been removed from the module tree but is still active!"
|
7
|
+
#
|
8
|
+
# You may need to register a listener as autoload. See
|
9
|
+
# ./app/services/hyrax/listeners.rb
|
10
|
+
module Listeners
|
11
|
+
extend ActiveSupport::Autoload
|
12
|
+
|
13
|
+
autoload :AclIndexListener
|
14
|
+
autoload :BatchNotificationListener
|
15
|
+
autoload :FileSetLifecycleListener
|
16
|
+
autoload :FileSetLifecycleNotificationListener
|
17
|
+
autoload :MetadataIndexListener
|
18
|
+
autoload :ObjectLifecycleListener
|
19
|
+
autoload :ProxyDepositListener
|
20
|
+
autoload :WorkflowListener
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Hyrax
|
4
|
+
module Listeners
|
5
|
+
##
|
6
|
+
# Listens for deposit events, and checks for proxy situations. When a user
|
7
|
+
# deposits an item `on_behalf_of` another, ensures transfer is handled.
|
8
|
+
class ProxyDepositListener
|
9
|
+
##
|
10
|
+
# @param event [Dry::Event]
|
11
|
+
def on_object_deposited(event)
|
12
|
+
return if event[:object].try(:on_behalf_of).blank? ||
|
13
|
+
(event[:object].on_behalf_of == event[:object].depositor)
|
14
|
+
|
15
|
+
ContentDepositorChangeEventJob
|
16
|
+
.perform_later(event[:object], ::User.find_by_user_key(event[:object].on_behalf_of))
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Hyrax
|
4
|
+
module Listeners
|
5
|
+
##
|
6
|
+
# Listens for object lifecycle events that require workflow changes and
|
7
|
+
# manages workflow accordingly.
|
8
|
+
class WorkflowListener
|
9
|
+
##
|
10
|
+
# @note respects class attribute configuration at
|
11
|
+
# {Hyrax::Actors::InitializeWorkflowActor.workflow_factory}, but falls
|
12
|
+
# back on {Hyrax::Workflow::WorkflowFactory} to prepare for removal of
|
13
|
+
# Actors
|
14
|
+
# @return [#create] default: {Hyrax::Workflow::WorkflowFactory}
|
15
|
+
def factory
|
16
|
+
if defined?(Hyrax::Actors::InitializeWorkflowActor)
|
17
|
+
Hyrax::Actors::InitializeWorkflowActor.workflow_factory
|
18
|
+
else
|
19
|
+
Hyrax::Workflow::WorkflowFactory
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
##
|
24
|
+
# @param event [Dry::Event]
|
25
|
+
def on_object_deposited(event)
|
26
|
+
return Rails.logger.warn("Skipping workflow initialization for #{event[:object]}; no user is given\n\t#{event}") if
|
27
|
+
event[:user].blank?
|
28
|
+
|
29
|
+
factory.create(event[:object], {}, event[:user])
|
30
|
+
rescue Sipity::StateError, Sipity::ConversionError => err
|
31
|
+
# don't error on known sipity error types; log instead
|
32
|
+
Rails.logger.error(err)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -52,7 +52,8 @@ module Hyrax
|
|
52
52
|
|
53
53
|
def single_membership_collections(collection_ids)
|
54
54
|
return [] if collection_ids.blank?
|
55
|
-
|
55
|
+
|
56
|
+
::Collection.where(:id => collection_ids, Hyrax.config.collection_type_index_field.to_sym => collection_type_gids_that_disallow_multiple_membership)
|
56
57
|
end
|
57
58
|
|
58
59
|
def collection_type_gids_that_disallow_multiple_membership
|
@@ -12,9 +12,8 @@ module Hyrax
|
|
12
12
|
attr_reader :user
|
13
13
|
|
14
14
|
# @param [::User] user the current user
|
15
|
-
# @param [
|
16
|
-
# @
|
17
|
-
# @option options [Array<String>] :models the options to display, defaults to everything.
|
15
|
+
# @param [#call] concern_name_normalizer (String#constantize) a proc that translates names to classes
|
16
|
+
# @param [Array<String>] models the options to display, defaults to everything.
|
18
17
|
def initialize(user,
|
19
18
|
models: Hyrax.config.registered_curation_concern_types,
|
20
19
|
concern_name_normalizer: ->(str) { str.constantize })
|
@@ -17,7 +17,7 @@ module Hyrax
|
|
17
17
|
# @!attribute [r] persister
|
18
18
|
# @return [#save]
|
19
19
|
# @!attribute [r] queries
|
20
|
-
# @
|
20
|
+
# @return [Valkyrie::Persistence::CustomQueryContainer]
|
21
21
|
attr_reader :embargo_manager, :lease_manager, :persister, :queries
|
22
22
|
|
23
23
|
##
|
@@ -0,0 +1,108 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# SearchService returns search results from the repository
|
4
|
+
module Hyrax
|
5
|
+
# Copied from Blacklight 7
|
6
|
+
class SearchService
|
7
|
+
def initialize(config:, user_params: nil, search_builder_class: config.search_builder_class, **context)
|
8
|
+
@blacklight_config = config
|
9
|
+
@user_params = user_params || {}
|
10
|
+
@search_builder_class = search_builder_class
|
11
|
+
@context = context
|
12
|
+
end
|
13
|
+
|
14
|
+
# The blacklight_config + controller are accessed by the search_builder
|
15
|
+
attr_reader :blacklight_config, :context
|
16
|
+
|
17
|
+
def search_builder
|
18
|
+
search_builder_class.new(self)
|
19
|
+
end
|
20
|
+
|
21
|
+
# rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
22
|
+
# a solr query method
|
23
|
+
# @yield [search_builder] optional block yields configured SearchBuilder, caller can modify or create new SearchBuilder to be used. Block should return SearchBuilder to be used.
|
24
|
+
# @return [Blacklight::Solr::Response] the solr response object
|
25
|
+
def search_results
|
26
|
+
builder = search_builder.with(user_params)
|
27
|
+
builder.page = user_params[:page] if user_params[:page]
|
28
|
+
builder.rows = (user_params[:per_page] || user_params[:rows]) if user_params[:per_page] || user_params[:rows]
|
29
|
+
|
30
|
+
builder = yield(builder) if block_given?
|
31
|
+
response = repository.search(builder)
|
32
|
+
|
33
|
+
if response.grouped? && grouped_key_for_results
|
34
|
+
[response.group(grouped_key_for_results), []]
|
35
|
+
elsif response.grouped? && response.grouped.length == 1
|
36
|
+
[response.grouped.first, []]
|
37
|
+
else
|
38
|
+
[response, response.documents]
|
39
|
+
end
|
40
|
+
end
|
41
|
+
# rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
42
|
+
|
43
|
+
# retrieve a document, given the doc id
|
44
|
+
# @param [Array{#to_s},#to_s] id
|
45
|
+
# @return [Blacklight::Solr::Response, Blacklight::SolrDocument] the solr response object and the first document
|
46
|
+
def fetch(id = nil, extra_controller_params = {})
|
47
|
+
if id.is_a? Array
|
48
|
+
fetch_many(id, extra_controller_params)
|
49
|
+
else
|
50
|
+
fetch_one(id, extra_controller_params)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
private
|
55
|
+
|
56
|
+
attr_reader :search_builder_class, :user_params, :search_state
|
57
|
+
|
58
|
+
def repository
|
59
|
+
blacklight_config.repository || blacklight_config.repository_class.new(blacklight_config)
|
60
|
+
end
|
61
|
+
|
62
|
+
def scope
|
63
|
+
@context[:scope]
|
64
|
+
end
|
65
|
+
|
66
|
+
def method_missing(method_name, *arguments, &block)
|
67
|
+
if scope&.respond_to?(method_name)
|
68
|
+
Deprecation.warn(self.class, "Calling `#{method_name}` on scope " \
|
69
|
+
'is deprecated and will be removed in Blacklight 8. Call #to_h first if you ' \
|
70
|
+
' need to use hash methods (or, preferably, use your own SearchState implementation)')
|
71
|
+
scope&.public_send(method_name, *arguments, &block)
|
72
|
+
else
|
73
|
+
super
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
def respond_to_missing?(method_name, include_private = false)
|
78
|
+
scope&.respond_to?(method_name, include_private) || super
|
79
|
+
end
|
80
|
+
|
81
|
+
def current_ability
|
82
|
+
@current_ability || @context[:current_ability]
|
83
|
+
end
|
84
|
+
|
85
|
+
##
|
86
|
+
# Retrieve a set of documents by id
|
87
|
+
# @param [Array] ids
|
88
|
+
# @param [HashWithIndifferentAccess] extra_controller_params
|
89
|
+
def fetch_many(ids, extra_controller_params)
|
90
|
+
extra_controller_params ||= {}
|
91
|
+
|
92
|
+
query = search_builder
|
93
|
+
.with(user_params)
|
94
|
+
.where(blacklight_config.document_model.unique_key => ids)
|
95
|
+
.merge(blacklight_config.fetch_many_document_params)
|
96
|
+
.merge(extra_controller_params)
|
97
|
+
|
98
|
+
solr_response = repository.search(query)
|
99
|
+
|
100
|
+
[solr_response, solr_response.documents]
|
101
|
+
end
|
102
|
+
|
103
|
+
def fetch_one(id, extra_controller_params)
|
104
|
+
solr_response = repository.find id, extra_controller_params
|
105
|
+
[solr_response, solr_response.documents.first]
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
@@ -34,7 +34,7 @@ module Hyrax
|
|
34
34
|
##
|
35
35
|
# @param [Symbol] schema
|
36
36
|
#
|
37
|
-
# @return [
|
37
|
+
# @return [{Symbol => Symbol}] a map from index keys to attribute names
|
38
38
|
def index_rules_for(schema:)
|
39
39
|
definitions(schema).each_with_object({}) do |definition, hash|
|
40
40
|
definition.index_keys.each do |key|
|
@@ -108,6 +108,8 @@ module Hyrax
|
|
108
108
|
# @return [Dry::Types::Type]
|
109
109
|
def type_for(type)
|
110
110
|
case type
|
111
|
+
when 'id'
|
112
|
+
Valkyrie::Types::ID
|
111
113
|
when 'uri'
|
112
114
|
Valkyrie::Types::URI
|
113
115
|
when 'date_time'
|
@@ -2,7 +2,6 @@
|
|
2
2
|
module Hyrax
|
3
3
|
module Statistics
|
4
4
|
# A class that retrieves system level statistics about the system
|
5
|
-
# TODO: this class could be refactored into several classes.
|
6
5
|
#
|
7
6
|
# @attr_reader [Integer] limit limits the results returned from top_depositors and top_formats
|
8
7
|
# Default is 5, maximum is 20, minimum is 5
|
@@ -11,7 +11,7 @@ module Hyrax
|
|
11
11
|
|
12
12
|
return unless thumb
|
13
13
|
return call(thumb) unless thumb.file_set?
|
14
|
-
if
|
14
|
+
if audio?(thumb)
|
15
15
|
audio_image
|
16
16
|
elsif thumbnail?(thumb)
|
17
17
|
thumbnail_path(thumb)
|
@@ -22,6 +22,11 @@ module Hyrax
|
|
22
22
|
|
23
23
|
private
|
24
24
|
|
25
|
+
def audio?(thumb)
|
26
|
+
service = thumb.respond_to?(:audio?) ? thumb : Hyrax::FileSetTypeService.new(file_set: thumb)
|
27
|
+
service.audio?
|
28
|
+
end
|
29
|
+
|
25
30
|
def fetch_thumbnail(object)
|
26
31
|
return object if object.thumbnail_id == object.id
|
27
32
|
Hyrax.query_service.find_by_alternate_identifier(alternate_identifier: object.thumbnail_id)
|
@@ -1,6 +1,16 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
module Hyrax
|
3
|
+
##
|
4
|
+
# Give the current time in UTC
|
5
|
+
#
|
6
|
+
# Use of this service allows a single integration point timestamps. If your
|
7
|
+
# application (or test suite) needs to provide a special time for "now", you
|
8
|
+
# can override it here.
|
9
|
+
#
|
10
|
+
# @example
|
11
|
+
# Hyrax::TimeService.time_in_utc
|
3
12
|
class TimeService
|
13
|
+
##
|
4
14
|
# @return [DateTime] the current time in UTC
|
5
15
|
def self.time_in_utc
|
6
16
|
DateTime.current
|
@@ -1,5 +1,4 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
require 'wings/services/file_metadata_builder'
|
3
2
|
|
4
3
|
module Hyrax
|
5
4
|
class VersioningService
|
@@ -38,27 +37,12 @@ module Hyrax
|
|
38
37
|
Hyrax::VersionCommitter.create(version_id: version_id, committer_login: user_key)
|
39
38
|
end
|
40
39
|
|
41
|
-
# TODO: WINGS - Copied from valkyrie6 branch. Need to explore whether this is needed?
|
42
|
-
# # @param [FileSet] file_set
|
43
|
-
# # @param [Hyrax::FileMetadata] content
|
44
|
-
# # @param [String] revision_id
|
45
|
-
# # @param [User, String] user
|
46
|
-
# def restore_version(file_set, content, revision_id, user = nil)
|
47
|
-
# found_version = content.versions.find { |x| x.label == Array.wrap(revision_id) }
|
48
|
-
# return unless found_version
|
49
|
-
# file_metadata = Wings::FileMetadataBuilder.new(storage_adapter: nil, persister: indexing_adapter.persister).attach_file_metadata(file_metadata: found_version, file_set: file_set)
|
50
|
-
# create(file_metadata, user)
|
51
|
-
# end
|
52
|
-
|
53
40
|
private
|
54
41
|
|
55
|
-
# # TODO: WINGS - Should we create and use indexing adapter for persistence? This is what was used in branch valkyrie6. See issue #3800.
|
56
|
-
# def indexing_adapter
|
57
|
-
# Valkyrie::MetadataAdapter.find(:indexing_persister)
|
58
|
-
# end
|
59
|
-
|
60
42
|
def perform_create(content, user, use_valkyrie)
|
61
43
|
use_valkyrie ? perform_create_through_valkyrie(content, user) : perform_create_through_active_fedora(content, user)
|
44
|
+
rescue NotImplementedError
|
45
|
+
Rails.logger.warn "Declining to create a Version for #{content}; #{self} doesn't support versioning with use_valkyrie: #{use_valkyrie}"
|
62
46
|
end
|
63
47
|
|
64
48
|
def perform_create_through_active_fedora(content, user)
|
@@ -66,16 +50,8 @@ module Hyrax
|
|
66
50
|
record_committer(content, user) if user
|
67
51
|
end
|
68
52
|
|
69
|
-
def perform_create_through_valkyrie(content, user)
|
70
|
-
|
71
|
-
# rubocop:disable Lint/UnreachableCode
|
72
|
-
new_version = content.new(id: nil)
|
73
|
-
new_version.label = "version#{content.member_ids.length + 1}"
|
74
|
-
new_version = indexing_adapter.persister.save(resource: new_version)
|
75
|
-
content.member_ids = content.member_ids + [new_version.id]
|
76
|
-
content = indexing_adapter.persister.save(resource: content)
|
77
|
-
record_committer(content, user) if user
|
78
|
-
# rubocop:enable Lint/UnreachableCode
|
53
|
+
def perform_create_through_valkyrie(content, user) # no-op
|
54
|
+
raise NotImplementedError
|
79
55
|
end
|
80
56
|
end
|
81
57
|
end
|
@@ -0,0 +1,166 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Hyrax
|
4
|
+
##
|
5
|
+
# @api public
|
6
|
+
#
|
7
|
+
# Mediates uploads to a work.
|
8
|
+
#
|
9
|
+
# Given an existing Work object, `#add` some set of files, then call `#attach`
|
10
|
+
# to handle creation/attachment of File Sets, and trigger persistence of files
|
11
|
+
# to the storage backend.
|
12
|
+
#
|
13
|
+
# This class provides both an interface and a concrete implementation.
|
14
|
+
# Applications that want to handle file attachment differently (e.g. by making
|
15
|
+
# them completely synchronous, by attaching file sets to a different work
|
16
|
+
# attribute, by supporting another file/IO class, etc...) can use a different
|
17
|
+
# `Handler` implementation. The only guarantee made by the _interface_ is that
|
18
|
+
# the process of persisting the relationship between `work` and the provided
|
19
|
+
# `files` will start when `#attach` is called.
|
20
|
+
#
|
21
|
+
# This base implementation accepts only `Hyrax::UploadedFile` instances and,
|
22
|
+
# for each one, creates a `Hyrax::FileSet` with permissions matching those on
|
23
|
+
# `work`, and appends that FileSet to `member_ids`. The `FileSet` will be
|
24
|
+
# added in the order that the `UploadedFiles` are passed in. If the work has a
|
25
|
+
# `nil` `representative_id` and/or `thumbnail_id`, the first `FileSet` will be
|
26
|
+
# set to that value. An `IngestJob` will be equeued, for each `FileSet`. When
|
27
|
+
# all of the `files` have been processed, the work will be saved with the
|
28
|
+
# added members. While this is happening, we take a lock on the work via
|
29
|
+
# `Lockable` (Redis/Redlock).
|
30
|
+
#
|
31
|
+
# This also publishes events as required by `Hyrax.publisher`.
|
32
|
+
#
|
33
|
+
# @todo make this genuinely retry-able. if we fail after creating some of
|
34
|
+
# the file_sets, but not attaching them to works, we should resolve that
|
35
|
+
# incomplete work on subsequent runs.
|
36
|
+
#
|
37
|
+
#
|
38
|
+
# @example
|
39
|
+
# Hyrax::WorkUploadsHandler.new(work: my_work)
|
40
|
+
# .add(files: [file1, file2])
|
41
|
+
# .attach
|
42
|
+
#
|
43
|
+
class WorkUploadsHandler
|
44
|
+
include Lockable
|
45
|
+
|
46
|
+
##
|
47
|
+
# @!attribute [r] files
|
48
|
+
# @return [Enumberable<Hyrax::UploadedFile>]
|
49
|
+
# @!attribute [r] work
|
50
|
+
# @return [Hyrax::Work]
|
51
|
+
attr_reader :files, :work
|
52
|
+
|
53
|
+
##
|
54
|
+
# @param [Hyrax::Work] work
|
55
|
+
# @param [#save] persister the valkyrie persister to use
|
56
|
+
def initialize(work:, persister: Hyrax.persister)
|
57
|
+
@work = work
|
58
|
+
@persister = persister
|
59
|
+
end
|
60
|
+
|
61
|
+
##
|
62
|
+
# @api public
|
63
|
+
#
|
64
|
+
# @note we immediately and silently discard uploads with an existing
|
65
|
+
# file_set_uri, in a half-considered attempt at supporting idempotency
|
66
|
+
# (for job retries). this is for legacy/AttachFilesToWorkJob
|
67
|
+
# compatibility, but could stand for a roubst reimplementation.
|
68
|
+
#
|
69
|
+
# @param [Enumberable<Hyrax::UploadedFile>] files files to add
|
70
|
+
#
|
71
|
+
# @return [WorkFileSetManager] self
|
72
|
+
# @raise [ArgumentError] if any of the uploaded files are not an
|
73
|
+
# `UploadedFile`
|
74
|
+
def add(files:)
|
75
|
+
validate_files(files) &&
|
76
|
+
@files = Array.wrap(files).reject { |f| f.file_set_uri.present? }
|
77
|
+
self
|
78
|
+
end
|
79
|
+
|
80
|
+
##
|
81
|
+
# @api public
|
82
|
+
#
|
83
|
+
# Create filesets for each added file
|
84
|
+
#
|
85
|
+
# @return [Boolean] true if all requested files were attached
|
86
|
+
def attach
|
87
|
+
return true if Array.wrap(files).empty? # short circuit to avoid aquiring a lock we won't use
|
88
|
+
|
89
|
+
acquire_lock_for(work.id) do
|
90
|
+
event_payloads = files.each_with_object([]) { |file, arry| arry << make_file_set_and_ingest(file) }
|
91
|
+
Hyrax.persister.save(resource: work)
|
92
|
+
event_payloads.each { |payload| Hyrax.publisher.publish('file.set.attached', payload) }
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
private
|
97
|
+
|
98
|
+
##
|
99
|
+
# @api private
|
100
|
+
def make_file_set_and_ingest(file)
|
101
|
+
file_set = @persister.save(resource: Hyrax::FileSet.new(file_set_args(file)))
|
102
|
+
Hyrax.publisher.publish('object.deposited', object: file_set, user: file.user)
|
103
|
+
file.add_file_set!(file_set)
|
104
|
+
|
105
|
+
# copy ACLs; should we also be propogating embargo/lease?
|
106
|
+
Hyrax::AccessControlList.copy_permissions(source: target_permissions, target: file_set)
|
107
|
+
append_to_work(file_set)
|
108
|
+
IngestJob.perform_later(wrap_file(file, file_set))
|
109
|
+
{ file_set: file_set, user: file.user }
|
110
|
+
end
|
111
|
+
|
112
|
+
##
|
113
|
+
# @api private
|
114
|
+
#
|
115
|
+
# @todo figure out how to know less about Work's ideas about FileSet use here. Maybe post-Wings, work.
|
116
|
+
def append_to_work(file_set)
|
117
|
+
work.member_ids << file_set.id
|
118
|
+
work.representative_id = file_set.id if work.respond_to?(:representative_id) && work.representative_id.blank?
|
119
|
+
work.thumbnail_id = file_set.id if work.respond_to?(:thumbnail_id) && work.thumbnail_id.blank?
|
120
|
+
end
|
121
|
+
|
122
|
+
##
|
123
|
+
# @api private
|
124
|
+
#
|
125
|
+
# @return [Hash{Symbol => Object}]
|
126
|
+
def file_set_args(file)
|
127
|
+
{ depositor: file.user.user_key,
|
128
|
+
creator: file.user.user_key,
|
129
|
+
date_uploaded: file.created_at,
|
130
|
+
date_modified: Hyrax::TimeService.time_in_utc,
|
131
|
+
label: file.uploader.filename,
|
132
|
+
title: file.uploader.filename }
|
133
|
+
end
|
134
|
+
|
135
|
+
##
|
136
|
+
# @api private
|
137
|
+
#
|
138
|
+
# @note cache these per instance to avoid repeated lookups.
|
139
|
+
#
|
140
|
+
# @return [Hyrax::AccessControlList] permissions to set on created filesets
|
141
|
+
def target_permissions
|
142
|
+
@target_permissions ||= Hyrax::AccessControlList.new(resource: work)
|
143
|
+
end
|
144
|
+
|
145
|
+
##
|
146
|
+
# @api private
|
147
|
+
# @return [JobIoWrapper]
|
148
|
+
def wrap_file(file, file_set)
|
149
|
+
JobIoWrapper.create_with_varied_file_handling!(user: file.user, file: file, relation: :original_file, file_set: file_set)
|
150
|
+
end
|
151
|
+
|
152
|
+
##
|
153
|
+
# @api private
|
154
|
+
#
|
155
|
+
# @note ported from AttachFilesToWorkJob. do we need this? maybe we should
|
156
|
+
# validate something other than type?
|
157
|
+
#
|
158
|
+
# @raise [ArgumentError] if any of the uploaded files aren't the right class
|
159
|
+
def validate_files(files)
|
160
|
+
files.each do |file|
|
161
|
+
next if file.is_a? Hyrax::UploadedFile
|
162
|
+
raise ArgumentError, "Hyrax::UploadedFile required, but #{file.class} received: #{file.inspect}"
|
163
|
+
end
|
164
|
+
end
|
165
|
+
end
|
166
|
+
end
|