XNAT Development

Best Practices for Development


Other topics

[Edit Nav]

XNAT Feature Requests : Build RESTful Interface to Prearchive

ID: 1296
Module: XNAT
Source: CNDA (Dan Marcus & Kevin Archie)
Creation Date: 5/4/2010

Authors: Kevin Archie

Background: The existing prearchive management page is old and buggy and missing key desired features including batch move/delete operations and downloading sessions from the prearchive for inspection. There are also use cases (notably the CCIR push cleanup) for which it would be convenient to have an external, web services interface to the prearchive functions. A REST API for prearchive management will both provide the server side functionality needed for a revised webapp prearchive page and support access from external tools.

Issues: How best to handle requests covering multiple prearchives? See the discussion.

Notes: The existing Ajax backend to the prearchive relies on old-style web services but builds a vaguely REST-flavored interface on top. It shouldn't be hard to build a restlet-based implementation by referring to the previous implementation.

  1. Provide a GET-only resource REST/projects/{Project}/prearchive that is a session listing including both resource URIs and metadata needed for a listing: acquisition date/time, initial upload date/time, last touch date/time, subject and session name, modality
  2. Provide GET/DELETE operations on individual sessions as REST/projects/{Project}/prearchive/{upload-timestamp}/{session-label} . There are two different forms of the GET operation: ?format=xml (default) retrieves the session XML document, whereas ?format=zip (or ?format=tgz) retrieves the full session contents as a zip/tgz archive.
  3. Provide POST operation on individual session with ?action=archive[&subject=SubjectID][&session=SessionID][&additional-xnat-field=value] or ?action=move&project=NewProject

Implementation Notes:

Overall Upload and Merge Support