github samvera/hyrax v1.0.0
Hyrax 1.0.0

latest releases: v3.4.1, v3.4.0, v3.3.0...
6 years ago

This release provides a bridge from Sufia 7.3 to Hyrax.

Changes (in rough order)

Getting started

  • Upgrade to Rails 5.0.x
  • Replace the sufia gem with hyrax (1.0.0) in your application's Gemfile, and run bundle install
  • Make sure any tweaks made in the Sufia or CC initializer move over into the Hyrax initializer. To do this, copy the Hyrax 1.0.0 initializer to config/initializers/hyrax.rb, then update it to include changes you have made to your CurationConcerns & Sufia initializers (at which point you should be able to safely remove the old initializers)
  • Global search & replace Sufia and CurationConcerns to Hyrax, on file names, folder names, and file contents. Note that while it should be safe to replace 'sufia' with 'hyrax', 'Sufia' with 'Hyrax', and 'CurationConcerns' with 'Hyrax', it is not safe to automate replacement of 'curation_concerns' with 'hyrax'. Lean on version control here to make sure you don't make any changes that will cause problems later. You may find that this process causes some duplicate lines -- go through and remove those now.

Routes

  • Remove Hydra::BatchEdit.add_routes(self)
  • Remove curation_concerns_collections

Models

  • Create a database migration to rename the sufia_features table to hyrax_features
  • Install Hyrax's database migrations: rails hyrax:install:migrations (You may see a bunch of warnings here about Hyrax's migrations looking similar to Sufia's. That's to be expected.)
  • Create a new migration via rails g migration RemoveWorkflowNameFromPermissionTemplates. Make sure it includes the following method definition:
  def change
    remove_column :permission_templates, :workflow_name, :string
  end
  • Run rails db:migrate

Controllers

  • Remove include CurationConcerns::CurationConcernController from all controllers.
  • Ensure that self.curation_concern_type = YourWorkTypeHere comes after include Hyrax::WorksControllerBehavior in your work type controllers
  • Remove include Hyrax::Catalog from app/controllers/catalog_controller.rb
  • Change config.search_builder_class in app/controllers/catalog_controller.rb to equal Hyrax::CatalogSearchBuilder
  • Remove include Hyrax::ApplicationControllerBehavior from app/controllers/application_controller.rb
  • Remove app/controllers/hyrax/admin_controller.rb since the AdminControllerBehavior no longer exists

Views

If you've overridden or created any static pages in your application, you will need to move them from app/views/static/ to app/views/hyrax/static/.

Minter state

  • Install the new database-backed identifier minter (if not already done) via rails generate active_fedora:noid:install
  • Migrate your database again via rails db:migrate
  • Migrate your file-based minter state to the new db-based minter state via rails active_fedora:noid:migrate:file_to_database

Other steps

  • You should be able to safely remove app/helpers/curation_concerns_helper.rb
  • Remove the files app/assets/javascripts/batch_edit.js and app/assets/stylesheets/batch_edit.scss
  • Add Blacklight internationalization keys (from CurationConcerns) to config/locales/hyrax.en.yml in your application if not already present: https://github.com/projecthydra-labs/hyrax/blob/037d75dcf979b0a37536e03a4bef40415813734d/lib/generators/hyrax/templates/config/locales/hyrax.en.yml#L1-L44
  • For each work type (or "curation concern") you generated in Sufia, regenerate them with Hyrax's work generator. It should prompt you whether you want to override files. You may want to do this and then examine the changes it made, restoring any customizations your application requires. (Again, version control will be your friend here.)

AdminSet Workflow

  • Workflows changed subtly between Sufia 7.3 and Hyrax such that now an AdminSet has both available workflows and an active workflow. No tools have yet been built to automate mapping workflows into the new structure, so you should make sure workflows are loaded (rails hyrax:workflow:load) and then use the UI to make sure a workflow is selected for each of your AdminSets.
  • Ensure a Hyrax::PermissionTemplate exists for your each of your AdminSets. You can create this for the Default AdminSet via:
permission_template = Hyrax::PermissionTemplate.create!(admin_set_id: "admin_set/default")
Hyrax::Workflow::WorkflowImporter.method(:load_workflow_for).call(permission_template: permission_template)
workflow = Sipity::Workflow.activate!(permission_template: permission_template, workflow_name: Hyrax.config.default_active_workflow_name)
# Run the following steps only for the default AdminSet
permission_template.access_grants.create(agent_type: 'group', agent_id: 'registered', access: 'deposit')
deposit = Sipity::Role.find_by_name!('depositing')
workflow.update_responsibilities(role: deposit, agents: Hyrax::Group.new('registered'))

Data Migration

Sufia 7.3 utilized CurationConcerns 1.7, but Hyrax was created from CurationConcerns 2.0. Collection membership changed direction as part of CC 2.0. Run the data migration script that reverses this membershp on your objects:

rails hyrax:migrate:collections RAILS_ENV=production

Contributing to the Release Notes

As you are migrating your application from Sufia to Hyrax, if you encounter missed steps, please submit an issue to the Hyrax team.

Don't miss a new hyrax release

NewReleases is sending notifications on new releases.