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
@@ -39,20 +39,29 @@ module Hyrax
|
|
39
39
|
|
40
40
|
def presenter
|
41
41
|
@presenter ||= begin
|
42
|
-
# Query Solr for the collection.
|
43
|
-
# run the solr query to find the collection members
|
44
|
-
response = repository.search(single_item_search_builder.query)
|
45
|
-
curation_concern = response.documents.first
|
46
|
-
raise CanCan::AccessDenied unless curation_concern
|
47
42
|
presenter_class.new(curation_concern, current_ability)
|
48
43
|
end
|
49
44
|
end
|
50
45
|
|
46
|
+
def curation_concern
|
47
|
+
# Query Solr for the collection.
|
48
|
+
# run the solr query to find the collection members
|
49
|
+
response, _docs = search_service.search_results
|
50
|
+
curation_concern = response.documents.first
|
51
|
+
raise CanCan::AccessDenied unless curation_concern
|
52
|
+
curation_concern
|
53
|
+
end
|
54
|
+
|
55
|
+
def search_service
|
56
|
+
Hyrax::SearchService.new(config: blacklight_config, user_params: params.except(:q, :page), scope: self, search_builder_class: single_item_search_builder_class)
|
57
|
+
end
|
58
|
+
|
51
59
|
# Instantiates the search builder that builds a query for a single item
|
52
60
|
# this is useful in the show view.
|
53
61
|
def single_item_search_builder
|
54
|
-
|
62
|
+
search_service.search_builder
|
55
63
|
end
|
64
|
+
deprecation_deprecate :single_item_search_builder
|
56
65
|
|
57
66
|
def collection_params
|
58
67
|
form_class.model_attributes(params[:collection])
|
@@ -11,11 +11,12 @@ module Hyrax
|
|
11
11
|
with_themed_layout :decide_layout
|
12
12
|
copy_blacklight_config_from(::CatalogController)
|
13
13
|
|
14
|
-
class_attribute :_curation_concern_type, :show_presenter, :work_form_service, :search_builder_class
|
14
|
+
class_attribute :_curation_concern_type, :show_presenter, :work_form_service, :search_builder_class
|
15
|
+
class_attribute :iiif_manifest_builder, instance_accessor: false
|
15
16
|
self.show_presenter = Hyrax::WorkShowPresenter
|
16
17
|
self.work_form_service = Hyrax::WorkFormService
|
17
18
|
self.search_builder_class = WorkSearchBuilder
|
18
|
-
self.iiif_manifest_builder =
|
19
|
+
self.iiif_manifest_builder = nil
|
19
20
|
attr_accessor :curation_concern
|
20
21
|
helper_method :curation_concern, :contextual_path
|
21
22
|
|
@@ -53,12 +54,17 @@ module Hyrax
|
|
53
54
|
end
|
54
55
|
|
55
56
|
def create
|
57
|
+
# Caching the original input params in case the form is not valid
|
58
|
+
original_input_params_for_form = params[hash_key_for_curation_concern].deep_dup
|
56
59
|
if create_work
|
57
60
|
after_create_response
|
58
61
|
else
|
59
62
|
respond_to do |wants|
|
60
63
|
wants.html do
|
61
64
|
build_form
|
65
|
+
# Creating a form object that can re-render most of the
|
66
|
+
# submitted parameters
|
67
|
+
@form = Hyrax::Forms::FailedSubmissionFormWrapper.new(form: @form, input_params: original_input_params_for_form)
|
62
68
|
render 'new', status: :unprocessable_entity
|
63
69
|
end
|
64
70
|
wants.json { render_json_response(response_type: :unprocessable_entity, options: { errors: curation_concern.errors }) }
|
@@ -137,12 +143,13 @@ module Hyrax
|
|
137
143
|
private
|
138
144
|
|
139
145
|
def iiif_manifest_builder
|
140
|
-
self.class.iiif_manifest_builder
|
146
|
+
self.class.iiif_manifest_builder ||
|
147
|
+
(Flipflop.cache_work_iiif_manifest? ? Hyrax::CachingIiifManifestBuilder.new : Hyrax::ManifestBuilderService.new)
|
141
148
|
end
|
142
149
|
|
143
150
|
def iiif_manifest_presenter
|
144
151
|
IiifManifestPresenter.new(search_result_document(id: params[:id])).tap do |p|
|
145
|
-
p.hostname = request.
|
152
|
+
p.hostname = request.base_url
|
146
153
|
p.ability = current_ability
|
147
154
|
end
|
148
155
|
end
|
@@ -182,8 +189,12 @@ module Hyrax
|
|
182
189
|
else
|
183
190
|
form = build_form
|
184
191
|
|
185
|
-
@curation_concern =
|
186
|
-
|
192
|
+
@curation_concern =
|
193
|
+
form.validate(params[hash_key_for_curation_concern]) &&
|
194
|
+
transactions['change_set.create_work']
|
195
|
+
.with_step_args('work_resource.add_file_sets' => { uploaded_files: uploaded_files },
|
196
|
+
'change_set.set_user_as_depositor' => { user: current_user })
|
197
|
+
.call(form).value!
|
187
198
|
end
|
188
199
|
end
|
189
200
|
|
@@ -194,8 +205,11 @@ module Hyrax
|
|
194
205
|
else
|
195
206
|
form = build_form
|
196
207
|
|
197
|
-
@curation_concern =
|
198
|
-
|
208
|
+
@curation_concern =
|
209
|
+
form.validate(params[hash_key_for_curation_concern]) &&
|
210
|
+
transactions['change_set.update_work']
|
211
|
+
.with_step_args('work_resource.add_file_sets' => { uploaded_files: uploaded_files })
|
212
|
+
.call(form).value!
|
199
213
|
end
|
200
214
|
end
|
201
215
|
|
@@ -237,37 +251,37 @@ module Hyrax
|
|
237
251
|
search_result_document(search_params)
|
238
252
|
end
|
239
253
|
|
254
|
+
##
|
240
255
|
# Only returns unsuppressed documents the user has read access to
|
241
256
|
#
|
242
257
|
# @api public
|
243
258
|
#
|
244
259
|
# @param search_params [ActionController::Parameters] this should
|
245
|
-
#
|
246
|
-
#
|
260
|
+
# include an :id key, but based on implementation and use of the
|
261
|
+
# WorkSearchBuilder, it need not.
|
247
262
|
#
|
248
263
|
# @return [SolrDocument]
|
249
264
|
#
|
250
|
-
#
|
251
265
|
# @raise [WorkflowAuthorizationException] when the object is not
|
252
|
-
#
|
253
|
-
#
|
254
|
-
#
|
266
|
+
# found via the search builder's search logic BUT the object is
|
267
|
+
# suppressed AND the user can read it (Yeah, it's confusing but
|
268
|
+
# after a lot of debugging that's the logic)
|
255
269
|
#
|
256
270
|
# @raise [CanCan::AccessDenied] when the object is not found via
|
257
|
-
#
|
258
|
-
#
|
259
|
-
|
271
|
+
# the search builder's search logic BUT the object is not
|
272
|
+
# supressed OR not readable by the user (Yeah.)
|
273
|
+
#
|
260
274
|
# @note This is Jeremy, I have suspicions about the first line of
|
261
|
-
#
|
262
|
-
#
|
263
|
-
#
|
264
|
-
#
|
265
|
-
#
|
266
|
-
#
|
267
|
-
#
|
268
|
-
#
|
275
|
+
# this comment (eg, "Only return unsuppressed..."). The
|
276
|
+
# reason is that I've encounter situations in the specs
|
277
|
+
# where the document_list is empty but if I then query Solr
|
278
|
+
# for the object by ID, I get a document that is NOT
|
279
|
+
# suppressed AND can be read. In other words, I believe
|
280
|
+
# there is more going on in the search_results method
|
281
|
+
# (e.g. a filter is being applied that is beyond what the
|
282
|
+
# comment indicates)
|
269
283
|
#
|
270
|
-
# @see
|
284
|
+
# @see #document_not_found!
|
271
285
|
def search_result_document(search_params)
|
272
286
|
_, document_list = search_results(search_params)
|
273
287
|
return document_list.first unless document_list.empty?
|
@@ -356,10 +370,8 @@ module Hyrax
|
|
356
370
|
end
|
357
371
|
|
358
372
|
def after_update_response
|
359
|
-
if
|
360
|
-
|
361
|
-
return redirect_to main_app.confirm_hyrax_permission_path(curation_concern) if curation_concern.visibility_changed?
|
362
|
-
end
|
373
|
+
return redirect_to hyrax.confirm_access_permission_path(curation_concern) if permissions_changed? && concern_has_file_sets?
|
374
|
+
|
363
375
|
respond_to do |wants|
|
364
376
|
wants.html { redirect_to [main_app, curation_concern], notice: "Work \"#{curation_concern}\" successfully updated." }
|
365
377
|
wants.json { render :show, status: :ok, location: polymorphic_path([main_app, curation_concern]) }
|
@@ -392,7 +404,26 @@ module Hyrax
|
|
392
404
|
end
|
393
405
|
|
394
406
|
def permissions_changed?
|
395
|
-
@saved_permissions !=
|
407
|
+
@saved_permissions !=
|
408
|
+
case curation_concern
|
409
|
+
when ActiveFedora::Base
|
410
|
+
curation_concern.permissions.map(&:to_hash)
|
411
|
+
else
|
412
|
+
Hyrax::AccessControl.for(resource: curation_concern).permissions
|
413
|
+
end
|
414
|
+
end
|
415
|
+
|
416
|
+
def concern_has_file_sets?
|
417
|
+
case curation_concern
|
418
|
+
when ActiveFedora::Common
|
419
|
+
curation_concern.file_sets.present?
|
420
|
+
else
|
421
|
+
Hyrax.custom_queries.find_child_fileset_ids(resource: curation_concern).any?
|
422
|
+
end
|
423
|
+
end
|
424
|
+
|
425
|
+
def uploaded_files
|
426
|
+
UploadedFile.find(params.fetch(:uploaded_files, []))
|
396
427
|
end
|
397
428
|
end
|
398
429
|
end
|
@@ -5,6 +5,11 @@ module Hyrax
|
|
5
5
|
class CollectionsController < Hyrax::My::CollectionsController
|
6
6
|
include Blacklight::AccessControls::Catalog
|
7
7
|
include Blacklight::Base
|
8
|
+
|
9
|
+
configure_blacklight do |config|
|
10
|
+
config.search_builder_class = Hyrax::Dashboard::CollectionsSearchBuilder
|
11
|
+
end
|
12
|
+
|
8
13
|
include BreadcrumbsForCollections
|
9
14
|
with_themed_layout 'dashboard'
|
10
15
|
|
@@ -55,7 +60,7 @@ module Hyrax
|
|
55
60
|
# Coming from the UI, a collection type id should always be present. Coming from the API, if a collection type id is not specified,
|
56
61
|
# use the default collection type (provides backward compatibility with versions < Hyrax 2.1.0)
|
57
62
|
collection_type_id = params[:collection_type_id].presence || default_collection_type.id
|
58
|
-
@collection.collection_type_gid = CollectionType.find(collection_type_id).
|
63
|
+
@collection.collection_type_gid = CollectionType.find(collection_type_id).to_global_id
|
59
64
|
add_breadcrumb t(:'hyrax.controls.home'), root_path
|
60
65
|
add_breadcrumb t(:'hyrax.dashboard.breadcrumbs.admin'), hyrax.dashboard_path
|
61
66
|
add_breadcrumb t('.header', type_title: @collection.collection_type.title), request.path
|
@@ -106,7 +111,7 @@ module Hyrax
|
|
106
111
|
authorize! :create, @collection
|
107
112
|
# Coming from the UI, a collection type gid should always be present. Coming from the API, if a collection type gid is not specified,
|
108
113
|
# use the default collection type (provides backward compatibility with versions < Hyrax 2.1.0)
|
109
|
-
@collection.collection_type_gid = params[:collection_type_gid].presence || default_collection_type.
|
114
|
+
@collection.collection_type_gid = params[:collection_type_gid].presence || default_collection_type.to_global_id
|
110
115
|
@collection.attributes = collection_params.except(:members, :parent_id, :collection_type_gid)
|
111
116
|
@collection.apply_depositor_metadata(current_user.user_key)
|
112
117
|
add_members_to_collection unless batch.empty?
|
@@ -192,10 +197,6 @@ module Hyrax
|
|
192
197
|
render json: result
|
193
198
|
end
|
194
199
|
|
195
|
-
def search_builder_class
|
196
|
-
Hyrax::Dashboard::CollectionsSearchBuilder
|
197
|
-
end
|
198
|
-
|
199
200
|
private
|
200
201
|
|
201
202
|
def default_collection_type
|
@@ -315,20 +316,29 @@ module Hyrax
|
|
315
316
|
|
316
317
|
def presenter
|
317
318
|
@presenter ||= begin
|
318
|
-
# Query Solr for the collection.
|
319
|
-
# run the solr query to find the collection members
|
320
|
-
response = repository.search(single_item_search_builder.query)
|
321
|
-
curation_concern = response.documents.first
|
322
|
-
raise CanCan::AccessDenied unless curation_concern
|
323
319
|
presenter_class.new(curation_concern, current_ability)
|
324
320
|
end
|
325
321
|
end
|
326
322
|
|
323
|
+
def curation_concern
|
324
|
+
# Query Solr for the collection.
|
325
|
+
# run the solr query to find the collection members
|
326
|
+
response, _docs = single_item_search_service.search_results
|
327
|
+
curation_concern = response.documents.first
|
328
|
+
raise CanCan::AccessDenied unless curation_concern
|
329
|
+
curation_concern
|
330
|
+
end
|
331
|
+
|
332
|
+
def single_item_search_service
|
333
|
+
Hyrax::SearchService.new(config: blacklight_config, user_params: params.except(:q, :page), scope: self, search_builder_class: single_item_search_builder_class)
|
334
|
+
end
|
335
|
+
|
327
336
|
# Instantiates the search builder that builds a query for a single item
|
328
337
|
# this is useful in the show view.
|
329
338
|
def single_item_search_builder
|
330
|
-
|
339
|
+
search_service.search_builder
|
331
340
|
end
|
341
|
+
deprecation_deprecate :single_item_search_builder
|
332
342
|
|
333
343
|
def collection_params
|
334
344
|
@participants = extract_old_style_permission_attributes(params[:collection])
|
@@ -3,10 +3,9 @@ module Hyrax
|
|
3
3
|
module Dashboard
|
4
4
|
## Shows a list of all works to the admins
|
5
5
|
class WorksController < Hyrax::My::WorksController
|
6
|
-
#
|
7
|
-
|
8
|
-
|
9
|
-
Hyrax::Dashboard::WorksSearchBuilder
|
6
|
+
# Define collection specific filter facets.
|
7
|
+
configure_blacklight do |config|
|
8
|
+
config.search_builder_class = Hyrax::Dashboard::WorksSearchBuilder
|
10
9
|
end
|
11
10
|
|
12
11
|
private
|
@@ -14,6 +14,10 @@ module Hyrax
|
|
14
14
|
|
15
15
|
helper_method :curation_concern
|
16
16
|
copy_blacklight_config_from(::CatalogController)
|
17
|
+
# Define collection specific filter facets.
|
18
|
+
configure_blacklight do |config|
|
19
|
+
config.search_builder_class = Hyrax::FileSetSearchBuilder
|
20
|
+
end
|
17
21
|
|
18
22
|
class_attribute :show_presenter, :form_class
|
19
23
|
self.show_presenter = Hyrax::FileSetPresenter
|
@@ -135,16 +139,11 @@ module Hyrax
|
|
135
139
|
when 'edit'
|
136
140
|
add_breadcrumb I18n.t("hyrax.file_set.browse_view"), main_app.hyrax_file_set_path(params["id"])
|
137
141
|
when 'show'
|
138
|
-
add_breadcrumb presenter.parent.to_s, main_app.polymorphic_path(presenter.parent)
|
142
|
+
add_breadcrumb presenter.parent.to_s, main_app.polymorphic_path(presenter.parent) if presenter.parent.present?
|
139
143
|
add_breadcrumb presenter.to_s, main_app.polymorphic_path(presenter)
|
140
144
|
end
|
141
145
|
end
|
142
146
|
|
143
|
-
# Override of Blacklight::RequestBuilders
|
144
|
-
def search_builder_class
|
145
|
-
Hyrax::FileSetSearchBuilder
|
146
|
-
end
|
147
|
-
|
148
147
|
def initialize_edit_form
|
149
148
|
@parent = @file_set.in_objects.first
|
150
149
|
original = @file_set.original_file
|
@@ -162,13 +161,23 @@ module Hyrax
|
|
162
161
|
|
163
162
|
def presenter
|
164
163
|
@presenter ||= begin
|
165
|
-
|
166
|
-
curation_concern = document_list.first
|
167
|
-
raise CanCan::AccessDenied unless curation_concern
|
168
|
-
show_presenter.new(curation_concern, current_ability, request)
|
164
|
+
show_presenter.new(curation_concern_document, current_ability, request)
|
169
165
|
end
|
170
166
|
end
|
171
167
|
|
168
|
+
def curation_concern_document
|
169
|
+
# Query Solr for the collection.
|
170
|
+
# run the solr query to find the collection members
|
171
|
+
response, _docs = single_item_search_service.search_results
|
172
|
+
curation_concern = response.documents.first
|
173
|
+
raise CanCan::AccessDenied unless curation_concern
|
174
|
+
curation_concern
|
175
|
+
end
|
176
|
+
|
177
|
+
def single_item_search_service
|
178
|
+
Hyrax::SearchService.new(config: blacklight_config, user_params: params.except(:q, :page), scope: self, search_builder_class: search_builder_class)
|
179
|
+
end
|
180
|
+
|
172
181
|
def wants_to_revert?
|
173
182
|
params.key?(:revision) && params[:revision] != curation_concern.latest_content_version.label
|
174
183
|
end
|
@@ -5,12 +5,6 @@ class Hyrax::HomepageController < ApplicationController
|
|
5
5
|
include Blacklight::SearchHelper
|
6
6
|
include Blacklight::AccessControls::Catalog
|
7
7
|
|
8
|
-
# The search builder for finding recent documents
|
9
|
-
# Override of Blacklight::RequestBuilders
|
10
|
-
def search_builder_class
|
11
|
-
Hyrax::HomepageSearchBuilder
|
12
|
-
end
|
13
|
-
|
14
8
|
class_attribute :presenter_class
|
15
9
|
self.presenter_class = Hyrax::HomepagePresenter
|
16
10
|
layout 'homepage'
|
@@ -29,21 +23,27 @@ class Hyrax::HomepageController < ApplicationController
|
|
29
23
|
|
30
24
|
# Return 5 collections
|
31
25
|
def collections(rows: 5)
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
response.documents
|
26
|
+
Hyrax::CollectionsService.new(self).search_results do |builder|
|
27
|
+
builder.rows(rows)
|
28
|
+
end
|
36
29
|
rescue Blacklight::Exceptions::ECONNREFUSED, Blacklight::Exceptions::InvalidRequest
|
37
30
|
[]
|
38
31
|
end
|
39
32
|
|
40
33
|
def recent
|
41
34
|
# grab any recent documents
|
42
|
-
(_, @recent_documents) = search_results
|
35
|
+
(_, @recent_documents) = search_service.search_results do |builder|
|
36
|
+
builder.rows(4)
|
37
|
+
builder.merge(sort: sort_field)
|
38
|
+
end
|
43
39
|
rescue Blacklight::Exceptions::ECONNREFUSED, Blacklight::Exceptions::InvalidRequest
|
44
40
|
@recent_documents = []
|
45
41
|
end
|
46
42
|
|
43
|
+
def search_service
|
44
|
+
Hyrax::SearchService.new(config: blacklight_config, user_params: { q: '' }, scope: self, search_builder_class: Hyrax::HomepageSearchBuilder)
|
45
|
+
end
|
46
|
+
|
47
47
|
def sort_field
|
48
48
|
"date_uploaded_dtsi desc"
|
49
49
|
end
|
@@ -2,13 +2,16 @@
|
|
2
2
|
module Hyrax
|
3
3
|
module My
|
4
4
|
class CollectionsController < MyController
|
5
|
+
configure_blacklight do |config|
|
6
|
+
config.search_builder_class = Hyrax::My::CollectionsSearchBuilder
|
7
|
+
end
|
5
8
|
# Define collection specific filter facets.
|
6
9
|
def self.configure_facets
|
7
10
|
configure_blacklight do |config|
|
8
11
|
# Name of pivot facet must match field name that uses helper_method
|
9
|
-
config.add_facet_field
|
12
|
+
config.add_facet_field Hyrax.config.collection_type_index_field,
|
10
13
|
helper_method: :collection_type_label, limit: 5,
|
11
|
-
pivot: ['has_model_ssim',
|
14
|
+
pivot: ['has_model_ssim', Hyrax.config.collection_type_index_field],
|
12
15
|
label: I18n.t('hyrax.dashboard.my.heading.collection_type')
|
13
16
|
# This causes AdminSets to also be shown with the Collection Type label
|
14
17
|
config.add_facet_field 'has_model_ssim',
|
@@ -18,10 +21,6 @@ module Hyrax
|
|
18
21
|
end
|
19
22
|
configure_facets
|
20
23
|
|
21
|
-
def search_builder_class
|
22
|
-
Hyrax::My::CollectionsSearchBuilder
|
23
|
-
end
|
24
|
-
|
25
24
|
def index
|
26
25
|
add_breadcrumb t(:'hyrax.controls.home'), root_path
|
27
26
|
add_breadcrumb t(:'hyrax.dashboard.breadcrumbs.admin'), hyrax.dashboard_path
|
@@ -2,9 +2,8 @@
|
|
2
2
|
module Hyrax
|
3
3
|
module My
|
4
4
|
class HighlightsController < MyController
|
5
|
-
|
6
|
-
|
7
|
-
Hyrax::My::HighlightsSearchBuilder
|
5
|
+
configure_blacklight do |config|
|
6
|
+
config.search_builder_class = Hyrax::My::HighlightsSearchBuilder
|
8
7
|
end
|
9
8
|
|
10
9
|
def index
|
@@ -2,9 +2,8 @@
|
|
2
2
|
module Hyrax
|
3
3
|
module My
|
4
4
|
class SharesController < MyController
|
5
|
-
|
6
|
-
|
7
|
-
Hyrax::My::SharesSearchBuilder
|
5
|
+
configure_blacklight do |config|
|
6
|
+
config.search_builder_class = Hyrax::My::SharesSearchBuilder
|
8
7
|
end
|
9
8
|
|
10
9
|
def index
|