-
Notifications
You must be signed in to change notification settings - Fork 1
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
Rails hyrax upgrade #318
Merged
Merged
Rails hyrax upgrade #318
Conversation
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 commit will account for a proposed `Hyku::WorksControllerBehavior` in the Hyku/Hyrax 5 upgrade branch.
Changed the #iiif_print_config? to a class_attribute so we don't have to instantiate the object to check if it's configured. Added a next to the indexer so if a curation concern does not have IIIF Print configured, then we won't index the SetChildFlag onto it.
The `class_attribute` best serves cases where we might adjust configuration at run-time or during initialization. In the case of of the class method I am removing, it's subtly different than the ideal use case for `class_attribute`. The difference is such: We include the configuration module into a model; this is the run time configuration. And because we've "configured IIIF Print" for that model, we always will have a `.iiif_print_config?` of true.
This commit will add indexing paths for Valkyrie resources. The `IiifPrint::SimpleSchemaLoaderDecorator` is introduced here to add the `IiifPrint::Engine.root` path to the schema load path so we can keep the yaml in the gem and not have to copy it over to the host app.
This is not necessary and will keep an instance around in memory for longer than we need
* main: 🎁 Add Transaction for Cleaning Up Split Pages ♻️ Extract direct ActiveFedora calls to adapter
Why a listener and not a transaction? In part because the moment I want to perform the conditional enqueuing is at the point where the `Hyrax::WorkUploadsHandler` does it's job. That is when we have: - the parent work - the file set - the original file - the user The `Hyrax::WorkUploadsHandler` is most analogous to the behavior in `Hyrax::Actors::FileSetActor#attach_to_work` and `Hyrax::Actors::FileSetActor#create_content`. Fortunately, Hyrax's transaction and upload handler remove the conditional handling we needed between uploading a remote file and directly uploading a file. Related to: - scientist-softserv/hykuup_knapsack#35 - scientist-softserv/hykuup_knapsack#99 - #312
Prior to this commit, each time we called `config_search_paths` we would append `IiifPrint::Engine.root` to the instances array. This mean that we could continue to prepend many times resulting in many entries of `IiifPrint::Engine.root` in the instance's array. With this change we avoid mutating the array in `super`.
* main: 🎁 Add listener for handling file set attachment
Fundamental assumption, based on the `double_combo` branch of Hyrax is that we will be able to use Valkyrie queries to Solr and Fedora for all objects in the repository. See samvera/hyrax#6221 (comment)
laritakr
approved these changes
Jan 22, 2024
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.
Other than the lint error, looks reasonable
The indexer logic fix is based on #319
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note: The baseline logic for IiifPrint does not change with this PR. We introduce a Valkyrie and ActiveFedora adapter and default to the ActiveFedora adapter, thus preserving prior implementation behavior.
Were someone to use the Valkyrie adapter, there would likely be bugs. But that would require someone configuring an as of yet undocumented feature.
All told, this is a non-breaking PR that is more of a refactor than a feature add.
🎁 Override
Hyku::WorksControllerBehavior
cad2cf3
This commit will account for a proposed
Hyku::WorksControllerBehavior
in the Hyku/Hyrax 5 upgrade branch.
🚧 WIP to work with Valkyrie objects
cc105d0
Changed the #iiif_print_config? to a class_attribute so we don't have to
instantiate the object to check if it's configured. Added a next to the
indexer so if a curation concern does not have IIIF Print configured,
then we won't index the SetChildFlag onto it.
♻️ Favor explicit method over class attribute
f0d50f2
The
class_attribute
best serves cases where we might adjustconfiguration at run-time or during initialization. In the case of of
the class method I am removing, it's subtly different than the ideal use
case for
class_attribute
.The difference is such:
We include the configuration module into a model; this is the run time
configuration. And because we've "configured IIIF Print" for that
model, we always will have a
.iiif_print_config?
of true.🧹 Add indexing paths for Valkyrie resource
5ab4c2a
This commit will add indexing paths for Valkyrie resources. The
IiifPrint::SimpleSchemaLoaderDecorator
is introduced here to add theIiifPrint::Engine.root
path to the schema load path so we can keep theyaml in the gem and not have to copy it over to the host app.
Remove instance variable declaration
8066b7e
This is not necessary and will keep an instance around
in memory for longer than we need
🎁 Add listener for handling file set attachment
e21cd78
Why a listener and not a transaction? In part because the moment I want
to perform the conditional enqueuing is at the point where the
Hyrax::WorkUploadsHandler
does it's job. That is when we have:The
Hyrax::WorkUploadsHandler
is most analogous to the behavior inHyrax::Actors::FileSetActor#attach_to_work
andHyrax::Actors::FileSetActor#create_content
. Fortunately, Hyrax'stransaction and upload handler remove the conditional handling we needed
between uploading a remote file and directly uploading a file.
Related to:
🧹 Avoid mutating super's array
321613e
Prior to this commit, each time we called
config_search_paths
we wouldappend
IiifPrint::Engine.root
to the instances array. This mean thatwe could continue to prepend many times resulting in many entries of
IiifPrint::Engine.root
in the instance's array.With this change we avoid mutating the array in
super
.Move towards adapter logic
ff11975
🧹 Switch fetching objects based on persistence layer
7cde6af
Fundamental assumption, based on the
double_combo
branch of Hyrax isthat we will be able to use Valkyrie queries to Solr and Fedora for all
objects in the repository.
See samvera/hyrax#6221 (comment)
♻️ Restore decoration based on work types
fc96714
Adding safe constantize to handle new-ish object that we decorate
48053b4