scientist-softserv / iiif_print

A gem for Hyrax/Samvera for displaying PDF pages in a IIIF Compliant viewer
Apache License 2.0
4 stars 1 forks source link

I350 valkyrie derivatives #351

Closed laritakr closed 4 months ago

laritakr commented 4 months ago

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 e476998ab453afabf1bcb8afa059b4416af9b705. 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](https://github.com/scientist-softserv/iiif_print/assets/17851674/3ab95313-7f53-4fcf-b1c0-5f64094feb78)

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 # 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' ```