From: SVN c. m. f. t. SWORD-A. p. <swo...@li...> - 2012-03-26 14:07:14
|
Revision: 494 http://sword-app.svn.sourceforge.net/sword-app/?rev=494&view=rev Author: richard-jones Date: 2012-03-26 14:07:03 +0000 (Mon, 26 Mar 2012) Log Message: ----------- add readme and update pom file with version and project name Modified Paths: -------------- JavaClient2.0/trunk/pom.xml Added Paths: ----------- JavaClient2.0/trunk/README Added: JavaClient2.0/trunk/README =================================================================== --- JavaClient2.0/trunk/README (rev 0) +++ JavaClient2.0/trunk/README 2012-03-26 14:07:03 UTC (rev 494) @@ -0,0 +1,88 @@ +SWORD 2.0 Client +================ + +This client library is an implementation of the SWORD 2.0 standard defined here + +http://swordapp.org/sword-v2/sword-v2-specifications/ + + +Build +----- + +To build this library use maven 2: + + mvn clean package + +In the root directory will build the software + + +Usage +----- + +The main point of entry for client operations is org.swordapp.client.SWORDClient + +To perform deposits, create instances of org.swordapp.client.Deposit and pass it to the SWORDClient's methods. + +To authenticate, create instances of org.swordapp.client.AuthCredentials and pass them in with the Deposit object to the SWORDClient. + + +For example: + + SWORDClient client = new SWORDClient() + +Obtain a service document: + + ServiceDocument sd = client.getServiceDocument(this.sdIRI, new AuthCredentials(this.user, this.pass)); + +Get the first collection from the first workspace in the service document: + + SWORDCollection col = sd.getWorkspaces().get(0).getCollections().get(0); + +Create a binary file only Deposit object: + + Deposit deposit = new Deposit(); + deposit.setFile(new FileInputStream(myFile)); + deposit.setMimeType("application/zip"); + deposit.setFilename("example.zip"); + deposit.setPackaging(UriRegistry.PACKAGE_SIMPLE_ZIP); + deposit.setMd5(fileMD5); + deposit.setInProgress(true); + deposit.setSuggestedIdentifier("abcdefg"); + +Pass the deposit object to the client: + + DepositReceipt receipt = client.deposit(col, deposit, auth) + +We can create entry-only depsits too: + + EntryPart ep = new EntryPart(); + ep.addDublinCore("title", "My Title"); + + Deposit deposit = new Deposit(); + deposit.setEntryPart(ep); + +For some deposit operations we get back a DepositReceipt object, from which we can get all the details we might want about the item: + + receipt.getStatusCode(); + receipt.getLocation(); + receipt.getDerivedResourceLinks(); + receipt.getOriginalDepositLink(); + receipt.getEditMediaLink(); + receipt.getAtomStatementLink(); + receipt.getContentLink(); + receipt.getEditLink(); + receipt.getOREStatementLink(); + receipt.getPackaging(); + receipt.getSplashPageLink(); + receipt.getStatementLink("application/rdf+xml"); + receipt.getStatementLink("application/atom+xml;type=feed"); + receipt.getSwordEditLink(); + receipt.getTreatment(); + receipt.getVerboseDescription(); + + +Limitations +----------- + +Currently the client DOES NOT support multipart deposit. Therefore the specification sections 6.3.2, 6.5.3, and 6.7.3 are not supported yet. + Modified: JavaClient2.0/trunk/pom.xml =================================================================== --- JavaClient2.0/trunk/pom.xml 2012-03-26 13:32:42 UTC (rev 493) +++ JavaClient2.0/trunk/pom.xml 2012-03-26 14:07:03 UTC (rev 494) @@ -4,8 +4,8 @@ <modelVersion>4.0.0</modelVersion> <groupId>org.swordapp</groupId> - <artifactId>sword-client</artifactId> - <version>2.0</version> + <artifactId>sword2-client</artifactId> + <version>0.9</version> <build> <plugins> @@ -86,4 +86,4 @@ <version>1.6.1</version> </dependency> </dependencies> -</project> \ No newline at end of file +</project> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |