-
Notifications
You must be signed in to change notification settings - Fork 26
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
Use collection_id for linking rather than inferring from eadid #1531
Conversation
@corylown This looks good. Thanks for thinking it through. I have tested these changes out locally and they work well. I would recommend taking this refactor even further, and removing I.e., remove this file:
Remove this method from
...or if we're concerned that implementers may have called In
Could be:
And this...
Could just be:
Here's a gist, note: without rspec tests. I did test these changes out by checking out |
@seanaery thanks for taking a close look at this and for your thorough testing. My initial work on this included many of the changes you suggest, then I backed them out for a few reasons.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That all sounds good to me. 👍
At the last community call (2024-04-22) we discussion a desired feature to make it easier to customize the formation of the collection document id. The use cases cited were needing to add the repository name/code to prevent identifier collisions across repositories and adding a slug version of the title to the id for friendlier URLs.
As I was looking at how we could better support this I found that there were a couple places in the application where we were inferring the parent collection id from the normalized form of the eadid. I found this confusing and was concerned that allowing customization of the document id would break these assumptions about the relationship between the parent collection document id and the eadid.
This PR attempts to remove this assumption from the app so we can (in a future PR) add a seam for customizing the collection document id formation.
Instead of inferring the parent collection document id from the
eadid
this creates aSolrDocument
accessor methodcollection_id
using the_root_
Solr field from Solr's nested document structure. This change works with either older stylelegacy_id
parent field relationships or the newerparent_ids
field. It should be completely backwards compatible with existing arclight v1 apps.Grateful for feedback, questions, concerns.