This is a rake job for importing DSpace exported AIP packages into Hydra repositories
This rake job was built for Hyrax, but should be usable in any Project Hydra based repository project.
The following additional dependencies are necessary:
- RubyZip - The rubyzip gem for unzipping packages
- Colorize - The colorize gem is used for formatted shell output
Add the rubyzip gem to your Gemfile
gem 'rubyzip'
Add the colorize gem to your Gemfile
gem 'colorize'
Download the rake file into your apps lib/tasks folder:
cd lib/tasks
wget https://raw.githubusercontent.com/aaron-collier/hydra-packager/master/lib/tasks/packager.rake
The rake tasks currently takes two (2) parameters:
- The full path to the root AIP exported package
- The email address of the default depositor
NOTE: Currently, the packager creates users by the email address of the exported depositor.
TODO: Make the user creation configurable.
All configuration is currently handled inside the rake file.
TODO: Add a configuration file.
- @type_of_work_map - A hash that maps from "resource_type" and the
hyrax:worktypes in your app - @attributes - A hash that maps from dspace exported dublin core fields to work properties defined in your models where multiple is true (default)
- @singulars - A hash that maps from dspace exported dunblin core fields to work properties defined in your models where multiple is false
rake packager:aip["/path/to/zip/file.zip","[email protected]"] RAILS_ENV=<target environment>