hyrax 5.0.1 → 5.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.circleci/config.yml +7 -176
- data/.dassie/.env +8 -3
- data/.dassie/Gemfile +13 -2
- data/.dassie/app/controllers/hyrax/generic_work_resources_controller.rb +17 -0
- data/.dassie/app/controllers/hyrax/generic_works_controller.rb +7 -1
- data/.dassie/app/forms/generic_work_resource_form.rb +20 -0
- data/.dassie/app/indexers/generic_work_resource_indexer.rb +16 -0
- data/.dassie/app/models/admin_set_resource.rb +9 -0
- data/.dassie/app/models/collection_resource.rb +2 -0
- data/.dassie/app/models/file_set.rb +2 -0
- data/.dassie/app/models/generic_work_resource.rb +10 -0
- data/.dassie/app/views/hyrax/generic_work_resources/_generic_work_resource.html.erb +2 -0
- data/.dassie/config/analytics.yml +6 -1
- data/.dassie/config/application.rb +24 -0
- data/.dassie/config/initializers/hyrax.rb +13 -3
- data/.dassie/config/initializers/wings.rb +109 -0
- data/.dassie/config/metadata/generic_work_resource.yaml +22 -0
- data/.dassie/config/valkyrie_index.yml +4 -10
- data/.dassie/db/migrate/20240506070809_valkyrie_id_to_string.rb +5 -0
- data/.dassie/db/schema.rb +2 -2
- data/.dassie/spec/indexers/generic_work_resource_indexer_spec.rb +13 -0
- data/.dassie/spec/models/generic_work_resource_spec.rb +12 -0
- data/.dassie/spec/views/generic_work_resources/_generic_work_resource.html.erb_spec.rb +7 -0
- data/.dockerignore +6 -4
- data/.github/release.yml +3 -0
- data/.github/workflows/lint-build-test.yml +130 -0
- data/.github/workflows/test-results.yml +40 -0
- data/.koppie/.env +7 -5
- data/.koppie/Gemfile +12 -1
- data/.koppie/config/analytics.yml +6 -1
- data/.koppie/config/environments/test.rb +2 -0
- data/.koppie/config/initializers/1_valkyrie.rb +6 -2
- data/.koppie/config/solr.yml +1 -1
- data/.regen +1 -1
- data/.rubocop.yml +5 -0
- data/Dockerfile +16 -36
- data/Gemfile +2 -0
- data/app/assets/javascripts/hydra-editor/field_manager.es6 +187 -0
- data/app/assets/javascripts/hyrax/analytics_events.js +48 -24
- data/app/assets/javascripts/hyrax/collapse.js +4 -4
- data/app/assets/javascripts/hyrax/file_manager/save_manager.es6 +2 -0
- data/app/assets/javascripts/hyrax/search.js +2 -3
- data/app/assets/javascripts/hyrax/select_work_type.es6 +3 -1
- data/app/assets/javascripts/hyrax/uploader.js +20 -18
- data/app/assets/javascripts/hyrax.js +1 -0
- data/app/assets/stylesheets/_bootstrap-default-overrides.scss +4 -0
- data/app/assets/stylesheets/hyrax/_card.scss +4 -0
- data/app/assets/stylesheets/hyrax/_catalog.scss +21 -0
- data/app/assets/stylesheets/hyrax/_collections.scss +1 -1
- data/app/assets/stylesheets/hyrax/_facets.scss +15 -3
- data/app/assets/stylesheets/hyrax/_featured.scss +4 -0
- data/app/assets/stylesheets/hyrax/_form.scss +4 -0
- data/app/assets/stylesheets/hyrax/_forms.scss +2 -1
- data/app/assets/stylesheets/hyrax/_nestable.scss +9 -8
- data/app/assets/stylesheets/hyrax/_select_work_type.scss +12 -0
- data/app/assets/stylesheets/hyrax/_styles.scss +4 -0
- data/app/assets/stylesheets/hyrax/_work-show.scss +3 -0
- data/app/controllers/concerns/hyrax/singular_subresource_controller.rb +7 -2
- data/app/controllers/concerns/hyrax/valkyrie_downloads_controller_behavior.rb +11 -2
- data/app/controllers/concerns/hyrax/works_controller_behavior.rb +9 -2
- data/app/controllers/hyrax/admin/analytics/collection_reports_controller.rb +2 -2
- data/app/controllers/hyrax/admin/analytics/work_reports_controller.rb +7 -8
- data/app/controllers/hyrax/dashboard/collections_controller.rb +2 -1
- data/app/controllers/hyrax/downloads_controller.rb +24 -3
- data/app/controllers/hyrax/file_sets_controller.rb +32 -6
- data/app/controllers/hyrax/my/works_controller.rb +20 -0
- data/app/controllers/hyrax/stats_controller.rb +1 -1
- data/app/controllers/hyrax/uploads_controller.rb +28 -2
- data/app/forms/hyrax/forms/admin/appearance.rb +1 -1
- data/app/forms/hyrax/forms/admin/collection_type_form.rb +1 -7
- data/app/forms/hyrax/forms/pcdm_collection_form.rb +9 -0
- data/app/forms/hyrax/forms/work_embargo_form.rb +6 -0
- data/app/forms/hyrax/forms/work_lease_form.rb +6 -0
- data/app/indexers/concerns/hyrax/location_indexer.rb +2 -2
- data/app/indexers/hyrax/indexers/file_set_indexer.rb +4 -0
- data/app/indexers/hyrax/indexers/resource_indexer.rb +1 -0
- data/app/indexers/hyrax/valkyrie_indexer.rb +3 -5
- data/app/jobs/migrate_files_to_valkyrie_job.rb +109 -0
- data/app/jobs/migrate_resources_job.rb +34 -0
- data/app/jobs/valkyrie_create_derivatives_job.rb +2 -1
- data/app/models/admin_set.rb +1 -0
- data/app/models/concerns/hyrax/ar_resource.rb +104 -0
- data/app/models/concerns/hyrax/solr_document/ordered_members.rb +2 -1
- data/app/models/concerns/hyrax/solr_document_behavior.rb +13 -2
- data/app/models/concerns/hyrax/valkyrie_lazy_migration.rb +82 -0
- data/app/models/file_download_stat.rb +1 -1
- data/app/models/file_view_stat.rb +1 -1
- data/app/models/hyrax/collection_type.rb +12 -4
- data/app/models/hyrax/file_metadata.rb +19 -0
- data/app/models/hyrax/file_set.rb +25 -0
- data/app/models/hyrax/model_registry.rb +2 -3
- data/app/models/hyrax/resource.rb +5 -0
- data/app/models/hyrax/statistic.rb +12 -37
- data/app/presenters/hyrax/file_set_presenter.rb +2 -1
- data/app/presenters/hyrax/file_usage.rb +3 -3
- data/app/presenters/hyrax/iiif_manifest_presenter.rb +2 -1
- data/app/presenters/hyrax/member_presenter_factory.rb +7 -1
- data/app/presenters/hyrax/menu_presenter.rb +1 -1
- data/app/presenters/hyrax/stats_usage_presenter.rb +2 -1
- data/app/presenters/hyrax/work_show_presenter.rb +13 -17
- data/app/presenters/hyrax/work_usage.rb +5 -2
- data/app/search_builders/hyrax/expired_embargo_search_builder.rb +7 -1
- data/app/search_builders/hyrax/expired_lease_search_builder.rb +7 -1
- data/app/search_builders/hyrax/filter_by_type.rb +1 -3
- data/app/search_builders/hyrax/valkyrie_abstract_type_relation.rb +7 -2
- data/app/services/hyrax/access_control_list.rb +1 -1
- data/app/services/hyrax/admin_set_create_service.rb +16 -5
- data/app/services/hyrax/admin_set_service.rb +2 -1
- data/app/services/hyrax/analytics/ga4/base.rb +96 -0
- data/app/services/hyrax/analytics/ga4/events.rb +25 -0
- data/app/services/hyrax/analytics/ga4/events_daily.rb +36 -0
- data/app/services/hyrax/analytics/ga4/visits.rb +33 -0
- data/app/services/hyrax/analytics/ga4/visits_daily.rb +24 -0
- data/app/services/hyrax/analytics/ga4.rb +204 -0
- data/app/services/hyrax/analytics/google.rb +16 -2
- data/app/services/hyrax/analytics/matomo.rb +16 -3
- data/app/services/hyrax/analytics/results.rb +6 -0
- data/app/services/hyrax/custom_queries/find_access_control.rb +1 -1
- data/app/services/hyrax/custom_queries/find_by_date_range.rb +6 -23
- data/app/services/hyrax/custom_queries/find_collections_by_type.rb +2 -2
- data/app/services/hyrax/custom_queries/find_count_by.rb +3 -31
- data/app/services/hyrax/custom_queries/find_file_metadata.rb +2 -2
- data/app/services/hyrax/custom_queries/find_models_by_access.rb +5 -27
- data/app/services/hyrax/embargo_manager.rb +2 -1
- data/app/services/hyrax/listeners/file_listener.rb +2 -2
- data/app/services/hyrax/lock_manager.rb +6 -6
- data/app/services/hyrax/lockable.rb +4 -3
- data/app/services/hyrax/simple_schema_loader.rb +1 -1
- data/app/services/hyrax/solr_service.rb +22 -8
- data/app/services/hyrax/statistics/query_service.rb +1 -1
- data/app/services/hyrax/statistics/works/over_time.rb +1 -1
- data/app/services/hyrax/thumbnail_path_service.rb +2 -0
- data/app/services/hyrax/user_stat_importer.rb +5 -5
- data/app/services/hyrax/valkyrie_upload.rb +9 -7
- data/app/services/hyrax/versioning_service.rb +10 -2
- data/app/services/hyrax/work_query_service.rb +2 -2
- data/app/services/migrate_resource_service.rb +55 -0
- data/app/views/_controls.html.erb +5 -5
- data/app/views/_masthead.html.erb +1 -1
- data/app/views/catalog/_search_form.html.erb +9 -16
- data/app/views/catalog/_thumbnail_list_collection.html.erb +1 -1
- data/app/views/catalog/_thumbnail_list_default.html.erb +2 -2
- data/app/views/hyrax/admin/analytics/collection_reports/index.html.erb +4 -4
- data/app/views/hyrax/admin/analytics/work_reports/index.html.erb +1 -1
- data/app/views/hyrax/admin/collection_types/_form.html.erb +4 -4
- data/app/views/hyrax/admin/collection_types/index.html.erb +1 -1
- data/app/views/hyrax/admin/features/index.html.erb +1 -1
- data/app/views/hyrax/base/_file_manager_actions.html.erb +1 -1
- data/app/views/hyrax/base/_file_manager_member.html.erb +7 -4
- data/app/views/hyrax/base/_file_manager_thumbnail.html.erb +1 -1
- data/app/views/hyrax/base/_form_files.html.erb +1 -1
- data/app/views/hyrax/base/_form_member_of_collections.html.erb +4 -0
- data/app/views/hyrax/base/_show_actions.html.erb +7 -8
- data/app/views/hyrax/base/_work_button_row.html.erb +1 -1
- data/app/views/hyrax/batch_select/_add_button.html.erb +1 -1
- data/app/views/hyrax/content_blocks/_form.html.erb +3 -3
- data/app/views/hyrax/dashboard/_sidebar.html.erb +1 -1
- data/app/views/hyrax/dashboard/_user_activity.html.erb +2 -2
- data/app/views/hyrax/dashboard/collections/_form.html.erb +4 -4
- data/app/views/hyrax/dashboard/collections/_form_share.html.erb +6 -4
- data/app/views/hyrax/dashboard/collections/_list_collections.html.erb +1 -1
- data/app/views/hyrax/dashboard/collections/_show_document_list_row.html.erb +1 -1
- data/app/views/hyrax/dashboard/show_admin.html.erb +18 -19
- data/app/views/hyrax/dashboard/sidebar/_activity.html.erb +1 -1
- data/app/views/hyrax/embargoes/_list_expired_active_embargoes.html.erb +7 -7
- data/app/views/hyrax/file_sets/_actions.html.erb +9 -1
- data/app/views/hyrax/file_sets/_permission_form.html.erb +4 -2
- data/app/views/hyrax/file_sets/_show_actions.html.erb +1 -1
- data/app/views/hyrax/homepage/_featured.html.erb +1 -1
- data/app/views/hyrax/homepage/_recent_document.html.erb +2 -2
- data/app/views/hyrax/leases/_list_expired_active_leases.html.erb +6 -6
- data/app/views/hyrax/my/collections/_list_collections.html.erb +1 -1
- data/app/views/hyrax/my/collections/_tabs.html.erb +1 -1
- data/app/views/hyrax/pages/_form.html.erb +8 -8
- data/app/views/hyrax/transfers/_received.html.erb +1 -1
- data/app/views/hyrax/uploads/create.json.jbuilder +2 -2
- data/app/views/hyrax/users/_activity_log.html.erb +15 -9
- data/app/views/hyrax/users/_user_row.html.erb +6 -3
- data/app/views/hyrax/users/_vitals.html.erb +3 -2
- data/app/views/layouts/_head_tag_content.html.erb +2 -0
- data/app/views/shared/_appearance_styles.html.erb +5 -1
- data/app/views/shared/_ga4.html.erb +11 -0
- data/app/views/shared/_select_work_type_modal.html.erb +10 -1
- data/bin/db-migrate-seed.sh +3 -3
- data/bin/dev-entrypoint.sh +7 -2
- data/bin/{db-wait.sh → service-wait.sh} +1 -1
- data/bin/worker-entrypoint.sh +8 -0
- data/chart/hyrax/templates/deployment-worker.yaml +2 -2
- data/config/locales/hyrax.en.yml +4 -2
- data/config/metadata/basic_metadata.yaml +20 -0
- data/config/metadata/hyrax_internal_metadata.yaml +1 -1
- data/docker-compose-dassie.yml +167 -0
- data/docker-compose-koppie.yml +21 -36
- data/docker-compose-sirenia.yml +50 -44
- data/docker-compose.yml +2 -183
- data/documentation/developing-your-hyrax-based-app.md +2 -2
- data/hyrax.gemspec +5 -4
- data/lib/freyja/custom_query_container.rb +5 -0
- data/lib/freyja/metadata_adapter.rb +32 -0
- data/lib/freyja/persister.rb +42 -0
- data/lib/freyja/query_service.rb +20 -0
- data/lib/freyja/resource_factory.rb +8 -0
- data/lib/freyja.rb +14 -0
- data/lib/frigg/custom_query_container.rb +5 -0
- data/lib/frigg/metadata_adapter.rb +22 -0
- data/lib/frigg/persister.rb +33 -0
- data/lib/frigg/query_service.rb +15 -0
- data/lib/frigg.rb +13 -0
- data/lib/generators/hyrax/install_generator.rb +5 -0
- data/lib/generators/hyrax/templates/config/analytics.yml +6 -1
- data/lib/generators/hyrax/templates/config/initializers/1_valkyrie.rb +6 -2
- data/lib/generators/hyrax/templates/config/valkyrie_index.yml +1 -1
- data/lib/goddess/custom_query_container.rb +71 -0
- data/lib/goddess/metadata.rb +13 -0
- data/lib/goddess/query.rb +176 -0
- data/lib/hyrax/configuration.rb +83 -0
- data/lib/hyrax/engine.rb +2 -0
- data/lib/hyrax/form_fields.rb +1 -3
- data/lib/hyrax/name.rb +5 -0
- data/lib/hyrax/rubocop/custom_cops.rb +30 -0
- data/lib/hyrax/specs/capybara.rb +10 -6
- data/lib/hyrax/specs/shared_specs/factories/admin_sets.rb +2 -0
- data/lib/hyrax/specs/shared_specs/factories/hyrax_embargo.rb +4 -0
- data/lib/hyrax/specs/shared_specs/factories/hyrax_lease.rb +4 -0
- data/lib/hyrax/specs/shared_specs/factories/hyrax_work.rb +16 -2
- data/lib/hyrax/specs/shared_specs/hydra_works.rb +1 -1
- data/lib/hyrax/transactions/admin_set_destroy.rb +2 -1
- data/lib/hyrax/transactions/collection_destroy.rb +2 -1
- data/lib/hyrax/transactions/container.rb +9 -0
- data/lib/hyrax/transactions/steps/add_file_sets.rb +2 -1
- data/lib/hyrax/transactions/steps/delete_permission_template.rb +30 -0
- data/lib/hyrax/transactions/steps/delete_resource.rb +1 -1
- data/lib/hyrax/transactions/steps/save_collection_logo.rb +2 -1
- data/lib/hyrax/valkyrie_can_can_adapter.rb +8 -1
- data/lib/hyrax/version.rb +1 -1
- data/lib/wings/active_fedora_converter.rb +13 -5
- data/lib/wings/converter_value_mapper.rb +1 -0
- data/lib/wings/services/custom_queries/find_collections_by_type.rb +2 -1
- data/lib/wings/services/custom_queries/find_file_metadata.rb +2 -2
- data/lib/wings/setup.rb +12 -3
- data/lib/wings/transformer_value_mapper.rb +5 -1
- data/lib/wings/valkyrie/persister.rb +3 -1
- data/template.rb +1 -1
- metadata +77 -19
- data/.koppie/scripts/db-migrate-seed.sh +0 -9
- data/.koppie/scripts/entrypoint.sh +0 -10
data/docker-compose.yml
CHANGED
|
@@ -1,183 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
services:
|
|
4
|
-
app: &app
|
|
5
|
-
build:
|
|
6
|
-
context: .
|
|
7
|
-
target: hyrax-engine-dev
|
|
8
|
-
args:
|
|
9
|
-
- EXTRA_APK_PACKAGES=git less
|
|
10
|
-
- BUNDLE_GEMFILE=Gemfile.dassie
|
|
11
|
-
image: samvera/dassie
|
|
12
|
-
entrypoint: dev-entrypoint.sh
|
|
13
|
-
command: sh -c 'bundle exec puma -v -b tcp://0.0.0.0:3000'
|
|
14
|
-
stdin_open: true
|
|
15
|
-
tty: true
|
|
16
|
-
user: root
|
|
17
|
-
env_file:
|
|
18
|
-
- .dassie/.env
|
|
19
|
-
environment:
|
|
20
|
-
- RAILS_ROOT=/app/samvera/hyrax-webapp
|
|
21
|
-
depends_on:
|
|
22
|
-
- chrome
|
|
23
|
-
- db_migrate
|
|
24
|
-
- fcrepo
|
|
25
|
-
- memcached
|
|
26
|
-
- postgres
|
|
27
|
-
- redis
|
|
28
|
-
- solr
|
|
29
|
-
ports:
|
|
30
|
-
- 3000:3000
|
|
31
|
-
- 9876:9876
|
|
32
|
-
volumes:
|
|
33
|
-
- ./bin:/app/samvera
|
|
34
|
-
- .dassie:/app/samvera/hyrax-webapp
|
|
35
|
-
- .:/app/samvera/hyrax-engine
|
|
36
|
-
- bundle:/app/bundle
|
|
37
|
-
- hyrax-derivatives:/app/samvera/hyrax-webapp/derivatives
|
|
38
|
-
- hyrax-uploads:/app/samvera/hyrax-webapp/uploads
|
|
39
|
-
- rails-public:/app/samvera/hyrax-webapp/public
|
|
40
|
-
- rails-tmp:/app/samvera/hyrax-webapp/tmp
|
|
41
|
-
networks:
|
|
42
|
-
- hyrax
|
|
43
|
-
|
|
44
|
-
sidekiq:
|
|
45
|
-
image: samvera/dassie
|
|
46
|
-
entrypoint: dev-entrypoint.sh
|
|
47
|
-
command: sh -c 'bundle exec sidekiq'
|
|
48
|
-
user: root
|
|
49
|
-
env_file:
|
|
50
|
-
- .dassie/.env
|
|
51
|
-
depends_on:
|
|
52
|
-
- db_migrate
|
|
53
|
-
- fcrepo
|
|
54
|
-
- memcached
|
|
55
|
-
- postgres
|
|
56
|
-
- redis
|
|
57
|
-
- solr
|
|
58
|
-
volumes:
|
|
59
|
-
- ./bin:/app/samvera
|
|
60
|
-
- .dassie:/app/samvera/hyrax-webapp
|
|
61
|
-
- .:/app/samvera/hyrax-engine
|
|
62
|
-
- bundle:/app/bundle
|
|
63
|
-
- hyrax-derivatives:/app/samvera/hyrax-webapp/derivatives
|
|
64
|
-
- hyrax-uploads:/app/samvera/hyrax-webapp/uploads
|
|
65
|
-
- rails-public:/app/samvera/hyrax-webapp/public
|
|
66
|
-
- rails-tmp:/app/samvera/hyrax-webapp/tmp
|
|
67
|
-
networks:
|
|
68
|
-
- hyrax
|
|
69
|
-
|
|
70
|
-
db_migrate:
|
|
71
|
-
image: samvera/dassie
|
|
72
|
-
user: root
|
|
73
|
-
env_file:
|
|
74
|
-
- .dassie/.env
|
|
75
|
-
entrypoint: dev-entrypoint.sh
|
|
76
|
-
command: db-migrate-seed.sh
|
|
77
|
-
depends_on:
|
|
78
|
-
- postgres
|
|
79
|
-
volumes:
|
|
80
|
-
- ./bin:/app/samvera
|
|
81
|
-
- .dassie:/app/samvera/hyrax-webapp
|
|
82
|
-
- .:/app/samvera/hyrax-engine
|
|
83
|
-
- bundle:/app/bundle
|
|
84
|
-
- rails-public:/app/samvera/hyrax-webapp/public
|
|
85
|
-
- rails-tmp:/app/samvera/hyrax-webapp/tmp
|
|
86
|
-
networks:
|
|
87
|
-
- hyrax
|
|
88
|
-
|
|
89
|
-
chrome:
|
|
90
|
-
image: seleniarm/standalone-chromium:114.0
|
|
91
|
-
environment:
|
|
92
|
-
- START_XVFB=false
|
|
93
|
-
logging:
|
|
94
|
-
driver: none
|
|
95
|
-
volumes:
|
|
96
|
-
- /dev/shm:/dev/shm
|
|
97
|
-
shm_size: 2G
|
|
98
|
-
ports:
|
|
99
|
-
- "4445:4444"
|
|
100
|
-
- "5960:5900"
|
|
101
|
-
networks:
|
|
102
|
-
- hyrax
|
|
103
|
-
|
|
104
|
-
postgres:
|
|
105
|
-
image: postgres:15
|
|
106
|
-
environment:
|
|
107
|
-
- POSTGRES_USER=hyrax_user
|
|
108
|
-
- POSTGRES_PASSWORD=hyrax_password
|
|
109
|
-
- POSTGRES_DB=hyrax
|
|
110
|
-
- POSTGRES_HOST_AUTH_METHOD=trust
|
|
111
|
-
ports:
|
|
112
|
-
- "5432:5432"
|
|
113
|
-
volumes:
|
|
114
|
-
- db:/var/lib/postgresql/data
|
|
115
|
-
networks:
|
|
116
|
-
- hyrax
|
|
117
|
-
|
|
118
|
-
fcrepo:
|
|
119
|
-
image: ghcr.io/samvera/fcrepo4:4.7.5
|
|
120
|
-
volumes:
|
|
121
|
-
- fcrepo:/data:cached
|
|
122
|
-
ports:
|
|
123
|
-
- 8080:8080
|
|
124
|
-
networks:
|
|
125
|
-
- hyrax
|
|
126
|
-
|
|
127
|
-
fits:
|
|
128
|
-
image: ghcr.io/samvera/fitsservlet:1.6.0
|
|
129
|
-
ports:
|
|
130
|
-
- 8080
|
|
131
|
-
networks:
|
|
132
|
-
- hyrax
|
|
133
|
-
|
|
134
|
-
memcached:
|
|
135
|
-
image: bitnami/memcached
|
|
136
|
-
ports:
|
|
137
|
-
- '11211:11211'
|
|
138
|
-
networks:
|
|
139
|
-
- hyrax
|
|
140
|
-
|
|
141
|
-
redis:
|
|
142
|
-
image: bitnami/redis:6.2
|
|
143
|
-
env_file:
|
|
144
|
-
- .dassie/.env
|
|
145
|
-
volumes:
|
|
146
|
-
- redis:/bitnami/redis/data
|
|
147
|
-
networks:
|
|
148
|
-
- hyrax
|
|
149
|
-
|
|
150
|
-
solr:
|
|
151
|
-
image: solr:8.11
|
|
152
|
-
ports:
|
|
153
|
-
- 8983:8983
|
|
154
|
-
command:
|
|
155
|
-
- sh
|
|
156
|
-
- "-c"
|
|
157
|
-
- "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"
|
|
158
|
-
volumes:
|
|
159
|
-
- solr_home:/var/solr/data:cached
|
|
160
|
-
- .dassie/solr/conf:/opt/solr/server/configsets/hyraxconf
|
|
161
|
-
ulimits:
|
|
162
|
-
nofile:
|
|
163
|
-
soft: 65536
|
|
164
|
-
hard: 524288
|
|
165
|
-
networks:
|
|
166
|
-
- hyrax
|
|
167
|
-
|
|
168
|
-
volumes:
|
|
169
|
-
bundle:
|
|
170
|
-
db:
|
|
171
|
-
fcrepo:
|
|
172
|
-
hyrax-derivatives:
|
|
173
|
-
hyrax-uploads:
|
|
174
|
-
rails-public:
|
|
175
|
-
rails-tmp:
|
|
176
|
-
redis:
|
|
177
|
-
solr_home:
|
|
178
|
-
|
|
179
|
-
networks:
|
|
180
|
-
hyrax:
|
|
181
|
-
driver: bridge
|
|
182
|
-
driver_opts:
|
|
183
|
-
com.docker.network.bridge.name: br-hyrax
|
|
1
|
+
include:
|
|
2
|
+
- docker-compose-dassie.yml
|
|
@@ -32,7 +32,7 @@ You can also try [Running Hyrax-based application in local VM](https://github.co
|
|
|
32
32
|
During development, running only the dependent services in a container environment may be beneficial. This avoids potential headaches concerning file permissions and eases the use of debugging tools. The application generation instructions below use [Lando](https://lando.dev) to achieve this setup.
|
|
33
33
|
|
|
34
34
|
This document contains instructions specific to setting up an app with __Hyrax
|
|
35
|
-
v5.0.
|
|
35
|
+
v5.0.3__. If you are looking for instructions on installing a different
|
|
36
36
|
version, be sure to select the appropriate branch or tag from the drop-down
|
|
37
37
|
menu above.
|
|
38
38
|
|
|
@@ -148,7 +148,7 @@ Generate a new Rails application using the template.
|
|
|
148
148
|
**NOTE:** `HYRAX_SKIP_WINGS` is needed here to avoid loading the Wings compatibility layer during the application generation process.
|
|
149
149
|
|
|
150
150
|
```shell
|
|
151
|
-
HYRAX_SKIP_WINGS=true rails _6.1.7.7_ new my_app --database=postgresql -m https://raw.githubusercontent.com/samvera/hyrax/hyrax-v5.0.
|
|
151
|
+
HYRAX_SKIP_WINGS=true rails _6.1.7.7_ new my_app --database=postgresql -m https://raw.githubusercontent.com/samvera/hyrax/hyrax-v5.0.3/template.rb
|
|
152
152
|
```
|
|
153
153
|
|
|
154
154
|
Generating a new Rails application using Hyrax's template above takes cares of a number of steps for you, including:
|
data/hyrax.gemspec
CHANGED
|
@@ -38,12 +38,12 @@ SUMMARY
|
|
|
38
38
|
spec.add_dependency 'almond-rails', '~> 0.1'
|
|
39
39
|
spec.add_dependency 'awesome_nested_set', '~> 3.1'
|
|
40
40
|
spec.add_dependency 'blacklight', '~> 7.29'
|
|
41
|
-
spec.add_dependency 'blacklight-gallery', '~> 4.0'
|
|
41
|
+
spec.add_dependency 'blacklight-gallery', '~> 4.7.0'
|
|
42
42
|
spec.add_dependency 'breadcrumbs_on_rails', '~> 3.0'
|
|
43
43
|
spec.add_dependency 'browse-everything', '>= 0.16', '< 2.0'
|
|
44
44
|
spec.add_dependency 'carrierwave', '~> 1.0'
|
|
45
45
|
spec.add_dependency 'clipboard-rails', '~> 1.5'
|
|
46
|
-
spec.add_dependency 'concurrent-ruby', '
|
|
46
|
+
spec.add_dependency 'concurrent-ruby', '1.3.4' # Pinned until Rails 7 update
|
|
47
47
|
spec.add_dependency 'connection_pool', '~> 2.4'
|
|
48
48
|
spec.add_dependency 'draper', '~> 4.0'
|
|
49
49
|
spec.add_dependency 'dry-logic', '~> 1.5'
|
|
@@ -55,6 +55,7 @@ SUMMARY
|
|
|
55
55
|
# Pin more tightly because 0.x gems are potentially unstable
|
|
56
56
|
spec.add_dependency 'flot-rails', '~> 0.0.6'
|
|
57
57
|
spec.add_dependency 'font-awesome-rails', '~> 4.2'
|
|
58
|
+
spec.add_dependency 'google-analytics-data', '~> 0.6'
|
|
58
59
|
spec.add_dependency 'hydra-derivatives', '~> 3.3'
|
|
59
60
|
spec.add_dependency 'hydra-editor', '~> 6.0'
|
|
60
61
|
spec.add_dependency 'hydra-file_characterization', '~> 1.1'
|
|
@@ -69,7 +70,7 @@ SUMMARY
|
|
|
69
70
|
spec.add_dependency 'noid-rails', '~> 3.0'
|
|
70
71
|
spec.add_dependency 'oauth'
|
|
71
72
|
spec.add_dependency 'oauth2', '~> 1.2'
|
|
72
|
-
spec.add_dependency 'openseadragon'
|
|
73
|
+
spec.add_dependency 'openseadragon', '~> 0.9'
|
|
73
74
|
spec.add_dependency 'posix-spawn'
|
|
74
75
|
spec.add_dependency 'qa', '~> 5.5', '>= 5.5.1' # questioning_authority
|
|
75
76
|
spec.add_dependency 'rails_autolink', '~> 1.1'
|
|
@@ -83,7 +84,7 @@ SUMMARY
|
|
|
83
84
|
spec.add_dependency 'retriable', '>= 2.9', '< 4.0'
|
|
84
85
|
spec.add_dependency 'signet'
|
|
85
86
|
spec.add_dependency 'tinymce-rails', '~> 5.10'
|
|
86
|
-
spec.add_dependency 'valkyrie', '~> 3.
|
|
87
|
+
spec.add_dependency 'valkyrie', '~> 3.5'
|
|
87
88
|
spec.add_dependency 'view_component', '~> 2.74.1' # Pin until blacklight is updated with workaround for https://github.com/ViewComponent/view_component/issues/1565
|
|
88
89
|
spec.add_dependency 'sprockets', '3.7.2' # 3.7.3 fails feature specs
|
|
89
90
|
spec.add_dependency 'sass-rails', '~> 6.0'
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative 'persister'
|
|
4
|
+
require_relative 'query_service'
|
|
5
|
+
require_relative 'resource_factory'
|
|
6
|
+
|
|
7
|
+
module Freyja
|
|
8
|
+
class MetadataAdapter
|
|
9
|
+
include Goddess::Metadata
|
|
10
|
+
|
|
11
|
+
##
|
|
12
|
+
# @return [Freyja::Persister]
|
|
13
|
+
def persister
|
|
14
|
+
@persister ||= Freyja::Persister.new(adapter: self)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
##
|
|
18
|
+
# @return [Freyja::QueryService, #services]
|
|
19
|
+
def query_service
|
|
20
|
+
@query_service ||= Freyja::QueryService.new(
|
|
21
|
+
Valkyrie::Persistence::Postgres::QueryService.new(adapter: self, resource_factory: resource_factory),
|
|
22
|
+
Valkyrie::MetadataAdapter.adapters[:wings_adapter].query_service
|
|
23
|
+
)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
##
|
|
27
|
+
# @return [Freyja::ResourceFactory]
|
|
28
|
+
def resource_factory
|
|
29
|
+
@resource_factory ||= Freyja::ResourceFactory.new(adapter: self)
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Freyja
|
|
4
|
+
# Persister for Postgres MetadataAdapter.
|
|
5
|
+
class Persister < Valkyrie::Persistence::Postgres::Persister
|
|
6
|
+
# Persists a resource within the database
|
|
7
|
+
#
|
|
8
|
+
# Modified from the upstream to skip previously persisted check
|
|
9
|
+
#
|
|
10
|
+
# @param [Valkyrie::Resource] resource
|
|
11
|
+
# @return [Valkyrie::Resource] the persisted/updated resource
|
|
12
|
+
# @raise [Valkyrie::Persistence::StaleObjectError] raised if the resource
|
|
13
|
+
# was modified in the database between been read into memory and persisted
|
|
14
|
+
# rubocop:disable Lint/UnusedMethodArgument
|
|
15
|
+
def save(resource:, external_resource: false, perform_af_validation: false)
|
|
16
|
+
orm_object = resource_factory.from_resource(resource: resource)
|
|
17
|
+
orm_object.transaction do
|
|
18
|
+
orm_object.save!
|
|
19
|
+
if resource.id && resource.id.to_s != orm_object.id
|
|
20
|
+
raise Valkyrie::Persistence::UnsupportedDatatype,
|
|
21
|
+
"Postgres' primary key column can not save with the given ID #{resource.id}. " \
|
|
22
|
+
"To avoid this error, set the ID to be nil via `resource.id = nil` before you save it. \n" \
|
|
23
|
+
"Called from #{Gem.location_of_caller.join(':')}"
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
convert_and_migrate_resource(orm_object)
|
|
27
|
+
|
|
28
|
+
rescue ActiveRecord::StaleObjectError
|
|
29
|
+
raise Valkyrie::Persistence::StaleObjectError, "The object #{resource.id} has been updated by another process."
|
|
30
|
+
end
|
|
31
|
+
# rubocop:enable Lint/UnusedMethodArgument
|
|
32
|
+
|
|
33
|
+
def convert_and_migrate_resource(orm_object)
|
|
34
|
+
new_resource = resource_factory.to_resource(object: orm_object)
|
|
35
|
+
if Hyrax.config.valkyrie_transition?
|
|
36
|
+
MigrateFilesToValkyrieJob.perform_later(new_resource) if new_resource.is_a?(Hyrax::FileSet) && new_resource.file_ids.size == 1 && new_resource.file_ids.first.id.to_s.match('/files/')
|
|
37
|
+
MigrateResourcesJob.perform_later(ids: new_resource.member_ids.map(&:to_s)) if new_resource.is_a?(Hyrax::Work)
|
|
38
|
+
end
|
|
39
|
+
new_resource
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
module Freyja
|
|
3
|
+
class QueryService
|
|
4
|
+
include Goddess::Query
|
|
5
|
+
|
|
6
|
+
def orm_class
|
|
7
|
+
services.first.orm_class
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
##
|
|
11
|
+
# Constructs a Valkyrie::Persistence::CustomQueryContainer using this
|
|
12
|
+
# query service
|
|
13
|
+
#
|
|
14
|
+
# @return [Valkyrie::Persistence::CustomQueryContainer]
|
|
15
|
+
def custom_queries
|
|
16
|
+
@custom_queries ||= Freyja::CustomQueryContainer.new(query_service: self)
|
|
17
|
+
end
|
|
18
|
+
alias custom_query custom_queries
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Freyja
|
|
4
|
+
# Provides access to generic methods for converting to/from
|
|
5
|
+
# {Valkyrie::Resource} and {Valkyrie::Persistence::Postgres::ORM::Resource}.
|
|
6
|
+
class ResourceFactory < Valkyrie::Persistence::Postgres::ResourceFactory
|
|
7
|
+
end
|
|
8
|
+
end
|
data/lib/freyja.rb
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'wings'
|
|
4
|
+
require 'goddess/metadata'
|
|
5
|
+
require 'goddess/query'
|
|
6
|
+
require 'goddess/custom_query_container'
|
|
7
|
+
require 'freyja/metadata_adapter'
|
|
8
|
+
require 'freyja/custom_query_container'
|
|
9
|
+
require 'freyja/resource_factory'
|
|
10
|
+
require 'freyja/persister'
|
|
11
|
+
require 'freyja/query_service'
|
|
12
|
+
|
|
13
|
+
module Freyja
|
|
14
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative 'persister'
|
|
4
|
+
require_relative 'query_service'
|
|
5
|
+
|
|
6
|
+
module Frigg
|
|
7
|
+
class MetadataAdapter
|
|
8
|
+
include Goddess::Metadata
|
|
9
|
+
|
|
10
|
+
def persister
|
|
11
|
+
@persister ||= Frigg::Persister.new(adapter: self)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# @return [Class] +Valkyrie::Persistence::Postgres::QueryService+
|
|
15
|
+
def query_service
|
|
16
|
+
@query_service ||= Frigg::QueryService.new(
|
|
17
|
+
Valkyrie::Persistence::Fedora::QueryService.new(adapter: self),
|
|
18
|
+
Valkyrie::MetadataAdapter.adapters[:wings_adapter].query_service
|
|
19
|
+
)
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Frigg
|
|
4
|
+
# Persister for Postgres MetadataAdapter.
|
|
5
|
+
class Persister < Valkyrie::Persistence::Fedora::Persister
|
|
6
|
+
# Persists a resource within the database
|
|
7
|
+
#
|
|
8
|
+
# Modified from the upstream to skip previously persisted check
|
|
9
|
+
#
|
|
10
|
+
# @param [Valkyrie::Resource] resource
|
|
11
|
+
# @return [Valkyrie::Resource] the persisted/updated resource
|
|
12
|
+
# @raise [Valkyrie::Persistence::StaleObjectError] raised if the resource
|
|
13
|
+
# was modified in the database between been read into memory and persisted
|
|
14
|
+
# rubocop:disable Lint/UnusedMethodArgument
|
|
15
|
+
def save(resource:, external_resource: false, perform_af_validation: false)
|
|
16
|
+
# TODO
|
|
17
|
+
# orm_object = resource_factory.from_resource(resource: resource)
|
|
18
|
+
# orm_object.transaction do
|
|
19
|
+
# orm_object.save!
|
|
20
|
+
# if resource.id && resource.id.to_s != orm_object.id
|
|
21
|
+
# raise Valkyrie::Persistence::UnsupportedDatatype,
|
|
22
|
+
# "Postgres' primary key column can not save with the given ID #{resource.id}. " \
|
|
23
|
+
# "To avoid this error, set the ID to be nil via `resource.id = nil` before you save it. \n" \
|
|
24
|
+
# "Called from #{Gem.location_of_caller.join(':')}"
|
|
25
|
+
# end
|
|
26
|
+
# end
|
|
27
|
+
# resource_factory.to_resource(object: orm_object)
|
|
28
|
+
# rescue ActiveRecord::StaleObjectError
|
|
29
|
+
# raise Valkyrie::Persistence::StaleObjectError, "The object #{resource.id} has been updated by another process."
|
|
30
|
+
end
|
|
31
|
+
# rubocop:enable Lint/UnusedMethodArgument
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
module Frigg
|
|
3
|
+
class QueryService
|
|
4
|
+
include Goddess::Query
|
|
5
|
+
|
|
6
|
+
##
|
|
7
|
+
# Constructs a Valkyrie::Persistence::CustomQueryContainer using this
|
|
8
|
+
# query service
|
|
9
|
+
#
|
|
10
|
+
# @return [Valkyrie::Persistence::CustomQueryContainer]
|
|
11
|
+
def custom_queries
|
|
12
|
+
@custom_queries ||= Frigg::CustomQueryContainer.new(query_service: self)
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
data/lib/frigg.rb
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'wings'
|
|
4
|
+
require 'goddess/metadata'
|
|
5
|
+
require 'goddess/query'
|
|
6
|
+
require 'goddess/custom_query_container'
|
|
7
|
+
require 'frigg/metadata_adapter'
|
|
8
|
+
require 'frigg/custom_query_container'
|
|
9
|
+
require 'frigg/persister'
|
|
10
|
+
require 'frigg/query_service'
|
|
11
|
+
|
|
12
|
+
module Frigg
|
|
13
|
+
end
|
|
@@ -209,5 +209,10 @@ module Hyrax
|
|
|
209
209
|
gem 'dotenv-rails', '~> 2.8'
|
|
210
210
|
end
|
|
211
211
|
end
|
|
212
|
+
|
|
213
|
+
def support_analytics
|
|
214
|
+
gem 'google-protobuf', force_ruby_platform: true # required because google-protobuf is not compatible with Alpine linux
|
|
215
|
+
gem 'grpc', force_ruby_platform: true # required because grpc is not compatible with Alpine linux
|
|
216
|
+
end
|
|
212
217
|
end
|
|
213
218
|
end
|
|
@@ -2,12 +2,17 @@
|
|
|
2
2
|
# You can manually fill in these values or use the ENV variables.
|
|
3
3
|
#
|
|
4
4
|
analytics:
|
|
5
|
+
ga4:
|
|
6
|
+
analytics_id: <%= ENV['GOOGLE_ANALYTICS_ID'] %>
|
|
7
|
+
property_id: <%= ENV['GOOGLE_ANALYTICS_PROPERTY_ID'] %>
|
|
8
|
+
account_json: <%= ENV['GOOGLE_ACCOUNT_JSON'] %>
|
|
9
|
+
account_json_path: <%= ENV['GOOGLE_ACCOUNT_JSON_PATH'] %>
|
|
5
10
|
google:
|
|
6
11
|
analytics_id: <%= ENV['GOOGLE_ANALYTICS_ID'] %>
|
|
7
12
|
app_name: <%= ENV['GOOGLE_OAUTH_APP_NAME'] %>
|
|
8
13
|
app_version: <%= ENV['GOOGLE_OAUTH_APP_VERSION'] %>
|
|
9
|
-
privkey_value: <%= ENV['GOOGLE_OAUTH_PRIVATE_KEY_VALUE'] %>
|
|
10
14
|
privkey_path: <%= ENV['GOOGLE_OAUTH_PRIVATE_KEY_PATH'] %>
|
|
15
|
+
privkey_value: <%= ENV['GOOGLE_OAUTH_PRIVATE_KEY_VALUE'] %>
|
|
11
16
|
privkey_secret: <%= ENV['GOOGLE_OAUTH_PRIVATE_KEY_SECRET'] %>
|
|
12
17
|
client_email: <%= ENV['GOOGLE_OAUTH_CLIENT_EMAIL'] %>
|
|
13
18
|
matomo:
|
|
@@ -36,7 +36,9 @@ Valkyrie::MetadataAdapter.register(
|
|
|
36
36
|
# )),
|
|
37
37
|
# base_path: Rails.env,
|
|
38
38
|
# schema: Valkyrie::Persistence::Fedora::PermissiveSchema.new(Hyrax::SimpleSchemaLoader.new.permissive_schema_for_valkrie_adapter),
|
|
39
|
-
# fedora_version: 6
|
|
39
|
+
# fedora_version: 6.5,
|
|
40
|
+
# fedora_pairtree_count: 4,
|
|
41
|
+
# fedora_pairtree_length: 2
|
|
40
42
|
# ), :fedora_metadata
|
|
41
43
|
# )
|
|
42
44
|
|
|
@@ -68,7 +70,9 @@ Valkyrie.config.metadata_adapter = ENV.fetch('VALKYRIE_METADATA_ADAPTER') { :pg_
|
|
|
68
70
|
# ENV.fetch('FCREPO_URL') { "http://localhost:8080/fcrepo/rest" }
|
|
69
71
|
# )),
|
|
70
72
|
# base_path: Rails.env,
|
|
71
|
-
# fedora_version: 6
|
|
73
|
+
# fedora_version: 6.5,
|
|
74
|
+
# fedora_pairtree_count: 4,
|
|
75
|
+
# fedora_pairtree_length: 2
|
|
72
76
|
# ), :fedora_storage
|
|
73
77
|
# )
|
|
74
78
|
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
development:
|
|
3
3
|
url: <%= ENV['SOLR_URL'] || "http://127.0.0.1:#{ENV.fetch('SOLR_DEVELOPMENT_PORT', 8983)}/solr/hydra-development" %>
|
|
4
4
|
test:
|
|
5
|
-
url: <%= ENV['SOLR_URL'] || "http://127.0.0.1:#{ENV.fetch('SOLR_TEST_PORT', 8985)}/solr/hydra-test" %>
|
|
5
|
+
url: <%= ENV['SOLR_TEST_URL'] || ENV['SOLR_URL'] || "http://127.0.0.1:#{ENV.fetch('SOLR_TEST_PORT', 8985)}/solr/hydra-test" %>
|
|
6
6
|
production:
|
|
7
7
|
url: <%= ENV['SOLR_URL'] || "http://your.production.server:8080/bl_solr/core0" %>
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
module Goddess
|
|
3
|
+
class CustomQueryContainer < Valkyrie::Persistence::CustomQueryContainer
|
|
4
|
+
include Goddess::Query::MethodMissingMachinations
|
|
5
|
+
##
|
|
6
|
+
# @!group Class Attributes
|
|
7
|
+
#
|
|
8
|
+
# @!attribute :known_custom_queries_and_their_strategies [r|w]
|
|
9
|
+
# @return [Hash<Symbol,Symbol>]
|
|
10
|
+
# Valid strategies are :find_multiple
|
|
11
|
+
# @see Goddess::Query::MethodMissingMachinations
|
|
12
|
+
# @todo Audit the current custom queries and assign strategies.
|
|
13
|
+
class_attribute(:known_custom_queries_and_their_strategies,
|
|
14
|
+
default: {
|
|
15
|
+
find_by_date_range: :find_multiple,
|
|
16
|
+
find_child_collection_ids: :find_multiple,
|
|
17
|
+
find_child_collections: :find_multiple,
|
|
18
|
+
find_child_file_set_ids: :find_multiple,
|
|
19
|
+
find_child_file_sets: :find_multiple,
|
|
20
|
+
find_child_fileset_ids: :find_multiple,
|
|
21
|
+
find_child_filesets: :find_multiple,
|
|
22
|
+
find_child_work_ids: :find_multiple,
|
|
23
|
+
find_child_works: :find_multiple,
|
|
24
|
+
find_collections_by_type: :find_multiple,
|
|
25
|
+
find_collections_for: :find_multiple,
|
|
26
|
+
find_count_by: :count_multiple,
|
|
27
|
+
find_extracted_text: :find_single,
|
|
28
|
+
find_file_metadata_by: :find_single,
|
|
29
|
+
find_file_metadata_by_alternate_identifier: :find_single,
|
|
30
|
+
find_files: :find_multiple,
|
|
31
|
+
find_ids_by_model: :find_multiple,
|
|
32
|
+
find_many_by_alternate_ids: :find_multiple,
|
|
33
|
+
find_many_file_metadata_by_ids: :find_multiple,
|
|
34
|
+
find_many_file_metadata_by_use: :find_multiple,
|
|
35
|
+
find_members_of: :find_multiple,
|
|
36
|
+
find_models_by_access: :find_multiple,
|
|
37
|
+
find_original_file: :find_single,
|
|
38
|
+
find_parent_collection_ids: :find_multiple,
|
|
39
|
+
find_parent_collections: :find_multiple,
|
|
40
|
+
find_parent_work: :find_single_or_nil,
|
|
41
|
+
find_parent_work_id: :find_single_or_nil,
|
|
42
|
+
find_parents: :find_multiple,
|
|
43
|
+
find_thumbnail: :find_single,
|
|
44
|
+
find_access_control_for: :find_single
|
|
45
|
+
})
|
|
46
|
+
class_attribute(:fallback_query_strategy, default: :find_single)
|
|
47
|
+
# @!endgroup Class Attributes
|
|
48
|
+
##
|
|
49
|
+
|
|
50
|
+
def services
|
|
51
|
+
@services ||= query_service.services.map(&:custom_queries)
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
private
|
|
55
|
+
|
|
56
|
+
def method_missing(method_name, *args, **opts, &block)
|
|
57
|
+
return super unless services.detect { |service| service.respond_to?(method_name) }
|
|
58
|
+
|
|
59
|
+
strategy = known_custom_queries_and_their_strategies.fetch(method_name, fallback_query_strategy)
|
|
60
|
+
dispatch_method_name = "query_strategy_for_#{strategy}"
|
|
61
|
+
|
|
62
|
+
# We want to check for private methods
|
|
63
|
+
return super unless respond_to?(dispatch_method_name, true)
|
|
64
|
+
send(dispatch_method_name, method_name, *args, **opts, &block)
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
def respond_to_missing?(method_name, _include_private = false)
|
|
68
|
+
services.detect { |service| service.respond_to?(method_name) }.present? || super
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Goddess
|
|
4
|
+
module Metadata
|
|
5
|
+
# @return [Valkyrie::ID] Identifier for this metadata adapter.
|
|
6
|
+
def id
|
|
7
|
+
@id ||= begin
|
|
8
|
+
to_hash = "migrate_adapter"
|
|
9
|
+
::Valkyrie::ID.new(Digest::MD5.hexdigest(to_hash))
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|