hyrax 4.0.0 → 5.0.0.rc2
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 +124 -232
- data/.dassie/.env +8 -2
- data/.dassie/Gemfile +27 -42
- data/.dassie/Gemfile.dassie +2 -0
- data/.dassie/app/assets/config/manifest.js +2 -0
- data/.dassie/app/assets/stylesheets/hyrax.scss +1 -0
- data/.dassie/config/environments/test.rb +1 -0
- data/.dassie/config/initializers/hyrax.rb +3 -1
- data/.dassie/config/initializers/riiif.rb +11 -7
- data/.dassie/config/metadata/collection_resource.yaml +3 -0
- data/.dassie/config/metadata/monograph.yaml +8 -0
- data/.dassie/config/metadata/sample_metadata.yaml +1 -0
- data/.dassie/config/redis.yml +2 -0
- data/.dassie/db/migrate/20230725222727_create_hyrax_counter_metrics.hyrax.rb +14 -0
- data/.dassie/db/migrate/20230803165135_change_work_id_to_string.rb +5 -0
- data/.dassie/db/migrate/20230808102105_add_indices_to_hyrax_counter_metrics.hyrax.rb +8 -0
- data/.dassie/db/migrate/20230821153635_add_fields_to_counter_metric.rb +8 -0
- data/.dassie/db/schema.rb +22 -3
- data/.dockerignore +7 -0
- data/.github/PULL_REQUEST_TEMPLATE.md +10 -7
- data/.github/release.yml +5 -2
- data/.gitignore +1 -1
- data/.koppie/.env +13 -4
- data/.koppie/Gemfile +10 -12
- data/.koppie/Gemfile.koppie +2 -0
- data/.koppie/Rakefile +0 -2
- data/.koppie/app/models/ability.rb +1 -5
- data/.koppie/app/models/user.rb +0 -2
- data/.koppie/config/application.rb +2 -1
- data/.koppie/config/arkivo.yml +6 -0
- data/.koppie/config/blacklight.yml +2 -2
- data/.koppie/config/environments/test.rb +1 -0
- data/.koppie/config/features.yml +2 -0
- data/.koppie/config/initializers/1_valkyrie.rb +29 -6
- data/.koppie/config/initializers/arkivo_constraint.rb +12 -0
- data/.koppie/config/initializers/hyrax.rb +10 -4
- data/.koppie/config/initializers/riiif.rb +11 -7
- data/.koppie/config/metadata/collection_resource.yaml +49 -0
- data/.koppie/config/metadata/generic_work.yaml +2 -0
- data/.koppie/config/metadata/monograph.yaml +10 -0
- data/.koppie/config/role_map.yml +3 -25
- data/.koppie/config/routes.rb +1 -2
- data/.koppie/config/solr.yml +1 -1
- data/.koppie/config/valkyrie_index.yml +4 -10
- data/.koppie/config/zotero.yml +6 -0
- data/.koppie/db/migrate/20230725222727_create_hyrax_counter_metrics.hyrax.rb +14 -0
- data/.koppie/db/migrate/20230803165135_change_work_id_to_string.rb +5 -0
- data/.koppie/db/schema.rb +12 -1
- data/.koppie/yarn.lock +23 -23
- data/.regen +1 -1
- data/CONTAINERS.md +1 -3
- data/Dockerfile +17 -13
- data/Gemfile +4 -21
- data/Gemfile.dassie +2 -0
- data/Gemfile.koppie +2 -0
- data/README.md +0 -1
- data/Rakefile +0 -11
- data/app/actors/hyrax/actors/base_actor.rb +4 -3
- data/app/actors/hyrax/actors/embargo_actor.rb +3 -3
- data/app/actors/hyrax/actors/lease_actor.rb +5 -2
- data/app/assets/javascripts/hyrax/batch_select_all.js +1 -1
- data/app/assets/javascripts/hyrax/file_manager/member.es6 +1 -1
- data/app/assets/javascripts/hyrax/file_manager/sorting.es6 +3 -2
- data/app/assets/stylesheets/hyrax/_file-listing.scss +0 -2
- data/app/assets/stylesheets/hyrax/_work-show.scss +19 -3
- data/app/assets/stylesheets/hyrax/sidebar.scss +23 -0
- data/app/controllers/concerns/hyrax/embargoes_controller_behavior.rb +8 -2
- data/app/controllers/concerns/hyrax/leases_controller_behavior.rb +7 -1
- data/app/controllers/concerns/hyrax/valkyrie_downloads_controller_behavior.rb +79 -0
- data/app/controllers/concerns/hyrax/works_controller_behavior.rb +64 -14
- data/app/controllers/hyrax/admin/workflows_controller.rb +48 -3
- data/app/controllers/hyrax/api/items_controller.rb +2 -3
- data/app/controllers/hyrax/batch_edits_controller.rb +39 -10
- data/app/controllers/hyrax/batch_uploads_controller.rb +5 -1
- data/app/controllers/hyrax/dashboard/collections_controller.rb +4 -1
- data/app/controllers/hyrax/downloads_controller.rb +8 -1
- data/app/controllers/hyrax/file_sets_controller.rb +50 -6
- data/app/controllers/hyrax/my/collections_controller.rb +2 -0
- data/app/controllers/hyrax/single_use_links_viewer_controller.rb +16 -2
- data/app/forms/concerns/hyrax/basic_metadata_form_fields_behavior.rb +38 -0
- data/app/forms/hyrax/forms/collection_form.rb +0 -15
- data/app/forms/hyrax/forms/dashboard/nest_collection_form.rb +0 -34
- data/app/forms/hyrax/forms/file_set_edit_form.rb +1 -1
- data/app/forms/hyrax/forms/file_set_form.rb +2 -2
- data/app/forms/hyrax/forms/pcdm_object_form.rb +21 -0
- data/app/forms/hyrax/forms/permission_template_form.rb +2 -7
- data/app/forms/hyrax/forms/resource_batch_edit_form.rb +118 -0
- data/app/forms/hyrax/forms/resource_form.rb +21 -34
- data/app/forms/hyrax/forms/work_embargo_form.rb +1 -0
- data/app/forms/hyrax/forms/work_form.rb +1 -1
- data/app/forms/hyrax/forms/work_lease_form.rb +1 -0
- data/app/helpers/hyrax/dashboard_helper_behavior.rb +30 -9
- data/app/helpers/hyrax/membership_helper.rb +13 -1
- data/app/helpers/hyrax/work_form_helper.rb +0 -107
- data/app/indexers/hyrax/file_set_indexer.rb +6 -0
- data/app/indexers/hyrax/location_indexer.rb +29 -0
- data/app/indexers/hyrax/valkyrie_file_set_indexer.rb +36 -5
- data/app/indexers/hyrax/valkyrie_work_indexer.rb +9 -2
- data/app/inputs/controlled_vocabulary_input.rb +1 -1
- data/app/jobs/characterize_job.rb +1 -1
- data/app/jobs/create_work_job.rb +36 -4
- data/app/jobs/valkyrie_characterization_job.rb +9 -0
- data/app/jobs/valkyrie_create_derivatives_job.rb +8 -7
- data/app/jobs/valkyrie_ingest_job.rb +1 -4
- data/app/models/admin_set.rb +1 -31
- data/app/models/collection_branding_info.rb +2 -9
- data/app/models/concerns/hyrax/ability.rb +2 -1
- data/app/models/concerns/hyrax/collection_behavior.rb +4 -12
- data/app/models/concerns/hyrax/file_set/derivatives.rb +3 -2
- data/app/models/concerns/hyrax/riiif_file.rb +30 -0
- data/app/models/concerns/hyrax/solr_document_behavior.rb +20 -3
- data/app/models/hyrax/collection_type.rb +5 -14
- data/app/models/hyrax/counter_metric.rb +7 -0
- data/app/models/hyrax/file_metadata.rb +9 -9
- data/app/models/hyrax/file_set.rb +76 -15
- data/app/models/hyrax/orcid_validator.rb +0 -6
- data/app/models/hyrax/resource.rb +30 -2
- data/app/models/hyrax/work.rb +2 -5
- data/app/presenters/hyrax/collection_presenter.rb +0 -17
- data/app/presenters/hyrax/embargo_presenter.rb +4 -0
- data/app/presenters/hyrax/file_set_presenter.rb +6 -0
- data/app/presenters/hyrax/iiif_manifest_presenter.rb +3 -7
- data/app/presenters/hyrax/pcdm_member_presenter_factory.rb +6 -4
- data/app/presenters/hyrax/presenter_renderer.rb +0 -7
- data/app/presenters/hyrax/version_list_presenter.rb +19 -10
- data/app/presenters/hyrax/version_presenter.rb +19 -4
- data/app/presenters/hyrax/work_show_presenter.rb +6 -11
- data/app/search_builders/hyrax/file_set_search_builder.rb +1 -1
- data/app/search_builders/hyrax/valkyrie_abstract_type_relation.rb +37 -0
- data/app/search_builders/hyrax/valkyrie_work_relation.rb +9 -0
- data/app/services/hyrax/admin_set_create_service.rb +0 -17
- data/app/services/hyrax/characterization/valkyrie_characterization_service.rb +16 -9
- data/app/services/hyrax/collections/collection_member_service.rb +1 -1
- data/app/services/hyrax/custom_queries/find_by_date_range.rb +55 -0
- data/app/services/hyrax/custom_queries/find_count_by.rb +62 -0
- data/app/services/hyrax/custom_queries/find_file_metadata.rb +1 -1
- data/app/services/hyrax/custom_queries/find_models_by_access.rb +59 -0
- data/app/services/hyrax/derivative_bucketed_storage.rb +25 -0
- data/app/services/hyrax/derivative_path.rb +14 -4
- data/app/services/hyrax/embargo_manager.rb +106 -13
- data/app/services/hyrax/embargo_service.rb +12 -10
- data/app/services/hyrax/file_set_derivatives_service.rb +14 -13
- data/app/services/hyrax/fixity_check_failure_service.rb +1 -1
- data/app/services/hyrax/identifier/dispatcher.rb +9 -2
- data/app/services/hyrax/lease_manager.rb +88 -8
- data/app/services/hyrax/listeners/file_metadata_listener.rb +16 -8
- data/app/services/hyrax/listeners/member_cleanup_listener.rb +2 -28
- data/app/services/hyrax/listeners/metadata_index_listener.rb +11 -0
- data/app/services/hyrax/listeners/workflow_listener.rb +8 -11
- data/app/services/hyrax/lock_manager.rb +1 -2
- data/app/services/hyrax/persist_directly_contained_output_file_service.rb +24 -2
- data/app/services/hyrax/riiif_file_resolver.rb +50 -0
- data/app/services/hyrax/simple_schema_loader.rb +31 -0
- data/app/services/hyrax/solr_query_service.rb +7 -6
- data/app/services/hyrax/statistics/depositors/summary.rb +1 -1
- data/app/services/hyrax/statistics/over_time.rb +1 -1
- data/app/services/hyrax/statistics/users/over_time.rb +3 -1
- data/app/services/hyrax/statistics/valkyrie_query_service.rb +49 -0
- data/app/services/hyrax/statistics/works/count.rb +1 -1
- data/app/services/hyrax/thumbnail_path_service.rb +5 -0
- data/app/services/hyrax/valkyrie_persist_derivatives.rb +16 -11
- data/app/services/hyrax/valkyrie_upload.rb +16 -28
- data/app/services/hyrax/versioning_service.rb +30 -15
- data/app/services/hyrax/visibility_intention.rb +1 -4
- data/app/services/hyrax/visibility_propagator.rb +1 -1
- data/app/services/hyrax/work_uploads_handler.rb +1 -1
- data/app/services/hyrax/workflow/actionable_objects.rb +28 -3
- data/app/services/hyrax/workflow/grant_edit_to_depositor.rb +1 -1
- data/app/services/hyrax/workflow/grant_read_to_depositor.rb +1 -1
- data/app/services/hyrax/workflow/permission_query.rb +23 -2
- data/app/validators/hyrax/collection_membership_validator.rb +1 -1
- data/app/views/catalog/_search_form.html.erb +1 -1
- data/app/views/hyrax/admin/collection_types/index.html.erb +1 -1
- data/app/views/hyrax/admin/workflows/_tabs.html.erb +9 -0
- data/app/views/hyrax/admin/workflows/index.html.erb +53 -76
- data/app/views/hyrax/base/_file_manager_members.html.erb +2 -2
- data/app/views/hyrax/base/_file_manager_resource_form.html.erb +1 -1
- data/app/views/hyrax/base/_form.html.erb +0 -10
- data/app/views/hyrax/base/_form_permission_embargo.html.erb +1 -1
- data/app/views/hyrax/base/_form_permission_lease.html.erb +1 -1
- data/app/views/hyrax/base/_form_visibility_component.html.erb +4 -4
- data/app/views/hyrax/base/_items.html.erb +1 -1
- data/app/views/hyrax/base/_show_actions.html.erb +1 -1
- data/app/views/hyrax/base/_workflow_actions.html.erb +25 -23
- data/app/views/hyrax/base/file_manager.html.erb +1 -1
- data/app/views/hyrax/base/show.json.jbuilder +4 -3
- data/app/views/hyrax/collections/_show_document_list_row.html.erb +1 -1
- 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/collections/_sort_and_per_page.html.erb +3 -3
- data/app/views/hyrax/file_sets/_versioning.html.erb +5 -5
- data/app/views/hyrax/file_sets/media_display/_audio.html.erb +4 -4
- data/app/views/hyrax/file_sets/media_display/_default.html.erb +1 -1
- data/app/views/hyrax/file_sets/media_display/_video.html.erb +2 -2
- data/app/views/hyrax/file_sets/show.html.erb +5 -3
- data/app/views/hyrax/homepage/_explore_collections.html.erb +1 -1
- data/app/views/hyrax/my/_search_form.html.erb +1 -1
- data/app/views/hyrax/notifications/_notifications.html.erb +1 -1
- data/app/views/hyrax/users/_vitals.html.erb +1 -1
- data/bin/dev-entrypoint.sh +13 -0
- data/chart/hyrax/Chart.yaml +18 -14
- data/chart/hyrax/README.md +34 -21
- data/chart/hyrax/templates/_helpers.tpl +34 -1
- data/chart/hyrax/templates/configmap-env.yaml +12 -2
- data/chart/hyrax/templates/secrets.yaml +1 -1
- data/chart/hyrax/values.yaml +39 -14
- data/config/initializers/file_length_patch.rb +10 -0
- data/config/initializers/listeners.rb +4 -10
- data/config/initializers/storage_adapter_initializer.rb +1 -1
- data/config/locales/hyrax.en.yml +8 -0
- data/config/metadata/basic_metadata.yaml +52 -0
- data/config/metadata/core_metadata.yaml +4 -0
- data/config/metadata/file_set_metadata.yaml +20 -1
- data/config/metadata/hyrax_internal_metadata.yaml +57 -0
- data/docker-compose-koppie.yml +36 -22
- data/docker-compose-sirenia.yml +202 -0
- data/docker-compose.yml +42 -26
- data/documentation/developing-your-hyrax-based-app.md +6 -14
- data/documentation/legacyREADME.md +3 -1
- data/hyrax.gemspec +12 -13
- data/karma.conf.js +9 -10
- data/lib/generators/hyrax/collection_resource/templates/collection_metadata.yaml +2 -0
- data/lib/generators/hyrax/templates/config/initializers/hyrax.rb +1 -1
- data/lib/generators/hyrax/templates/config/initializers/riiif.rb +11 -7
- data/lib/generators/hyrax/templates/db/migrate/20230725222727_create_hyrax_counter_metrics.rb.erb +14 -0
- data/lib/generators/hyrax/templates/db/migrate/20230803165135_change_work_id_to_string.rb.erb +5 -0
- data/lib/generators/hyrax/templates/db/migrate/20230808102105_add_indices_to_hyrax_counter_metrics.rb.erb +8 -0
- data/lib/generators/hyrax/templates/db/migrate/20230821153635_add_fields_to_counter_metric.rb.erb +8 -0
- data/lib/generators/hyrax/templates/db/seeds.rb +1 -1
- data/lib/generators/hyrax/work_resource/templates/form.rb.erb +1 -1
- data/lib/generators/hyrax/work_resource/templates/metadata.yaml +2 -0
- data/lib/hyrax/active_fedora_dummy_model.rb +6 -1
- data/lib/hyrax/configuration.rb +147 -43
- data/lib/hyrax/controlled_vocabularies/location.rb +7 -1
- data/lib/hyrax/engine.rb +2 -1
- data/lib/hyrax/form_fields.rb +6 -0
- data/lib/hyrax/publisher.rb +23 -3
- data/lib/hyrax/redis_event_store.rb +7 -8
- data/lib/hyrax/resource_name.rb +4 -0
- data/lib/hyrax/specs/capybara.rb +25 -37
- data/lib/hyrax/specs/shared_specs/hydra_works.rb +34 -7
- data/lib/hyrax/specs/shared_specs/indexers.rb +24 -6
- data/lib/hyrax/transactions/collection_destroy.rb +3 -2
- data/lib/hyrax/transactions/container.rb +47 -0
- data/lib/hyrax/transactions/file_metadata_destroy.rb +20 -0
- data/lib/hyrax/transactions/file_set_destroy.rb +3 -1
- data/lib/hyrax/transactions/file_set_update.rb +21 -0
- data/lib/hyrax/transactions/steps/add_file_sets.rb +6 -0
- data/lib/hyrax/transactions/steps/add_to_parent.rb +1 -1
- data/lib/hyrax/transactions/steps/apply_permission_template.rb +40 -0
- data/lib/hyrax/transactions/steps/delete_all_file_metadata.rb +46 -0
- data/lib/hyrax/transactions/steps/delete_all_file_sets.rb +46 -0
- data/lib/hyrax/transactions/steps/file_metadata_delete.rb +40 -0
- data/lib/hyrax/transactions/steps/remove_from_membership.rb +45 -0
- data/lib/hyrax/transactions/steps/save.rb +21 -0
- data/lib/hyrax/transactions/work_create.rb +1 -0
- data/lib/hyrax/transactions/work_destroy.rb +3 -2
- data/lib/hyrax/version.rb +1 -1
- data/lib/hyrax.rb +1 -0
- data/lib/tasks/collection_type_global_id.rake +9 -4
- data/lib/tasks/embargo_lease.rake +1 -0
- data/lib/valkyrie/indexing/solr/indexing_adapter.rb +2 -0
- data/lib/wings/active_fedora_converter/default_work.rb +7 -2
- data/lib/wings/active_fedora_converter/file_metadata_node.rb +1 -1
- data/lib/wings/active_fedora_converter.rb +53 -11
- data/lib/wings/attribute_transformer.rb +24 -17
- data/lib/wings/model_transformer.rb +23 -12
- data/lib/wings/orm_converter.rb +23 -18
- data/lib/wings/setup.rb +23 -3
- data/lib/wings/valkyrie/persister.rb +4 -2
- data/lib/wings/valkyrie/storage.rb +8 -90
- data/lib/wings.rb +5 -0
- data/package.json +3 -1
- data/tasks/hyrax_dev.rake +2 -33
- data/template.rb +1 -1
- metadata +104 -81
- data/.engine_cart.yml +0 -3
- data/app/forms/hyrax/forms/file_manager_form.rb +0 -35
- data/app/services/hyrax/collections/migration_service.rb +0 -113
- data/app/views/hyrax/base/_form_collections_error.html.erb +0 -1
- data/app/views/hyrax/base/_form_in_works_error.html.erb +0 -3
- data/app/views/hyrax/base/_form_ordered_members_error.html.erb +0 -3
- data/app/views/hyrax/base/_form_visibility_error.html.erb +0 -19
- data/app/views/hyrax/users/_user_util_links_extra.html.erb +0 -0
- data/lib/hyrax/specs/shared_specs/valkyrie_storage_versions.rb +0 -9
@@ -23,6 +23,7 @@
|
|
23
23
|
attributes:
|
24
24
|
monograph_title:
|
25
25
|
type: string
|
26
|
+
predicate: http://hyrax-example.com/monograph_title
|
26
27
|
record_info:
|
27
28
|
type: string
|
28
29
|
form:
|
@@ -30,26 +31,33 @@ attributes:
|
|
30
31
|
primary: true
|
31
32
|
index_keys:
|
32
33
|
- "record_info_tesim"
|
34
|
+
predicate: http://hyrax-example.com/record_info
|
33
35
|
place_of_publication:
|
34
36
|
type: string
|
35
37
|
form:
|
36
38
|
required: false
|
37
39
|
primary: true
|
40
|
+
predicate: http://hyrax-example.com/place_of_publication
|
38
41
|
genre:
|
39
42
|
type: string
|
40
43
|
form:
|
41
44
|
primary: true
|
45
|
+
predicate: http://hyrax-example.com/genre
|
42
46
|
series_title:
|
43
47
|
type: string
|
44
48
|
form:
|
45
49
|
primary: false
|
50
|
+
predicate: http://hyrax-example.com/series_title
|
46
51
|
target_audience:
|
47
52
|
type: string
|
48
53
|
form:
|
49
54
|
multiple: true
|
55
|
+
predicate: http://hyrax-example.com/target_audience
|
50
56
|
table_of_contents:
|
51
57
|
type: string
|
52
58
|
form:
|
53
59
|
multiple: false
|
60
|
+
predicate: http://hyrax-example.com/table_of_contents
|
54
61
|
date_of_issuance:
|
55
62
|
type: string
|
63
|
+
predicate: http://hyrax-example.com/date_of_issuance
|
data/.dassie/config/redis.yml
CHANGED
@@ -1,9 +1,11 @@
|
|
1
1
|
development:
|
2
2
|
host: <%= ENV.fetch('REDIS_HOST', 'localhost') %>
|
3
3
|
port: <%= ENV.fetch('REDIS_PORT', 6379) %>
|
4
|
+
password: <%= ENV['REDIS_PASSWORD'] %>
|
4
5
|
test:
|
5
6
|
host: <%= ENV.fetch('REDIS_HOST', 'localhost') %>
|
6
7
|
port: <%= ENV.fetch('REDIS_PORT', 6379) %>
|
8
|
+
password: <%= ENV['REDIS_PASSWORD'] %>
|
7
9
|
production:
|
8
10
|
host: <%= ENV.fetch('REDIS_HOST', 'localhost') %>
|
9
11
|
port: <%= ENV.fetch('REDIS_PORT', 6379) %>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class CreateHyraxCounterMetrics < ActiveRecord::Migration[5.2]
|
2
|
+
def change
|
3
|
+
create_table :hyrax_counter_metrics do |t|
|
4
|
+
t.string :worktype
|
5
|
+
t.string :resource_type
|
6
|
+
t.integer :work_id
|
7
|
+
t.date :date
|
8
|
+
t.integer :total_item_investigations
|
9
|
+
t.integer :total_item_requests
|
10
|
+
|
11
|
+
t.timestamps
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
class AddIndicesToHyraxCounterMetrics < ActiveRecord::Migration[5.2]
|
2
|
+
def change
|
3
|
+
add_index :hyrax_counter_metrics, :worktype
|
4
|
+
add_index :hyrax_counter_metrics, :resource_type
|
5
|
+
add_index :hyrax_counter_metrics, :work_id
|
6
|
+
add_index :hyrax_counter_metrics, :date
|
7
|
+
end
|
8
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
class AddFieldsToCounterMetric < ActiveRecord::Migration[5.2]
|
2
|
+
def change
|
3
|
+
add_column :hyrax_counter_metrics, :title, :string
|
4
|
+
add_column :hyrax_counter_metrics, :year_of_publication, :integer, index: true
|
5
|
+
add_column :hyrax_counter_metrics, :publisher, :string, index: true
|
6
|
+
add_column :hyrax_counter_metrics, :author, :string, index: true
|
7
|
+
end
|
8
|
+
end
|
data/.dassie/db/schema.rb
CHANGED
@@ -2,15 +2,15 @@
|
|
2
2
|
# of editing this file, please use the migrations feature of Active Record to
|
3
3
|
# incrementally modify your database, and then regenerate this schema definition.
|
4
4
|
#
|
5
|
-
# This file is the source Rails uses to define your schema when running `rails
|
6
|
-
# db:schema:load`. When creating a new database, `rails db:schema:load` tends to
|
5
|
+
# This file is the source Rails uses to define your schema when running `bin/rails
|
6
|
+
# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
|
7
7
|
# be faster and is potentially less error prone than running all of your
|
8
8
|
# migrations from scratch. Old migrations may fail to apply correctly if those
|
9
9
|
# migrations use external dependencies or application code.
|
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: 2023_08_21_153635) do
|
14
14
|
|
15
15
|
# These are extensions that must be enabled in order to support this database
|
16
16
|
enable_extension "plpgsql"
|
@@ -140,6 +140,25 @@ ActiveRecord::Schema.define(version: 2021_11_30_181150) do
|
|
140
140
|
t.index ["machine_id"], name: "index_hyrax_collection_types_on_machine_id", unique: true
|
141
141
|
end
|
142
142
|
|
143
|
+
create_table "hyrax_counter_metrics", force: :cascade do |t|
|
144
|
+
t.string "worktype"
|
145
|
+
t.string "resource_type"
|
146
|
+
t.string "work_id"
|
147
|
+
t.date "date"
|
148
|
+
t.integer "total_item_investigations"
|
149
|
+
t.integer "total_item_requests"
|
150
|
+
t.datetime "created_at", null: false
|
151
|
+
t.datetime "updated_at", null: false
|
152
|
+
t.string "title"
|
153
|
+
t.integer "year_of_publication"
|
154
|
+
t.string "publisher"
|
155
|
+
t.string "author"
|
156
|
+
t.index ["date"], name: "index_hyrax_counter_metrics_on_date"
|
157
|
+
t.index ["resource_type"], name: "index_hyrax_counter_metrics_on_resource_type"
|
158
|
+
t.index ["work_id"], name: "index_hyrax_counter_metrics_on_work_id"
|
159
|
+
t.index ["worktype"], name: "index_hyrax_counter_metrics_on_worktype"
|
160
|
+
end
|
161
|
+
|
143
162
|
create_table "hyrax_default_administrative_set", force: :cascade do |t|
|
144
163
|
t.string "default_admin_set_id", null: false
|
145
164
|
t.datetime "created_at", null: false
|
data/.dockerignore
CHANGED
@@ -13,13 +13,16 @@ Present tense short summary (50 characters or less)
|
|
13
13
|
|
14
14
|
### Type of change (for release notes)
|
15
15
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
-
|
20
|
-
-
|
21
|
-
-
|
22
|
-
-
|
16
|
+
Add an appropriate `notes-*` label to the PR (or indicate here) that classifies this change.
|
17
|
+
|
18
|
+
Choose from:
|
19
|
+
- `notes-major` Major Changes (Potentially breaking changes)
|
20
|
+
- `notes-minor` New Features that are backward compatible
|
21
|
+
- `notes-deprecation` Deprecations
|
22
|
+
- `notes-bugfix` Bug Fixes
|
23
|
+
- `notes-valkyrie` Valkyrie Progress
|
24
|
+
- `notes-docs` Documentation
|
25
|
+
- `notes-container` Containerization related (Docker, Helm, etc)
|
23
26
|
|
24
27
|
### Detailed Description
|
25
28
|
|
data/.github/release.yml
CHANGED
@@ -3,10 +3,10 @@ changelog:
|
|
3
3
|
- title: Major Changes (Potentially breaking changes)
|
4
4
|
labels:
|
5
5
|
- notes-major
|
6
|
-
- title: New Features
|
6
|
+
- title: New Features and Non-breaking Changes
|
7
7
|
labels:
|
8
8
|
- notes-minor
|
9
|
-
- title:
|
9
|
+
- title: Deprecation Notices
|
10
10
|
labels:
|
11
11
|
- notes-deprecation
|
12
12
|
- title: Bug Fixes
|
@@ -21,6 +21,9 @@ changelog:
|
|
21
21
|
- title: Containerization
|
22
22
|
labels:
|
23
23
|
- notes-container
|
24
|
+
- title: Tests and CI Process
|
25
|
+
labels:
|
26
|
+
- notes-tests
|
24
27
|
- title: Other
|
25
28
|
labels:
|
26
29
|
- "*"
|
data/.gitignore
CHANGED
data/.koppie/.env
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
APP_NAME=koppie
|
2
|
+
BUNDLE_GEMFILE=Gemfile.koppie
|
3
|
+
BUNDLE_PATH=/app/bundle
|
4
|
+
CH12N_TOOL=fits_servlet
|
1
5
|
CHROME_HEADLESS_MODE=false
|
2
6
|
DATABASE_CLEANER_ALLOW_REMOTE_DATABASE_URL=true
|
3
7
|
DATABASE_TEST_URL=postgresql://hyrax_user:hyrax_password@postgres/hyrax_test?pool=5
|
@@ -7,12 +11,17 @@ DB_NAME=koppie
|
|
7
11
|
DB_PASSWORD=hyrax_password
|
8
12
|
DB_PORT=5432
|
9
13
|
DB_USERNAME=hyrax_user
|
14
|
+
FCREPO_URL=http://fedoraAdmin:fedoraAdmin@fcrepo:8080/fcrepo/rest
|
15
|
+
FITS_SERVLET_URL=http://fits:8080/fits
|
10
16
|
HUB_URL=http://chrome:4444/wd/hub
|
11
17
|
HYRAX_DERIVATIVES_PATH=/app/samvera/hyrax-webapp/derivatives/
|
12
18
|
HYRAX_ENGINE_PATH=/app/samvera/hyrax-engine
|
13
19
|
HYRAX_UPLOAD_PATH=/app/samvera/hyrax-webapp/uploads/
|
14
20
|
HYRAX_VALKYRIE=true
|
15
21
|
IN_DOCKER=true
|
22
|
+
KARMA_BROWSER=remote-chromium
|
23
|
+
KARMA_HOSTNAME=app
|
24
|
+
MEMCACHED_HOST=memcached
|
16
25
|
METADATA_DATABASE_NAME=koppie_metadata_development
|
17
26
|
POSTGRES_DB=koppie
|
18
27
|
POSTGRES_HOST_AUTH_METHOD=trust
|
@@ -25,7 +34,7 @@ RAILS_LOG_TO_STDOUT=true
|
|
25
34
|
RAILS_QUEUE=sidekiq
|
26
35
|
REDIS_HOST=redis
|
27
36
|
REDIS_PASSWORD=sidekickin
|
28
|
-
REDIS_URL=redis
|
37
|
+
REDIS_URL=redis://:sidekickin@redis:6379
|
29
38
|
SEED_KOPPIE=true
|
30
39
|
SKIP_SELENIUM=
|
31
40
|
SOLR_COLLECTION_NAME=koppie
|
@@ -34,6 +43,6 @@ SOLR_CORES=koppie
|
|
34
43
|
SOLR_HOST=solr
|
35
44
|
SOLR_PORT=8983
|
36
45
|
SOLR_URL=http://solr:8983/solr/koppie
|
37
|
-
|
38
|
-
|
39
|
-
|
46
|
+
SOLR_TEST_URL=http://solr:8983/solr/koppie_test
|
47
|
+
VALKYRIE_METADATA_ADAPTER=pg_metadata
|
48
|
+
VALKYRIE_STORAGE_ADAPTER=versioned_disk_storage
|
data/.koppie/Gemfile
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# Attempts to determine if a global gem source has ready been added by another Gemfile
|
1
3
|
if @sources.global_rubygems_source == Bundler::SourceList.new.global_rubygems_source
|
2
4
|
Bundler.ui.info '[Koppie] Adding global rubygems source.'
|
3
5
|
source 'https://rubygems.org'
|
@@ -10,15 +12,14 @@ gem 'bootsnap', '>= 1.1.0', require: false
|
|
10
12
|
gem 'bootstrap', '~> 4.0'
|
11
13
|
gem 'coffee-rails', '~> 4.2'
|
12
14
|
gem 'dalli'
|
13
|
-
gem 'devise'
|
14
|
-
gem 'devise-guests', '0.8
|
15
|
-
gem 'hydra-role-management'
|
15
|
+
gem 'devise'
|
16
|
+
gem 'devise-guests', '~> 0.8'
|
16
17
|
gemspec name: 'hyrax', path: ENV.fetch('HYRAX_ENGINE_PATH', '..')
|
17
18
|
gem 'jbuilder', '~> 2.5'
|
18
19
|
gem 'jquery-rails'
|
19
20
|
gem 'pg', '~> 1.3'
|
20
|
-
gem 'puma'
|
21
|
-
gem 'rails', '~> 6.
|
21
|
+
gem 'puma'
|
22
|
+
gem 'rails', '~> 6.1'
|
22
23
|
gem 'riiif', '~> 2.1'
|
23
24
|
gem 'rsolr', '>= 1.0', '< 3'
|
24
25
|
gem 'sass-rails', '~> 6.0'
|
@@ -41,11 +42,8 @@ group :development do
|
|
41
42
|
end
|
42
43
|
|
43
44
|
group :development, :test do
|
44
|
-
gem '
|
45
|
-
gem
|
46
|
-
gem
|
47
|
-
gem
|
48
|
-
gem "pry-rescue"
|
49
|
-
gem 'rspec-rails'
|
50
|
-
gem 'solr_wrapper', '>= 0.3'
|
45
|
+
gem 'debug', '>= 1.0.0'
|
46
|
+
gem 'pry-doc'
|
47
|
+
gem 'pry-rails'
|
48
|
+
gem 'pry-rescue'
|
51
49
|
end
|
data/.koppie/Rakefile
CHANGED
@@ -1,15 +1,11 @@
|
|
1
1
|
class Ability
|
2
2
|
include Hydra::Ability
|
3
|
-
|
3
|
+
|
4
4
|
include Hyrax::Ability
|
5
5
|
self.ability_logic += [:everyone_can_create_curation_concerns]
|
6
6
|
|
7
7
|
# Define any customized permissions here.
|
8
8
|
def custom_permissions
|
9
|
-
if current_user.admin?
|
10
|
-
can [:create, :show, :add_user, :remove_user, :index, :edit, :update, :destroy], Role
|
11
|
-
end
|
12
|
-
|
13
9
|
# Limits deleting objects to a the admin user
|
14
10
|
#
|
15
11
|
# if current_user.admin?
|
data/.koppie/app/models/user.rb
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
class User < ApplicationRecord
|
2
2
|
# Connects this user object to Hydra behaviors.
|
3
3
|
include Hydra::User
|
4
|
-
# Connects this user object to Role-management behaviors.
|
5
|
-
include Hydra::RoleManagement::UserRoles
|
6
4
|
|
7
5
|
# Connects this user object to Hyrax behaviors.
|
8
6
|
include Hyrax::User
|
@@ -6,7 +6,7 @@ require 'rails/all'
|
|
6
6
|
# you've limited to :test, :development, or :production.
|
7
7
|
Bundler.require(*Rails.groups)
|
8
8
|
|
9
|
-
module
|
9
|
+
module Koppie
|
10
10
|
class Application < Rails::Application
|
11
11
|
# Initialize configuration defaults for originally generated Rails version.
|
12
12
|
config.load_defaults 6.0
|
@@ -15,6 +15,7 @@ module NuraxPg
|
|
15
15
|
# Application configuration can go into files in config/initializers
|
16
16
|
# -- all .rb files in that directory are automatically loaded after loading
|
17
17
|
# the framework and any gems in your application.
|
18
|
+
config.session_store :cookie_store, key: "_#{ENV.fetch('APP_NAME', 'koppie')}_session"
|
18
19
|
|
19
20
|
# use SideKiq by default
|
20
21
|
config.active_job.queue_adapter = :sidekiq
|
@@ -1,9 +1,9 @@
|
|
1
1
|
development:
|
2
2
|
adapter: solr
|
3
|
-
url: <%= ENV['SOLR_URL'] || "http://127.0.0.1:8983/solr/nurax-pg-blacklight-dev" %>
|
3
|
+
url: <%= ENV['SOLR_DEVELOPMENT_URL'] || ENV['SOLR_URL'] || "http://127.0.0.1:8983/solr/nurax-pg-blacklight-dev" %>
|
4
4
|
test: &test
|
5
5
|
adapter: solr
|
6
|
-
url: <%= ENV['SOLR_URL'] || "http://127.0.0.1:#{ENV.fetch('SOLR_TEST_PORT', 8985)}/solr/nurax-pg-test" %>
|
6
|
+
url: <%= ENV['SOLR_TEST_URL'] || ENV['SOLR_URL'] || "http://127.0.0.1:#{ENV.fetch('SOLR_TEST_PORT', 8985)}/solr/nurax-pg-test" %>
|
7
7
|
production:
|
8
8
|
adapter: solr
|
9
9
|
url: <%= ENV['SOLR_URL'] || "http://127.0.0.1:8983/solr/nurax-pg" %>
|
@@ -1,5 +1,6 @@
|
|
1
1
|
Rails.application.configure do
|
2
2
|
# Settings specified here will take precedence over those in config/application.rb.
|
3
|
+
config.assets.debug = true
|
3
4
|
|
4
5
|
# The test environment is used exclusively to run your application's
|
5
6
|
# test suite. You never need to work with it otherwise. Remember that
|
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
require 'faraday/multipart'
|
2
3
|
|
3
4
|
# require "shrine/storage/s3"
|
4
5
|
# require "valkyrie/storage/shrine"
|
@@ -24,9 +25,20 @@
|
|
24
25
|
# :nurax_pg_metadata_adapter)
|
25
26
|
Valkyrie::MetadataAdapter.register(
|
26
27
|
Valkyrie::Persistence::Postgres::MetadataAdapter.new,
|
27
|
-
:
|
28
|
+
:pg_metadata
|
28
29
|
)
|
29
|
-
|
30
|
+
|
31
|
+
Valkyrie::MetadataAdapter.register(
|
32
|
+
Valkyrie::Persistence::Fedora::MetadataAdapter.new(
|
33
|
+
connection: ::Ldp::Client.new(Hyrax.config.fedora_connection_builder.call(
|
34
|
+
ENV.fetch('FCREPO_URL') { "http://localhost:8080/fcrepo/rest" })),
|
35
|
+
base_path: Rails.env,
|
36
|
+
schema: Valkyrie::Persistence::Fedora::PermissiveSchema.new(Hyrax::SimpleSchemaLoader.new.permissive_schema_for_valkrie_adapter),
|
37
|
+
fedora_version: 6
|
38
|
+
), :fedora_metadata
|
39
|
+
)
|
40
|
+
|
41
|
+
Valkyrie.config.metadata_adapter = ENV.fetch('VALKYRIE_METADATA_ADAPTER') { :pg_metadata }.to_sym
|
30
42
|
|
31
43
|
# shrine_s3_options = {
|
32
44
|
# bucket: ENV.fetch("REPOSITORY_S3_BUCKET") { "nurax_pg#{Rails.env}" },
|
@@ -46,11 +58,22 @@ Valkyrie.config.metadata_adapter = :nurax_pg_metadata_adapter
|
|
46
58
|
# )
|
47
59
|
#
|
48
60
|
# Valkyrie.config.storage_adapter = :repository_s3
|
61
|
+
|
49
62
|
Valkyrie::StorageAdapter.register(
|
50
|
-
Valkyrie::Storage::
|
51
|
-
|
52
|
-
|
63
|
+
Valkyrie::Storage::Fedora.new(
|
64
|
+
connection: ::Ldp::Client.new(Hyrax.config.fedora_connection_builder.call(
|
65
|
+
ENV.fetch('FCREPO_URL') { "http://localhost:8080/fcrepo/rest" })),
|
66
|
+
base_path: Rails.env,
|
67
|
+
fedora_version: 6
|
68
|
+
), :fedora_storage
|
53
69
|
)
|
54
|
-
|
70
|
+
|
71
|
+
Valkyrie::StorageAdapter.register(
|
72
|
+
Valkyrie::Storage::VersionedDisk.new(base_path: Rails.root.join("storage", "files"),
|
73
|
+
file_mover: FileUtils.method(:cp)),
|
74
|
+
:versioned_disk_storage
|
75
|
+
)
|
76
|
+
|
77
|
+
Valkyrie.config.storage_adapter = ENV.fetch('VALKYRIE_STORAGE_ADAPTER') { :versioned_disk_storage }.to_sym
|
55
78
|
|
56
79
|
Valkyrie.config.indexing_adapter = :solr_index
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module Hyrax
|
3
|
+
class ArkivoConstraint
|
4
|
+
def self.matches?(_request)
|
5
|
+
# Add your own logic here to authorize trusted connections to
|
6
|
+
# the API e.g., if your installation of Arkivo runs on a host
|
7
|
+
# with the 10.0.0.3 IP address, you could use:
|
8
|
+
# request.remote_ip == '10.0.0.3'
|
9
|
+
true
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -7,6 +7,8 @@ Hyrax.config do |config|
|
|
7
7
|
|
8
8
|
config.disable_wings = true # not needed if ENV includes HYRAX_SKIP_WINGS=true
|
9
9
|
|
10
|
+
config.characterization_options = { ch12n_tool: ENV.fetch('CH12N_TOOL', 'fits').to_sym }
|
11
|
+
|
10
12
|
# Register roles that are expected by your implementation.
|
11
13
|
# @see Hyrax::RoleRegistry for additional details.
|
12
14
|
# @note there are magical roles as defined in Hyrax::RoleRegistry::MAGIC_ROLES
|
@@ -97,14 +99,14 @@ Hyrax.config do |config|
|
|
97
99
|
|
98
100
|
# Hyrax can integrate with Zotero's Arkivo service for automatic deposit
|
99
101
|
# of Zotero-managed research items.
|
100
|
-
|
102
|
+
config.arkivo_api = true
|
101
103
|
|
102
104
|
# Stream realtime notifications to users in the browser
|
103
105
|
# config.realtime_notifications = true
|
104
106
|
|
105
107
|
# Location autocomplete uses geonames to search for named regions
|
106
108
|
# Username for connecting to geonames
|
107
|
-
|
109
|
+
config.geonames_username = ENV['GEONAMES_USERNAME'] || ''
|
108
110
|
|
109
111
|
# Should the acceptance of the licence agreement be active (checkbox), or
|
110
112
|
# implied when the save button is pressed? Set to true for active
|
@@ -247,7 +249,7 @@ Hyrax.config do |config|
|
|
247
249
|
# Identify the model class name that will be used for Collections in your app
|
248
250
|
# (i.e. ::Collection for ActiveFedora, Hyrax::PcdmCollection for Valkyrie)
|
249
251
|
# config.collection_model = '::Collection'
|
250
|
-
config.collection_model = 'Hyrax::PcdmCollection'
|
252
|
+
# config.collection_model = 'Hyrax::PcdmCollection'
|
251
253
|
# Injected via `rails g hyrax:collection_resource CollectionResource`
|
252
254
|
config.collection_model = 'CollectionResource'
|
253
255
|
|
@@ -320,12 +322,16 @@ custom_queries = [Hyrax::CustomQueries::Navigators::CollectionMembers,
|
|
320
322
|
Hyrax::CustomQueries::Navigators::ParentCollectionsNavigator,
|
321
323
|
Hyrax::CustomQueries::Navigators::ChildFileSetsNavigator,
|
322
324
|
Hyrax::CustomQueries::Navigators::ChildWorksNavigator,
|
325
|
+
Hyrax::CustomQueries::Navigators::ParentWorkNavigator,
|
323
326
|
Hyrax::CustomQueries::Navigators::FindFiles,
|
324
327
|
Hyrax::CustomQueries::FindAccessControl,
|
325
328
|
Hyrax::CustomQueries::FindCollectionsByType,
|
326
329
|
Hyrax::CustomQueries::FindFileMetadata,
|
327
330
|
Hyrax::CustomQueries::FindIdsByModel,
|
328
|
-
Hyrax::CustomQueries::FindManyByAlternateIds
|
331
|
+
Hyrax::CustomQueries::FindManyByAlternateIds,
|
332
|
+
Hyrax::CustomQueries::FindModelsByAccess,
|
333
|
+
Hyrax::CustomQueries::FindCountBy,
|
334
|
+
Hyrax::CustomQueries::FindByDateRange]
|
329
335
|
custom_queries.each do |handler|
|
330
336
|
Hyrax.query_service.custom_queries.register_query_handler(handler)
|
331
337
|
end
|
@@ -1,12 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
|
3
|
-
Riiif::Image.file_resolver = Riiif::HttpFileResolver.new
|
2
|
+
Rails.application.reloader.to_prepare do
|
4
3
|
Riiif::Image.info_service = lambda do |id, _file|
|
5
4
|
# id will look like a path to a pcdm:file
|
6
5
|
# (e.g. rv042t299%2Ffiles%2F6d71677a-4f80-42f1-ae58-ed1063fd79c7)
|
7
6
|
# but we just want the id for the FileSet it's attached to.
|
8
7
|
|
9
|
-
# Capture everything before the first slash
|
10
8
|
fs_id = id.sub(/\A([^\/]*)\/.*/, '\1')
|
11
9
|
resp = Hyrax::SolrService.get("id:#{fs_id}")
|
12
10
|
doc = resp['response']['docs'].first
|
@@ -14,9 +12,15 @@ ActiveSupport::Reloader.to_prepare do
|
|
14
12
|
{ height: doc['height_is'], width: doc['width_is'], format: doc['mime_type_ssi'], channels: doc['alpha_channels_ssi'] }
|
15
13
|
end
|
16
14
|
|
17
|
-
|
18
|
-
|
19
|
-
|
15
|
+
if Hyrax.config.use_valkyrie?
|
16
|
+
Riiif::Image.file_resolver = Hyrax::RiiifFileResolver.new
|
17
|
+
else
|
18
|
+
Riiif::Image.file_resolver = Riiif::HttpFileResolver.new
|
19
|
+
|
20
|
+
Riiif::Image.file_resolver.id_to_uri = lambda do |id|
|
21
|
+
Hyrax::Base.id_to_uri(CGI.unescape(id)).tap do |url|
|
22
|
+
Rails.logger.info "Riiif resolved #{id} to #{url}"
|
23
|
+
end
|
20
24
|
end
|
21
25
|
end
|
22
26
|
|
@@ -25,5 +29,5 @@ ActiveSupport::Reloader.to_prepare do
|
|
25
29
|
Riiif.not_found_image = Rails.root.join('app', 'assets', 'images', 'us_404.svg')
|
26
30
|
Riiif.unauthorized_image = Rails.root.join('app', 'assets', 'images', 'us_404.svg')
|
27
31
|
|
28
|
-
Riiif::Engine.config.cache_duration =
|
32
|
+
Riiif::Engine.config.cache_duration = 1.day
|
29
33
|
end
|