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
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1e1143acd065d9ea879f9d47024e4b14603dce26ce528082ba1d358a3aec9629
|
|
4
|
+
data.tar.gz: 4b75c209e9caace3457521ec1af21fc59d8250bf6a4536e74af63061d07d69bf
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 248c5cdb08d506306f7e7664f17647b7af8c0afea32a583d1fe1698cf2346b57caa3d276f4c684627326ff174340a27ea5a74cf8c79d83b79d23285feef8c06e
|
|
7
|
+
data.tar.gz: dbe9e52dea97e0162fa943120f6f3507cb25ad0fd945a7baf693ded264ee5b7308d20894f8220af43471f0cb08fb1c3b7512a5e116261bba22c425369baece15
|
data/.circleci/config.yml
CHANGED
|
@@ -1,181 +1,12 @@
|
|
|
1
1
|
version: 2.1
|
|
2
|
-
orbs:
|
|
3
|
-
samvera: samvera/circleci-orb@1
|
|
4
|
-
browser-tools: circleci/browser-tools@1.3
|
|
5
|
-
ruby: circleci/ruby@2
|
|
6
|
-
node: circleci/node@5
|
|
7
|
-
|
|
8
|
-
executors:
|
|
9
|
-
hyrax:
|
|
10
|
-
parameters:
|
|
11
|
-
fcrepo_version:
|
|
12
|
-
type: string
|
|
13
|
-
default: '4.7.5'
|
|
14
|
-
hyrax_app:
|
|
15
|
-
type: string
|
|
16
|
-
default: 'dassie'
|
|
17
|
-
postgres_version:
|
|
18
|
-
type: string
|
|
19
|
-
default: '14.9'
|
|
20
|
-
redis_version:
|
|
21
|
-
type: string
|
|
22
|
-
default: '6.2'
|
|
23
|
-
ruby_type:
|
|
24
|
-
type: string
|
|
25
|
-
default: 'ruby'
|
|
26
|
-
ruby_version:
|
|
27
|
-
type: string
|
|
28
|
-
default: '2.5.5'
|
|
29
|
-
solr_port:
|
|
30
|
-
type: string
|
|
31
|
-
default: '8985'
|
|
32
|
-
solr_version:
|
|
33
|
-
type: string
|
|
34
|
-
default: '8.11-slim'
|
|
35
|
-
environment:
|
|
36
|
-
RAILS_ENV: test
|
|
37
|
-
RACK_ENV: test
|
|
38
|
-
FCREPO_PORT: 8080
|
|
39
|
-
POSTGRES_DB: circle_test
|
|
40
|
-
POSTGRES_HOST: 127.0.0.1
|
|
41
|
-
POSTGRES_USER: postgres
|
|
42
|
-
docker:
|
|
43
|
-
- image: "ghcr.io/samvera/hyrax/<< parameters.hyrax_app >>-dev:<< pipeline.git.revision >>"
|
|
44
|
-
- image: seleniarm/standalone-chromium:114.0
|
|
45
|
-
environment:
|
|
46
|
-
SE_NODE_SESSION_TIMEOUT: 1200
|
|
47
|
-
START_XVFB: "false"
|
|
48
|
-
|
|
49
|
-
- image: samvera/fcrepo4:<< parameters.fcrepo_version >>
|
|
50
|
-
environment:
|
|
51
|
-
CATALINA_OPTS: "-Djava.awt.headless=true -Dfile.encoding=UTF-8 -server -Xms512m -Xmx1024m -XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=256m -XX:MaxPermSize=256m -XX:+DisableExplicitGC"
|
|
52
|
-
- image: zookeeper:3.4
|
|
53
|
-
- image: solr:<< parameters.solr_version >>
|
|
54
|
-
environment:
|
|
55
|
-
VERBOSE: yes
|
|
56
|
-
SECURITY_JSON: '{"authentication":{"blockUnknown": false, "class":"solr.BasicAuthPlugin", "credentials":{"solr":"IV0EHq1OnNrj6gvRCwvFwTrZ1+z1oBbnQdiVC3otuq0= Ndd7LKvVBAaZIF0QAVi1ekCfAJXr1GGfLtRUXhgrF8c="}, "realm":"My Solr users", "forwardCredentials": false}, "authorization":{ "class":"solr.RuleBasedAuthorizationPlugin", "permissions":[{"name":"security-edit", "role":"admin"}], "user-role":{"solr":"admin"}}}'
|
|
57
|
-
command: sh -c "server/scripts/cloud-scripts/zkcli.sh -zkhost localhost:2181 -cmd put /security.json \"${SECURITY_JSON}\" && solr-fg -cloud -noprompt -p << parameters.solr_port >> -z localhost:2181"
|
|
58
|
-
- image: redis:<< parameters.redis_version >>
|
|
59
|
-
- image: cimg/postgres:<< parameters.postgres_version >>
|
|
60
2
|
|
|
3
|
+
# Run a no-op workflow so CircleCI reports as a green check in pull requests.
|
|
4
|
+
# This file is needed until all active hyrax branches have moved off CircleCI
|
|
5
|
+
# and the integration can be deactivated.
|
|
61
6
|
jobs:
|
|
62
|
-
|
|
63
|
-
parameters:
|
|
64
|
-
hyrax_app:
|
|
65
|
-
type: string
|
|
66
|
-
default: dassie
|
|
67
|
-
ruby_version:
|
|
68
|
-
type: string
|
|
69
|
-
default: 3.2.2
|
|
70
|
-
docker:
|
|
71
|
-
- image: gcr.io/kaniko-project/executor:v1.14.0-debug
|
|
72
|
-
entrypoint: ""
|
|
73
|
-
steps:
|
|
74
|
-
- run:
|
|
75
|
-
name: Configure GHCR credentials
|
|
76
|
-
command: |
|
|
77
|
-
cat > /kaniko/.docker/config.json \<<- JSON
|
|
78
|
-
{
|
|
79
|
-
"auths": {
|
|
80
|
-
"ghcr.io": {
|
|
81
|
-
"auth": "$(echo -n $GHCR_USER:$GHCR_TOKEN | base64)"
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
JSON
|
|
86
|
-
- run:
|
|
87
|
-
name: Build and Push image
|
|
88
|
-
command: |
|
|
89
|
-
/kaniko/executor \
|
|
90
|
-
--cache=true \
|
|
91
|
-
--build-arg "EXTRA_APK_PACKAGES=git bash" \
|
|
92
|
-
--build-arg "APP_PATH=.<< parameters.hyrax_app >>" \
|
|
93
|
-
--build-arg "RUBY_VERSION=<< parameters.ruby_version >>" \
|
|
94
|
-
--context "git://github.com/$(echo $CIRCLE_REPOSITORY_URL | sed -E 's/.+:(.+)\.git/\1/')#refs/heads/${CIRCLE_BRANCH}#${CIRCLE_SHA1}" \
|
|
95
|
-
--target "hyrax-engine-dev" \
|
|
96
|
-
--destination "ghcr.io/samvera/hyrax/<< parameters.hyrax_app >>-dev:${CIRCLE_SHA1}"
|
|
97
|
-
|
|
98
|
-
hyrax-test:
|
|
99
|
-
parameters:
|
|
100
|
-
hyrax_app:
|
|
101
|
-
type: string
|
|
102
|
-
default: dassie
|
|
103
|
-
hyrax_valkyrie:
|
|
104
|
-
type: string
|
|
105
|
-
default: "false"
|
|
106
|
-
ruby_version:
|
|
107
|
-
type: string
|
|
108
|
-
default: 3.2.2
|
|
109
|
-
executor:
|
|
110
|
-
name: hyrax
|
|
111
|
-
hyrax_app: << parameters.hyrax_app >>
|
|
112
|
-
ruby_version: << parameters.ruby_version >>
|
|
113
|
-
resource_class: large
|
|
114
|
-
parallelism: 12
|
|
115
|
-
environment:
|
|
116
|
-
CHROME_HEADLESS_MODE: true
|
|
117
|
-
DATABASE_URL: postgresql://postgres@127.0.0.1/circle_test
|
|
118
|
-
HUB_URL: http://localhost:4444/wd/hub
|
|
119
|
-
HYRAX_VALKYRIE: << parameters.hyrax_valkyrie >>
|
|
120
|
-
IN_DOCKER: true
|
|
121
|
-
KARMA_BROWSER: remote-chromium
|
|
122
|
-
SOLR_URL: http://127.0.0.1:8985/solr/hydra-test
|
|
123
|
-
VALKYRIE_SOLR_CORE: valkyrie-test
|
|
124
|
-
VALKYRIE_SOLR_PORT: 8985
|
|
125
|
-
steps:
|
|
126
|
-
- run:
|
|
127
|
-
name: Create solr core
|
|
128
|
-
command: |
|
|
129
|
-
cd /app/samvera/hyrax-webapp/solr/conf
|
|
130
|
-
zip -1 -r solr_conf.zip ./*
|
|
131
|
-
db-wait.sh localhost:8985 # wait for solr to be available before hitting the API
|
|
132
|
-
curl -H "Content-type:application/octet-stream" --data-binary @solr_conf.zip "http://solr:SolrRocks@127.0.0.1:8985/solr/admin/configs?action=UPLOAD&name=solrconfig"
|
|
133
|
-
curl -H 'Content-type: application/json' http://solr:SolrRocks@127.0.0.1:8985/api/collections/ -d '{create: {name: hydra-test, config: solrconfig, numShards: 1}}'
|
|
134
|
-
curl -H 'Content-type: application/json' http://solr:SolrRocks@127.0.0.1:8985/api/collections/ -d '{create: {name: valkyrie-test, config: solrconfig, numShards: 1}}'
|
|
135
|
-
- ruby/rspec-test:
|
|
136
|
-
app-dir: /app/samvera/hyrax-engine
|
|
137
|
-
|
|
138
|
-
rubocop:
|
|
139
|
-
working_directory: ~/hyrax
|
|
7
|
+
build:
|
|
140
8
|
docker:
|
|
141
|
-
- image: cimg/
|
|
9
|
+
- image: cimg/base:current
|
|
10
|
+
resource_class: small
|
|
142
11
|
steps:
|
|
143
|
-
-
|
|
144
|
-
- run: bundle install
|
|
145
|
-
- ruby/rubocop-check
|
|
146
|
-
|
|
147
|
-
workflows:
|
|
148
|
-
version: 2
|
|
149
|
-
dassie:
|
|
150
|
-
jobs:
|
|
151
|
-
- rubocop
|
|
152
|
-
- kaniko-build:
|
|
153
|
-
name: "dassie-build"
|
|
154
|
-
ruby_version: "3.2.2"
|
|
155
|
-
hyrax_app: "dassie"
|
|
156
|
-
- hyrax-test:
|
|
157
|
-
name: "dassie-test"
|
|
158
|
-
ruby_version: "3.2.2"
|
|
159
|
-
hyrax_app: "dassie"
|
|
160
|
-
requires:
|
|
161
|
-
- dassie-build
|
|
162
|
-
- hyrax-test:
|
|
163
|
-
name: "dassie-valkyrie-test"
|
|
164
|
-
ruby_version: "3.2.2"
|
|
165
|
-
hyrax_app: "dassie"
|
|
166
|
-
hyrax_valkyrie: "1"
|
|
167
|
-
requires:
|
|
168
|
-
- dassie-build
|
|
169
|
-
|
|
170
|
-
koppie:
|
|
171
|
-
jobs:
|
|
172
|
-
- kaniko-build:
|
|
173
|
-
name: "koppie-build"
|
|
174
|
-
ruby_version: "3.2.2"
|
|
175
|
-
hyrax_app: "koppie"
|
|
176
|
-
- hyrax-test:
|
|
177
|
-
name: "koppie-test"
|
|
178
|
-
ruby_version: "3.2.2"
|
|
179
|
-
hyrax_app: "koppie"
|
|
180
|
-
requires:
|
|
181
|
-
- koppie-build
|
|
12
|
+
- run: echo "Hyrax tests have moved to Github Actions."
|
data/.dassie/.env
CHANGED
|
@@ -2,7 +2,7 @@ ANALYTICS_START_DATE=2021-08-21
|
|
|
2
2
|
BUNDLE_GEMFILE=Gemfile.dassie
|
|
3
3
|
BUNDLE_PATH=/app/bundle
|
|
4
4
|
CH12N_TOOL=fits_servlet
|
|
5
|
-
CHROME_HEADLESS_MODE=
|
|
5
|
+
CHROME_HEADLESS_MODE=true
|
|
6
6
|
DATABASE_CLEANER_ALLOW_REMOTE_DATABASE_URL=true
|
|
7
7
|
DATABASE_TEST_URL=postgresql://hyrax_user:hyrax_password@postgres/hyrax_test?pool=5
|
|
8
8
|
DATABASE_URL=postgresql://hyrax_user:hyrax_password@postgres/hyrax?pool=5
|
|
@@ -13,15 +13,16 @@ FCREPO_PORT=8080
|
|
|
13
13
|
FCREPO_REST_PATH=rest
|
|
14
14
|
FCREPO_TEST_BASE_PATH=/test
|
|
15
15
|
FITS_SERVLET_URL=http://fits:8080/fits
|
|
16
|
-
HUB_URL=http://chrome:4444
|
|
16
|
+
HUB_URL=http://chrome:4444
|
|
17
17
|
HYRAX_ANALYTICS=false
|
|
18
18
|
HYRAX_ANALYTICS_PROVIDER=google
|
|
19
19
|
HYRAX_DERIVATIVES_PATH=/app/samvera/hyrax-webapp/derivatives/
|
|
20
20
|
HYRAX_ENGINE_PATH=/app/samvera/hyrax-engine
|
|
21
21
|
HYRAX_UPLOAD_PATH=/app/samvera/hyrax-webapp/uploads/
|
|
22
|
+
HYRAX_VALKYRIE=true
|
|
22
23
|
IN_DOCKER=true
|
|
23
24
|
KARMA_BROWSER=remote-chromium
|
|
24
|
-
KARMA_HOSTNAME=
|
|
25
|
+
KARMA_HOSTNAME=web
|
|
25
26
|
MEMCACHED_HOST=memcached
|
|
26
27
|
RACK_ENV=development
|
|
27
28
|
RAILS_ENV=development
|
|
@@ -35,5 +36,9 @@ SOLR_HOST=solr
|
|
|
35
36
|
SOLR_PORT=8983
|
|
36
37
|
SOLR_TEST_URL=http://solr:8983/solr/hyrax_test
|
|
37
38
|
SOLR_URL=http://solr:8983/solr/hyrax
|
|
39
|
+
TB_RSPEC_OPTIONS=--force-color --format RspecJunitFormatter --out rspec.xml
|
|
40
|
+
TB_RSPEC_FORMATTER=progress
|
|
41
|
+
VALKYRIE_ID_TYPE=string
|
|
38
42
|
VALKYRIE_SOLR_HOST=solr
|
|
39
43
|
VALKYRIE_SOLR_PORT=8983
|
|
44
|
+
VALKYRIE_TRANSITION=false
|
data/.dassie/Gemfile
CHANGED
|
@@ -14,12 +14,23 @@ gem 'coffee-rails', '~> 4.2'
|
|
|
14
14
|
gem 'dalli'
|
|
15
15
|
gem 'devise'
|
|
16
16
|
gem 'devise-guests', '~> 0.8'
|
|
17
|
+
|
|
18
|
+
# Required because grpc and google-protobuf gem's binaries are not compatible with Alpine Linux.
|
|
19
|
+
# To install the package in Alpine: `apk add ruby-grpc`
|
|
20
|
+
# The pinned versions should match the version provided by the Alpine packages.
|
|
21
|
+
if RUBY_PLATFORM =~ /musl/
|
|
22
|
+
path '/usr/lib/ruby/gems/3.2.0' do
|
|
23
|
+
gem 'google-protobuf', '~> 3.24.4', force_ruby_platform: true
|
|
24
|
+
gem 'grpc', '~> 1.59.3', force_ruby_platform: true
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
17
28
|
gemspec name: 'hyrax', path: ENV.fetch('HYRAX_ENGINE_PATH', '..')
|
|
18
29
|
gem 'jbuilder', '~> 2.5'
|
|
19
30
|
gem 'jquery-rails'
|
|
20
31
|
gem 'pg', '~> 1.3'
|
|
21
32
|
gem 'puma'
|
|
22
|
-
gem 'rails', '~> 6.1'
|
|
33
|
+
gem 'rails', '~> 6.1', '>= 6.1.7.10'
|
|
23
34
|
gem 'riiif', '~> 2.1'
|
|
24
35
|
gem 'rsolr', '>= 1.0', '< 3'
|
|
25
36
|
gem 'sass-rails', '~> 6.0'
|
|
@@ -46,4 +57,4 @@ group :development, :test do
|
|
|
46
57
|
gem 'pry-doc'
|
|
47
58
|
gem 'pry-rails'
|
|
48
59
|
gem 'pry-rescue'
|
|
49
|
-
end
|
|
60
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Generated via
|
|
4
|
+
# `rails generate hyrax:work_resource GenericWorkResource`
|
|
5
|
+
module Hyrax
|
|
6
|
+
# Generated controller for GenericWorkResource
|
|
7
|
+
class GenericWorkResourcesController < ApplicationController
|
|
8
|
+
# Adds Hyrax behaviors to the controller.
|
|
9
|
+
include Hyrax::WorksControllerBehavior
|
|
10
|
+
include Hyrax::BreadcrumbsForWorks
|
|
11
|
+
self.curation_concern_type = ::GenericWorkResource
|
|
12
|
+
|
|
13
|
+
# Use a Valkyrie aware form service to generate Valkyrie::ChangeSet style
|
|
14
|
+
# forms.
|
|
15
|
+
self.work_form_service = Hyrax::FormFactory.new
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -6,7 +6,13 @@ module Hyrax
|
|
|
6
6
|
# Adds Hyrax behaviors to the controller.
|
|
7
7
|
include Hyrax::WorksControllerBehavior
|
|
8
8
|
include Hyrax::BreadcrumbsForWorks
|
|
9
|
-
|
|
9
|
+
if Hyrax.config.valkyrie_transition?
|
|
10
|
+
self.curation_concern_type = ::GenericWorkResource
|
|
11
|
+
|
|
12
|
+
self.work_form_service = Hyrax::FormFactory.new
|
|
13
|
+
else
|
|
14
|
+
self.curation_concern_type = ::GenericWork
|
|
15
|
+
end
|
|
10
16
|
|
|
11
17
|
# Use this line if you want to use a custom presenter
|
|
12
18
|
self.show_presenter = Hyrax::GenericWorkPresenter
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Generated via
|
|
4
|
+
# `rails generate hyrax:work_resource GenericWorkResource`
|
|
5
|
+
#
|
|
6
|
+
# @see https://github.com/samvera/hyrax/wiki/Hyrax-Valkyrie-Usage-Guide#forms
|
|
7
|
+
# @see https://github.com/samvera/valkyrie/wiki/ChangeSets-and-Dirty-Tracking
|
|
8
|
+
class GenericWorkResourceForm < Hyrax::Forms::ResourceForm(GenericWorkResource)
|
|
9
|
+
include Hyrax::FormFields(:basic_metadata)
|
|
10
|
+
include Hyrax::FormFields(:generic_work_resource)
|
|
11
|
+
|
|
12
|
+
# Define custom form fields using the Valkyrie::ChangeSet interface
|
|
13
|
+
#
|
|
14
|
+
# property :my_custom_form_field
|
|
15
|
+
|
|
16
|
+
# if you want a field in the form, but it doesn't have a directly corresponding
|
|
17
|
+
# model attribute, make it virtual
|
|
18
|
+
#
|
|
19
|
+
# property :user_input_not_destined_for_the_model, virtual: true
|
|
20
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Generated via
|
|
4
|
+
# `rails generate hyrax:work_resource GenericWorkResource`
|
|
5
|
+
class GenericWorkResourceIndexer < Hyrax::ValkyrieWorkIndexer
|
|
6
|
+
include Hyrax::Indexer(:basic_metadata)
|
|
7
|
+
include Hyrax::Indexer(:generic_work_resource)
|
|
8
|
+
|
|
9
|
+
# Uncomment this block if you want to add custom indexing behavior:
|
|
10
|
+
# def to_solr
|
|
11
|
+
# super.tap do |index_document|
|
|
12
|
+
# index_document[:my_field_tesim] = resource.my_field.map(&:to_s)
|
|
13
|
+
# index_document[:other_field_ssim] = resource.other_field
|
|
14
|
+
# end
|
|
15
|
+
# end
|
|
16
|
+
end
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class AdminSetResource < Hyrax::AdministrativeSet
|
|
4
|
+
include Hyrax::ArResource
|
|
5
|
+
include Hyrax::Permissions::Readable
|
|
6
|
+
Hyrax::ValkyrieLazyMigration.migrating(self, from: ::AdminSet) if Hyrax.config.valkyrie_transition?
|
|
7
|
+
|
|
8
|
+
# include WithPermissionTemplateShim
|
|
9
|
+
end
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Generated via
|
|
4
|
+
# `rails generate hyrax:work_resource GenericWorkResource`
|
|
5
|
+
class GenericWorkResource < Hyrax::Work
|
|
6
|
+
include Hyrax::Schema(:basic_metadata)
|
|
7
|
+
include Hyrax::Schema(:generic_work_resource)
|
|
8
|
+
|
|
9
|
+
Hyrax::ValkyrieLazyMigration.migrating(self, from: GenericWork) if Hyrax.config.valkyrie_transition?
|
|
10
|
+
end
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
analytics:
|
|
2
|
+
ga4:
|
|
3
|
+
analytics_id: <%= ENV['GOOGLE_ANALYTICS_ID'] %>
|
|
4
|
+
property_id: <%= ENV['GOOGLE_ANALYTICS_PROPERTY_ID'] %>
|
|
5
|
+
account_json: <%= ENV['GOOGLE_ACCOUNT_JSON'] %>
|
|
6
|
+
account_json_path: <%= ENV['GOOGLE_ACCOUNT_JSON_PATH'] %>
|
|
2
7
|
google:
|
|
3
8
|
analytics_id: <%= ENV['GOOGLE_ANALYTICS_ID'] %>
|
|
4
9
|
app_name: <%= ENV['GOOGLE_OAUTH_APP_NAME'] %>
|
|
5
10
|
app_version: <%= ENV['GOOGLE_OAUTH_APP_VERSION'] %>
|
|
6
|
-
privkey_value: <%= ENV['GOOGLE_OAUTH_PRIVATE_KEY_VALUE'] %>
|
|
7
11
|
privkey_path: <%= ENV['GOOGLE_OAUTH_PRIVATE_KEY_PATH'] %>
|
|
12
|
+
privkey_value: <%= ENV['GOOGLE_OAUTH_PRIVATE_KEY_VALUE'] %>
|
|
8
13
|
privkey_secret: <%= ENV['GOOGLE_OAUTH_PRIVATE_KEY_SECRET'] %>
|
|
9
14
|
client_email: <%= ENV['GOOGLE_OAUTH_CLIENT_EMAIL'] %>
|
|
10
15
|
matomo:
|
|
@@ -18,5 +18,29 @@ module Dassie
|
|
|
18
18
|
|
|
19
19
|
# use SideKiq by default
|
|
20
20
|
config.active_job.queue_adapter = :sidekiq
|
|
21
|
+
# inline can be useful when debugging
|
|
22
|
+
# config.active_job.queue_adapter = :inline
|
|
23
|
+
|
|
24
|
+
##
|
|
25
|
+
# When using the Goddess adapter of Hyrax 5.x, we want to have a
|
|
26
|
+
# canonical answer for what are the Work Types that we want to manage.
|
|
27
|
+
#
|
|
28
|
+
# We don't want to rely on `Hyrax.config.curation_concerns`, as these are
|
|
29
|
+
# the ActiveFedora implementations.
|
|
30
|
+
#
|
|
31
|
+
# @return [Array<Class>]
|
|
32
|
+
def self.work_types
|
|
33
|
+
Hyrax.config.curation_concerns.map do |cc|
|
|
34
|
+
if cc.to_s.end_with?("Resource")
|
|
35
|
+
cc
|
|
36
|
+
else
|
|
37
|
+
# We may encounter a case where we don't have an old ActiveFedora
|
|
38
|
+
# model that we're mapping to. For example, let's say we add Game as
|
|
39
|
+
# a curation concern. And Game has only ever been written/modeled via
|
|
40
|
+
# Valkyrie. We don't want to also have a GameResource.
|
|
41
|
+
"#{cc}Resource".safe_constantize || cc
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
21
45
|
end
|
|
22
46
|
end
|
|
@@ -13,6 +13,8 @@ Hyrax.config do |config|
|
|
|
13
13
|
config.register_curation_concern :"namespaced_works/nested_work"
|
|
14
14
|
# Injected via `rails g hyrax:work_resource Monograph`
|
|
15
15
|
config.register_curation_concern :monograph
|
|
16
|
+
# Injected via `rails g hyrax:work_resource GenericWorkResource`
|
|
17
|
+
# config.register_curation_concern :generic_work_resource
|
|
16
18
|
|
|
17
19
|
config.iiif_image_server = true
|
|
18
20
|
config.work_requires_files = false
|
|
@@ -65,9 +67,17 @@ Hyrax.config do |config|
|
|
|
65
67
|
# config.admin_set_model = 'Hyrax::AdministrativeSet'
|
|
66
68
|
|
|
67
69
|
# dassie needs legacy AF models
|
|
68
|
-
|
|
69
|
-
config.
|
|
70
|
-
|
|
70
|
+
# If using Frayja/Frigg then use the resource they provide
|
|
71
|
+
if Hyrax.config.valkyrie_transition?
|
|
72
|
+
config.collection_model = 'CollectionResource'
|
|
73
|
+
config.admin_set_model = 'AdminSetResource'
|
|
74
|
+
config.file_set_model = 'Hyrax::FileSet'
|
|
75
|
+
else
|
|
76
|
+
# dassie needs legacy AF models
|
|
77
|
+
config.collection_model = '::Collection'
|
|
78
|
+
config.admin_set_model = 'AdminSet'
|
|
79
|
+
config.file_set_model = '::FileSet'
|
|
80
|
+
end
|
|
71
81
|
end
|
|
72
82
|
|
|
73
83
|
Date::DATE_FORMATS[:standard] = "%m/%d/%Y"
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
# rubocop:disable Metrics/BlockLength
|
|
3
|
+
|
|
4
|
+
# Freyja setup adapted from hyku
|
|
5
|
+
if Hyrax.config.valkyrie_transition?
|
|
6
|
+
Rails.application.config.after_initialize do
|
|
7
|
+
[ # List AF work models
|
|
8
|
+
GenericWork
|
|
9
|
+
].each do |klass|
|
|
10
|
+
Wings::ModelRegistry.register("#{klass}Resource".constantize, klass)
|
|
11
|
+
# we register itself so we can pre-translate the class in Freyja instead of having to translate in each query_service
|
|
12
|
+
Wings::ModelRegistry.register(klass, klass)
|
|
13
|
+
end
|
|
14
|
+
Wings::ModelRegistry.register(Collection, Collection)
|
|
15
|
+
Wings::ModelRegistry.register(CollectionResource, Collection)
|
|
16
|
+
Wings::ModelRegistry.register(AdminSet, AdminSet)
|
|
17
|
+
Wings::ModelRegistry.register(AdminSetResource, AdminSet)
|
|
18
|
+
Wings::ModelRegistry.register(FileSet, FileSet)
|
|
19
|
+
Wings::ModelRegistry.register(Hyrax::FileSet, FileSet)
|
|
20
|
+
Wings::ModelRegistry.register(Hydra::PCDM::File, Hydra::PCDM::File)
|
|
21
|
+
Wings::ModelRegistry.register(Hyrax::FileMetadata, Hydra::PCDM::File)
|
|
22
|
+
|
|
23
|
+
Valkyrie::MetadataAdapter.register(
|
|
24
|
+
Freyja::MetadataAdapter.new,
|
|
25
|
+
:freyja
|
|
26
|
+
)
|
|
27
|
+
Valkyrie.config.metadata_adapter = :freyja
|
|
28
|
+
Hyrax.config.query_index_from_valkyrie = true
|
|
29
|
+
Hyrax.config.index_adapter = :solr_index
|
|
30
|
+
|
|
31
|
+
Valkyrie::StorageAdapter.register(
|
|
32
|
+
Valkyrie::Storage::VersionedDisk.new(base_path: Rails.root.join("storage", "files"),
|
|
33
|
+
file_mover: FileUtils.method(:cp)),
|
|
34
|
+
:disk
|
|
35
|
+
)
|
|
36
|
+
Valkyrie.config.storage_adapter = :disk
|
|
37
|
+
Valkyrie.config.indexing_adapter = :solr_index
|
|
38
|
+
|
|
39
|
+
# load all the sql based custom queries
|
|
40
|
+
[
|
|
41
|
+
Hyrax::CustomQueries::Navigators::CollectionMembers,
|
|
42
|
+
Hyrax::CustomQueries::Navigators::ChildCollectionsNavigator,
|
|
43
|
+
Hyrax::CustomQueries::Navigators::ParentCollectionsNavigator,
|
|
44
|
+
Hyrax::CustomQueries::Navigators::ChildFileSetsNavigator,
|
|
45
|
+
Hyrax::CustomQueries::Navigators::ChildWorksNavigator,
|
|
46
|
+
Hyrax::CustomQueries::Navigators::FindFiles,
|
|
47
|
+
Hyrax::CustomQueries::FindAccessControl,
|
|
48
|
+
Hyrax::CustomQueries::FindCollectionsByType,
|
|
49
|
+
Hyrax::CustomQueries::FindFileMetadata,
|
|
50
|
+
Hyrax::CustomQueries::FindIdsByModel,
|
|
51
|
+
Hyrax::CustomQueries::FindManyByAlternateIds,
|
|
52
|
+
Hyrax::CustomQueries::FindModelsByAccess,
|
|
53
|
+
Hyrax::CustomQueries::FindCountBy,
|
|
54
|
+
Hyrax::CustomQueries::FindByDateRange,
|
|
55
|
+
# Hyrax::CustomQueries::FindBySourceIdentifier # from bulkrax
|
|
56
|
+
].each do |handler|
|
|
57
|
+
Hyrax.query_service.services[0].custom_queries.register_query_handler(handler)
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# [
|
|
61
|
+
# Wings::CustomQueries::FindBySourceIdentifier
|
|
62
|
+
# ].each do |handler|
|
|
63
|
+
# Hyrax.query_service.services[1].custom_queries.register_query_handler(handler)
|
|
64
|
+
# end
|
|
65
|
+
|
|
66
|
+
# Register each work resource pair
|
|
67
|
+
# Wings::ModelRegistry.register(GenericWorkResource, GenericWork)
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
Rails.application.config.to_prepare do
|
|
71
|
+
AdminSetResource.class_eval do
|
|
72
|
+
attribute :internal_resource, Valkyrie::Types::Any.default("AdminSet"), internal: true
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
CollectionResource.class_eval do
|
|
76
|
+
attribute :internal_resource, Valkyrie::Types::Any.default("Collection"), internal: true
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
Valkyrie.config.resource_class_resolver = lambda do |resource_klass_name|
|
|
80
|
+
# TODO: Can we use some kind of lookup.
|
|
81
|
+
klass_name = resource_klass_name.gsub(/^Wings\((.+)\)$/, '\1')
|
|
82
|
+
klass_name = klass_name.gsub(/Resource$/, '')
|
|
83
|
+
if %w[
|
|
84
|
+
GenericWork
|
|
85
|
+
].include?(klass_name)
|
|
86
|
+
"#{klass_name}Resource".constantize
|
|
87
|
+
elsif 'Collection' == klass_name
|
|
88
|
+
CollectionResource
|
|
89
|
+
elsif 'AdminSet' == klass_name
|
|
90
|
+
AdminSetResource
|
|
91
|
+
# Without this mapping, we'll see cases of Postgres Valkyrie adapter attempting to write to
|
|
92
|
+
# Fedora. Yeah!
|
|
93
|
+
elsif 'Hydra::AccessControl' == klass_name
|
|
94
|
+
Hyrax::AccessControl
|
|
95
|
+
elsif 'FileSet' == klass_name
|
|
96
|
+
Hyrax::FileSet
|
|
97
|
+
elsif 'Hydra::AccessControls::Embargo' == klass_name
|
|
98
|
+
Hyrax::Embargo
|
|
99
|
+
elsif 'Hydra::AccessControls::Lease' == klass_name
|
|
100
|
+
Hyrax::Lease
|
|
101
|
+
elsif 'Hydra::PCDM::File' == klass_name
|
|
102
|
+
Hyrax::FileMetadata
|
|
103
|
+
else
|
|
104
|
+
klass_name.constantize
|
|
105
|
+
end
|
|
106
|
+
end
|
|
107
|
+
end
|
|
108
|
+
# rubocop:enable Metrics/BlockLength
|
|
109
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Simple yaml config-driven schema which is used to define model attributes,
|
|
2
|
+
# index key names, and form properties.
|
|
3
|
+
#
|
|
4
|
+
# Attributes must have a type but all other configuration options are optional.
|
|
5
|
+
#
|
|
6
|
+
# attributes:
|
|
7
|
+
# attribute_name:
|
|
8
|
+
# type: string
|
|
9
|
+
# multiple: false
|
|
10
|
+
# index_keys:
|
|
11
|
+
# - "attribute_name_sim"
|
|
12
|
+
# form:
|
|
13
|
+
# required: true
|
|
14
|
+
# primary: true
|
|
15
|
+
# multiple: false
|
|
16
|
+
#
|
|
17
|
+
# @see config/metadata/basic_metadata.yaml for an example configuration
|
|
18
|
+
#
|
|
19
|
+
# Generated via
|
|
20
|
+
# `rails generate hyrax:work_resource GenericWorkResource`
|
|
21
|
+
|
|
22
|
+
attributes: {}
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
development:
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
test:
|
|
6
|
-
host: <%= ENV['VALKYRIE_SOLR_HOST'] %>
|
|
7
|
-
port: <%= ENV['VALKYRIE_SOLR_PORT'] || 8987 %>
|
|
8
|
-
core: <%= ENV['VALKYRIE_SOLR_CORE'] || 'hyrax-valkyrie-test' %>
|
|
2
|
+
url: <%= ENV['SOLR_DEVELOPMENT_URL'] || ENV['SOLR_URL'] || "http://127.0.0.1:8983/solr/hyrax-valkyrie-dev" %>
|
|
3
|
+
test: &test
|
|
4
|
+
url: <%= ENV['SOLR_TEST_URL'] || ENV['SOLR_URL'] || "http://127.0.0.1:#{ENV.fetch('SOLR_TEST_PORT', 8987)}/solr/hyrax-valkyrie-test" %>
|
|
9
5
|
production:
|
|
10
|
-
|
|
11
|
-
port: <%= ENV['VALKYRIE_SOLR_PORT'] %>
|
|
12
|
-
core: <%= ENV['VALKYRIE_SOLR_CORE'] %>
|
|
6
|
+
url: <%= ENV['SOLR_URL'] || "http://127.0.0.1:8983/solr/hyrax-valkyrie" %>
|
data/.dassie/db/schema.rb
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
#
|
|
11
11
|
# It's strongly recommended that you check this file into your version control system.
|
|
12
12
|
|
|
13
|
-
ActiveRecord::Schema.define(version:
|
|
13
|
+
ActiveRecord::Schema.define(version: 2024_05_06_070809) do
|
|
14
14
|
|
|
15
15
|
# These are extensions that must be enabled in order to support this database
|
|
16
16
|
enable_extension "plpgsql"
|
|
@@ -251,7 +251,7 @@ ActiveRecord::Schema.define(version: 2023_08_21_153635) do
|
|
|
251
251
|
t.index ["namespace"], name: "index_minter_states_on_namespace", unique: true
|
|
252
252
|
end
|
|
253
253
|
|
|
254
|
-
create_table "orm_resources", id: :
|
|
254
|
+
create_table "orm_resources", id: :text, default: -> { "(uuid_generate_v4())::text" }, force: :cascade do |t|
|
|
255
255
|
t.jsonb "metadata", default: {}, null: false
|
|
256
256
|
t.datetime "created_at", null: false
|
|
257
257
|
t.datetime "updated_at", null: false
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Generated via
|
|
4
|
+
# `rails generate hyrax:work_resource GenericWorkResource`
|
|
5
|
+
require 'rails_helper'
|
|
6
|
+
require 'hyrax/specs/shared_specs/indexers'
|
|
7
|
+
|
|
8
|
+
RSpec.describe GenericWorkResourceIndexer do
|
|
9
|
+
let(:indexer_class) { described_class }
|
|
10
|
+
let(:resource) { GenericWorkResource.new }
|
|
11
|
+
|
|
12
|
+
it_behaves_like 'a Hyrax::Resource indexer'
|
|
13
|
+
end
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Generated via
|
|
4
|
+
# `rails generate hyrax:work_resource GenericWorkResource`
|
|
5
|
+
require 'rails_helper'
|
|
6
|
+
require 'hyrax/specs/shared_specs/hydra_works'
|
|
7
|
+
|
|
8
|
+
RSpec.describe GenericWorkResource do
|
|
9
|
+
subject(:work) { described_class.new }
|
|
10
|
+
|
|
11
|
+
it_behaves_like 'a Hyrax::Work'
|
|
12
|
+
end
|