Hi,helix84
Thanks for your help. Now we can use the swordv2 to submit package. Notice
that inProgress = false and zip package must contain license. Following is our
coding:
String sdIRI = "http://localhost:8080/swordv2/servicedocument";
String userName = "xxxxxxxxxxxx";
String password = "xxxxxxxxxxxx";
String file = "C:/Users/luopc/Desktop/dspace/22/222.zip";
Deposit deposit = new Deposit();
deposit.setFile(new FileInputStream(file));
deposit.setMimeType("application/zip");
deposit.setFilename("222.zip");
deposit.setPackaging("http://purl.org/net/sword/package/METSDSpaceSIP");
deposit.setMd5(Test2.getMd5ByFile(new File(file)));
deposit.setInProgress(false);
deposit.setSuggestedIdentifier("abcd");
AuthCredentials auth = new AuthCredentials(userName, password);
SWORDClient client = new SWORDClient();
ServiceDocument sd = client.getServiceDocument(sdIRI, auth);
SWORDCollection col = sd.getWorkspaces().get(0).getCollections().get(0);
DepositReceipt receipt = client.deposit(col, deposit,new
AuthCredentials(userName, password));
-----原始邮件-----
发件人:helix84 <heli...@centrum.sk>
发送时间:2014-12-01 18:10:53 (星期一)
收件人: "罗鹏程" <1406189...@pku.edu.cn>
抄送: "DSpace Developers" <dspace-devel@lists.sourceforge.net>
主题: Re: [Dspace-devel] swordv2 submission problem
Here's how it works for me:
1) Create a new user "submitter" with password "password"
2) Create a new collection for SWORD submissions (123456789/15)
3) Edit the collection, in tab Assign Roles / Submitters add the "submitter"
user to this collection's submitters
4) use the curl command to post example.zip as "submitter" to "123456789/15"
curl -X POST -d @example.zip
"http://submitter:passw...@example.com/swordv2/collection/123456789/15" -H
"Host: example.com" -H "Content-Disposition: filename=example.zip"
5) The item appears in the collection (in_archive state), not in workflow
subject to approval.
祝好
~~helix84
Compulsory reading: DSpace Mailing List Etiquette
https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Dspace-devel mailing list
Dspace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspace-devel