hyrax 5.0.0.rc2 → 5.0.0
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 +14 -0
- data/.dassie/app/listeners/hyrax_listener.rb +81 -0
- data/.dassie/config/environments/test.rb +0 -5
- data/.dassie/config/initializers/hyrax.rb +5 -0
- data/.dassie/config/initializers/publisher.rb +3 -0
- data/.dassie/config/initializers/riiif.rb +77 -0
- data/.gitignore +4 -0
- data/.koppie/.env +2 -2
- data/.koppie/app/forms/collection_resource_form.rb +1 -0
- data/.koppie/app/indexers/collection_resource_indexer.rb +1 -0
- data/.koppie/app/listeners/hyrax_listener.rb +81 -0
- data/.koppie/app/models/collection.rb +1 -1
- data/.koppie/app/models/collection_resource.rb +1 -0
- data/.koppie/config/analytics.yml +5 -5
- data/.koppie/config/initializers/publisher.rb +3 -0
- data/.koppie/config/initializers/riiif.rb +78 -0
- data/.koppie/config/metadata/collection_resource.yaml +8 -166
- data/.koppie/config/metadata/sample_metadata.yaml +4 -0
- data/CONTAINERS.md +39 -2
- data/Dockerfile +14 -11
- data/Gemfile +8 -7
- data/README.md +2 -0
- data/app/actors/hyrax/actors/base_actor.rb +6 -3
- data/app/actors/hyrax/actors/file_actor.rb +1 -1
- data/app/actors/hyrax/actors/lease_actor.rb +3 -6
- data/app/assets/javascripts/hyrax/save_work/uploaded_files.es6 +10 -2
- data/app/assets/stylesheets/hyrax/sidebar.scss +6 -1
- data/app/controllers/concerns/hyrax/collections_controller_behavior.rb +1 -1
- data/app/controllers/concerns/hyrax/local_file_downloads_controller_behavior.rb +12 -19
- data/app/controllers/concerns/hyrax/stream_file_downloads_controller_behavior.rb +54 -0
- data/app/controllers/concerns/hyrax/valkyrie_downloads_controller_behavior.rb +38 -9
- data/app/controllers/concerns/hyrax/works_controller_behavior.rb +19 -14
- data/app/controllers/hyrax/admin/admin_sets_controller.rb +2 -2
- data/app/controllers/hyrax/admin/analytics/work_reports_controller.rb +5 -5
- data/app/controllers/hyrax/dashboard/collections_controller.rb +2 -5
- data/app/controllers/hyrax/downloads_controller.rb +1 -0
- data/app/controllers/hyrax/file_sets_controller.rb +3 -2
- data/app/controllers/hyrax/my/collections_controller.rb +1 -1
- data/app/forms/concerns/hyrax/basic_metadata_form_fields_behavior.rb +1 -0
- data/app/forms/concerns/hyrax/contained_in_works_behavior.rb +24 -0
- data/app/forms/concerns/hyrax/deposit_agreement_behavior.rb +12 -0
- data/app/forms/concerns/hyrax/leaseability_behavior.rb +49 -0
- data/app/forms/concerns/hyrax/permission_behavior.rb +20 -0
- data/app/forms/hyrax/forms/administrative_set_form.rb +1 -5
- data/app/forms/hyrax/forms/collection_form.rb +19 -0
- data/app/forms/hyrax/forms/file_set_form.rb +5 -0
- data/app/forms/hyrax/forms/pcdm_collection_form.rb +1 -5
- data/app/forms/hyrax/forms/pcdm_object_form.rb +13 -22
- data/app/forms/hyrax/forms/resource_batch_edit_form.rb +7 -2
- data/app/forms/hyrax/forms/resource_form.rb +30 -100
- data/app/forms/hyrax/forms.rb +52 -0
- data/app/helpers/hyrax/hyrax_helper_behavior.rb +2 -0
- data/app/indexers/{hyrax → concerns/hyrax}/location_indexer.rb +1 -5
- data/app/indexers/{hyrax → concerns/hyrax}/permission_indexer.rb +2 -2
- data/app/indexers/{hyrax → concerns/hyrax}/visibility_indexer.rb +1 -1
- data/app/indexers/hyrax/administrative_set_indexer.rb +5 -17
- data/app/indexers/hyrax/indexers/administrative_set_indexer.rb +25 -0
- data/app/indexers/hyrax/indexers/file_set_indexer.rb +144 -0
- data/app/indexers/hyrax/indexers/pcdm_collection_indexer.rb +27 -0
- data/app/indexers/hyrax/indexers/pcdm_object_indexer.rb +72 -0
- data/app/indexers/hyrax/indexers/resource_indexer.rb +86 -0
- data/app/indexers/hyrax/indexers.rb +54 -0
- data/app/indexers/hyrax/pcdm_collection_indexer.rb +5 -18
- data/app/indexers/hyrax/valkyrie_collection_indexer.rb +6 -4
- data/app/indexers/hyrax/valkyrie_file_set_indexer.rb +5 -136
- data/app/indexers/hyrax/valkyrie_indexer.rb +8 -112
- data/app/indexers/hyrax/valkyrie_work_indexer.rb +5 -64
- data/app/indexers/hyrax/work_indexer.rb +1 -0
- data/app/jobs/create_work_job.rb +1 -0
- data/app/models/admin_set.rb +20 -1
- data/app/models/collection.rb +5 -0
- data/app/models/concerns/hyrax/ability/admin_set_ability.rb +13 -28
- data/app/models/concerns/hyrax/ability/collection_ability.rb +26 -28
- data/app/models/concerns/hyrax/ability/resource_ability.rb +19 -0
- data/app/models/concerns/hyrax/ability.rb +11 -9
- data/app/models/concerns/hyrax/collection_behavior.rb +8 -0
- data/app/models/concerns/hyrax/solr_document_behavior.rb +15 -5
- data/app/models/concerns/hyrax/work_behavior.rb +4 -0
- data/app/models/featured_work.rb +12 -4
- data/app/models/file_set.rb +5 -0
- data/app/models/hyrax/administrative_set.rb +1 -1
- data/app/models/hyrax/change_set.rb +2 -2
- data/app/models/hyrax/file_metadata.rb +34 -7
- data/app/models/hyrax/file_set.rb +2 -2
- data/app/models/hyrax/group.rb +9 -38
- data/app/models/hyrax/group_behavior.rb +58 -0
- data/app/models/hyrax/model_registry.rb +111 -0
- data/app/models/hyrax/pcdm_collection.rb +1 -7
- data/app/models/hyrax/resource.rb +66 -8
- data/app/models/hyrax/statistic.rb +1 -1
- data/app/models/hyrax/work.rb +1 -7
- data/app/presenters/hyrax/collapsable_section_presenter.rb +7 -3
- data/app/presenters/hyrax/file_set_presenter.rb +8 -6
- data/app/presenters/hyrax/lease_presenter.rb +4 -0
- data/app/presenters/hyrax/menu_presenter.rb +14 -2
- data/app/presenters/hyrax/pcdm_member_presenter_factory.rb +1 -1
- data/app/presenters/hyrax/version_list_presenter.rb +6 -4
- data/app/search_builders/hyrax/admin_set_search_builder.rb +1 -1
- data/app/search_builders/hyrax/catalog_search_builder.rb +8 -2
- data/app/search_builders/hyrax/dashboard/collections_search_builder.rb +5 -3
- data/app/search_builders/hyrax/exposed_models_relation.rb +1 -1
- data/app/search_builders/hyrax/file_set_search_builder.rb +1 -1
- data/app/search_builders/hyrax/filter_by_type.rb +3 -2
- data/app/search_builders/hyrax/member_with_files_search_builder.rb +1 -1
- data/app/search_builders/hyrax/my/collections_search_builder.rb +2 -2
- data/app/search_builders/hyrax/my/find_works_search_builder.rb +8 -3
- data/app/services/hyrax/access_control_list.rb +21 -4
- data/app/services/hyrax/action/create_valkyrie_work.rb +80 -0
- data/app/services/hyrax/admin_set_create_service.rb +7 -3
- data/app/services/hyrax/admin_set_service.rb +2 -2
- data/app/services/hyrax/collections/collection_member_search_service.rb +2 -0
- data/app/services/hyrax/collections/permissions_service.rb +27 -9
- data/app/services/hyrax/custom_queries/find_collections_by_type.rb +1 -1
- data/app/services/hyrax/custom_queries/find_file_metadata.rb +1 -1
- data/app/services/hyrax/custom_queries/navigators/find_files.rb +1 -1
- data/app/services/hyrax/custom_queries/navigators/parent_work_navigator.rb +1 -1
- data/app/services/hyrax/edit_permissions_service.rb +1 -1
- data/app/services/hyrax/embargo_manager.rb +1 -1
- data/app/services/hyrax/file_set_file_service.rb +21 -10
- data/app/services/hyrax/form_factory.rb +1 -1
- data/app/services/hyrax/lease_manager.rb +39 -16
- data/app/services/hyrax/lease_service.rb +12 -6
- data/app/services/hyrax/listeners/acl_index_listener.rb +1 -1
- data/app/services/hyrax/listeners/active_fedora_acl_index_listener.rb +1 -1
- data/app/services/hyrax/listeners/member_cleanup_listener.rb +15 -1
- data/app/services/hyrax/listeners/object_lifecycle_listener.rb +5 -1
- data/app/services/hyrax/listeners/trophy_cleanup_listener.rb +2 -1
- data/app/services/hyrax/listeners/workflow_listener.rb +13 -0
- data/app/services/hyrax/listeners.rb +2 -1
- data/app/services/hyrax/location_service.rb +3 -0
- data/app/services/hyrax/multiple_membership_checker.rb +1 -1
- data/app/services/hyrax/simple_schema_loader.rb +1 -1
- data/app/services/hyrax/solr_service.rb +19 -5
- data/app/services/hyrax/statistics/collections/over_time.rb +1 -1
- data/app/services/hyrax/statistics/query_service.rb +6 -0
- data/app/services/hyrax/valkyrie_persist_derivatives.rb +11 -4
- data/app/services/hyrax/valkyrie_upload.rb +1 -1
- data/app/services/hyrax/work_uploads_handler.rb +5 -4
- data/app/views/_user_util_links.html.erb +1 -1
- data/app/views/collections/edit_fields/_based_near.html.erb +11 -7
- data/app/views/hyrax/admin/admin_sets/_form_participants.html.erb +67 -67
- data/app/views/hyrax/admin/admin_sets/edit.html.erb +1 -1
- data/app/views/hyrax/admin/collection_types/_form_participants.html.erb +3 -1
- data/app/views/hyrax/base/_attribute_rows.html.erb +1 -0
- data/app/views/hyrax/base/_base_form_files_prepend.html.erb +4 -0
- data/app/views/hyrax/base/_form_files.html.erb +65 -64
- data/app/views/hyrax/base/show.html.erb +2 -3
- data/app/views/hyrax/collections/show.html.erb +7 -9
- data/app/views/hyrax/dashboard/_sidebar.html.erb +4 -3
- data/app/views/hyrax/dashboard/collections/_form_share_table.html.erb +2 -2
- data/app/views/hyrax/file_sets/media_display/_audio.html.erb +1 -1
- data/app/views/hyrax/file_sets/media_display/_video.html.erb +1 -1
- data/app/views/hyrax/my/facet.html.erb +1 -1
- data/app/views/layouts/_head_tag_content.html.erb +1 -0
- data/app/views/shared/_footer.html.erb +1 -1
- data/chart/hyrax/Chart.yaml +3 -3
- data/chart/hyrax/templates/_tmplvalues.tpl +38 -0
- data/chart/hyrax/templates/deployment-worker.yaml +6 -2
- data/chart/hyrax/templates/deployment.yaml +9 -3
- data/chart/hyrax/values.yaml +9 -1
- data/config/initializers/listeners.rb +1 -1
- data/config/locales/hyrax.de.yml +5 -0
- data/config/locales/hyrax.en.yml +10 -0
- data/config/locales/hyrax.es.yml +5 -0
- data/config/locales/hyrax.fr.yml +5 -0
- data/config/locales/hyrax.it.yml +5 -0
- data/config/locales/hyrax.pt-BR.yml +5 -0
- data/config/locales/hyrax.zh.yml +5 -0
- data/config/metadata/basic_metadata.yaml +1 -0
- data/config/metadata/core_metadata.yaml +2 -0
- data/config/metadata/file_set_metadata.yaml +2 -0
- data/docker-compose-koppie.yml +3 -3
- data/docker-compose-sirenia.yml +3 -3
- data/documentation/developing-your-hyrax-based-app.md +89 -67
- data/hyrax.gemspec +9 -2
- data/lib/generators/hyrax/collection_resource/templates/collection_indexer.rb.erb +1 -1
- data/lib/generators/hyrax/config_generator.rb +12 -0
- data/lib/generators/hyrax/install_generator.rb +37 -7
- data/lib/generators/hyrax/listeners_generator.rb +18 -0
- data/lib/generators/hyrax/models_generator.rb +1 -10
- data/lib/generators/hyrax/riiif_generator.rb +6 -4
- data/lib/generators/hyrax/templates/.env +9 -0
- data/lib/generators/hyrax/templates/.lando.yml +50 -0
- data/lib/generators/hyrax/templates/app/listeners/hyrax_listener.rb +81 -0
- data/lib/generators/hyrax/templates/app/models/file_set.rb +1 -2
- data/lib/generators/hyrax/templates/config/initializers/1_valkyrie.rb +102 -0
- data/lib/generators/hyrax/templates/config/initializers/file_services.rb +6 -0
- data/lib/generators/hyrax/templates/config/initializers/hyrax.rb +41 -5
- data/lib/generators/hyrax/templates/config/initializers/publisher.rb +3 -0
- data/lib/generators/hyrax/templates/config/initializers/riiif.rb +77 -0
- data/lib/generators/hyrax/templates/config/locales/hyrax.de.yml +1 -1
- data/lib/generators/hyrax/templates/config/locales/hyrax.en.yml +1 -1
- data/lib/generators/hyrax/templates/config/locales/hyrax.es.yml +1 -1
- data/lib/generators/hyrax/templates/config/locales/hyrax.fr.yml +1 -1
- data/lib/generators/hyrax/templates/config/locales/hyrax.it.yml +1 -1
- data/lib/generators/hyrax/templates/config/locales/hyrax.pt-BR.yml +1 -1
- data/lib/generators/hyrax/templates/config/locales/hyrax.zh.yml +1 -1
- data/lib/generators/hyrax/templates/config/redis.yml +3 -6
- data/lib/generators/hyrax/templates/config/valkyrie_index.yml +4 -9
- data/lib/generators/hyrax/work_resource/templates/indexer.rb.erb +1 -1
- data/lib/hyrax/configuration.rb +95 -7
- data/lib/hyrax/indexer.rb +1 -1
- data/lib/hyrax/publisher.rb +5 -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/specs/capybara.rb +1 -0
- data/lib/hyrax/specs/shared_specs/hydra_works.rb +78 -20
- data/lib/hyrax/specs/shared_specs/indexers.rb +1 -1
- data/lib/hyrax/transactions/admin_set_destroy.rb +2 -1
- data/lib/hyrax/transactions/container.rb +5 -0
- data/lib/hyrax/transactions/steps/add_to_parent.rb +1 -0
- data/lib/hyrax/transactions/steps/check_for_default_admin_set.rb +32 -0
- data/lib/hyrax/transactions/steps/check_for_empty_admin_set.rb +1 -1
- data/lib/hyrax/transactions/steps/save.rb +2 -1
- data/lib/hyrax/transactions/steps/set_user_as_creator.rb +1 -1
- data/lib/hyrax/transactions/steps/update_work_members.rb +2 -0
- data/lib/hyrax/version.rb +1 -1
- data/lib/hyrax.rb +1 -0
- data/lib/tasks/embargo_lease.rake +1 -0
- data/lib/valkyrie/indexing/solr/indexing_adapter.rb +21 -7
- data/lib/wings/active_fedora_converter/default_work.rb +4 -5
- data/lib/wings/active_fedora_converter/file_metadata_node.rb +1 -1
- data/lib/wings/model_registry.rb +8 -0
- data/lib/wings/model_transformer.rb +19 -2
- data/lib/wings/orm_converter.rb +4 -0
- data/lib/wings/services/custom_queries/find_ids_by_model.rb +2 -2
- data/lib/wings/valkyrie/query_service.rb +5 -2
- data/lib/wings.rb +3 -0
- data/spec/factories/access_control.rb +12 -0
- data/spec/factories/admin_sets.rb +32 -0
- data/spec/factories/admin_sets_lw.rb +222 -0
- data/spec/factories/administrative_sets.rb +79 -0
- data/spec/factories/api_items.rb +92 -0
- data/spec/factories/collection_branding_infos.rb +12 -0
- data/spec/factories/collection_type_participants.rb +9 -0
- data/spec/factories/collection_types.rb +139 -0
- data/spec/factories/collections.rb +282 -0
- data/spec/factories/collections_factory.rb +107 -0
- data/spec/factories/content_blocks.rb +5 -0
- data/spec/factories/counter_metrics.rb +12 -0
- data/spec/factories/featured_works.rb +5 -0
- data/spec/factories/file_sets.rb +45 -0
- data/spec/factories/generic_works.rb +200 -0
- data/spec/factories/hyrax_collection.rb +92 -0
- data/spec/factories/hyrax_default_admin_set.rb +7 -0
- data/spec/factories/hyrax_embargo.rb +18 -0
- data/spec/factories/hyrax_file_metadata.rb +92 -0
- data/spec/factories/hyrax_file_set.rb +129 -0
- data/spec/factories/hyrax_lease.rb +18 -0
- data/spec/factories/hyrax_resource.rb +15 -0
- data/spec/factories/hyrax_work.rb +221 -0
- data/spec/factories/object_id.rb +7 -0
- data/spec/factories/operations.rb +22 -0
- data/spec/factories/permission.rb +7 -0
- data/spec/factories/permission_template_accesses.rb +17 -0
- data/spec/factories/permission_templates.rb +111 -0
- data/spec/factories/proxy_deposit_requests.rb +7 -0
- data/spec/factories/single_use_links.rb +14 -0
- data/spec/factories/sipity_entities.rb +17 -0
- data/spec/factories/uploaded_files.rb +11 -0
- data/spec/factories/users.rb +52 -0
- data/spec/factories/workflow_actions.rb +7 -0
- data/spec/factories/workflow_states.rb +7 -0
- data/spec/factories/workflows.rb +7 -0
- data/spec/support/book_resource.rb +36 -0
- data/spec/support/can_can_overrides.rb +43 -0
- data/spec/support/clean_solr.rb +7 -0
- data/spec/support/controller_level_helpers.rb +27 -0
- data/spec/support/factory_helpers.rb +94 -0
- data/spec/support/fakes/fake_actor.rb +22 -0
- data/spec/support/fakes/fake_authority.rb +14 -0
- data/spec/support/fakes/fake_search_builder_scope.rb +44 -0
- data/spec/support/fakes/indexing_adapter.rb +17 -0
- data/spec/support/fakes/test_hydra_group_service.rb +55 -0
- data/spec/support/features/batch_edit_actions.rb +37 -0
- data/spec/support/features/session_helpers.rb +15 -0
- data/spec/support/features/workflow.rb +10 -0
- data/spec/support/features.rb +11 -0
- data/spec/support/form_with_validations.rb +15 -0
- data/spec/support/input_support.rb +12 -0
- data/spec/support/logging_formatter.rb +67 -0
- data/spec/support/matchers/api_responses.rb +27 -0
- data/spec/support/matchers/collection_type_property_matchers.rb +30 -0
- data/spec/support/matchers/embargo.rb +9 -0
- data/spec/support/matchers/lease.rb +9 -0
- data/spec/support/matchers/match_valkyrie_ids_with_af_ids.rb +12 -0
- data/spec/support/matchers/pcdm_matchers.rb +34 -0
- data/spec/support/matchers/permission.rb +31 -0
- data/spec/support/matchers/response_matchers.rb +8 -0
- data/spec/support/optional_example.rb +17 -0
- data/spec/support/rake.rb +42 -0
- data/spec/support/selectors.rb +112 -0
- data/spec/support/shared_examples_for_collection_presenter.rb +44 -0
- data/spec/support/simple_work.rb +28 -0
- data/spec/support/spec_statistic.rb +24 -0
- data/spec/support/speedup.rb +7 -0
- data/spec/support/statistic_helper.rb +10 -0
- data/spec/support/valkyrie_indexing.rb +2 -0
- data/spec/support/wings_models.rb +9 -0
- data/template.rb +1 -3
- metadata +113 -30
- data/app/indexers/hyrax/resource_indexer.rb +0 -15
- data/app/models/concerns/hyrax/riiif_file.rb +0 -30
- data/app/services/hyrax/characterization/model_wrapper.rb +0 -0
- data/app/services/hyrax/custom_queries/find_by_collection_type.rb +0 -0
- data/app/services/hyrax/query_service.rb +0 -0
- data/app/services/hyrax/riiif_file_resolver.rb +0 -50
- data/lib/hyrax/specs/disable_animations_in_test_environment.rb +0 -53
- /data/app/indexers/{hyrax → concerns/hyrax}/thumbnail_indexer.rb +0 -0
data/CONTAINERS.md
CHANGED
@@ -5,10 +5,11 @@ Our goal is to provide a practical, reusable reference environment for applicati
|
|
5
5
|
|
6
6
|
The [Hyrax Engine Development](#hyrax-engine-development) is further along than the [Docker Image for Hyrax-based Applications](#docker-image-for-hyrax-based-applications) which is further along than [Deploying to Production](#deploying-to-production).
|
7
7
|
|
8
|
-
There are
|
8
|
+
There are three options for development environments to run:
|
9
9
|
|
10
10
|
- [Dassie](#dassie-internal-test-app-with-activefedora) is the default internal test app that will run an ActiveFedora-based Hyrax web application using Fedora 4 as the backend storage. See [Troubleshooting Dassie](#troubleshooting-dassie) if you encounter any issues.
|
11
11
|
- [Koppie](#koppie-internal-test-app-with-valkyrie-connector-to-postgres) is a newer internal test app that is a Valkyrie-based Hyrax web application that runs with PostGres as backend storage. It does not run ActiveFedora or use Fedora 4. See [Troubleshooting Koppie](#troubleshooting-koppie) if you encounter any issues.
|
12
|
+
- [Sirenia](#sirenia-internal-test-app-with-valkyrie-connector-to-fedora) is Koppie but with Valkyrie configured to use Fedora 6 metadata and storage adapters.
|
12
13
|
|
13
14
|
<!-- NOTE: This title is referenced in the top-level README.md. Keep that in mind if you change it. -->
|
14
15
|
## Hyrax Engine Development
|
@@ -37,6 +38,7 @@ This starts containers for:
|
|
37
38
|
- Redis
|
38
39
|
- Memcached
|
39
40
|
- SideKiq (for background jobs)
|
41
|
+
- Chrome (for feature tests)
|
40
42
|
|
41
43
|
It also runs database migrations. This will also bring up a development application on `http://localhost:3000`.
|
42
44
|
|
@@ -147,6 +149,7 @@ This starts containers for:
|
|
147
149
|
- Redis
|
148
150
|
- Memcached
|
149
151
|
- SideKiq (for background jobs)
|
152
|
+
- Chrome (for feature tests)
|
150
153
|
|
151
154
|
It also runs database migrations. This will also bring up a development application on `http://localhost:3001`.
|
152
155
|
|
@@ -183,13 +186,47 @@ echo "FROM samveralabs/hyrax" > Dockerfile
|
|
183
186
|
|
184
187
|
_This is for applications that mount Hyrax and is separate from the docker containers for Hyrax engine development._
|
185
188
|
|
189
|
+
### Sirenia Internal Test App with Valkyrie Connector to Fedora
|
190
|
+
|
191
|
+
Sirenia uses the same image as koppie. If you have not already done so, follow the build instructions for koppie above.
|
192
|
+
|
193
|
+
Start Sirenia: `docker compose -f docker-compose-sirenia.yml up`
|
194
|
+
|
195
|
+
This starts containers for:
|
196
|
+
|
197
|
+
- a `hyrax` test application (`.sirenia`);
|
198
|
+
- Fedora
|
199
|
+
- Solr
|
200
|
+
- Postgresql
|
201
|
+
- Redis
|
202
|
+
- Memcached
|
203
|
+
- SideKiq (for background jobs)
|
204
|
+
- Chrome (for feature tests)
|
205
|
+
|
206
|
+
It also runs database migrations. This will also bring up a development application on `http://localhost:3002`.
|
207
|
+
|
208
|
+
To stop the containers for the Hyrax-based application, type <kbd>Ctrl</kbd>+<kbd>c</kbd>. To restart the containers run `docker compose -f docker-compose-sirenia.yml up`.
|
209
|
+
|
210
|
+
_**Note:** Starting and stopping Docker in this way will preserve your data between restarts._
|
211
|
+
|
212
|
+
Sirenia runs as a different project than Dassie and Koppie, so it should be possible to run both concurrently (assuming your workstation has enough RAM).
|
213
|
+
|
214
|
+
#### Run rails console on Sirenia
|
215
|
+
|
216
|
+
Currently Sirenia should not be used for running specs. See [Code Changes and Testing](#code-changes-and-testing) under Dassie instead until the specs can be updated for a valkyrie only environment.
|
217
|
+
|
218
|
+
```sh
|
219
|
+
docker compose -f docker-compose-sirenia.yml up
|
220
|
+
docker compose -f docker-compose-sirenia.yml exec app bundle exec rails c
|
221
|
+
```
|
222
|
+
|
186
223
|
### Maintaining
|
187
224
|
|
188
225
|
We publish several Hyrax images to the [GitHub container registry][ghcr] under
|
189
226
|
the [Samvera organization][samvera-packages]. To build them:
|
190
227
|
|
191
228
|
```sh
|
192
|
-
export HYRAX_VERSION=v5.0.0
|
229
|
+
export HYRAX_VERSION=v5.0.0 # or desired version
|
193
230
|
git checkout hyrax-$HYRAX_VERSION
|
194
231
|
|
195
232
|
docker build --target hyrax-base --tag ghcr.io/samvera/hyrax/hyrax-base:$(git rev-parse HEAD) .
|
data/Dockerfile
CHANGED
@@ -1,8 +1,5 @@
|
|
1
|
-
ARG ALPINE_VERSION=3.
|
2
|
-
ARG RUBY_VERSION=3.2.
|
3
|
-
|
4
|
-
FROM ruby:$RUBY_VERSION-alpine$ALPINE_VERSION as builder
|
5
|
-
RUN apk add build-base curl jemalloc
|
1
|
+
ARG ALPINE_VERSION=3.19
|
2
|
+
ARG RUBY_VERSION=3.2.3
|
6
3
|
|
7
4
|
FROM ruby:$RUBY_VERSION-alpine$ALPINE_VERSION as hyrax-base
|
8
5
|
|
@@ -16,6 +13,14 @@ RUN apk --no-cache upgrade && \
|
|
16
13
|
curl \
|
17
14
|
gcompat \
|
18
15
|
imagemagick \
|
16
|
+
imagemagick-heic \
|
17
|
+
imagemagick-jpeg \
|
18
|
+
imagemagick-jxl \
|
19
|
+
imagemagick-pdf \
|
20
|
+
imagemagick-svg \
|
21
|
+
imagemagick-tiff \
|
22
|
+
imagemagick-webp \
|
23
|
+
jemalloc \
|
19
24
|
tzdata \
|
20
25
|
nodejs \
|
21
26
|
yarn \
|
@@ -34,12 +39,10 @@ RUN mkdir -p /app/samvera/hyrax-webapp
|
|
34
39
|
WORKDIR /app/samvera/hyrax-webapp
|
35
40
|
|
36
41
|
COPY --chown=1001:101 ./bin/*.sh /app/samvera/
|
37
|
-
ENV PATH="/app/samvera:$PATH"
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
COPY --from=builder /usr/lib/libjemalloc.so.2 /usr/local/lib/
|
42
|
-
ENV LD_PRELOAD="/usr/local/lib/libjemalloc.so.2"
|
42
|
+
ENV PATH="/app/samvera:$PATH" \
|
43
|
+
RAILS_ROOT="/app/samvera/hyrax-webapp" \
|
44
|
+
RAILS_SERVE_STATIC_FILES="1" \
|
45
|
+
LD_PRELOAD="/usr/local/lib/libjemalloc.so.2"
|
43
46
|
|
44
47
|
ENTRYPOINT ["hyrax-entrypoint.sh"]
|
45
48
|
CMD ["bundle", "exec", "puma", "-v", "-b", "tcp://0.0.0.0:3000"]
|
data/Gemfile
CHANGED
@@ -1,7 +1,14 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
source 'https://rubygems.org'
|
3
|
+
|
3
4
|
# Please see hyrax.gemspec for dependency information.
|
4
|
-
|
5
|
+
# Install gems from test app
|
6
|
+
if ENV['RAILS_ROOT']
|
7
|
+
test_app_gemfile_path = File.expand_path('Gemfile', ENV['RAILS_ROOT'])
|
8
|
+
eval_gemfile test_app_gemfile_path
|
9
|
+
else
|
10
|
+
gemspec
|
11
|
+
end
|
5
12
|
|
6
13
|
group :development, :test do
|
7
14
|
gem 'benchmark-ips'
|
@@ -13,9 +20,3 @@ group :development, :test do
|
|
13
20
|
gem 'ruby-prof', require: false
|
14
21
|
gem "simplecov", require: false
|
15
22
|
end
|
16
|
-
|
17
|
-
# Install gems from test app
|
18
|
-
if ENV['RAILS_ROOT']
|
19
|
-
test_app_gemfile_path = File.expand_path('Gemfile', ENV['RAILS_ROOT'])
|
20
|
-
eval_gemfile test_app_gemfile_path
|
21
|
-
end
|
data/README.md
CHANGED
@@ -69,10 +69,13 @@ module Hyrax
|
|
69
69
|
end
|
70
70
|
|
71
71
|
def save(env, use_valkyrie: false)
|
72
|
-
|
72
|
+
# NOTE: You must call env.curation_concern.save before you attempt to coerce the curation
|
73
|
+
# concern into a valkyrie resource.
|
74
|
+
is_valid = env.curation_concern.save
|
75
|
+
return is_valid unless use_valkyrie
|
73
76
|
|
74
77
|
# don't run validations again on the converted object if they've already passed
|
75
|
-
resource = valkyrie_save(resource: env.curation_concern.valkyrie_resource, is_valid:
|
78
|
+
resource = valkyrie_save(resource: env.curation_concern.valkyrie_resource, is_valid: is_valid)
|
76
79
|
|
77
80
|
# we need to manually set the id and reload, because the actor stack requires
|
78
81
|
# `env.curation_concern` to be the exact same instance throughout.
|
@@ -83,7 +86,7 @@ module Hyrax
|
|
83
86
|
# for now, just hit the validation error again
|
84
87
|
# later we should capture the _err.obj and pass it back
|
85
88
|
# through the environment
|
86
|
-
|
89
|
+
is_valid
|
87
90
|
end
|
88
91
|
|
89
92
|
def apply_save_data_to_curation_concern(env)
|
@@ -14,12 +14,9 @@ module Hyrax
|
|
14
14
|
def destroy
|
15
15
|
case work
|
16
16
|
when Valkyrie::Resource
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
lease_manager.deactivate!
|
21
|
-
work.lease = Hyrax.persister.save(resource: lease_manager.lease)
|
22
|
-
Hyrax::AccessControlList(work).save
|
17
|
+
Hyrax::LeaseManager.deactivate_lease_for(resource: work) &&
|
18
|
+
Hyrax.persister.save(resource: work.lease) &&
|
19
|
+
Hyrax::AccessControlList(work).save
|
23
20
|
else
|
24
21
|
work.lease_visibility! # If the lease has lapsed, update the current visibility.
|
25
22
|
work.deactivate_lease!
|
@@ -3,7 +3,15 @@ export class UploadedFiles {
|
|
3
3
|
constructor(form, callback) {
|
4
4
|
this.form = form
|
5
5
|
this.element = $('#fileupload')
|
6
|
-
this.
|
6
|
+
this.uploadsInProgress = 0
|
7
|
+
this.element.on('fileuploadadded', (e, data) => {
|
8
|
+
this.uploadsInProgress += 1
|
9
|
+
callback(e, data)
|
10
|
+
})
|
11
|
+
this.element.on('fileuploadcompleted', (e, data) => {
|
12
|
+
this.uploadsInProgress -= 1
|
13
|
+
callback(e, data)
|
14
|
+
})
|
7
15
|
this.element.on('fileuploaddestroyed', callback)
|
8
16
|
}
|
9
17
|
|
@@ -13,7 +21,7 @@ export class UploadedFiles {
|
|
13
21
|
}
|
14
22
|
|
15
23
|
get inProgress() {
|
16
|
-
return this.
|
24
|
+
return this.uploadsInProgress > 0;
|
17
25
|
}
|
18
26
|
|
19
27
|
get hasFiles() {
|
@@ -137,9 +137,14 @@ $gutter-width: $grid-gutter-width/2;
|
|
137
137
|
li {
|
138
138
|
white-space: nowrap;
|
139
139
|
|
140
|
-
> a:
|
140
|
+
> a:focus {
|
141
|
+
color: $admin-sidebar-link-color;
|
142
|
+
}
|
143
|
+
|
144
|
+
> a:hover {
|
141
145
|
text-decoration: none;
|
142
146
|
background-color: $admin-sidebar-link-background-color;
|
147
|
+
color: $admin-sidebar-link-hover-color;
|
143
148
|
}
|
144
149
|
}
|
145
150
|
|
@@ -6,9 +6,7 @@ module Hyrax
|
|
6
6
|
# Handle the HTTP show request
|
7
7
|
def send_local_content
|
8
8
|
response.headers['Accept-Ranges'] = 'bytes'
|
9
|
-
if request.
|
10
|
-
local_content_head
|
11
|
-
elsif request.headers['Range']
|
9
|
+
if request.headers['Range']
|
12
10
|
send_range_for_local_file
|
13
11
|
else
|
14
12
|
send_local_file_contents
|
@@ -26,7 +24,11 @@ module Hyrax
|
|
26
24
|
self.status = 206
|
27
25
|
prepare_local_file_headers
|
28
26
|
# For derivatives stored on the local file system
|
29
|
-
|
27
|
+
if request.head?
|
28
|
+
head status
|
29
|
+
else
|
30
|
+
send_data IO.binread(file, length, from), local_derivative_download_options.merge(status: status)
|
31
|
+
end
|
30
32
|
end
|
31
33
|
|
32
34
|
def send_local_file_contents
|
@@ -34,7 +36,11 @@ module Hyrax
|
|
34
36
|
self.status = 200
|
35
37
|
prepare_local_file_headers
|
36
38
|
# For derivatives stored on the local file system
|
37
|
-
|
39
|
+
if request.head?
|
40
|
+
head status
|
41
|
+
else
|
42
|
+
send_file file, local_derivative_download_options
|
43
|
+
end
|
38
44
|
end
|
39
45
|
|
40
46
|
def local_file_size
|
@@ -54,16 +60,9 @@ module Hyrax
|
|
54
60
|
File.mtime(file) if file.is_a? String
|
55
61
|
end
|
56
62
|
|
57
|
-
# Override
|
58
|
-
# render an HTTP HEAD response
|
59
|
-
def local_content_head
|
60
|
-
response.headers['Content-Length'] = local_file_size.to_s
|
61
|
-
head :ok, content_type: local_file_mime_type
|
62
|
-
end
|
63
|
-
|
64
63
|
# Override
|
65
64
|
def prepare_local_file_headers
|
66
|
-
send_file_headers!
|
65
|
+
send_file_headers! local_derivative_download_options
|
67
66
|
response.headers['Content-Type'] = local_file_mime_type
|
68
67
|
response.headers['Content-Length'] ||= local_file_size.to_s
|
69
68
|
# Prevent Rack::ETag from calculating a digest over body
|
@@ -73,12 +72,6 @@ module Hyrax
|
|
73
72
|
|
74
73
|
private
|
75
74
|
|
76
|
-
# Override the Hydra::Controller::DownloadBehavior#content_options so that
|
77
|
-
# we have an attachement rather than 'inline'
|
78
|
-
def local_content_options
|
79
|
-
{ type: local_file_mime_type, filename: local_file_name, disposition: 'attachment' }
|
80
|
-
end
|
81
|
-
|
82
75
|
# Override this method if you want to change the options sent when downloading
|
83
76
|
# a derivative file
|
84
77
|
def local_derivative_download_options
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module Hyrax
|
3
|
+
# Overrides Hydra::Controller:DownloadBehavior handing of HEAD requests to
|
4
|
+
# respond with same headers as a GET request would receive.
|
5
|
+
module StreamFileDownloadsControllerBehavior
|
6
|
+
protected
|
7
|
+
|
8
|
+
# Handle the HTTP show request
|
9
|
+
def send_content
|
10
|
+
response.headers['Accept-Ranges'] = 'bytes'
|
11
|
+
if request.headers['HTTP_RANGE']
|
12
|
+
send_range
|
13
|
+
else
|
14
|
+
send_file_contents
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
# rubocop:disable Metrics/AbcSize
|
19
|
+
def send_range
|
20
|
+
_, range = request.headers['HTTP_RANGE'].split('bytes=')
|
21
|
+
from, to = range.split('-').map(&:to_i)
|
22
|
+
to = file.size - 1 unless to
|
23
|
+
length = to - from + 1
|
24
|
+
response.headers['Content-Range'] = "bytes #{from}-#{to}/#{file.size}"
|
25
|
+
response.headers['Content-Length'] = length.to_s
|
26
|
+
self.status = 206
|
27
|
+
prepare_file_headers
|
28
|
+
|
29
|
+
if request.head?
|
30
|
+
head status
|
31
|
+
else
|
32
|
+
stream_body file.stream(request.headers['HTTP_RANGE'])
|
33
|
+
end
|
34
|
+
end
|
35
|
+
# rubocop:enable Metrics/AbcSize
|
36
|
+
|
37
|
+
def send_file_contents
|
38
|
+
return unless stale?(last_modified: file_last_modified, template: false)
|
39
|
+
|
40
|
+
self.status = 200
|
41
|
+
prepare_file_headers
|
42
|
+
|
43
|
+
if request.head?
|
44
|
+
head status
|
45
|
+
else
|
46
|
+
stream_body file.stream
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
def file_last_modified
|
51
|
+
file.modified_date
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -9,10 +9,10 @@ module Hyrax
|
|
9
9
|
|
10
10
|
private
|
11
11
|
|
12
|
+
# rubocop:disable Metrics/AbcSize, Metrics/MethodLength
|
12
13
|
def send_file_contents_valkyrie(file_set)
|
13
14
|
response.headers["Accept-Ranges"] = "bytes"
|
14
15
|
self.status = 200
|
15
|
-
use = params.fetch(:file, :original_file).to_sym
|
16
16
|
mime_type = params[:mime_type]
|
17
17
|
file_metadata = find_file_metadata(file_set: file_set, use: use, mime_type: mime_type)
|
18
18
|
return unless stale?(last_modified: file_metadata.updated_at, template: false)
|
@@ -23,23 +23,49 @@ module Hyrax
|
|
23
23
|
# Warning - using the range header will load the range selection in to memory
|
24
24
|
# this can cause memory bloat
|
25
25
|
if request.headers['Range']
|
26
|
-
|
27
|
-
|
26
|
+
if request.head?
|
27
|
+
prepare_range_headers_valkyrie(file: file)
|
28
|
+
head status
|
29
|
+
else
|
30
|
+
send_data send_range_valkyrie(file: file), data_options(file_metadata)
|
31
|
+
end
|
32
|
+
elsif request.head?
|
33
|
+
head status
|
28
34
|
else
|
29
35
|
send_file file.disk_path, data_options(file_metadata).except(:status)
|
30
36
|
end
|
31
37
|
end
|
38
|
+
# rubocop:enable Metrics/AbcSize, Metrics/MethodLength
|
32
39
|
|
33
40
|
def data_options(file_metadata)
|
34
41
|
{
|
35
42
|
type: file_metadata.mime_type,
|
36
43
|
filename: file_metadata.original_filename,
|
37
|
-
disposition:
|
44
|
+
disposition: disposition,
|
38
45
|
status: status
|
39
46
|
}
|
40
47
|
end
|
41
48
|
|
49
|
+
def use
|
50
|
+
params.fetch(:file, :original_file).to_sym
|
51
|
+
end
|
52
|
+
|
53
|
+
def disposition
|
54
|
+
if ActiveRecord::Type::Boolean.new.cast(params.fetch(:inline, use != :original_file))
|
55
|
+
'inline'
|
56
|
+
else
|
57
|
+
'attachment'
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
42
61
|
def send_range_valkyrie(file:)
|
62
|
+
from, length = prepare_range_headers_valkyrie(file: file)
|
63
|
+
file.rewind
|
64
|
+
file.read from # Seek to start of requested range
|
65
|
+
file.read length
|
66
|
+
end
|
67
|
+
|
68
|
+
def prepare_range_headers_valkyrie(file:)
|
43
69
|
_, range = request.headers['Range'].split('bytes=')
|
44
70
|
from, to = range.split('-').map(&:to_i)
|
45
71
|
to = file.size - 1 unless to
|
@@ -47,19 +73,22 @@ module Hyrax
|
|
47
73
|
response.headers['Content-Range'] = "bytes #{from}-#{to}/#{file.size}"
|
48
74
|
response.headers['Content-Length'] = length.to_s
|
49
75
|
self.status = 206
|
50
|
-
|
51
|
-
file.read length
|
76
|
+
[from, length]
|
52
77
|
end
|
53
78
|
|
54
|
-
|
55
|
-
|
56
|
-
response.headers["Content-Disposition"] =
|
79
|
+
# rubocop:disable Metrics/AbcSize
|
80
|
+
def prepare_file_headers_valkyrie(metadata:, file:)
|
81
|
+
response.headers["Content-Disposition"] =
|
82
|
+
ActionDispatch::Http::ContentDisposition.format(disposition: disposition, filename: metadata.original_filename)
|
57
83
|
response.headers["Content-Type"] = metadata.mime_type
|
58
84
|
response.headers["Content-Length"] ||= (file.try(:size) || metadata.size.first).to_s
|
85
|
+
headers["Content-Transfer-Encoding"] = "binary"
|
59
86
|
# Prevent Rack::ETag from calculating a digest over body
|
60
87
|
response.headers["Last-Modified"] = metadata.updated_at.utc.strftime("%a, %d %b %Y %T GMT")
|
61
88
|
self.content_type = metadata.mime_type
|
89
|
+
response.cache_control[:public] ||= false
|
62
90
|
end
|
91
|
+
# rubocop:enable Metrics/AbcSize
|
63
92
|
|
64
93
|
def find_file_metadata(file_set:, use: :original_file, mime_type: nil)
|
65
94
|
if mime_type.nil?
|
@@ -18,9 +18,12 @@ module Hyrax
|
|
18
18
|
|
19
19
|
class_attribute :_curation_concern_type, :show_presenter, :work_form_service, :search_builder_class
|
20
20
|
class_attribute :iiif_manifest_builder, instance_accessor: false
|
21
|
+
class_attribute :create_valkyrie_work_action
|
22
|
+
|
21
23
|
self.show_presenter = Hyrax::WorkShowPresenter
|
22
24
|
self.work_form_service = Hyrax::WorkFormService
|
23
25
|
self.search_builder_class = WorkSearchBuilder
|
26
|
+
self.create_valkyrie_work_action = Hyrax::Action::CreateValkyrieWork
|
24
27
|
self.iiif_manifest_builder = nil
|
25
28
|
attr_accessor :curation_concern
|
26
29
|
helper_method :curation_concern, :contextual_path
|
@@ -187,20 +190,16 @@ module Hyrax
|
|
187
190
|
# rubocop:disable Metrics/MethodLength
|
188
191
|
def create_valkyrie_work
|
189
192
|
form = build_form
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
+
action = create_valkyrie_work_action.new(form: form,
|
194
|
+
transactions: transactions,
|
195
|
+
user: current_user,
|
196
|
+
params: params,
|
197
|
+
work_attributes_key: hash_key_for_curation_concern)
|
198
|
+
|
199
|
+
return after_create_error(form_err_msg(action.form), action.work_attributes) unless action.validate
|
200
|
+
|
201
|
+
result = action.perform
|
193
202
|
|
194
|
-
result =
|
195
|
-
transactions['change_set.create_work']
|
196
|
-
.with_step_args(
|
197
|
-
'work_resource.add_to_parent' => { parent_id: params[:parent_id], user: current_user },
|
198
|
-
'work_resource.add_file_sets' => { uploaded_files: uploaded_files, file_set_params: original_input_params_for_form[:file_set] },
|
199
|
-
'change_set.set_user_as_depositor' => { user: current_user },
|
200
|
-
'work_resource.change_depositor' => { user: ::User.find_by_user_key(form.on_behalf_of) },
|
201
|
-
'work_resource.save_acl' => { permissions_params: form.input_params["permissions"] }
|
202
|
-
)
|
203
|
-
.call(form)
|
204
203
|
@curation_concern = result.value_or { return after_create_error(transaction_err_msg(result)) }
|
205
204
|
after_create_response
|
206
205
|
end
|
@@ -228,7 +227,13 @@ module Hyrax
|
|
228
227
|
end
|
229
228
|
|
230
229
|
def transaction_err_msg(result)
|
231
|
-
result.failure.
|
230
|
+
msg = if result.failure[1].respond_to?(:full_messages)
|
231
|
+
"#{result.failure[1].full_messages.to_sentence} [#{result.failure[0]}]"
|
232
|
+
else
|
233
|
+
result.failure[0].to_s
|
234
|
+
end
|
235
|
+
Rails.logger.info("Transaction failed: #{msg}\n #{result.trace}")
|
236
|
+
msg
|
232
237
|
end
|
233
238
|
|
234
239
|
def presenter
|
@@ -99,7 +99,7 @@ module Hyrax
|
|
99
99
|
case @admin_set
|
100
100
|
when Valkyrie::Resource
|
101
101
|
transactions['admin_set_resource.destroy'].call(@admin_set).value_or do |failure|
|
102
|
-
redirect_to hyrax.admin_admin_set_path(admin_set_id), alert: failure.first
|
102
|
+
return redirect_to hyrax.admin_admin_set_path(admin_set_id), alert: failure.first
|
103
103
|
end
|
104
104
|
after_delete_success
|
105
105
|
else
|
@@ -182,7 +182,7 @@ module Hyrax
|
|
182
182
|
@form ||=
|
183
183
|
case @admin_set
|
184
184
|
when Valkyrie::Resource
|
185
|
-
Hyrax::Forms::ResourceForm.for(@admin_set)
|
185
|
+
Hyrax::Forms::ResourceForm.for(resource: @admin_set)
|
186
186
|
else
|
187
187
|
form_class.new(@admin_set, current_ability, repository)
|
188
188
|
end
|
@@ -29,7 +29,7 @@ module Hyrax
|
|
29
29
|
@pageviews = Hyrax::Analytics.daily_events_for_id(@document.id, 'work-view')
|
30
30
|
@uniques = Hyrax::Analytics.unique_visitors_for_id(@document.id)
|
31
31
|
@downloads = Hyrax::Analytics.daily_events_for_id(@document.id, 'file_set_in_work_download')
|
32
|
-
@files = paginate(@document._source["
|
32
|
+
@files = paginate(@document._source["member_ids_ssim"], rows: 5)
|
33
33
|
respond_to do |format|
|
34
34
|
format.html
|
35
35
|
format.csv { export_data }
|
@@ -41,11 +41,11 @@ module Hyrax
|
|
41
41
|
def accessible_works
|
42
42
|
models = Hyrax.config.curation_concerns.map { |m| "\"#{m}\"" }
|
43
43
|
if current_user.ability.admin?
|
44
|
-
|
44
|
+
Hyrax::SolrService.query("has_model_ssim:(#{models.join(' OR ')})",
|
45
45
|
fl: 'title_tesim, id, member_of_collections',
|
46
46
|
rows: 50_000)
|
47
47
|
else
|
48
|
-
|
48
|
+
Hyrax::SolrService.query(
|
49
49
|
"edit_access_person_ssim:#{current_user} AND has_model_ssim:(#{models.join(' OR ')})",
|
50
50
|
fl: 'title_tesim, id, member_of_collections',
|
51
51
|
rows: 50_000
|
@@ -55,13 +55,13 @@ module Hyrax
|
|
55
55
|
|
56
56
|
def accessible_file_sets
|
57
57
|
if current_user.ability.admin?
|
58
|
-
|
58
|
+
Hyrax::SolrService.query(
|
59
59
|
"has_model_ssim:FileSet",
|
60
60
|
fl: 'title_tesim, id',
|
61
61
|
rows: 50_000
|
62
62
|
)
|
63
63
|
else
|
64
|
-
|
64
|
+
Hyrax::SolrService.query(
|
65
65
|
"edit_access_person_ssim:#{current_user} AND has_model_ssim:FileSet",
|
66
66
|
fl: 'title_tesim, id',
|
67
67
|
rows: 50_000
|
@@ -26,9 +26,6 @@ module Hyrax
|
|
26
26
|
# Catch permission errors
|
27
27
|
rescue_from Hydra::AccessDenied, CanCan::AccessDenied, with: :deny_collection_access
|
28
28
|
|
29
|
-
# actions: index, create, new, edit, show, update, destroy, permissions, citation
|
30
|
-
before_action :authenticate_user!, except: [:index]
|
31
|
-
|
32
29
|
class_attribute :presenter_class,
|
33
30
|
:form_class,
|
34
31
|
:single_item_search_builder_class,
|
@@ -80,7 +77,6 @@ module Hyrax
|
|
80
77
|
|
81
78
|
def edit
|
82
79
|
form
|
83
|
-
collection_type
|
84
80
|
end
|
85
81
|
|
86
82
|
def after_create
|
@@ -274,6 +270,7 @@ module Hyrax
|
|
274
270
|
def collection_type
|
275
271
|
@collection_type ||= CollectionType.find_by_gid!(collection.collection_type_gid)
|
276
272
|
end
|
273
|
+
helper_method :collection_type
|
277
274
|
|
278
275
|
def link_parent_collection(parent_id)
|
279
276
|
child = collection.respond_to?(:valkyrie_resource) ? collection.valkyrie_resource : collection
|
@@ -512,7 +509,7 @@ module Hyrax
|
|
512
509
|
@form ||=
|
513
510
|
case @collection
|
514
511
|
when Valkyrie::Resource
|
515
|
-
form = Hyrax::Forms::ResourceForm.for(@collection)
|
512
|
+
form = Hyrax::Forms::ResourceForm.for(resource: @collection)
|
516
513
|
form.prepopulate!
|
517
514
|
form
|
518
515
|
else
|
@@ -2,6 +2,7 @@
|
|
2
2
|
module Hyrax
|
3
3
|
class DownloadsController < ApplicationController
|
4
4
|
include Hydra::Controller::DownloadBehavior
|
5
|
+
include Hyrax::StreamFileDownloadsControllerBehavior
|
5
6
|
include Hyrax::LocalFileDownloadsControllerBehavior
|
6
7
|
include Hyrax::ValkyrieDownloadsControllerBehavior
|
7
8
|
include Hyrax::WorkflowsHelper # Provides #workflow_restriction?
|
@@ -121,7 +121,7 @@ module Hyrax
|
|
121
121
|
end
|
122
122
|
|
123
123
|
def valkyrie_update_metadata
|
124
|
-
change_set = Hyrax::Forms::ResourceForm.for(file_set)
|
124
|
+
change_set = Hyrax::Forms::ResourceForm.for(resource: file_set)
|
125
125
|
|
126
126
|
result =
|
127
127
|
change_set.validate(attributes) &&
|
@@ -137,6 +137,7 @@ module Hyrax
|
|
137
137
|
@parent ||=
|
138
138
|
case file_set
|
139
139
|
when Hyrax::FileSet
|
140
|
+
# TODO: Add Hyrax::FileSet#parent method
|
140
141
|
Hyrax.query_service.find_parents(resource: file_set).first
|
141
142
|
else
|
142
143
|
file_set.parent
|
@@ -233,7 +234,7 @@ module Hyrax
|
|
233
234
|
|
234
235
|
case file_set
|
235
236
|
when Hyrax::Resource
|
236
|
-
@form = Hyrax::Forms::ResourceForm.for(file_set)
|
237
|
+
@form = Hyrax::Forms::ResourceForm.for(resource: file_set)
|
237
238
|
@form.prepopulate!
|
238
239
|
else
|
239
240
|
@form = form_class.new(file_set)
|