Deleting a project's resource fails with REST

25 views
Skip to first unread message

Fletcher Johnson

unread,
Nov 5, 2012, 3:15:02 PM11/5/12
to xnat_di...@googlegroups.com
See:
{"ResultSet":{"Result":[{"cat_id":"","element_name":"xnat:resourceCatalog","category":"resources","xnat_abstractresource_id":"385","label":"","cat_desc":" "},{"cat_id":"","element_name":"xnat:resourceCatalog","category":"resources","xnat_abstractresource_id":"386","label":"rSame","cat_desc":" "},{"cat_id":"","element_name":"xnat:resourceCatalog","category":"resources","xnat_abstractresource_id":"387","label":"rNotLocal","cat_desc":" "},{"cat_id":"","element_name":"xnat:resourceCatalog","category":"resources","xnat_abstractresource_id":"430","label":"rNotRemote","cat_desc":" "}], "totalRecords": "4","title": "Resources"}} 

<?xml version="1.0" encoding="UTF-8"?>
</cat:Catalog>

<?xml version="1.0" encoding="UTF-8"?>
<cat:entries>
<cat:entry ID="rNotLocal/f" URI="f" name="f"/>
</cat:entries>
</cat:Catalog>

Fletcher Johnson

unread,
Nov 5, 2012, 3:22:51 PM11/5/12
to xnat_di...@googlegroups.com
But the resource will not show up using this url...

{"ResultSet":{"Columns":[{"key":"URI","serverRoot":"/spred"}],"Result":[{"Name":"a","file_content":"","cat_ID":"385","collection":"","file_format":"","file_tags":"","URI":"/data/projects/synctest/resources/385/files/a","Size":"7"},{"Name":"b","file_content":"","cat_ID":"385","collection":"","file_format":"","file_tags":"","URI":"/data/projects/synctest/resources/385/files/b","Size":"3"},{"Name":"d","file_content":"","cat_ID":"385","collection":"","file_format":"","file_tags":"","URI":"/data/projects/synctest/resources/385/files/d","Size":"3"},{"Name":"a","file_content":"","cat_ID":"386","collection":"rSame","file_format":"","file_tags":"","URI":"/data/projects/synctest/resources/386/files/a","Size":"7"},{"Name":"b","file_content":"","cat_ID":"386","collection":"rSame","file_format":"","file_tags":"","URI":"/data/projects/synctest/resources/386/files/b","Size":"3"},{"Name":"d","file_content":"","cat_ID":"386","collection":"rSame","file_format":"","file_tags":"","URI":"/data/projects/synctest/resources/386/files/d","Size":"3"},{"Name":"f","file_content":"","cat_ID":"387","collection":"rNotLocal","file_format":"","file_tags":"","URI":"/data/projects/synctest/resources/387/files/f","Size":"3"}], "title": "Files"}}
Message has been deleted

Rick Herrick

unread,
Nov 6, 2012, 3:41:03 PM11/6/12
to xnat_di...@googlegroups.com
Can you verify whether any of the files in question are still located in the data archive?

I haven't really been able to follow the issue, since I'm not clear on the exact sequence of events and what you're trying to accomplish here. Can you break it down into steps and/or recreate the problem?

On Tuesday, November 6, 2012 1:21:28 PM UTC-6, Fletcher Johnson wrote:
Related to this is another bug which I assume is a direct result of the problem I have mentioned, namely the failure to insert files for the URL: https://localhost:8889/spred/data/archive/projects/synctest/files

If I do this...

curl -k --cookie JSESSIONID=6CF02C735CCADF5D48628395E977DA27 -F x2.py=@x2.py -F xnatsynctest.py=@xnatsynctest.py https://172.24.0.248:4004/spred/data/archive/projects/synctest/files

x2.py ends up in the non existent rNotRemote resource.
Result:{"Name":"x2.py","file_content":"","cat_ID":"430","collection":"rNotRemote","file_format":"","file_tags":"","URI":"/data/projects/synctest/resources/430/files/x2.py","Size":"502"}

The solution is to use the cat_ID for the "" resource
curl -k --cookie JSESSIONID=6CF02C735CCADF5D48628395E977DA27 -F x2.py=@x2.py -F xnatsynctest.py=@xnatsynctest.py https://172.24.0.248:4004/spred/data/archive/projects/synctest/resources/385/files/

Result
:{"Name":"x2.py","file_content":"","cat_ID":"385","collection":"","file_format":"","file_tags":"","URI":"/data/projects/synctest/resources/385/files/x2.py","Size":"502"}
Reply all
Reply to author
Forward
0 new messages