iiif_print 2.0.1 → 3.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +96 -102
  3. data/app/actors/iiif_print/actors/cleanup_file_sets_actor_decorator.rb +1 -0
  4. data/app/actors/iiif_print/actors/file_set_actor_decorator.rb +1 -0
  5. data/app/helpers/iiif_print/iiif_helper_decorator.rb +1 -0
  6. data/app/indexers/concerns/iiif_print/child_work_indexer_decorator.rb +45 -0
  7. data/app/indexers/concerns/iiif_print/{file_set_indexer.rb → file_set_indexer_decorator.rb} +15 -1
  8. data/app/jobs/iiif_print/jobs/child_works_from_pdf_job.rb +8 -2
  9. data/app/listeners/iiif_print/listener.rb +1 -1
  10. data/app/models/concerns/iiif_print/solr_document_decorator.rb +47 -0
  11. data/app/models/iiif_print/iiif_search_decorator.rb +1 -0
  12. data/app/models/iiif_print/iiif_search_response_decorator.rb +1 -0
  13. data/app/presenters/iiif_print/file_set_presenter_decorator.rb +1 -0
  14. data/app/presenters/iiif_print/{iiif_manifest_presenter_behavior.rb → iiif_manifest_presenter/display_image_presenter_decorator.rb} +4 -32
  15. data/app/presenters/iiif_print/iiif_manifest_presenter_decorator.rb +35 -0
  16. data/app/presenters/iiif_print/{iiif_manifest_presenter_factory_behavior.rb → iiif_manifest_presenter_factory_decorator.rb} +2 -1
  17. data/app/renderers/hyrax/renderers/faceted_attribute_renderer_decorator.rb +1 -0
  18. data/app/services/iiif_print/derivative_rodeo_service.rb +1 -1
  19. data/app/services/iiif_print/{manifest_builder_service_behavior.rb → manifest_builder_service_decorator.rb} +2 -1
  20. data/app/services/iiif_print/simple_schema_loader_decorator.rb +1 -0
  21. data/app/transactions/hyrax/transactions/steps/delete_all_file_sets_decorator.rb +2 -0
  22. data/config/metadata/child_works_from_pdf_splitting.yaml +6 -0
  23. data/lib/iiif_print/base_derivative_service.rb +1 -1
  24. data/lib/iiif_print/blacklight_iiif_search/annotation_decorator.rb +1 -0
  25. data/lib/iiif_print/configuration.rb +1 -1
  26. data/lib/iiif_print/data/fileset_helper.rb +1 -1
  27. data/lib/iiif_print/engine.rb +9 -52
  28. data/lib/iiif_print/text_extraction_derivative_service.rb +4 -1
  29. data/lib/iiif_print/version.rb +1 -1
  30. data/lib/iiif_print/works_controller_behavior_decorator.rb +13 -0
  31. data/lib/iiif_print.rb +0 -2
  32. metadata +11 -11
  33. data/app/indexers/concerns/iiif_print/child_work_indexer.rb +0 -27
  34. data/app/models/concerns/iiif_print/solr/document.rb +0 -63
  35. data/config/initializers/simple_schema_loader.rb +0 -1
  36. data/lib/iiif_print/works_controller_behavior.rb +0 -9
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 494bfcd0e3f6c84a7b6d81ae45aea07c5a6259a7d692e079bb24ea29f6908442
4
- data.tar.gz: fb266b5b22d36bc3cd2e99697f82dab7093912e84957a71e28c84aaef657157b
3
+ metadata.gz: 42aafdbd6969538637551e48a96a176cc928b2e9e1a4df887b1cb79e4864a6a0
4
+ data.tar.gz: afbefd582dd694b4168481c2bdbc1d7b3f7866529266433188b3eaa1bf4d6f79
5
5
  SHA512:
6
- metadata.gz: e48dff9d57b8043d804096e923afe4e21609e7f1ae067e84e1afc895bfd38781f532c036ac513316d517675c45d74f6e4c014e25b578aa3b0074371cdb7fffc8
7
- data.tar.gz: 70d83ecf95e10f177c976c2e241be8f613084ac7e360a946edb1dd3919a19140f36ac2c6abe085f5a12bdc62d2ae565bacab3dfd1c64f1645213c5484f46bbe8
6
+ metadata.gz: 21c03a9ad7de46c271b8296bc65636d02d2b66fa4881c3eb9f669211300c563e40dc2ec3483b0d04d62f2546346f32fbd417577dc64336479b6ed2f049da8305
7
+ data.tar.gz: 7be1097dea227d4ac82b27fbe31cd5553c46fdc376541afea62023d0adda2b18f2ca74b346da8add4b7e50d78bc8b37c525d0ce3bd52acb118c58b59631893af
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
- remote: /app/samvera/hyrax-webapp
2
+ remote: .
3
3
  specs:
4
- iiif_print (1.0.0)
4
+ iiif_print (3.0.1)
5
5
  blacklight_iiif_search (>= 1.0, < 3.0)
6
6
  derivative-rodeo (~> 0.5)
7
7
  hyrax (>= 2.5, < 6)
@@ -65,7 +65,7 @@ GEM
65
65
  activemodel (= 5.2.8.1)
66
66
  activesupport (= 5.2.8.1)
67
67
  arel (>= 9.0)
68
- activerecord-import (1.5.1)
68
+ activerecord-import (1.7.0)
69
69
  activerecord (>= 4.2)
70
70
  activestorage (5.2.8.1)
71
71
  actionpack (= 5.2.8.1)
@@ -76,8 +76,8 @@ GEM
76
76
  i18n (>= 0.7, < 2)
77
77
  minitest (~> 5.1)
78
78
  tzinfo (~> 1.1)
79
- addressable (2.8.5)
80
- public_suffix (>= 2.0.2, < 6.0)
79
+ addressable (2.8.7)
80
+ public_suffix (>= 2.0.2, < 7.0)
81
81
  almond-rails (0.3.0)
82
82
  rails (>= 4.2)
83
83
  arel (9.0.0)
@@ -87,33 +87,34 @@ GEM
87
87
  awesome_nested_set (3.6.0)
88
88
  activerecord (>= 4.0.0, < 7.2)
89
89
  aws-eventstream (1.3.0)
90
- aws-partitions (1.857.0)
91
- aws-sdk-core (3.188.0)
92
- aws-eventstream (~> 1, >= 1.0.2)
90
+ aws-partitions (1.951.0)
91
+ aws-sdk-core (3.201.0)
92
+ aws-eventstream (~> 1, >= 1.3.0)
93
93
  aws-partitions (~> 1, >= 1.651.0)
94
- aws-sigv4 (~> 1.5)
94
+ aws-sigv4 (~> 1.8)
95
95
  jmespath (~> 1, >= 1.6.1)
96
- aws-sdk-kms (1.73.0)
97
- aws-sdk-core (~> 3, >= 3.188.0)
98
- aws-sigv4 (~> 1.1)
99
- aws-sdk-s3 (1.140.0)
100
- aws-sdk-core (~> 3, >= 3.188.0)
96
+ aws-sdk-kms (1.88.0)
97
+ aws-sdk-core (~> 3, >= 3.201.0)
98
+ aws-sigv4 (~> 1.5)
99
+ aws-sdk-s3 (1.156.0)
100
+ aws-sdk-core (~> 3, >= 3.201.0)
101
101
  aws-sdk-kms (~> 1)
102
- aws-sigv4 (~> 1.6)
103
- aws-sdk-sqs (1.68.0)
104
- aws-sdk-core (~> 3, >= 3.188.0)
105
- aws-sigv4 (~> 1.1)
106
- aws-sigv4 (1.7.0)
102
+ aws-sigv4 (~> 1.5)
103
+ aws-sdk-sqs (1.80.0)
104
+ aws-sdk-core (~> 3, >= 3.201.0)
105
+ aws-sigv4 (~> 1.5)
106
+ aws-sigv4 (1.8.0)
107
107
  aws-eventstream (~> 1, >= 1.0.2)
108
108
  babel-source (5.8.35)
109
109
  babel-transpiler (0.7.0)
110
110
  babel-source (>= 4.0, < 6)
111
111
  execjs (~> 2.0)
112
112
  backport (1.2.0)
113
+ base64 (0.2.0)
113
114
  bcp47 (0.3.3)
114
115
  i18n
115
- bcrypt (3.1.20)
116
116
  benchmark (0.3.0)
117
+ bigdecimal (3.1.8)
117
118
  bindex (0.8.1)
118
119
  bixby (5.0.2)
119
120
  rubocop (= 1.28.2)
@@ -158,7 +159,7 @@ GEM
158
159
  ruby-box
159
160
  signet (~> 0.8)
160
161
  typhoeus
161
- builder (3.2.4)
162
+ builder (3.3.0)
162
163
  byebug (11.1.3)
163
164
  cancancan (1.17.0)
164
165
  carrierwave (1.3.4)
@@ -174,7 +175,7 @@ GEM
174
175
  coffee-script-source
175
176
  execjs
176
177
  coffee-script-source (1.12.2)
177
- concurrent-ruby (1.2.2)
178
+ concurrent-ruby (1.3.3)
178
179
  connection_pool (2.4.1)
179
180
  coveralls (0.8.23)
180
181
  json (>= 1.8, < 3)
@@ -183,6 +184,7 @@ GEM
183
184
  thor (>= 0.19.4, < 2.0)
184
185
  tins (~> 1.6)
185
186
  crass (1.0.6)
187
+ csv (3.3.0)
186
188
  database_cleaner (1.99.0)
187
189
  date (3.3.4)
188
190
  declarative (0.0.20)
@@ -191,7 +193,7 @@ GEM
191
193
  declarative-option (0.1.0)
192
194
  deprecation (1.1.0)
193
195
  activesupport
194
- derivative-rodeo (0.5.2)
196
+ derivative-rodeo (0.5.3)
195
197
  activesupport (>= 5)
196
198
  aws-sdk-s3
197
199
  aws-sdk-sqs
@@ -200,14 +202,6 @@ GEM
200
202
  mime-types
201
203
  mini_magick
202
204
  nokogiri
203
- devise (4.9.3)
204
- bcrypt (~> 3.0)
205
- orm_adapter (~> 0.1)
206
- railties (>= 4.1.0)
207
- responders
208
- warden (~> 1.2.3)
209
- devise-guests (0.8.2)
210
- devise
211
205
  diff-lcs (1.5.0)
212
206
  disposable (0.4.7)
213
207
  declarative (>= 0.0.9, < 1.0.0)
@@ -289,11 +283,11 @@ GEM
289
283
  scanf (~> 1.0)
290
284
  sxp (~> 1.2)
291
285
  unicode-types (~> 1.8)
292
- engine_cart (2.5.0)
286
+ engine_cart (2.6.0)
293
287
  rails (>= 5.0)
294
288
  equivalent-xml (0.6.0)
295
289
  nokogiri (>= 1.4.3)
296
- erubi (1.12.0)
290
+ erubi (1.13.0)
297
291
  ethon (0.16.0)
298
292
  ffi (>= 1.15.0)
299
293
  execjs (2.9.1)
@@ -305,7 +299,7 @@ GEM
305
299
  faraday
306
300
  fcrepo_wrapper (0.9.0)
307
301
  ruby-progressbar
308
- ffi (1.16.3)
302
+ ffi (1.17.0)
309
303
  flipflop (2.7.1)
310
304
  activesupport (>= 4.0)
311
305
  terminal-table (>= 1.8)
@@ -313,10 +307,12 @@ GEM
313
307
  jquery-rails
314
308
  font-awesome-rails (4.7.0.8)
315
309
  railties (>= 3.2, < 8.0)
316
- geocoder (1.8.2)
310
+ geocoder (1.8.3)
311
+ base64 (>= 0.1.0)
312
+ csv (>= 3.0.0)
317
313
  globalid (1.1.0)
318
314
  activesupport (>= 5.0)
319
- google-apis-core (0.11.2)
315
+ google-apis-core (0.11.3)
320
316
  addressable (~> 2.5, >= 2.5.1)
321
317
  googleauth (>= 0.16.2, < 2.a)
322
318
  httpclient (>= 2.8.1, < 3.a)
@@ -324,8 +320,7 @@ GEM
324
320
  representable (~> 3.0)
325
321
  retriable (>= 2.0, < 4.a)
326
322
  rexml
327
- webrick
328
- google-apis-drive_v3 (0.44.0)
323
+ google-apis-drive_v3 (0.46.0)
329
324
  google-apis-core (>= 0.11.0, < 2.a)
330
325
  googleauth (1.8.1)
331
326
  faraday (>= 0.17.3, < 3.a)
@@ -333,7 +328,7 @@ GEM
333
328
  multi_json (~> 1.11)
334
329
  os (>= 0.9, < 2.0)
335
330
  signet (>= 0.16, < 2.a)
336
- haml (6.2.3)
331
+ haml (6.3.0)
337
332
  temple (>= 0.8.2)
338
333
  thor
339
334
  tilt
@@ -341,7 +336,8 @@ GEM
341
336
  hiredis (0.6.3)
342
337
  htmlentities (4.3.4)
343
338
  http_logger (0.7.0)
344
- httparty (0.21.0)
339
+ httparty (0.22.0)
340
+ csv
345
341
  mini_mime (>= 1.0.0)
346
342
  multi_xml (>= 0.5.2)
347
343
  httpclient (2.8.3)
@@ -445,14 +441,14 @@ GEM
445
441
  signet
446
442
  tinymce-rails (~> 5.10)
447
443
  valkyrie (~> 2, >= 2.1.1)
448
- i18n (1.14.1)
444
+ i18n (1.14.5)
449
445
  concurrent-ruby (~> 1.0)
450
446
  ice_nine (0.11.2)
451
447
  iiif-presentation (1.1.0)
452
448
  activesupport (>= 3.2.18)
453
449
  faraday (>= 0.9)
454
450
  json
455
- iiif_manifest (1.3.1)
451
+ iiif_manifest (1.5.0)
456
452
  activesupport (>= 4)
457
453
  jaro_winkler (1.5.6)
458
454
  jbuilder (2.11.5)
@@ -470,7 +466,7 @@ GEM
470
466
  thor (>= 0.14, < 2.0)
471
467
  jquery-ui-rails (6.0.1)
472
468
  railties (>= 3.2.16)
473
- json (2.6.3)
469
+ json (2.7.2)
474
470
  json-canonicalization (0.3.1)
475
471
  json-ld (3.1.10)
476
472
  htmlentities (~> 4.3)
@@ -482,9 +478,10 @@ GEM
482
478
  json-ld-preloaded (3.1.6)
483
479
  json-ld (~> 3.1)
484
480
  rdf (~> 3.1)
485
- json-schema (4.1.1)
481
+ json-schema (4.3.0)
486
482
  addressable (>= 2.8)
487
- jwt (2.7.1)
483
+ jwt (2.8.2)
484
+ base64
488
485
  kaminari (1.2.2)
489
486
  activesupport (>= 4.1.0)
490
487
  kaminari-actionview (= 1.2.2)
@@ -566,40 +563,42 @@ GEM
566
563
  mailboxer (0.15.1)
567
564
  carrierwave (>= 0.5.8)
568
565
  rails (>= 5.0.0)
569
- marcel (1.0.2)
566
+ marcel (1.0.4)
570
567
  matrix (0.4.2)
571
568
  method_source (1.0.0)
572
- mime-types (3.5.1)
569
+ mime-types (3.5.2)
573
570
  mime-types-data (~> 3.2015)
574
- mime-types-data (3.2023.1003)
575
- mini_magick (4.12.0)
571
+ mime-types-data (3.2024.0702)
572
+ mini_magick (4.13.1)
576
573
  mini_mime (1.1.5)
577
- mini_portile2 (2.8.5)
578
- minitest (5.20.0)
574
+ mini_portile2 (2.8.7)
575
+ minitest (5.24.1)
576
+ mize (0.4.1)
577
+ protocol (~> 2.0)
579
578
  multi_json (1.15.0)
580
579
  multi_xml (0.6.0)
581
- multipart-post (2.3.0)
580
+ multipart-post (2.4.1)
582
581
  nest (3.2.0)
583
582
  redic
584
583
  net-http-persistent (4.0.2)
585
584
  connection_pool (~> 2.2)
586
- net-imap (0.4.6)
585
+ net-imap (0.4.14)
587
586
  date
588
587
  net-protocol
589
588
  net-pop (0.1.2)
590
589
  net-protocol
591
590
  net-protocol (0.2.2)
592
591
  timeout
593
- net-smtp (0.4.0)
592
+ net-smtp (0.5.0)
594
593
  net-protocol
595
594
  newspaper_works_fixtures (0.3.1)
596
595
  rails (~> 5.0)
597
- nio4r (2.6.1)
596
+ nio4r (2.7.3)
598
597
  noid (0.9.0)
599
598
  noid-rails (3.0.3)
600
599
  actionpack (>= 5.0.0, < 7)
601
600
  noid (~> 0.9)
602
- nokogiri (1.15.5)
601
+ nokogiri (1.15.6)
603
602
  mini_portile2 (~> 2.8.2)
604
603
  racc (~> 1.4)
605
604
  oauth (1.1.0)
@@ -616,17 +615,18 @@ GEM
616
615
  rack (>= 1.2, < 4)
617
616
  openseadragon (0.6.0)
618
617
  rails (> 3.2.0)
619
- orm_adapter (0.5.0)
620
618
  os (1.1.4)
621
- parallel (1.23.0)
622
- parser (3.2.2.4)
619
+ parallel (1.25.1)
620
+ parser (3.3.3.0)
623
621
  ast (~> 2.4.1)
624
622
  racc
625
623
  parslet (2.0.0)
626
624
  posix-spawn (0.3.15)
627
625
  power_converter (0.1.2)
626
+ protocol (2.0.0)
627
+ ruby_parser (~> 3.0)
628
628
  psych (3.3.4)
629
- public_suffix (5.0.4)
629
+ public_suffix (5.1.1)
630
630
  puma (3.12.6)
631
631
  qa (5.11.0)
632
632
  activerecord-import
@@ -637,8 +637,8 @@ GEM
637
637
  nokogiri (~> 1.6)
638
638
  rails (>= 5.0, < 7.2)
639
639
  rdf
640
- racc (1.7.3)
641
- rack (2.2.8)
640
+ racc (1.8.0)
641
+ rack (2.2.9)
642
642
  rack-test (2.1.0)
643
643
  rack (>= 1.3)
644
644
  rails (5.2.8.1)
@@ -676,9 +676,9 @@ GEM
676
676
  rake (>= 0.8.7)
677
677
  thor (>= 0.19.0, < 2.0)
678
678
  rainbow (3.1.1)
679
- rake (13.1.0)
679
+ rake (13.2.1)
680
680
  rb-fsevent (0.11.2)
681
- rb-inotify (0.10.1)
681
+ rb-inotify (0.11.1)
682
682
  ffi (~> 1.0)
683
683
  rdf (3.2.11)
684
684
  link_header (~> 0.0, >= 0.0.8)
@@ -754,35 +754,32 @@ GEM
754
754
  reform-rails (0.2.6)
755
755
  activemodel (>= 5.0)
756
756
  reform (>= 2.3.1, < 3.0.0)
757
- regexp_parser (2.8.2)
757
+ regexp_parser (2.9.2)
758
758
  representable (3.0.4)
759
759
  declarative (< 0.1.0)
760
760
  declarative-option (< 0.2.0)
761
761
  uber (< 0.2.0)
762
- request_store (1.5.1)
762
+ request_store (1.7.0)
763
763
  rack (>= 1.4)
764
- responders (3.1.1)
765
- actionpack (>= 5.2)
766
- railties (>= 5.2)
767
764
  retriable (3.1.2)
768
765
  reverse_markdown (2.1.1)
769
766
  nokogiri
770
767
  rexml (3.2.6)
771
- rsolr (2.5.0)
768
+ rsolr (2.6.0)
772
769
  builder (>= 2.1.2)
773
770
  faraday (>= 0.9, < 3, != 2.0.0)
774
- rspec-activemodel-mocks (1.1.0)
771
+ rspec-activemodel-mocks (1.2.0)
775
772
  activemodel (>= 3.0)
776
773
  activesupport (>= 3.0)
777
774
  rspec-mocks (>= 2.99, < 4.0)
778
- rspec-core (3.12.2)
779
- rspec-support (~> 3.12.0)
780
- rspec-expectations (3.12.3)
775
+ rspec-core (3.13.0)
776
+ rspec-support (~> 3.13.0)
777
+ rspec-expectations (3.13.1)
781
778
  diff-lcs (>= 1.2.0, < 2.0)
782
- rspec-support (~> 3.12.0)
783
- rspec-mocks (3.12.6)
779
+ rspec-support (~> 3.13.0)
780
+ rspec-mocks (3.13.1)
784
781
  diff-lcs (>= 1.2.0, < 2.0)
785
- rspec-support (~> 3.12.0)
782
+ rspec-support (~> 3.13.0)
786
783
  rspec-rails (5.1.2)
787
784
  actionpack (>= 5.2)
788
785
  activesupport (>= 5.2)
@@ -791,7 +788,7 @@ GEM
791
788
  rspec-expectations (~> 3.10)
792
789
  rspec-mocks (~> 3.10)
793
790
  rspec-support (~> 3.10)
794
- rspec-support (3.12.1)
791
+ rspec-support (3.13.1)
795
792
  rubocop (1.28.2)
796
793
  parallel (~> 1.10)
797
794
  parser (>= 3.1.0.0)
@@ -801,8 +798,8 @@ GEM
801
798
  rubocop-ast (>= 1.17.0, < 2.0)
802
799
  ruby-progressbar (~> 1.7)
803
800
  unicode-display_width (>= 1.4.0, < 3.0)
804
- rubocop-ast (1.30.0)
805
- parser (>= 3.2.1.0)
801
+ rubocop-ast (1.31.3)
802
+ parser (>= 3.3.1.0)
806
803
  rubocop-performance (1.19.1)
807
804
  rubocop (>= 1.7.0, < 2.0)
808
805
  rubocop-ast (>= 0.4.0)
@@ -819,6 +816,9 @@ GEM
819
816
  oauth2
820
817
  ruby-progressbar (1.13.0)
821
818
  ruby2_keywords (0.0.5)
819
+ ruby_parser (3.21.0)
820
+ racc (~> 1.5)
821
+ sexp_processor (~> 4.16)
822
822
  rubyzip (2.3.2)
823
823
  samvera-nesting_indexer (2.0.0)
824
824
  dry-equalizer
@@ -837,6 +837,7 @@ GEM
837
837
  ffi (~> 1.9)
838
838
  scanf (1.0.0)
839
839
  select2-rails (3.5.11)
840
+ sexp_processor (4.17.1)
840
841
  shacl (0.1.1)
841
842
  json-ld (~> 3.1, >= 3.1.7)
842
843
  rdf (~> 3.1, >= 3.1.8)
@@ -853,12 +854,12 @@ GEM
853
854
  sxp (~> 1.1)
854
855
  shoulda-matchers (3.1.3)
855
856
  activesupport (>= 4.0.0)
856
- signet (0.18.0)
857
+ signet (0.19.0)
857
858
  addressable (~> 2.8)
858
859
  faraday (>= 0.17.5, < 3.a)
859
860
  jwt (>= 1.5, < 3.0)
860
861
  multi_json (~> 1.10)
861
- simple_form (5.3.0)
862
+ simple_form (5.3.1)
862
863
  actionpack (>= 5.2)
863
864
  activemodel (>= 5.2)
864
865
  simplecov (0.16.1)
@@ -902,7 +903,8 @@ GEM
902
903
  sparql-client (3.2.2)
903
904
  net-http-persistent (~> 4.0, >= 4.0.2)
904
905
  rdf (~> 3.2, >= 3.2.11)
905
- sprockets (3.7.2)
906
+ sprockets (3.7.3)
907
+ base64
906
908
  concurrent-ruby (~> 1.0)
907
909
  rack (> 1, < 3)
908
910
  sprockets-es6 (0.9.2)
@@ -913,7 +915,7 @@ GEM
913
915
  actionpack (>= 5.2)
914
916
  activesupport (>= 5.2)
915
917
  sprockets (>= 3.0.0)
916
- sqlite3 (1.7.2)
918
+ sqlite3 (1.7.3)
917
919
  mini_portile2 (~> 2.8.0)
918
920
  ssrf_filter (1.0.8)
919
921
  sxp (1.2.4)
@@ -921,15 +923,17 @@ GEM
921
923
  rdf (~> 3.2)
922
924
  sync (0.5.0)
923
925
  temple (0.10.3)
924
- term-ansicolor (1.7.1)
926
+ term-ansicolor (1.10.2)
927
+ mize
925
928
  tins (~> 1.0)
926
929
  terminal-table (3.0.2)
927
930
  unicode-display_width (>= 1.1.1, < 3)
928
- thor (1.3.0)
931
+ thor (1.3.1)
929
932
  thread_safe (0.3.6)
930
- tilt (2.3.0)
933
+ tilt (2.4.0)
931
934
  timeout (0.4.1)
932
- tins (1.32.1)
935
+ tins (1.33.0)
936
+ bigdecimal
933
937
  sync
934
938
  tinymce-rails (5.10.9)
935
939
  railties (>= 3.1.1)
@@ -964,55 +968,45 @@ GEM
964
968
  rdf-vocab
965
969
  reform (~> 2.2)
966
970
  reform-rails
967
- version_gem (1.1.3)
968
- warden (1.2.9)
969
- rack (>= 2.0.9)
971
+ version_gem (1.1.4)
970
972
  web-console (3.7.0)
971
973
  actionview (>= 5.0)
972
974
  activemodel (>= 5.0)
973
975
  bindex (>= 0.4.0)
974
976
  railties (>= 5.0)
975
- webrick (1.8.1)
976
977
  websocket-driver (0.7.6)
977
978
  websocket-extensions (>= 0.1.0)
978
979
  websocket-extensions (0.1.5)
979
980
  yard (0.9.34)
980
- zeitwerk (2.6.12)
981
+ zeitwerk (2.6.16)
981
982
 
982
983
  PLATFORMS
983
984
  ruby
984
985
 
985
986
  DEPENDENCIES
986
987
  bixby
987
- bootstrap-sass (~> 3.0)
988
988
  byebug
989
989
  coffee-rails (~> 4.2)
990
990
  coveralls
991
991
  database_cleaner (~> 1.3)
992
- devise
993
- devise-guests (~> 0.6)
994
992
  engine_cart (~> 2.2)
995
993
  factory_bot (~> 4.4)
996
- fcrepo_wrapper
994
+ fcrepo_wrapper (~> 0.5, >= 0.5.1)
997
995
  iiif_print!
998
996
  jbuilder (~> 2.5)
999
- jquery-rails
1000
997
  json-canonicalization (= 0.3.1)
1001
998
  newspaper_works_fixtures (~> 0.3, >= 0.3.1)
1002
999
  puma (~> 3.11)
1003
1000
  rails (~> 5.2.8, >= 5.2.8.1)
1004
1001
  rails-controller-testing (~> 1)
1005
- redis (= 4.8.1)
1006
- rsolr (>= 1.0, < 3)
1007
1002
  rspec-activemodel-mocks
1008
1003
  rspec-rails
1009
1004
  sass-rails (~> 5.0)
1010
1005
  shoulda-matchers (~> 3.1)
1011
1006
  solargraph
1012
- solr_wrapper (>= 0.3)
1007
+ solr_wrapper (>= 1.1, < 3.0)
1013
1008
  sqlite3
1014
1009
  turbolinks (~> 5)
1015
- twitter-typeahead-rails (= 0.11.1.pre.corejavascript)
1016
1010
  tzinfo-data
1017
1011
  uglifier (>= 1.3.0)
1018
1012
  web-console (>= 3.3.0)
@@ -22,3 +22,4 @@ module IiifPrint
22
22
  end
23
23
  end
24
24
  end
25
+ Hyrax::Actors::CleanupFileSetsActor.prepend(IiifPrint::Actors::CleanupFileSetsActorDecorator)
@@ -56,3 +56,4 @@ module IiifPrint
56
56
  end
57
57
  end
58
58
  end
59
+ Hyrax::Actors::FileSetActor.prepend(IiifPrint::Actors::FileSetActorDecorator)
@@ -30,3 +30,4 @@ module IiifPrint
30
30
  end
31
31
  end
32
32
  end
33
+ Hyrax::IiifHelper.prepend(IiifPrint::IiifHelperDecorator)
@@ -0,0 +1,45 @@
1
+ # frozen_string_literal: true
2
+
3
+ module IiifPrint
4
+ module ChildWorkIndexerDecorator
5
+ def to_solr
6
+ super.tap do |index_document|
7
+ index_solr_doc(index_document)
8
+ end
9
+ end
10
+
11
+ def generate_solr_document
12
+ super.tap do |solr_doc|
13
+ index_solr_doc(solr_doc)
14
+ end
15
+ end
16
+
17
+ private
18
+
19
+ def index_solr_doc(solr_doc)
20
+ object ||= @object || resource
21
+ solr_doc['is_child_bsi'] ||= object.try(:is_child)
22
+ solr_doc['split_from_pdf_id_ssi'] ||= object.try(:split_from_pdf_id)
23
+ solr_doc['is_page_of_ssim'] = iiif_print_lineage_service.ancestor_ids_for(object)
24
+ solr_doc['member_ids_ssim'] = iiif_print_lineage_service.descendent_member_ids_for(object)
25
+ end
26
+ end
27
+ end
28
+
29
+ if ActiveModel::Type::Boolean.new.cast(ENV.fetch('HYRAX_VALKYRIE', false))
30
+ # Newer versions of Hyrax favor `Hyrax::Indexers::PcdmObjectIndexer` and deprecate
31
+ # `Hyrax::ValkyrieWorkIndexer`
32
+ indexers = Hyrax.config.curation_concerns.map do |concern|
33
+ "#{concern}ResourceIndexer".safe_constantize
34
+ end
35
+ indexers.each { |indexer| indexer.prepend(IiifPrint::ChildWorkIndexerDecorator) }
36
+
37
+ # Versions 3.0+ of Hyrax have `Hyrax::ValkyrieWorkIndexer` so we want to decorate that as
38
+ # well. We want to use the elsif construct because later on Hyrax::ValkyrieWorkIndexer
39
+ # inherits from Hyrax::Indexers::PcdmObjectIndexer and only implements:
40
+ # `def initialize(*args); super; end`
41
+ 'Hyrax::ValkyrieWorkIndexer'.safe_constantize&.prepend(IiifPrint::ChildWorkIndexerDecorator)
42
+ else
43
+ # The ActiveFedora::Base indexer for Works
44
+ Hyrax::WorkIndexer.prepend(IiifPrint::ChildWorkIndexerDecorator)
45
+ end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module IiifPrint
4
- module FileSetIndexer
4
+ module FileSetIndexerDecorator
5
5
  def to_solr
6
6
  super.tap do |index_document|
7
7
  index_solr_doc(index_document)
@@ -55,3 +55,17 @@ module IiifPrint
55
55
  end
56
56
  end
57
57
  end
58
+ if ActiveModel::Type::Boolean.new.cast(ENV.fetch('HYRAX_VALKYRIE', false))
59
+ # Newer versions of Hyrax favor `Hyrax::Indexers::FileSetIndexer` and deprecate
60
+ # `Hyrax::ValkyrieFileSetIndexer`.
61
+ 'Hyrax::Indexers::FileSetIndexer'.safe_constantize&.prepend(IiifPrint::FileSetIndexerDecorator)
62
+
63
+ # Versions 3.0+ of Hyrax have `Hyrax::ValkyrieFileSetIndexer` so we want to decorate that as
64
+ # well. We want to use the elsif construct because later on Hyrax::ValkyrieFileSetIndexer
65
+ # inherits from Hyrax::Indexers::FileSetIndexer and only implements:
66
+ # `def initialize(*args); super; end`
67
+ 'Hyrax::ValkyrieFileSetIndexer'.safe_constantize&.prepend(IiifPrint::FileSetIndexerDecorator)
68
+ else
69
+ # The ActiveFedora::Base indexer for FileSets
70
+ Hyrax::FileSetIndexer.prepend(IiifPrint::FileSetIndexerDecorator)
71
+ end
@@ -87,7 +87,7 @@ module IiifPrint
87
87
  )
88
88
  BatchCreateJob.perform_later(user,
89
89
  @child_work_titles,
90
- {},
90
+ @resource_types,
91
91
  @uploaded_files,
92
92
  attributes.merge!(model: child_model.to_s, split_from_pdf_id: @split_from_pdf_id).with_indifferent_access,
93
93
  operation)
@@ -99,6 +99,7 @@ module IiifPrint
99
99
  def prepare_import_data(original_pdf_path, image_files, user)
100
100
  @uploaded_files = []
101
101
  @child_work_titles = {}
102
+ @resource_types = {}
102
103
  number_of_pages_in_pdf = image_files.size
103
104
  image_files.each_with_index do |image_path, page_number|
104
105
  file_id = create_uploaded_file(user, image_path).to_s
@@ -111,6 +112,7 @@ module IiifPrint
111
112
  page_padding: number_of_digits(nbr: number_of_pages_in_pdf)
112
113
  )
113
114
 
115
+ @resource_types[file_id] = resource_types
114
116
  @uploaded_files << file_id
115
117
  @child_work_titles[file_id] = child_title
116
118
  # save child work info to create the member relationships
@@ -144,10 +146,14 @@ module IiifPrint
144
146
  uf.id
145
147
  end
146
148
 
147
- # TODO: what attributes do we need to fill in from the parent work? What about AllinsonFlex?
148
149
  def attributes
149
150
  IiifPrint.config.child_work_attributes_function.call(parent_work: @parent_work, admin_set_id: @child_admin_set_id)
150
151
  end
152
+
153
+ # TODO: Does this method need to be configurable?
154
+ def resource_types
155
+ @parent_work.try(:resource_type)
156
+ end
151
157
  end
152
158
  end
153
159
  end
@@ -15,7 +15,7 @@ module IiifPrint
15
15
  file_set = event[:file_set]
16
16
  return false unless file_set
17
17
  return false unless file_set.file_set?
18
- return false unless file_set.original_file.pdf?
18
+ return false unless file_set.original_file&.pdf?
19
19
 
20
20
  work = IiifPrint.parent_for(file_set)
21
21
  # A short-circuit to avoid fetching the underlying file.
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ module IiifPrint
4
+ module SolrDocumentDecorator
5
+ def digest_sha1
6
+ digest[/urn:sha1:([\w]+)/, 1]
7
+ end
8
+
9
+ def method_missing(method_name, *args, &block)
10
+ super unless iiif_print_solr_field_names.include? method_name.to_s
11
+ self[IiifPrint.solr_name(method_name.to_s)]
12
+ end
13
+
14
+ def respond_to_missing?(method_name, include_private = false)
15
+ iiif_print_solr_field_names.include?(method_name.to_s) || super
16
+ end
17
+
18
+ # @see https://github.com/samvera/hyrax/commit/7108409c619cd2ba4ae8c836b9f3b429a7e9837b
19
+ def file_set_ids
20
+ # Yes, this looks a little odd. But the truth is the prior key (e.g. `file_set_ids_ssim`) was
21
+ # an alias of `member_ids_ssim`.
22
+ self['member_ids_ssim']
23
+ end
24
+
25
+ def any_highlighting?
26
+ response&.[]('highlighting')&.[](id)&.present?
27
+ end
28
+
29
+ def solr_document
30
+ self
31
+ end
32
+ end
33
+ end
34
+
35
+ SolrDocument.prepend(IiifPrint::SolrDocumentDecorator)
36
+ SolrDocument.attribute :is_child, Hyrax::SolrDocument::Metadata::Solr::String, 'is_child_bsi'
37
+ SolrDocument.attribute :split_from_pdf_id, Hyrax::SolrDocument::Metadata::Solr::String, 'split_from_pdf_id_ssi'
38
+ SolrDocument.attribute :digest, Hyrax::SolrDocument::Metadata::Solr::String, 'digest_ssim'
39
+
40
+ # @note These properties came from the newspaper_works gem. They are configurable.
41
+ SolrDocument.class_attribute :iiif_print_solr_field_names, default: %w[alternative_title genre
42
+ issn lccn oclcnum held_by text_direction
43
+ page_number section author photographer
44
+ volume issue_number geographic_coverage
45
+ extent publication_date height width
46
+ edition_number edition_name frequency preceded_by
47
+ succeeded_by]
@@ -33,3 +33,4 @@ module IiifPrint
33
33
  end
34
34
  end
35
35
  end
36
+ ::BlacklightIiifSearch::IiifSearch.prepend(IiifPrint::IiifSearchDecorator)
@@ -38,3 +38,4 @@ module IiifPrint
38
38
  end
39
39
  end
40
40
  end
41
+ ::BlacklightIiifSearch::IiifSearchResponse.prepend(IiifPrint::IiifSearchResponseDecorator)
@@ -9,3 +9,4 @@ module IiifPrint
9
9
  end
10
10
  end
11
11
  end
12
+ Hyrax::FileSetPresenter.prepend(IiifPrint::FileSetPresenterDecorator)
@@ -1,38 +1,9 @@
1
1
  # mixin to provide URL for IIIF Content Search service
2
2
  module IiifPrint
3
- module IiifManifestPresenterBehavior
4
- extend ActiveSupport::Concern
5
-
6
- # Extending the presenter to the base url which includes the protocol.
7
- # We need the base url to render the facet links and normalize the interface.
8
- attr_accessor :base_url
9
-
10
- def manifest_metadata
11
- # ensure we are using a SolrDocument
12
- @manifest_metadata ||= IiifPrint.manifest_metadata_from(work: model.solr_document, presenter: self)
13
- end
14
-
15
- def search_service
16
- Rails.application.routes.url_helpers.solr_document_iiif_search_url(id, host: hostname)
17
- end
18
-
19
- # OVERRIDE: Hyrax 3x, avoid nil returning to IIIF Manifest gem
20
- # @see https://github.com/samvera/iiif_manifest/blob/c408f90eba11bef908796c7236ba6bcf8d687acc/lib/iiif_manifest/v3/manifest_builder/record_property_builder.rb#L28
21
- ##
22
- # @return [Array<Hash{String => String}>]
23
- def sequence_rendering
24
- Array(try(:rendering_ids)).map do |file_set_id|
25
- rendering = file_set_presenters.find { |p| p.id == file_set_id }
26
- return [] unless rendering
27
-
28
- { '@id' => Hyrax::Engine.routes.url_helpers.download_url(rendering.id, host: hostname),
29
- 'format' => rendering.mime_type.presence || I18n.t("hyrax.manifest.unknown_mime_text"),
30
- 'label' => I18n.t("hyrax.manifest.download_text") + (rendering.label || '') }
31
- end.flatten
32
- end
33
-
3
+ module IiifManifestPresenter
34
4
  # OVERRIDE: Hyrax v3.x
35
- module DisplayImagePresenterBehavior
5
+ module DisplayImagePresenterDecorator
6
+ extend ActiveSupport::Concern
36
7
  # Extending the presenter to the base url which includes the protocol.
37
8
  # We need the base url to render the facet links and normalize the interface.
38
9
  attr_accessor :base_url
@@ -128,3 +99,4 @@ module IiifPrint
128
99
  end
129
100
  end
130
101
  end
102
+ Hyrax::IiifManifestPresenter::DisplayImagePresenter.prepend(IiifPrint::IiifManifestPresenter::DisplayImagePresenterDecorator)
@@ -0,0 +1,35 @@
1
+ # mixin to provide URL for IIIF Content Search service
2
+ module IiifPrint
3
+ module IiifManifestPresenterDecorator
4
+ extend ActiveSupport::Concern
5
+
6
+ # Extending the presenter to the base url which includes the protocol.
7
+ # We need the base url to render the facet links and normalize the interface.
8
+ attr_accessor :base_url
9
+
10
+ def manifest_metadata
11
+ # ensure we are using a SolrDocument
12
+ @manifest_metadata ||= IiifPrint.manifest_metadata_from(work: model.solr_document, presenter: self)
13
+ end
14
+
15
+ def search_service
16
+ Rails.application.routes.url_helpers.solr_document_iiif_search_url(id, host: hostname)
17
+ end
18
+
19
+ # OVERRIDE: Hyrax 3x, avoid nil returning to IIIF Manifest gem
20
+ # @see https://github.com/samvera/iiif_manifest/blob/c408f90eba11bef908796c7236ba6bcf8d687acc/lib/iiif_manifest/v3/manifest_builder/record_property_builder.rb#L28
21
+ ##
22
+ # @return [Array<Hash{String => String}>]
23
+ def sequence_rendering
24
+ Array(try(:rendering_ids)).map do |file_set_id|
25
+ rendering = file_set_presenters.find { |p| p.id == file_set_id }
26
+ return [] unless rendering
27
+
28
+ { '@id' => Hyrax::Engine.routes.url_helpers.download_url(rendering.id, host: hostname),
29
+ 'format' => rendering.mime_type.presence || I18n.t("hyrax.manifest.unknown_mime_text"),
30
+ 'label' => I18n.t("hyrax.manifest.download_text") + (rendering.label || '') }
31
+ end.flatten
32
+ end
33
+ end
34
+ end
35
+ Hyrax::IiifManifestPresenter.prepend(IiifPrint::IiifManifestPresenterDecorator)
@@ -1,5 +1,5 @@
1
1
  module IiifPrint
2
- module IiifManifestPresenterFactoryBehavior
2
+ module IiifManifestPresenterFactoryDecorator
3
3
  # This will override Hyrax::IiifManifestPresenter::Factory#build and introducing
4
4
  # the expected behavior:
5
5
  # - child work images show as canvases in the parent work manifest
@@ -31,3 +31,4 @@ module IiifPrint
31
31
  end
32
32
  end
33
33
  end
34
+ Hyrax::IiifManifestPresenter::Factory.prepend(IiifPrint::IiifManifestPresenterFactoryDecorator)
@@ -16,3 +16,4 @@ module Hyrax
16
16
  end
17
17
  end
18
18
  end
19
+ Hyrax::Renderers::FacetedAttributeRenderer.prepend(Hyrax::Renderers::FacetedAttributeRendererDecorator)
@@ -366,7 +366,7 @@ module IiifPrint
366
366
  else
367
367
  # TODO: This is the fedora URL representing the file we uploaded; is that adequate? Will we
368
368
  # have access to this file?
369
- file_set.original_file.uri.to_s
369
+ file_set.original_file&.uri&.to_s
370
370
  end
371
371
  end
372
372
 
@@ -1,6 +1,6 @@
1
1
  module IiifPrint
2
2
  # rubocop:disable Metrics/ModuleLength
3
- module ManifestBuilderServiceBehavior
3
+ module ManifestBuilderServiceDecorator
4
4
  def initialize(*args,
5
5
  version: IiifPrint.config.default_iiif_manifest_version,
6
6
  iiif_manifest_factory: iiif_manifest_factory_for(version),
@@ -154,3 +154,4 @@ module IiifPrint
154
154
  end
155
155
  # rubocop:enable Metrics/ClassLength
156
156
  end
157
+ Hyrax::ManifestBuilderService.prepend(IiifPrint::ManifestBuilderServiceDecorator)
@@ -9,3 +9,4 @@ module IiifPrint
9
9
  end
10
10
  end
11
11
  end
12
+ Hyrax::SimpleSchemaLoader.prepend(IiifPrint::SimpleSchemaLoaderDecorator)
@@ -33,3 +33,5 @@ module Hyrax
33
33
  end
34
34
  end
35
35
  end
36
+
37
+ "Hyrax::Transactions::Steps::DeleteAllFileSets".safe_constantize&.prepend(Hyrax::Transactions::Steps::DeleteAllFileSetsDecorator)
@@ -4,6 +4,11 @@ attributes:
4
4
  multiple: false
5
5
  index_keys:
6
6
  - "is_child_bsi"
7
+ form:
8
+ display: false
9
+ required: false
10
+ primary: false
11
+ multiple: false
7
12
  predicate: "http://id.loc.gov/vocabulary/identifiers/isChild"
8
13
  split_from_pdf_id:
9
14
  type: string
@@ -11,6 +16,7 @@ attributes:
11
16
  index_keys:
12
17
  - "split_from_pdf_id_ssi"
13
18
  form:
19
+ display: false
14
20
  required: false
15
21
  primary: false
16
22
  multiple: false
@@ -33,7 +33,7 @@ module IiifPrint
33
33
  # @TODO: verify if this works for ActiveFedora and if so, remove commented code.
34
34
  # If not, modify to use adapter.
35
35
  # file_set.class.image_mime_types.include?(file_set.mime_type)
36
- file_set.original_file.image?
36
+ file_set.original_file&.image?
37
37
  end
38
38
 
39
39
  def derivative_path_factory
@@ -134,3 +134,4 @@ module IiifPrint
134
134
  end
135
135
  end
136
136
  end
137
+ ::BlacklightIiifSearch::IiifSearchAnnotation.prepend(IiifPrint::BlacklightIiifSearch::AnnotationDecorator)
@@ -212,7 +212,7 @@ module IiifPrint
212
212
  visibility: 'lease',
213
213
  visibility_after_lease: lease.visibility_after_lease,
214
214
  visibility_during_lease: lease.visibility_during_lease,
215
- lease_release_date: lease.lease_release_date
215
+ lease_release_date: lease.lease_expiration_date
216
216
  }
217
217
  else
218
218
  visibility_params = { visibility: parent_work.visibility.to_s }
@@ -13,7 +13,7 @@ module IiifPrint
13
13
  def first_fileset
14
14
  # if context is fileset id (e.g. caller is view partial) string,
15
15
  # get the fileset from that id
16
- return FileSet.find(@work) if @work.is_a?(String)
16
+ return Hyrax.query_service.find_by(id: @work) if @work.is_a?(String)
17
17
  # if "work" context is a FileSet, not actual work, return it
18
18
  return @work if @work.is_a?(Hyrax::FileSet) || @work.is_a?(FileSet)
19
19
  # in most cases, get from work's members:
@@ -48,55 +48,18 @@ module IiifPrint
48
48
 
49
49
  Hyrax.publisher.subscribe(IiifPrint::Listener.new) if Hyrax.respond_to?(:publisher)
50
50
 
51
- Hyrax::IiifManifestPresenter.prepend(IiifPrint::IiifManifestPresenterBehavior)
52
- Hyrax::IiifManifestPresenter::Factory.prepend(IiifPrint::IiifManifestPresenterFactoryBehavior)
53
- Hyrax::ManifestBuilderService.prepend(IiifPrint::ManifestBuilderServiceBehavior)
54
- Hyrax::Renderers::FacetedAttributeRenderer.prepend(Hyrax::Renderers::FacetedAttributeRendererDecorator)
55
- Hyrax::WorksControllerBehavior.prepend(IiifPrint::WorksControllerBehaviorDecorator)
56
- "Hyrax::Transactions::Steps::DeleteAllFileSets".safe_constantize&.prepend(Hyrax::Transactions::Steps::DeleteAllFileSetsDecorator)
57
- # Hyku::WorksControllerBehavior was introduced in Hyku v6.0.0+. Yes we don't depend on Hyku,
58
- # but this allows us to do minimal Hyku antics with IiifPrint.
59
- 'Hyku::WorksControllerBehavior'.safe_constantize&.prepend(IiifPrint::WorksControllerBehaviorDecorator)
51
+ # Load locales early so decorators can use them during initialization
52
+ I18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.yml'),
53
+ IiifPrint::Engine.root.join('config', 'locales', '**', '*.yml')]
60
54
 
61
- Hyrax::FileSetPresenter.prepend(IiifPrint::FileSetPresenterDecorator)
62
- Hyrax::WorkShowPresenter.prepend(IiifPrint::WorkShowPresenterDecorator)
63
- Hyrax::IiifHelper.prepend(IiifPrint::IiifHelperDecorator)
64
-
65
- if ActiveModel::Type::Boolean.new.cast(ENV.fetch('HYRAX_VALKYRIE', false))
66
- # Newer versions of Hyrax favor `Hyrax::Indexers::FileSetIndexer` and deprecate
67
- # `Hyrax::ValkyrieFileSetIndexer`.
68
- 'Hyrax::Indexers::FileSetIndexer'.safe_constantize&.prepend(IiifPrint::FileSetIndexer)
69
-
70
- # Versions 3.0+ of Hyrax have `Hyrax::ValkyrieFileSetIndexer` so we want to decorate that as
71
- # well. We want to use the elsif construct because later on Hyrax::ValkyrieFileSetIndexer
72
- # inherits from Hyrax::Indexers::FileSetIndexer and only implements:
73
- # `def initialize(*args); super; end`
74
- 'Hyrax::ValkyrieFileSetIndexer'.safe_constantize&.prepend(IiifPrint::FileSetIndexer)
75
-
76
- # Newer versions of Hyrax favor `Hyrax::Indexers::PcdmObjectIndexer` and deprecate
77
- # `Hyrax::ValkyrieWorkIndexer`
78
- indexers = Hyrax.config.curation_concerns.map do |concern|
79
- "#{concern}ResourceIndexer".safe_constantize
80
- end
81
- indexers.each { |indexer| indexer.prepend(IiifPrint::ChildWorkIndexer) }
82
-
83
- # Versions 3.0+ of Hyrax have `Hyrax::ValkyrieWorkIndexer` so we want to decorate that as
84
- # well. We want to use the elsif construct because later on Hyrax::ValkyrieWorkIndexer
85
- # inherits from Hyrax::Indexers::PcdmObjectIndexer and only implements:
86
- # `def initialize(*args); super; end`
87
- 'Hyrax::ValkyrieWorkIndexer'.safe_constantize&.prepend(IiifPrint::ChildWorkIndexer)
88
- else
89
- # The ActiveFedora::Base indexer for FileSets
90
- Hyrax::FileSetIndexer.prepend(IiifPrint::FileSetIndexer)
91
- # The ActiveFedora::Base indexer for Works
92
- Hyrax::WorkIndexer.prepend(IiifPrint::ChildWorkIndexer)
55
+ # Allows us to use decorator files
56
+ Dir.glob(File.join(File.dirname(__FILE__), "../../app/**/*_decorator*.rb")).sort.each do |c|
57
+ Rails.configuration.cache_classes ? require(c) : load(c)
93
58
  end
94
59
 
95
- ::BlacklightIiifSearch::IiifSearchResponse.prepend(IiifPrint::IiifSearchResponseDecorator)
96
- ::BlacklightIiifSearch::IiifSearchAnnotation.prepend(IiifPrint::BlacklightIiifSearch::AnnotationDecorator)
97
- ::BlacklightIiifSearch::IiifSearch.prepend(IiifPrint::IiifSearchDecorator)
98
- Hyrax::Actors::FileSetActor.prepend(IiifPrint::Actors::FileSetActorDecorator)
99
- Hyrax::Actors::CleanupFileSetsActor.prepend(IiifPrint::Actors::CleanupFileSetsActorDecorator)
60
+ Dir.glob(File.join(File.dirname(__FILE__), "../../lib/**/*_decorator*.rb")).sort.each do |c|
61
+ Rails.configuration.cache_classes ? require(c) : load(c)
62
+ end
100
63
 
101
64
  Hyrax.config do |config|
102
65
  config.callback.set(:after_create_fileset) do |file_set, user|
@@ -104,12 +67,6 @@ module IiifPrint
104
67
  end
105
68
  end
106
69
  end
107
-
108
- config.after_initialize do
109
- IiifPrint::Solr::Document.decorate(SolrDocument)
110
- Hyrax::IiifManifestPresenter::DisplayImagePresenter
111
- .prepend(IiifPrint::IiifManifestPresenterBehavior::DisplayImagePresenterBehavior)
112
- end
113
70
  # rubocop:enable Metrics/BlockLength
114
71
  end
115
72
  end
@@ -28,7 +28,10 @@ module IiifPrint
28
28
 
29
29
  ocr_derivatives.each do |extension, method_name|
30
30
  path = prepare_path(extension.to_s)
31
- write(content: ocr.public_send(method_name), path: path, extension: extension)
31
+ content = ocr.public_send(method_name)
32
+ next if content.blank?
33
+
34
+ write(content: content, path: path, extension: extension)
32
35
  end
33
36
  end
34
37
 
@@ -1,3 +1,3 @@
1
1
  module IiifPrint
2
- VERSION = '2.0.1'.freeze
2
+ VERSION = '3.0.1'.freeze
3
3
  end
@@ -0,0 +1,13 @@
1
+ module IiifPrint
2
+ module WorksControllerBehaviorDecorator
3
+ # Extending the presenter to the base url which includes the protocol.
4
+ # We need the base url to render the facet links.
5
+ def iiif_manifest_presenter
6
+ super.tap { |i| i.base_url = request.base_url }
7
+ end
8
+ end
9
+ end
10
+ Hyrax::WorksControllerBehavior.prepend(IiifPrint::WorksControllerBehaviorDecorator)
11
+ # Hyku::WorksControllerBehavior was introduced in Hyku v6.0.0+. Yes we don't depend on Hyku,
12
+ # but this allows us to do minimal Hyku antics with IiifPrint.
13
+ 'Hyku::WorksControllerBehavior'.safe_constantize&.prepend(IiifPrint::WorksControllerBehaviorDecorator)
data/lib/iiif_print.rb CHANGED
@@ -13,8 +13,6 @@ require "iiif_print/text_formats_from_alto_service"
13
13
  require "iiif_print/tiff_derivative_service"
14
14
  require "iiif_print/lineage_service"
15
15
  require "iiif_print/metadata"
16
- require "iiif_print/works_controller_behavior"
17
- require "iiif_print/blacklight_iiif_search/annotation_decorator"
18
16
  require "iiif_print/split_pdfs/base_splitter"
19
17
  require "iiif_print/split_pdfs/child_work_creation_from_pdf_service"
20
18
  require "iiif_print/split_pdfs/derivative_rodeo_splitter"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iiif_print
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Upton
@@ -14,7 +14,7 @@ authors:
14
14
  autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
- date: 2024-06-13 00:00:00.000000000 Z
17
+ date: 2024-07-05 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: blacklight_iiif_search
@@ -363,8 +363,8 @@ files:
363
363
  - app/helpers/iiif_print/iiif_helper_decorator.rb
364
364
  - app/helpers/iiif_print/iiif_print_helper_behavior.rb
365
365
  - app/helpers/iiif_print_helper.rb
366
- - app/indexers/concerns/iiif_print/child_work_indexer.rb
367
- - app/indexers/concerns/iiif_print/file_set_indexer.rb
366
+ - app/indexers/concerns/iiif_print/child_work_indexer_decorator.rb
367
+ - app/indexers/concerns/iiif_print/file_set_indexer_decorator.rb
368
368
  - app/jobs/iiif_print/jobs/application_job.rb
369
369
  - app/jobs/iiif_print/jobs/child_works_from_pdf_job.rb
370
370
  - app/jobs/iiif_print/jobs/create_relationships_job.rb
@@ -372,7 +372,7 @@ files:
372
372
  - app/listeners/iiif_print/listener.rb
373
373
  - app/mailers/iiif_print/application_mailer.rb
374
374
  - app/models/concerns/iiif_print/set_child_flag.rb
375
- - app/models/concerns/iiif_print/solr/document.rb
375
+ - app/models/concerns/iiif_print/solr_document_decorator.rb
376
376
  - app/models/iiif_print/application_record.rb
377
377
  - app/models/iiif_print/derivative_attachment.rb
378
378
  - app/models/iiif_print/iiif_search_decorator.rb
@@ -380,15 +380,16 @@ files:
380
380
  - app/models/iiif_print/ingest_file_relation.rb
381
381
  - app/models/iiif_print/pending_relationship.rb
382
382
  - app/presenters/iiif_print/file_set_presenter_decorator.rb
383
- - app/presenters/iiif_print/iiif_manifest_presenter_behavior.rb
384
- - app/presenters/iiif_print/iiif_manifest_presenter_factory_behavior.rb
383
+ - app/presenters/iiif_print/iiif_manifest_presenter/display_image_presenter_decorator.rb
384
+ - app/presenters/iiif_print/iiif_manifest_presenter_decorator.rb
385
+ - app/presenters/iiif_print/iiif_manifest_presenter_factory_decorator.rb
385
386
  - app/presenters/iiif_print/work_show_presenter_decorator.rb
386
387
  - app/renderers/hyrax/renderers/faceted_attribute_renderer_decorator.rb
387
388
  - app/search_builders/concerns/iiif_print/allinson_flex_fields.rb
388
389
  - app/search_builders/concerns/iiif_print/exclude_models.rb
389
390
  - app/search_builders/concerns/iiif_print/highlight_search_params.rb
390
391
  - app/services/iiif_print/derivative_rodeo_service.rb
391
- - app/services/iiif_print/manifest_builder_service_behavior.rb
392
+ - app/services/iiif_print/manifest_builder_service_decorator.rb
392
393
  - app/services/iiif_print/pluggable_derivative_service.rb
393
394
  - app/services/iiif_print/simple_schema_loader_decorator.rb
394
395
  - app/transactions/hyrax/transactions/iiif_print_container_decorator.rb
@@ -401,7 +402,6 @@ files:
401
402
  - app/views/hyrax/file_sets/_show_actions.html.erb
402
403
  - config/fcrepo_wrapper_test.yml
403
404
  - config/initializers/assets.rb
404
- - config/initializers/simple_schema_loader.rb
405
405
  - config/locales/iiif_print.de.yml
406
406
  - config/locales/iiif_print.en.yml
407
407
  - config/locales/iiif_print.es.yml
@@ -483,7 +483,7 @@ files:
483
483
  - lib/iiif_print/text_formats_from_alto_service.rb
484
484
  - lib/iiif_print/tiff_derivative_service.rb
485
485
  - lib/iiif_print/version.rb
486
- - lib/iiif_print/works_controller_behavior.rb
486
+ - lib/iiif_print/works_controller_behavior_decorator.rb
487
487
  - lib/samvera/derivatives.rb
488
488
  - lib/samvera/derivatives/configuration.rb
489
489
  - lib/samvera/derivatives/hyrax.rb
@@ -510,7 +510,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
510
510
  - !ruby/object:Gem::Version
511
511
  version: '0'
512
512
  requirements: []
513
- rubygems_version: 3.2.3
513
+ rubygems_version: 3.1.6
514
514
  signing_key:
515
515
  specification_version: 4
516
516
  summary: IiifPrint is a gem (Rails "engine") for Hyrax-based digital repository applications
@@ -1,27 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module IiifPrint
4
- module ChildWorkIndexer
5
- def to_solr
6
- super.tap do |index_document|
7
- index_solr_doc(index_document)
8
- end
9
- end
10
-
11
- def generate_solr_document
12
- super.tap do |solr_doc|
13
- index_solr_doc(solr_doc)
14
- end
15
- end
16
-
17
- private
18
-
19
- def index_solr_doc(solr_doc)
20
- object ||= @object || resource
21
- solr_doc['is_child_bsi'] ||= object.try(:is_child)
22
- solr_doc['split_from_pdf_id_ssi'] ||= object.try(:split_from_pdf_id)
23
- solr_doc['is_page_of_ssim'] = iiif_print_lineage_service.ancestor_ids_for(object)
24
- solr_doc['member_ids_ssim'] = iiif_print_lineage_service.descendent_member_ids_for(object)
25
- end
26
- end
27
- end
@@ -1,63 +0,0 @@
1
- module IiifPrint::Solr::Document
2
- # @note Why decorate? We want to avoid including this module via generator. And the generator
3
- # previously did two things: 1) include `IiifPrint::Solr::Document` in `SolrDocument`; 2)
4
- # add the `attribute :is_child` field to the SolrDocument. We can't rely on `included do`
5
- # block to handle that.
6
- #
7
- # This method is responsible for configuring the SolrDocument for a Hyrax/Hyku application. It
8
- # does three things:
9
- #
10
- # 1. Adds instance methods to the SolrDocument (see implementation below)
11
- # 2. Adds the `is_child` attribute to the SolrDocument
12
- # 3. Adds a class attribute (e.g. `iiif_print_solr_field_names`) to allow further customization.
13
- #
14
- # @note These `iiif_print_solr_field_names` came from the newspaper_works implementation and are
15
- # carried forward without much consideration, except to say "Make it configurable!"
16
- #
17
- # @param base [Class<SolrDocument>]
18
- # @return [Class<SolrDocument>]
19
- def self.decorate(base)
20
- base.prepend(self)
21
- base.send(:attribute, :is_child, Hyrax::SolrDocument::Metadata::Solr::String, 'is_child_bsi')
22
- base.send(:attribute, :split_from_pdf_id, Hyrax::SolrDocument::Metadata::Solr::String, 'split_from_pdf_id_ssi')
23
- base.send(:attribute, :digest, Hyrax::SolrDocument::Metadata::Solr::String, 'digest_ssim')
24
-
25
- # @note These properties came from the newspaper_works gem. They are configurable.
26
- base.class_attribute :iiif_print_solr_field_names, default: %w[alternative_title genre
27
- issn lccn oclcnum held_by text_direction
28
- page_number section author photographer
29
- volume issue_number geographic_coverage
30
- extent publication_date height width
31
- edition_number edition_name frequency preceded_by
32
- succeeded_by]
33
- base
34
- end
35
-
36
- def digest_sha1
37
- digest[/urn:sha1:([\w]+)/, 1]
38
- end
39
-
40
- def method_missing(method_name, *args, &block)
41
- super unless iiif_print_solr_field_names.include? method_name.to_s
42
- self[IiifPrint.solr_name(method_name.to_s)]
43
- end
44
-
45
- def respond_to_missing?(method_name, include_private = false)
46
- iiif_print_solr_field_names.include?(method_name.to_s) || super
47
- end
48
-
49
- # @see https://github.com/samvera/hyrax/commit/7108409c619cd2ba4ae8c836b9f3b429a7e9837b
50
- def file_set_ids
51
- # Yes, this looks a little odd. But the truth is the prior key (e.g. `file_set_ids_ssim`) was
52
- # an alias of `member_ids_ssim`.
53
- self['member_ids_ssim']
54
- end
55
-
56
- def any_highlighting?
57
- response&.[]('highlighting')&.[](id)&.present?
58
- end
59
-
60
- def solr_document
61
- self
62
- end
63
- end
@@ -1 +0,0 @@
1
- "Hyrax::SimpleSchemaLoader".safe_constantize&.prepend(IiifPrint::SimpleSchemaLoaderDecorator)
@@ -1,9 +0,0 @@
1
- module IiifPrint
2
- module WorksControllerBehaviorDecorator
3
- # Extending the presenter to the base url which includes the protocol.
4
- # We need the base url to render the facet links.
5
- def iiif_manifest_presenter
6
- super.tap { |i| i.base_url = request.base_url }
7
- end
8
- end
9
- end