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
@@ -24,11 +24,6 @@ module Hyrax
|
|
24
24
|
can :view_admin_show, AdminSet do |admin_set| # admin show page # for test by solr_doc, see collection_ability.rb
|
25
25
|
Hyrax::Collections::PermissionsService.can_view_admin_show_for_collection?(ability: self, collection_id: admin_set.id)
|
26
26
|
end
|
27
|
-
|
28
|
-
# TODO: I don't think these are needed anymore since there isn't a public show page. Should be checking :view_admin_show ability
|
29
|
-
can :read, AdminSet do |admin_set| # for test by solr_doc, see solr_document_ability.rb
|
30
|
-
test_read(admin_set.id)
|
31
|
-
end
|
32
27
|
end
|
33
28
|
|
34
29
|
# TODO: I'm not sure why this is checked with AdminSet abilities. It was before the refactor and since I'm not sure what the connection is, I left it here.
|
@@ -4,7 +4,6 @@ module Hyrax
|
|
4
4
|
extend ActiveSupport::Concern
|
5
5
|
include Hydra::AccessControls::WithAccessRight
|
6
6
|
include Hydra::WithDepositor # for access to apply_depositor_metadata
|
7
|
-
include Hydra::AccessControls::Permissions
|
8
7
|
include Hyrax::CoreMetadata
|
9
8
|
include Hydra::Works::CollectionBehavior
|
10
9
|
include Hyrax::Noid
|
@@ -30,17 +29,17 @@ module Hyrax
|
|
30
29
|
validates :collection_type_gid, presence: true
|
31
30
|
|
32
31
|
# Need to define here in order to override setter defined by ActiveTriples
|
33
|
-
def collection_type_gid=(new_collection_type_gid)
|
32
|
+
def collection_type_gid=(new_collection_type_gid, force: false)
|
34
33
|
new_collection_type_gid = new_collection_type_gid&.to_s
|
35
|
-
raise "Can't modify collection type of this collection" if persisted? && !collection_type_gid_was.nil? && collection_type_gid_was != new_collection_type_gid
|
34
|
+
raise "Can't modify collection type of this collection" if !force && persisted? && !collection_type_gid_was.nil? && collection_type_gid_was != new_collection_type_gid
|
36
35
|
new_collection_type = Hyrax::CollectionType.find_by_gid!(new_collection_type_gid)
|
37
|
-
super
|
36
|
+
super(new_collection_type_gid)
|
38
37
|
@collection_type = new_collection_type
|
39
38
|
collection_type_gid
|
40
39
|
end
|
41
40
|
end
|
42
41
|
|
43
|
-
delegate(*Hyrax::CollectionType.
|
42
|
+
delegate(*Hyrax::CollectionType.settings_attributes, to: :collection_type)
|
44
43
|
|
45
44
|
# Get the collection_type when accessed
|
46
45
|
def collection_type
|
@@ -48,7 +47,7 @@ module Hyrax
|
|
48
47
|
end
|
49
48
|
|
50
49
|
def collection_type=(new_collection_type)
|
51
|
-
self.collection_type_gid = new_collection_type.
|
50
|
+
self.collection_type_gid = new_collection_type.to_global_id
|
52
51
|
end
|
53
52
|
|
54
53
|
# Add members using the members association.
|
@@ -61,8 +60,6 @@ module Hyrax
|
|
61
60
|
|
62
61
|
# Add member objects by adding this collection to the objects' member_of_collection association.
|
63
62
|
# @param [Enumerable<String>] the ids of the new child collections and works collection ids
|
64
|
-
# Valkyrie Version: Wings::CollectionBehavior#add_collections_and_works aliased to #add_member_objects
|
65
|
-
# lib/wings/models/concerns/collection_behavior.rb
|
66
63
|
def add_member_objects(new_member_ids)
|
67
64
|
Array(new_member_ids).collect do |member_id|
|
68
65
|
member = Hyrax.query_service.find_by_alternate_identifier(alternate_identifier: member_id, use_valkyrie: false)
|
@@ -78,16 +75,12 @@ module Hyrax
|
|
78
75
|
end
|
79
76
|
|
80
77
|
# @return [Enumerable<ActiveFedora::Base>] an enumerable over the children of this collection
|
81
|
-
# Valkyrie Version: Wings::CollectionBehavior#child_collections_and_works aliased to #member_objects
|
82
|
-
# lib/wings/models/concerns/collection_behavior.rb
|
83
78
|
def member_objects
|
84
79
|
ActiveFedora::Base.where("member_of_collection_ids_ssim:#{id}")
|
85
80
|
end
|
86
81
|
|
87
82
|
# Use this query to get the ids of the member objects (since the containment
|
88
83
|
# association has been flipped)
|
89
|
-
# Valkyrie Version: Wings::CollectionBehavior#child_collections_and_works_ids aliased to #member_object_ids
|
90
|
-
# lib/wings/models/concerns/collection_behavior.rb
|
91
84
|
def member_object_ids
|
92
85
|
return [] unless id
|
93
86
|
member_objects.map(&:id)
|
@@ -108,7 +101,8 @@ module Hyrax
|
|
108
101
|
end
|
109
102
|
|
110
103
|
def collection_type_gid_document_field_name
|
111
|
-
|
104
|
+
Deprecation.warn('use Hyrax.config.collection_type_index_field instead')
|
105
|
+
Hyrax.config.collection_type_index_field
|
112
106
|
end
|
113
107
|
end
|
114
108
|
|
@@ -14,8 +14,8 @@ module Hyrax
|
|
14
14
|
class_attribute :paranoid_edit_permissions
|
15
15
|
self.paranoid_edit_permissions =
|
16
16
|
[
|
17
|
-
{ key: :edit_groups, message: 'Public cannot have edit access', condition: ->(obj) { obj.edit_groups.include?(
|
18
|
-
{ key: :edit_groups, message: 'Registered cannot have edit access', condition: ->(obj) { obj.edit_groups.include?(
|
17
|
+
{ key: :edit_groups, message: 'Public cannot have edit access', condition: ->(obj) { obj.edit_groups.include?(::Ability.public_group_name) } },
|
18
|
+
{ key: :edit_groups, message: 'Registered cannot have edit access', condition: ->(obj) { obj.edit_groups.include?(::Ability.registered_group_name) } }
|
19
19
|
]
|
20
20
|
end
|
21
21
|
|
@@ -1,28 +1,39 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
module Hyrax
|
3
3
|
module SolrDocument
|
4
|
-
# TODO: aside from height and width, I don't think any of these other terms are indexed by default. - Justin 3/2016
|
5
4
|
module Characterization
|
5
|
+
##
|
6
|
+
# @todo this might not be indexed normally. deprecate?
|
6
7
|
def byte_order
|
7
8
|
self["byte_order_tesim"]
|
8
9
|
end
|
9
10
|
|
11
|
+
##
|
12
|
+
# @todo this might not be indexed normally. deprecate?
|
10
13
|
def capture_device
|
11
14
|
self["capture_device_tesim"]
|
12
15
|
end
|
13
16
|
|
17
|
+
##
|
18
|
+
# @todo this might not be indexed normally. deprecate?
|
14
19
|
def color_map
|
15
20
|
self["color_map_tesim"]
|
16
21
|
end
|
17
22
|
|
23
|
+
##
|
24
|
+
# @todo this might not be indexed normally. deprecate?
|
18
25
|
def color_space
|
19
26
|
self["color_space_tesim"]
|
20
27
|
end
|
21
28
|
|
29
|
+
##
|
30
|
+
# @todo this might not be indexed normally. deprecate?
|
22
31
|
def compression
|
23
32
|
self["compression_tesim"]
|
24
33
|
end
|
25
34
|
|
35
|
+
##
|
36
|
+
# @todo this might not be indexed normally. deprecate?
|
26
37
|
def gps_timestamp
|
27
38
|
self["gps_timestamp_tesim"]
|
28
39
|
end
|
@@ -31,30 +42,44 @@ module Hyrax
|
|
31
42
|
self['height_is']
|
32
43
|
end
|
33
44
|
|
45
|
+
##
|
46
|
+
# @todo this might not be indexed normally. deprecate?
|
34
47
|
def image_producer
|
35
48
|
self["image_producer_tesim"]
|
36
49
|
end
|
37
50
|
|
51
|
+
##
|
52
|
+
# @todo this might not be indexed normally. deprecate?
|
38
53
|
def latitude
|
39
54
|
self["latitude_tesim"]
|
40
55
|
end
|
41
56
|
|
57
|
+
##
|
58
|
+
# @todo this might not be indexed normally. deprecate?
|
42
59
|
def longitude
|
43
60
|
self["longitude_tesim"]
|
44
61
|
end
|
45
62
|
|
63
|
+
##
|
64
|
+
# @todo this might not be indexed normally. deprecate?
|
46
65
|
def orientation
|
47
66
|
self["orientation_tesim"]
|
48
67
|
end
|
49
68
|
|
69
|
+
##
|
70
|
+
# @todo this might not be indexed normally. deprecate?
|
50
71
|
def profile_name
|
51
72
|
self["profile_name_tesim"]
|
52
73
|
end
|
53
74
|
|
75
|
+
##
|
76
|
+
# @todo this might not be indexed normally. deprecate?
|
54
77
|
def profile_version
|
55
78
|
self["profile_version_tesim"]
|
56
79
|
end
|
57
80
|
|
81
|
+
##
|
82
|
+
# @todo this might not be indexed normally. deprecate?
|
58
83
|
def scanning_software
|
59
84
|
self["scanning_software_tesim"]
|
60
85
|
end
|
@@ -63,18 +88,24 @@ module Hyrax
|
|
63
88
|
self['width_is']
|
64
89
|
end
|
65
90
|
|
91
|
+
##
|
92
|
+
# @todo this might not be indexed normally. deprecate?
|
66
93
|
def format_label
|
67
94
|
self["format_label_tesim"]
|
68
95
|
end
|
69
96
|
|
70
97
|
def file_size
|
71
|
-
self["
|
98
|
+
self["file_size_lts"]
|
72
99
|
end
|
73
100
|
|
101
|
+
##
|
102
|
+
# @todo this might not be indexed normally. deprecate?
|
74
103
|
def filename
|
75
104
|
self["filename_tesim"]
|
76
105
|
end
|
77
106
|
|
107
|
+
##
|
108
|
+
# @todo this might not be indexed normally. deprecate?
|
78
109
|
def well_formed
|
79
110
|
self["well_formed_tesim"]
|
80
111
|
end
|
@@ -95,6 +126,8 @@ module Hyrax
|
|
95
126
|
self["sample_rate_tesim"]
|
96
127
|
end
|
97
128
|
|
129
|
+
##
|
130
|
+
# @todo this might not be indexed normally. deprecate?
|
98
131
|
def last_modified
|
99
132
|
self["last_modified_tesim"]
|
100
133
|
end
|
@@ -1,5 +1,17 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
module Hyrax
|
3
|
+
##
|
4
|
+
# @api public
|
5
|
+
#
|
6
|
+
# Hyrax extensions for +Blacklight+'s generated +SolrDocument+.
|
7
|
+
#
|
8
|
+
# @example using with +Blacklight::Solr::Document+
|
9
|
+
# class SolrDocument
|
10
|
+
# include Blacklight::Solr::Document
|
11
|
+
# include Hyrax::SolrDocumentBehavior
|
12
|
+
# end
|
13
|
+
#
|
14
|
+
# @see https://github.com/projectblacklight/blacklight/wiki/Understanding-Rails-and-Blacklight#models
|
3
15
|
module SolrDocumentBehavior
|
4
16
|
extend ActiveSupport::Concern
|
5
17
|
include Hydra::Works::MimeTypes
|
@@ -23,32 +35,51 @@ module Hyrax
|
|
23
35
|
id
|
24
36
|
end
|
25
37
|
|
26
|
-
def to_s
|
27
|
-
title_or_label
|
38
|
+
def to_s # rubocop:disable Rails/Delegate
|
39
|
+
title_or_label.to_s
|
28
40
|
end
|
29
41
|
|
42
|
+
##
|
43
|
+
# Given a model class and an +id+, provides +ActiveModel+ style model methods.
|
44
|
+
#
|
45
|
+
# @note access this via {SolrDocumentBehavior#to_model}.
|
30
46
|
class ModelWrapper
|
47
|
+
##
|
48
|
+
# @api private
|
49
|
+
#
|
50
|
+
# @param [Class] model
|
51
|
+
# @param [String, nil] id
|
31
52
|
def initialize(model, id)
|
32
53
|
@model = model
|
33
54
|
@id = id
|
34
55
|
end
|
35
56
|
|
57
|
+
##
|
58
|
+
# @api public
|
36
59
|
def persisted?
|
37
60
|
true
|
38
61
|
end
|
39
62
|
|
63
|
+
##
|
64
|
+
# @api public
|
40
65
|
def to_param
|
41
66
|
@id
|
42
67
|
end
|
43
68
|
|
69
|
+
##
|
70
|
+
# @api public
|
44
71
|
def model_name
|
45
72
|
@model.model_name
|
46
73
|
end
|
47
74
|
|
75
|
+
##
|
76
|
+
# @api public
|
48
77
|
def to_partial_path
|
49
78
|
@model._to_partial_path
|
50
79
|
end
|
51
80
|
|
81
|
+
##
|
82
|
+
# @api public
|
52
83
|
def to_global_id
|
53
84
|
URI::GID.build app: GlobalID.app, model_name: model_name.name, model_id: @id
|
54
85
|
end
|
@@ -81,8 +112,9 @@ module Hyrax
|
|
81
112
|
end
|
82
113
|
|
83
114
|
# Method to return the model
|
84
|
-
def hydra_model
|
85
|
-
"::#{first('has_model_ssim')}".safe_constantize
|
115
|
+
def hydra_model(classifier: ActiveFedora.model_mapper)
|
116
|
+
"::#{first('has_model_ssim')}".safe_constantize ||
|
117
|
+
classifier.classifier(self).best_model
|
86
118
|
end
|
87
119
|
|
88
120
|
def depositor(default = '')
|
@@ -110,7 +142,7 @@ module Hyrax
|
|
110
142
|
end
|
111
143
|
|
112
144
|
def collection_type_gid
|
113
|
-
first(
|
145
|
+
first(Hyrax.config.collection_type_index_field)
|
114
146
|
end
|
115
147
|
end
|
116
148
|
end
|
@@ -7,10 +7,14 @@ module Hyrax
|
|
7
7
|
# Build a changeset class for the given resource class. The ChangeSet will
|
8
8
|
# have fields to match the resource class given.
|
9
9
|
#
|
10
|
+
# To define a custom changeset with validations, use naming convention with "ChangeSet" appended to the end
|
11
|
+
# of the resource class name. (e.g. for BookResource, name the change set BookResourceChangeSet)
|
12
|
+
#
|
10
13
|
# @example
|
11
14
|
# Hyrax::ChangeSet(Monograph)
|
12
15
|
def self.ChangeSet(resource_class)
|
13
|
-
|
16
|
+
klass = (resource_class.to_s + "ChangeSet").safe_constantize || Hyrax::ChangeSet
|
17
|
+
Class.new(klass) do
|
14
18
|
(resource_class.fields - resource_class.reserved_attributes).each do |field|
|
15
19
|
property field, default: nil
|
16
20
|
end
|
@@ -1,6 +1,14 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
module Hyrax
|
3
|
-
class CollectionType < ActiveRecord::Base
|
3
|
+
class CollectionType < ActiveRecord::Base # rubocop:disable Metrics/ClassLength
|
4
|
+
# @!method id
|
5
|
+
# @return [Integer]
|
6
|
+
# @!method description
|
7
|
+
# @return [String]
|
8
|
+
# @!method machine_id
|
9
|
+
# @return [String]
|
10
|
+
# @!method title
|
11
|
+
# @return [String]
|
4
12
|
self.table_name = 'hyrax_collection_types'
|
5
13
|
validates :title, presence: true, uniqueness: true
|
6
14
|
validates :machine_id, presence: true, uniqueness: true
|
@@ -10,21 +18,31 @@ module Hyrax
|
|
10
18
|
before_destroy :ensure_no_collections
|
11
19
|
has_many :collection_type_participants, class_name: 'Hyrax::CollectionTypeParticipant', foreign_key: 'hyrax_collection_type_id', dependent: :destroy
|
12
20
|
|
21
|
+
SETTINGS_ATTRIBUTES = # these need to updated in tandem with database migrations, use `.settings_attributes`
|
22
|
+
[:nestable?, :discoverable?, :brandable?, :sharable?, :share_applies_to_new_works?, :allow_multiple_membership?,
|
23
|
+
:require_membership?, :assigns_workflow?, :assigns_visibility?].freeze
|
24
|
+
|
13
25
|
USER_COLLECTION_MACHINE_ID = 'user_collection'
|
14
26
|
USER_COLLECTION_DEFAULT_TITLE = I18n.t('hyrax.collection_type.default_title', default: 'User Collection').freeze
|
15
27
|
|
16
28
|
ADMIN_SET_MACHINE_ID = 'admin_set'
|
17
29
|
ADMIN_SET_DEFAULT_TITLE = I18n.t('hyrax.collection_type.admin_set_title', default: 'Admin Set').freeze
|
18
30
|
|
31
|
+
##
|
32
|
+
# @note mints a #machine_id (?!)
|
33
|
+
# @return [void]
|
19
34
|
def title=(value)
|
20
35
|
super
|
21
36
|
assign_machine_id
|
22
37
|
end
|
23
38
|
|
39
|
+
# this class attribute is deprecated in favor of {.settings_attributes}
|
40
|
+
# these need to carefully align with boolean flag attributes/table columns,
|
41
|
+
# so making it settable is a liability. deprecating is challenging because
|
42
|
+
# +class_attribute+ calls +singleton_class.class_eval { redefine_method }+
|
43
|
+
# as the +name=+ implementation. there should be few callers outside hyrax.
|
24
44
|
class_attribute :collection_type_settings_methods, instance_writer: false
|
25
|
-
self.collection_type_settings_methods =
|
26
|
-
:allow_multiple_membership?, :require_membership?, :assigns_workflow?,
|
27
|
-
:assigns_visibility?]
|
45
|
+
self.collection_type_settings_methods = SETTINGS_ATTRIBUTES
|
28
46
|
|
29
47
|
# These are provided as a convenience method based on prior design discussions.
|
30
48
|
alias_attribute :discovery, :discoverable
|
@@ -39,15 +57,15 @@ module Hyrax
|
|
39
57
|
# @return [Hyrax::CollectionType] if record matching gid is found, an instance of Hyrax::CollectionType with id = the model_id portion of the gid (e.g. 3)
|
40
58
|
# @return [False] if record matching gid is not found
|
41
59
|
def self.find_by_gid(gid)
|
42
|
-
|
60
|
+
find_by_gid!(gid)
|
43
61
|
rescue ActiveRecord::RecordNotFound, URI::InvalidURIError
|
44
62
|
false
|
45
63
|
end
|
46
64
|
|
47
65
|
# Return an array of global identifiers for collection types that do not allow multiple membership.
|
48
66
|
# @return [Array<String>] an array of Global Identifiers
|
49
|
-
# @see
|
50
|
-
# @see Hyrax::MultipleMembershipChecker
|
67
|
+
# @see #gid
|
68
|
+
# @see Hyrax::MultipleMembershipChecker
|
51
69
|
def self.gids_that_do_not_allow_multiple_membership
|
52
70
|
where(allow_multiple_membership: false).map(&:gid)
|
53
71
|
end
|
@@ -57,22 +75,44 @@ module Hyrax
|
|
57
75
|
# @return [Hyrax::CollectionType] an instance of Hyrax::CollectionType with id = the model_id portion of the gid (e.g. 3)
|
58
76
|
# @raise [ActiveRecord::RecordNotFound] if record matching gid is not found
|
59
77
|
def self.find_by_gid!(gid)
|
60
|
-
|
61
|
-
|
78
|
+
raise(URI::InvalidURIError) if gid.nil?
|
79
|
+
GlobalID::Locator.locate(gid)
|
80
|
+
rescue NameError
|
81
|
+
Rails.logger.warn "#{self.class}##{__method__} called with #{gid}, which is " \
|
82
|
+
"a legacy collection type global id format. If this " \
|
83
|
+
"collection type gid is attached to a collection in " \
|
84
|
+
"your repository you'll want to run " \
|
85
|
+
"`hyrax:collections:update_collection_type_global_ids` to " \
|
86
|
+
"update references. see: https://github.com/samvera/hyrax/issues/4696"
|
87
|
+
find(GlobalID.new(gid).model_id)
|
88
|
+
end
|
89
|
+
|
90
|
+
##
|
91
|
+
# @note this replaces the deprecated +.collection_type_settings_methods+
|
92
|
+
# @return [Array<Symbol>] the predicates for collection type settings flags
|
93
|
+
# (e.g. {#nestable?})
|
94
|
+
def self.settings_attributes
|
95
|
+
SETTINGS_ATTRIBUTES
|
62
96
|
end
|
63
97
|
|
98
|
+
##
|
99
|
+
# @deprecation use #to_global_id
|
100
|
+
#
|
64
101
|
# Return the Global Identifier for this collection type.
|
65
|
-
# @return [String] Global Identifier (gid) for this collection_type (e.g. gid://internal/hyrax-collectiontype/3)
|
102
|
+
# @return [String, nil] Global Identifier (gid) for this collection_type (e.g. gid://internal/hyrax-collectiontype/3)
|
103
|
+
#
|
104
|
+
# @see https://github.com/rails/globalid#usage
|
66
105
|
def gid
|
67
|
-
|
106
|
+
Deprecation.warn('use #to_global_id.')
|
107
|
+
to_global_id.to_s if id
|
68
108
|
end
|
69
109
|
|
70
110
|
##
|
71
111
|
# @return [Enumerable<Collection, PcdmCollection>]
|
72
112
|
def collections(use_valkyrie: false)
|
73
|
-
return [] unless
|
74
|
-
return Hyrax.custom_queries.find_collections_by_type(global_id:
|
75
|
-
ActiveFedora::Base.where(
|
113
|
+
return [] unless id
|
114
|
+
return Hyrax.custom_queries.find_collections_by_type(global_id: to_global_id) if use_valkyrie
|
115
|
+
ActiveFedora::Base.where(Hyrax.config.collection_type_index_field.to_sym => to_global_id.to_s)
|
76
116
|
end
|
77
117
|
|
78
118
|
##
|
@@ -127,7 +167,6 @@ module Hyrax
|
|
127
167
|
private
|
128
168
|
|
129
169
|
def assign_machine_id
|
130
|
-
# FIXME: This method allows for the possibility of collisions
|
131
170
|
self.machine_id ||= title.parameterize.underscore.to_sym if title.present?
|
132
171
|
end
|
133
172
|
|
@@ -138,15 +177,13 @@ module Hyrax
|
|
138
177
|
end
|
139
178
|
|
140
179
|
def ensure_no_settings_changes_for_admin_set_type
|
141
|
-
return true unless admin_set? && exists_for_machine_id?(ADMIN_SET_MACHINE_ID)
|
142
|
-
return true unless collection_type_settings_changed?
|
180
|
+
return true unless admin_set? && collection_type_settings_changed? && exists_for_machine_id?(ADMIN_SET_MACHINE_ID)
|
143
181
|
errors[:base] << I18n.t('hyrax.admin.collection_types.errors.no_settings_change_for_admin_sets')
|
144
182
|
throw :abort
|
145
183
|
end
|
146
184
|
|
147
185
|
def ensure_no_settings_changes_for_user_collection_type
|
148
|
-
return true unless user_collection? && exists_for_machine_id?(USER_COLLECTION_MACHINE_ID)
|
149
|
-
return true unless collection_type_settings_changed?
|
186
|
+
return true unless user_collection? && collection_type_settings_changed? && exists_for_machine_id?(USER_COLLECTION_MACHINE_ID)
|
150
187
|
errors[:base] << I18n.t('hyrax.admin.collection_types.errors.no_settings_change_for_user_collections')
|
151
188
|
throw :abort
|
152
189
|
end
|
@@ -159,12 +196,12 @@ module Hyrax
|
|
159
196
|
end
|
160
197
|
|
161
198
|
def collection_type_settings_changed?
|
162
|
-
(changes.keys & ['nestable', 'brandable', 'discoverable', 'sharable', 'share_applies_to_new_works',
|
163
|
-
'require_membership', 'assigns_workflow', 'assigns_visibility']).any?
|
199
|
+
(changes.keys & ['nestable', 'brandable', 'discoverable', 'sharable', 'share_applies_to_new_works',
|
200
|
+
'allow_multiple_membership', 'require_membership', 'assigns_workflow', 'assigns_visibility']).any?
|
164
201
|
end
|
165
202
|
|
166
203
|
def exists_for_machine_id?(machine_id)
|
167
204
|
self.class.exists?(machine_id: machine_id)
|
168
205
|
end
|
169
|
-
end
|
206
|
+
end # rubocop:enable Metrics/ClassLength
|
170
207
|
end
|