hyrax 3.0.0 → 3.2.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 +46 -13
- data/.dassie/Gemfile +11 -6
- data/.dassie/app/controllers/catalog_controller.rb +6 -0
- data/.dassie/config/initializers/hyrax.rb +5 -0
- data/.dassie/config/initializers/riiif.rb +22 -20
- data/.dassie/config/role_map.yml +2 -0
- data/.dassie/db/seeds.rb +1 -1
- data/.dassie/package.json +3 -5
- data/.dockerignore +3 -0
- data/.env +1 -2
- data/.rubocop.yml +4 -0
- data/CONTAINERS.md +21 -1
- data/Dockerfile +42 -17
- data/Gemfile +21 -27
- data/app/actors/hyrax/actors/base_actor.rb +2 -2
- data/app/actors/hyrax/actors/collections_membership_actor.rb +3 -3
- data/app/actors/hyrax/actors/create_with_remote_files_actor.rb +85 -63
- data/app/actors/hyrax/actors/create_with_remote_files_ordered_members_actor.rb +7 -42
- data/app/actors/hyrax/actors/file_set_actor.rb +12 -5
- data/app/assets/stylesheets/hyrax/_styles.scss +5 -0
- data/app/controllers/concerns/hyrax/collections_controller_behavior.rb +30 -10
- data/app/controllers/concerns/hyrax/controller.rb +13 -2
- data/app/controllers/concerns/hyrax/embargoes_controller_behavior.rb +21 -9
- data/app/controllers/concerns/hyrax/leases_controller_behavior.rb +14 -5
- data/app/controllers/concerns/hyrax/works_controller_behavior.rb +22 -3
- data/app/controllers/hyrax/admin/admin_sets_controller.rb +2 -19
- data/app/controllers/hyrax/admin/permission_template_accesses_controller.rb +5 -6
- data/app/controllers/hyrax/admin/workflows_controller.rb +8 -2
- data/app/controllers/hyrax/collections_controller.rb +3 -1
- data/app/controllers/hyrax/dashboard/collection_members_controller.rb +24 -17
- data/app/controllers/hyrax/dashboard/collections_controller.rb +99 -35
- data/app/controllers/hyrax/dashboard/nest_collections_controller.rb +75 -39
- data/app/controllers/hyrax/file_sets_controller.rb +49 -13
- data/app/controllers/hyrax/my_controller.rb +4 -4
- data/app/controllers/hyrax/permissions_controller.rb +3 -4
- data/app/controllers/hyrax/workflow_actions_controller.rb +11 -6
- data/app/forms/hyrax/forms/administrative_set_form.rb +62 -0
- data/app/forms/hyrax/forms/collection_form.rb +14 -8
- data/app/forms/hyrax/forms/dashboard/nest_collection_form.rb +38 -6
- data/app/forms/hyrax/forms/file_set_form.rb +46 -0
- data/app/forms/hyrax/forms/pcdm_collection_form.rb +64 -0
- data/app/forms/hyrax/forms/permission.rb +23 -0
- data/app/forms/hyrax/forms/permission_template_form.rb +8 -2
- data/app/forms/hyrax/forms/resource_form.rb +34 -26
- data/app/forms/hyrax/forms/work_form.rb +5 -2
- data/app/forms/hyrax/forms/workflow_action_form.rb +4 -0
- data/app/helpers/hyrax/batch_edits_helper.rb +3 -1
- data/app/helpers/hyrax/collections_helper.rb +88 -2
- data/app/helpers/hyrax/dashboard_helper_behavior.rb +16 -5
- data/app/helpers/hyrax/embargo_helper.rb +4 -0
- data/app/helpers/hyrax/file_set_helper.rb +25 -6
- data/app/helpers/hyrax/hyrax_helper_behavior.rb +9 -0
- data/app/helpers/hyrax/lease_helper.rb +4 -0
- data/app/helpers/hyrax/url_helper.rb +4 -1
- data/app/helpers/hyrax/work_form_helper.rb +53 -0
- data/app/indexers/hyrax/administrative_set_indexer.rb +18 -0
- data/app/indexers/hyrax/pcdm_collection_indexer.rb +2 -0
- data/app/indexers/hyrax/valkyrie_file_set_indexer.rb +2 -0
- data/app/indexers/hyrax/valkyrie_indexer.rb +4 -3
- data/app/indexers/hyrax/valkyrie_work_indexer.rb +1 -1
- data/app/inputs/controlled_vocabulary_input.rb +2 -5
- data/app/jobs/attach_files_to_work_job.rb +19 -10
- data/app/jobs/attach_files_to_work_with_ordered_members_job.rb +6 -5
- data/app/jobs/ingest_local_file_job.rb +18 -2
- data/app/jobs/inherit_permissions_job.rb +9 -5
- data/app/models/admin_set.rb +22 -30
- data/app/models/collection_branding_info.rb +25 -9
- data/app/models/concerns/hyrax/ability/admin_set_ability.rb +31 -7
- data/app/models/concerns/hyrax/ability/collection_ability.rb +35 -20
- data/app/models/concerns/hyrax/ability/collection_type_ability.rb +1 -1
- data/app/models/concerns/hyrax/ability.rb +5 -3
- data/app/models/concerns/hyrax/collection_behavior.rb +17 -44
- data/app/models/concerns/hyrax/embargoable.rb +24 -0
- data/app/models/concerns/hyrax/file_set/characterization.rb +18 -12
- data/app/models/concerns/hyrax/solr_document_behavior.rb +11 -54
- data/app/models/concerns/hyrax/suppressible.rb +5 -0
- data/app/models/concerns/hyrax/user.rb +9 -3
- data/app/models/concerns/hyrax/work_behavior.rb +1 -1
- data/app/models/hyrax/administrative_set.rb +7 -1
- data/app/models/hyrax/file_set.rb +6 -0
- data/app/models/hyrax/pcdm_collection.rb +1 -0
- data/app/models/hyrax/permission.rb +1 -1
- data/app/models/hyrax/permission_template.rb +112 -12
- data/app/models/hyrax/virus_scanner.rb +27 -18
- data/app/models/hyrax/work.rb +1 -0
- data/app/models/hyrax/workflow_action_info.rb +16 -0
- data/app/models/sipity/agent.rb +1 -0
- data/app/models/sipity/comment.rb +17 -0
- data/app/models/sipity/entity.rb +30 -8
- data/app/models/sipity/workflow.rb +1 -0
- data/app/models/sipity.rb +53 -2
- data/app/presenters/hyrax/admin_set_options_presenter.rb +12 -8
- data/app/presenters/hyrax/admin_set_presenter.rb +13 -4
- data/app/presenters/hyrax/admin_set_selection_presenter.rb +116 -0
- data/app/presenters/hyrax/collection_presenter.rb +44 -23
- data/app/presenters/hyrax/file_set_presenter.rb +6 -1
- data/app/presenters/hyrax/file_usage.rb +3 -2
- data/app/presenters/hyrax/pcdm_member_presenter_factory.rb +119 -0
- data/app/presenters/hyrax/stats_usage_presenter.rb +2 -1
- data/app/presenters/hyrax/trophy_presenter.rb +33 -4
- data/app/presenters/hyrax/user_profile_presenter.rb +11 -1
- data/app/presenters/hyrax/version_list_presenter.rb +19 -0
- data/app/presenters/hyrax/version_presenter.rb +3 -2
- data/app/presenters/hyrax/work_show_presenter.rb +32 -6
- data/app/presenters/hyrax/work_usage.rb +5 -3
- data/app/renderers/hyrax/renderers/attribute_renderer.rb +10 -2
- data/app/search_builders/hyrax/abstract_type_relation.rb +4 -2
- data/app/search_builders/hyrax/admin_set_search_builder.rb +1 -1
- data/app/search_builders/hyrax/collection_member_search_builder.rb +6 -1
- data/app/search_builders/hyrax/dashboard/collections_search_builder.rb +1 -1
- data/app/search_builders/hyrax/exposed_models_relation.rb +1 -1
- data/app/search_builders/hyrax/filter_by_type.rb +1 -2
- data/app/search_builders/hyrax/my/collections_search_builder.rb +2 -2
- data/app/search_builders/hyrax/nested_collections_parent_search_builder.rb +1 -1
- data/app/search_builders/hyrax/single_collection_search_builder.rb +1 -1
- data/app/services/hyrax/admin_set_create_service.rb +136 -52
- data/app/services/hyrax/collection_types/permissions_service.rb +1 -1
- data/app/services/hyrax/collections/collection_member_search_service.rb +72 -0
- data/app/services/hyrax/collections/collection_member_service.rb +122 -27
- data/app/services/hyrax/collections/migration_service.rb +4 -2
- data/app/services/hyrax/collections/nested_collection_persistence_service.rb +12 -13
- data/app/services/hyrax/collections/nested_collection_query_service.rb +2 -0
- data/app/services/hyrax/collections/permissions_create_service.rb +82 -78
- data/app/services/hyrax/collections/permissions_service.rb +1 -1
- data/app/services/hyrax/contextual_path.rb +24 -1
- data/app/services/hyrax/curation_concern.rb +24 -2
- data/app/services/hyrax/custom_queries/find_file_metadata.rb +7 -5
- data/app/services/hyrax/custom_queries/navigators/parent_collections_navigator.rb +46 -0
- data/app/services/hyrax/default_middleware_stack.rb +11 -0
- data/app/services/hyrax/edit_permissions_service.rb +74 -41
- data/app/services/hyrax/ensure_well_formed_admin_set_service.rb +3 -3
- data/app/services/hyrax/find_objects_via_solr_service.rb +31 -0
- data/app/services/hyrax/listeners/active_fedora_acl_index_listener.rb +1 -0
- data/app/services/hyrax/listeners/member_cleanup_listener.rb +26 -0
- data/app/services/hyrax/listeners/metadata_index_listener.rb +25 -9
- data/app/services/hyrax/listeners/object_lifecycle_listener.rb +1 -1
- data/app/services/hyrax/listeners/trophy_cleanup_listener.rb +17 -0
- data/app/services/hyrax/listeners.rb +2 -0
- data/app/services/hyrax/multiple_membership_checker.rb +53 -29
- data/app/services/hyrax/permission_manager.rb +4 -4
- data/app/services/hyrax/persist_derivatives.rb +3 -1
- data/app/services/hyrax/resource_status.rb +7 -0
- data/app/services/hyrax/search_service.rb +4 -2
- data/app/services/hyrax/solr_query_builder_service.rb +45 -8
- data/app/services/hyrax/solr_query_service.rb +224 -0
- data/app/services/hyrax/solr_service.rb +9 -2
- data/app/services/hyrax/statistics/collections/over_time.rb +2 -1
- data/app/services/hyrax/statistics/depositors/summary.rb +2 -1
- data/app/services/hyrax/thumbnail_path_service.rb +1 -1
- data/app/services/hyrax/visibility_intention.rb +20 -2
- data/app/services/hyrax/visibility_propagator.rb +30 -1
- data/app/services/hyrax/work_uploads_handler.rb +17 -2
- data/app/services/hyrax/workflow/abstract_notification.rb +2 -2
- data/app/services/hyrax/workflow/action_taken_service.rb +16 -4
- data/app/services/hyrax/workflow/actionable_objects.rb +70 -0
- data/app/services/hyrax/workflow/activate_object.rb +5 -4
- data/app/services/hyrax/workflow/changes_required_notification.rb +5 -4
- data/app/services/hyrax/workflow/deactivate_object.rb +7 -5
- data/app/services/hyrax/workflow/deposited_notification.rb +8 -4
- data/app/services/hyrax/workflow/grant_edit_to_depositor.rb +7 -3
- data/app/services/hyrax/workflow/grant_read_to_depositor.rb +10 -3
- data/app/services/hyrax/workflow/object_in_workflow_decorator.rb +31 -0
- data/app/services/hyrax/workflow/revoke_edit_from_depositor.rb +8 -2
- data/app/services/hyrax/workflow/status_list_service.rb +43 -13
- data/app/services/hyrax/workflow/workflow_action_service.rb +4 -1
- data/app/views/hyrax/admin/admin_sets/_form.html.erb +1 -1
- data/app/views/hyrax/base/_form_child_work_relationships.html.erb +1 -1
- data/app/views/hyrax/base/_form_relationships.html.erb +1 -2
- data/app/views/hyrax/base/_form_rendering.html.erb +1 -1
- data/app/views/hyrax/base/_form_representative.html.erb +1 -1
- data/app/views/hyrax/base/_form_thumbnail.html.erb +1 -1
- data/app/views/hyrax/base/_form_visibility_error.html.erb +2 -0
- data/app/views/hyrax/base/_guts4form.html.erb +3 -3
- data/app/views/hyrax/base/_representative_media.html.erb +1 -1
- data/app/views/hyrax/base/_show_actions.html.erb +2 -2
- data/app/views/hyrax/base/_work_button_row.html.erb +1 -1
- data/app/views/hyrax/batch_uploads/_form.html.erb +1 -1
- data/app/views/hyrax/collections/show.html.erb +1 -1
- data/app/views/hyrax/dashboard/collections/_collection_title.html.erb +1 -1
- data/app/views/hyrax/dashboard/collections/_form.html.erb +4 -4
- data/app/views/hyrax/dashboard/collections/_form_branding.html.erb +1 -1
- data/app/views/hyrax/dashboard/collections/_list_collections.html.erb +1 -1
- data/app/views/hyrax/dashboard/collections/_sort_and_per_page.html.erb +1 -1
- data/app/views/hyrax/dashboard/collections/edit.html.erb +4 -2
- data/app/views/hyrax/dashboard/collections/new.html.erb +4 -2
- data/app/views/hyrax/dashboard/collections/show.html.erb +1 -1
- data/app/views/hyrax/file_sets/_actions.html.erb +10 -0
- data/app/views/hyrax/file_sets/edit.html.erb +1 -1
- data/app/views/hyrax/file_sets/media_display/_audio.html.erb +1 -1
- data/app/views/hyrax/file_sets/media_display/_default.html.erb +1 -1
- data/app/views/hyrax/file_sets/media_display/_image.html.erb +1 -1
- data/app/views/hyrax/file_sets/media_display/_office_document.html.erb +1 -1
- data/app/views/hyrax/file_sets/media_display/_pdf.html.erb +1 -1
- data/app/views/hyrax/file_sets/media_display/_video.html.erb +1 -1
- data/app/views/hyrax/file_sets/show.html.erb +1 -1
- data/app/views/hyrax/homepage/index.html.erb +1 -1
- data/app/views/hyrax/my/_admin_set_action_menu.html.erb +0 -11
- data/app/views/hyrax/my/_collection_action_menu.html.erb +1 -2
- data/app/views/hyrax/my/collections/_list_collections.html.erb +1 -1
- data/app/views/hyrax/my/collections/_modal_add_subcollection.html.erb +3 -5
- data/app/views/hyrax/my/collections/_modal_collection_types_to_create.html.erb +1 -1
- data/app/views/layouts/hyrax/dashboard.html.erb +1 -0
- data/app/views/layouts/hyrax.html.erb +1 -0
- data/app/views/shared/_read_only.html.erb +5 -0
- data/bin/db-migrate-seed.sh +3 -1
- data/bin/hyrax-entrypoint.sh +0 -14
- data/bin/solrcloud-assign-configset.sh +11 -3
- data/bin/solrcloud-upload-configset.sh +17 -6
- data/chart/hyrax/Chart.yaml +9 -5
- data/chart/hyrax/README.md +52 -5
- data/chart/hyrax/templates/_helpers.tpl +23 -1
- data/chart/hyrax/templates/branding-pvc.yaml +14 -0
- data/chart/hyrax/templates/configmap-env.yaml +14 -3
- data/chart/hyrax/templates/deployment-worker.yaml +129 -0
- data/chart/hyrax/templates/deployment.yaml +95 -0
- data/chart/hyrax/templates/derivatives-pvc.yaml +14 -0
- data/chart/hyrax/templates/ingress.yaml +13 -4
- data/chart/hyrax/templates/secrets.yaml +9 -0
- data/chart/hyrax/templates/uploads-pvc.yaml +14 -0
- data/chart/hyrax/values.yaml +114 -1
- data/config/brakeman.ignore +2 -2
- data/config/features.rb +50 -43
- data/config/initializers/1_healthz.rb +1 -0
- data/config/initializers/listeners.rb +4 -1
- data/config/initializers/valkryrie_storage.rb +7 -0
- data/config/locales/hyrax.de.yml +1 -1
- data/config/locales/hyrax.en.yml +2 -1
- data/config/locales/hyrax.es.yml +1 -1
- data/config/locales/hyrax.fr.yml +1 -1
- data/config/locales/hyrax.it.yml +1 -1
- data/config/locales/hyrax.pt-BR.yml +1 -1
- data/config/locales/hyrax.zh.yml +1 -1
- data/db/seeds.rb +1 -1
- data/docker-compose.yml +39 -8
- data/documentation/developing-your-hyrax-based-app.md +3 -3
- data/documentation/legacyREADME.md +3 -3
- data/hyrax.gemspec +1 -1
- data/lib/generators/hyrax/templates/catalog_controller.rb +3 -1
- data/lib/generators/hyrax/templates/config/initializers/hyrax.rb +15 -0
- data/lib/generators/hyrax/templates/config/initializers/riiif.rb +22 -20
- data/lib/generators/hyrax/work/templates/feature_spec.rb.erb +1 -1
- data/lib/generators/hyrax/work_resource/templates/indexer_spec.rb.erb +1 -0
- data/lib/hyrax/active_fedora_dummy_model.rb +62 -0
- data/lib/hyrax/collection_name.rb +6 -2
- data/lib/hyrax/configuration.rb +56 -0
- data/lib/hyrax/engine.rb +3 -1
- data/lib/hyrax/errors.rb +2 -0
- data/lib/hyrax/form_fields.rb +1 -0
- data/lib/hyrax/publisher.rb +12 -0
- data/lib/hyrax/resource_name.rb +1 -0
- data/lib/hyrax/resource_sync/change_list_writer.rb +2 -2
- data/lib/hyrax/resource_sync/resource_list_writer.rb +2 -2
- data/lib/hyrax/specs/capybara.rb +5 -3
- data/lib/hyrax/specs/shared_specs/hydra_works.rb +2 -0
- data/lib/hyrax/specs/shared_specs/indexers.rb +6 -0
- data/lib/hyrax/specs/shared_specs/valkyrie_storage_versions.rb +9 -0
- data/lib/hyrax/transactions/collection_create.rb +25 -0
- data/lib/hyrax/transactions/collection_update.rb +20 -0
- data/lib/hyrax/transactions/container.rb +47 -0
- data/lib/hyrax/transactions/file_set_destroy.rb +21 -0
- data/lib/hyrax/transactions/steps/add_file_sets.rb +3 -2
- data/lib/hyrax/transactions/steps/add_to_collections.rb +13 -1
- data/lib/hyrax/transactions/steps/add_to_parent.rb +36 -0
- data/lib/hyrax/transactions/steps/apply_collection_type_permissions.rb +29 -0
- data/lib/hyrax/transactions/steps/remove_file_set_from_work.rb +47 -0
- data/lib/hyrax/transactions/steps/save.rb +18 -6
- data/lib/hyrax/transactions/steps/set_collection_type_gid.rb +35 -0
- data/lib/hyrax/transactions/work_create.rb +2 -1
- data/lib/hyrax/valkyrie_can_can_adapter.rb +3 -0
- data/lib/hyrax/valkyrie_simple_path_generator.rb +20 -0
- data/lib/hyrax/version.rb +1 -1
- data/lib/hyrax.rb +9 -0
- data/lib/tasks/collection_type_global_id.rake +1 -1
- data/lib/tasks/default_admin_set.rake +12 -11
- data/lib/tasks/regenerate_derivatives.rake +12 -0
- data/lib/wings/active_fedora_converter/default_work.rb +15 -0
- data/lib/wings/converter_value_mapper.rb +2 -2
- data/lib/wings/model_transformer.rb +17 -1
- data/lib/wings/orm_converter.rb +18 -2
- data/lib/wings/setup.rb +2 -0
- data/lib/wings/valkyrie/persister.rb +7 -5
- data/lib/wings/valkyrie/query_service.rb +60 -17
- data/lib/wings/valkyrie/storage.rb +56 -1
- data/lib/wings.rb +0 -21
- data/template.rb +1 -1
- metadata +42 -9
data/config/brakeman.ignore
CHANGED
@@ -68,7 +68,7 @@
|
|
68
68
|
"file": "app/controllers/hyrax/users_controller.rb",
|
69
69
|
"line": 38,
|
70
70
|
"link": "http://brakemanscanner.org/docs/warning_types/sql_injection/",
|
71
|
-
"code": "::User.where(*base_query).where(\"#{Hydra.config.user_key_field} like lower(?) OR display_name like lower(?)\", (nil or ((\"%\" + query.downcase) + \"%\")), (nil or ((\"%\" + query.downcase) + \"%\"))).registered.where(\"#{Hydra.config.user_key_field} not in (?)\", [::User.batch_user_key, ::User.audit_user_key])",
|
71
|
+
"code": "::User.where(*base_query).where(\"#{Hydra.config.user_key_field} like lower(?) OR display_name like lower(?)\", (nil or ((\"%\" + query.downcase) + \"%\")), (nil or ((\"%\" + query.downcase) + \"%\"))).registered.where(\"#{Hydra.config.user_key_field} not in (?)\", [::User.system_user_key, ::User.batch_user_key, ::User.audit_user_key])",
|
72
72
|
"render_path": null,
|
73
73
|
"location": {
|
74
74
|
"type": "method",
|
@@ -88,7 +88,7 @@
|
|
88
88
|
"file": "app/models/concerns/hyrax/user.rb",
|
89
89
|
"line": 27,
|
90
90
|
"link": "http://brakemanscanner.org/docs/warning_types/sql_injection/",
|
91
|
-
"code": "where(\"#{Hydra.config.user_key_field} not in (?)\", [::User.batch_user_key, ::User.audit_user_key])",
|
91
|
+
"code": "where(\"#{Hydra.config.user_key_field} not in (?)\", [::User.system_user_key, ::User.batch_user_key, ::User.audit_user_key])",
|
92
92
|
"render_path": null,
|
93
93
|
"location": {
|
94
94
|
"type": "method",
|
data/config/features.rb
CHANGED
@@ -1,46 +1,53 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
Flipflop.configure do
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
3
|
+
begin
|
4
|
+
# Strategies will be used in the order listed here.
|
5
|
+
strategy :cookie
|
6
|
+
strategy :active_record, class: Hyrax::Feature
|
7
|
+
strategy Hyrax::Strategies::YamlStrategy, config: Hyrax.config.feature_config_path
|
8
|
+
strategy :default
|
9
|
+
|
10
|
+
feature :proxy_deposit,
|
11
|
+
default: true,
|
12
|
+
description: "Depositors may designate proxies to deposit works on their behalf"
|
13
|
+
|
14
|
+
feature :transfer_works,
|
15
|
+
default: true,
|
16
|
+
description: "Depositors may transfer their works to another user"
|
17
|
+
|
18
|
+
# Note, if this is deactivated, a default admin set will be created and all
|
19
|
+
# works will be assigned to it when they are created.
|
20
|
+
feature :assign_admin_set,
|
21
|
+
default: true,
|
22
|
+
description: "Ability to assign uploaded items to an admin set"
|
23
|
+
|
24
|
+
feature :show_deposit_agreement,
|
25
|
+
default: true,
|
26
|
+
description: "Show a deposit agreement to users creating works"
|
27
|
+
|
28
|
+
feature :active_deposit_agreement_acceptance,
|
29
|
+
default: Hyrax.config.active_deposit_agreement_acceptance?,
|
30
|
+
description: "Require an active acceptance of the deposit agreement by checking a checkbox"
|
31
|
+
|
32
|
+
feature :batch_upload,
|
33
|
+
default: false,
|
34
|
+
description: "Enable uploading batches of works"
|
35
|
+
|
36
|
+
feature :hide_private_items,
|
37
|
+
default: false,
|
38
|
+
description: "Do not show the private items."
|
39
|
+
|
40
|
+
feature :hide_users_list,
|
41
|
+
default: true,
|
42
|
+
description: "Do not show users list unless user has authenticated."
|
43
|
+
|
44
|
+
feature :cache_work_iiif_manifest,
|
45
|
+
default: false,
|
46
|
+
description: "Use Rails.cache to cache the JSON document for IIIF manifests"
|
47
|
+
feature :read_only,
|
48
|
+
default: false,
|
49
|
+
description: "Put the system into read-only mode. Deposits, edits, approvals and anything that makes a change to the data will be disabled."
|
50
|
+
rescue Flipflop::StrategyError, Flipflop::FeatureError => err
|
51
|
+
Rails.logger.warn "Ignoring #{err}: #{err.message}"
|
52
|
+
end
|
46
53
|
end
|
@@ -1,13 +1,16 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
Hyrax.publisher.subscribe(Hyrax::Listeners::AclIndexListener.new)
|
4
|
-
Hyrax.publisher.subscribe(Hyrax::Listeners::ActiveFedoraAclIndexListener.new)
|
4
|
+
Hyrax.publisher.subscribe(Hyrax::Listeners::ActiveFedoraAclIndexListener.new) unless
|
5
|
+
Hyrax.config.disable_wings
|
6
|
+
Hyrax.publisher.subscribe(Hyrax::Listeners::MemberCleanupListener.new)
|
5
7
|
Hyrax.publisher.subscribe(Hyrax::Listeners::MetadataIndexListener.new)
|
6
8
|
Hyrax.publisher.subscribe(Hyrax::Listeners::BatchNotificationListener.new)
|
7
9
|
Hyrax.publisher.subscribe(Hyrax::Listeners::ObjectLifecycleListener.new)
|
8
10
|
Hyrax.publisher.subscribe(Hyrax::Listeners::FileSetLifecycleListener.new)
|
9
11
|
Hyrax.publisher.subscribe(Hyrax::Listeners::FileSetLifecycleNotificationListener.new)
|
10
12
|
Hyrax.publisher.subscribe(Hyrax::Listeners::ProxyDepositListener.new)
|
13
|
+
Hyrax.publisher.subscribe(Hyrax::Listeners::TrophyCleanupListener.new)
|
11
14
|
Hyrax.publisher.subscribe(Hyrax::Listeners::WorkflowListener.new)
|
12
15
|
|
13
16
|
# Publish events from old style Hyrax::Callbacks to trigger the listeners
|
data/config/locales/hyrax.de.yml
CHANGED
data/config/locales/hyrax.en.yml
CHANGED
@@ -1221,7 +1221,7 @@ en:
|
|
1221
1221
|
subject: Batch upload complete
|
1222
1222
|
title: Files uploaded successfully
|
1223
1223
|
models:
|
1224
|
-
|
1224
|
+
file_set: File Set
|
1225
1225
|
hyrax/pcdm_collection: Collection
|
1226
1226
|
hyrax/work: Work
|
1227
1227
|
my:
|
@@ -1305,6 +1305,7 @@ en:
|
|
1305
1305
|
owner:
|
1306
1306
|
edit: Edit access
|
1307
1307
|
read: View/Download
|
1308
|
+
read_only: The repository is in read-only mode for maintenance. No submissions or edits can be made at this time.
|
1308
1309
|
search:
|
1309
1310
|
button:
|
1310
1311
|
html: <span class="glyphicon glyphicon-search" aria-hidden="true"></span> Go
|
data/config/locales/hyrax.es.yml
CHANGED
@@ -1222,7 +1222,7 @@ es:
|
|
1222
1222
|
subject: Subida en lote completa
|
1223
1223
|
title: Archivos cargados satisfactoriamente
|
1224
1224
|
models:
|
1225
|
-
|
1225
|
+
file_set: Conjunto de archivos
|
1226
1226
|
hyrax/pcdm_collection: Colección
|
1227
1227
|
hyrax/work: Trabaja
|
1228
1228
|
my:
|
data/config/locales/hyrax.fr.yml
CHANGED
@@ -1221,7 +1221,7 @@ fr:
|
|
1221
1221
|
subject: Téléchargement par lots complet
|
1222
1222
|
title: Fichiers téléchargés avec succès
|
1223
1223
|
models:
|
1224
|
-
|
1224
|
+
file_set: Ensemble de fichiers
|
1225
1225
|
hyrax/pcdm_collection: Collection
|
1226
1226
|
hyrax/work: Travailler
|
1227
1227
|
my:
|
data/config/locales/hyrax.it.yml
CHANGED
@@ -1215,7 +1215,7 @@ pt-BR:
|
|
1215
1215
|
subject: Carga em lote completo
|
1216
1216
|
title: Arquivos carregados com sucesso
|
1217
1217
|
models:
|
1218
|
-
|
1218
|
+
file_set: Conjunto de arquivos
|
1219
1219
|
hyrax/pcdm_collection: Coleção
|
1220
1220
|
hyrax/work: Trabalhar
|
1221
1221
|
my:
|
data/config/locales/hyrax.zh.yml
CHANGED
data/db/seeds.rb
CHANGED
@@ -10,7 +10,7 @@ errors = Hyrax::Workflow::WorkflowImporter.load_errors
|
|
10
10
|
abort("Failed to process all workflows:\n #{errors.join('\n ')}") unless errors.empty?
|
11
11
|
|
12
12
|
puts "\n== Creating default admin set"
|
13
|
-
admin_set_id =
|
13
|
+
admin_set_id = Hyrax::AdminSetCreateService.find_or_create_default_admin_set.id.to_s
|
14
14
|
|
15
15
|
# I have found that when I come back to a development
|
16
16
|
# environment, that I may have an AdminSet in Fedora, but it is
|
data/docker-compose.yml
CHANGED
@@ -7,7 +7,7 @@ services:
|
|
7
7
|
target: hyrax-engine-dev
|
8
8
|
args:
|
9
9
|
- EXTRA_APK_PACKAGES=git less
|
10
|
-
image:
|
10
|
+
image: ghcr.io/samvera/dassie
|
11
11
|
stdin_open: true
|
12
12
|
tty: true
|
13
13
|
user: root
|
@@ -33,6 +33,8 @@ services:
|
|
33
33
|
- hyrax-uploads:/app/samvera/hyrax-webapp/uploads
|
34
34
|
- rails-public:/app/samvera/hyrax-webapp/public
|
35
35
|
- rails-tmp:/app/samvera/hyrax-webapp/tmp
|
36
|
+
networks:
|
37
|
+
- hyrax
|
36
38
|
|
37
39
|
chrome:
|
38
40
|
image: selenium/standalone-chrome:3.141
|
@@ -44,9 +46,11 @@ services:
|
|
44
46
|
ports:
|
45
47
|
- "4444:4444"
|
46
48
|
- "5959:5900"
|
49
|
+
networks:
|
50
|
+
- hyrax
|
47
51
|
|
48
52
|
db_migrate:
|
49
|
-
image:
|
53
|
+
image: ghcr.io/samvera/dassie
|
50
54
|
user: root
|
51
55
|
env_file:
|
52
56
|
- .env
|
@@ -59,6 +63,8 @@ services:
|
|
59
63
|
- .:/app/samvera/hyrax-engine:cached
|
60
64
|
- rails-public:/app/samvera/hyrax-webapp/public
|
61
65
|
- rails-tmp:/app/samvera/hyrax-webapp/tmp
|
66
|
+
networks:
|
67
|
+
- hyrax
|
62
68
|
|
63
69
|
postgres:
|
64
70
|
image: postgres:latest
|
@@ -72,33 +78,48 @@ services:
|
|
72
78
|
- "5432:5432"
|
73
79
|
volumes:
|
74
80
|
- db:/var/lib/postgresql/data
|
81
|
+
networks:
|
82
|
+
- hyrax
|
75
83
|
|
76
84
|
fcrepo:
|
77
|
-
image:
|
85
|
+
image: ghcr.io/samvera/fcrepo4:4.7.5
|
78
86
|
volumes:
|
79
|
-
- fcrepo:/data
|
87
|
+
- fcrepo:/data:cached
|
80
88
|
ports:
|
81
89
|
- 8080:8080
|
82
|
-
|
83
|
-
-
|
90
|
+
networks:
|
91
|
+
- hyrax
|
84
92
|
|
85
93
|
memcached:
|
86
94
|
image: bitnami/memcached
|
87
95
|
ports:
|
88
96
|
- '11211:11211'
|
97
|
+
networks:
|
98
|
+
- hyrax
|
89
99
|
|
90
100
|
redis:
|
91
101
|
image: redis:5-alpine
|
92
102
|
volumes:
|
93
103
|
- redis:/data
|
104
|
+
networks:
|
105
|
+
- hyrax
|
94
106
|
|
95
107
|
sidekiq:
|
96
108
|
build:
|
97
109
|
context: .
|
98
110
|
target: hyrax-engine-dev-worker
|
111
|
+
image: ghcr.io/samvera/dassie-worker
|
112
|
+
user: root
|
99
113
|
env_file:
|
100
114
|
- .env
|
101
115
|
- .dassie/.env
|
116
|
+
depends_on:
|
117
|
+
- db_migrate
|
118
|
+
- fcrepo
|
119
|
+
- memcached
|
120
|
+
- postgres
|
121
|
+
- redis
|
122
|
+
- solr
|
102
123
|
volumes:
|
103
124
|
- .dassie:/app/samvera/hyrax-webapp:cached
|
104
125
|
- .:/app/samvera/hyrax-engine:cached
|
@@ -106,6 +127,8 @@ services:
|
|
106
127
|
- hyrax-uploads:/app/samvera/hyrax-webapp/uploads
|
107
128
|
- sidekiq-public:/app/samvera/hyrax-webapp/public
|
108
129
|
- sidekiq-tmp:/app/samvera/hyrax-webapp/tmp
|
130
|
+
networks:
|
131
|
+
- hyrax
|
109
132
|
|
110
133
|
solr:
|
111
134
|
image: solr:8.7
|
@@ -114,10 +137,12 @@ services:
|
|
114
137
|
command:
|
115
138
|
- sh
|
116
139
|
- "-c"
|
117
|
-
- "precreate-core hyrax_test /opt/solr/server/configsets/hyraxconf; precreate-core hyrax-valkyrie-test /opt/solr/server/configsets/hyraxconf; solr-precreate hyrax /opt/solr/server/configsets/hyraxconf"
|
140
|
+
- "precreate-core hyrax_test /opt/solr/server/configsets/hyraxconf; precreate-core hyrax-valkyrie-test /opt/solr/server/configsets/hyraxconf; precreate-core hyrax-valkyrie-dev /opt/solr/server/configsets/hyraxconf; solr-precreate hyrax /opt/solr/server/configsets/hyraxconf"
|
118
141
|
volumes:
|
119
|
-
- solr_home:/
|
142
|
+
- solr_home:/var/solr/data:cached
|
120
143
|
- .dassie/solr/conf:/opt/solr/server/configsets/hyraxconf
|
144
|
+
networks:
|
145
|
+
- hyrax
|
121
146
|
|
122
147
|
volumes:
|
123
148
|
db:
|
@@ -130,3 +155,9 @@ volumes:
|
|
130
155
|
sidekiq-public:
|
131
156
|
sidekiq-tmp:
|
132
157
|
solr_home:
|
158
|
+
|
159
|
+
networks:
|
160
|
+
hyrax:
|
161
|
+
driver: bridge
|
162
|
+
driver_opts:
|
163
|
+
com.docker.network.bridge.name: br-hyrax
|
@@ -30,7 +30,7 @@ A Hyrax-based application includes lots of dependencies. We provide a [Docker im
|
|
30
30
|
You can also try [Running Hyrax-based application in local VM](https://github.com/samvera/hyrax/wiki/Hyrax-Development-Guide#running-hyrax-based-application-in-local-vm) which uses Ubuntu.
|
31
31
|
|
32
32
|
This document contains instructions specific to setting up an app with __Hyrax
|
33
|
-
v3.0.
|
33
|
+
v3.0.1__. If you are looking for instructions on installing a different
|
34
34
|
version, be sure to select the appropriate branch or tag from the drop-down
|
35
35
|
menu above.
|
36
36
|
|
@@ -109,7 +109,7 @@ Hyrax requires Rails 5. We recommend the latest Rails 5.2 release.
|
|
109
109
|
|
110
110
|
```
|
111
111
|
# If you don't already have Rails at your disposal...
|
112
|
-
gem install rails -v 5.2.
|
112
|
+
gem install rails -v 5.2.6
|
113
113
|
```
|
114
114
|
|
115
115
|
### JavaScript runtime
|
@@ -125,7 +125,7 @@ NOTE: The steps need to be done in order to create a new Hyrax based app.
|
|
125
125
|
Generate a new Rails application using the template.
|
126
126
|
|
127
127
|
```
|
128
|
-
rails _5.2.
|
128
|
+
rails _5.2.6_ new my_app -m https://raw.githubusercontent.com/samvera/hyrax/v3.2.0/template.rb
|
129
129
|
```
|
130
130
|
|
131
131
|
Generating a new Rails application using Hyrax's template above takes cares of a number of steps for you, including:
|
@@ -50,7 +50,7 @@ The Samvera community is here to help. Please see our [support guide](./.github/
|
|
50
50
|
# Getting started
|
51
51
|
|
52
52
|
This document contains instructions specific to setting up an app with __Hyrax
|
53
|
-
v3.
|
53
|
+
v3.2.0__. If you are looking for instructions on installing a different
|
54
54
|
version, be sure to select the appropriate branch or tag from the drop-down
|
55
55
|
menu above.
|
56
56
|
|
@@ -143,7 +143,7 @@ Hyrax requires Rails 5. We recommend the latest Rails 5.2 release.
|
|
143
143
|
|
144
144
|
```
|
145
145
|
# If you don't already have Rails at your disposal...
|
146
|
-
gem install rails -v 5.2.
|
146
|
+
gem install rails -v 5.2.6
|
147
147
|
```
|
148
148
|
|
149
149
|
### JavaScript runtime
|
@@ -159,7 +159,7 @@ NOTE: The steps need to be done in order to create a new Hyrax based app.
|
|
159
159
|
Generate a new Rails application using the template.
|
160
160
|
|
161
161
|
```
|
162
|
-
rails _5.2.
|
162
|
+
rails _5.2.6_ new my_app -m https://raw.githubusercontent.com/samvera/hyrax/v3.0.2/template.rb
|
163
163
|
```
|
164
164
|
|
165
165
|
Generating a new Rails application using Hyrax's template above takes cares of a number of steps for you, including:
|
data/hyrax.gemspec
CHANGED
@@ -82,7 +82,7 @@ SUMMARY
|
|
82
82
|
spec.add_dependency 'select2-rails', '~> 3.5'
|
83
83
|
spec.add_dependency 'signet'
|
84
84
|
spec.add_dependency 'tinymce-rails'
|
85
|
-
spec.add_dependency 'valkyrie', '>= 2.1.1'
|
85
|
+
spec.add_dependency 'valkyrie', '~> 2', '>= 2.1.1'
|
86
86
|
|
87
87
|
spec.add_development_dependency "capybara", '~> 3.29'
|
88
88
|
spec.add_development_dependency 'capybara-screenshot', '~> 1.0'
|
@@ -5,6 +5,8 @@ class CatalogController < ApplicationController
|
|
5
5
|
|
6
6
|
# This filter applies the hydra access controls
|
7
7
|
before_action :enforce_show_permissions, only: :show
|
8
|
+
# Allow all search options when in read-only mode
|
9
|
+
skip_before_action :check_read_only
|
8
10
|
|
9
11
|
def self.uploaded_field
|
10
12
|
"system_create_dtsi"
|
@@ -22,7 +24,7 @@ class CatalogController < ApplicationController
|
|
22
24
|
config.view.slideshow.partials = [:index]
|
23
25
|
|
24
26
|
# Because too many times on Samvera tech people raise a problem regarding a failed query to SOLR.
|
25
|
-
# Often, it's because they
|
27
|
+
# Often, it's because they inadvertently exceeded the character limit of a GET request.
|
26
28
|
config.http_method = :post
|
27
29
|
|
28
30
|
## Default parameters to send to solr for all search-like requests. See also SolrHelper#solr_search_params
|
@@ -159,6 +159,11 @@ Hyrax.config do |config|
|
|
159
159
|
# Should a button with "Share my work" show on the front page to all users (even those not logged in)?
|
160
160
|
# config.display_share_button_when_not_logged_in = true
|
161
161
|
|
162
|
+
# This user is logged as the acting user for jobs and other processes that
|
163
|
+
# run without being attributed to a specific user (e.g. creation of the
|
164
|
+
# default admin set).
|
165
|
+
# config.system_user_key = 'systemuser@example.com'
|
166
|
+
|
162
167
|
# The user who runs batch jobs. Update this if you aren't using emails
|
163
168
|
# config.batch_user_key = 'batchuser@example.com'
|
164
169
|
|
@@ -233,6 +238,16 @@ Hyrax.config do |config|
|
|
233
238
|
# "#{ActiveFedora.fedora.host}#{ActiveFedora.fedora.base_path}/#{Noid::Rails.treeify(id)}"
|
234
239
|
# end
|
235
240
|
|
241
|
+
# Identify the model class name that will be used for Collections in your app
|
242
|
+
# (i.e. ::Collection for ActiveFedora, Hyrax::PcdmCollection for Valkyrie)
|
243
|
+
# config.collection_model = '::Collection'
|
244
|
+
# config.collection_model = 'Hyrax::PcdmCollection'
|
245
|
+
|
246
|
+
# Identify the model class name that will be used for Admin Sets in your app
|
247
|
+
# (i.e. AdminSet for ActiveFedora, Hyrax::AdministrativeSet for Valkyrie)
|
248
|
+
# config.admin_set_model = 'AdminSet'
|
249
|
+
# config.admin_set_model = 'Hyrax::AdministrativeSet'
|
250
|
+
|
236
251
|
# When your application is ready to use the valkyrie index instead of the one
|
237
252
|
# maintained by active fedora, you will need to set this to true. You will
|
238
253
|
# also need to update your Blacklight configuration.
|
@@ -1,27 +1,29 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
|
3
|
-
Riiif::Image.
|
4
|
-
|
5
|
-
|
6
|
-
|
2
|
+
ActiveSupport::Reloader.to_prepare do
|
3
|
+
Riiif::Image.file_resolver = Riiif::HttpFileResolver.new
|
4
|
+
Riiif::Image.info_service = lambda do |id, _file|
|
5
|
+
# id will look like a path to a pcdm:file
|
6
|
+
# (e.g. rv042t299%2Ffiles%2F6d71677a-4f80-42f1-ae58-ed1063fd79c7)
|
7
|
+
# but we just want the id for the FileSet it's attached to.
|
7
8
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
end
|
9
|
+
# Capture everything before the first slash
|
10
|
+
fs_id = id.sub(/\A([^\/]*)\/.*/, '\1')
|
11
|
+
resp = Hyrax::SolrService.get("id:#{fs_id}")
|
12
|
+
doc = resp['response']['docs'].first
|
13
|
+
raise "Unable to find solr document with id:#{fs_id}" unless doc
|
14
|
+
{ height: doc['height_is'], width: doc['width_is'], format: doc['mime_type_ssi'], channels: doc['alpha_channels_ssi'] }
|
15
|
+
end
|
15
16
|
|
16
|
-
Riiif::Image.file_resolver.id_to_uri = lambda do |id|
|
17
|
-
|
18
|
-
|
17
|
+
Riiif::Image.file_resolver.id_to_uri = lambda do |id|
|
18
|
+
Hyrax::Base.id_to_uri(CGI.unescape(id)).tap do |url|
|
19
|
+
Rails.logger.info "Riiif resolved #{id} to #{url}"
|
20
|
+
end
|
19
21
|
end
|
20
|
-
end
|
21
22
|
|
22
|
-
Riiif::Image.authorization_service = Hyrax::IIIFAuthorizationService
|
23
|
+
Riiif::Image.authorization_service = Hyrax::IIIFAuthorizationService
|
23
24
|
|
24
|
-
Riiif.not_found_image = Rails.root.join('app', 'assets', 'images', 'us_404.svg')
|
25
|
-
Riiif.unauthorized_image = Rails.root.join('app', 'assets', 'images', 'us_404.svg')
|
25
|
+
Riiif.not_found_image = Rails.root.join('app', 'assets', 'images', 'us_404.svg')
|
26
|
+
Riiif.unauthorized_image = Rails.root.join('app', 'assets', 'images', 'us_404.svg')
|
26
27
|
|
27
|
-
Riiif::Engine.config.cache_duration = 365.days
|
28
|
+
Riiif::Engine.config.cache_duration = 365.days
|
29
|
+
end
|
@@ -12,7 +12,7 @@ RSpec.feature 'Create a <%= class_name %>', js: false do
|
|
12
12
|
let(:user) do
|
13
13
|
User.new(user_attributes) { |u| u.save(validate: false) }
|
14
14
|
end
|
15
|
-
let(:admin_set_id) {
|
15
|
+
let(:admin_set_id) { Hyrax::AdminSetCreateService.find_or_create_default_admin_set.id.to_s }
|
16
16
|
let(:permission_template) { Hyrax::PermissionTemplate.find_or_create_by!(source_id: admin_set_id) }
|
17
17
|
let(:workflow) { Sipity::Workflow.create!(active: true, name: 'test-workflow', permission_template: permission_template) }
|
18
18
|
|
@@ -0,0 +1,62 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module Hyrax
|
3
|
+
##
|
4
|
+
# @api public
|
5
|
+
#
|
6
|
+
# Given a model class and an +id+, provides +ActiveModel+ style methods. This
|
7
|
+
# is a tool for providing route resolution and other +ActiveModel+ behavior
|
8
|
+
# for +ActiveFedora+ without loading the object from the fedora backend.
|
9
|
+
#
|
10
|
+
# @note this was originally implemented for +SolrDocument+ as
|
11
|
+
# +Hyrax::SolrDocumentBehavior::ModelWrapper+, but is useful in the more
|
12
|
+
# general case that we know the model class and id, but don't have a full
|
13
|
+
# model object.
|
14
|
+
#
|
15
|
+
class ActiveFedoraDummyModel
|
16
|
+
##
|
17
|
+
# @api public
|
18
|
+
#
|
19
|
+
# @param [Class] model
|
20
|
+
# @param [String, nil] id
|
21
|
+
def initialize(model, id)
|
22
|
+
@model = model
|
23
|
+
@id = id
|
24
|
+
end
|
25
|
+
|
26
|
+
##
|
27
|
+
# @api public
|
28
|
+
def persisted?
|
29
|
+
true
|
30
|
+
end
|
31
|
+
|
32
|
+
##
|
33
|
+
# @api public
|
34
|
+
def to_param
|
35
|
+
@id
|
36
|
+
end
|
37
|
+
|
38
|
+
##
|
39
|
+
# @api public
|
40
|
+
def model_name
|
41
|
+
@model.model_name
|
42
|
+
end
|
43
|
+
|
44
|
+
##
|
45
|
+
# @api public
|
46
|
+
#
|
47
|
+
# @note uses the @model's `._to_partial_path` if implemented, otherwise
|
48
|
+
# constructs a default
|
49
|
+
def to_partial_path
|
50
|
+
return @model._to_partial_path if
|
51
|
+
@model.respond_to?(:_to_partial_path)
|
52
|
+
|
53
|
+
"hyrax/#{model_name.collection}/#{model_name.element}"
|
54
|
+
end
|
55
|
+
|
56
|
+
##
|
57
|
+
# @api public
|
58
|
+
def to_global_id
|
59
|
+
URI::GID.build app: GlobalID.app, model_name: model_name.name, model_id: @id
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
@@ -8,8 +8,12 @@ module Hyrax
|
|
8
8
|
def initialize(klass, namespace = nil, name = nil)
|
9
9
|
super
|
10
10
|
|
11
|
-
@
|
12
|
-
@
|
11
|
+
@human = 'Collection'
|
12
|
+
@i18n_key = :collection
|
13
|
+
@param_key = 'collection'
|
14
|
+
@plural = 'collections'
|
15
|
+
@route_key = 'collections'
|
16
|
+
@singular_route_key = 'collection'
|
13
17
|
end
|
14
18
|
end
|
15
19
|
end
|