-
Notifications
You must be signed in to change notification settings - Fork 2
Installing, Developing, and Testing
- Note
- System Requirements
- Getting Started (New Installation)
Integrating newspaper_works in your Hyrax 2.5.x application.
Your Hyrax 2.5.x based application can extend and utilize newspaper_works
This software is still under development so the installation instructions here might not be up to date with the latest release. The instructions provide the necessary information to implement a test environment. Currently, these instructions are not intended to be used for deploying the application in a production environment.
Looking to quickly and easily deploy a NewspaperWorks development/test environment? Check out the NewspaperWorks vagrant box.
- For best results, we recommend running the application in Ubuntu 18.04 LTS.
- Ruby 2.5.5
- Rails 5.1.7
- OpenJDK 11
- Fedora Commons 4.73+
- Apache Solr 7.x
- Hyrax 2.5.x
- FITS 1.4.1
- Sidekiq (or another background-job processing framework like Resque or Sneakers)
- Redis
- poppler-utils (extract image metadata from PDFs)
- Ghostscript (extract images and text from PDFs)
- libopenjp2-tools (command-line tools for JP2 file read/write)
- ImageMagick (extract image metadata, create derivatives)
- Tesseract 3.x (OCR engine)
- libcurl3
- jetty9
-
Install Ruby (2.5.5), Rails (5.1.7), rbnev, database, etc.
- Ubuntu 18.04 LTS (recommended)
- Ubuntu 16.04 LTS
-
Install FITS (1.4.1 recommended)
-
Install the remaining dependencies using
apt-get
:
sudo apt-get install poppler-utils ghostscript imagemagick libopenjp2-tools libreoffice tesseract-ocr libcurl3 redis-server jetty9 wget
Instructions for installing Fedora Commons 4.x can be found here
Instructions for installing Apache Solr 7.x can be found here
-
Create a new Rails application using the Hyrax 2.5.x instructions.
-
Add the following to your application's Gemfile
gem 'newspaper_works'
-
Run
bundle install
-
Ensure that the
config/fedora.yml
andconfig/solr.yml
files are properly configured to reflect the environment variables. -
Run generators in the following sequence:
rails generate newspaper_works:generate
- Edit Hyrax initializer file
config/initializers/hyrax.rb
set the following attributes
config.work_requires_files = false
config.iiif_image_server = true
config.fits_path = /location/of/fits.sh
config.geonames_username = 'your geonames.org username'
-
Update the Hyrax production environment variable
vim config/environments/production.rb
set the following attributes
config.public_file_server.enabled = true
-
Start the Rails server
rails s
- In order to use some fields in forms, you will want to make sure you have a Geonames username, and configure that username in the
config.geonames_username
value inconfig/intitializers/hyrax.rb
of your app.
-
This will help fields such as "Place of Publication" provide autocomplete using the Geonames service/vocabulary.
-
NewspaperWorks requires that your application's
config/initializers/hyrax.rb
be edited to make uploads optional for (all) work types, by settingconfig.work_requires_files = false
. -
NewspaperWorks expects that your application's
config/initializers/hyrax.rb
be edited to enable a IIIF viewer, by settingconfig.iiif_image_server = true
. -
NewspaperWorks expects that your application's
config/initializers/hyrax.rb
be edited to set the FITS path, by settingconfig.fits_path = /location/of/fits.sh
-
NewspaperWorks expects that your application's
config/environments/production.rb
be edited to set file server to public, by settingconfig.public_file_server.enabled = true
-
NewspaperWorks overrides Hyrax's default
:after_create_fileset
event handler, in order to attach pre-existing derivatives in some ingest use cases. The file attachment adapters for NewspaperWorks use this callback to allow programmatic assignment of pre-existing derivative files before the primary file's file set has been created for a new work. The callback ensures that derivative files are attached, stored using Hyrax file/path naming conventions, once the file set has been created. Because the Hyrax callback registry only allows single subscribers to any event, application developers who overwrite this handler, or integrate other gems that do likewise, must take care to create a custom composition that ensures all work and queued jobs desired run after this object lifecycle event.
-
A custom vagrant setup has been created for users to develop and test the Newspapers_works application. Additional information about the vagrant setup can be found at the samvera-newspapers-vagrant project site.
A public instance of the NewspaperWorks gem is available for testing. Note the public site may not be running the latest release of the gem.