Skip to content

How Tos

Dolsy Smith edited this page Apr 25, 2024 · 12 revisions

How to start up rails console in the current production configuration

This is currently resulting in a stack trace (similar to https://github.com/rails/rails/issues/16370 - need to chase this down). For now, a workaround is to temporarily edit config/environments/production.rb and set config.eager_load = false. Remember to set it back afterwards. Then type: rvmsudo RAILS_ENV=production rails c

How to delete all items

Recommend doing this via the UI, but rails console method TBD.

How to delete a tombstone

Deleting an item leaves a "tombstone" in the Fedora repository which essentially holds the ID so that it can't be reused in this repository. There may be occasions where we want to delete a tombstone; for instance, when re-loading items with predetermined IDs during migration of items from a previous instance of GW ScholarSpace. This can be accomplished by curling to the Fedora API:

curl -X DELETE "http://<Fedora-server-URL>:8080/fcrepo/rest/prod/a1/a1/a1/a1/a1a1a1a1/fcr:tombstone" -u fedoraUser:fedoraPassword

where you would substitute the item's ID for a1/a1/a1/a1/a1a1a1a1, and substitute the username and password. If successful, there should be no error or other output at the command line.

How to reindex and generate thumbnails for items that don't have them yet.

nohup rake gwss:reindex_everything RAILS_ENV=production &

How to generate the sitemap

nohup rake gwss:sitemap_queue_generate RAILS_ENV=production &

How to find the work parent of a given fileset (Rails console)

ActiveFedora::SolrService.query("file_set_ids_ssim:(#{file_set_id})").first

where file_set_id is the ID of a FileSet object.

How to delete an item via the rails console

How to...