XNAT Development

Best Practices for Development


Other topics

[Edit Nav]

User Space/Files

Users should be able to upload (and download) files to a user space. There should be an archive space and a cache space.

The user will need to have files grouped by purpose/source. Some purposes will be XNAT defined, others will be user defined. These purpose based folders should be implemented as catalogs, similar to the other areas of XNAT.

Files in the archive space should probably have xnat:resourceCatalog entries stored in the database. Files in the cache space should not.

Archive REST API

The files for this space should be stored in the ROOT_ARCHIVE_PATH/users/{USER_ID}

/user/archive/resources -- list of catalogs for this user
/user/archive/resources/IMG_UPLOADS -- specifies a specific catalog (xnat:resourceCatalog)
This will require adding a user attribute to the xnat:abstractResource in xnat.xsd, if its going in the database.

You may be able to modify the existing FileList.java implementation to support this.

GET,POST /user/archive/resources
GET,DELETE,PUT /user/archive/resources/XNAME
GET,POST /user/archive/resources/XNAME/files
GET,PUT,DELETE /user/archive/resources/XNAME/files/X.dcm


The files for this space should be stored in the ROOT_CACHE_PATH/users/{USER_ID}

GET /user/cache/resources
GET,PUT,POST,DELETE /user/cache/resources/XNAME
GET,POST /user/cache/resources/XNAME/files (fails if it isn't a multi-part form request (that includes the filenames)) This should support format=html|json|xml|csv|zip
GET,PUT,DELETE /user/cache/resources/XNAME/files/X.dcm

You may be able to populate an XFTTable and reuse some of its features, see FileList.java

---------RESOURCE_NAME/ -- need to validate this as a file name on any OS
------------THE FILES.dcm

--support uploading zip, tar.gz, etc With the option of extracting the content.