<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.&nbsp; So far I have successfully </div><div><ol><li>created new&nbsp;eprints using POST to /id/contents,&nbsp;with or without&nbsp;embedded documents</li><li>edited existing&nbsp;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,&lt;eprints&gt;&lt;eprint&gt;... &lt;documents&gt;, adding&lt;document&gt; to an existing &lt;documents&gt;), then pushing it back.&nbsp; (Or creating &lt;documents&gt; where none exists)</div><ol><li>POSTing <!--StartFragment-->&lt;eprints&gt;...&lt;/eprints&gt;  to /id/eprint/123456 gives error: METHOD POST now allowed</li><li>PUTting &lt;eprints&gt;...&lt;documents&gt;...&lt;/eprints&gt;&nbsp; to /id/eprint/123456 has no effect</li><li>PUTting &lt;eprints&gt;...&lt;/eprints&gt;&nbsp; to /is/eprint/123456/contents&nbsp; gives an XMLparse &nbsp;error saying 'Expected &lt;documents&gt;, found &lt;eprints&gt;'</li><li>PUTting &lt;documents&gt;..&lt;/documents&gt;&nbsp; to <!--StartFragment-->/id/eprint/123456&nbsp;<!--StartFragment--> gives an XMLparse  error saying 'Expected &lt;eprints&gt;found &lt;documents&gt;, </li><li><!--StartFragment-->PUTting &lt;documents&gt;..&lt;/documents&gt;  to <!--StartFragment-->/id/eprint/123456/contents deletes&nbsp;the eprint&nbsp;record and creates an new one containing the document but no metadata, as you would expect&nbsp;<!--StartFragment--> </li><li><!--StartFragment-->PUTting &lt;eprints&gt;&lt;documents&gt;..&lt;/documents&gt;&lt;/eprints&gt;  to <!--StartFragment-->/id/eprint/123456&nbsp;<!--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&nbsp;:</div><ul><li>What if I PUT or POST a document to&nbsp;/id/document&nbsp; and specify &lt;eprintid&gt; within the document metadata? Will that&nbsp;create the document and link it to the eprint? </li><li>I'm unclear in general what is&nbsp;the&nbsp;function of the &lt;eprintid&gt; within the document, given that the eprintid is already clear from the URL and the embedded position of the &lt;document&gt; tag within the &lt;eprint&gt;.&nbsp; </li><li>More generally, implicit in the previous question, I am unclear whether the &lt;eprint&gt;&lt;document&gt;&lt;file&gt; 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 &lt;eprintid&gt; within the export &lt;document tag would seem to imply the strict interprtation, but I can find that stated anywhere.<br></li></ul></div></body></html>