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

I350 valkyrie derivatives #351

Merged
merged 1 commit into from
May 16, 2024
Merged

I350 valkyrie derivatives #351

merged 1 commit into from
May 16, 2024

Conversation

laritakr
Copy link
Contributor

@laritakr laritakr commented May 9, 2024

Story

This pull request updates IiifPrint to support Valkyrie.

At present, this is a breaking change for ActiveFedora (see notes below), per testing on a pre-valkyrized application (palni-palci). Attempts were made to prevent a breaking change by using adapters, but at this point it is not working for ActiveFedora.

A IiifPrint 2.0.0 release should be cut based on this pull request.

A IiifPrint 1.1.0 release should probably be cut as well, based on e476998. Verson 1.0.0 is at 4d2bb72 and was released March 2023. This is the last known working ActiveFedora version.

Refs #350

Expected Behavior Before Changes

IiifPrint only supports ActiveFedora derivatives.

Expected Behavior After Changes

IiifPrint can be used in a Valkyrized application.
PDF splits into child works.
Derivatives will show in the dropdown menu based on changes to Hyrax::FileSet model.

Screenshots / Video

From Valkyrized App

Screenshot 2024-05-16 at 1 10 53 PM

Notes

See corresponding branches in Hyrax and Hyku

Note: This is a breaking change... It provides support for the valkyrized Hyku & Hyrax but does not work for ActiveFedora apps. Retrofitting for ActiveFedora may be an option at a later point.

Backtrace with AF in Pals app
2024-05-16T15:56:49.092Z pid=85 tid=95rl class=CharacterizeJob jid=8696d9c48d5eb399163eca27 elapsed=15.892 INFO: fail
2024-05-16T15:56:49.093Z pid=85 tid=95rl WARN: {"context":"Job raised exception","job":{"retry":true,"queue":"default","class":"ActiveJob::QueueAdapters::SidekiqAdapter::JobWrapper","wrapped":"CharacterizeJob","args":[{"job_class":"CharacterizeJob","job_id":"1d4b316b-4a5f-478a-98e6-d0146d493781","provider_job_id":null,"queue_name":"default","priority":null,"arguments":[{"_aj_globalid":"gid://hyku/FileSet/bc85a2a3-1823-45fe-9483-af4dd7da7a9e"},"bc85a2a3-1823-45fe-9483-af4dd7da7a9e/files/705f4847-cb97-4c17-9570-e54131dcd225","/app/samvera/hyrax-webapp/public/uploads/9dcd81c5-8cc2-4a19-9765-714c1a1f220d/hyrax/uploaded_file/file/1/cat_scan.pdf"],"executions":0,"locale":"en","tenant":"9dcd81c5-8cc2-4a19-9765-714c1a1f220d"}],"jid":"8696d9c48d5eb399163eca27","created_at":1715874993.1984303,"enqueued_at":1715874993.1985812}}
2024-05-16T15:56:49.093Z pid=85 tid=95rl WARN: NoMethodError: undefined method `pdf?' for #<Hydra::PCDM::File:0x0000ffff9d52c3d8>
2024-05-16T15:56:49.093Z pid=85 tid=95rl WARN: /usr/local/bundle/gems/activemodel-5.2.8.1/lib/active_model/attribute_methods.rb:430:in `method_missing'
/app/samvera/hyrax-webapp/vendor/apps/iiif_print/app/listeners/iiif_print/listener.rb:18:in `on_file_characterized'
/usr/local/bundle/gems/dry-events-0.2.0/lib/dry/events/bus.rb:44:in `call'
/usr/local/bundle/gems/dry-events-0.2.0/lib/dry/events/bus.rb:44:in `block in publish'
/usr/local/bundle/gems/dry-events-0.2.0/lib/dry/events/bus.rb:36:in `block in process'
/usr/local/bundle/gems/dry-events-0.2.0/lib/dry/events/bus.rb:32:in `each'
/usr/local/bundle/gems/dry-events-0.2.0/lib/dry/events/bus.rb:32:in `process'
/usr/local/bundle/gems/dry-events-0.2.0/lib/dry/events/bus.rb:43:in `publish'
/usr/local/bundle/gems/dry-events-0.2.0/lib/dry/events/publisher.rb:190:in `publish'
/usr/local/bundle/bundler/gems/hyrax-285982850cd9/app/jobs/characterize_job.rb:35:in `perform'
/usr/local/bundle/gems/activejob-5.2.8.1/lib/active_job/execution.rb:39:in `block in perform_now'
/usr/local/bundle/gems/activesupport-5.2.8.1/lib/active_support/callbacks.rb:109:in `block in run_callbacks'
/usr/local/bundle/gems/sentry-raven-2.13.0/lib/raven/integrations/rails/active_job.rb:13:in `block (2 levels) in included'
/usr/local/bundle/gems/activesupport-5.2.8.1/lib/active_support/callbacks.rb:118:in `instance_exec'
/usr/local/bundle/gems/activesupport-5.2.8.1/lib/active_support/callbacks.rb:118:in `block in run_callbacks'

Creates Hyrax::FileMetadata objects for all valkyrie derivatives.
Access Valkyrie derivatives via Hyrax methods, rather than through the duplicated derivative logic in IiifPrint.

Note: does not address remote_url logic... this is not yet valkyrized.
@laritakr laritakr marked this pull request as ready for review May 14, 2024 20:59
@laritakr laritakr changed the title WIP I350 valkyrie derivatives I350 valkyrie derivatives May 14, 2024
@@ -35,7 +35,7 @@ def find_checksum(object)
return unless file

digest ||= if file.is_a?(Hyrax::FileMetadata)
file.checksum
Array.wrap(file.checksum).first
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checksum doesn't seem to work, but it seemed to be an array sometimes and a string others, so I chose to use Array.wrap for consistency.

@laritakr laritakr merged commit 830a9af into main May 16, 2024
11 checks passed
@laritakr laritakr deleted the i350-valkyrie-derivatives branch May 16, 2024 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants