Bitstorage API
To add files to DOMS, three things will need to happen:
- The file must be uploaded to bitstorage
The file must be connected to a Fedora object datastream of type TypeFile
- The file must be characterised (see the API for this), and the result added to a Technical Metadata-stream in the object (the file and the characterisation result must match, see the data model documentation)
Uploading the file to bitstorage must be done with the following API:
(WORK IN PROGRESS! WE NEED TO WRAP THIS IN A WEBSERVICE!)
The interface is command line based, and the client must have ssh access to halley.statsbiblioteket.dk.
The interface is as follows $ ssh doms@halley <<command>> <<filename>>
Commands are one of
save-md5) : save a file and get md5sum back get-md5) : get md5sum of a file approve) : approve a file delete) : delete a file not appoved get) : get a file getmd5s) : report md5 sums of stored files space-left) : report space left
Files are exchanged using stdin and stdout. Errors are reported to stderr.
To upload a file, use save-md5, and check that the checksum is as expected. Otherwise delete and retry.
Once all Fedora objects referring to the file are validated, use approve to publish the file.
Preferrably, use space-left first as sanity check.
Examples
Adding a file to a fedora metadata object:
- Make a new XML object of type File
- Call characterisation service on file, add metadata to the object, add file type id to the technical metadata
Call save-md5 on bitfinder API, check checksum
- Set fedora metadata objects to state "intermediate"
- Ingest the fedora file object
- Set fedora metadata objects to state "published"
Call approve from the bitfinder API