You can subscribe to this list here.
2008 |
Jan
(22) |
Feb
(8) |
Mar
(9) |
Apr
(4) |
May
(17) |
Jun
(29) |
Jul
(11) |
Aug
(13) |
Sep
(17) |
Oct
(14) |
Nov
(41) |
Dec
(8) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
(17) |
Feb
(26) |
Mar
(18) |
Apr
(1) |
May
(11) |
Jun
(20) |
Jul
(5) |
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
|
2010 |
Jan
(23) |
Feb
(7) |
Mar
(9) |
Apr
(13) |
May
(5) |
Jun
|
Jul
(3) |
Aug
(5) |
Sep
|
Oct
(1) |
Nov
(3) |
Dec
|
2011 |
Jan
(3) |
Feb
|
Mar
(2) |
Apr
(1) |
May
|
Jun
(14) |
Jul
(22) |
Aug
(1) |
Sep
(2) |
Oct
(11) |
Nov
(11) |
Dec
(35) |
2012 |
Jan
(17) |
Feb
(12) |
Mar
(41) |
Apr
(40) |
May
(41) |
Jun
(27) |
Jul
(9) |
Aug
(1) |
Sep
|
Oct
(6) |
Nov
|
Dec
(11) |
2013 |
Jan
|
Feb
(4) |
Mar
(2) |
Apr
(8) |
May
(1) |
Jun
(18) |
Jul
(10) |
Aug
(16) |
Sep
(2) |
Oct
(1) |
Nov
(14) |
Dec
(11) |
2014 |
Jan
(7) |
Feb
(2) |
Mar
|
Apr
|
May
(8) |
Jun
(1) |
Jul
(7) |
Aug
(10) |
Sep
(8) |
Oct
(8) |
Nov
|
Dec
|
2015 |
Jan
|
Feb
(2) |
Mar
(2) |
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(4) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(6) |
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
(4) |
2018 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: LEWIS S. <Stu...@ed...> - 2012-05-01 19:36:34
|
Hi Hayden, Thanks for persisting with this - it's great to hear about the positive outcome. Unfortunately I've not got a working copy of DSpace / SWORD on my PC since changing jobs. If you're able to debug the PHP client's parsing of the result, that would be great. The spec doesn't specify the response should be - it may be that no xml is returned, so the build hierarchy code may not be needed. I don't know what DSpace does in this respect. http://sword-app.svn.sourceforge.net/viewvc/sword-app/spec/tags/sword-2.0/SWORDProfile.html?revision=377#protocoloperations_addingcontent_mediaresource Thanks, Stuart -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. -----Original Message----- From: Hayden Young [mailto:hay...@wi...] Sent: 01 May 2012 17:07 To: Richard Jones Cc: swo...@li... Subject: Re: [sword-app-tech] depositMultipart always results in a 500 error Okay success with addExtraFileToMediaResource. First of all we added a new SimpleZipContentIngester entry to the SwordContentIngester: org.dspace.sword2.SimpleZipContentIngester = application/zip So it now looks like: plugin.named.org.dspace.sword2.SwordContentIngester = \ org.dspace.sword2.SimpleZipContentIngester = http://purl.org/net/sword/package/SimpleZip, \ org.dspace.sword2.SwordMETSContentIngester = http://purl.org/net/sword/package/METSDSpaceSIP, \ org.dspace.sword2.BinaryContentIngester = http://purl.org/net/sword/package/Binary, \ org.dspace.swordpackagers.SwordDocXIngester = application/vnd.openxmlformats-officedocument.wordprocessingml.document, \ org.dspace.swordpackagers.SwordXifIngester = image/jpeg, \ org.dspace.sword2.SimpleZipContentIngester = application/zip I then zip all my assets; pdf, jpeg, even other zips; and send these to Sword using addExtraFileToMediaResource: $response = $client->addExtraFileToMediaResource((string)$response->sac_edit_media_iri, self::USERNAME, self::PASSWORD, self::USERNAME, "package.zip", 'application/zip', false); Sword extracts the files and attaches them to my item. The content types are correct and the names are fully intact. One issue I notice I am getting when addExtraFileToMediaResource is the error: Error parsing response entry (String could not be parsed as XML). However, DSpace is not throwing an exception. The offending code block is: try { // Get the deposit results $sac_xml = @new SimpleXMLElement($sac_resp); $sac_ns = $sac_xml->getNamespaces(true); // Build the deposit response object $sac_dresponse->buildhierarchy($sac_xml, $sac_ns); } catch (Exception $e) { throw new Exception("Error parsing response entry (" . $e->getMessage() . ")"); } On closer inspection I noticed that calling the edit iri doesn't return anything and so the $sac_resp is empty. Therefore I am assuming buildhierarchy throws an exception at some stage. I haven't had chance to step through the code using a debugger but I can if you would like me to investigate further. Thanks again for everyone's assistance. Cheers Hayden On 01/05/12 01:36, Hayden Young wrote: > Thanks. > > Yes I at least have a php client that is working somewhat so we will > run the debugger against the sword server code and see if we can find > out where the problem is. > > Cheers > > > Hayden > > On 01/05/12 01:27, Richard Jones wrote: >> I've just looked this up in the spec, and no quote marks are expected >> - sorry for the diversion. >> >> Furthermore, the java client doesn't strip quotes, so not sure where >> your missing characters are going. >> >> Cheers, >> >> Richard >> >> >> On 30 April 2012 17:44, Hayden Young<hay...@wi...> wrote: >>> Okay I updated SwordAppClient and quoted the filename: >>> >>> array_push($headers, 'Content-Disposition: filename="' . >>> $sac_fname_trimmed . '"'); >>> >>> >>> The error logged: >>> >>> 30/04/2012 4:29:57 PM org.apache.catalina.core.StandardWrapperValve >>> invoke >>> SEVERE: Servlet.service() for servlet mediaresource threw exception >>> org.apache.abdera.i18n.iri.IRISyntaxException: >>> org.apache.abdera.i18n.text.InvalidCharacterException: Invalid >>> Character >>> 0x22(") >>> >>> We'll look at getting the debugger onto the Java code tomorrow. >>> >>> >>> On 30/04/12 23:36, LEWIS Stuart wrote: >>>>>> filename="myfile.xxx" (this will get the name right in DSpace) >>>>> So possibly the PHP client is not wrapping the filename in quote >>>>> marks, and the java server isn't clever enough to check that it's >>>>> actually stripping leading>and following quotes, which might >>>>> account for your missing letters. I'll check the java one - >>>>> Stuart, could you have a look at the PHP client? >>>> Yes - it looks like there might be a bug (copied from old v1 code): >>>> >>>> array_push($headers, "Content-Disposition: filename=" . >>>> $sac_fname_trimmed); >>>> >>>> It needs updating (three times in swordappclient.php) to: >>>> >>>> array_push($headers, 'Content-Disposition: filename="' . >>>> $sac_fname_trimmed . '"'); >>>> >>>> Try that, and see if it helps. >>>> >>>> Cheers, >>>> >>>> >>>> Stuart >>>> >>> -- >>> Hayden Young >>> Managing Director >>> Wijiti Pty Ltd >>> p. +61 (0) 08 6398 5010 >>> e. hay...@wi... >>> 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 >>> swo...@li... >>> https://lists.sourceforge.net/lists/listinfo/sword-app-tech >> >> > -- Hayden Young Managing Director Wijiti Pty Ltd p. +61 (0) 08 6398 5010 e. hay...@wi... 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 swo...@li... https://lists.sourceforge.net/lists/listinfo/sword-app-tech |
From: Hayden Y. <hay...@wi...> - 2012-05-01 16:35:34
|
Okay success with addExtraFileToMediaResource. First of all we added a new SimpleZipContentIngester entry to the SwordContentIngester: org.dspace.sword2.SimpleZipContentIngester = application/zip So it now looks like: plugin.named.org.dspace.sword2.SwordContentIngester = \ org.dspace.sword2.SimpleZipContentIngester = http://purl.org/net/sword/package/SimpleZip, \ org.dspace.sword2.SwordMETSContentIngester = http://purl.org/net/sword/package/METSDSpaceSIP, \ org.dspace.sword2.BinaryContentIngester = http://purl.org/net/sword/package/Binary, \ org.dspace.swordpackagers.SwordDocXIngester = application/vnd.openxmlformats-officedocument.wordprocessingml.document, \ org.dspace.swordpackagers.SwordXifIngester = image/jpeg, \ org.dspace.sword2.SimpleZipContentIngester = application/zip I then zip all my assets; pdf, jpeg, even other zips; and send these to Sword using addExtraFileToMediaResource: $response = $client->addExtraFileToMediaResource((string)$response->sac_edit_media_iri, self::USERNAME, self::PASSWORD, self::USERNAME, "package.zip", 'application/zip', false); Sword extracts the files and attaches them to my item. The content types are correct and the names are fully intact. One issue I notice I am getting when addExtraFileToMediaResource is the error: Error parsing response entry (String could not be parsed as XML). However, DSpace is not throwing an exception. The offending code block is: try { // Get the deposit results $sac_xml = @new SimpleXMLElement($sac_resp); $sac_ns = $sac_xml->getNamespaces(true); // Build the deposit response object $sac_dresponse->buildhierarchy($sac_xml, $sac_ns); } catch (Exception $e) { throw new Exception("Error parsing response entry (" . $e->getMessage() . ")"); } On closer inspection I noticed that calling the edit iri doesn't return anything and so the $sac_resp is empty. Therefore I am assuming buildhierarchy throws an exception at some stage. I haven't had chance to step through the code using a debugger but I can if you would like me to investigate further. Thanks again for everyone's assistance. Cheers Hayden On 01/05/12 01:36, Hayden Young wrote: > Thanks. > > Yes I at least have a php client that is working somewhat so we will > run the debugger against the sword server code and see if we can find > out where the problem is. > > Cheers > > > Hayden > > On 01/05/12 01:27, Richard Jones wrote: >> I've just looked this up in the spec, and no quote marks are expected >> - sorry for the diversion. >> >> Furthermore, the java client doesn't strip quotes, so not sure where >> your missing characters are going. >> >> Cheers, >> >> Richard >> >> >> On 30 April 2012 17:44, Hayden Young<hay...@wi...> wrote: >>> Okay I updated SwordAppClient and quoted the filename: >>> >>> array_push($headers, 'Content-Disposition: filename="' . >>> $sac_fname_trimmed . '"'); >>> >>> >>> The error logged: >>> >>> 30/04/2012 4:29:57 PM org.apache.catalina.core.StandardWrapperValve >>> invoke >>> SEVERE: Servlet.service() for servlet mediaresource threw exception >>> org.apache.abdera.i18n.iri.IRISyntaxException: >>> org.apache.abdera.i18n.text.InvalidCharacterException: Invalid >>> Character >>> 0x22(") >>> >>> We'll look at getting the debugger onto the Java code tomorrow. >>> >>> >>> On 30/04/12 23:36, LEWIS Stuart wrote: >>>>>> filename="myfile.xxx" (this will get the name right in DSpace) >>>>> So possibly the PHP client is not wrapping the filename in quote >>>>> marks, and the java server isn't clever enough to check that it's >>>>> actually stripping leading>and following quotes, which might >>>>> account for your missing letters. I'll check the java one - >>>>> Stuart, could you have a look at the PHP client? >>>> Yes - it looks like there might be a bug (copied from old v1 code): >>>> >>>> array_push($headers, "Content-Disposition: filename=" . >>>> $sac_fname_trimmed); >>>> >>>> It needs updating (three times in swordappclient.php) to: >>>> >>>> array_push($headers, 'Content-Disposition: filename="' . >>>> $sac_fname_trimmed . '"'); >>>> >>>> Try that, and see if it helps. >>>> >>>> Cheers, >>>> >>>> >>>> Stuart >>>> >>> -- >>> Hayden Young >>> Managing Director >>> Wijiti Pty Ltd >>> p. +61 (0) 08 6398 5010 >>> e. hay...@wi... >>> 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 >>> swo...@li... >>> https://lists.sourceforge.net/lists/listinfo/sword-app-tech >> >> > -- Hayden Young Managing Director Wijiti Pty Ltd p. +61 (0) 08 6398 5010 e. hay...@wi... 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. |
From: Hayden Y. <hay...@wi...> - 2012-04-30 17:36:48
|
Thanks. Yes I at least have a php client that is working somewhat so we will run the debugger against the sword server code and see if we can find out where the problem is. Cheers Hayden On 01/05/12 01:27, Richard Jones wrote: > I've just looked this up in the spec, and no quote marks are expected > - sorry for the diversion. > > Furthermore, the java client doesn't strip quotes, so not sure where > your missing characters are going. > > Cheers, > > Richard > > > On 30 April 2012 17:44, Hayden Young<hay...@wi...> wrote: >> Okay I updated SwordAppClient and quoted the filename: >> >> array_push($headers, 'Content-Disposition: filename="' . $sac_fname_trimmed . '"'); >> >> >> The error logged: >> >> 30/04/2012 4:29:57 PM org.apache.catalina.core.StandardWrapperValve invoke >> SEVERE: Servlet.service() for servlet mediaresource threw exception >> org.apache.abdera.i18n.iri.IRISyntaxException: >> org.apache.abdera.i18n.text.InvalidCharacterException: Invalid Character >> 0x22(") >> >> We'll look at getting the debugger onto the Java code tomorrow. >> >> >> On 30/04/12 23:36, LEWIS Stuart wrote: >>>>> filename="myfile.xxx" (this will get the name right in DSpace) >>>> So possibly the PHP client is not wrapping the filename in quote marks, and the java server isn't clever enough to check that it's actually stripping leading>and following quotes, which might account for your missing letters. I'll check the java one - Stuart, could you have a look at the PHP client? >>> Yes - it looks like there might be a bug (copied from old v1 code): >>> >>> array_push($headers, "Content-Disposition: filename=" . $sac_fname_trimmed); >>> >>> It needs updating (three times in swordappclient.php) to: >>> >>> array_push($headers, 'Content-Disposition: filename="' . $sac_fname_trimmed . '"'); >>> >>> Try that, and see if it helps. >>> >>> Cheers, >>> >>> >>> Stuart >>> >> -- >> Hayden Young >> Managing Director >> Wijiti Pty Ltd >> p. +61 (0) 08 6398 5010 >> e. hay...@wi... >> 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 >> swo...@li... >> https://lists.sourceforge.net/lists/listinfo/sword-app-tech > > -- Hayden Young Managing Director Wijiti Pty Ltd p. +61 (0) 08 6398 5010 e. hay...@wi... 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. |
From: Richard J. <ri...@co...> - 2012-04-30 17:28:14
|
I've just looked this up in the spec, and no quote marks are expected - sorry for the diversion. Furthermore, the java client doesn't strip quotes, so not sure where your missing characters are going. Cheers, Richard On 30 April 2012 17:44, Hayden Young <hay...@wi...> wrote: > Okay I updated SwordAppClient and quoted the filename: > > array_push($headers, 'Content-Disposition: filename="' . $sac_fname_trimmed . '"'); > > > The error logged: > > 30/04/2012 4:29:57 PM org.apache.catalina.core.StandardWrapperValve invoke > SEVERE: Servlet.service() for servlet mediaresource threw exception > org.apache.abdera.i18n.iri.IRISyntaxException: > org.apache.abdera.i18n.text.InvalidCharacterException: Invalid Character > 0x22(") > > We'll look at getting the debugger onto the Java code tomorrow. > > > On 30/04/12 23:36, LEWIS Stuart wrote: >>>> filename="myfile.xxx" (this will get the name right in DSpace) >>> So possibly the PHP client is not wrapping the filename in quote marks, and the java server isn't clever enough to check that it's actually stripping leading>and following quotes, which might account for your missing letters. I'll check the java one - Stuart, could you have a look at the PHP client? >> Yes - it looks like there might be a bug (copied from old v1 code): >> >> array_push($headers, "Content-Disposition: filename=" . $sac_fname_trimmed); >> >> It needs updating (three times in swordappclient.php) to: >> >> array_push($headers, 'Content-Disposition: filename="' . $sac_fname_trimmed . '"'); >> >> Try that, and see if it helps. >> >> Cheers, >> >> >> Stuart >> > > -- > Hayden Young > Managing Director > Wijiti Pty Ltd > p. +61 (0) 08 6398 5010 > e. hay...@wi... > 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 > swo...@li... > https://lists.sourceforge.net/lists/listinfo/sword-app-tech -- Richard Jones, Founder, Cottage Labs t: @richard_d_jones, @cottagelabs w: http://cottagelabs.com |
From: Hayden Y. <hay...@wi...> - 2012-04-30 16:45:10
|
Okay I updated SwordAppClient and quoted the filename: array_push($headers, 'Content-Disposition: filename="' . $sac_fname_trimmed . '"'); The error logged: 30/04/2012 4:29:57 PM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet mediaresource threw exception org.apache.abdera.i18n.iri.IRISyntaxException: org.apache.abdera.i18n.text.InvalidCharacterException: Invalid Character 0x22(") We'll look at getting the debugger onto the Java code tomorrow. On 30/04/12 23:36, LEWIS Stuart wrote: >>> filename="myfile.xxx" (this will get the name right in DSpace) >> So possibly the PHP client is not wrapping the filename in quote marks, and the java server isn't clever enough to check that it's actually stripping leading>and following quotes, which might account for your missing letters. I'll check the java one - Stuart, could you have a look at the PHP client? > Yes - it looks like there might be a bug (copied from old v1 code): > > array_push($headers, "Content-Disposition: filename=" . $sac_fname_trimmed); > > It needs updating (three times in swordappclient.php) to: > > array_push($headers, 'Content-Disposition: filename="' . $sac_fname_trimmed . '"'); > > Try that, and see if it helps. > > Cheers, > > > Stuart > -- Hayden Young Managing Director Wijiti Pty Ltd p. +61 (0) 08 6398 5010 e. hay...@wi... 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. |
From: LEWIS S. <Stu...@ed...> - 2012-04-30 15:36:13
|
>> filename="myfile.xxx" (this will get the name right in DSpace) > >So possibly the PHP client is not wrapping the filename in quote marks, and the java server isn't clever enough to check that it's actually stripping leading >and following quotes, which might account for your missing letters. I'll check the java one - Stuart, could you have a look at the PHP client? Yes - it looks like there might be a bug (copied from old v1 code): array_push($headers, "Content-Disposition: filename=" . $sac_fname_trimmed); It needs updating (three times in swordappclient.php) to: array_push($headers, 'Content-Disposition: filename="' . $sac_fname_trimmed . '"'); Try that, and see if it helps. Cheers, Stuart -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. |
From: Richard J. <ri...@co...> - 2012-04-30 15:07:00
|
Hi Marco, Hayden, On 30 April 2012 15:46, Marco Fabiani <mar...@ee...> wrote: > Hi Hayden, Richard > > I was in the same situation you are in a few weeks ago, although I was > trying what you are trying to do using the python client. > > Here is how I solved the problem: > > - create an atom entry (which works for you), with the header in_progress = > True > > - add the file by posting to the "edit_media" url that I get in the deposit > receipt from the previous entry creation. To do this, these are the headers > I send: > > filename="myfile.xxx" (this will get the name right in DSpace) So possibly the PHP client is not wrapping the filename in quote marks, and the java server isn't clever enough to check that it's actually stripping leading and following quotes, which might account for your missing letters. I'll check the java one - Stuart, could you have a look at the PHP client? > mimetype="application/zip" > packaging="http://purl.org/net/sword/package/Binary" (this will force the > use of the Binary ingester, which is detecting the MIME type automatically). > > I also slightly modified the BinaryIngester in DSpace because there was a > small bug (which I reported). Yes, thanks for that. I have incorporated your fix into the fork of the code which I linked to earlier. It shouldn't stop the sword interface working, but it sure keeps the bundles much tidier. > With these headers, and with "my" > BinaryIngester, the file type is stored correctly. The only thing missing is > the file's Description. > > I created a simple command line tool to send files to DSpace, you can find > it here: Project: SWORD Uploader > If you need the modified BinaryIngester, I can send you the compiled file > (or the source if you prefer), if this could solve your problem. > > Another way of depositing many files is to use the SimpleZip ingester: just > zip all the files and post them with > packaging="http://purl.org/net/sword/package/SimpleZip" . This will create > an entry with a title defined by the name of the zip file. If you send the > header in-progess=True, the entry will remain open. You can then update the > metadata using the appropriate command. > > Richard: >>As long as the mime type is in the "accept" list, then you should be >>able to use the correct mime type in the deposit (you could also set >>your accepts config option to */*. > > I tried using */* but it didn't work for me, only specific MIME types > worked. Ok, noted, that sounds like a bug, I'll put it on my list. Cheers, Richard > > Hope this help, > cheers > Marco > > -------------------------------------------------- > Marco Fabiani > Postdoctoral Research Assistant > Centre for Digital Music > School of Electronic Engineering and Computer Science > Queen Mary, University of London > Mile End Road, London E1 4NS, UK > > On 30 Apr 2012, at 13:55, Hayden Young wrote: > > Hi Marco and Richard > > Closer still to a solution I think. > > Richard, I commented out the offending ingester: > > org.dspace.swordpackagers.SwordXifIngester = image/jpeg > > unfortunately, this did not solve the problem but I now get the same error > as if I attempt to ingest a PDF (I.e. file not found) so at least now there > is some consistency. I checked all permissions on my upload.tempdir; as > bitstreams are being successfully associated with items if I set the > mimetype to "application/zip" I am guessing my directory permissions are > correct? > > Marco, thanks for the suggestion. I did set the mime type as application/zip > and had some success with uploading the bitstreams; that is, the bitstream > is appearing within the item). There are two issues: > > 1. The file type is not detected and so it is given the file type "Unknown" > > 2. No matter which type of file or how many files are uploaded, the first > letter is always dropped from the file name. So, for example my_image.jpg > will be renamed y_image.jpg or my_document.pdf will be y_document.pdf. I > checked my mimetype settings and both image/jpeg and application/pdf are > registered. > > Therefore, I'm thinking could this be a swordv2 config issue? I have > attached in case it assists with diagnosis. > > Cheers > > > Hayden > > > > ------------------------------------------------------------------------------ > 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 > swo...@li... > https://lists.sourceforge.net/lists/listinfo/sword-app-tech > -- Richard Jones, Founder, Cottage Labs t: @richard_d_jones, @cottagelabs w: http://cottagelabs.com |
From: Marco F. <mar...@ee...> - 2012-04-30 14:47:08
|
Hi Hayden, Richard I was in the same situation you are in a few weeks ago, although I was trying what you are trying to do using the python client. Here is how I solved the problem: - create an atom entry (which works for you), with the header in_progress = True - add the file by posting to the "edit_media" url that I get in the deposit receipt from the previous entry creation. To do this, these are the headers I send: filename="myfile.xxx" (this will get the name right in DSpace) mimetype="application/zip" packaging="http://purl.org/net/sword/package/Binary" (this will force the use of the Binary ingester, which is detecting the MIME type automatically). I also slightly modified the BinaryIngester in DSpace because there was a small bug (which I reported). With these headers, and with "my" BinaryIngester, the file type is stored correctly. The only thing missing is the file's Description. I created a simple command line tool to send files to DSpace, you can find it here: Project: SWORD Uploader If you need the modified BinaryIngester, I can send you the compiled file (or the source if you prefer), if this could solve your problem. Another way of depositing many files is to use the SimpleZip ingester: just zip all the files and post them with packaging="http://purl.org/net/sword/package/SimpleZip" . This will create an entry with a title defined by the name of the zip file. If you send the header in-progess=True, the entry will remain open. You can then update the metadata using the appropriate command. Richard: >As long as the mime type is in the "accept" list, then you should be >able to use the correct mime type in the deposit (you could also set >your accepts config option to */*. I tried using */* but it didn't work for me, only specific MIME types worked. Hope this help, cheers Marco -------------------------------------------------- Marco Fabiani Postdoctoral Research Assistant Centre for Digital Music School of Electronic Engineering and Computer Science Queen Mary, University of London Mile End Road, London E1 4NS, UK On 30 Apr 2012, at 13:55, Hayden Young wrote: > Hi Marco and Richard > > Closer still to a solution I think. > > Richard, I commented out the offending ingester: > > org.dspace.swordpackagers.SwordXifIngester = image/jpeg > > unfortunately, this did not solve the problem but I now get the same error as if I attempt to ingest a PDF (I.e. file not found) so at least now there is some consistency. I checked all permissions on my upload.tempdir; as bitstreams are being successfully associated with items if I set the mimetype to "application/zip" I am guessing my directory permissions are correct? > > Marco, thanks for the suggestion. I did set the mime type as application/zip and had some success with uploading the bitstreams; that is, the bitstream is appearing within the item). There are two issues: > > 1. The file type is not detected and so it is given the file type "Unknown" > > 2. No matter which type of file or how many files are uploaded, the first letter is always dropped from the file name. So, for example my_image.jpg will be renamed y_image.jpg or my_document.pdf will be y_document.pdf. I checked my mimetype settings and both image/jpeg and application/pdf are registered. > > Therefore, I'm thinking could this be a swordv2 config issue? I have attached in case it assists with diagnosis. > > Cheers > > > Hayden > |
From: Richard J. <ri...@co...> - 2012-04-30 14:33:03
|
Hi Marco, Hayden, The particular ingester used is selected by the use of both mime type and the Packaging header in the deposit request. If you take a look at the config, you'll see different ingesters for different package uris, such as the SimpleZip or the Binary formats (which are standard SWORD types). If you don't supply a Packaging header it will default to Binary. As long as the mime type is in the "accept" list, then you should be able to use the correct mime type in the deposit (you could also set your accepts config option to */*. The particular exception that you are getting is difficult: I'm not sure I could diagnose without getting a debugger onto it. The offending line in the BinaryContentIngester gets the InputStream from the deposit object, so it's possible that that is the problem. Can you get a debugger onto it? Cheers, Richard On 30 April 2012 13:55, Hayden Young <hay...@wi...> wrote: > Hi Marco and Richard > > Closer still to a solution I think. > > Richard, I commented out the offending ingester: > > org.dspace.swordpackagers.SwordXifIngester = image/jpeg > > unfortunately, this did not solve the problem but I now get the same error > as if I attempt to ingest a PDF (I.e. file not found) so at least now there > is some consistency. I checked all permissions on my upload.tempdir; as > bitstreams are being successfully associated with items if I set the > mimetype to "application/zip" I am guessing my directory permissions are > correct? > > Marco, thanks for the suggestion. I did set the mime type as application/zip > and had some success with uploading the bitstreams; that is, the bitstream > is appearing within the item). There are two issues: > > 1. The file type is not detected and so it is given the file type "Unknown" > > 2. No matter which type of file or how many files are uploaded, the first > letter is always dropped from the file name. So, for example my_image.jpg > will be renamed y_image.jpg or my_document.pdf will be y_document.pdf. I > checked my mimetype settings and both image/jpeg and application/pdf are > registered. > > Therefore, I'm thinking could this be a swordv2 config issue? I have > attached in case it assists with diagnosis. > > Cheers > > > Hayden > > > On 30/04/12 19:54, Marco Fabiani wrote: > > Hi Hayden, > > when I add files to a resource in DSpace via Swordv2 (I use python), I > always set the MIME type as "application/zip", and let the BinaryIngester do > the ingestion. I tried setting jpeg and pdf types but never worked for me. > In the end, if the type is known, it will appear in DSpace anyway as a > recognised type (I think the ingester matches the extension with the types > registry). > > Hope this helps! > > Cheers, > Marco > > -------------------------------------------------- > Marco Fabiani > Postdoctoral Research Assistant > Centre for Digital Music > School of Electronic Engineering and Computer Science > Queen Mary, University of London > Mile End Road, London E1 4NS, UK > > On 30 Apr 2012, at 12:46, Richard Jones wrote: > > Hi Hayden, > > Looks like the Xif Ingester (which is part of the sword packagers > extension [1]) is configured in by default. You can just remove this > from the config, or you can install the packagers (which are pretty > experimental at this point). > > [1] https://bitbucket.org/richardjones/sword-packagers > > Your second error I'm not sure about - looks like perhaps the temp > file to be ingested isn't accessible; can you check the > swordv2-server.cfg property upload.tmpdir and see if it is set, > exists, is writable, is readable, etc. > > Cheers, > > Richard > > > On 30 April 2012 12:39, Hayden Young <hay...@wi...> wrote: > > Thanks all. > > > Stuart, taking your suggestion about adding the metadata then the > > bitstream, I'm a lot closer to a working solution. > > > $response = $client->depositAtomEntry(self::URL, self::USERNAME, > > self::PASSWORD, self::USERNAME, './tmp/atom_multipart_package', true); > > > where atom_multipart_package is my atom xml, successfully creates an > > item and populates the associated metadata fields. > > > However, > > > $response = > > $client->addExtraFileToMediaResource((string)$response->sac_edit_media_iri, > > self::USERNAME, self::PASSWORD, self::USERNAME, "./tmp/logo.jpg", > > 'image/jpeg', false); > > > is throwing an error, although I suspect this may be more of a DSpace > > configuration issue rather than an issue between the sword client and > > server. > > > The above will throw a DSpace error: > > > 30/04/2012 10:53:38 AM org.apache.catalina.core.StandardWrapperValve invoke > > SEVERE: Servlet.service() for servlet mediaresource threw exception > > org.dspace.core.PluginInstantiationException: Cannot load plugin class: > > java.lang.ClassNotFoundException: org.dspace.swordpackagers.SwordXifIngester > > at org.dspace.core.PluginManager.getNamedPlugin(PluginManager.java:459) > > at > > org.dspace.sword2.SwordIngesterFactory.getContentInstance(SwordIngesterFactory.java:49) > > at > > org.dspace.sword2.MediaResourceManagerDSpace.addContent(MediaResourceManagerDSpace.java:818) > > at > > org.dspace.sword2.MediaResourceManagerDSpace.addResource(MediaResourceManagerDSpace.java:553) > > at org.swordapp.server.MediaResourceAPI.post(MediaResourceAPI.java:239) > > at > > org.swordapp.server.servlets.MediaResourceServletDefault.doPost(MediaResourceServletDefault.java:49) > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) > > 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) > > Caused by: java.lang.ClassNotFoundException: > > org.dspace.swordpackagers.SwordXifIngester > > at > > org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1645) > > at > > org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491) > > at java.lang.Class.forName0(Native Method) > > at java.lang.Class.forName(Class.java:186) > > at org.dspace.core.PluginManager.getNamedPlugin(PluginManager.java:424) > > ... 19 more > > > > Alternatively, if I try a PDF > > > $response = > > $client->addExtraFileToMediaResource((string)$response->sac_edit_media_iri, > > self::USERNAME, self::PASSWORD, self::USERNAME, "./tmp/logo.pdf", > > 'application/pdf', false); > > > DSpace throws the error: > > > <html><head><title>Apache Tomcat/6.0.28 - Error > > report</title><style><!--H1 > > {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} > > H2 > > {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} > > H3 > > {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} > > BODY > > {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B > > {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} > > P > > {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A > > {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> > > </head><body><h1>HTTP Status 500 - </h1><HR size="1" > > noshade="noshade"><p><b>type</b> Exception report</p><p><b>message</b> > > <u></u></p><p><b>description</b> <u>The server encountered an internal > > error () that prevented it from fulfilling this > > request.</u></p><p><b>exception</b> <pre>javax.servlet.ServletException: > > org.swordapp.server.SwordServerException: There was a problem depositing > > the item > > org.swordapp.server.MediaResourceAPI.post(MediaResourceAPI.java:270) > > > org.swordapp.server.servlets.MediaResourceServletDefault.doPost(MediaResourceServletDefault.java:49) > > javax.servlet.http.HttpServlet.service(HttpServlet.java:637) > > javax.servlet.http.HttpServlet.service(HttpServlet.java:717) > > </pre></p><p><b>root cause</b> > > <pre>org.swordapp.server.SwordServerException: There was a problem > > depositing the item > > > org.dspace.sword2.MediaResourceManagerDSpace.addResource(MediaResourceManagerDSpace.java:633) > > org.swordapp.server.MediaResourceAPI.post(MediaResourceAPI.java:239) > > > org.swordapp.server.servlets.MediaResourceServletDefault.doPost(MediaResourceServletDefault.java:49) > > javax.servlet.http.HttpServlet.service(HttpServlet.java:637) > > javax.servlet.http.HttpServlet.service(HttpServlet.java:717) > > </pre></p><p><b>root cause</b> > > <pre>org.dspace.sword2.DSpaceSwordException: java.io.IOException: No > > such file or directory > > > org.dspace.sword2.BinaryContentIngester.ingestToItem(BinaryContentIngester.java:183) > > > org.dspace.sword2.BinaryContentIngester.ingest(BinaryContentIngester.java:46) > > > org.dspace.sword2.BinaryContentIngester.ingest(BinaryContentIngester.java:34) > > > org.dspace.sword2.MediaResourceManagerDSpace.addContent(MediaResourceManagerDSpace.java:822) > > > org.dspace.sword2.MediaResourceManagerDSpace.addResource(MediaResourceManagerDSpace.java:553) > > org.swordapp.server.MediaResourceAPI.post(MediaResourceAPI.java:239) > > > org.swordapp.server.servlets.MediaResourceServletDefault.doPost(MediaResourceServletDefault.java:49) > > javax.servlet.http.HttpServlet.service(HttpServlet.java:637) > > javax.servlet.http.HttpServlet.service(HttpServlet.java:717) > > </pre></p><p><b>root cause</b> <pre>java.io.IOException: No such file or > > directory > > java.io.UnixFileSystem.createFileExclusively(Native Method) > > java.io.File.createNewFile(File.java:900) > > edu.sdsc.grid.io.local.LocalFile.createNewFile(LocalFile.java:486) > > > org.dspace.storage.bitstore.BitstreamStorageManager.store(BitstreamStorageManager.java:300) > > org.dspace.content.Bitstream.create(Bitstream.java:205) > > org.dspace.content.Bundle.createBitstream(Bundle.java:384) > > org.dspace.content.Item.createSingleBitstream(Item.java:1345) > > org.dspace.content.Item.createSingleBitstream(Item.java:1365) > > > org.dspace.sword2.BinaryContentIngester.ingestToItem(BinaryContentIngester.java:148) > > > org.dspace.sword2.BinaryContentIngester.ingest(BinaryContentIngester.java:46) > > > org.dspace.sword2.BinaryContentIngester.ingest(BinaryContentIngester.java:34) > > > org.dspace.sword2.MediaResourceManagerDSpace.addContent(MediaResourceManagerDSpace.java:822) > > > org.dspace.sword2.MediaResourceManagerDSpace.addResource(MediaResourceManagerDSpace.java:553) > > org.swordapp.server.MediaResourceAPI.post(MediaResourceAPI.java:239) > > > org.swordapp.server.servlets.MediaResourceServletDefault.doPost(MediaResourceServletDefault.java:49) > > javax.servlet.http.HttpServlet.service(HttpServlet.java:637) > > javax.servlet.http.HttpServlet.service(HttpServlet.java:717) > > </pre></p><p><b>note</b> <u>The full stack trace of the root cause is > > available in the Apache Tomcat/6.0.28 logs.</u></p><HR size="1" > > noshade="noshade"><h3>Apache Tomcat/6.0.28</h3></body></html> > > > Cheers > > > > Hayden > > > On 30/04/12 16:20, Richard Jones wrote: > > Hi Guys, > > > It looks like you are making progress. Just to add that the existing > > SWORDv2 implementation in DSpace is pretty experimental, but I have > > been working through it in the last couple of weeks, finding and > > fixing all the oddities that I can find. This is all happening in a > > fork I have made of the github repo, from the 1.8.2 release: > > > https://github.com/nye-duo/DSpace/tree/duo > > > I hope to have this stable in the next couple of weeks, but note that > > I'm not currently trying to get the multipart issues resolved, just > > all the other bits and bobs. > > > Cheers, > > > Richard > > > On 30 April 2012 09:09, LEWIS Stuart<Stu...@ed...> wrote: > > Hi Hayden, > > > The two options would be either: > > > PackagerMetsSwap::create (to create a METS/SWAP package, which can be used > in SWORD v1 or v2), followed by SWORDAppClient::deposit to deposit the > package > > > Or > > > SWORDAppClient::depositAtomEntry to create the metadata-only object, > followed by SWORDAppClient::addExtraFileToMediaResource > > > (I think that should work - I've not got a computer set up with this code > running right now). > > > Thanks, > > > > Stuart > > > > > -- > > The University of Edinburgh is a charitable body, registered in > > Scotland, with registration number SC005336. > > > > -----Original Message----- > > From: Hayden Young [mailto:hay...@wi...] > > Sent: 30 April 2012 08:55 > > To: LEWIS Stuart > > Cc: swo...@li... > > Subject: Re: [sword-app-tech] depositMultipart always results in a 500 error > > > Hi Stuart > > > Thanks for your assistance. > > > So if I need to use a two step process to deposit an item to DSpace, am I > using the correct methods to overcome DSpace's SWORDv2 limitations? > > > I.e. > > > SWORDAppClient::deposit to create the item > > > SWORDAppClient::replaceMetadata or > > SWORDAppClient::replaceMetadataWithFile to update the item's metadata. > > > > > On 30/04/12 15:32, LEWIS Stuart wrote: > > Hi Hayden, > > > === > > 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 > > > 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? > > === > > > I don't think that is what should be causing it - when replacing metadata > (the first case, depositing a new atom entry) no filename > (content-disposition) is required. See the example in the spec at "6.5.2. > Replacing the Metadata of a Resource". > > > In the second case, the problem might be that you're trying to deposit a > package (zip file, SWORD v1-style, which requires the use of the deposit() > function) using the depositMultipartByMethod function. This requires a > multipart file, which can be created using the packager_atom_multipart.php > class. For an example of this in use, see > test/test-packager-atom_multipart.php > > > Thanks, > > > > Stuart > > > -- > > Hayden Young > > Managing Director > > Wijiti Pty Ltd > > p. +61 (0) 08 6398 5010 > > e. hay...@wi... > > 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 > > swo...@li... > > https://lists.sourceforge.net/lists/listinfo/sword-app-tech > > > > > -- > > Hayden Young > > Managing Director > > Wijiti Pty Ltd > > p. +61 (0) 08 6398 5010 > > e. hay...@wi... > > 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 > > swo...@li... > > https://lists.sourceforge.net/lists/listinfo/sword-app-tech > > > > > -- > > Richard Jones, > > Founder, Cottage Labs > t: @richard_d_jones, @cottagelabs > w: http://cottagelabs.com > > ------------------------------------------------------------------------------ > 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 > swo...@li... > https://lists.sourceforge.net/lists/listinfo/sword-app-tech > > > > > ------------------------------------------------------------------------------ > 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 > swo...@li... > https://lists.sourceforge.net/lists/listinfo/sword-app-tech > > > -- > Hayden Young > Managing Director > Wijiti Pty Ltd > p. +61 (0) 08 6398 5010 > e. hay...@wi... > 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 > swo...@li... > https://lists.sourceforge.net/lists/listinfo/sword-app-tech > -- Richard Jones, Founder, Cottage Labs t: @richard_d_jones, @cottagelabs w: http://cottagelabs.com |
From: Hayden Y. <hay...@wi...> - 2012-04-30 13:20:04
|
#---------------------------------------------------------------# #----------------SWORD 2.0 SERVER CONFIGURATIONS----------------# #---------------------------------------------------------------# # These configs are only used by the SWORD Server interface, # # version 2.0 (used by DSpace to accept ingest packages via # # SWORD 2.0 protocol) # #---------------------------------------------------------------# # the base url of the sword 2.0 system # # the default if {dspace.url}/swordv2 # url = http://ubuntu1104.wijiti.local:8080/i/saber/swordv2 # The base URL of the SWORD collection. This is the URL from # which DSpace will construct the deposit location urls for # collections. # # The default is {dspace.url}/swordv2/collection # # In the event that you are not deploying DSpace as the ROOT # application in the servlet container, this will generate # incorrect URLs, and you should override the functionality # by specifying in full as below: # collection.url = http://ubuntu1104.wijiti.local:8080/i/saber/swordv2/collection # The base URL of the SWORD service document. This is the # URL from which DSpace will construct the service document # location urls for the site, and for individual collections # # The default is {dspace.url}/swordv2/servicedocument # # In the event that you are not deploying DSpace as the ROOT # application in the servlet container, this will generate # incorrect URLs, and you should override the functionality # by specifying in full as below: # servicedocument.url = http://ubuntu1104.wijiti.local:8080/i/saber/swordv2/servicedocument # The accept packaging properties, along with their associated # quality values where appropriate. # # Global settings; these will be used on all DSpace collections # accept-packaging.collection.METSDSpaceSIP = http://purl.org/net/sword/package/METSDSpaceSIP accept-packaging.collection.SimpleZip = http://purl.org/net/sword/package/SimpleZip accept-packaging.collection.Binary = http://purl.org/net/sword/package/Binary # The accept packaging properties for items. This is used to determine # which package types are acceptable to deposit into an existing item, # either adding to or replacing the media resource # accept-packaging.item.METSDSpaceSIP = http://purl.org/net/sword/package/METSDSpaceSIP accept-packaging.item.SimpleZip = http://purl.org/net/sword/package/SimpleZip accept-packaging.item.Binary = http://purl.org/net/sword/package/Binary # A comma separated list of MIME types that SWORD will accept accepts = application/zip, image/jpeg, application/pdf # Collection Specific settings: these will be used on the collections # with the given handles # #accept-packaging.collection.[handle].METSDSpaceSIP = http://purl.org/net/sword-types/METSDSpaceSIP # Should the server offer as the default the list of all Communities # to a Service Document request. If false, the server will offer # the list of all collections, which is the default and recommended # behaviour at this stage. # # NOTE: a service document for Communities will not offer any viable # deposit targets, and the client will need to request the list of # Collections in the target before deposit can continue # expose-communities = false allow-community-deposit = false # The maximum upload size of a package through the sword interface, # in bytes # # This will be the combined size of all the files, the metadata and # any manifest data. It is NOT the same as the maximum size set # for an individual file upload through the user interface. If not # set, or set to 0, the sword service will default to no limit. # max-upload-size = 0 # Should DSpace store a copy of the original sword deposit package? # # NOTE: this will cause the deposit process to run slightly slower, # and will accelerate the rate at which the repository consumes disk # space. BUT, it will also mean that the deposited packages are # recoverable in their original form. It is strongly recommended, # therefore, to leave this option turned on # keep-original-package = true # The bundle name that SWORD should store incoming packages under if # keep-original-package is set to true. The default is "SWORD" # if not value is set # # bundle.name = SWORD # In the event of package ingest failure, provide an option to store # the package on the file system. The default is false. #keep-package-on-fail=false #failed-package.dir=http://localhost:8080/upload # Should we support mediated deposit via sword? Enabled, this will # allow users to deposit content packages on behalf of other users. # # See the SWORD specification for a detailed explanation of deposit # On-Behalf-Of another user # on-behalf-of.enable = true # The URL which identifies the sword software which provides # the sword interface. This is the URL which DSpace will use # to fill out the atom:generator element of its atom documents. # # The default is: # # http://www.dspace.org/ns/sword/2.0/ # # If you have modified your sword software, you should change # this URI to identify your own version. If you are using the # standard dspace-sword module you will not, in general, need # to change this setting # generator.url = http://www.dspace.org/ns/sword/2.0/ # Which version of SWORD is being used generator.version = 2.0 # The form of authentication to use # This is normally set to 'basic' for HTTP Basic auth-type = Basic # The location where uploaded files and packages are # stored while being processed upload.tempdir = /home/dspace/instances/saber/upload # The metadata field in which to store the updated date for # items deposited via SWORD. updated.field = dc.date.updated # The metadata field in which to store the value of the slug # header if it is supplied slug.field = dc.identifier.slug # The metadata field in which to store the value of the # atom entry author if it is supplied author.field = dc.contributor.author # The metadata field in which to store the value of the # atom entry title if it is supplied title.field = dc.title # Supported packaging formats for the dissemination of packages disseminate-packaging.METSDSpaceSIP = http://purl.org/net/sword/package/METSDSpaceSIP disseminate-packaging.SimpleZip = http://purl.org/net/sword/package/SimpleZip # Configure the plugins to process incoming packages. The form of this # configuration is as per the Plugin Manager's Named Plugin documentation: # # plugin.named.[interface] = [implementation] = [package format identifier] \ # # Package ingesters should implement the SWORDIngester interface, and # will be loaded when a package of the format specified above in: # # accept-packaging.[package format].identifier = [package format identifier] # # is received. # # In the event that this is a simple file deposit, with no package # format, then the class named by "SimpleFileIngester" will be loaded # and executed where appropriate. This case will only occur when a single # file is being deposited into an existing DSpace Item # plugin.named.org.dspace.sword2.SwordContentIngester = \ org.dspace.sword2.SimpleZipContentIngester = http://purl.org/net/sword/package/SimpleZip, \ org.dspace.sword2.SwordMETSContentIngester = http://purl.org/net/sword/package/METSDSpaceSIP, \ org.dspace.sword2.BinaryContentIngester = http://purl.org/net/sword/package/Binary, \ org.dspace.swordpackagers.SwordDocXIngester = application/vnd.openxmlformats-officedocument.wordprocessingml.document #, \ # org.dspace.swordpackagers.SwordXifIngester = image/jpeg plugin.single.org.dspace.sword2.SwordEntryIngester = \ org.dspace.sword2.SimpleDCEntryIngester plugin.single.org.dspace.sword2.SwordEntryDisseminator = \ org.dspace.sword2.SimpleDCEntryDisseminator # note that we replace ";" with "_" as ";" is not permitted in the PluginManager names plugin.named.org.dspace.sword2.SwordContentDisseminator = \ org.dspace.sword2.SimpleZipContentDisseminator = http://purl.org/net/sword/package/SimpleZip, \ org.dspace.sword2.FeedContentDisseminator = application/atom+xml, \ org.dspace.sword2.FeedContentDisseminator = application/atom+xml_type_feed # note that we replace ";" with "_" as ";" is not permitted in the PluginManager names plugin.named.org.dspace.sword2.SwordStatementDisseminator = \ org.dspace.sword2.AtomStatementDisseminator = atom, \ org.dspace.sword2.OreStatementDisseminator = rdf, \ org.dspace.sword2.AtomStatementDisseminator = application/atom+xml_type_feed, \ org.dspace.sword2.OreStatementDisseminator = application/rdf+xml plugin.single.org.dspace.sword2.WorkflowManager = \ org.dspace.sword2.WorkflowManagerDefault # tell the SWORD METS implementation which package ingester to use # to install deposited content. This should refer to one of the # classes configured for: # # plugin.named.org.dspace.content.packager.PackageIngester plugin.named.org.dspace.content.packager.PackageIngester = \ org.dspace.content.packager.DSpaceMETSIngester = METS # # The value of mets-ingester.package-ingester tells the # system which named plugin for this interface should be used # to ingest SWORD METS packages # # The default is METS # # mets-ingester.package-ingester = METS # Should the sword server enable restore-mode when ingesting new # packages. If this is enabled the item will be treated as a # previously deleted item from the repository. If the item had # previously been assigned a handle then that same handle will be # restored to activity. restore-mode.enable = false # metadata field mapping for SimpleDCEntryIngester # simpledc.abstract = dc.description.abstract simpledc.accessRights = dc.rights #simpledc.accrualMethod = dc.???? #simpledc.accrualPeriodicity = dc.???? #simpledc.accrualPolicy = dc.???? simpledc.alternative = dc.title.alternative #simpledc.audience = dc.??? simpledc.available = dc.date.available simpledc.bibliographicCitation = dc.identifier.citation #simpledc.conformsTo = dc.???? simpledc.contributor = dc.contributor simpledc.coverage = dc.coverage simpledc.created = dc.date.created simpledc.creator = dc.contributor.author simpledc.date = dc.date simpledc.dateAccepted = dc.date.accepted simpledc.dateCopyrighted = dc.date.??? simpledc.dateSubmitted = dc.date.submitted simpledc.description = dc.description #simpledc.educationLevel = dc.??? simpledc.extent = dc.format.extent simpledc.format = dc.format #simpledc.hasFormat = dc.???? #simpledc.hasPart = dc.??? #simpledc.hasVersion = dc.??? simpledc.identifier = dc.identifier #simpledc.instructionalMethod = dc.??? #simpledc.isFormatOf = dc.??? simpledc.isPartOf = dc.relation.ispartof simpledc.isReferencedBy = dc.relation.isreferencedby simpledc.isReplacedBy = dc.relation.isreplacedby simpledc.isRequiredBy = dc.relation.isrequiredby simpledc.issued = dc.date.issued #simpledc.isVersionOf = dc.???? simpledc.language = dc.language #simpledc.license = dc.???? #simpledc.mediator = dc.???? simpledc.medium = dc.format.medium simpledc.modified = dc.date.modified simpledc.provenance = dc.description.provenance simpledc.publisher = dc.publisher simpledc.references = dc.relation.references simpledc.relation = dc.relation simpledc.replaces = dc.relation.replaces simpledc.requires = dc.relation.requires simpledc.rights = dc.rights simpledc.rightsHolder = dc.rights simpledc.source = dc.source simpledc.spatial = dc.coverage.spatial simpledc.subject = dc.subject #simpledc.tableOfContents = dc.???? simpledc.temporal = dc.coverage.temporal simpledc.title = dc.title simpledc.type = dc.type #simpledc.valid = dc.???? # order of precedence for importing multipart content. if entry-first then # metadata in the package will override metadata in the entry, otherwise # the entry metadata will be applied before the package metadata, so the # package may override the metadata supplied in the entry - it depends on # the specific behaviour of the package ingester selected # # Defaults to false multipart.entry-first = false # if the workflow gets started, should there be a notification # email sent # workflow.notify = true # when content is replaced, should the old version of the content be kept? This # creates a copy of the ORIGINAL bundle with the name V_YYYY-MM-DD.X where YYYY-MM-DD # is the date the copy was created, and X is an integer from 0 upwards. # versions.keep = true state.workspace.uri = http://ubuntu1104.wijiti.local:8080/i/saber/state/inprogress state.workspace.description = The item is in the user workspace state.workflow.uri = http://ubuntu1104.wijiti.local:8080/i/saber/state/inreview state.workflow.description = The item is undergoing review prior to acceptance to the archive state.archive.uri = http://ubuntu1104.wijiti.local:8080/i/saber/state/archived state.archive.description = The item has been archived state.withdrawn.uri = http://ubuntu1104.wijiti.local:8080/i/saber/state/withdrawn state.withdrawn.description = The item has been withdrawn from the item and is no longer available |
From: Marco F. <mar...@ee...> - 2012-04-30 11:54:41
|
Hi Hayden, when I add files to a resource in DSpace via Swordv2 (I use python), I always set the MIME type as "application/zip", and let the BinaryIngester do the ingestion. I tried setting jpeg and pdf types but never worked for me. In the end, if the type is known, it will appear in DSpace anyway as a recognised type (I think the ingester matches the extension with the types registry). Hope this helps! Cheers, Marco -------------------------------------------------- Marco Fabiani Postdoctoral Research Assistant Centre for Digital Music School of Electronic Engineering and Computer Science Queen Mary, University of London Mile End Road, London E1 4NS, UK On 30 Apr 2012, at 12:46, Richard Jones wrote: > Hi Hayden, > > Looks like the Xif Ingester (which is part of the sword packagers > extension [1]) is configured in by default. You can just remove this > from the config, or you can install the packagers (which are pretty > experimental at this point). > > [1] https://bitbucket.org/richardjones/sword-packagers > > Your second error I'm not sure about - looks like perhaps the temp > file to be ingested isn't accessible; can you check the > swordv2-server.cfg property upload.tmpdir and see if it is set, > exists, is writable, is readable, etc. > > Cheers, > > Richard > > > On 30 April 2012 12:39, Hayden Young <hay...@wi...> wrote: >> Thanks all. >> >> Stuart, taking your suggestion about adding the metadata then the >> bitstream, I'm a lot closer to a working solution. >> >> $response = $client->depositAtomEntry(self::URL, self::USERNAME, >> self::PASSWORD, self::USERNAME, './tmp/atom_multipart_package', true); >> >> where atom_multipart_package is my atom xml, successfully creates an >> item and populates the associated metadata fields. >> >> However, >> >> $response = >> $client->addExtraFileToMediaResource((string)$response->sac_edit_media_iri, >> self::USERNAME, self::PASSWORD, self::USERNAME, "./tmp/logo.jpg", >> 'image/jpeg', false); >> >> is throwing an error, although I suspect this may be more of a DSpace >> configuration issue rather than an issue between the sword client and >> server. >> >> The above will throw a DSpace error: >> >> 30/04/2012 10:53:38 AM org.apache.catalina.core.StandardWrapperValve invoke >> SEVERE: Servlet.service() for servlet mediaresource threw exception >> org.dspace.core.PluginInstantiationException: Cannot load plugin class: >> java.lang.ClassNotFoundException: org.dspace.swordpackagers.SwordXifIngester >> at org.dspace.core.PluginManager.getNamedPlugin(PluginManager.java:459) >> at >> org.dspace.sword2.SwordIngesterFactory.getContentInstance(SwordIngesterFactory.java:49) >> at >> org.dspace.sword2.MediaResourceManagerDSpace.addContent(MediaResourceManagerDSpace.java:818) >> at >> org.dspace.sword2.MediaResourceManagerDSpace.addResource(MediaResourceManagerDSpace.java:553) >> at org.swordapp.server.MediaResourceAPI.post(MediaResourceAPI.java:239) >> at >> org.swordapp.server.servlets.MediaResourceServletDefault.doPost(MediaResourceServletDefault.java:49) >> at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) >> 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) >> Caused by: java.lang.ClassNotFoundException: >> org.dspace.swordpackagers.SwordXifIngester >> at >> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1645) >> at >> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491) >> at java.lang.Class.forName0(Native Method) >> at java.lang.Class.forName(Class.java:186) >> at org.dspace.core.PluginManager.getNamedPlugin(PluginManager.java:424) >> ... 19 more >> >> >> Alternatively, if I try a PDF >> >> $response = >> $client->addExtraFileToMediaResource((string)$response->sac_edit_media_iri, >> self::USERNAME, self::PASSWORD, self::USERNAME, "./tmp/logo.pdf", >> 'application/pdf', false); >> >> DSpace throws the error: >> >> <html><head><title>Apache Tomcat/6.0.28 - Error >> report</title><style><!--H1 >> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} >> H2 >> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} >> H3 >> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} >> BODY >> {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B >> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} >> P >> {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A >> {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> >> </head><body><h1>HTTP Status 500 - </h1><HR size="1" >> noshade="noshade"><p><b>type</b> Exception report</p><p><b>message</b> >> <u></u></p><p><b>description</b> <u>The server encountered an internal >> error () that prevented it from fulfilling this >> request.</u></p><p><b>exception</b> <pre>javax.servlet.ServletException: >> org.swordapp.server.SwordServerException: There was a problem depositing >> the item >> org.swordapp.server.MediaResourceAPI.post(MediaResourceAPI.java:270) >> >> org.swordapp.server.servlets.MediaResourceServletDefault.doPost(MediaResourceServletDefault.java:49) >> javax.servlet.http.HttpServlet.service(HttpServlet.java:637) >> javax.servlet.http.HttpServlet.service(HttpServlet.java:717) >> </pre></p><p><b>root cause</b> >> <pre>org.swordapp.server.SwordServerException: There was a problem >> depositing the item >> >> org.dspace.sword2.MediaResourceManagerDSpace.addResource(MediaResourceManagerDSpace.java:633) >> org.swordapp.server.MediaResourceAPI.post(MediaResourceAPI.java:239) >> >> org.swordapp.server.servlets.MediaResourceServletDefault.doPost(MediaResourceServletDefault.java:49) >> javax.servlet.http.HttpServlet.service(HttpServlet.java:637) >> javax.servlet.http.HttpServlet.service(HttpServlet.java:717) >> </pre></p><p><b>root cause</b> >> <pre>org.dspace.sword2.DSpaceSwordException: java.io.IOException: No >> such file or directory >> >> org.dspace.sword2.BinaryContentIngester.ingestToItem(BinaryContentIngester.java:183) >> >> org.dspace.sword2.BinaryContentIngester.ingest(BinaryContentIngester.java:46) >> >> org.dspace.sword2.BinaryContentIngester.ingest(BinaryContentIngester.java:34) >> >> org.dspace.sword2.MediaResourceManagerDSpace.addContent(MediaResourceManagerDSpace.java:822) >> >> org.dspace.sword2.MediaResourceManagerDSpace.addResource(MediaResourceManagerDSpace.java:553) >> org.swordapp.server.MediaResourceAPI.post(MediaResourceAPI.java:239) >> >> org.swordapp.server.servlets.MediaResourceServletDefault.doPost(MediaResourceServletDefault.java:49) >> javax.servlet.http.HttpServlet.service(HttpServlet.java:637) >> javax.servlet.http.HttpServlet.service(HttpServlet.java:717) >> </pre></p><p><b>root cause</b> <pre>java.io.IOException: No such file or >> directory >> java.io.UnixFileSystem.createFileExclusively(Native Method) >> java.io.File.createNewFile(File.java:900) >> edu.sdsc.grid.io.local.LocalFile.createNewFile(LocalFile.java:486) >> >> org.dspace.storage.bitstore.BitstreamStorageManager.store(BitstreamStorageManager.java:300) >> org.dspace.content.Bitstream.create(Bitstream.java:205) >> org.dspace.content.Bundle.createBitstream(Bundle.java:384) >> org.dspace.content.Item.createSingleBitstream(Item.java:1345) >> org.dspace.content.Item.createSingleBitstream(Item.java:1365) >> >> org.dspace.sword2.BinaryContentIngester.ingestToItem(BinaryContentIngester.java:148) >> >> org.dspace.sword2.BinaryContentIngester.ingest(BinaryContentIngester.java:46) >> >> org.dspace.sword2.BinaryContentIngester.ingest(BinaryContentIngester.java:34) >> >> org.dspace.sword2.MediaResourceManagerDSpace.addContent(MediaResourceManagerDSpace.java:822) >> >> org.dspace.sword2.MediaResourceManagerDSpace.addResource(MediaResourceManagerDSpace.java:553) >> org.swordapp.server.MediaResourceAPI.post(MediaResourceAPI.java:239) >> >> org.swordapp.server.servlets.MediaResourceServletDefault.doPost(MediaResourceServletDefault.java:49) >> javax.servlet.http.HttpServlet.service(HttpServlet.java:637) >> javax.servlet.http.HttpServlet.service(HttpServlet.java:717) >> </pre></p><p><b>note</b> <u>The full stack trace of the root cause is >> available in the Apache Tomcat/6.0.28 logs.</u></p><HR size="1" >> noshade="noshade"><h3>Apache Tomcat/6.0.28</h3></body></html> >> >> Cheers >> >> >> Hayden >> >> On 30/04/12 16:20, Richard Jones wrote: >>> Hi Guys, >>> >>> It looks like you are making progress. Just to add that the existing >>> SWORDv2 implementation in DSpace is pretty experimental, but I have >>> been working through it in the last couple of weeks, finding and >>> fixing all the oddities that I can find. This is all happening in a >>> fork I have made of the github repo, from the 1.8.2 release: >>> >>> https://github.com/nye-duo/DSpace/tree/duo >>> >>> I hope to have this stable in the next couple of weeks, but note that >>> I'm not currently trying to get the multipart issues resolved, just >>> all the other bits and bobs. >>> >>> Cheers, >>> >>> Richard >>> >>> On 30 April 2012 09:09, LEWIS Stuart<Stu...@ed...> wrote: >>>> Hi Hayden, >>>> >>>> The two options would be either: >>>> >>>> PackagerMetsSwap::create (to create a METS/SWAP package, which can be used in SWORD v1 or v2), followed by SWORDAppClient::deposit to deposit the package >>>> >>>> Or >>>> >>>> SWORDAppClient::depositAtomEntry to create the metadata-only object, followed by SWORDAppClient::addExtraFileToMediaResource >>>> >>>> (I think that should work - I've not got a computer set up with this code running right now). >>>> >>>> Thanks, >>>> >>>> >>>> Stuart >>>> >>>> >>>> >>>> -- >>>> The University of Edinburgh is a charitable body, registered in >>>> Scotland, with registration number SC005336. >>>> >>>> >>>> -----Original Message----- >>>> From: Hayden Young [mailto:hay...@wi...] >>>> Sent: 30 April 2012 08:55 >>>> To: LEWIS Stuart >>>> Cc: swo...@li... >>>> Subject: Re: [sword-app-tech] depositMultipart always results in a 500 error >>>> >>>> Hi Stuart >>>> >>>> Thanks for your assistance. >>>> >>>> So if I need to use a two step process to deposit an item to DSpace, am I using the correct methods to overcome DSpace's SWORDv2 limitations? >>>> >>>> I.e. >>>> >>>> SWORDAppClient::deposit to create the item >>>> >>>> SWORDAppClient::replaceMetadata or >>>> SWORDAppClient::replaceMetadataWithFile to update the item's metadata. >>>> >>>> >>>> >>>> On 30/04/12 15:32, LEWIS Stuart wrote: >>>>> Hi Hayden, >>>>> >>>>> === >>>>> 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 >>>>> >>>>> 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? >>>>> === >>>>> >>>>> I don't think that is what should be causing it - when replacing metadata (the first case, depositing a new atom entry) no filename (content-disposition) is required. See the example in the spec at "6.5.2. Replacing the Metadata of a Resource". >>>>> >>>>> In the second case, the problem might be that you're trying to deposit a package (zip file, SWORD v1-style, which requires the use of the deposit() function) using the depositMultipartByMethod function. This requires a multipart file, which can be created using the packager_atom_multipart.php class. For an example of this in use, see test/test-packager-atom_multipart.php >>>>> >>>>> Thanks, >>>>> >>>>> >>>>> Stuart >>>>> >>>> -- >>>> Hayden Young >>>> Managing Director >>>> Wijiti Pty Ltd >>>> p. +61 (0) 08 6398 5010 >>>> e. hay...@wi... >>>> 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 >>>> swo...@li... >>>> https://lists.sourceforge.net/lists/listinfo/sword-app-tech >>> >>> >> >> -- >> Hayden Young >> Managing Director >> Wijiti Pty Ltd >> p. +61 (0) 08 6398 5010 >> e. hay...@wi... >> 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 >> swo...@li... >> https://lists.sourceforge.net/lists/listinfo/sword-app-tech > > > > -- > > Richard Jones, > > Founder, Cottage Labs > t: @richard_d_jones, @cottagelabs > w: http://cottagelabs.com > > ------------------------------------------------------------------------------ > 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 > swo...@li... > https://lists.sourceforge.net/lists/listinfo/sword-app-tech |
From: Richard J. <ri...@co...> - 2012-04-30 11:47:10
|
Hi Hayden, Looks like the Xif Ingester (which is part of the sword packagers extension [1]) is configured in by default. You can just remove this from the config, or you can install the packagers (which are pretty experimental at this point). [1] https://bitbucket.org/richardjones/sword-packagers Your second error I'm not sure about - looks like perhaps the temp file to be ingested isn't accessible; can you check the swordv2-server.cfg property upload.tmpdir and see if it is set, exists, is writable, is readable, etc. Cheers, Richard On 30 April 2012 12:39, Hayden Young <hay...@wi...> wrote: > Thanks all. > > Stuart, taking your suggestion about adding the metadata then the > bitstream, I'm a lot closer to a working solution. > > $response = $client->depositAtomEntry(self::URL, self::USERNAME, > self::PASSWORD, self::USERNAME, './tmp/atom_multipart_package', true); > > where atom_multipart_package is my atom xml, successfully creates an > item and populates the associated metadata fields. > > However, > > $response = > $client->addExtraFileToMediaResource((string)$response->sac_edit_media_iri, > self::USERNAME, self::PASSWORD, self::USERNAME, "./tmp/logo.jpg", > 'image/jpeg', false); > > is throwing an error, although I suspect this may be more of a DSpace > configuration issue rather than an issue between the sword client and > server. > > The above will throw a DSpace error: > > 30/04/2012 10:53:38 AM org.apache.catalina.core.StandardWrapperValve invoke > SEVERE: Servlet.service() for servlet mediaresource threw exception > org.dspace.core.PluginInstantiationException: Cannot load plugin class: > java.lang.ClassNotFoundException: org.dspace.swordpackagers.SwordXifIngester > at org.dspace.core.PluginManager.getNamedPlugin(PluginManager.java:459) > at > org.dspace.sword2.SwordIngesterFactory.getContentInstance(SwordIngesterFactory.java:49) > at > org.dspace.sword2.MediaResourceManagerDSpace.addContent(MediaResourceManagerDSpace.java:818) > at > org.dspace.sword2.MediaResourceManagerDSpace.addResource(MediaResourceManagerDSpace.java:553) > at org.swordapp.server.MediaResourceAPI.post(MediaResourceAPI.java:239) > at > org.swordapp.server.servlets.MediaResourceServletDefault.doPost(MediaResourceServletDefault.java:49) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) > 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) > Caused by: java.lang.ClassNotFoundException: > org.dspace.swordpackagers.SwordXifIngester > at > org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1645) > at > org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:186) > at org.dspace.core.PluginManager.getNamedPlugin(PluginManager.java:424) > ... 19 more > > > Alternatively, if I try a PDF > > $response = > $client->addExtraFileToMediaResource((string)$response->sac_edit_media_iri, > self::USERNAME, self::PASSWORD, self::USERNAME, "./tmp/logo.pdf", > 'application/pdf', false); > > DSpace throws the error: > > <html><head><title>Apache Tomcat/6.0.28 - Error > report</title><style><!--H1 > {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} > H2 > {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} > H3 > {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} > BODY > {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B > {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} > P > {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A > {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> > </head><body><h1>HTTP Status 500 - </h1><HR size="1" > noshade="noshade"><p><b>type</b> Exception report</p><p><b>message</b> > <u></u></p><p><b>description</b> <u>The server encountered an internal > error () that prevented it from fulfilling this > request.</u></p><p><b>exception</b> <pre>javax.servlet.ServletException: > org.swordapp.server.SwordServerException: There was a problem depositing > the item > org.swordapp.server.MediaResourceAPI.post(MediaResourceAPI.java:270) > > org.swordapp.server.servlets.MediaResourceServletDefault.doPost(MediaResourceServletDefault.java:49) > javax.servlet.http.HttpServlet.service(HttpServlet.java:637) > javax.servlet.http.HttpServlet.service(HttpServlet.java:717) > </pre></p><p><b>root cause</b> > <pre>org.swordapp.server.SwordServerException: There was a problem > depositing the item > > org.dspace.sword2.MediaResourceManagerDSpace.addResource(MediaResourceManagerDSpace.java:633) > org.swordapp.server.MediaResourceAPI.post(MediaResourceAPI.java:239) > > org.swordapp.server.servlets.MediaResourceServletDefault.doPost(MediaResourceServletDefault.java:49) > javax.servlet.http.HttpServlet.service(HttpServlet.java:637) > javax.servlet.http.HttpServlet.service(HttpServlet.java:717) > </pre></p><p><b>root cause</b> > <pre>org.dspace.sword2.DSpaceSwordException: java.io.IOException: No > such file or directory > > org.dspace.sword2.BinaryContentIngester.ingestToItem(BinaryContentIngester.java:183) > > org.dspace.sword2.BinaryContentIngester.ingest(BinaryContentIngester.java:46) > > org.dspace.sword2.BinaryContentIngester.ingest(BinaryContentIngester.java:34) > > org.dspace.sword2.MediaResourceManagerDSpace.addContent(MediaResourceManagerDSpace.java:822) > > org.dspace.sword2.MediaResourceManagerDSpace.addResource(MediaResourceManagerDSpace.java:553) > org.swordapp.server.MediaResourceAPI.post(MediaResourceAPI.java:239) > > org.swordapp.server.servlets.MediaResourceServletDefault.doPost(MediaResourceServletDefault.java:49) > javax.servlet.http.HttpServlet.service(HttpServlet.java:637) > javax.servlet.http.HttpServlet.service(HttpServlet.java:717) > </pre></p><p><b>root cause</b> <pre>java.io.IOException: No such file or > directory > java.io.UnixFileSystem.createFileExclusively(Native Method) > java.io.File.createNewFile(File.java:900) > edu.sdsc.grid.io.local.LocalFile.createNewFile(LocalFile.java:486) > > org.dspace.storage.bitstore.BitstreamStorageManager.store(BitstreamStorageManager.java:300) > org.dspace.content.Bitstream.create(Bitstream.java:205) > org.dspace.content.Bundle.createBitstream(Bundle.java:384) > org.dspace.content.Item.createSingleBitstream(Item.java:1345) > org.dspace.content.Item.createSingleBitstream(Item.java:1365) > > org.dspace.sword2.BinaryContentIngester.ingestToItem(BinaryContentIngester.java:148) > > org.dspace.sword2.BinaryContentIngester.ingest(BinaryContentIngester.java:46) > > org.dspace.sword2.BinaryContentIngester.ingest(BinaryContentIngester.java:34) > > org.dspace.sword2.MediaResourceManagerDSpace.addContent(MediaResourceManagerDSpace.java:822) > > org.dspace.sword2.MediaResourceManagerDSpace.addResource(MediaResourceManagerDSpace.java:553) > org.swordapp.server.MediaResourceAPI.post(MediaResourceAPI.java:239) > > org.swordapp.server.servlets.MediaResourceServletDefault.doPost(MediaResourceServletDefault.java:49) > javax.servlet.http.HttpServlet.service(HttpServlet.java:637) > javax.servlet.http.HttpServlet.service(HttpServlet.java:717) > </pre></p><p><b>note</b> <u>The full stack trace of the root cause is > available in the Apache Tomcat/6.0.28 logs.</u></p><HR size="1" > noshade="noshade"><h3>Apache Tomcat/6.0.28</h3></body></html> > > Cheers > > > Hayden > > On 30/04/12 16:20, Richard Jones wrote: >> Hi Guys, >> >> It looks like you are making progress. Just to add that the existing >> SWORDv2 implementation in DSpace is pretty experimental, but I have >> been working through it in the last couple of weeks, finding and >> fixing all the oddities that I can find. This is all happening in a >> fork I have made of the github repo, from the 1.8.2 release: >> >> https://github.com/nye-duo/DSpace/tree/duo >> >> I hope to have this stable in the next couple of weeks, but note that >> I'm not currently trying to get the multipart issues resolved, just >> all the other bits and bobs. >> >> Cheers, >> >> Richard >> >> On 30 April 2012 09:09, LEWIS Stuart<Stu...@ed...> wrote: >>> Hi Hayden, >>> >>> The two options would be either: >>> >>> PackagerMetsSwap::create (to create a METS/SWAP package, which can be used in SWORD v1 or v2), followed by SWORDAppClient::deposit to deposit the package >>> >>> Or >>> >>> SWORDAppClient::depositAtomEntry to create the metadata-only object, followed by SWORDAppClient::addExtraFileToMediaResource >>> >>> (I think that should work - I've not got a computer set up with this code running right now). >>> >>> Thanks, >>> >>> >>> Stuart >>> >>> >>> >>> -- >>> The University of Edinburgh is a charitable body, registered in >>> Scotland, with registration number SC005336. >>> >>> >>> -----Original Message----- >>> From: Hayden Young [mailto:hay...@wi...] >>> Sent: 30 April 2012 08:55 >>> To: LEWIS Stuart >>> Cc: swo...@li... >>> Subject: Re: [sword-app-tech] depositMultipart always results in a 500 error >>> >>> Hi Stuart >>> >>> Thanks for your assistance. >>> >>> So if I need to use a two step process to deposit an item to DSpace, am I using the correct methods to overcome DSpace's SWORDv2 limitations? >>> >>> I.e. >>> >>> SWORDAppClient::deposit to create the item >>> >>> SWORDAppClient::replaceMetadata or >>> SWORDAppClient::replaceMetadataWithFile to update the item's metadata. >>> >>> >>> >>> On 30/04/12 15:32, LEWIS Stuart wrote: >>>> Hi Hayden, >>>> >>>> === >>>> 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 >>>> >>>> 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? >>>> === >>>> >>>> I don't think that is what should be causing it - when replacing metadata (the first case, depositing a new atom entry) no filename (content-disposition) is required. See the example in the spec at "6.5.2. Replacing the Metadata of a Resource". >>>> >>>> In the second case, the problem might be that you're trying to deposit a package (zip file, SWORD v1-style, which requires the use of the deposit() function) using the depositMultipartByMethod function. This requires a multipart file, which can be created using the packager_atom_multipart.php class. For an example of this in use, see test/test-packager-atom_multipart.php >>>> >>>> Thanks, >>>> >>>> >>>> Stuart >>>> >>> -- >>> Hayden Young >>> Managing Director >>> Wijiti Pty Ltd >>> p. +61 (0) 08 6398 5010 >>> e. hay...@wi... >>> 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 >>> swo...@li... >>> https://lists.sourceforge.net/lists/listinfo/sword-app-tech >> >> > > -- > Hayden Young > Managing Director > Wijiti Pty Ltd > p. +61 (0) 08 6398 5010 > e. hay...@wi... > 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 > swo...@li... > https://lists.sourceforge.net/lists/listinfo/sword-app-tech -- Richard Jones, Founder, Cottage Labs t: @richard_d_jones, @cottagelabs w: http://cottagelabs.com |
From: Hayden Y. <hay...@wi...> - 2012-04-30 11:40:07
|
Thanks all. Stuart, taking your suggestion about adding the metadata then the bitstream, I'm a lot closer to a working solution. $response = $client->depositAtomEntry(self::URL, self::USERNAME, self::PASSWORD, self::USERNAME, './tmp/atom_multipart_package', true); where atom_multipart_package is my atom xml, successfully creates an item and populates the associated metadata fields. However, $response = $client->addExtraFileToMediaResource((string)$response->sac_edit_media_iri, self::USERNAME, self::PASSWORD, self::USERNAME, "./tmp/logo.jpg", 'image/jpeg', false); is throwing an error, although I suspect this may be more of a DSpace configuration issue rather than an issue between the sword client and server. The above will throw a DSpace error: 30/04/2012 10:53:38 AM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet mediaresource threw exception org.dspace.core.PluginInstantiationException: Cannot load plugin class: java.lang.ClassNotFoundException: org.dspace.swordpackagers.SwordXifIngester at org.dspace.core.PluginManager.getNamedPlugin(PluginManager.java:459) at org.dspace.sword2.SwordIngesterFactory.getContentInstance(SwordIngesterFactory.java:49) at org.dspace.sword2.MediaResourceManagerDSpace.addContent(MediaResourceManagerDSpace.java:818) at org.dspace.sword2.MediaResourceManagerDSpace.addResource(MediaResourceManagerDSpace.java:553) at org.swordapp.server.MediaResourceAPI.post(MediaResourceAPI.java:239) at org.swordapp.server.servlets.MediaResourceServletDefault.doPost(MediaResourceServletDefault.java:49) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) 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) Caused by: java.lang.ClassNotFoundException: org.dspace.swordpackagers.SwordXifIngester at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1645) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:186) at org.dspace.core.PluginManager.getNamedPlugin(PluginManager.java:424) ... 19 more Alternatively, if I try a PDF $response = $client->addExtraFileToMediaResource((string)$response->sac_edit_media_iri, self::USERNAME, self::PASSWORD, self::USERNAME, "./tmp/logo.pdf", 'application/pdf', false); DSpace throws the error: <html><head><title>Apache Tomcat/6.0.28 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 500 - </h1><HR size="1" noshade="noshade"><p><b>type</b> Exception report</p><p><b>message</b> <u></u></p><p><b>description</b> <u>The server encountered an internal error () that prevented it from fulfilling this request.</u></p><p><b>exception</b> <pre>javax.servlet.ServletException: org.swordapp.server.SwordServerException: There was a problem depositing the item org.swordapp.server.MediaResourceAPI.post(MediaResourceAPI.java:270) org.swordapp.server.servlets.MediaResourceServletDefault.doPost(MediaResourceServletDefault.java:49) javax.servlet.http.HttpServlet.service(HttpServlet.java:637) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) </pre></p><p><b>root cause</b> <pre>org.swordapp.server.SwordServerException: There was a problem depositing the item org.dspace.sword2.MediaResourceManagerDSpace.addResource(MediaResourceManagerDSpace.java:633) org.swordapp.server.MediaResourceAPI.post(MediaResourceAPI.java:239) org.swordapp.server.servlets.MediaResourceServletDefault.doPost(MediaResourceServletDefault.java:49) javax.servlet.http.HttpServlet.service(HttpServlet.java:637) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) </pre></p><p><b>root cause</b> <pre>org.dspace.sword2.DSpaceSwordException: java.io.IOException: No such file or directory org.dspace.sword2.BinaryContentIngester.ingestToItem(BinaryContentIngester.java:183) org.dspace.sword2.BinaryContentIngester.ingest(BinaryContentIngester.java:46) org.dspace.sword2.BinaryContentIngester.ingest(BinaryContentIngester.java:34) org.dspace.sword2.MediaResourceManagerDSpace.addContent(MediaResourceManagerDSpace.java:822) org.dspace.sword2.MediaResourceManagerDSpace.addResource(MediaResourceManagerDSpace.java:553) org.swordapp.server.MediaResourceAPI.post(MediaResourceAPI.java:239) org.swordapp.server.servlets.MediaResourceServletDefault.doPost(MediaResourceServletDefault.java:49) javax.servlet.http.HttpServlet.service(HttpServlet.java:637) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) </pre></p><p><b>root cause</b> <pre>java.io.IOException: No such file or directory java.io.UnixFileSystem.createFileExclusively(Native Method) java.io.File.createNewFile(File.java:900) edu.sdsc.grid.io.local.LocalFile.createNewFile(LocalFile.java:486) org.dspace.storage.bitstore.BitstreamStorageManager.store(BitstreamStorageManager.java:300) org.dspace.content.Bitstream.create(Bitstream.java:205) org.dspace.content.Bundle.createBitstream(Bundle.java:384) org.dspace.content.Item.createSingleBitstream(Item.java:1345) org.dspace.content.Item.createSingleBitstream(Item.java:1365) org.dspace.sword2.BinaryContentIngester.ingestToItem(BinaryContentIngester.java:148) org.dspace.sword2.BinaryContentIngester.ingest(BinaryContentIngester.java:46) org.dspace.sword2.BinaryContentIngester.ingest(BinaryContentIngester.java:34) org.dspace.sword2.MediaResourceManagerDSpace.addContent(MediaResourceManagerDSpace.java:822) org.dspace.sword2.MediaResourceManagerDSpace.addResource(MediaResourceManagerDSpace.java:553) org.swordapp.server.MediaResourceAPI.post(MediaResourceAPI.java:239) org.swordapp.server.servlets.MediaResourceServletDefault.doPost(MediaResourceServletDefault.java:49) javax.servlet.http.HttpServlet.service(HttpServlet.java:637) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) </pre></p><p><b>note</b> <u>The full stack trace of the root cause is available in the Apache Tomcat/6.0.28 logs.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/6.0.28</h3></body></html> Cheers Hayden On 30/04/12 16:20, Richard Jones wrote: > Hi Guys, > > It looks like you are making progress. Just to add that the existing > SWORDv2 implementation in DSpace is pretty experimental, but I have > been working through it in the last couple of weeks, finding and > fixing all the oddities that I can find. This is all happening in a > fork I have made of the github repo, from the 1.8.2 release: > > https://github.com/nye-duo/DSpace/tree/duo > > I hope to have this stable in the next couple of weeks, but note that > I'm not currently trying to get the multipart issues resolved, just > all the other bits and bobs. > > Cheers, > > Richard > > On 30 April 2012 09:09, LEWIS Stuart<Stu...@ed...> wrote: >> Hi Hayden, >> >> The two options would be either: >> >> PackagerMetsSwap::create (to create a METS/SWAP package, which can be used in SWORD v1 or v2), followed by SWORDAppClient::deposit to deposit the package >> >> Or >> >> SWORDAppClient::depositAtomEntry to create the metadata-only object, followed by SWORDAppClient::addExtraFileToMediaResource >> >> (I think that should work - I've not got a computer set up with this code running right now). >> >> Thanks, >> >> >> Stuart >> >> >> >> -- >> The University of Edinburgh is a charitable body, registered in >> Scotland, with registration number SC005336. >> >> >> -----Original Message----- >> From: Hayden Young [mailto:hay...@wi...] >> Sent: 30 April 2012 08:55 >> To: LEWIS Stuart >> Cc: swo...@li... >> Subject: Re: [sword-app-tech] depositMultipart always results in a 500 error >> >> Hi Stuart >> >> Thanks for your assistance. >> >> So if I need to use a two step process to deposit an item to DSpace, am I using the correct methods to overcome DSpace's SWORDv2 limitations? >> >> I.e. >> >> SWORDAppClient::deposit to create the item >> >> SWORDAppClient::replaceMetadata or >> SWORDAppClient::replaceMetadataWithFile to update the item's metadata. >> >> >> >> On 30/04/12 15:32, LEWIS Stuart wrote: >>> Hi Hayden, >>> >>> === >>> 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 >>> >>> 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? >>> === >>> >>> I don't think that is what should be causing it - when replacing metadata (the first case, depositing a new atom entry) no filename (content-disposition) is required. See the example in the spec at "6.5.2. Replacing the Metadata of a Resource". >>> >>> In the second case, the problem might be that you're trying to deposit a package (zip file, SWORD v1-style, which requires the use of the deposit() function) using the depositMultipartByMethod function. This requires a multipart file, which can be created using the packager_atom_multipart.php class. For an example of this in use, see test/test-packager-atom_multipart.php >>> >>> Thanks, >>> >>> >>> Stuart >>> >> -- >> Hayden Young >> Managing Director >> Wijiti Pty Ltd >> p. +61 (0) 08 6398 5010 >> e. hay...@wi... >> 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 >> swo...@li... >> https://lists.sourceforge.net/lists/listinfo/sword-app-tech > > -- Hayden Young Managing Director Wijiti Pty Ltd p. +61 (0) 08 6398 5010 e. hay...@wi... 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. |
From: Richard J. <ri...@co...> - 2012-04-30 08:21:06
|
Hi Guys, It looks like you are making progress. Just to add that the existing SWORDv2 implementation in DSpace is pretty experimental, but I have been working through it in the last couple of weeks, finding and fixing all the oddities that I can find. This is all happening in a fork I have made of the github repo, from the 1.8.2 release: https://github.com/nye-duo/DSpace/tree/duo I hope to have this stable in the next couple of weeks, but note that I'm not currently trying to get the multipart issues resolved, just all the other bits and bobs. Cheers, Richard On 30 April 2012 09:09, LEWIS Stuart <Stu...@ed...> wrote: > Hi Hayden, > > The two options would be either: > > PackagerMetsSwap::create (to create a METS/SWAP package, which can be used in SWORD v1 or v2), followed by SWORDAppClient::deposit to deposit the package > > Or > > SWORDAppClient::depositAtomEntry to create the metadata-only object, followed by SWORDAppClient::addExtraFileToMediaResource > > (I think that should work - I've not got a computer set up with this code running right now). > > Thanks, > > > Stuart > > > > -- > The University of Edinburgh is a charitable body, registered in > Scotland, with registration number SC005336. > > > -----Original Message----- > From: Hayden Young [mailto:hay...@wi...] > Sent: 30 April 2012 08:55 > To: LEWIS Stuart > Cc: swo...@li... > Subject: Re: [sword-app-tech] depositMultipart always results in a 500 error > > Hi Stuart > > Thanks for your assistance. > > So if I need to use a two step process to deposit an item to DSpace, am I using the correct methods to overcome DSpace's SWORDv2 limitations? > > I.e. > > SWORDAppClient::deposit to create the item > > SWORDAppClient::replaceMetadata or > SWORDAppClient::replaceMetadataWithFile to update the item's metadata. > > > > On 30/04/12 15:32, LEWIS Stuart wrote: >> Hi Hayden, >> >> === >> 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 >> >> 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? >> === >> >> I don't think that is what should be causing it - when replacing metadata (the first case, depositing a new atom entry) no filename (content-disposition) is required. See the example in the spec at "6.5.2. Replacing the Metadata of a Resource". >> >> In the second case, the problem might be that you're trying to deposit a package (zip file, SWORD v1-style, which requires the use of the deposit() function) using the depositMultipartByMethod function. This requires a multipart file, which can be created using the packager_atom_multipart.php class. For an example of this in use, see test/test-packager-atom_multipart.php >> >> Thanks, >> >> >> Stuart >> > > -- > Hayden Young > Managing Director > Wijiti Pty Ltd > p. +61 (0) 08 6398 5010 > e. hay...@wi... > 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 > swo...@li... > https://lists.sourceforge.net/lists/listinfo/sword-app-tech -- Richard Jones, Founder, Cottage Labs t: @richard_d_jones, @cottagelabs w: http://cottagelabs.com |
From: LEWIS S. <Stu...@ed...> - 2012-04-30 08:09:19
|
Hi Hayden, The two options would be either: PackagerMetsSwap::create (to create a METS/SWAP package, which can be used in SWORD v1 or v2), followed by SWORDAppClient::deposit to deposit the package Or SWORDAppClient::depositAtomEntry to create the metadata-only object, followed by SWORDAppClient::addExtraFileToMediaResource (I think that should work - I've not got a computer set up with this code running right now). Thanks, Stuart -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. -----Original Message----- From: Hayden Young [mailto:hay...@wi...] Sent: 30 April 2012 08:55 To: LEWIS Stuart Cc: swo...@li... Subject: Re: [sword-app-tech] depositMultipart always results in a 500 error Hi Stuart Thanks for your assistance. So if I need to use a two step process to deposit an item to DSpace, am I using the correct methods to overcome DSpace's SWORDv2 limitations? I.e. SWORDAppClient::deposit to create the item SWORDAppClient::replaceMetadata or SWORDAppClient::replaceMetadataWithFile to update the item's metadata. On 30/04/12 15:32, LEWIS Stuart wrote: > Hi Hayden, > > === > 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 > > 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? > === > > I don't think that is what should be causing it - when replacing metadata (the first case, depositing a new atom entry) no filename (content-disposition) is required. See the example in the spec at "6.5.2. Replacing the Metadata of a Resource". > > In the second case, the problem might be that you're trying to deposit a package (zip file, SWORD v1-style, which requires the use of the deposit() function) using the depositMultipartByMethod function. This requires a multipart file, which can be created using the packager_atom_multipart.php class. For an example of this in use, see test/test-packager-atom_multipart.php > > Thanks, > > > Stuart > -- Hayden Young Managing Director Wijiti Pty Ltd p. +61 (0) 08 6398 5010 e. hay...@wi... 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. |
From: Hayden Y. <hay...@wi...> - 2012-04-30 07:54:56
|
Hi Stuart Thanks for your assistance. So if I need to use a two step process to deposit an item to DSpace, am I using the correct methods to overcome DSpace's SWORDv2 limitations? I.e. SWORDAppClient::deposit to create the item SWORDAppClient::replaceMetadata or SWORDAppClient::replaceMetadataWithFile to update the item's metadata. On 30/04/12 15:32, LEWIS Stuart wrote: > Hi Hayden, > > === > 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 > > 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? > === > > I don't think that is what should be causing it - when replacing metadata (the first case, depositing a new atom entry) no filename (content-disposition) is required. See the example in the spec at "6.5.2. Replacing the Metadata of a Resource". > > In the second case, the problem might be that you're trying to deposit a package (zip file, SWORD v1-style, which requires the use of the deposit() function) using the depositMultipartByMethod function. This requires a multipart file, which can be created using the packager_atom_multipart.php class. For an example of this in use, see test/test-packager-atom_multipart.php > > Thanks, > > > Stuart > -- Hayden Young Managing Director Wijiti Pty Ltd p. +61 (0) 08 6398 5010 e. hay...@wi... 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. |
From: LEWIS S. <Stu...@ed...> - 2012-04-30 07:33:02
|
Hi Hayden, === 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 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? === I don't think that is what should be causing it - when replacing metadata (the first case, depositing a new atom entry) no filename (content-disposition) is required. See the example in the spec at "6.5.2. Replacing the Metadata of a Resource". In the second case, the problem might be that you're trying to deposit a package (zip file, SWORD v1-style, which requires the use of the deposit() function) using the depositMultipartByMethod function. This requires a multipart file, which can be created using the packager_atom_multipart.php class. For an example of this in use, see test/test-packager-atom_multipart.php Thanks, Stuart -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. |
From: Hayden Y. <hay...@wi...> - 2012-04-30 06:57:23
|
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<ri...@co...> 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<hay...@wi...> 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. hay...@wi... >>> 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 >>> swo...@li... >>> 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. hay...@wi... 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. |
From: Richard J. <ri...@co...> - 2012-04-24 10:20:24
|
Hi Folks, We have migrated the python client library from bitbucket to github: https://github.com/swordapp/python-client-sword2 Cheers, Richard -- Richard Jones, Founder, Cottage Labs t: @richard_d_jones, @cottagelabs w: http://cottagelabs.com |
From: Joke P. <jok...@da...> - 2012-04-19 08:09:53
|
The zip file comes with a log4j-1.2.15.jar which does contain an /org/apache/log4j/PropertyConfigurator.class I did try various ways: java -classpath ".;log4j-1.2.15.jar;." -jar sword-common-1.1.jar java -classpath "log4j-1.2.15.jar;." -jar sword-common-1.1.jar java -classpath ".;log4j-1.2.15.jar" -jar sword-common-1.1.jar /usr/lib/jvm/java-1.6.0-sun-1.6.0.18/bin/java -jar sword-common-1.1.jar /usr/lib/jvm/java-1.6.0-sun-1.6.0.18/bin/java -classpath "log4j-1.2.15.jar" -jar sword-common-1.1.jar but the stack trace is persistent On 18/04/2012 08:23, "LEWIS Stuart" <Stu...@ed...> wrote: Hi Joke, The stack trace suggests that you need to add the log4j logging library jar file to your classpath. http://logging.apache.org/log4j/1.2/download.html Thanks, Stuart From: Joke Pol [mailto:jok...@da...] Sent: 17 April 2012 12:36 To: swo...@li... Subject: [sword-app-tech] Demo client NoClassDefFoundError PropertyConfigurator I downloaded sword-client-1.1.zip from http://sourceforge.net/projects/sword-app/files/SWORD%20Java%20Library/ Went to the unzipped directory and launched swordclient.sh I have been playing with the classpath but keep getting the stack trace below. Anny suggestion what I might have overlooked? Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/PropertyConfigurator at org.purl.sword.client.ClientFactory.<init>(ClientFactory.java:56) at org.purl.sword.client.ClientFactory.main(ClientFactory.java:183) Caused by: java.lang.ClassNotFoundException: org.apache.log4j.PropertyConfigurator at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) ... 2 more With kind regards, Joke Pol Developer +31(0)6 201 055 18 jok...@da... Data Archiving and Networked Services (DANS) DANS offers durable access to digital research data. Please visit http://www.dans.knaw.nl for more information and contact details. DANS is an institute of KNAW and NWO. |
From: Richard J. <ri...@co...> - 2012-04-18 19:05:42
|
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 <ri...@co...> 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 <hay...@wi...> 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. hay...@wi... >> 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 >> swo...@li... >> https://lists.sourceforge.net/lists/listinfo/sword-app-tech >> > > > > -- > > Richard Jones, > > Founder, Cottage Labs > t: @richard_d_jones, @cottagelabs > w: http://cottagelabs.com -- Richard Jones, Founder, Cottage Labs t: @richard_d_jones, @cottagelabs w: http://cottagelabs.com |
From: Richard J. <ri...@co...> - 2012-04-18 19:03:41
|
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 <hay...@wi...> 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. hay...@wi... > 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 > swo...@li... > https://lists.sourceforge.net/lists/listinfo/sword-app-tech > -- Richard Jones, Founder, Cottage Labs t: @richard_d_jones, @cottagelabs w: http://cottagelabs.com |
From: Hayden Y. <hay...@wi...> - 2012-04-18 18:36:08
|
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. hay...@wi... 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. |
From: LEWIS S. <Stu...@ed...> - 2012-04-18 06:23:48
|
The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. |
From: Hayden Y. <hay...@wi...> - 2012-04-18 05:38:19
|
Hi Stuart Thanks for the update. I ended up using SimpleXmlElement to retrieve the url then tokenized the url to obtain the id. // get the actual id from the response id. if (isset($response->sac_id)) { $xml = new SimpleXMLElement($response->sac_id->saveXML()); $array = $xml->xpath('/id'); $idUrl = ''; foreach($array as $node) { $idUrl = $node; } $parts = explode('/', $idUrl); $pos = count($parts) - 1; $id = $parts[$pos]; } $response is an instance of SwordAppEntry. I noticed that the response->sac_id is an SimpleXmlElement object but for some reason xpath would not retrieve anything. I found passing the sac_id output to a new SimpleXMLElement fixed the problem. Not sure why. Cheers Hayden On 17/04/12 18:09, LEWIS Stuart wrote: > Hi Hayden, > > Unfortunately not - from a SWORD point of view, this is just a URL. The SWORD specification does not describe how URLs should encode item identifiers, so this is an implementation choice for the repository. Therefore the client library can't know how to extract the ID. > > Thanks, > > > Stuart > > > -- Hayden Young Managing Director Wijiti Pty Ltd p. +61 (0) 08 6398 5010 e. hay...@wi... 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. |