Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gen collection resource #5519

Closed
wants to merge 5 commits into from
Closed

Gen collection resource #5519

wants to merge 5 commits into from

Conversation

elrayle
Copy link
Contributor

@elrayle elrayle commented Mar 11, 2022

Description

This PR...

  • creates a generator for collection resources
  • removes basic_metadata from Hyrax::PcdmCollection
  • adds a resource collection to the test app

Collection Resource Generator

Generates:

  1. Creates a collection model and spec.
  2. Creates a collection form and spec.
  3. Creates a collection indexer and spec.
  4. Creates a collection metadata config.
  5. Sets this to be the collection class.

The generated collection resource classes include basic_metadata.

Move basic metadata

The generated collection resource class includes basic_metadata. For that reason, the inclusion of basic_metadata was removed from Hyrax::PcdmCollection and its indexer.

_NOTE: This follows the pattern used for works where Hyrax::Work includes core_metadata, but not basic_metadata, as it is included in generated work classes.

Add CollectionResource in test app

The test generator was updated to create a collection resource class named "CollectionResource". The config that is generated to set this as 'the' collection class is commented out in /config/initializers/hyrax.rb by the test generator.

For now, this allows the ActiveFedora ::Collection class to continue to be 'the' collection class.

NOTE: At this time, Hyrax supports a single class that is 'the' collection class. It is configured in config/initializers/hyrax.rb by setting config.collection_model =.

Potential Future Work

This pattern allows for future work that would update Hyrax to allow multiple collection resource classes each with their own metadata.

Related Work

This PR replaces the proposed work in PR #5157 that added a separate collection_basic_metadata file.

@samvera/hyrax-code-reviewers

@elrayle elrayle force-pushed the gen_collection_resource branch 2 times, most recently from f1823fd to 2efeb7c Compare March 11, 2022 22:33
Generates:
1. Creates a collection model and spec.
2. Creates a collection form and spec.
3. Creates a collection indexer and spec.
4. Creates a collection metadata config.
5. Sets this to be the collection class.

create a collection resource in test app, but don’t make it ‘the’ collection

This provides a PcdmCollection for use in testing.  It does not make it ‘the’ collection class for the test app.  That remains `::Collection` until we are ready for a full switch to Valkyrie.
The collection resource generator will include basic metadata in the generated collection class.
@elrayle elrayle marked this pull request as draft April 12, 2022 15:47
@elrayle elrayle closed this May 3, 2022
@elrayle elrayle deleted the gen_collection_resource branch May 3, 2022 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant