A Hydra application enabling deposit of digital objects into the Stanford Digital Repository for preservation and access.
docker-compose up -d
brew install exiftool # Required by assembly-objectfile
./bin/rails db:migrate db:test:prepare
RAILS_ENV=test ./bin/rails hydrus:refreshfix # load all fedora and database fixtures, and get sample uploaded files
You can provide the current user and roles using environment variables when the server is in development mode:
ROLES=dlss:hydrus-app-administrators REMOTE_USER=archivist1@stanford.edu rails server
To run the test suite, invoke rake
from the Hydrus app root. Note that the docker containers need to be running already for this work.
$ rake # Runs all tests.
# Coverage reports
$ open coverage/index.html
If you encounter problems with running tests, try:
$ docker-compose stop
$ docker-compose rm -vf
$ docker-compose up -d
cap [stage_name] deploy
Run remediations the objects in the deployed environment require changes to be consistent with the new code.
The general framework, and the front-end. See the code for more details on how the process works.
app/models/hydrus/remediation_runner.rb
remediations/run.rb
Remediation scripts:
remediations/archive/0000.00.00a.rb
for a schematic example.Running remediations (using production environment as the example):
# Must run from the deployed box.
RAILS_ENV=production bundle exec rails runner remediations/run.rb
grep -i warn log/remediation.log #Then search for problems.
List the Hydrus rake tasks.
rake -T hydrus
Some handy scripts during development.
rails runner devel/create_test_item.rb help
rails runner script/experiment.rb # See comments in script.
rails runner devel/get_datastreams.rb
rails runner devel/list_all_hydrus_objects.rb
If you see an error relating to generate_intial_workflow() for nil:NilClass, run this:
rake hydrus:reindex_workflow_objects
If you update the text, you should change the following:
Headings:
app/views/hydrus_items/terms_of_deposit.html.erb
app/views/hydrus_items/_terms_of_deposit_popup.html.erb
Text and headings:
app/views/hydrus_items/_terms_of_deposit_text.html.erb
doc/SDRSelfDepositTerms.doc
$public/SDRSelfDepositTerms.pdf
General points:
Relationship between object_status and workflow steps for collections:
object_status workflow steps
----------------------------------------------------
draft start-deposit
published_open submit --> approve --> start-assembly
published_closed start-assembly
----------------------------------------------------
Notes:
Relationship between object_status and workflow steps for items:
Items not requiring human approval:
object_status workflow steps
----------------------------------------------------
draft start-deposit
published submit --> approve --> start-assembly
----------------------------------------------------
Items requiring human approval:
object_status workflow steps
----------------------------------------------------
draft start-deposit
awaiting_approval submit
returned submit
published approve --> start-assembly
----------------------------------------------------
Note: Items can toggle back and forth between awaiting_approval and returned during the edit-and-review process. During that time, the workflow remains at the submit step.
# Temporarily edit register_dor_object().
params[:pid] = 'ITEM_PID' if args.last == 'APO_PID'
# Run this in the Rails console.
bundle exec rails c ENV
hc = Hydrus::Collection.find 'COLL_PID'
u = User.new(:email => 'EMAIL')
hi = ItemService.create(hc.pid, u)
/data/hydrus-files/tmp
folder on the hydrus-prod server using sftp or some other mechanismcd hydrus/current
bundle exec rails console production
hof = Hydrus::ObjectFile.new
hof.pid = 'druid:XX111YY2222'
hof.hide = false # set this to true if the file should be hidden (default: false)
hof.label = "Description" # optional description of file, can be left blank
hof.file = File.open('/data/hydrus-files/tmp/YOURFILENAME') # add your file here by path
hof.save # should return true if it succeeded
/data/hydrus-files/DRUID/TREE/PATH/DRUID/content
e.g. /data/hydrus-files/xx/111/yy/2222/xx111yy2222/content