Hi Richard

Thanks for your suggestions.

So far:

> 1/ POST your Atom Entry to the Collection IRI with In-Progress: true
> in the headers

$client = new SWORDAPPClient();

$response = $client->deposit(self::URL, self::USERNAME, self::PASSWORD, 
self::USERNAME, './tmp/atom_multipart_package.zip', 
self::PACKAGE_FORMAT, self::PACKAGE_CONTENT_TYPE, true);

is successfully POSTing my deposit to DSpace SWORDv2 although no 
metadata is saved and the title of the deposit drops the "a" from 
atom_multipart_package.zip so my DSpace item's title looks like: 
Untitled: tom_multipart_package.zip.

> 2/ PUT your package to the Edit Media IRI with all the relevant
> package headers and Metadata-Relevant: true if the package contains
> any metadata to be extracted
Okay I've tried a couple of methods for adding metadata and completing 
the deposit.

Both:

$response = 
$client->replaceMetadata((string)$response->sac_edit_media_iri, 
self::USERNAME, self::PASSWORD, self::USERNAME, './tmp/atom2', false);

$response = 
$client->replaceMetadataAndFile((string)$response->sac_edit_media_iri, 
self::USERNAME, self::PASSWORD, self::USERNAME, 
'./tmp/atom_multipart_package2.zip', false);

result in the error:

<atom:summary xmlns:atom="http://www.w3.org/2005/Atom";>Filename could 
not be extracted from 
Content-Disposition</atom:summary><sword:verboseDescription>org.swordapp.server.SwordError:
 
Filename could not be extracted from Content-Disposition
     at 
org.swordapp.server.SwordAPIEndpoint.addDepositPropertiesFromBinary(SwordAPIEndpoint.java:311)
     at org.swordapp.server.MediaResourceAPI.put(MediaResourceAPI.java:165)
     at 
org.swordapp.server.servlets.MediaResourceServletDefault.doPut(MediaResourceServletDefault.java:56)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:640)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
     at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
     at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
     at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
     at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
     at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
     at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
     at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
     at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
     at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
     at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
     at 
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
     at java.lang.Thread.run(Thread.java:679)
</sword:verboseDescription></sword:error>

Looking at both these methods shows that they call 
depositAtomEntryByMethod and depositMultipartByMethod but from what I 
can see, neither of these methods sets the curl Content-Disposition 
header. Could this be what is causing this error?

Cheers


Hayden


On 19/04/12 03:05, Richard Jones wrote:
> To be more helpful ....
>
> You can separate the deposit into two requests and get the same effect
> as a multipart:
>
> 1/ POST your Atom Entry to the Collection IRI with In-Progress: true
> in the headers
>
> 2/ PUT your package to the Edit Media IRI with all the relevant
> package headers and Metadata-Relevant: true if the package contains
> any metadata to be extracted
>
> Cheers,
>
> Richard
>
>
>
> On 18 April 2012 20:03, Richard Jones<rich...@cottagelabs.com>  wrote:
>> Hi Hayden,
>>
>> Unfortunately the Abdera library which the SWORD implementation in
>> DSpace uses doesn't seem to properly support multipart, and we've been
>> unable to get it to work thus far.  It's on my list of things to do,
>> but any insights anyone else has on it would be really useful.
>>
>> Cheers,
>>
>> Richard
>>
>> On 18 April 2012 19:34, Hayden Young<haydenyo...@wijiti.com>  wrote:
>>> I have successfully developed a deposit tool in Joomla using a
>>> PackagerMetsSwap package and SWORDAPPClient to deposit a SWORD package into
>>> DSpace via Swordv2.
>>>
>>> The next step is to use SWORD to update an existing deposit, in particular
>>> when a user's item is rejected from the workflow. However, from what I can
>>> see in the PHP Sword client lib is that one cannot update an existing item
>>> using a METS package; rather, the deposit would need to be packaged as
>>> AtomMultipart.
>>>
>>> I have successfully created a package using PackagerAtomMultipart but when I
>>> attempt to deposit it using $client->depositMultipart (where $client is an
>>> instance of SWORDAPPClient) an exception is thrown with the cryptic error:
>>>
>>> Error parsing response entry (String could not be parsed as XML)
>>>
>>> There are no errors in my Tomcat logs and DSpace logs aren't reporting
>>> anything unusual.
>>>
>>> Next, I tried $response->deposit(...) and the deposit was successful.
>>> However, the first letter is dropped off of the deposited zip file, the
>>> title of the item is Untitled: name-of-deposited-zip.zip and all of the
>>> metadata is missing, including anything set using
>>> $package->addEntryAuthor(). So, for example, if my atom package is called
>>> atom_multipart_package.zip, I get the following record in my workflow list:
>>>
>>> - Title: Untitled: tom_multipart_package.zip
>>> - no metadata
>>> - no author information set by addEntryAuthor()
>>> - if I configure sword to save the deposited package, the file name is
>>> tom_multipart_package.zip, without the "a" at the front.
>>>
>>> I have tested my own atom packages as well as the test ones bundled with the
>>> PHP Sword client libs and I get the same exception.
>>>
>>> I've attached both atom packages as well as my DSpace swordv2-server config
>>> in case they may be of help.
>>>
>>> Cheers
>>>
>>>
>>> Hayden
>>>
>>> --
>>> Hayden Young
>>> Managing Director
>>> Wijiti Pty Ltd
>>> p. +61 (0) 08 6398 5010
>>> e. haydenyo...@wijiti.com
>>> w. www.wijiti.com
>>> vcard. www.wijiti.com/vcard/haydenyoung.vcf
>>>
>>> NOTICE
>>> This e-mail and any attachments are intended for the addressee(s) only and
>>> may be confidential. They may contain legally privileged or copyright
>>> material. You should not read, copy, use or disclose them without
>>> authorization. If you are not the intended recipient please contact the
>>> sender as soon as possible by return e-mail and then please delete both
>>> messages. This notice should not be removed.
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Better than sec? Nothing is better than sec when it comes to
>>> monitoring Big Data applications. Try Boundary one-second
>>> resolution app monitoring today. Free.
>>> http://p.sf.net/sfu/Boundary-dev2dev
>>> _______________________________________________
>>> sword-app-tech mailing list
>>> sword-app-tech@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/sword-app-tech
>>>
>>
>>
>> --
>>
>> Richard Jones,
>>
>> Founder, Cottage Labs
>> t: @richard_d_jones, @cottagelabs
>> w: http://cottagelabs.com
>
>

-- 
Hayden Young
Managing Director
Wijiti Pty Ltd
p. +61 (0) 08 6398 5010
e. haydenyo...@wijiti.com
w. www.wijiti.com
vcard. www.wijiti.com/vcard/haydenyoung.vcf

NOTICE
This e-mail and any attachments are intended for the addressee(s) only and may 
be confidential. They may contain legally privileged or copyright material. You 
should not read, copy, use or disclose them without authorization. If you are 
not the intended recipient please contact the sender as soon as possible by 
return e-mail and then please delete both messages. This notice should not be 
removed.


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
sword-app-tech mailing list
sword-app-tech@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sword-app-tech

Reply via email to