Code for Managing Collections
Table of Contents
Collection Model
I now that the basics of the modeling was coming from Hydra::Works::Collections.Ā Is that still the case?
Yes, with other application behaviors injected in Hyrax:
- https://github.com/samvera/hyrax/blob/master/app/models/concerns/hyrax/collection_behavior.rb
- https://github.com/samvera/hydra-works/blob/master/lib/hydra/works/models/concerns/collection_behavior.rb
- https://github.com/samvera/hydra-pcdm/blob/master/lib/hydra/pcdm/models/concerns/collection_behavior.rb
- https://github.com/samvera/hydra-pcdm/blob/master/lib/hydra/pcdm/models/concerns/pcdm_behavior.rb
Collection Controller
Is this coming from Hydra::Collections gem?
No, Hydra::Collections was merged into CurationConcerns, which became Hyrax. Controller code for collections lives:
- https://github.com/samvera/hyrax/blob/master/app/controllers/hyrax/collections_controller.rb
- https://github.com/samvera/hyrax/blob/master/app/controllers/hyrax/admin/admin_sets_controller.rb
- https://github.com/samvera/hyrax/blob/master/app/controllers/concerns/hyrax/collections_controller_behavior.rb
- https://github.com/samvera/hyrax/blob/master/app/controllers/concerns/hyrax/collections/accepts_batches.rb
- https://github.com/samvera/hyrax/blob/master/app/controllers/concerns/hyrax/breadcrumbs_for_collections.rb
Also note the My and Dashboard extensions:
- https://github.com/samvera/hyrax/blob/master/app/controllers/hyrax/my/collections_controller.rb
- https://github.com/samvera/hyrax/blob/master/app/controllers/hyrax/dashboard/collections_controller.rb
Collection Management Views
Views are all here for user collections:Ā https://github.com/samvera/hyrax/tree/master/app/views/hyrax/collections
And here for admin sets:Ā https://github.com/samvera/hyrax/tree/master/app/views/hyrax/admin/admin_sets
See also the collection- and admin set-related presenters and search builders that control what entities you see when browsing to these views.
Where is the code for listing collections?
Collections index view is path /dashboard/my/collections and /dashboard/collections Ā
Where is the code for new/edit collections?
Adding items to collections
Adding sub-collections
Are there checks in Hyrax that prevent a collection being nested in a collection?Ā Hydra::Works::Collections has the infrastructure that should allow for this.
I don't believe so, no.
Adding works
Where all can a work get added to a collection?Ā I am looking for the appropriate place to do multi-membership validation.
- In the Work edit view and in the Your Works view (/dashboard/my/works and /dashboard/works)
- In the relationships tab of add new work and in add new works by batch