-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2164 from samvera/i94-collections
Collection & Admin Set Valkyrization
- Loading branch information
Showing
21 changed files
with
230 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
class AdminSetResourceForm < Hyrax::Forms::AdministrativeSetForm | ||
include CollectionAccessFiltering | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# frozen_string_literal: true | ||
|
||
# Generated via | ||
# `rails generate hyrax:collection_resource CollectionResource` | ||
class CollectionResourceForm < Hyrax::Forms::PcdmCollectionForm | ||
include Hyrax::FormFields(:basic_metadata) | ||
include Hyrax::FormFields(:collection_resource) | ||
include CollectionAccessFiltering | ||
end |
11 changes: 0 additions & 11 deletions
11
app/forms/hyrax/forms/admin/administrative_set_form_decorator.rb
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# frozen_string_literal: true | ||
|
||
class AdminSetResourceIndexer < Hyrax::Indexers::AdministrativeSetIndexer | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# frozen_string_literal: true | ||
|
||
# Generated via | ||
# `rails generate hyrax:collection_resource CollectionResource` | ||
class CollectionResourceIndexer < Hyrax::Indexers::PcdmCollectionIndexer | ||
include Hyrax::Indexer(:basic_metadata) | ||
include Hyrax::Indexer(:collection_resource) | ||
|
||
def to_solr | ||
super.tap do |index_document| | ||
index_document["account_cname_tesim"] = Site.instance&.account&.cname | ||
index_document['account_institution_name_ssim'] = Site.instance.institution_label | ||
end | ||
end | ||
end |
4 changes: 1 addition & 3 deletions
4
...els/hyrax/administrative_set_decorator.rb → app/models/admin_set_resource.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
# frozen_string_literal: true | ||
|
||
# OVERRIDE Hyrax 5.0 to add AF methods to collection | ||
|
||
Hyrax::AdministrativeSet.class_eval do | ||
class AdminSetResource < Hyrax::AdministrativeSet | ||
include Hyrax::ArResource | ||
include Hyrax::Permissions::Readable | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# frozen_string_literal: true | ||
|
||
# Generated via | ||
# `rails generate hyrax:collection_resource CollectionResource` | ||
class CollectionResource < Hyrax::PcdmCollection | ||
include Hyrax::Schema(:basic_metadata) | ||
include Hyrax::Schema(:collection_resource) | ||
include Hyrax::ArResource | ||
# This module provides the #public?, #private?, #restricted? methods; consider | ||
# contributing this back to Hyrax; but that decision requires further discussion | ||
# on architecture. | ||
# @see https://samvera.slack.com/archives/C0F9JQJDQ/p1705421588370699 Slack discussion thread. | ||
include Hyrax::Permissions::Readable | ||
prepend OrderAlready.for(:creator) | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,12 +20,14 @@ | |
# Identify the model class name that will be used for Collections in your app | ||
# (i.e. ::Collection for ActiveFedora, Hyrax::PcdmCollection for Valkyrie) | ||
# config.collection_model = '::Collection' | ||
config.collection_model = 'Hyrax::PcdmCollection' | ||
# Injected via `rails g hyrax:collection_resource CollectionResource` | ||
config.collection_model = 'CollectionResource' | ||
|
||
# Identify the model class name that will be used for Admin Sets in your app | ||
# (i.e. AdminSet for ActiveFedora, Hyrax::AdministrativeSet for Valkyrie) | ||
# config.admin_set_model = 'AdminSet' | ||
config.admin_set_model = 'Hyrax::AdministrativeSet' | ||
config.admin_set_model = 'AdminSetResource' | ||
|
||
# The email address that messages submitted via the contact page are sent to | ||
# This is set by account settings | ||
# config.contact_email = '[email protected]' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.