<html><head>
<meta name="Generator" content="Novell Groupwise Client (Version 14.0.1 Build: 117118)">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><style></style></head>
<body style="font: 10pt/normal Segoe UI; margin: 16px 16px 4px; font-size-adjust: none; font-stretch: normal;"><div class="GroupWiseMessageBody active" id="GroupWiseSection_1450104966000_Andy.Reid@lshtm.ac.uk_E7E91160180E0000BAA6000000100002_"><div>Dear gurus,</div><div>I am trying to push documents into existing eprints records, from a staging area in an external publications database. So far I have successfully </div><div><ol><li>created new eprints using POST to /id/contents, with or without embedded documents</li><li>edited existing eprint metadata by fetching the XML, editing it programatically, and PUTting it back to /id/eprint/123456</li></ol></div><div>What I am failing to do is the next stage up, fetching existing XML,<eprints><eprint>... <documents>, adding<document> to an existing <documents>), then pushing it back. (Or creating <documents> where none exists)</div><ol><li>POSTing <!--StartFragment--><eprints>...</eprints> to /id/eprint/123456 gives error: METHOD POST now allowed</li><li>PUTting <eprints>...<documents>...</eprints> to /id/eprint/123456 has no effect</li><li>PUTting <eprints>...</eprints> to /is/eprint/123456/contents gives an XMLparse error saying 'Expected <documents>, found <eprints>'</li><li>PUTting <documents>..</documents> to <!--StartFragment-->/id/eprint/123456 <!--StartFragment--> gives an XMLparse error saying 'Expected <eprints>found <documents>, </li><li><!--StartFragment-->PUTting <documents>..</documents> to <!--StartFragment-->/id/eprint/123456/contents deletes the eprint record and creates an new one containing the document but no metadata, as you would expect <!--StartFragment--> </li><li><!--StartFragment-->PUTting <eprints><documents>..</documents></eprints> to <!--StartFragment-->/id/eprint/123456 <!--StartFragment--> wipes metadata and fails to upload document</li></ol><div>There are probably other permutations I haven't tried on these variables, but somebody might be able to save me some time if they can spot where I'm going wrong :</div><ul><li>What if I PUT or POST a document to /id/document and specify <eprintid> within the document metadata? Will that create the document and link it to the eprint? </li><li>I'm unclear in general what is the function of the <eprintid> within the document, given that the eprintid is already clear from the URL and the embedded position of the <document> tag within the <eprint>. </li><li>More generally, implicit in the previous question, I am unclear whether the <eprint><document><file> hierarchy is a strict tree, where a child can only have one parent, or is it possible for a document to be referenced by more than one eprint? The presence of <eprintid> within the export <document tag would seem to imply the strict interprtation, but I can find that stated anywhere.<br></li></ul></div></body></html>