tar xvfz engine-demo.tar.gz

export DEMO_HOME=`pwd`/demo
./demo/bin/Engine &


## get list of tags 
#cd sample-metadata
#grep Label * | cut -d '"' -f 2 |  sort | uniq

# check for no tags:

curl http://localhost:8000/tags

# add some tags:
curl -X POST 'http://localhost:8000/tags?file_type&keywords&modality&project&scan&session&subject'

# create a tagged data entry
# using a sample metadata file
curl -X POST -H "Content-Type: application/x-xnat-metadata+xml" -H "Content-Disposition: x-xnat-metadata; filename=\"demo-howto\"" -d @demo/sample-metadata/cardiac-text.xml http://localhost:8000/data

# # returns url, which is an empty file
# http://localhost:8000/data/demo-sample-project/subj02/CT/demo-howto

#
# add some data
# - use this HOWTO file
#
curl -T XNAT-FileServer-HOWTO.txt http://localhost:8000/data/demo-sample-project/subj02/CT/demo-howto


# # can get metadata with:
# curl http://localhost:8000/data/demo-sample-project/subj02/CT/demo-howto?part=metadata

# # can search for this in the database:
curl http://localhost:8000/search

# # can search for modalities:
curl http://localhost:8000/search??modality

# # can search for all resources by modality:
curl http://localhost:8000/search?modality=CT

# # can get just the resource 
curl 'http://localhost:8000/search?modality=CT&no-metadata'


#
# now you can use the URIs found using search commands 
# to download the actual data

# http://localhost:8000/data/demo-sample-project/subj02/CT/demo-howto