hyrax 5.0.0.rc2 → 5.0.0.rc3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (307) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +14 -0
  3. data/.dassie/app/listeners/hyrax_listener.rb +81 -0
  4. data/.dassie/config/environments/test.rb +0 -5
  5. data/.dassie/config/initializers/hyrax.rb +5 -0
  6. data/.dassie/config/initializers/publisher.rb +3 -0
  7. data/.dassie/config/initializers/riiif.rb +77 -0
  8. data/.gitignore +4 -0
  9. data/.koppie/.env +2 -2
  10. data/.koppie/app/forms/collection_resource_form.rb +1 -0
  11. data/.koppie/app/indexers/collection_resource_indexer.rb +1 -0
  12. data/.koppie/app/listeners/hyrax_listener.rb +81 -0
  13. data/.koppie/app/models/collection.rb +1 -1
  14. data/.koppie/app/models/collection_resource.rb +1 -0
  15. data/.koppie/config/analytics.yml +5 -5
  16. data/.koppie/config/initializers/publisher.rb +3 -0
  17. data/.koppie/config/initializers/riiif.rb +78 -0
  18. data/.koppie/config/metadata/collection_resource.yaml +8 -166
  19. data/.koppie/config/metadata/sample_metadata.yaml +4 -0
  20. data/CONTAINERS.md +39 -2
  21. data/Dockerfile +14 -11
  22. data/Gemfile +8 -7
  23. data/README.md +2 -0
  24. data/app/actors/hyrax/actors/base_actor.rb +6 -3
  25. data/app/actors/hyrax/actors/file_actor.rb +1 -1
  26. data/app/actors/hyrax/actors/lease_actor.rb +3 -6
  27. data/app/assets/javascripts/hyrax/save_work/uploaded_files.es6 +10 -2
  28. data/app/assets/stylesheets/hyrax/sidebar.scss +6 -1
  29. data/app/controllers/concerns/hyrax/collections_controller_behavior.rb +1 -1
  30. data/app/controllers/concerns/hyrax/local_file_downloads_controller_behavior.rb +12 -19
  31. data/app/controllers/concerns/hyrax/stream_file_downloads_controller_behavior.rb +54 -0
  32. data/app/controllers/concerns/hyrax/valkyrie_downloads_controller_behavior.rb +38 -9
  33. data/app/controllers/concerns/hyrax/works_controller_behavior.rb +19 -14
  34. data/app/controllers/hyrax/admin/admin_sets_controller.rb +2 -2
  35. data/app/controllers/hyrax/admin/analytics/work_reports_controller.rb +5 -5
  36. data/app/controllers/hyrax/dashboard/collections_controller.rb +2 -2
  37. data/app/controllers/hyrax/downloads_controller.rb +1 -0
  38. data/app/controllers/hyrax/file_sets_controller.rb +3 -2
  39. data/app/controllers/hyrax/my/collections_controller.rb +1 -1
  40. data/app/forms/concerns/hyrax/basic_metadata_form_fields_behavior.rb +1 -0
  41. data/app/forms/concerns/hyrax/contained_in_works_behavior.rb +24 -0
  42. data/app/forms/concerns/hyrax/deposit_agreement_behavior.rb +12 -0
  43. data/app/forms/concerns/hyrax/leaseability_behavior.rb +49 -0
  44. data/app/forms/concerns/hyrax/permission_behavior.rb +20 -0
  45. data/app/forms/hyrax/forms/administrative_set_form.rb +1 -5
  46. data/app/forms/hyrax/forms/collection_form.rb +19 -0
  47. data/app/forms/hyrax/forms/file_set_form.rb +5 -0
  48. data/app/forms/hyrax/forms/pcdm_collection_form.rb +1 -5
  49. data/app/forms/hyrax/forms/pcdm_object_form.rb +13 -22
  50. data/app/forms/hyrax/forms/resource_batch_edit_form.rb +7 -2
  51. data/app/forms/hyrax/forms/resource_form.rb +30 -100
  52. data/app/forms/hyrax/forms.rb +52 -0
  53. data/app/helpers/hyrax/hyrax_helper_behavior.rb +2 -0
  54. data/app/indexers/{hyrax → concerns/hyrax}/location_indexer.rb +1 -5
  55. data/app/indexers/{hyrax → concerns/hyrax}/permission_indexer.rb +2 -2
  56. data/app/indexers/{hyrax → concerns/hyrax}/visibility_indexer.rb +1 -1
  57. data/app/indexers/hyrax/administrative_set_indexer.rb +5 -17
  58. data/app/indexers/hyrax/indexers/administrative_set_indexer.rb +25 -0
  59. data/app/indexers/hyrax/indexers/file_set_indexer.rb +144 -0
  60. data/app/indexers/hyrax/indexers/pcdm_collection_indexer.rb +27 -0
  61. data/app/indexers/hyrax/indexers/pcdm_object_indexer.rb +72 -0
  62. data/app/indexers/hyrax/indexers/resource_indexer.rb +86 -0
  63. data/app/indexers/hyrax/indexers.rb +54 -0
  64. data/app/indexers/hyrax/pcdm_collection_indexer.rb +5 -18
  65. data/app/indexers/hyrax/valkyrie_collection_indexer.rb +6 -4
  66. data/app/indexers/hyrax/valkyrie_file_set_indexer.rb +5 -136
  67. data/app/indexers/hyrax/valkyrie_indexer.rb +8 -112
  68. data/app/indexers/hyrax/valkyrie_work_indexer.rb +5 -64
  69. data/app/indexers/hyrax/work_indexer.rb +1 -0
  70. data/app/jobs/create_work_job.rb +1 -0
  71. data/app/models/admin_set.rb +20 -1
  72. data/app/models/collection.rb +5 -0
  73. data/app/models/concerns/hyrax/ability/admin_set_ability.rb +13 -28
  74. data/app/models/concerns/hyrax/ability/collection_ability.rb +26 -28
  75. data/app/models/concerns/hyrax/ability/resource_ability.rb +19 -0
  76. data/app/models/concerns/hyrax/ability.rb +11 -9
  77. data/app/models/concerns/hyrax/collection_behavior.rb +8 -0
  78. data/app/models/concerns/hyrax/solr_document_behavior.rb +15 -5
  79. data/app/models/concerns/hyrax/work_behavior.rb +4 -0
  80. data/app/models/featured_work.rb +12 -4
  81. data/app/models/file_set.rb +5 -0
  82. data/app/models/hyrax/administrative_set.rb +1 -1
  83. data/app/models/hyrax/change_set.rb +2 -2
  84. data/app/models/hyrax/file_metadata.rb +34 -7
  85. data/app/models/hyrax/file_set.rb +2 -2
  86. data/app/models/hyrax/group.rb +9 -38
  87. data/app/models/hyrax/group_behavior.rb +58 -0
  88. data/app/models/hyrax/model_registry.rb +111 -0
  89. data/app/models/hyrax/pcdm_collection.rb +1 -7
  90. data/app/models/hyrax/resource.rb +66 -8
  91. data/app/models/hyrax/statistic.rb +1 -1
  92. data/app/models/hyrax/work.rb +1 -7
  93. data/app/presenters/hyrax/collapsable_section_presenter.rb +7 -3
  94. data/app/presenters/hyrax/file_set_presenter.rb +8 -6
  95. data/app/presenters/hyrax/lease_presenter.rb +4 -0
  96. data/app/presenters/hyrax/menu_presenter.rb +14 -2
  97. data/app/presenters/hyrax/pcdm_member_presenter_factory.rb +1 -1
  98. data/app/presenters/hyrax/version_list_presenter.rb +6 -4
  99. data/app/search_builders/hyrax/admin_set_search_builder.rb +1 -1
  100. data/app/search_builders/hyrax/catalog_search_builder.rb +2 -2
  101. data/app/search_builders/hyrax/dashboard/collections_search_builder.rb +5 -3
  102. data/app/search_builders/hyrax/exposed_models_relation.rb +1 -1
  103. data/app/search_builders/hyrax/file_set_search_builder.rb +1 -1
  104. data/app/search_builders/hyrax/filter_by_type.rb +3 -2
  105. data/app/search_builders/hyrax/member_with_files_search_builder.rb +1 -1
  106. data/app/search_builders/hyrax/my/collections_search_builder.rb +2 -2
  107. data/app/search_builders/hyrax/my/find_works_search_builder.rb +8 -3
  108. data/app/services/hyrax/access_control_list.rb +21 -4
  109. data/app/services/hyrax/action/create_valkyrie_work.rb +80 -0
  110. data/app/services/hyrax/admin_set_create_service.rb +7 -3
  111. data/app/services/hyrax/admin_set_service.rb +2 -2
  112. data/app/services/hyrax/collections/collection_member_search_service.rb +2 -0
  113. data/app/services/hyrax/collections/permissions_service.rb +27 -9
  114. data/app/services/hyrax/custom_queries/find_collections_by_type.rb +1 -1
  115. data/app/services/hyrax/custom_queries/find_file_metadata.rb +1 -1
  116. data/app/services/hyrax/custom_queries/navigators/find_files.rb +1 -1
  117. data/app/services/hyrax/custom_queries/navigators/parent_work_navigator.rb +1 -1
  118. data/app/services/hyrax/edit_permissions_service.rb +1 -1
  119. data/app/services/hyrax/embargo_manager.rb +1 -1
  120. data/app/services/hyrax/file_set_file_service.rb +21 -10
  121. data/app/services/hyrax/form_factory.rb +1 -1
  122. data/app/services/hyrax/lease_manager.rb +39 -16
  123. data/app/services/hyrax/lease_service.rb +12 -6
  124. data/app/services/hyrax/listeners/acl_index_listener.rb +1 -1
  125. data/app/services/hyrax/listeners/active_fedora_acl_index_listener.rb +1 -1
  126. data/app/services/hyrax/listeners/member_cleanup_listener.rb +15 -1
  127. data/app/services/hyrax/listeners/object_lifecycle_listener.rb +5 -1
  128. data/app/services/hyrax/listeners/trophy_cleanup_listener.rb +2 -1
  129. data/app/services/hyrax/listeners/workflow_listener.rb +13 -0
  130. data/app/services/hyrax/listeners.rb +2 -1
  131. data/app/services/hyrax/location_service.rb +3 -0
  132. data/app/services/hyrax/multiple_membership_checker.rb +1 -1
  133. data/app/services/hyrax/simple_schema_loader.rb +1 -1
  134. data/app/services/hyrax/solr_service.rb +19 -5
  135. data/app/services/hyrax/statistics/collections/over_time.rb +1 -1
  136. data/app/services/hyrax/statistics/query_service.rb +6 -0
  137. data/app/services/hyrax/valkyrie_persist_derivatives.rb +11 -4
  138. data/app/services/hyrax/valkyrie_upload.rb +1 -1
  139. data/app/services/hyrax/work_uploads_handler.rb +5 -4
  140. data/app/views/_user_util_links.html.erb +1 -1
  141. data/app/views/collections/edit_fields/_based_near.html.erb +11 -7
  142. data/app/views/hyrax/admin/admin_sets/_form_participants.html.erb +67 -67
  143. data/app/views/hyrax/admin/admin_sets/edit.html.erb +1 -1
  144. data/app/views/hyrax/admin/collection_types/_form_participants.html.erb +3 -1
  145. data/app/views/hyrax/base/_attribute_rows.html.erb +1 -0
  146. data/app/views/hyrax/base/_base_form_files_prepend.html.erb +4 -0
  147. data/app/views/hyrax/base/_form_files.html.erb +65 -64
  148. data/app/views/hyrax/base/show.html.erb +2 -3
  149. data/app/views/hyrax/collections/show.html.erb +7 -9
  150. data/app/views/hyrax/dashboard/_sidebar.html.erb +4 -3
  151. data/app/views/hyrax/dashboard/collections/_form_share_table.html.erb +2 -2
  152. data/app/views/hyrax/file_sets/media_display/_audio.html.erb +1 -1
  153. data/app/views/hyrax/file_sets/media_display/_video.html.erb +1 -1
  154. data/app/views/hyrax/my/facet.html.erb +1 -1
  155. data/app/views/layouts/_head_tag_content.html.erb +1 -0
  156. data/app/views/shared/_footer.html.erb +1 -1
  157. data/chart/hyrax/Chart.yaml +3 -3
  158. data/chart/hyrax/values.yaml +9 -1
  159. data/config/initializers/listeners.rb +1 -1
  160. data/config/locales/hyrax.de.yml +5 -0
  161. data/config/locales/hyrax.en.yml +10 -0
  162. data/config/locales/hyrax.es.yml +5 -0
  163. data/config/locales/hyrax.fr.yml +5 -0
  164. data/config/locales/hyrax.it.yml +5 -0
  165. data/config/locales/hyrax.pt-BR.yml +5 -0
  166. data/config/locales/hyrax.zh.yml +5 -0
  167. data/config/metadata/basic_metadata.yaml +1 -0
  168. data/config/metadata/core_metadata.yaml +2 -0
  169. data/config/metadata/file_set_metadata.yaml +2 -0
  170. data/docker-compose-koppie.yml +3 -3
  171. data/docker-compose-sirenia.yml +3 -3
  172. data/documentation/developing-your-hyrax-based-app.md +77 -60
  173. data/hyrax.gemspec +9 -2
  174. data/lib/generators/hyrax/collection_resource/templates/collection_indexer.rb.erb +1 -1
  175. data/lib/generators/hyrax/config_generator.rb +12 -0
  176. data/lib/generators/hyrax/install_generator.rb +37 -7
  177. data/lib/generators/hyrax/listeners_generator.rb +18 -0
  178. data/lib/generators/hyrax/models_generator.rb +1 -10
  179. data/lib/generators/hyrax/riiif_generator.rb +6 -4
  180. data/lib/generators/hyrax/templates/.env +9 -0
  181. data/lib/generators/hyrax/templates/.lando.yml +50 -0
  182. data/lib/generators/hyrax/templates/app/listeners/hyrax_listener.rb +81 -0
  183. data/lib/generators/hyrax/templates/app/models/file_set.rb +1 -2
  184. data/lib/generators/hyrax/templates/config/initializers/1_valkyrie.rb +102 -0
  185. data/lib/generators/hyrax/templates/config/initializers/file_services.rb +6 -0
  186. data/lib/generators/hyrax/templates/config/initializers/hyrax.rb +41 -5
  187. data/lib/generators/hyrax/templates/config/initializers/publisher.rb +3 -0
  188. data/lib/generators/hyrax/templates/config/initializers/riiif.rb +77 -0
  189. data/lib/generators/hyrax/templates/config/locales/hyrax.de.yml +1 -1
  190. data/lib/generators/hyrax/templates/config/locales/hyrax.en.yml +1 -1
  191. data/lib/generators/hyrax/templates/config/locales/hyrax.es.yml +1 -1
  192. data/lib/generators/hyrax/templates/config/locales/hyrax.fr.yml +1 -1
  193. data/lib/generators/hyrax/templates/config/locales/hyrax.it.yml +1 -1
  194. data/lib/generators/hyrax/templates/config/locales/hyrax.pt-BR.yml +1 -1
  195. data/lib/generators/hyrax/templates/config/locales/hyrax.zh.yml +1 -1
  196. data/lib/generators/hyrax/templates/config/redis.yml +3 -6
  197. data/lib/generators/hyrax/templates/config/valkyrie_index.yml +4 -9
  198. data/lib/generators/hyrax/work_resource/templates/indexer.rb.erb +1 -1
  199. data/lib/hyrax/configuration.rb +95 -7
  200. data/lib/hyrax/indexer.rb +1 -1
  201. data/lib/hyrax/publisher.rb +5 -2
  202. data/lib/hyrax/resource_sync/change_list_writer.rb +1 -1
  203. data/lib/hyrax/resource_sync/resource_list_writer.rb +1 -1
  204. data/lib/hyrax/specs/capybara.rb +1 -0
  205. data/lib/hyrax/specs/shared_specs/hydra_works.rb +78 -20
  206. data/lib/hyrax/specs/shared_specs/indexers.rb +1 -1
  207. data/lib/hyrax/transactions/admin_set_destroy.rb +2 -1
  208. data/lib/hyrax/transactions/container.rb +5 -0
  209. data/lib/hyrax/transactions/steps/add_to_parent.rb +1 -0
  210. data/lib/hyrax/transactions/steps/check_for_default_admin_set.rb +32 -0
  211. data/lib/hyrax/transactions/steps/check_for_empty_admin_set.rb +1 -1
  212. data/lib/hyrax/transactions/steps/save.rb +2 -1
  213. data/lib/hyrax/transactions/steps/set_user_as_creator.rb +1 -1
  214. data/lib/hyrax/transactions/steps/update_work_members.rb +2 -0
  215. data/lib/hyrax/version.rb +1 -1
  216. data/lib/hyrax.rb +1 -0
  217. data/lib/tasks/embargo_lease.rake +1 -0
  218. data/lib/valkyrie/indexing/solr/indexing_adapter.rb +21 -7
  219. data/lib/wings/active_fedora_converter/default_work.rb +4 -5
  220. data/lib/wings/active_fedora_converter/file_metadata_node.rb +1 -1
  221. data/lib/wings/model_registry.rb +8 -0
  222. data/lib/wings/model_transformer.rb +19 -2
  223. data/lib/wings/orm_converter.rb +4 -0
  224. data/lib/wings/services/custom_queries/find_ids_by_model.rb +2 -2
  225. data/lib/wings/valkyrie/query_service.rb +5 -2
  226. data/lib/wings.rb +3 -0
  227. data/spec/factories/access_control.rb +12 -0
  228. data/spec/factories/admin_sets.rb +32 -0
  229. data/spec/factories/admin_sets_lw.rb +222 -0
  230. data/spec/factories/administrative_sets.rb +79 -0
  231. data/spec/factories/api_items.rb +92 -0
  232. data/spec/factories/collection_branding_infos.rb +12 -0
  233. data/spec/factories/collection_type_participants.rb +9 -0
  234. data/spec/factories/collection_types.rb +139 -0
  235. data/spec/factories/collections.rb +282 -0
  236. data/spec/factories/collections_factory.rb +107 -0
  237. data/spec/factories/content_blocks.rb +5 -0
  238. data/spec/factories/counter_metrics.rb +12 -0
  239. data/spec/factories/featured_works.rb +5 -0
  240. data/spec/factories/file_sets.rb +45 -0
  241. data/spec/factories/generic_works.rb +200 -0
  242. data/spec/factories/hyrax_collection.rb +92 -0
  243. data/spec/factories/hyrax_default_admin_set.rb +7 -0
  244. data/spec/factories/hyrax_embargo.rb +18 -0
  245. data/spec/factories/hyrax_file_metadata.rb +92 -0
  246. data/spec/factories/hyrax_file_set.rb +129 -0
  247. data/spec/factories/hyrax_lease.rb +18 -0
  248. data/spec/factories/hyrax_resource.rb +15 -0
  249. data/spec/factories/hyrax_work.rb +221 -0
  250. data/spec/factories/object_id.rb +7 -0
  251. data/spec/factories/operations.rb +22 -0
  252. data/spec/factories/permission.rb +7 -0
  253. data/spec/factories/permission_template_accesses.rb +17 -0
  254. data/spec/factories/permission_templates.rb +111 -0
  255. data/spec/factories/proxy_deposit_requests.rb +7 -0
  256. data/spec/factories/single_use_links.rb +14 -0
  257. data/spec/factories/sipity_entities.rb +17 -0
  258. data/spec/factories/uploaded_files.rb +11 -0
  259. data/spec/factories/users.rb +52 -0
  260. data/spec/factories/workflow_actions.rb +7 -0
  261. data/spec/factories/workflow_states.rb +7 -0
  262. data/spec/factories/workflows.rb +7 -0
  263. data/spec/support/book_resource.rb +36 -0
  264. data/spec/support/can_can_overrides.rb +43 -0
  265. data/spec/support/clean_solr.rb +7 -0
  266. data/spec/support/controller_level_helpers.rb +27 -0
  267. data/spec/support/factory_helpers.rb +94 -0
  268. data/spec/support/fakes/fake_actor.rb +22 -0
  269. data/spec/support/fakes/fake_authority.rb +14 -0
  270. data/spec/support/fakes/fake_search_builder_scope.rb +44 -0
  271. data/spec/support/fakes/indexing_adapter.rb +17 -0
  272. data/spec/support/fakes/test_hydra_group_service.rb +55 -0
  273. data/spec/support/features/batch_edit_actions.rb +37 -0
  274. data/spec/support/features/session_helpers.rb +15 -0
  275. data/spec/support/features/workflow.rb +10 -0
  276. data/spec/support/features.rb +11 -0
  277. data/spec/support/form_with_validations.rb +15 -0
  278. data/spec/support/input_support.rb +12 -0
  279. data/spec/support/logging_formatter.rb +67 -0
  280. data/spec/support/matchers/api_responses.rb +27 -0
  281. data/spec/support/matchers/collection_type_property_matchers.rb +30 -0
  282. data/spec/support/matchers/embargo.rb +9 -0
  283. data/spec/support/matchers/lease.rb +9 -0
  284. data/spec/support/matchers/match_valkyrie_ids_with_af_ids.rb +12 -0
  285. data/spec/support/matchers/pcdm_matchers.rb +34 -0
  286. data/spec/support/matchers/permission.rb +31 -0
  287. data/spec/support/matchers/response_matchers.rb +8 -0
  288. data/spec/support/optional_example.rb +17 -0
  289. data/spec/support/rake.rb +42 -0
  290. data/spec/support/selectors.rb +112 -0
  291. data/spec/support/shared_examples_for_collection_presenter.rb +44 -0
  292. data/spec/support/simple_work.rb +28 -0
  293. data/spec/support/spec_statistic.rb +24 -0
  294. data/spec/support/speedup.rb +7 -0
  295. data/spec/support/statistic_helper.rb +10 -0
  296. data/spec/support/valkyrie_indexing.rb +2 -0
  297. data/spec/support/wings_models.rb +9 -0
  298. data/template.rb +1 -3
  299. metadata +112 -30
  300. data/app/indexers/hyrax/resource_indexer.rb +0 -15
  301. data/app/models/concerns/hyrax/riiif_file.rb +0 -30
  302. data/app/services/hyrax/characterization/model_wrapper.rb +0 -0
  303. data/app/services/hyrax/custom_queries/find_by_collection_type.rb +0 -0
  304. data/app/services/hyrax/query_service.rb +0 -0
  305. data/app/services/hyrax/riiif_file_resolver.rb +0 -50
  306. data/lib/hyrax/specs/disable_animations_in_test_environment.rb +0 -53
  307. /data/app/indexers/{hyrax → concerns/hyrax}/thumbnail_indexer.rb +0 -0
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Generated via
4
4
  # `rails generate hyrax:work_resource <%= class_name %>`
5
- class <%= class_name %>Indexer < Hyrax::ValkyrieWorkIndexer
5
+ class <%= class_name %>Indexer < Hyrax::Indexers::PcdmObjectIndexer(<%= class_name %>)
6
6
  include Hyrax::Indexer(:basic_metadata)
7
7
  include Hyrax::Indexer(:<%= file_name %>)
8
8
 
@@ -55,7 +55,7 @@ module Hyrax
55
55
  #
56
56
  # == Valkyrie
57
57
  #
58
- # *Experimental:* Options for toggling Hyrax's experimental "Wings" valkyrie
58
+ # Options for toggling Hyrax's "Wings" valkyrie
59
59
  # adapter and configuring valkyrie.
60
60
  #
61
61
  # @see Hyrax.config
@@ -170,7 +170,7 @@ module Hyrax
170
170
  # @return [Hash] of options like {ch12n_tool: :fits_servlet}
171
171
  attr_writer :characterization_options
172
172
  def characterization_options
173
- @characterization_options ||= {}
173
+ @characterization_options ||= { ch12n_tool: ENV.fetch('CH12N_TOOL', 'fits').to_sym }
174
174
  end
175
175
 
176
176
  ##
@@ -267,6 +267,28 @@ module Hyrax
267
267
  @derivative_services ||= [Hyrax::FileSetDerivativesService]
268
268
  end
269
269
 
270
+ attr_writer :file_set_model
271
+ ##
272
+ # @return [#constantize] a string representation of the admin set
273
+ # model
274
+ def file_set_model
275
+ @file_set_model ||= 'Hyrax::FileSet'
276
+ end
277
+
278
+ ##
279
+ # @return [Class] the configured admin set model class
280
+ def file_set_class
281
+ file_set_model.constantize
282
+ end
283
+
284
+ ##
285
+ # @!attribute [rw] file_set_file_service
286
+ # @return [Class] implementer of {Hyrax::FileSetFileService}
287
+ attr_writer :file_set_file_service
288
+ def file_set_file_service
289
+ @file_set_file_service ||= Hyrax::FileSetFileService
290
+ end
291
+
270
292
  attr_writer :fixity_service
271
293
  def fixity_service
272
294
  @fixity_service ||= Hyrax::Fixity::ActiveFedoraFixityService
@@ -595,18 +617,20 @@ module Hyrax
595
617
  end
596
618
 
597
619
  ##
598
- # @return [Boolean] whether to use the experimental valkyrie index
620
+ # @return [Boolean] whether to use the valkyrie index
599
621
  def query_index_from_valkyrie
600
622
  @query_index_from_valkyrie ||= false
601
623
  end
602
624
  attr_writer :query_index_from_valkyrie
603
625
 
604
626
  ##
605
- # @return [Boolean] whether to use experimental valkyrie storage features
627
+ # @return [Boolean] whether to use valkyrie storage features
606
628
  def use_valkyrie?
629
+ return @use_valkyrie unless @use_valkyrie.nil?
607
630
  return true if disable_wings # always return true if wings is disabled
608
631
  ActiveModel::Type::Boolean.new.cast(ENV.fetch('HYRAX_VALKYRIE', false))
609
632
  end
633
+ attr_writer :use_valkyrie
610
634
  # @!endgroup
611
635
 
612
636
  attr_writer :feature_config_path
@@ -836,7 +860,7 @@ module Hyrax
836
860
  # @return [#constantize] a string representation of the collection
837
861
  # model
838
862
  def collection_model
839
- @collection_model ||= '::Collection'
863
+ @collection_model ||= 'Hyrax::PcdmCollection'
840
864
  end
841
865
 
842
866
  ##
@@ -850,7 +874,7 @@ module Hyrax
850
874
  # @return [#constantize] a string representation of the admin set
851
875
  # model
852
876
  def admin_set_model
853
- @admin_set_model ||= 'AdminSet'
877
+ @admin_set_model ||= 'Hyrax::AdministrativeSet'
854
878
  end
855
879
 
856
880
  ##
@@ -890,6 +914,70 @@ module Hyrax
890
914
  @index_field_mapper ||= ActiveFedora.index_field_mapper
891
915
  end
892
916
 
917
+ attr_writer :administrative_set_form
918
+ ##
919
+ # @return [Class]
920
+ def administrative_set_form
921
+ @administrative_set_form ||= Hyrax::Forms::AdministrativeSetForm
922
+ end
923
+
924
+ attr_writer :file_set_form
925
+ ##
926
+ # @return [Class]
927
+ def file_set_form
928
+ @file_set_form ||= Hyrax::Forms::FileSetForm
929
+ end
930
+
931
+ attr_writer :pcdm_collection_form
932
+ ##
933
+ # @return [Class]
934
+ def pcdm_collection_form
935
+ @pcdm_collection_form ||= Hyrax::Forms::PcdmCollectionForm
936
+ end
937
+
938
+ attr_writer :pcdm_object_form_builder
939
+ ##
940
+ # @return [Proc]
941
+ def pcdm_object_form_builder
942
+ return @pcdm_object_form_builder unless @pcdm_object_form_builder.nil?
943
+ "Hyrax::Forms::PcdmObjectForm".constantize # autoload
944
+ @pcdm_object_form_builder = lambda do |model_class|
945
+ Hyrax::Forms::PcdmObjectForm(model_class)
946
+ end
947
+ end
948
+
949
+ attr_writer :administrative_set_indexer
950
+ ##
951
+ # @return [Class]
952
+ def administrative_set_indexer
953
+ @administrative_set_indexer ||= Hyrax::Indexers::AdministrativeSetIndexer
954
+ end
955
+
956
+ attr_writer :file_set_indexer
957
+ ##
958
+ # @return [Class]
959
+ def file_set_indexer
960
+ @file_set_indexer ||= Hyrax::Indexers::FileSetIndexer
961
+ end
962
+
963
+ attr_writer :pcdm_collection_indexer
964
+ ##
965
+ # @return [Class]
966
+ def pcdm_collection_indexer
967
+ @pcdm_collection_indexer ||= Hyrax::Indexers::PcdmCollectionIndexer
968
+ end
969
+
970
+ attr_writer :pcdm_object_indexer_builder
971
+ ##
972
+ # @return [Proc]
973
+ def pcdm_object_indexer_builder
974
+ return @pcdm_object_indexer_builder unless @pcdm_object_indexer_builder.nil?
975
+ "Hyrax::Indexers::PcdmObjectIndexer".constantize # autoload
976
+ @pcdm_object_indexer_builder = lambda do |model_class|
977
+ Hyrax::Indexers::PcdmObjectIndexer(model_class)
978
+ end
979
+ end
980
+
893
981
  # Should a button with "Share my work" show on the front page to users who are not logged in?
894
982
  attr_writer :display_share_button_when_not_logged_in
895
983
  def display_share_button_when_not_logged_in?
@@ -936,7 +1024,7 @@ module Hyrax
936
1024
  attr_writer :translate_id_to_uri
937
1025
  def translate_id_to_uri
938
1026
  @translate_id_to_uri ||= lambda do |id|
939
- "#{ActiveFedora.fedora.host}#{ActiveFedora.fedora.base_path}/#{::Noid::Rails.treeify(id)}"
1027
+ "#{ActiveFedora.fedora.host}#{ActiveFedora.fedora.base_path}/#{::Noid::Rails.treeify(id.to_s)}"
940
1028
  end
941
1029
  end
942
1030
 
data/lib/hyrax/indexer.rb CHANGED
@@ -14,7 +14,7 @@ module Hyrax
14
14
  #
15
15
  # @example building a module as a mixin
16
16
  #
17
- # class MyIndexer < Hyrax::ValkyrieIndexer
17
+ # class MyIndexer < Hyrax::Indexers::ResourceIndexer
18
18
  # include Hyrax::Indexer(:core_metadata)
19
19
  # end
20
20
  #
@@ -10,6 +10,8 @@ module Hyrax
10
10
  # reflect the kinds of resources the event applied to.
11
11
  #
12
12
  # - `batch`: events related to the performance of `BatchCreateJob`
13
+ # - `collection`: events related to the lifecycle of PCDM Collections
14
+ # - `file`: events related to the lifecycle of File/FileMetadata
13
15
  # - `file.set`: events related to the lifecycle of Hydra Works FileSets
14
16
  # - `object`: events related to the lifecycle of all PCDM Objects
15
17
  #
@@ -73,7 +75,7 @@ module Hyrax
73
75
  #
74
76
  # publisher.unsubscribe(event_listener)
75
77
  #
76
- # @see https://dry-rb.org/gems/dry-events/0.2/
78
+ # @see https://dry-rb.org/gems/dry-events
77
79
  # @see Dry::Events::Publisher
78
80
  # @see https://github.com/samvera/hyrax/wiki/Hyrax's-Event-Bus-(Hyrax::Publisher)
79
81
  class Publisher
@@ -86,6 +88,7 @@ module Hyrax
86
88
  # are you adding an event?
87
89
  # make sure Hyrax is publishing events in the correct places (this is be non-trivial!)
88
90
  # and add it to the list at https://github.com/samvera/hyrax/wiki/Hyrax's-Event-Bus-(Hyrax::Publisher)
91
+ # and to the listener generator.
89
92
 
90
93
  # @!macro [new] a_registered_event
91
94
  # @!attribute [r] $1
@@ -203,7 +206,7 @@ module Hyrax
203
206
  # @return Array[Object] the listeners Hyrax subscribes by default.
204
207
  def default_listeners
205
208
  @default_listeners ||=
206
- [Hyrax::Listeners::AclIndexListener.new,
209
+ [Hyrax::Listeners::ACLIndexListener.new,
207
210
  Hyrax::Listeners::BatchNotificationListener.new,
208
211
  Hyrax::Listeners::FileMetadataListener.new,
209
212
  Hyrax::Listeners::FileSetLifecycleListener.new,
@@ -62,7 +62,7 @@ module Hyrax
62
62
  def build_resources(xml, doc_set)
63
63
  doc_set.each do |doc|
64
64
  model = doc.fetch('has_model_ssim', []).first.safe_constantize
65
- if model.try(:collection?) || model == Hyrax.config.collection_class
65
+ if model.try(:collection?) || Hyrax::ModelRegistry.collection_classes.include?(model)
66
66
  build_resource(xml, doc, model, hyrax_routes)
67
67
  else
68
68
  build_resource(xml, doc, model, main_app_routes)
@@ -32,7 +32,7 @@ module Hyrax
32
32
  end
33
33
  end
34
34
 
35
- def build_collections(xml, searcher: AbstractTypeRelation.new(allowable_types: [::Collection, Hyrax.config.collection_class]))
35
+ def build_collections(xml, searcher: AbstractTypeRelation.new(allowable_types: Hyrax::ModelRegistry.collection_classes))
36
36
  searcher.search_in_batches(public_access) do |doc_set|
37
37
  build_resources(xml, doc_set, hyrax_routes)
38
38
  end
@@ -51,6 +51,7 @@ Capybara.app_host = "http://#{ip}:#{Capybara.server_port}"
51
51
 
52
52
  Capybara.default_driver = :rack_test # This is a faster driver
53
53
  Capybara.javascript_driver = :selenium_chrome_headless_sandboxless # This is slower
54
+ Capybara.disable_animation = true
54
55
  Capybara.default_max_wait_time = ENV.fetch('CAPYBARA_WAIT_TIME', 10) # We may have a slow application, let's give it some time.
55
56
 
56
57
  Capybara::Screenshot.register_driver(:selenium_chrome_headless_sandboxless) do |driver, path|
@@ -19,11 +19,41 @@ RSpec.shared_examples 'a Hyrax::Resource' do
19
19
  end
20
20
  end
21
21
 
22
- it { is_expected.to respond_to :collection? }
23
- it { is_expected.to respond_to :file? }
24
- it { is_expected.to respond_to :file_set? }
25
- it { is_expected.to respond_to :pcdm_object? }
26
- it { is_expected.to respond_to :work? }
22
+ describe '#class' do
23
+ subject(:klass) { resource.class }
24
+
25
+ it { is_expected.to respond_to :collection? }
26
+ it { is_expected.to respond_to :file? }
27
+ it { is_expected.to respond_to :file_set? }
28
+ it { is_expected.to respond_to :pcdm_collection? }
29
+ it { is_expected.to respond_to :pcdm_object? }
30
+ it { is_expected.to respond_to :work? }
31
+ end
32
+
33
+ it do
34
+ is_expected.to respond_to :collection?
35
+ expect(resource.collection?).to eq resource.class.collection?
36
+ end
37
+ it do
38
+ is_expected.to respond_to :file?
39
+ expect(resource.file?).to eq resource.class.file?
40
+ end
41
+ it do
42
+ is_expected.to respond_to :file_set?
43
+ expect(resource.file_set?).to eq resource.class.file_set?
44
+ end
45
+ it do
46
+ is_expected.to respond_to :pcdm_collection?
47
+ expect(resource.pcdm_collection?).to eq resource.class.pcdm_collection?
48
+ end
49
+ it do
50
+ is_expected.to respond_to :pcdm_object?
51
+ expect(resource.pcdm_object?).to eq resource.class.pcdm_object?
52
+ end
53
+ it do
54
+ is_expected.to respond_to :work?
55
+ expect(resource.work?).to eq resource.class.work?
56
+ end
27
57
  end
28
58
 
29
59
  RSpec.shared_examples 'belongs to collections' do
@@ -128,15 +158,21 @@ end
128
158
  RSpec.shared_examples 'a Hyrax::PcdmCollection' do
129
159
  subject(:collection) { described_class.new }
130
160
 
131
- it { is_expected.to be_collection }
132
- it { is_expected.to be_pcdm_object }
133
- it { is_expected.not_to be_file_set }
134
- it { is_expected.not_to be_work }
135
-
136
161
  it_behaves_like 'a Hyrax::Resource'
137
162
  it_behaves_like 'a model with core metadata'
138
163
  it_behaves_like 'has members'
139
164
 
165
+ describe '#class' do
166
+ subject(:klass) { collection.class }
167
+
168
+ it { is_expected.to be_collection }
169
+ it { is_expected.not_to be_file }
170
+ it { is_expected.not_to be_file_set }
171
+ it { is_expected.to be_pcdm_collection }
172
+ it { is_expected.not_to be_pcdm_object }
173
+ it { is_expected.not_to be_work }
174
+ end
175
+
140
176
  describe '#collection_type_gid' do
141
177
  let(:gid) { Hyrax::CollectionType.find_or_create_default_collection_type.to_global_id.to_s }
142
178
 
@@ -151,8 +187,20 @@ end
151
187
  RSpec.shared_examples 'a Hyrax::AdministrativeSet' do
152
188
  subject(:admin_set) { described_class.new }
153
189
 
190
+ it_behaves_like 'a Hyrax::Resource'
154
191
  it_behaves_like 'a model with core metadata'
155
192
 
193
+ describe '#class' do
194
+ subject(:klass) { admin_set.class }
195
+
196
+ it { is_expected.to be_collection }
197
+ it { is_expected.not_to be_file }
198
+ it { is_expected.not_to be_file_set }
199
+ it { is_expected.to be_pcdm_collection }
200
+ it { is_expected.not_to be_pcdm_object }
201
+ it { is_expected.not_to be_work }
202
+ end
203
+
156
204
  it 'has an #alternative_title' do
157
205
  expect { admin_set.alternative_title = ['Moomin'] }
158
206
  .to change { admin_set.alternative_title }
@@ -191,11 +239,16 @@ RSpec.shared_examples 'a Hyrax::Work' do
191
239
  it_behaves_like 'belongs to collections'
192
240
  it_behaves_like 'has members'
193
241
 
194
- it { is_expected.not_to be_collection }
195
- it { is_expected.not_to be_file }
196
- it { is_expected.not_to be_file_set }
197
- it { is_expected.to be_pcdm_object }
198
- it { is_expected.to be_work }
242
+ describe '#class' do
243
+ subject(:klass) { work.class }
244
+
245
+ it { is_expected.not_to be_collection }
246
+ it { is_expected.not_to be_file }
247
+ it { is_expected.not_to be_file_set }
248
+ it { is_expected.not_to be_pcdm_collection }
249
+ it { is_expected.to be_pcdm_object }
250
+ it { is_expected.to be_work }
251
+ end
199
252
 
200
253
  describe '#admin_set_id' do
201
254
  it 'is nil by default' do
@@ -259,11 +312,16 @@ RSpec.shared_examples 'a Hyrax::FileSet', valkyrie_adapter: :test_adapter do
259
312
  it_behaves_like 'a model with core metadata'
260
313
  it_behaves_like 'a model with basic metadata'
261
314
 
262
- it { is_expected.not_to be_collection }
263
- it { is_expected.not_to be_file }
264
- it { is_expected.to be_file_set }
265
- it { is_expected.to be_pcdm_object }
266
- it { is_expected.not_to be_work }
315
+ describe '#class' do
316
+ subject(:klass) { fileset.class }
317
+
318
+ it { is_expected.not_to be_collection }
319
+ it { is_expected.not_to be_file }
320
+ it { is_expected.to be_file_set }
321
+ it { is_expected.not_to be_pcdm_collection }
322
+ it { is_expected.to be_pcdm_object }
323
+ it { is_expected.not_to be_work }
324
+ end
267
325
 
268
326
  describe 'files' do
269
327
  it 'has empty file_ids by default' do
@@ -18,7 +18,7 @@ RSpec.shared_examples 'a Hyrax::Resource indexer' do
18
18
  describe '#to_solr' do
19
19
  it 'indexes base resource fields' do
20
20
  expect(indexer.to_solr)
21
- .to include(has_model_ssim: resource.class.name,
21
+ .to include(has_model_ssim: resource.to_rdf_representation,
22
22
  human_readable_type_tesim: resource.human_readable_type,
23
23
  alternate_ids_sim: a_collection_containing_exactly(*ids))
24
24
  end
@@ -8,7 +8,8 @@ module Hyrax
8
8
  #
9
9
  # @since 3.4.0
10
10
  class AdminSetDestroy < Transaction
11
- DEFAULT_STEPS = ['admin_set_resource.check_empty',
11
+ DEFAULT_STEPS = ['admin_set_resource.check_default',
12
+ 'admin_set_resource.check_empty',
12
13
  'admin_set_resource.delete',
13
14
  'admin_set_resource.delete_acl'].freeze
14
15
 
@@ -37,6 +37,7 @@ module Hyrax
37
37
  require 'hyrax/transactions/steps/apply_collection_type_permissions'
38
38
  require 'hyrax/transactions/steps/apply_permission_template'
39
39
  require 'hyrax/transactions/steps/change_depositor'
40
+ require 'hyrax/transactions/steps/check_for_default_admin_set'
40
41
  require 'hyrax/transactions/steps/check_for_empty_admin_set'
41
42
  require 'hyrax/transactions/steps/delete_access_control'
42
43
  require 'hyrax/transactions/steps/delete_all_file_metadata'
@@ -170,6 +171,10 @@ module Hyrax
170
171
  end
171
172
 
172
173
  namespace 'admin_set_resource' do |ops| # Hyrax::AdministrativeSet resource
174
+ ops.register 'check_default' do
175
+ Steps::CheckForDefaultAdminSet.new
176
+ end
177
+
173
178
  ops.register 'check_empty' do
174
179
  Steps::CheckForEmptyAdminSet.new
175
180
  end
@@ -25,6 +25,7 @@ module Hyrax
25
25
 
26
26
  user ||= ::User.find_by_user_key(obj.depositor)
27
27
  Hyrax.publisher.publish('object.metadata.updated', object: parent, user: user)
28
+ Hyrax.publisher.publish('object.membership.updated', object: parent, user: user)
28
29
 
29
30
  Success(obj)
30
31
  rescue Valkyrie::Persistence::ObjectNotFoundError => _err
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+ require 'dry/monads'
3
+
4
+ module Hyrax
5
+ module Transactions
6
+ module Steps
7
+ ##
8
+ # Validates non-defaultness of the {Hyrax::AdministrativeSet}; gives `Success`
9
+ # when not the default and `Failure` otherwise.
10
+ #
11
+ # Use this step to guard against destroying the default AdminSet.
12
+ class CheckForDefaultAdminSet
13
+ include Dry::Monads[:result]
14
+
15
+ ##
16
+ # @param [#find_inverse_references_by] query_service
17
+ def initialize(query_service: Hyrax.query_service)
18
+ @query_service = query_service
19
+ end
20
+
21
+ ##
22
+ # @param [Hyrax::AdministrativeSet] admin_set
23
+ #
24
+ # @return [Dry::Monads::Result]
25
+ def call(admin_set)
26
+ return Failure["Administrative set cannot be deleted as it is the default set", admin_set] if admin_set.id == Hyrax.config.default_admin_set_id
27
+ Success(admin_set)
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
@@ -26,7 +26,7 @@ module Hyrax
26
26
  members = @query_service
27
27
  .find_inverse_references_by(property: :admin_set_id,
28
28
  resource: admin_set)
29
- return Failure[:admin_set_has_members, members] if members.any?
29
+ return Failure["Administrative set cannot be deleted as it is not empty", members] if members.any?
30
30
 
31
31
  Success(admin_set)
32
32
  end
@@ -40,7 +40,7 @@ module Hyrax
40
40
  save_lease_or_embargo(unsaved)
41
41
  saved = @persister.save(resource: unsaved)
42
42
  rescue StandardError => err
43
- return Failure(["Failed save on #{change_set}\n\t#{err.message}", change_set.resource])
43
+ return Failure.new(["Failed save on #{change_set}\n\t#{err.message}", change_set.resource], err.backtrace.first)
44
44
  end
45
45
 
46
46
  # if we have a permission manager, it's acting as a local cache of another resource.
@@ -58,6 +58,7 @@ module Hyrax
58
58
  private
59
59
 
60
60
  def valid_future_date?(item, attribute)
61
+ return true if item.fields[attribute].blank?
61
62
  raise StandardError, "#{item.model} must use a future date" if item.fields[attribute] < Time.zone.now
62
63
  end
63
64
 
@@ -23,7 +23,7 @@ module Hyrax
23
23
 
24
24
  Success(change_set)
25
25
  rescue NoMethodError => err
26
- Failure([err.message, change_set])
26
+ Failure.new([err.message, change_set], err.backtrace.first)
27
27
  end
28
28
 
29
29
  ##
@@ -29,6 +29,8 @@ module Hyrax
29
29
  obj.member_ids -= destroys.map { |id| Valkyrie::ID.new(id) }
30
30
 
31
31
  save_resource(obj, user)
32
+ Hyrax.publisher.publish('object.membership.updated', object: obj, user: user)
33
+
32
34
  Success(obj)
33
35
  end
34
36
 
data/lib/hyrax/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Hyrax
3
- VERSION = '5.0.0.rc2'
3
+ VERSION = '5.0.0.rc3'
4
4
  end
data/lib/hyrax.rb CHANGED
@@ -41,6 +41,7 @@ module Hyrax
41
41
  autoload :Configuration
42
42
  autoload :ControlledVocabularies
43
43
  autoload :EventStore
44
+ autoload :Forms
44
45
  autoload :RedisEventStore
45
46
  autoload :ResourceSync
46
47
  autoload :Zotero
@@ -21,6 +21,7 @@ namespace :hyrax do
21
21
 
22
22
  Hyrax.query_service.find_many_by_ids(ids: ids).each do |resource|
23
23
  Hyrax::LeaseManager.release_lease_for(resource: resource) &&
24
+ Hyrax.persister.save(resource: resource.lease) &&
24
25
  Hyrax::AccessControlList(resource).save
25
26
  end
26
27
  end
@@ -9,7 +9,7 @@ module Valkyrie
9
9
  ##
10
10
  # @!attribute [r] connection
11
11
  # @return [RSolr::Client]
12
- attr_reader :connection
12
+ attr_accessor :connection
13
13
 
14
14
  ##
15
15
  # @param connection [RSolr::Client] The RSolr connection to index to.
@@ -37,6 +37,10 @@ module Valkyrie
37
37
  connection.commit
38
38
  end
39
39
 
40
+ def reset!
41
+ self.connection = default_connection
42
+ end
43
+
40
44
  private
41
45
 
42
46
  def persist(resources)
@@ -66,9 +70,14 @@ module Valkyrie
66
70
  return {}
67
71
  end
68
72
 
69
- { 'host' => bl_index.host,
73
+ {
74
+ 'host' => bl_index.host,
75
+ 'user' => bl_index.user,
76
+ 'password' => bl_index.password,
77
+ 'scheme' => bl_index.scheme,
70
78
  'port' => bl_index.port,
71
- 'core' => 'hyrax-valkyrie' }
79
+ 'core' => bl_index.path.split("/")[2] || 'hyrax-valkyrie'
80
+ }.compact
72
81
  end
73
82
 
74
83
  def connection_url
@@ -78,12 +87,17 @@ module Valkyrie
78
87
  {}
79
88
  end
80
89
 
81
- # if any configuration is missing, derive it from Blacklight
90
+ # Given how we're building blacklight_based_config, there won't be a URL. So let's avoid
91
+ # that whole logic path.
92
+ return config['url'] if config['url'].present?
93
+
94
+ # Derive any missing configuration from Blacklight.
82
95
  config = blacklight_based_config.with_indifferent_access.merge(config)
83
96
 
84
- return config['url'] if config['url'].present?
97
+ url = "#{config.fetch('scheme', 'http')}://"
98
+ url = "#{url}#{config['user']}:#{config['password']}@" if config.key?('user') && config.key?('password')
85
99
 
86
- "http://#{config['host']}:#{config['port']}/solr/#{config['core']}"
100
+ "#{url}#{config['host']}:#{config['port']}/solr/#{config['core']}"
87
101
  end
88
102
 
89
103
  def default_connection
@@ -91,7 +105,7 @@ module Valkyrie
91
105
  end
92
106
 
93
107
  def resource_indexer
94
- Hyrax::ValkyrieIndexer
108
+ Hyrax::Indexers::ResourceIndexer
95
109
  end
96
110
  end
97
111
  end
@@ -77,11 +77,10 @@ module Wings
77
77
  # default work class builder
78
78
  def self.DefaultWork(resource_class) # rubocop:disable Naming/MethodName
79
79
  class_cache[resource_class] ||= Class.new(DefaultWork) do
80
- self.valkyrie_class = resource_class
81
-
80
+ self.valkyrie_class = resource_class.respond_to?(:valkyrie_class) ? resource_class.valkyrie_class : resource_class
82
81
  # skip reserved attributes, we assume we don't need to translate valkyrie internals
83
- schema = resource_class.schema.reject do |key|
84
- resource_class.reserved_attributes.include?(key.name)
82
+ schema = valkyrie_class.schema.reject do |key|
83
+ valkyrie_class.reserved_attributes.include?(key.name)
85
84
  end
86
85
 
87
86
  Wings::ActiveFedoraConverter.apply_properties(self, schema)
@@ -142,7 +141,7 @@ module Wings
142
141
  end
143
142
 
144
143
  def indexing_service
145
- Hyrax::ValkyrieIndexer.for(resource: valkyrie_resource)
144
+ Hyrax::Indexers::ResourceIndexer.for(resource: valkyrie_resource)
146
145
  end
147
146
 
148
147
  def to_global_id
@@ -36,7 +36,7 @@ module Wings
36
36
  end
37
37
 
38
38
  def indexing_service
39
- Hyrax::ValkyrieIndexer.for(resource: valkyrie_resource)
39
+ Hyrax::Indexers::ResourceIndexer.for(resource: valkyrie_resource)
40
40
  end
41
41
 
42
42
  def to_solr
@@ -24,6 +24,10 @@ module Wings
24
24
  instance.register(*args)
25
25
  end
26
26
 
27
+ def self.unregister(*args)
28
+ instance.unregister(*args)
29
+ end
30
+
27
31
  def self.lookup(*args)
28
32
  instance.lookup(*args)
29
33
  end
@@ -40,6 +44,10 @@ module Wings
40
44
  @map[valkyrie.name] = active_fedora.name
41
45
  end
42
46
 
47
+ def unregister(valkyrie)
48
+ @map.delete(valkyrie.name)
49
+ end
50
+
43
51
  def lookup(valkyrie)
44
52
  valkyrie = valkyrie._canonical_valkyrie_model if
45
53
  valkyrie.respond_to?(:_canonical_valkyrie_model)