Hi Gary,

> I asked this question in 2007 with no replies. But I'd still like an answer, 
> even if it's "No way mate.". I'd like to append a bitstream to an existing 
> item, without removing any existing bitstreams.
> 
> The "add" and "replace" options of the ItemImport class don't seem to
> cover this useful possibility. I'd like to be able to do this 
> programmatically if possible.

Not as good a suggestion as Richard Rodgers has just mentioned, but there is 
also SWORD if you like writing scripts and playing with CURL. Whilst the normal 
use-case for SWORD is to deposit a new item, the DSpace SWORD implementation 
also allows you to POST a file to a deposit URL for an existing item, and it 
adds the POSTed file to the item. E.g.:

> curl --basic --user "<<username>>:<<password>" -i --data-binary "@<<file 
> path>>/<<file name>>" -H "Content-Type: <<file mime type>>"  
> http://localhost:8080/sword/deposit/<<handle>>/<<item handle id>> 

HTTP/1.1 201 Created
Server: Apache-Coyote/1.1
Location: http://localhost:8080/sword/media-link/123456789/2160/bitstream/169
Content-Type: application/atom+xml;charset=UTF-8
Transfer-Encoding: chunked
Date: Sun, 14 Mar 2010 23:21:55 GMT

<?xml version="1.0" encoding="UTF-8"?>
<atom:entry xmlns:atom="http://www.w3.org/2005/Atom"; 
xmlns:sword="http://purl.org/net/sword/";>
   
<atom:id>http://localhost:8080/xmlui/bitstream/123456789/2160/8/sword-2010-03-15.jpeg</atom:id>
   <atom:author>
      <atom:name>[email protected]</atom:name>
   </atom:author>
   <atom:content type="image/jpeg" 
src="http://localhost:8080/xmlui/bitstream/123456789/2160/8/sword-2010-03-15.jpeg"/>
   <atom:generator uri="http://www.dspace.org/ns/sword/1.3.1"; version="1.3"/>
   <atom:link 
href="http://localhost:8080/xmlui/bitstream/123456789/2160/8/sword-2010-03-15.jpeg";
 rel="alternate" type="image/jpeg"/>
   <atom:rights 
type="text">http://localhost:8080/xmlui/bitstream/123456789/2160/2/license.txt 
</atom:rights>
   <atom:title type="text">sword-2010-03-15.jpeg</atom:title>
   <sword:treatment>The file has been attached to the specified 
item</sword:treatment>
   <sword:verboseDescription/>
   <sword:noOp>false</sword:noOp>
   <sword:userAgent>curl/7.19.6 (i386-apple-darwin10.0.0) libcurl/7.19.6 
OpenSSL/0.9.8l zlib/1.2.3</sword:userAgent>
   <sword:packaging/>
</atom:entry>

Cheers,


Stuart Lewis
IT Innovations Analyst and Developer
Te Tumu Herenga The University of Auckland Library
Auckland Mail Centre, Private Bag 92019, Auckland 1142, New Zealand
Ph: 64 9 373-7599 x81928
http://www.library.auckland.ac.nz/


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
DSpace-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-tech

Reply via email to