hyrax 3.0.0.pre.rc2 → 3.0.0.pre.rc3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (514) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +5 -5
  3. data/.dassie/.env +4 -0
  4. data/.dassie/.gitignore +27 -0
  5. data/.dassie/Gemfile +57 -0
  6. data/.dassie/README.md +3 -0
  7. data/.dassie/Rakefile +6 -0
  8. data/.dassie/app/actors/hyrax/actors/generic_work_actor.rb +8 -0
  9. data/.dassie/app/actors/hyrax/actors/namespaced_works/nested_work_actor.rb +8 -0
  10. data/.dassie/app/assets/config/manifest.js +3 -0
  11. data/.dassie/app/assets/images/.keep +0 -0
  12. data/.dassie/app/assets/images/unauthorized.png +0 -0
  13. data/.dassie/app/assets/images/us_404.svg +91 -0
  14. data/.dassie/app/assets/javascripts/application.js +26 -0
  15. data/.dassie/app/assets/javascripts/blacklight_gallery.js +1 -0
  16. data/.dassie/app/assets/javascripts/cable.js +13 -0
  17. data/.dassie/app/assets/javascripts/channels/.keep +0 -0
  18. data/.dassie/app/assets/javascripts/openseadragon.js +2 -0
  19. data/.dassie/app/assets/stylesheets/application.css +16 -0
  20. data/.dassie/app/assets/stylesheets/hyrax.scss +17 -0
  21. data/.dassie/app/assets/stylesheets/openseadragon.css +3 -0
  22. data/.dassie/app/channels/application_cable/channel.rb +4 -0
  23. data/.dassie/app/channels/application_cable/connection.rb +4 -0
  24. data/.dassie/app/controllers/application_controller.rb +14 -0
  25. data/.dassie/app/controllers/catalog_controller.rb +300 -0
  26. data/.dassie/app/controllers/concerns/.keep +0 -0
  27. data/.dassie/app/controllers/hyrax/generic_works_controller.rb +14 -0
  28. data/.dassie/app/controllers/hyrax/monographs_controller.rb +17 -0
  29. data/.dassie/app/controllers/hyrax/namespaced_works/nested_works_controller.rb +14 -0
  30. data/.dassie/app/forms/hyrax/generic_work_form.rb +9 -0
  31. data/.dassie/app/forms/hyrax/namespaced_works/nested_work_form.rb +9 -0
  32. data/.dassie/app/forms/monograph_form.rb +20 -0
  33. data/.dassie/app/helpers/application_helper.rb +2 -0
  34. data/.dassie/app/helpers/hyrax_helper.rb +6 -0
  35. data/.dassie/app/indexers/generic_work_indexer.rb +18 -0
  36. data/.dassie/app/indexers/monograph_indexer.rb +16 -0
  37. data/.dassie/app/indexers/namespaced_works/nested_work_indexer.rb +18 -0
  38. data/.dassie/app/jobs/application_job.rb +2 -0
  39. data/.dassie/app/mailers/application_mailer.rb +4 -0
  40. data/.dassie/app/models/ability.rb +21 -0
  41. data/.dassie/app/models/application_record.rb +3 -0
  42. data/.dassie/app/models/collection.rb +8 -0
  43. data/.dassie/app/models/concerns/.keep +0 -0
  44. data/.dassie/app/models/file_set.rb +5 -0
  45. data/.dassie/app/models/generic_work.rb +14 -0
  46. data/.dassie/app/models/monograph.rb +8 -0
  47. data/.dassie/app/models/namespaced_works/nested_work.rb +16 -0
  48. data/.dassie/app/models/qa.rb +5 -0
  49. data/.dassie/app/models/qa/local_authority.rb +2 -0
  50. data/.dassie/app/models/qa/local_authority_entry.rb +3 -0
  51. data/.dassie/app/models/search_builder.rb +16 -0
  52. data/.dassie/app/models/solr_document.rb +28 -0
  53. data/.dassie/app/models/time_span.rb +22 -0
  54. data/.dassie/app/models/user.rb +26 -0
  55. data/.dassie/app/presenters/hyrax/generic_work_presenter.rb +6 -0
  56. data/.dassie/app/presenters/hyrax/namespaced_works/nested_work_presenter.rb +6 -0
  57. data/.dassie/app/views/hyrax/generic_works/_generic_work.html.erb +2 -0
  58. data/.dassie/app/views/hyrax/monographs/_monograph.html.erb +2 -0
  59. data/.dassie/app/views/hyrax/namespaced_works/nested_works/_nested_work.html.erb +2 -0
  60. data/.dassie/app/views/layouts/application.html.erb +15 -0
  61. data/.dassie/app/views/layouts/mailer.html.erb +13 -0
  62. data/.dassie/app/views/layouts/mailer.text.erb +1 -0
  63. data/.dassie/bin/bundle +3 -0
  64. data/.dassie/bin/rails +9 -0
  65. data/.dassie/bin/rake +9 -0
  66. data/.dassie/bin/setup +36 -0
  67. data/.dassie/bin/spring +17 -0
  68. data/.dassie/bin/update +31 -0
  69. data/.dassie/bin/yarn +11 -0
  70. data/.dassie/config.ru +5 -0
  71. data/.dassie/config/analytics.yml +6 -0
  72. data/.dassie/config/application.rb +22 -0
  73. data/.dassie/config/arkivo.yml +6 -0
  74. data/.dassie/config/authorities/licenses.yml +46 -0
  75. data/.dassie/config/authorities/resource_types.yml +41 -0
  76. data/.dassie/config/authorities/rights_statements.yml +37 -0
  77. data/.dassie/config/blacklight.yml +9 -0
  78. data/.dassie/config/boot.rb +4 -0
  79. data/.dassie/config/browse_everything_providers.yml +2 -0
  80. data/.dassie/config/cable.yml +10 -0
  81. data/.dassie/config/credentials.yml.enc +1 -0
  82. data/.dassie/config/environment.rb +5 -0
  83. data/.dassie/config/environments/development.rb +69 -0
  84. data/.dassie/config/environments/production.rb +94 -0
  85. data/.dassie/config/environments/test.rb +51 -0
  86. data/.dassie/config/fedora.yml +15 -0
  87. data/.dassie/config/initializers/arkivo_constraint.rb +12 -0
  88. data/.dassie/config/initializers/assets.rb +2 -0
  89. data/.dassie/config/initializers/clamav.rb +2 -0
  90. data/.dassie/config/initializers/cookies_serializer.rb +1 -0
  91. data/.dassie/config/initializers/devise.rb +13 -0
  92. data/.dassie/config/initializers/filter_parameter_logging.rb +1 -0
  93. data/.dassie/config/initializers/hydra_config.rb +6 -0
  94. data/.dassie/config/initializers/hyrax.rb +48 -0
  95. data/.dassie/config/initializers/mailboxer.rb +21 -0
  96. data/.dassie/config/initializers/mime_types.rb +4 -0
  97. data/.dassie/config/initializers/mini_magick.rb +6 -0
  98. data/.dassie/config/initializers/redis_config.rb +4 -0
  99. data/.dassie/config/initializers/riiif.rb +27 -0
  100. data/.dassie/config/initializers/simple_form.rb +28 -0
  101. data/.dassie/config/initializers/simple_form_bootstrap.rb +143 -0
  102. data/.dassie/config/initializers/wrap_parameters.rb +3 -0
  103. data/.dassie/config/locales/blacklight.en.yml +3 -0
  104. data/.dassie/config/locales/devise.en.yml +65 -0
  105. data/.dassie/config/locales/generic_work.de.yml +8 -0
  106. data/.dassie/config/locales/generic_work.en.yml +8 -0
  107. data/.dassie/config/locales/generic_work.es.yml +10 -0
  108. data/.dassie/config/locales/generic_work.fr.yml +8 -0
  109. data/.dassie/config/locales/generic_work.it.yml +8 -0
  110. data/.dassie/config/locales/generic_work.pt-BR.yml +8 -0
  111. data/.dassie/config/locales/generic_work.zh.yml +10 -0
  112. data/.dassie/config/locales/hyrax.de.yml +58 -0
  113. data/.dassie/config/locales/hyrax.en.yml +58 -0
  114. data/.dassie/config/locales/hyrax.es.yml +58 -0
  115. data/.dassie/config/locales/hyrax.fr.yml +58 -0
  116. data/.dassie/config/locales/hyrax.it.yml +58 -0
  117. data/.dassie/config/locales/hyrax.pt-BR.yml +58 -0
  118. data/.dassie/config/locales/hyrax.zh.yml +58 -0
  119. data/.dassie/config/locales/namespaced_works/nested_work.de.yml +8 -0
  120. data/.dassie/config/locales/namespaced_works/nested_work.en.yml +8 -0
  121. data/.dassie/config/locales/namespaced_works/nested_work.es.yml +10 -0
  122. data/.dassie/config/locales/namespaced_works/nested_work.fr.yml +8 -0
  123. data/.dassie/config/locales/namespaced_works/nested_work.it.yml +8 -0
  124. data/.dassie/config/locales/namespaced_works/nested_work.pt-BR.yml +8 -0
  125. data/.dassie/config/locales/namespaced_works/nested_work.zh.yml +10 -0
  126. data/.dassie/config/metadata/monograph.yaml +55 -0
  127. data/.dassie/config/metadata/sample_metadata.yaml +3 -0
  128. data/.dassie/config/puma.rb +6 -0
  129. data/.dassie/config/redis.yml +9 -0
  130. data/.dassie/config/role_map.yml +24 -0
  131. data/.dassie/config/routes.rb +35 -0
  132. data/.dassie/config/solr.yml +7 -0
  133. data/.dassie/config/spring.rb +6 -0
  134. data/.dassie/config/storage.yml +7 -0
  135. data/.dassie/config/tinymce.yml +12 -0
  136. data/.dassie/config/uv/uv-config.json +3 -0
  137. data/.dassie/config/uv/uv.html +87 -0
  138. data/.dassie/config/valkyrie_index.yml +12 -0
  139. data/.dassie/config/workflows/default_workflow.json +21 -0
  140. data/.dassie/config/workflows/mediated_deposit_workflow.json +76 -0
  141. data/.dassie/config/zotero.yml +6 -0
  142. data/.dassie/db/migrate/20200821212749_create_searches.blacklight.rb +17 -0
  143. data/.dassie/db/migrate/20200821212750_create_bookmarks.blacklight.rb +19 -0
  144. data/.dassie/db/migrate/20200821212751_add_polymorphic_type_to_bookmarks.blacklight.rb +9 -0
  145. data/.dassie/db/migrate/20200821212803_devise_create_users.rb +44 -0
  146. data/.dassie/db/migrate/20200821212806_add_devise_guests_to_users.rb +15 -0
  147. data/.dassie/db/migrate/20200821212828_create_version_committers.hyrax.rb +15 -0
  148. data/.dassie/db/migrate/20200821212829_create_checksum_audit_logs.hyrax.rb +19 -0
  149. data/.dassie/db/migrate/20200821212830_create_single_use_links.hyrax.rb +12 -0
  150. data/.dassie/db/migrate/20200821212831_add_social_to_users.hyrax.rb +13 -0
  151. data/.dassie/db/migrate/20200821212832_add_ldap_attrs_to_user.hyrax.rb +27 -0
  152. data/.dassie/db/migrate/20200821212833_add_avatars_to_users.hyrax.rb +15 -0
  153. data/.dassie/db/migrate/20200821212834_create_trophies.hyrax.rb +10 -0
  154. data/.dassie/db/migrate/20200821212835_add_linkedin_to_users.hyrax.rb +5 -0
  155. data/.dassie/db/migrate/20200821212836_create_tinymce_assets.hyrax.rb +8 -0
  156. data/.dassie/db/migrate/20200821212837_create_content_blocks.hyrax.rb +10 -0
  157. data/.dassie/db/migrate/20200821212838_create_featured_works.hyrax.rb +12 -0
  158. data/.dassie/db/migrate/20200821212839_add_external_key_to_content_blocks.hyrax.rb +6 -0
  159. data/.dassie/db/migrate/20200821212840_create_proxy_deposit_rights.hyrax.rb +10 -0
  160. data/.dassie/db/migrate/20200821212841_create_proxy_deposit_requests.hyrax.rb +15 -0
  161. data/.dassie/db/migrate/20200821212842_create_file_view_stats.hyrax.rb +12 -0
  162. data/.dassie/db/migrate/20200821212843_create_file_download_stats.hyrax.rb +12 -0
  163. data/.dassie/db/migrate/20200821212844_add_orcid_to_users.hyrax.rb +5 -0
  164. data/.dassie/db/migrate/20200821212845_create_user_stats.hyrax.rb +19 -0
  165. data/.dassie/db/migrate/20200821212846_create_work_view_stats.hyrax.rb +12 -0
  166. data/.dassie/db/migrate/20200821212847_add_works_to_user_stats.hyrax.rb +13 -0
  167. data/.dassie/db/migrate/20200821212848_change_trophy_generic_file_id_to_work_id.hyrax.rb +5 -0
  168. data/.dassie/db/migrate/20200821212849_change_proxy_deposit_generic_file_id_to_work_id.hyrax.rb +5 -0
  169. data/.dassie/db/migrate/20200821212850_change_audit_log_generic_file_id_to_file_set_id.hyrax.rb +5 -0
  170. data/.dassie/db/migrate/20200821212851_change_proxy_deposit_request_generic_file_id_to_work_id.hyrax.rb +5 -0
  171. data/.dassie/db/migrate/20200821212852_create_uploaded_files.hyrax.rb +10 -0
  172. data/.dassie/db/migrate/20200821212853_create_features.hyrax.rb +10 -0
  173. data/.dassie/db/migrate/20200821212854_create_operations.hyrax.rb +23 -0
  174. data/.dassie/db/migrate/20200821212855_change_featured_work_generic_file_id_to_work_id.hyrax.rb +6 -0
  175. data/.dassie/db/migrate/20200821212856_add_arkivo_to_users.hyrax.rb +8 -0
  176. data/.dassie/db/migrate/20200821212857_create_sipity.hyrax.rb +163 -0
  177. data/.dassie/db/migrate/20200821212858_create_sipity_workflow_methods.hyrax.rb +10 -0
  178. data/.dassie/db/migrate/20200821212859_create_permission_template.hyrax.rb +11 -0
  179. data/.dassie/db/migrate/20200821212860_create_permission_template_access.hyrax.rb +11 -0
  180. data/.dassie/db/migrate/20200821212861_add_release_to_permission_templates.hyrax.rb +6 -0
  181. data/.dassie/db/migrate/20200821212862_add_permission_template_to_sipity_workflow.hyrax.rb +26 -0
  182. data/.dassie/db/migrate/20200821212863_tidy_up_because_of_bad_exception.hyrax.rb +13 -0
  183. data/.dassie/db/migrate/20200821212864_add_allows_access_grant_to_workflow.hyrax.rb +5 -0
  184. data/.dassie/db/migrate/20200821212865_change_checksum_audit_log.hyrax.rb +18 -0
  185. data/.dassie/db/migrate/20200821212866_create_job_io_wrappers.hyrax.rb +15 -0
  186. data/.dassie/db/migrate/20200821212867_create_collection_types.hyrax.rb +17 -0
  187. data/.dassie/db/migrate/20200821212868_update_collection_type_column_names.hyrax.rb +9 -0
  188. data/.dassie/db/migrate/20200821212869_update_collection_type_column_options.hyrax.rb +17 -0
  189. data/.dassie/db/migrate/20200821212870_create_collection_branding_infos.hyrax.rb +15 -0
  190. data/.dassie/db/migrate/20200821212871_create_collection_type_participants.hyrax.rb +11 -0
  191. data/.dassie/db/migrate/20200821212872_rename_admin_set_id_to_source_id.hyrax.rb +5 -0
  192. data/.dassie/db/migrate/20200821212873_add_preferred_locale_to_users.hyrax.rb +5 -0
  193. data/.dassie/db/migrate/20200821212874_add_collection_type_sharing_options.hyrax.rb +5 -0
  194. data/.dassie/db/migrate/20200821212875_add_unique_constraint_to_permission_template_accesses.hyrax.rb +8 -0
  195. data/.dassie/db/migrate/20200821212876_add_branding_to_collection_type.hyrax.rb +5 -0
  196. data/.dassie/db/migrate/20200821212877_add_badge_color_to_collection_types.hyrax.rb +5 -0
  197. data/.dassie/db/migrate/20200821212878_update_single_use_links_column_names.hyrax.rb +6 -0
  198. data/.dassie/db/migrate/20200821212879_change_sipity_entity_specific_responsibility.hyrax.rb +9 -0
  199. data/.dassie/db/migrate/20200821212880_create_mailboxer.mailboxer_engine.rb +65 -0
  200. data/.dassie/db/migrate/20200821212881_add_conversation_optout.mailboxer_engine.rb +15 -0
  201. data/.dassie/db/migrate/20200821212882_add_missing_indices.mailboxer_engine.rb +20 -0
  202. data/.dassie/db/migrate/20200821212883_add_delivery_tracking_info_to_mailboxer_receipts.mailboxer_engine.rb +8 -0
  203. data/.dassie/db/migrate/20200821212884_create_qa_local_authorities.rb +10 -0
  204. data/.dassie/db/migrate/20200821212885_create_qa_local_authority_entries.rb +12 -0
  205. data/.dassie/db/migrate/20200821212902_create_minter_states.noid_rails_engine.rb +17 -0
  206. data/.dassie/db/migrate/20200821212903_rename_minter_state_random_to_rand.noid_rails_engine.rb +8 -0
  207. data/.dassie/db/schema.rb +563 -0
  208. data/.dassie/db/seeds.rb +14 -0
  209. data/.dassie/lib/assets/.keep +0 -0
  210. data/.dassie/lib/tasks/.keep +0 -0
  211. data/.dassie/log/.keep +0 -0
  212. data/.dassie/package.json +17 -0
  213. data/.dassie/public/404.html +67 -0
  214. data/.dassie/public/422.html +67 -0
  215. data/.dassie/public/500.html +66 -0
  216. data/.dassie/public/apple-touch-icon-precomposed.png +0 -0
  217. data/.dassie/public/apple-touch-icon.png +0 -0
  218. data/.dassie/public/favicon.ico +0 -0
  219. data/.dassie/public/robots.txt +1 -0
  220. data/.dassie/solr/conf/_rest_managed.json +3 -0
  221. data/.dassie/solr/conf/mapping-ISOLatin1Accent.txt +246 -0
  222. data/.dassie/solr/conf/schema.xml +367 -0
  223. data/.dassie/solr/conf/scripts.conf +24 -0
  224. data/.dassie/solr/conf/solrconfig.xml +208 -0
  225. data/.dassie/solr/conf/stopwords.txt +58 -0
  226. data/.dassie/solr/conf/stopwords_en.txt +58 -0
  227. data/.dassie/solr/conf/xslt/example.xsl +132 -0
  228. data/.dassie/solr/conf/xslt/example_atom.xsl +67 -0
  229. data/.dassie/solr/conf/xslt/example_rss.xsl +66 -0
  230. data/.dassie/solr/conf/xslt/luke.xsl +337 -0
  231. data/.dassie/solr/sample_solr_documents.yml +2692 -0
  232. data/.dassie/storage/.keep +0 -0
  233. data/.dassie/values.stage.yaml +7 -0
  234. data/.dassie/values.yaml +15 -0
  235. data/.dassie/vendor/.keep +0 -0
  236. data/.dockerignore +11 -0
  237. data/.env +26 -0
  238. data/.github/CODE_OF_CONDUCT.md +4 -4
  239. data/.github/CONTRIBUTING.md +1 -1
  240. data/.github/SUPPORT.md +13 -1
  241. data/.gitignore +1 -1
  242. data/.regen +1 -1
  243. data/.rubocop.yml +1 -0
  244. data/.rubocop_fixme.yml +4 -0
  245. data/CODE_OF_CONDUCT.md +4 -4
  246. data/CONTAINERS.md +148 -0
  247. data/CONTRIBUTING.md +1 -1
  248. data/Dockerfile +75 -0
  249. data/Gemfile +26 -35
  250. data/README.md +61 -288
  251. data/app/actors/hyrax/actors/attach_members_actor.rb +7 -5
  252. data/app/actors/hyrax/actors/base_actor.rb +0 -1
  253. data/app/actors/hyrax/actors/create_with_files_ordered_members_actor.rb +28 -28
  254. data/app/actors/hyrax/actors/create_with_remote_files_actor.rb +2 -3
  255. data/app/actors/hyrax/actors/create_with_remote_files_ordered_members_actor.rb +23 -28
  256. data/app/actors/hyrax/actors/default_admin_set_actor.rb +20 -21
  257. data/app/actors/hyrax/actors/file_actor.rb +32 -32
  258. data/app/actors/hyrax/actors/file_set_actor.rb +4 -15
  259. data/app/actors/hyrax/actors/initialize_workflow_actor.rb +8 -0
  260. data/app/actors/hyrax/actors/transfer_request_actor.rb +5 -0
  261. data/app/assets/javascripts/hyrax.js +1 -0
  262. data/app/assets/javascripts/hyrax/skip_to_content.js +15 -0
  263. data/app/assets/stylesheets/hyrax/_usage-stats.scss +1 -1
  264. data/app/authorities/qa/authorities/collections.rb +18 -8
  265. data/app/authorities/qa/authorities/find_works.rb +20 -5
  266. data/app/controllers/concerns/hyrax/collections_controller_behavior.rb +15 -6
  267. data/app/controllers/concerns/hyrax/works_controller_behavior.rb +62 -31
  268. data/app/controllers/hyrax/dashboard/collections_controller.rb +22 -12
  269. data/app/controllers/hyrax/dashboard/works_controller.rb +3 -4
  270. data/app/controllers/hyrax/file_sets_controller.rb +19 -10
  271. data/app/controllers/hyrax/homepage_controller.rb +11 -11
  272. data/app/controllers/hyrax/my/collections_controller.rb +5 -6
  273. data/app/controllers/hyrax/my/highlights_controller.rb +2 -3
  274. data/app/controllers/hyrax/my/shares_controller.rb +2 -3
  275. data/app/controllers/hyrax/my/works_controller.rb +1 -6
  276. data/app/controllers/hyrax/my_controller.rb +10 -2
  277. data/app/controllers/hyrax/permissions_controller.rb +1 -0
  278. data/app/controllers/hyrax/single_use_links_viewer_controller.rb +11 -5
  279. data/app/controllers/hyrax/users_controller.rb +5 -10
  280. data/app/forms/hyrax/forms/failed_submission_form_wrapper.rb +136 -0
  281. data/app/forms/hyrax/forms/resource_form.rb +8 -4
  282. data/app/helpers/hyrax/collections_helper.rb +1 -1
  283. data/app/helpers/hyrax/dashboard_helper_behavior.rb +7 -2
  284. data/app/helpers/hyrax/embargo_helper.rb +5 -1
  285. data/app/helpers/hyrax/hyrax_helper_behavior.rb +10 -5
  286. data/app/helpers/hyrax/lease_helper.rb +5 -1
  287. data/app/indexers/hyrax/pcdm_collection_indexer.rb +21 -0
  288. data/app/indexers/hyrax/resource_indexer.rb +3 -1
  289. data/app/indexers/hyrax/valkyrie_collection_indexer.rb +3 -12
  290. data/app/indexers/hyrax/valkyrie_indexer.rb +45 -17
  291. data/app/indexers/hyrax/valkyrie_work_indexer.rb +16 -0
  292. data/app/jobs/attach_files_to_work_job.rb +3 -41
  293. data/app/jobs/embargo_expiry_job.rb +15 -0
  294. data/app/jobs/event_job.rb +14 -7
  295. data/app/jobs/hyrax/application_job.rb +6 -1
  296. data/app/jobs/import_url_job.rb +11 -5
  297. data/app/jobs/inherit_permissions_job.rb +6 -25
  298. data/app/jobs/lease_expiry_job.rb +15 -0
  299. data/app/models/admin_set.rb +1 -1
  300. data/app/models/concerns/hyrax/ability.rb +192 -21
  301. data/app/models/concerns/hyrax/ability/admin_set_ability.rb +0 -5
  302. data/app/models/concerns/hyrax/collection_behavior.rb +7 -13
  303. data/app/models/concerns/hyrax/permissions/writable.rb +2 -2
  304. data/app/models/concerns/hyrax/solr_document/characterization.rb +35 -2
  305. data/app/models/concerns/hyrax/solr_document_behavior.rb +37 -5
  306. data/app/models/hyrax/change_set.rb +5 -1
  307. data/app/models/hyrax/collection_type.rb +59 -22
  308. data/app/models/hyrax/event.rb +5 -7
  309. data/app/models/hyrax/file_metadata.rb +15 -4
  310. data/app/models/hyrax/pcdm_collection.rb +13 -0
  311. data/app/models/hyrax/uploaded_file.rb +9 -2
  312. data/app/models/hyrax/{active_job_proxy.rb → valkyrie_global_id_proxy.rb} +6 -5
  313. data/app/models/hyrax/virus_scanner.rb +2 -1
  314. data/app/models/hyrax/work.rb +1 -1
  315. data/app/models/sipity.rb +6 -0
  316. data/app/models/sipity/entity.rb +1 -1
  317. data/app/models/sipity/workflow.rb +23 -3
  318. data/app/presenters/hyrax/admin/repository_object_presenter.rb +7 -2
  319. data/app/presenters/hyrax/collection_presenter.rb +1 -1
  320. data/app/presenters/hyrax/file_set_presenter.rb +3 -0
  321. data/app/presenters/hyrax/iiif_manifest_presenter.rb +3 -3
  322. data/app/presenters/hyrax/permission_badge.rb +1 -1
  323. data/app/presenters/hyrax/presenter_factory.rb +0 -2
  324. data/app/presenters/hyrax/select_collection_type_presenter.rb +16 -3
  325. data/app/presenters/hyrax/select_type_presenter.rb +3 -2
  326. data/app/presenters/hyrax/stats_usage_presenter.rb +0 -1
  327. data/app/presenters/hyrax/work_show_presenter.rb +1 -1
  328. data/app/renderers/hyrax/renderers/attribute_renderer.rb +16 -6
  329. data/app/search_builders/hyrax/README.md +3 -3
  330. data/app/search_builders/hyrax/admin_admin_set_member_search_builder.rb +8 -2
  331. data/app/search_builders/hyrax/collection_member_search_builder.rb +21 -7
  332. data/app/search_builders/hyrax/dashboard/managed_search_filters.rb +1 -1
  333. data/app/search_builders/hyrax/dashboard/nested_collections_search_builder.rb +1 -1
  334. data/app/search_builders/hyrax/embargo_search_builder.rb +0 -1
  335. data/app/search_builders/hyrax/filter_by_type.rb +3 -1
  336. data/app/search_builders/hyrax/lease_search_builder.rb +0 -1
  337. data/app/search_builders/hyrax/nested_collections_parent_search_builder.rb +12 -2
  338. data/app/search_builders/hyrax/search_builder.rb +1 -4
  339. data/app/search_builders/hyrax/search_filters.rb +0 -2
  340. data/app/services/hyrax/access_control_list.rb +33 -2
  341. data/app/services/hyrax/adapters/nesting_index_adapter.rb +26 -7
  342. data/app/services/hyrax/admin_set_member_service.rb +18 -4
  343. data/{lib/hyrax/callbacks/registry.rb → app/services/hyrax/callbacks.rb} +23 -0
  344. data/app/services/hyrax/change_content_depositor_service.rb +4 -1
  345. data/app/services/hyrax/collection_member_service.rb +5 -1
  346. data/app/services/hyrax/collection_types/permissions_service.rb +0 -2
  347. data/app/services/hyrax/collections/collection_member_service.rb +44 -64
  348. data/app/services/hyrax/collections/managed_collections_service.rb +15 -2
  349. data/app/services/hyrax/collections/migration_service.rb +9 -3
  350. data/app/services/hyrax/collections/nested_collection_persistence_service.rb +1 -1
  351. data/app/services/hyrax/collections/nested_collection_query_service.rb +39 -19
  352. data/app/services/hyrax/collections/permissions_service.rb +0 -1
  353. data/app/services/hyrax/collections_service.rb +12 -12
  354. data/app/services/hyrax/custom_queries/find_collections_by_type.rb +1 -1
  355. data/app/services/hyrax/custom_queries/navigators/child_collections_navigator.rb +14 -3
  356. data/app/services/hyrax/custom_queries/navigators/child_filesets_navigator.rb +14 -3
  357. data/app/services/hyrax/custom_queries/navigators/child_works_navigator.rb +10 -3
  358. data/app/services/hyrax/custom_queries/navigators/collection_members.rb +1 -0
  359. data/app/services/hyrax/custom_queries/navigators/find_files.rb +3 -0
  360. data/app/services/hyrax/database_migrator.rb +13 -10
  361. data/app/services/hyrax/default_middleware_stack.rb +0 -6
  362. data/app/services/hyrax/ensure_well_formed_admin_set_service.rb +27 -0
  363. data/app/services/hyrax/file_set_fixity_check_service.rb +16 -17
  364. data/app/services/hyrax/file_set_type_service.rb +55 -0
  365. data/app/services/hyrax/graph_exporter.rb +64 -8
  366. data/app/services/hyrax/list_source_exporter.rb +16 -34
  367. data/app/services/hyrax/listeners.rb +22 -0
  368. data/app/services/hyrax/listeners/proxy_deposit_listener.rb +20 -0
  369. data/app/services/hyrax/listeners/workflow_listener.rb +36 -0
  370. data/app/services/hyrax/multiple_membership_checker.rb +2 -1
  371. data/app/services/hyrax/quick_classification_query.rb +2 -3
  372. data/app/services/hyrax/resource_visibility_propagator.rb +1 -1
  373. data/app/services/hyrax/search_service.rb +108 -0
  374. data/app/services/hyrax/simple_schema_loader.rb +3 -1
  375. data/app/services/hyrax/statistics/depositors/summary.rb +0 -1
  376. data/app/services/hyrax/statistics/system_stats.rb +0 -1
  377. data/app/services/hyrax/thumbnail_path_service.rb +6 -1
  378. data/app/services/hyrax/time_service.rb +10 -0
  379. data/app/services/hyrax/versioning_service.rb +4 -28
  380. data/app/services/hyrax/work_uploads_handler.rb +166 -0
  381. data/app/services/hyrax/workflow/action_taken_service.rb +14 -1
  382. data/app/services/hyrax/workflow/grant_edit_to_depositor.rb +3 -1
  383. data/app/services/hyrax/workflow/permission_generator.rb +14 -9
  384. data/app/services/hyrax/workflow/workflow_action_service.rb +1 -1
  385. data/app/services/hyrax/workflow/workflow_factory.rb +12 -10
  386. data/app/services/hyrax/working_directory.rb +0 -1
  387. data/app/services/hyrax/works/managed_works_service.rb +14 -2
  388. data/app/views/_controls.html.erb +1 -1
  389. data/app/views/hyrax/admin/collection_types/index.html.erb +1 -1
  390. data/app/views/hyrax/base/_member.html.erb +1 -1
  391. data/app/views/hyrax/base/_representative_media.html.erb +1 -1
  392. data/app/views/hyrax/base/iiif_viewers/_universal_viewer.html.erb +1 -1
  393. data/app/views/hyrax/base/show.html.erb +2 -2
  394. data/app/views/hyrax/batch_select/_add_button.html.erb +1 -1
  395. data/app/views/hyrax/collections/_default_group.html.erb +2 -0
  396. data/app/views/hyrax/collections/show.html.erb +1 -1
  397. data/app/views/hyrax/dashboard/works/_default_group.html.erb +2 -0
  398. data/app/views/hyrax/embargoes/_list_expired_active_embargoes.html.erb +1 -1
  399. data/app/views/hyrax/leases/_list_expired_active_leases.html.erb +2 -1
  400. data/app/views/hyrax/my/works/_default_group.html.erb +2 -0
  401. data/app/views/layouts/hyrax.html.erb +0 -15
  402. data/bin/db-migrate-seed.sh +9 -0
  403. data/bin/db-wait.sh +14 -0
  404. data/bin/hyrax-entrypoint.sh +15 -0
  405. data/chart/fcrepo/.gitignore +2 -0
  406. data/chart/fcrepo/.helmignore +23 -0
  407. data/chart/fcrepo/Chart.yaml +11 -0
  408. data/chart/fcrepo/README.md +50 -0
  409. data/chart/fcrepo/templates/NOTES.txt +21 -0
  410. data/chart/fcrepo/templates/_helpers.tpl +68 -0
  411. data/chart/fcrepo/templates/configmap-env.yaml +19 -0
  412. data/chart/fcrepo/templates/deployment.yaml +109 -0
  413. data/chart/fcrepo/templates/ingress.yaml +41 -0
  414. data/chart/fcrepo/templates/pvc.yaml +20 -0
  415. data/chart/fcrepo/templates/secret.yaml +12 -0
  416. data/chart/fcrepo/templates/service.yaml +15 -0
  417. data/chart/fcrepo/templates/serviceaccount.yaml +12 -0
  418. data/chart/fcrepo/templates/tests/test-connection.yaml +15 -0
  419. data/chart/fcrepo/values.yaml +79 -0
  420. data/chart/hyrax/.gitignore +2 -0
  421. data/chart/hyrax/.helmignore +23 -0
  422. data/chart/hyrax/Chart.yaml +27 -0
  423. data/chart/hyrax/README.md +69 -0
  424. data/chart/hyrax/templates/NOTES.txt +21 -0
  425. data/chart/hyrax/templates/_helpers.tpl +92 -0
  426. data/chart/hyrax/templates/configmap-env.yaml +32 -0
  427. data/chart/hyrax/templates/deployment.yaml +79 -0
  428. data/chart/hyrax/templates/fcrepo-secret.yaml +13 -0
  429. data/chart/hyrax/templates/hpa.yaml +28 -0
  430. data/chart/hyrax/templates/ingress.yaml +41 -0
  431. data/chart/hyrax/templates/secrets.yaml +12 -0
  432. data/chart/hyrax/templates/service.yaml +15 -0
  433. data/chart/hyrax/templates/serviceaccount.yaml +12 -0
  434. data/chart/hyrax/templates/tests/test-connection.yaml +15 -0
  435. data/chart/hyrax/values.yaml +97 -0
  436. data/config/initializers/indexing_adapter_initializer.rb +7 -12
  437. data/config/initializers/listeners.rb +2 -0
  438. data/config/locales/hyrax.en.yml +1 -1
  439. data/config/metadata/basic_metadata.yaml +13 -0
  440. data/db/seeds.rb +20 -0
  441. data/docker-compose.yml +132 -0
  442. data/documentation/developing-your-hyrax-based-app.md +271 -0
  443. data/documentation/legacyREADME.md +336 -0
  444. data/documentation/note-about-versions.md +15 -0
  445. data/hyrax.gemspec +7 -8
  446. data/lib/generators/hyrax/templates/config/initializers/hyrax.rb +4 -6
  447. data/lib/generators/hyrax/templates/config/locales/hyrax.es.yml +1 -1
  448. data/lib/generators/hyrax/templates/db/seeds.rb +16 -14
  449. data/lib/generators/hyrax/templates/uv.html +1 -1
  450. data/lib/generators/hyrax/work_resource/templates/controller.rb.erb +0 -5
  451. data/lib/generators/hyrax/work_resource/templates/form.rb.erb +1 -1
  452. data/lib/generators/hyrax/work_resource/templates/work.html.erb_spec.rb.erb +3 -2
  453. data/lib/hyrax.rb +17 -0
  454. data/lib/hyrax/configuration.rb +340 -200
  455. data/lib/hyrax/event_store.rb +5 -0
  456. data/lib/hyrax/form_fields.rb +1 -1
  457. data/lib/hyrax/indexer.rb +19 -3
  458. data/lib/hyrax/publisher.rb +71 -2
  459. data/lib/hyrax/resource_sync/change_list_writer.rb +1 -1
  460. data/lib/hyrax/resource_sync/resource_list_writer.rb +1 -1
  461. data/lib/hyrax/schema.rb +2 -2
  462. data/lib/hyrax/specs/capybara.rb +98 -0
  463. data/lib/hyrax/specs/clamav.rb +15 -0
  464. data/lib/hyrax/specs/disable_animations_in_test_environment.rb +53 -0
  465. data/lib/hyrax/specs/engine_routes.rb +11 -0
  466. data/lib/hyrax/specs/shared_specs/change_set.rb +11 -0
  467. data/lib/hyrax/specs/shared_specs/factories/strategies/json_strategy.rb +13 -0
  468. data/lib/hyrax/specs/shared_specs/factories/strategies/valkyrie_resource.rb +0 -11
  469. data/lib/hyrax/specs/shared_specs/hydra_works.rb +6 -0
  470. data/lib/hyrax/specs/shared_specs/indexers.rb +22 -5
  471. data/lib/hyrax/specs/shared_specs/metadata.rb +64 -0
  472. data/lib/hyrax/specs/spy_listener.rb +52 -26
  473. data/lib/hyrax/transactions/container.rb +13 -1
  474. data/lib/hyrax/transactions/steps/add_file_sets.rb +35 -0
  475. data/lib/hyrax/transactions/steps/save.rb +10 -4
  476. data/lib/hyrax/transactions/steps/save_access_control.rb +29 -0
  477. data/lib/hyrax/transactions/steps/set_default_admin_set.rb +1 -1
  478. data/lib/hyrax/transactions/update_work.rb +3 -1
  479. data/lib/hyrax/transactions/work_create.rb +3 -1
  480. data/lib/hyrax/version.rb +1 -1
  481. data/lib/tasks/collection_type_global_id.rake +22 -0
  482. data/lib/tasks/default_admin_set.rake +5 -0
  483. data/lib/wings.rb +1 -1
  484. data/lib/wings/active_fedora_converter.rb +71 -123
  485. data/lib/wings/active_fedora_converter/default_work.rb +129 -0
  486. data/lib/wings/active_fedora_converter/nested_resource.rb +25 -0
  487. data/lib/wings/attribute_transformer.rb +28 -1
  488. data/lib/wings/converter_value_mapper.rb +70 -3
  489. data/lib/wings/model_registry.rb +4 -3
  490. data/lib/wings/model_transformer.rb +25 -7
  491. data/lib/wings/orm_converter.rb +19 -23
  492. data/lib/wings/services/custom_queries/find_collections_by_type.rb +1 -1
  493. data/lib/wings/services/custom_queries/find_file_metadata.rb +65 -38
  494. data/lib/wings/services/file_converter_service.rb +6 -55
  495. data/lib/wings/services/file_metadata_builder.rb +12 -8
  496. data/lib/wings/setup.rb +56 -9
  497. data/lib/wings/transformer_value_mapper.rb +1 -0
  498. data/lib/wings/valkyrie/metadata_adapter.rb +2 -2
  499. data/lib/wings/valkyrie/persister.rb +13 -14
  500. data/lib/wings/valkyrie/storage.rb +94 -0
  501. data/tasks/benchmark.rake +56 -0
  502. data/template.rb +1 -3
  503. metadata +346 -54
  504. data/lib/hyrax/callbacks.rb +0 -27
  505. data/lib/wings/hydra/pcdm/models/concerns/collection_valkyrie_behavior.rb +0 -28
  506. data/lib/wings/hydra/pcdm/models/concerns/object_valkyrie_behavior.rb +0 -28
  507. data/lib/wings/hydra/pcdm/models/concerns/pcdm_valkyrie_behavior.rb +0 -171
  508. data/lib/wings/hydra/works/models/concerns/collection_valkyrie_behavior.rb +0 -31
  509. data/lib/wings/hydra/works/models/concerns/file_set_valkyrie_behavior.rb +0 -31
  510. data/lib/wings/hydra/works/models/concerns/work_valkyrie_behavior.rb +0 -60
  511. data/lib/wings/models/concerns/collection_behavior.rb +0 -39
  512. data/lib/wings/models/multi_checksum.rb +0 -18
  513. data/lib/wings/services/id_converter_service.rb +0 -15
  514. data/lib/wings/valkyrie/storage/active_fedora.rb +0 -27
@@ -1,6 +1,6 @@
1
1
  # Search Builders
2
2
 
3
- Building searches is core to any Blacklight app, and Hyrax is no exception.
3
+ Building searches is core to any Blacklight app, and Hyrax is no exception.
4
4
  This directory contains our Search Builders, so named because the design followed a builder pattern, meaning
5
5
  that when invoked to set values, methods return the object itself, so that invocations can be chained, like:
6
6
 
@@ -11,13 +11,13 @@ builder = Blacklight::SearchBuilder.new(processor_chain, scope)
11
11
  .with(q: 'Abraham Lincoln')
12
12
  ```
13
13
 
14
- However, at this level, many if not most of the additional methods do not follow this pattern.
14
+ However, at this level, many if not most of the additional methods do not follow this pattern.
15
15
  Refer to the `Blacklight::SearchBuilder` class if you want to be certain. That leads to the next topic...
16
16
 
17
17
  ## Ancestry
18
18
 
19
19
  Most of the SearchBuilders have `::SearchBuilder` as a parent or ancestor. `::SearchBuilder` does not exist in any repo: it is generated
20
- by Blacklight and modified by Hyrax. Others descend from `Blacklight::SearchBuilder`, or various other relatives.
20
+ by Blacklight and modified by Hyrax. Others descend from `Blacklight::SearchBuilder`, or various other relatives.
21
21
 
22
22
  ### ::SearchBuilder
23
23
 
@@ -8,14 +8,20 @@ module Hyrax
8
8
 
9
9
  attr_reader :collection
10
10
 
11
- # @param [scope] Typically the controller object
12
- # @param [::Collection]
11
+ ##
12
+ # @param [Object] scope Typically the controller object
13
+ # @param [::Collection] collection
13
14
  def initialize(scope:, collection:)
14
15
  @collection = collection
15
16
  super(scope)
16
17
  end
17
18
 
19
+ ##
18
20
  # include filters into the query to only include the admin_set members (regardless of status)
21
+ #
22
+ # @param [Hash] solr_parameters
23
+ #
24
+ # @return [void]
19
25
  def in_admin_set(solr_parameters)
20
26
  solr_parameters[:fq] ||= []
21
27
  solr_parameters[:fq] << "{!term f=#{Hyrax.config.admin_set_predicate.qname.last}_ssim}#{collection.id}"
@@ -3,7 +3,7 @@ module Hyrax
3
3
  # This search builder requires that a accessor named "collection" exists in the scope
4
4
  class CollectionMemberSearchBuilder < ::SearchBuilder
5
5
  include Hyrax::FilterByType
6
- attr_reader :collection, :search_includes_models
6
+ attr_writer :collection, :search_includes_models
7
7
 
8
8
  class_attribute :collection_membership_field
9
9
  self.collection_membership_field = 'member_of_collection_ids_ssim'
@@ -11,14 +11,28 @@ module Hyrax
11
11
  # Defines which search_params_logic should be used when searching for Collection members
12
12
  self.default_processor_chain += [:member_of_collection]
13
13
 
14
- # @param [scope] Typically the controller object
15
- # @param [Symbol] :works, :collections, (anything else retrieves both)
16
- def initialize(scope:,
17
- collection:,
18
- search_includes_models: :works)
14
+ # @param [Object] scope Typically the controller object
15
+ # @param [Symbol] search_includes_models +:works+ or +:collections+; (anything else retrieves both)
16
+ def initialize(*args,
17
+ scope: nil,
18
+ collection: nil,
19
+ search_includes_models: nil)
19
20
  @collection = collection
20
21
  @search_includes_models = search_includes_models
21
- super(scope)
22
+
23
+ if args.any?
24
+ super(*args)
25
+ else
26
+ super(scope)
27
+ end
28
+ end
29
+
30
+ def collection
31
+ @collection || (scope.context[:collection] if scope&.respond_to?(:context))
32
+ end
33
+
34
+ def search_includes_models
35
+ @search_includes_models || :works
22
36
  end
23
37
 
24
38
  # include filters into the query to only include the collection memebers
@@ -15,7 +15,7 @@ module Hyrax
15
15
  return [] if groups.empty?
16
16
  permission_types.map do |type|
17
17
  field = solr_field_for(type, 'group')
18
- user_groups = type == 'read' ? groups - ['public', 'registered'] : groups
18
+ user_groups = type == 'read' ? groups - [::Ability.public_group_name, ::Ability.registered_group_name] : groups
19
19
  next if user_groups.empty?
20
20
  "({!terms f=#{field}}#{user_groups.join(',')})" # parens required to properly OR the clauses together.
21
21
  end
@@ -28,7 +28,7 @@ module Hyrax
28
28
  solr_parameters[:fq] ||= []
29
29
  solr_parameters[:fq] += [
30
30
  "-" + Hyrax::SolrQueryBuilderService.construct_query_for_ids([limit_ids]),
31
- Hyrax::SolrQueryBuilderService.construct_query(::Collection.collection_type_gid_document_field_name => @collection.collection_type_gid)
31
+ Hyrax::SolrQueryBuilderService.construct_query(Hyrax.config.collection_type_index_field => @collection.collection_type_gid)
32
32
  ]
33
33
  solr_parameters[:fq] += limit_clause if limit_clause # add limits to prevent illegal nesting arrangements
34
34
  end
@@ -4,7 +4,6 @@ module Hyrax
4
4
  class EmbargoSearchBuilder < Blacklight::SearchBuilder
5
5
  self.default_processor_chain = [:with_pagination, :with_sorting, :only_active_embargoes]
6
6
 
7
- # TODO: add more complex pagination
8
7
  def with_pagination(solr_params)
9
8
  solr_params[:rows] = 1000
10
9
  end
@@ -30,7 +30,9 @@ module Hyrax
30
30
  end
31
31
 
32
32
  def models_to_solr_clause
33
- models.map { |model| model.try(:to_rdf_representation) || model.name }.join(',')
33
+ models.map do |model|
34
+ model.respond_to?(:to_rdf_representation) ? model.to_rdf_representation : model.name
35
+ end.join(',')
34
36
  end
35
37
 
36
38
  def generic_type_field
@@ -4,7 +4,6 @@ module Hyrax
4
4
  class LeaseSearchBuilder < Blacklight::SearchBuilder
5
5
  self.default_processor_chain = [:with_pagination, :with_sorting, :only_active_leases]
6
6
 
7
- # TODO: add more complex pagination
8
7
  def with_pagination(solr_params)
9
8
  solr_params[:rows] = 1000
10
9
  end
@@ -1,25 +1,35 @@
1
1
  # frozen_string_literal: true
2
2
  module Hyrax
3
+ ##
3
4
  # Searches for all collections that are parents of a given collection.
4
5
  class NestedCollectionsParentSearchBuilder < ::SearchBuilder
5
6
  include Hyrax::FilterByType
6
7
  attr_reader :child, :page, :limit
7
8
 
8
- # @param [scope] Typically the controller object
9
- # @param [child] The child collection
9
+ # @param [Object] scope Typically the controller object
10
+ # @param [ActiveFedora::Base] child The child collection
10
11
  def initialize(scope:, child:, page:)
11
12
  @child = child
12
13
  @page = page
13
14
  super(scope)
14
15
  end
15
16
 
17
+ ##
16
18
  # Filters the query to only include the parent collections
19
+ #
20
+ # @param [Hash] solr_parameters
21
+ #
22
+ # @return [void]
17
23
  def parent_collections_only(solr_parameters)
18
24
  solr_parameters[:fq] ||= []
19
25
  solr_parameters[:fq] += [Hyrax::SolrQueryBuilderService.construct_query_for_ids(child.member_of_collection_ids)]
20
26
  end
21
27
  self.default_processor_chain += [:parent_collections_only]
22
28
 
29
+ ##
30
+ # @param [Hash] solr_parameters
31
+ #
32
+ # @return [void]
23
33
  def with_pagination(solr_parameters)
24
34
  solr_parameters[:page] = page
25
35
  end
@@ -1,8 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
  module Hyrax
3
- class SearchBuilder < Blacklight::SearchBuilder
4
- include Blacklight::Solr::SearchBuilderBehavior
5
- include Hydra::AccessControlsEnforcement
6
- include Hyrax::SearchFilters
3
+ class SearchBuilder < ::SearchBuilder
7
4
  end
8
5
  end
@@ -22,12 +22,10 @@ module Hyrax
22
22
 
23
23
  private
24
24
 
25
- # TODO: could this be moved to Blacklight::AccessControls::Enforcement?
26
25
  def current_user_key
27
26
  current_user.user_key
28
27
  end
29
28
 
30
- # TODO: could this be moved to Blacklight::AccessControls::Enforcement?
31
29
  def current_user
32
30
  scope.current_user
33
31
  end
@@ -1,6 +1,23 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Hyrax
4
+ ##
5
+ # @api public
6
+ #
7
+ # Cast an object to its AccessControlList
8
+ #
9
+ # @param [Object] an object to try to cast
10
+ #
11
+ # @return [Hyrax::AccessControlList]
12
+ def self.AccessControlList(obj)
13
+ case obj
14
+ when AccessControlList
15
+ obj
16
+ else
17
+ AccessControlList.new(resource: obj)
18
+ end
19
+ end
20
+
4
21
  ##
5
22
  # @api public
6
23
  #
@@ -53,6 +70,19 @@ module Hyrax
53
70
  @query_service = query_service
54
71
  end
55
72
 
73
+ ##
74
+ # Copy and save permissions from source to target
75
+ #
76
+ # @param [Valkyrie::Resource, Hyrax::AccessControlList] source
77
+ # @param [Valkyrie::Resource, Hyrax::AccessControlList] target
78
+ #
79
+ # @return [Hyrax::AccessControlList] an acl for `target` with the updated permissions
80
+ def self.copy_permissions(source:, target:)
81
+ target = Hyrax::AccessControlList(target)
82
+ target.permissions = Hyrax::AccessControlList(source).permissions
83
+ target.save && target
84
+ end
85
+
56
86
  ##
57
87
  # @api public
58
88
  #
@@ -112,7 +142,8 @@ module Hyrax
112
142
  #
113
143
  # @return [Array<Hyrax::Permission>]
114
144
  def permissions=(new_permissions)
115
- change_set.permissions = new_permissions.to_a
145
+ change_set.permissions = []
146
+ new_permissions.each { |p| self << p }
116
147
  end
117
148
 
118
149
  ##
@@ -156,7 +187,7 @@ module Hyrax
156
187
 
157
188
  private
158
189
 
159
- def id_for(agent: user_or_group)
190
+ def id_for(agent:)
160
191
  case agent
161
192
  when Hyrax::Group
162
193
  "#{Hyrax::Group.name_prefix}#{agent.name}"
@@ -6,7 +6,10 @@ module Hyrax
6
6
  LIMITED_REINDEX = "limited"
7
7
 
8
8
  # @!group Providing interface for a Samvera::NestingIndexer::Adapter
9
+
10
+ ##
9
11
  # @api public
12
+ #
10
13
  # @param id [String]
11
14
  # @return Samvera::NestingIndexer::Document::PreservationDocument
12
15
  def self.find_preservation_document_by(id:)
@@ -16,7 +19,9 @@ module Hyrax
16
19
  Samvera::NestingIndexer::Documents::PreservationDocument.new(id: id, parent_ids: parent_ids)
17
20
  end
18
21
 
22
+ ##
19
23
  # @api public
24
+ #
20
25
  # @param id [String]
21
26
  # @return Samvera::NestingIndexer::Document::PreservationDocument
22
27
  def self.find_preservation_parent_ids_for(id:)
@@ -33,7 +38,9 @@ module Hyrax
33
38
  end
34
39
  end
35
40
 
41
+ ##
36
42
  # @api public
43
+ #
37
44
  # @param id [String]
38
45
  # @return Samvera::NestingIndexer::Documents::IndexDocument
39
46
  def self.find_index_document_by(id:)
@@ -41,12 +48,13 @@ module Hyrax
41
48
  coerce_solr_document_to_index_document(original_solr_document: solr_document, id: id)
42
49
  end
43
50
 
51
+ ##
44
52
  # @api public
45
53
  # @yieldparam id [String]
46
54
  # @yieldparam parent_id [Array<String>]
47
- # Samvera::NestingIndexer.reindex_all!(extent: FULL_REINDEX)
48
- # rubocop:disable Lint/UnusedMethodArgument
49
- def self.each_perservation_document_id_and_parent_ids(&block)
55
+ #
56
+ # @see Samvera::NestingIndexer.reindex_all!(extent: FULL_REINDEX)
57
+ def self.each_perservation_document_id_and_parent_ids(&block) # rubocop:disable Lint/UnusedMethodArgument
50
58
  ActiveFedora::Base.descendant_uris(ActiveFedora.fedora.base_uri, exclude_uri: true).each do |uri|
51
59
  id = Hyrax::Base.uri_to_id(uri)
52
60
  object = ActiveFedora::Base.find(id)
@@ -62,8 +70,8 @@ module Hyrax
62
70
  end
63
71
  end
64
72
  end
65
- # rubocop:enable Lint/UnusedMethodArgument
66
73
 
74
+ ##
67
75
  # @api public
68
76
  #
69
77
  # From the nesting_document, we will need to add the nesting attributes to the underlying SOLR document for the object
@@ -85,6 +93,7 @@ module Hyrax
85
93
  )
86
94
  end
87
95
 
96
+ ##
88
97
  # @api public
89
98
  #
90
99
  # @param solr_doc [SolrDocument]
@@ -92,7 +101,7 @@ module Hyrax
92
101
  # @param parent_ids [Array]
93
102
  # @param pathnames [Array]
94
103
  # @param depth [Array] the object's deepest nesting depth
95
- # @return solr_doc [SolrDocument]
104
+ # @return [SolrDocument]
96
105
  def self.add_nesting_attributes(solr_doc:, ancestors:, parent_ids:, pathnames:, depth:)
97
106
  solr_doc[solr_field_name_for_storing_ancestors] = ancestors
98
107
  solr_doc[solr_field_name_for_storing_parent_ids] = parent_ids
@@ -102,11 +111,14 @@ module Hyrax
102
111
  solr_doc
103
112
  end
104
113
 
114
+ ##
105
115
  # @api public
116
+ #
106
117
  # @param document [Samvera::NestingIndexer::Documents::IndexDocument]
107
118
  # @param extent [String] if not "full" or nil, doesn't yield children for reindexing
108
- # @param solr_field_name_for_ancestors [String] The SOLR field name we use to find children
109
119
  # @yield Samvera::NestingIndexer::Documents::IndexDocument
120
+ #
121
+ # @return [void]
110
122
  def self.each_child_document_of(document:, extent:, &block)
111
123
  raw_child_solr_documents_of(parent_document: document).each do |solr_document|
112
124
  child_document = coerce_solr_document_to_index_document(original_solr_document: solr_document, id: solr_document.fetch('id'))
@@ -114,11 +126,13 @@ module Hyrax
114
126
  block.call(child_document) if full_reindex?(extent: extent) || child_document.pathnames.empty?
115
127
  end
116
128
  end
117
- # @!endgroup
118
129
 
130
+ # @!endgroup
119
131
  # @!group Supporting methods for interface implementation
120
132
 
133
+ ##
121
134
  # @api private
135
+ #
122
136
  # @todo Need to implement retrieving parent_ids, pathnames, and ancestors from the given document
123
137
  def self.coerce_solr_document_to_index_document(original_solr_document:, id:)
124
138
  Samvera::NestingIndexer::Documents::IndexDocument.new(
@@ -130,6 +144,7 @@ module Hyrax
130
144
  end
131
145
  private_class_method :coerce_solr_document_to_index_document
132
146
 
147
+ ##
133
148
  # @api private
134
149
  def self.find_solr_document_by(id:)
135
150
  query = Hyrax::SolrQueryBuilderService.construct_query_for_ids([id])
@@ -140,6 +155,7 @@ module Hyrax
140
155
  end
141
156
  private_class_method :find_solr_document_by
142
157
 
158
+ ##
143
159
  # @api private
144
160
  def self.nesting_configuration
145
161
  @nesting_configuration ||= Samvera::NestingIndexer.configuration
@@ -152,9 +168,11 @@ module Hyrax
152
168
  :solr_field_name_for_deepest_nested_depth, to: :nesting_configuration
153
169
  end
154
170
 
171
+ ##
155
172
  # @api private
156
173
  # @param parent_document [Curate::Indexer::Documents::IndexDocument]
157
174
  # @return [Hash] A raw response document from SOLR
175
+ #
158
176
  # @todo What is the appropriate suffix to apply to the solr_field_name?
159
177
  def self.raw_child_solr_documents_of(parent_document:)
160
178
  # query Solr for all of the documents included as a member_of_collection parent. Or up to 10000 of them.
@@ -168,6 +186,7 @@ module Hyrax
168
186
  false
169
187
  end
170
188
  private_class_method :full_reindex?
189
+
171
190
  # @!endgroup
172
191
  end
173
192
  end
@@ -1,19 +1,33 @@
1
1
  # frozen_string_literal: true
2
2
  module Hyrax
3
+ ##
3
4
  # Responsible for retrieving admin set's members
4
5
  class AdminSetMemberService
6
+ ##
7
+ # @!attribute [r] collection
8
+ # @return [::Collection]
9
+ # @!attribute [r] params
10
+ # @return [ActionController::Parameters]
11
+ # @!attribute [r] scope
12
+ # @return [#repository]
5
13
  attr_reader :scope, :params, :collection
14
+
15
+ ##
16
+ # @!method repository
17
+ # @note delegated to +:scope+
6
18
  delegate :repository, to: :scope
7
19
 
8
- # @param scope [#repository] Typically acontroller object which responds to :repository
9
- # @param [::Collection] an collection of type admin set
10
- # @param [ActionController::Parameters] query params
20
+ ##
21
+ # @param [#repository] scope Typically acontroller object which responds to :repository
22
+ # @param [::Collection] collection an collection of type admin set
23
+ # @param [ActionController::Parameters] params query params
11
24
  def initialize(scope:, collection:, params:)
12
25
  @scope = scope
13
26
  @collection = collection
14
27
  @params = params
15
28
  end
16
29
 
30
+ ##
17
31
  # @api public
18
32
  #
19
33
  # All members of the given admin_set
@@ -32,8 +46,8 @@ module Hyrax
32
46
  @members_search_builder ||= Hyrax::AdminAdminSetMemberSearchBuilder.new(scope: scope, collection: collection)
33
47
  end
34
48
 
49
+ ##
35
50
  # @api private
36
- #
37
51
  def query_solr(query_builder:, query_params:)
38
52
  repository.search(query_builder.with(query_params).query)
39
53
  end