You can subscribe to this list here.
| 2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(11) |
Dec
(6) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2009 |
Jan
(2) |
Feb
(64) |
Mar
(4) |
Apr
(2) |
May
(10) |
Jun
(26) |
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
(1) |
Dec
|
| 2010 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2011 |
Jan
(14) |
Feb
(7) |
Mar
(7) |
Apr
(37) |
May
(59) |
Jun
(4) |
Jul
(16) |
Aug
(3) |
Sep
(9) |
Oct
(1) |
Nov
|
Dec
(25) |
| 2012 |
Jan
(68) |
Feb
(5) |
Mar
(28) |
Apr
(12) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: SVN c. m. f. t. SWORD-A. p. <swo...@li...> - 2009-02-17 14:47:11
|
Revision: 110
http://sword-app.svn.sourceforge.net/sword-app/?rev=110&view=rev
Author: stuartlewis
Date: 2009-02-17 14:47:08 +0000 (Tue, 17 Feb 2009)
Log Message:
-----------
A SWORDServer can now throw a SWORDErrorException from the doServiceDocument method.
Modified Paths:
--------------
java-common/trunk/src/main/java/org/purl/sword/base/SWORDErrorException.java
java-common/trunk/src/main/java/org/purl/sword/server/DepositServlet.java
java-common/trunk/src/main/java/org/purl/sword/server/DummyServer.java
java-common/trunk/src/main/java/org/purl/sword/server/SWORDServer.java
java-common/trunk/src/main/java/org/purl/sword/server/ServiceDocumentServlet.java
Modified: java-common/trunk/src/main/java/org/purl/sword/base/SWORDErrorException.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/base/SWORDErrorException.java 2009-02-17 14:45:54 UTC (rev 109)
+++ java-common/trunk/src/main/java/org/purl/sword/base/SWORDErrorException.java 2009-02-17 14:47:08 UTC (rev 110)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2008, Aberystwyth University
+ * Copyright (c) 2009, Aberystwyth University
*
* All rights reserved.
*
@@ -57,9 +57,8 @@
/**
* Create a new instance and store the specified data.
*
- * @param message The message for the exception.
- * @param source The original exception that lead to this exception. This
- * can be <code>null</code>.
+ * @param errorURI The errorURI of the exception being thrown
+ * @param description A description of the error thrown.
*/
public SWORDErrorException(String errorURI, String description)
{
Modified: java-common/trunk/src/main/java/org/purl/sword/server/DepositServlet.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/server/DepositServlet.java 2009-02-17 14:45:54 UTC (rev 109)
+++ java-common/trunk/src/main/java/org/purl/sword/server/DepositServlet.java 2009-02-17 14:47:08 UTC (rev 110)
@@ -334,7 +334,7 @@
// Print out the Deposit Response
response.setStatus(dr.getHttpResponse());
- if( (dr.getLocation()!= null) && (!dr.getLocation().equals("")))
+ if ((dr.getLocation() != null) && (!dr.getLocation().equals("")))
{
response.setHeader("Location", dr.getLocation());
}
Modified: java-common/trunk/src/main/java/org/purl/sword/server/DummyServer.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/server/DummyServer.java 2009-02-17 14:45:54 UTC (rev 109)
+++ java-common/trunk/src/main/java/org/purl/sword/server/DummyServer.java 2009-02-17 14:47:08 UTC (rev 110)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2008, Aberystwyth University
+ * Copyright (c) 2009, Aberystwyth University
*
* All rights reserved.
*
@@ -96,7 +96,7 @@
* @throws SWORDErrorException If something goes wrong, such as
*/
public ServiceDocument doServiceDocument(ServiceDocumentRequest sdr)
- throws SWORDAuthenticationException, SWORDException {
+ throws SWORDAuthenticationException, SWORDErrorException, SWORDException {
// Authenticate the user
String username = sdr.getUsername();
String password = sdr.getPassword();
@@ -107,6 +107,13 @@
throw new SWORDAuthenticationException("Bad credentials");
}
+ // Allow users to force the throwing of a SWORD error exception by setting
+ // the OBO user to 'error'
+ if ((sdr.getOnBehalfOf() != null) && (sdr.getOnBehalfOf().equals("error"))) {
+ // Throw the error exception
+ throw new SWORDErrorException(ErrorCodes.MEDIATION_NOT_ALLOWED, "Mediated deposits not allowed");
+ }
+
// Create and return a dummy ServiceDocument
ServiceDocument document = new ServiceDocument();
Service service = new Service("1.3", true, true);
@@ -326,6 +333,8 @@
dr.setEntry(se);
+ dr.setLocation("http://www.myrepository.ac.uk/atom/" + counter);
+
return dr;
}
}
Modified: java-common/trunk/src/main/java/org/purl/sword/server/SWORDServer.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/server/SWORDServer.java 2009-02-17 14:45:54 UTC (rev 109)
+++ java-common/trunk/src/main/java/org/purl/sword/server/SWORDServer.java 2009-02-17 14:47:08 UTC (rev 110)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2008, Aberystwyth University
+ * Copyright (c) 2009, Aberystwyth University
*
* All rights reserved.
*
@@ -61,13 +61,15 @@
* @param sdr The Service Document Request object
*
* @exception SWORDAuthenticationException Thrown if the authentication fails
+ * @exception SWORDErrorException Thrown if there was an error with the input not matching
+ * the capabilities of the server
* @exception SWORDException Thrown in an un-handalable Exception occurs.
* This will be dealt with by sending a HTTP 500 Server Exception
*
* @return The ServiceDocument representing the service document
*/
public ServiceDocument doServiceDocument(ServiceDocumentRequest sdr)
- throws SWORDAuthenticationException, SWORDException;
+ throws SWORDAuthenticationException, SWORDErrorException, SWORDException;
/**
* Answer a SWORD deposit
@@ -75,6 +77,8 @@
* @param deposit The Deposit object
*
* @exception SWORDAuthenticationException Thrown if the authentication fails
+ * @exception SWORDErrorException Thrown if there was an error with the input not matching
+ * the capabilities of the server
* @exception SWORDException Thrown if an un-handalable Exception occurs.
* This will be dealt with by sending a HTTP 500 Server Exception
*
Modified: java-common/trunk/src/main/java/org/purl/sword/server/ServiceDocumentServlet.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/server/ServiceDocumentServlet.java 2009-02-17 14:45:54 UTC (rev 109)
+++ java-common/trunk/src/main/java/org/purl/sword/server/ServiceDocumentServlet.java 2009-02-17 14:47:08 UTC (rev 110)
@@ -50,6 +50,7 @@
import org.apache.log4j.Logger;
import org.purl.sword.base.HttpHeaders;
import org.purl.sword.base.SWORDAuthenticationException;
+import org.purl.sword.base.SWORDErrorException;
import org.purl.sword.base.SWORDException;
import org.purl.sword.base.ServiceDocument;
import org.purl.sword.base.ServiceDocumentRequest;
@@ -172,11 +173,13 @@
response.setHeader("WWW-Authenticate", s);
response.setStatus(401);
}
+ } catch (SWORDErrorException see) {
+ // Return the relevant HTTP status code
+ response.sendError(see.getStatus(), see.getDescription());
} catch (SWORDException se) {
se.printStackTrace();
// Throw a HTTP 500
- response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, se
- .getMessage());
+ response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, se.getMessage());
}
}
@@ -218,7 +221,7 @@
}
/**
- * Utility method to deicde if we are using HTTP Basic authentication
+ * Utility method to decide if we are using HTTP Basic authentication
*
* @return if HTTP Basic authentication is in use or not
*/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: SVN c. m. f. t. SWORD-A. p. <swo...@li...> - 2009-02-17 14:45:58
|
Revision: 109
http://sword-app.svn.sourceforge.net/sword-app/?rev=109&view=rev
Author: stuartlewis
Date: 2009-02-17 14:45:54 +0000 (Tue, 17 Feb 2009)
Log Message:
-----------
Update client to display the location given in the HTTP headers of a deposit response
Modified Paths:
--------------
java-common/trunk/src/main/java/org/purl/sword/client/Client.java
java-common/trunk/src/main/java/org/purl/sword/client/ServletClient.java
java-webapp/trunk/src/main/webapp/deposit.jsp
Modified: java-common/trunk/src/main/java/org/purl/sword/client/Client.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/client/Client.java 2009-02-17 14:44:33 UTC (rev 108)
+++ java-common/trunk/src/main/java/org/purl/sword/client/Client.java 2009-02-17 14:45:54 UTC (rev 109)
@@ -429,6 +429,7 @@
messageBody = readResponse(httppost
.getResponseBodyAsStream());
response = new DepositResponse(status.getCode());
+ response.setLocation(httppost.getResponseHeader("Location").getValue());
// added call for the status code.
response.unmarshall(messageBody);
}
Modified: java-common/trunk/src/main/java/org/purl/sword/client/ServletClient.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/client/ServletClient.java 2009-02-17 14:44:33 UTC (rev 108)
+++ java-common/trunk/src/main/java/org/purl/sword/client/ServletClient.java 2009-02-17 14:45:54 UTC (rev 109)
@@ -382,6 +382,7 @@
request.setAttribute("userAgent", se.getUserAgent());
request.setAttribute("packaging", se.getPackaging());
request.setAttribute("links", se.getLinks());
+ request.setAttribute("location", resp.getLocation());
// Set the ServiceDocument and associated values
request.getRequestDispatcher("deposit.jsp").forward(request, response);
Modified: java-webapp/trunk/src/main/webapp/deposit.jsp
===================================================================
--- java-webapp/trunk/src/main/webapp/deposit.jsp 2009-02-17 14:44:33 UTC (rev 108)
+++ java-webapp/trunk/src/main/webapp/deposit.jsp 2009-02-17 14:45:54 UTC (rev 109)
@@ -16,6 +16,7 @@
String userAgent = (String)request.getAttribute("userAgent");
String packaging = (String)request.getAttribute("packaging");
Iterator links = (Iterator)request.getAttribute("links");
+ String location = (String)request.getAttribute("location");
%>
<html>
<head>
@@ -25,7 +26,12 @@
<body bgcolor="white">
<h1>SWORD Web Client: Deposit</h1>
<div id="section">
- <strong>ID:</strong> <%= id %>
+ <strong>ID:</strong> <%= id %><br />
+ <%
+ if ((location != null) && (!location.equals(""))) {
+ %><strong>Location:</strong> <%= location %><br /><%
+ }
+ %>
<ul>
<li><strong>Title:</strong> <%= title %></li>
<%
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: SVN c. m. f. t. SWORD-A. p. <swo...@li...> - 2009-02-17 14:44:37
|
Revision: 108
http://sword-app.svn.sourceforge.net/sword-app/?rev=108&view=rev
Author: stuartlewis
Date: 2009-02-17 14:44:33 +0000 (Tue, 17 Feb 2009)
Log Message:
-----------
Update SwordTest to comply with SWORD 1.3 API
Modified Paths:
--------------
java-common/trunk/src/test/java/org/purl/sword/SwordTest.java
Modified: java-common/trunk/src/test/java/org/purl/sword/SwordTest.java
===================================================================
--- java-common/trunk/src/test/java/org/purl/sword/SwordTest.java 2009-02-16 20:50:43 UTC (rev 107)
+++ java-common/trunk/src/test/java/org/purl/sword/SwordTest.java 2009-02-17 14:44:33 UTC (rev 108)
@@ -58,7 +58,6 @@
import org.purl.sword.base.SWORDEntry;
import org.purl.sword.base.Service;
import org.purl.sword.base.ServiceDocument;
-import org.purl.sword.base.ServiceLevel;
import org.purl.sword.base.Workspace;
/**
@@ -91,7 +90,7 @@
public void serviceDocumentTest()
{
// create a new service document
- Service service = new Service(ServiceLevel.ZERO);
+ Service service = new Service();
service.setVerbose(true);
service.setNoOp(false);
@@ -231,8 +230,6 @@
entry.setUpdated("2007-08-02T10:22:17Z");
- entry.setFormatNamespace("Test format namespace");
- entry.setTreatment("Treatment description");
entry.setNoOp(true);
entry.setVerboseDescription("A Verbose Description.");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: SVN c. m. f. t. SWORD-A. p. <swo...@li...> - 2009-02-16 20:50:44
|
Revision: 107
http://sword-app.svn.sourceforge.net/sword-app/?rev=107&view=rev
Author: stuartlewis
Date: 2009-02-16 20:50:43 +0000 (Mon, 16 Feb 2009)
Log Message:
-----------
A DepositResponse may now contains a location (get/setLocation) which if present will be entered as the value of the Location header for the deposit response.
Modified Paths:
--------------
java-common/trunk/src/main/java/org/purl/sword/base/DepositResponse.java
java-common/trunk/src/main/java/org/purl/sword/server/DepositServlet.java
Modified: java-common/trunk/src/main/java/org/purl/sword/base/DepositResponse.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/base/DepositResponse.java 2009-02-16 20:22:56 UTC (rev 106)
+++ java-common/trunk/src/main/java/org/purl/sword/base/DepositResponse.java 2009-02-16 20:50:43 UTC (rev 107)
@@ -61,6 +61,9 @@
/** The HTTP Response code */
private int httpResponse;
+
+ /** The value to set in the Location header (typically the atom edit link) */
+ private String location;
/** Logger */
private static Logger log = Logger.getLogger(DepositResponse.class);
@@ -74,6 +77,7 @@
{
entry = new SWORDEntry();
this.httpResponse = httpResponse;
+ location = null;
}
/**
@@ -134,6 +138,24 @@
}
/**
+ * Retrieve the Location header.
+ *
+ * @return The Location header
+ */
+ public String getLocation() {
+ return location;
+ }
+
+ /**
+ * Set the HTTP Location header.
+ *
+ * @param location The Location header.
+ */
+ public void setLocation(String location) {
+ this.location = location;
+ }
+
+ /**
* Marshall the data in the enclosed SWORD Entry.
*
* @return The string representation. Null if there was an error.
Modified: java-common/trunk/src/main/java/org/purl/sword/server/DepositServlet.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/server/DepositServlet.java 2009-02-16 20:22:56 UTC (rev 106)
+++ java-common/trunk/src/main/java/org/purl/sword/server/DepositServlet.java 2009-02-16 20:50:43 UTC (rev 107)
@@ -334,6 +334,10 @@
// Print out the Deposit Response
response.setStatus(dr.getHttpResponse());
+ if( (dr.getLocation()!= null) && (!dr.getLocation().equals("")))
+ {
+ response.setHeader("Location", dr.getLocation());
+ }
response.setContentType("application/atom+xml; charset=UTF-8");
PrintWriter out = response.getWriter();
out.write(dr.marshall());
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: SVN c. m. f. t. SWORD-A. p. <swo...@li...> - 2009-02-16 20:23:03
|
Revision: 106
http://sword-app.svn.sourceforge.net/sword-app/?rev=106&view=rev
Author: stuartlewis
Date: 2009-02-16 20:22:56 +0000 (Mon, 16 Feb 2009)
Log Message:
-----------
APP namespace updated from http://purl.org/atom/app# to http://www.w3.org/2007/app
Modified Paths:
--------------
java-common/trunk/src/main/java/org/purl/sword/base/Namespaces.java
Modified: java-common/trunk/src/main/java/org/purl/sword/base/Namespaces.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/base/Namespaces.java 2009-02-16 20:09:15 UTC (rev 105)
+++ java-common/trunk/src/main/java/org/purl/sword/base/Namespaces.java 2009-02-16 20:22:56 UTC (rev 106)
@@ -50,7 +50,7 @@
/**
* Atom Publishing Protocol (APP) Namespace.
*/
- public static final String NS_APP = "http://purl.org/atom/app#";
+ public static final String NS_APP = "http://www.w3.org/2007/app";
/**
* APP Prefix.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: SVN c. m. f. t. SWORD-A. p. <swo...@li...> - 2009-02-16 20:09:46
|
Revision: 105
http://sword-app.svn.sourceforge.net/sword-app/?rev=105&view=rev
Author: stuartlewis
Date: 2009-02-16 20:09:15 +0000 (Mon, 16 Feb 2009)
Log Message:
-----------
Changed utitlity methods to 'protected'
Modified Paths:
--------------
java-common/trunk/src/main/java/org/purl/sword/server/DepositServlet.java
Modified: java-common/trunk/src/main/java/org/purl/sword/server/DepositServlet.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/server/DepositServlet.java 2009-01-15 09:58:13 UTC (rev 104)
+++ java-common/trunk/src/main/java/org/purl/sword/server/DepositServlet.java 2009-02-16 20:09:15 UTC (rev 105)
@@ -78,7 +78,7 @@
public class DepositServlet extends HttpServlet {
/** Sword repository */
- private SWORDServer myRepository;
+ protected SWORDServer myRepository;
/** Authentication type */
private String authN;
@@ -387,7 +387,7 @@
* @param response The HttpServletResponse to send the error document to
* @throws IOException
*/
- private void makeErrorDocument(String errorURI, int status, String summary,
+ protected void makeErrorDocument(String errorURI, int status, String summary,
HttpServletRequest request, HttpServletResponse response) throws IOException
{
SWORDErrorDocument sed = new SWORDErrorDocument(errorURI);
@@ -419,7 +419,7 @@
* @param request
* @return The username and password combination
*/
- private String getUsernamePassword(HttpServletRequest request) {
+ protected String getUsernamePassword(HttpServletRequest request) {
try {
String authHeader = request.getHeader("Authorization");
if (authHeader != null) {
@@ -459,7 +459,7 @@
* @param req The request object
* @return The URL
*/
- private static String getUrl(HttpServletRequest req) {
+ protected static String getUrl(HttpServletRequest req) {
String reqUrl = req.getRequestURL().toString();
String queryString = req.getQueryString();
if (queryString != null) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: SVN c. m. f. t. SWORD-A. p. <swo...@li...> - 2009-01-15 09:58:21
|
Revision: 104
http://sword-app.svn.sourceforge.net/sword-app/?rev=104&view=rev
Author: andy_starr
Date: 2009-01-15 09:58:13 +0000 (Thu, 15 Jan 2009)
Log Message:
-----------
Work on updating client to SWORD profile 1.3. Changes made to GUI client. Further changes required to Cmd client.
Modified Paths:
--------------
java-common/trunk/src/main/java/org/purl/sword/base/DepositResponse.java
java-common/trunk/src/main/java/org/purl/sword/base/HttpHeaders.java
java-common/trunk/src/main/java/org/purl/sword/base/QualityValue.java
java-common/trunk/src/main/java/org/purl/sword/base/SWORDEntry.java
java-common/trunk/src/main/java/org/purl/sword/base/SWORDErrorDocument.java
java-common/trunk/src/main/java/org/purl/sword/base/SWORDErrorException.java
java-common/trunk/src/main/java/org/purl/sword/base/Service.java
java-common/trunk/src/main/java/org/purl/sword/base/ServiceDocument.java
java-common/trunk/src/main/java/org/purl/sword/client/Client.java
java-common/trunk/src/main/java/org/purl/sword/client/ClientConstants.java
java-common/trunk/src/main/java/org/purl/sword/client/CmdClient.java
java-common/trunk/src/main/java/org/purl/sword/client/GuiClient.java
java-common/trunk/src/main/java/org/purl/sword/client/PostDialog.java
java-common/trunk/src/main/java/org/purl/sword/client/PostMessage.java
java-common/trunk/src/main/java/org/purl/sword/client/ServicePanel.java
java-common/trunk/src/main/java/org/purl/sword/client/ServletClient.java
java-common/trunk/src/main/java/org/purl/sword/server/DepositServlet.java
java-common/trunk/src/main/java/org/purl/sword/server/DummyServer.java
java-common/trunk/src/main/java/org/purl/sword/server/ServiceDocumentServlet.java
Modified: java-common/trunk/src/main/java/org/purl/sword/base/DepositResponse.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/base/DepositResponse.java 2009-01-15 09:55:45 UTC (rev 103)
+++ java-common/trunk/src/main/java/org/purl/sword/base/DepositResponse.java 2009-01-15 09:58:13 UTC (rev 104)
@@ -88,8 +88,8 @@
/**
* Get the SWORD Entry
- *
- * @return The entry
+ *
+ * @return The entry
*/
public SWORDEntry getEntry( )
{
@@ -97,6 +97,25 @@
}
/**
+ * Get the SWORD Entry as an error document
+ *
+ * @return The error document
+ * @throws SWORDException If this DespositResponse does not contain a
+ * SWORDErrorDocument. If this is thrown, then
+ * the document stores an Entry.
+ */
+ public SWORDErrorDocument getErrorDocument( )
+ throws SWORDException
+ {
+ if( entry instanceof SWORDErrorDocument)
+ {
+ return (SWORDErrorDocument)entry;
+ }
+
+ throw new SWORDException("Requested document is not an Error Document.");
+ }
+
+ /**
* Retrieve the HTTP Response code.
*
* @return The response code.
@@ -126,7 +145,7 @@
ByteArrayOutputStream stream = new ByteArrayOutputStream();
Serializer serializer = new Serializer(stream, "UTF-8");
serializer.setIndent(3);
- serializer.setMaxLength(64);
+ //serializer.setMaxLength(64);
if( entry != null )
{
Modified: java-common/trunk/src/main/java/org/purl/sword/base/HttpHeaders.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/base/HttpHeaders.java 2009-01-15 09:55:45 UTC (rev 103)
+++ java-common/trunk/src/main/java/org/purl/sword/base/HttpHeaders.java 2009-01-15 09:58:13 UTC (rev 104)
@@ -74,11 +74,17 @@
public static final String X_VERBOSE = "X-Verbose";
/**
- * The HTTP Header label that specifies the desired NoOp status.
+ * The HTTP Header label that specifies the desired NoOp status.
*/
public static final String X_NO_OP = "X-No-Op";
-
+
/**
+ * An HTTP Header label that the server should not epect, and thus
+ * created a corrupt header.
+ */
+ public static final String X_CORRUPT = "X-wibble";
+
+ /**
* The HTTP Header that specifies the error code information.
*/
public static final String X_ERROR_CODE = "X-Error-Code";
Modified: java-common/trunk/src/main/java/org/purl/sword/base/QualityValue.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/base/QualityValue.java 2009-01-15 09:55:45 UTC (rev 103)
+++ java-common/trunk/src/main/java/org/purl/sword/base/QualityValue.java 2009-01-15 09:58:13 UTC (rev 104)
@@ -118,7 +118,7 @@
/**
* A main method with rudimentary tests to check the class
*/
- public static void main(String[] args)
+ /*public static void main(String[] args)
{
// Test the class
@@ -204,4 +204,5 @@
System.out.println("7) Fail: no value failed unexpectedly");
}
}
+ */
}
Modified: java-common/trunk/src/main/java/org/purl/sword/base/SWORDEntry.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/base/SWORDEntry.java 2009-01-15 09:55:45 UTC (rev 103)
+++ java-common/trunk/src/main/java/org/purl/sword/base/SWORDEntry.java 2009-01-15 09:58:13 UTC (rev 104)
@@ -64,13 +64,18 @@
protected String verboseDescription;
/**
- * Used for a human readable statement about what treatment
+ * Used for a human readable statement about what treatment
* the deposited resource has received. Include either a
- * text description or a URI.
+ * text description or a URI.
*/
protected String treatment;
-
+
/**
+ * Used for a human readable summary of an error.
+ */
+ protected String summary;
+
+ /**
* Used to determine if the noOp value has been set.
*/
protected boolean noOpSet;
@@ -318,6 +323,17 @@
log.error("Error accessing the content for the treatment element");
}
}
+ else if (isInstanceOf(element, "summary", Namespaces.NS_ATOM))
+ {
+ try
+ {
+ summary = unmarshallString(element);
+ }
+ catch( UnmarshallException ume )
+ {
+ log.error("Error accessing the content for the summary element");
+ }
+ }
else if (isInstanceOf(element, "noOp", Namespaces.NS_SWORD))
{
try
Modified: java-common/trunk/src/main/java/org/purl/sword/base/SWORDErrorDocument.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/base/SWORDErrorDocument.java 2009-01-15 09:55:45 UTC (rev 103)
+++ java-common/trunk/src/main/java/org/purl/sword/base/SWORDErrorDocument.java 2009-01-15 09:58:13 UTC (rev 104)
@@ -64,7 +64,7 @@
* The Error URI
*/
private String errorURI;
-
+
/**
* Create the error document (intended to be used when unmarshalling an error document
* as this will set the errorURI)
@@ -117,11 +117,31 @@
}
/**
+ * Get the error URI
+ *
+ * @return the error URI
+ */
+ public String getErrorURI()
+ {
+ return errorURI;
+ }
+
+ /**
+ * set the error URI
+ *
+ * @param error the error URI
+ */
+ public void setErrorURI(String error)
+ {
+ errorURI = error;
+ }
+
+ /**
* Main method to perform a brief test of the class
*
* @param args
*/
- public static void main(String[] args)
+ /*public static void main(String[] args)
{
SWORDErrorDocument sed = new SWORDErrorDocument(ErrorCodes.MEDIATION_NOT_ALLOWED);
sed.setNoOp(true);
@@ -137,4 +157,5 @@
System.out.println(sed.marshall().toXML());
}
+ */
}
\ No newline at end of file
Modified: java-common/trunk/src/main/java/org/purl/sword/base/SWORDErrorException.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/base/SWORDErrorException.java 2009-01-15 09:55:45 UTC (rev 103)
+++ java-common/trunk/src/main/java/org/purl/sword/base/SWORDErrorException.java 2009-01-15 09:58:13 UTC (rev 104)
@@ -72,7 +72,7 @@
else if (errorURI.equals(ErrorCodes.ERROR_CONTENT)) { status = 415; }
else if (errorURI.equals(ErrorCodes.MAX_UPLOAD_SIZE_EXCEEDED)) { status = 413; }
else if (errorURI.equals(ErrorCodes.MEDIATION_NOT_ALLOWED)) { status = 412; }
- else if (errorURI.equals(ErrorCodes.TARGET_OWNER_UKNOWN)) { status = 400; }
+ else if (errorURI.equals(ErrorCodes.TARGET_OWNER_UKNOWN)) { status = 401; }
else { status = 400; }
}
Modified: java-common/trunk/src/main/java/org/purl/sword/base/Service.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/base/Service.java 2009-01-15 09:55:45 UTC (rev 103)
+++ java-common/trunk/src/main/java/org/purl/sword/base/Service.java 2009-01-15 09:58:13 UTC (rev 104)
@@ -85,6 +85,11 @@
private int maxUploadSize = -1;
/**
+ * The details of the server
+ */
+ private String serverIdentity;
+
+ /**
* List of Workspaces.
*/
private List<Workspace> workspaces;
@@ -101,7 +106,7 @@
* Local name part of verbose element.
*/
public static final String ELEMENT_SWORD_VERBOSE = "verbose";
-
+
/**
* Local name part of noOp element.
*/
@@ -111,8 +116,13 @@
* MaxUploadSize
*/
public static final String ELEMENT_SWORD_MAX_UPLOAD_SIZE = "maxUploadSize";
-
+
/**
+ * MaxUploadSize
+ */
+ public static final String ELEMENT_GENERATOR = "generator";
+
+ /**
* Name for this element.
*/
public static final String ELEMENT_NAME = "service";
@@ -255,15 +265,33 @@
/**
* Get the maximum upload file size (in kB)
- *
+ *
* @return the maximum file upload size
*/
public int getMaxUploadSize()
{
return maxUploadSize;
}
-
+
/**
+ * Get the identity of the server
+ *
+ * @return the data returned by the server
+ */
+ public String getServerIdentity()
+ {
+ return serverIdentity;
+ }
+
+ /**
+ * Set the identity of the server
+ */
+ public void setServerIdentity(String identity)
+ {
+ serverIdentity = identity;
+ }
+
+ /**
* Get an Iterator over the workspaces.
*
* @return The workspace.
@@ -397,6 +425,10 @@
{
setMaxUploadSize(unmarshallInteger(element));
}
+ else if (isInstanceOf(element, ELEMENT_GENERATOR, Namespaces.NS_ATOM))
+ {
+ setServerIdentity(unmarshallString(element));
+ }
else if (isInstanceOf(element, Workspace.ELEMENT_NAME, Namespaces.NS_APP ))
{
Workspace workspace = new Workspace( );
Modified: java-common/trunk/src/main/java/org/purl/sword/base/ServiceDocument.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/base/ServiceDocument.java 2009-01-15 09:55:45 UTC (rev 103)
+++ java-common/trunk/src/main/java/org/purl/sword/base/ServiceDocument.java 2009-01-15 09:58:13 UTC (rev 104)
@@ -126,7 +126,7 @@
ByteArrayOutputStream stream = new ByteArrayOutputStream();
Serializer serializer = new Serializer(stream, "UTF-8");
serializer.setIndent(3);
- serializer.setMaxLength(64);
+ //serializer.setMaxLength(64);
Document doc = new Document(service.marshall());
serializer.write(doc);
Modified: java-common/trunk/src/main/java/org/purl/sword/client/Client.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/client/Client.java 2009-01-15 09:55:45 UTC (rev 103)
+++ java-common/trunk/src/main/java/org/purl/sword/client/Client.java 2009-01-15 09:58:13 UTC (rev 104)
@@ -102,6 +102,11 @@
private String password;
/**
+ * The userAgent to identify this application.
+ */
+ private String userAgent;
+
+ /**
* The client that is used to send data to the specified server.
*/
private HttpClient client;
@@ -126,7 +131,7 @@
new Integer(DEFAULT_TIMEOUT));
log.debug("proxy host: " + client.getHostConfiguration().getProxyHost());
log.debug("proxy port: " + client.getHostConfiguration().getProxyPort());
- doAuthentication = false;
+ doAuthentication = false;
}
/**
@@ -210,6 +215,9 @@
doAuthentication = false;
}
+ public void setUserAgent(String userAgent){
+ this.userAgent = userAgent;
+ }
/**
* Set the connection timeout for the socket.
*
@@ -285,6 +293,12 @@
onBehalfOf));
}
+ if (containsValue(userAgent)) {
+ log.debug("Setting userAgent: " + userAgent);
+ httpget.addRequestHeader(new Header(HttpHeaders.USER_AGENT,
+ userAgent));
+ }
+
ServiceDocument doc = null;
try {
@@ -358,7 +372,7 @@
}
String filename = message.getFilename();
- if (filename != "") {
+ if (! "".equals(filename)) {
httppost.addRequestHeader(new Header(
HttpHeaders.CONTENT_DISPOSITION, " filename="
+ filename));
@@ -369,8 +383,14 @@
.getSlug()));
}
- httppost.addRequestHeader(new Header(HttpHeaders.X_NO_OP, Boolean
+ if(message.getCorruptRequest())
+ {
+ // insert a header with an invalid boolean value
+ httppost.addRequestHeader(new Header(HttpHeaders.X_NO_OP, "Wibble"));
+ }else{
+ httppost.addRequestHeader(new Header(HttpHeaders.X_NO_OP, Boolean
.toString(message.isNoOp())));
+ }
httppost.addRequestHeader(new Header(HttpHeaders.X_VERBOSE, Boolean
.toString(message.isVerbose())));
@@ -390,7 +410,6 @@
if (containsValue(userAgent)) {
httppost.addRequestHeader(new Header(
HttpHeaders.USER_AGENT, userAgent));
- System.out.println("USERAGENT = " + userAgent);
}
stream = new FileInputStream(message.getFilepath());
Modified: java-common/trunk/src/main/java/org/purl/sword/client/ClientConstants.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/client/ClientConstants.java 2009-01-15 09:55:45 UTC (rev 103)
+++ java-common/trunk/src/main/java/org/purl/sword/client/ClientConstants.java 2009-01-15 09:58:13 UTC (rev 104)
@@ -47,8 +47,18 @@
* Current software version.
*/
public static final String CLIENT_VERSION = "1.0";
-
+
/**
+ * the name of this application
+ */
+ public static final String SERVICE_NAME = "CASIS Test Client";
+
+ /**
+ * the name of this application
+ */
+ public static final String NOT_DEFINED_TEXT = "Not defined";
+
+ /**
* The logging property file.
*/
public static final String LOGGING_PROPERTY_FILE = "log4j.properties";
Modified: java-common/trunk/src/main/java/org/purl/sword/client/CmdClient.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/client/CmdClient.java 2009-01-15 09:55:45 UTC (rev 103)
+++ java-common/trunk/src/main/java/org/purl/sword/client/CmdClient.java 2009-01-15 09:58:13 UTC (rev 104)
@@ -42,6 +42,8 @@
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Iterator;
+import java.util.Hashtable;
+import java.util.Enumeration;
import org.apache.log4j.Logger;
import org.purl.sword.atom.Author;
@@ -58,6 +60,7 @@
import org.purl.sword.base.SWORDEntry;
import org.purl.sword.base.ServiceDocument;
import org.purl.sword.base.Workspace;
+import org.purl.sword.base.QualityValue;
/**
* Example implementation of a command line client. This can send out service
@@ -164,6 +167,8 @@
System.out.println("Supports NoOp? " + document.getService().isNoOp());
System.out.println("Supports Verbose? "
+ document.getService().isVerbose());
+ System.out.println("Max Upload File Size "
+ + document.getService().getMaxUploadSize() +" kB");
Iterator<Workspace> workspaces = document.getService().getWorkspaces();
for (; workspaces.hasNext();)
@@ -206,6 +211,16 @@
System.out.println("Accepts: " + s);
}
}
+ Hashtable acceptsPackaging = collection.getAcceptPackaging();
+ String acceptPackagingList = "";
+ for(Enumeration e = acceptsPackaging.keys();e.hasMoreElements();)
+ {
+ String key = (String) e.nextElement();
+ QualityValue packagingValue = (QualityValue)acceptsPackaging.get(key);
+ acceptPackagingList += key + " ("+packagingValue+"), ";
+ }
+ System.out.println("Accepts Packaging: "+ acceptPackagingList);
+
}
System.out.println("+ End of Collections ---");
}
@@ -251,7 +266,7 @@
message.setFormatNamespace(options.getFormatNamespace());
message.setOnBehalfOf(options.getOnBehalfOf());
message.setChecksumError(options.getChecksumError());
- message.setSlug(options.getSlug());
+ message.setUserAgent(ClientConstants.SERVICE_NAME);
processPost(message);
@@ -313,7 +328,7 @@
message.setFormatNamespace(options.getFormatNamespace());
message.setOnBehalfOf(destination.getOnBehalfOf());
message.setChecksumError(options.getChecksumError());
- message.setSlug(options.getSlug());
+ message.setUserAgent(ClientConstants.SERVICE_NAME);
processPost(message);
}
Modified: java-common/trunk/src/main/java/org/purl/sword/client/GuiClient.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/client/GuiClient.java 2009-01-15 09:55:45 UTC (rev 103)
+++ java-common/trunk/src/main/java/org/purl/sword/client/GuiClient.java 2009-01-15 09:58:13 UTC (rev 104)
@@ -82,6 +82,8 @@
import org.jdesktop.swingworker.SwingWorker;
import org.purl.sword.base.DepositResponse;
import org.purl.sword.base.ServiceDocument;
+import org.purl.sword.base.SWORDException;
+import org.purl.sword.base.SWORDErrorDocument;
/**
* Main class that creates the GUI interface for the demonstration SWORD client.
@@ -363,6 +365,7 @@
} else {
swordclient.clearCredentials();
}
+ swordclient.setUserAgent(ClientConstants.SERVICE_NAME);
}
/***************************************************************************
@@ -686,7 +689,9 @@
message.setNoOp(postDialog.useNoOp());
message.setChecksumError(postDialog
.corruptMD5());
- message.setSlug(postDialog.getSlug());
+ message.setCorruptRequest(postDialog
+ .corruptRequest());
+ message.setUserAgent(ClientConstants.SERVICE_NAME);
publish("Posting file to: " + location);
@@ -705,12 +710,29 @@
} else {
publish("Unable to post file to: "
+ location);
+ mainPanel.addMessage(document.marshall());
+
+ // build up the error message, taking into
+ // account the exception condition.
+ String outputMessage;
+ try{
+ SWORDErrorDocument errorDoc = document.getErrorDocument();
+ outputMessage = "Unable to post file to "
+ + location
+ + ".\r\nStatus is: "
+ + status.toString()
+ + ".\r\nThe Error URI is: "
+ + errorDoc.getErrorURI()
+ + "\r\nSummary is: "
+ + errorDoc.getSummary();
+ }catch (SWORDException se){
+ outputMessage = se.getMessage();
+ }
+
+ // display the error - using the string created above
JOptionPane.showMessageDialog(
GuiClient.this,
- "Unable to post file to "
- + location
- + ". Status is: "
- + status.toString(),
+ outputMessage,
"Post File",
JOptionPane.WARNING_MESSAGE);
}
Modified: java-common/trunk/src/main/java/org/purl/sword/client/PostDialog.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/client/PostDialog.java 2009-01-15 09:55:45 UTC (rev 103)
+++ java-common/trunk/src/main/java/org/purl/sword/client/PostDialog.java 2009-01-15 09:58:13 UTC (rev 104)
@@ -160,11 +160,16 @@
private JCheckBox useMD5;
/**
- * The corruptMD5 checkbox.
+ * The corruptMD5 checkbox.
*/
private JCheckBox corruptMD5;
-
+
/**
+ * The corruptRequest checkbox.
+ */
+ private JCheckBox corruptRequest;
+
+ /**
* The useNoOp checkbox.
*/
private JCheckBox useNoOp;
@@ -185,11 +190,6 @@
private JList list;
/**
- * The Slug Header that is to be sent to the server.
- */
- private SWORDComboBox slugHeader;
-
- /**
* The parent frame for the dialog that is displayed.
*/
private JFrame parentFrame = null;
@@ -263,7 +263,6 @@
String type = "application/zip";
fileType.addItem(type);
fileType.setSelectedItem(type);
- slugHeader = new SWORDComboBox();
// controls that will be used in the second dialog
postLocation = new SWORDComboBox();
@@ -275,6 +274,7 @@
useMD5 = new JCheckBox();
useMD5.addChangeListener(this);
corruptMD5 = new JCheckBox();
+ corruptRequest = new JCheckBox();
useNoOp = new JCheckBox();
useVerbose = new JCheckBox();
formatNamespace = new SWORDComboBox();
@@ -283,10 +283,13 @@
JLabel fileTypeLabel = new JLabel("File Type:", JLabel.TRAILING);
JLabel useMD5Label = new JLabel("Use MD5:", JLabel.TRAILING);
JLabel corruptMD5Label = new JLabel("Corrupt MD5:", JLabel.TRAILING);
+ JLabel corruptRequestLabel = new JLabel("Corrupt Request:", JLabel.TRAILING);
+ //JLabel corruptMD5Label = new JLabel("Corrupt MD5:", JLabel.TRAILING);
JLabel useNoOpLabel = new JLabel("Use noOp:", JLabel.TRAILING);
JLabel useVerboseLabel = new JLabel("Use verbose:", JLabel.TRAILING);
- JLabel formatNamespaceLabel = new JLabel("Format Namespace:", JLabel.TRAILING);
- JLabel slugHeaderLabel = new JLabel("Slug Header:", JLabel.TRAILING);
+ JLabel formatNamespaceLabel = new JLabel("X-Packaging:", JLabel.TRAILING);
+ JLabel userAgentLabel = new JLabel("User Agent:", JLabel.TRAILING);
+ JLabel userAgentNameLabel = new JLabel(ClientConstants.SERVICE_NAME, JLabel.LEADING);
SWORDFormPanel panel = new SWORDFormPanel();
panel.addFirstRow(new JLabel("Please enter the details for the post operation"));
@@ -298,10 +301,11 @@
panel.addRow(fileTypeLabel, fileType);
panel.addRow(useMD5Label, useMD5);
panel.addRow(corruptMD5Label, corruptMD5);
+ panel.addRow(corruptRequestLabel, corruptRequest);
panel.addRow(useNoOpLabel, useNoOp);
panel.addRow(useVerboseLabel, useVerbose);
panel.addRow(formatNamespaceLabel, formatNamespace);
- panel.addRow(slugHeaderLabel, slugHeader);
+ panel.addRow(userAgentLabel, userAgentNameLabel);
return panel;
}
@@ -575,22 +579,22 @@
}
/**
- * Get the slug name.
- * @return The name.
+ * Determine if the MD5 hash should be corrupted.
+ * @return True if the corrupt MD5 checkbox is selected. The MD5 checkbox
+ * must also be selected.
*/
- public String getSlug()
+ public boolean corruptMD5()
{
- return slugHeader.getText();
+ return (corruptMD5.isEnabled() && corruptMD5.isSelected());
}
-
+
/**
- * Determine if the MD5 hash should be corrupted.
- * @return True if the corrupt MD5 checkbox is selected. The MD5 checkbox
- * must also be selected.
+ * Determine if the POST request should be corrupted.
+ * @return True if the corrupt request checkbox is selected.
*/
- public boolean corruptMD5()
+ public boolean corruptRequest()
{
- return (corruptMD5.isEnabled() && corruptMD5.isSelected());
+ return (corruptRequest.isSelected());
}
/**
Modified: java-common/trunk/src/main/java/org/purl/sword/client/PostMessage.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/client/PostMessage.java 2009-01-15 09:55:45 UTC (rev 103)
+++ java-common/trunk/src/main/java/org/purl/sword/client/PostMessage.java 2009-01-15 09:58:13 UTC (rev 104)
@@ -119,17 +119,24 @@
private boolean verbose;
/**
- * The packaging format for the deposit.
+ * The packaging format for the deposit.
*/
private String packaging;
/**
- * True if the deposit should simualte a checksum error. The client should check this
+ * True if the deposit should simualte a checksum error. The client should check this
* field to determine if a correct MD5 checksum should be sent or whether the checksum should
- * be modified so that it generates an error at the server.
+ * be modified so that it generates an error at the server.
*/
private boolean checksumError;
+ /**
+ * True if the deposit should corrupt the POST header. The client should check this
+ * field to determine if a correct header should be sent or whether the header should
+ * be modified so that it generates an error at the server.
+ */
+ private boolean corruptRequest;
+
/**
* The Slug header value.
*/
@@ -330,6 +337,26 @@
}
/**
+ * Get the status of the corrupt request flag.
+ *
+ * @return True if the client should corrupt the POST header.
+ */
+ public boolean getCorruptRequest()
+ {
+ return corruptRequest;
+ }
+
+ /**
+ * Set the state of the corrupt request flag.
+ *
+ * @param checksumError True if the item should corrupt the POST header.
+ */
+ public void setCorruptRequest(boolean corruptRequest)
+ {
+ this.corruptRequest = corruptRequest;
+ }
+
+ /**
* Set the Slug value.
*
* @param slug The value.
Modified: java-common/trunk/src/main/java/org/purl/sword/client/ServicePanel.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/client/ServicePanel.java 2009-01-15 09:55:45 UTC (rev 103)
+++ java-common/trunk/src/main/java/org/purl/sword/client/ServicePanel.java 2009-01-15 09:58:13 UTC (rev 104)
@@ -77,6 +77,7 @@
import java.util.Enumeration;
import java.util.Iterator;
import java.util.Vector;
+import java.util.Hashtable;
import javax.swing.Icon;
import javax.swing.ImageIcon;
@@ -107,6 +108,7 @@
import org.purl.sword.base.Service;
import org.purl.sword.base.ServiceDocument;
import org.purl.sword.base.Workspace;
+import org.purl.sword.base.QualityValue;
/**
* The main panel for the GUI client. This contains the top-two sub-panels: the
@@ -473,7 +475,7 @@
buffer.append("<tr bgcolor=\"#ffffff;\"><td>");
buffer.append(label);
buffer.append("</td><td>");
- buffer.append(value);
+ buffer.append(DisplayableValue(value));
buffer.append("</td></tr>");
}
/**
@@ -492,6 +494,8 @@
addTableRow(buffer, "SWORD Version", service.getVersion());
addTableRow(buffer, "NoOp Support ", service.isNoOp());
addTableRow(buffer, "Verbose Support ", service.isVerbose());
+ addTableRow(buffer, "Max File Upload Size ", service.getMaxUploadSize()+" kB");
+ //addTableRow(buffer, "Server Identity ", service.getServerIdentity()); // FIXME delete?
buffer.append("</table>");
@@ -521,6 +525,20 @@
details.setText(buffer.toString());
}
+ /**
+ * Return the parameter unmodified if set, or the not defined text if null
+ * @param s
+ * @return s or ClientConstants.NOT_DEFINED_TEXT
+ */
+ private Object DisplayableValue(Object s)
+ {
+ if (null == s)
+ {
+ return ClientConstants.NOT_DEFINED_TEXT;
+ }else{
+ return s;
+ }
+ }
/**
* Add a string within paragraph tags.
@@ -559,11 +577,12 @@
addTableRow(buffer, "Namespace", collection.getFormatNamespace());
addTableRow(buffer, "Treatment", collection.getTreatment());
addTableRow(buffer, "Mediation", collection.getMediation());
+ addTableRow(buffer, "Nested Service Document", collection.getService());
String[] accepts = collection.getAccepts();
String acceptList = "";
- if( accepts != null && accepts.length == 0 )
+ if( accepts != null && accepts.length == 0 )
{
acceptList = "None specified";
}
@@ -576,6 +595,16 @@
}
addTableRow(buffer, "Accepts", acceptList);
+ Hashtable acceptsPackaging = collection.getAcceptPackaging();
+ String acceptPackagingList = "";
+ for(Enumeration e = acceptsPackaging.keys();e.hasMoreElements();)
+ {
+ String key = (String) e.nextElement();
+ QualityValue packagingValue = (QualityValue)acceptsPackaging.get(key);
+ acceptPackagingList += key + " ("+packagingValue+")" + "<br>";
+ }
+ addTableRow(buffer, "Accepts Packaging", acceptPackagingList);
+
buffer.append("</table>");
}
@@ -660,28 +689,21 @@
addTableRow(buffer, "Contributors", contributorString.toString());
// process source
- Source source = entry.getSource();
- String sourceString = "";
- if( source != null )
- {
- Generator generator = source.getGenerator();
- if( generator != null )
- {
- sourceString += "Content: '" + generator.getContent() + "' <br>'";
- sourceString += "Version: '" + generator.getVersion() + "' <br>'";
- sourceString += "Uri: '" + generator.getUri() + "' <br>'";
- }
- else
- {
- sourceString += "No generator defined.";
- }
+ String sourceString="";
+ Generator generator = entry.getGenerator();
+ if( generator != null )
+ {
+ sourceString += "Content: '" + generator.getContent() + "' <br>'";
+ sourceString += "Version: '" + generator.getVersion() + "' <br>'";
+ sourceString += "Uri: '" + generator.getUri() + "'";
}
else
{
- sourceString = "Not defined";
+ sourceString += "No generator defined.";
}
- addTableRow(buffer, "Source", sourceString);
+ addTableRow(buffer, "Generator", sourceString);
+
// process treatment
addTableRow(buffer, "Treatment", entry.getTreatment());
@@ -691,10 +713,13 @@
// process noOp
addTableRow(buffer, "NoOp", entry.isNoOp());
- // process formatNamespace
+ // process formatNamespace
addTableRow(buffer, "Packaging", entry.getPackaging());
+ // process userAgent
+ addTableRow(buffer, "User Agent", entry.getUserAgent());
+
buffer.append("</table>");
}
Modified: java-common/trunk/src/main/java/org/purl/sword/client/ServletClient.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/client/ServletClient.java 2009-01-15 09:55:45 UTC (rev 103)
+++ java-common/trunk/src/main/java/org/purl/sword/client/ServletClient.java 2009-01-15 09:58:13 UTC (rev 104)
@@ -261,7 +261,7 @@
Client client = new Client();
try {
PostMessage message = new PostMessage();
- message.setUserAgent(userAgent);
+ message.setUserAgent(ClientConstants.SERVICE_NAME);
// Get the file
FileItemFactory factory = new DiskFileItemFactory();
@@ -352,7 +352,7 @@
client.setProxy(pHost, pPort);
}
- message.setUseMD5(useMD5);
+ message.setUseMD5(useMD5);
message.setChecksumError(errorMD5);
message.setVerbose(verbose);
message.setNoOp(noOp);
Modified: java-common/trunk/src/main/java/org/purl/sword/server/DepositServlet.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/server/DepositServlet.java 2009-01-15 09:55:45 UTC (rev 103)
+++ java-common/trunk/src/main/java/org/purl/sword/server/DepositServlet.java 2009-01-15 09:58:13 UTC (rev 104)
@@ -259,26 +259,41 @@
d.setFile(fis);
// Set the X-On-Behalf-Of header
- d.setOnBehalfOf(request.getHeader(HttpHeaders.X_ON_BEHALF_OF.toString()));
+ String onBehalfOf = request.getHeader(HttpHeaders.X_ON_BEHALF_OF.toString());
+ if ((onBehalfOf != null) && (onBehalfOf.equals("reject"))) {
+ // user name is "reject", so throw a not know error to allow the client to be tested
+ throw new SWORDErrorException(ErrorCodes.TARGET_OWNER_UKNOWN,"unknown user \"reject\"");
+ } else {
+ d.setOnBehalfOf(onBehalfOf);
+ }
// Set the X-Packaging header
d.setPackaging(request.getHeader(HttpHeaders.X_PACKAGING));
// Set the X-No-Op header
String noop = request.getHeader(HttpHeaders.X_NO_OP);
+ log.error("X_NO_OP value is " + noop);
if ((noop != null) && (noop.equals("true"))) {
d.setNoOp(true);
+ } else if ((noop != null) && (noop.equals("false"))) {
+ d.setNoOp(false);
+ }else if (noop == null) {
+ d.setNoOp(false);
} else {
- d.setNoOp(false);
- }
+ throw new SWORDErrorException(ErrorCodes.ERROR_BAD_REQUEST,"Bad no-op");
+ }
// Set the X-Verbose header
String verbose = request.getHeader(HttpHeaders.X_VERBOSE);
if ((verbose != null) && (verbose.equals("true"))) {
d.setVerbose(true);
+ } else if ((verbose != null) && (verbose.equals("false"))) {
+ d.setVerbose(false);
+ }else if (verbose == null) {
+ d.setVerbose(false);
} else {
- d.setVerbose(false);
- }
+ throw new SWORDErrorException(ErrorCodes.ERROR_BAD_REQUEST,"Bad verbose");
+ }
// Set the slug
String slug = request.getHeader(HttpHeaders.SLUG);
Modified: java-common/trunk/src/main/java/org/purl/sword/server/DummyServer.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/server/DummyServer.java 2009-01-15 09:55:45 UTC (rev 103)
+++ java-common/trunk/src/main/java/org/purl/sword/server/DummyServer.java 2009-01-15 09:58:13 UTC (rev 104)
@@ -65,6 +65,8 @@
import org.purl.sword.base.ServiceDocumentRequest;
import org.purl.sword.base.Workspace;
+import org.apache.log4j.Logger;
+
/**
* A 'dummy server' which acts as dumb repository which implements the
* SWORD ServerInterface. It accepts any type of deposit, and tries to
@@ -81,6 +83,8 @@
/** A counter to count submissions, so the response to a deposit can increment */
private static int counter = 0;
+ /** Logger */
+ private static Logger log = Logger.getLogger(ServiceDocumentServlet.class);
/**
* Provides a dumb but plausible service document - it contains
@@ -107,8 +111,10 @@
ServiceDocument document = new ServiceDocument();
Service service = new Service("1.3", true, true);
document.setService(service);
+ log.debug("sdr.getLocation() is: " + sdr.getLocation());
String location = sdr.getLocation().substring(0, sdr.getLocation().length() - 16);
-
+ log.debug("location is: " + location);
+
if (sdr.getLocation().contains("?nested=")) {
Workspace workspace = new Workspace();
workspace.setTitle("Nested service document workspace");
@@ -304,7 +310,7 @@
try {
content.setType("application/zip");
} catch (InvalidMediaTypeException e1) {
- // TODO Auto-generated catch block
+ // TODO Auto-generated catch block
e1.printStackTrace();
}
content.setSource("http://www.myrepository.ac.uk/sdl/uploads/upload-" + counter + ".zip");
Modified: java-common/trunk/src/main/java/org/purl/sword/server/ServiceDocumentServlet.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/server/ServiceDocumentServlet.java 2009-01-15 09:55:45 UTC (rev 103)
+++ java-common/trunk/src/main/java/org/purl/sword/server/ServiceDocumentServlet.java 2009-01-15 09:58:13 UTC (rev 104)
@@ -99,7 +99,7 @@
// Set the authentication method
authN = getServletContext().getInitParameter("authentication-method");
- if ((authN == null) || (authN == "")) {
+ if ((authN == null) || ("".equals(authN))) {
authN = "None";
}
log.info("Authentication type set to: " + authN);
@@ -129,7 +129,7 @@
// Create the ServiceDocumentRequest
ServiceDocumentRequest sdr = new ServiceDocumentRequest();
- // Are there any authentication details?
+ // Are there any authentication details?
String usernamePassword = getUsernamePassword(request);
if ((usernamePassword != null) && (!usernamePassword.equals(""))) {
int p = usernamePassword.indexOf(":");
@@ -239,9 +239,11 @@
private static String getUrl(HttpServletRequest req) {
String reqUrl = req.getRequestURL().toString();
String queryString = req.getQueryString();
+ log.debug("Requested url is: " + reqUrl);
if (queryString != null) {
reqUrl += "?" + queryString;
}
+ log.debug("Requested url with Query String is: " + reqUrl);
return reqUrl;
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: SVN c. m. f. t. SWORD-A. p. <swo...@li...> - 2009-01-15 09:55:50
|
Revision: 103
http://sword-app.svn.sourceforge.net/sword-app/?rev=103&view=rev
Author: andy_starr
Date: 2009-01-15 09:55:45 +0000 (Thu, 15 Jan 2009)
Log Message:
-----------
removed Slug header as part of update to 1.3
Modified Paths:
--------------
java-webapp/trunk/src/main/webapp/depositform.jsp
Modified: java-webapp/trunk/src/main/webapp/depositform.jsp
===================================================================
--- java-webapp/trunk/src/main/webapp/depositform.jsp 2008-12-13 19:27:12 UTC (rev 102)
+++ java-webapp/trunk/src/main/webapp/depositform.jsp 2009-01-15 09:55:45 UTC (rev 103)
@@ -55,7 +55,6 @@
Username: <input type="text" name="u" value="<%= u %>" /><br />
Password: <input type="text" name="p" value="<%= p %>" /><br />
On behalf of: <input type="text" name="obo" value="<%= obo %>" /><br />
- Slug: <input type="text" name="slug" /><br />
Send MD5 checksum: <input type="checkbox" name="usemd5" checked="checked" /><br />
Corrupt MD5 checksum: <input type="checkbox" name="errormd5" /><br />
Request verbose response: <input type="checkbox" name="verbose" /><br />
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: SVN c. m. f. t. SWORD-A. p. <swo...@li...> - 2008-12-13 19:27:15
|
Revision: 102
http://sword-app.svn.sourceforge.net/sword-app/?rev=102&view=rev
Author: stuartlewis
Date: 2008-12-13 19:27:12 +0000 (Sat, 13 Dec 2008)
Log Message:
-----------
Error documents now include the user-agent echoed back
Modified Paths:
--------------
java-common/trunk/src/main/java/org/purl/sword/server/DepositServlet.java
Modified: java-common/trunk/src/main/java/org/purl/sword/server/DepositServlet.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/server/DepositServlet.java 2008-12-06 20:38:44 UTC (rev 101)
+++ java-common/trunk/src/main/java/org/purl/sword/server/DepositServlet.java 2008-12-13 19:27:12 UTC (rev 102)
@@ -232,6 +232,7 @@
"The uploaded file exceeded the maximum file size this server will accept (the file is " +
fLength + "kB but the server will only accept files as large as " +
maxUploadSize + "kB)",
+ request,
response);
return;
}
@@ -247,6 +248,7 @@
this.makeErrorDocument(ErrorCodes.ERROR_CHECKSUM_MISMATCH,
HttpServletResponse.SC_PRECONDITION_FAILED,
"The received MD5 checksum for the deposited file did not match the checksum sent by the deposit client",
+ request,
response);
log.debug("Bad MD5 for file. Aborting with appropriate error message");
return;
@@ -335,6 +337,7 @@
this.makeErrorDocument(see.getErrorURI(),
see.getStatus(),
see.getDescription(),
+ request,
response);
return;
} catch (SWORDException se) {
@@ -365,11 +368,12 @@
* @param errorURI The error URI to pass
* @param status The HTTP status to return
* @param summary The textual description to give the user
+ * @param request The HttpServletRequest object
* @param response The HttpServletResponse to send the error document to
* @throws IOException
*/
- private void makeErrorDocument(String errorURI, int status,
- String summary, HttpServletResponse response) throws IOException
+ private void makeErrorDocument(String errorURI, int status, String summary,
+ HttpServletRequest request, HttpServletResponse response) throws IOException
{
SWORDErrorDocument sed = new SWORDErrorDocument(errorURI);
Title title = new Title();
@@ -383,6 +387,9 @@
Summary sum = new Summary();
sum.setContent(summary);
sed.setSummary(sum);
+ if (request.getHeader(HttpHeaders.USER_AGENT.toString()) != null) {
+ sed.setUserAgent(request.getHeader(HttpHeaders.USER_AGENT.toString()));
+ }
response.setStatus(status);
response.setContentType("application/atom+xml; charset=UTF-8");
PrintWriter out = response.getWriter();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: SVN c. m. f. t. SWORD-A. p. <swo...@li...> - 2008-12-06 20:38:55
|
Revision: 101
http://sword-app.svn.sourceforge.net/sword-app/?rev=101&view=rev
Author: stuartlewis
Date: 2008-12-06 20:38:44 +0000 (Sat, 06 Dec 2008)
Log Message:
-----------
Changed default HTTP response to 201 Created rather than 202 Accepted.
Modified Paths:
--------------
java-common/trunk/src/main/java/org/purl/sword/server/DummyServer.java
Modified: java-common/trunk/src/main/java/org/purl/sword/server/DummyServer.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/server/DummyServer.java 2008-12-06 20:17:54 UTC (rev 100)
+++ java-common/trunk/src/main/java/org/purl/sword/server/DummyServer.java 2008-12-06 20:38:44 UTC (rev 101)
@@ -245,7 +245,7 @@
if (!deposit.isNoOp()) {
counter++;
}
- DepositResponse dr = new DepositResponse(Deposit.ACCEPTED);
+ DepositResponse dr = new DepositResponse(Deposit.CREATED);
SWORDEntry se = new SWORDEntry();
Title t = new Title();
@@ -320,8 +320,6 @@
dr.setEntry(se);
- dr.setHttpResponse(200);
-
return dr;
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: SVN c. m. f. t. SWORD-A. p. <swo...@li...> - 2008-12-06 20:17:58
|
Revision: 100
http://sword-app.svn.sourceforge.net/sword-app/?rev=100&view=rev
Author: stuartlewis
Date: 2008-12-06 20:17:54 +0000 (Sat, 06 Dec 2008)
Log Message:
-----------
Dummy server wasn't setting the HTTP status code to 200, so Tomcat was defaulting to 202
Modified Paths:
--------------
java-common/trunk/src/main/java/org/purl/sword/server/DummyServer.java
Modified: java-common/trunk/src/main/java/org/purl/sword/server/DummyServer.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/server/DummyServer.java 2008-12-05 21:45:30 UTC (rev 99)
+++ java-common/trunk/src/main/java/org/purl/sword/server/DummyServer.java 2008-12-06 20:17:54 UTC (rev 100)
@@ -320,6 +320,8 @@
dr.setEntry(se);
+ dr.setHttpResponse(200);
+
return dr;
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: SVN c. m. f. t. SWORD-A. p. <swo...@li...> - 2008-12-05 22:22:31
|
Revision: 99
http://sword-app.svn.sourceforge.net/sword-app/?rev=99&view=rev
Author: stuartlewis
Date: 2008-12-05 21:45:30 +0000 (Fri, 05 Dec 2008)
Log Message:
-----------
Organized imports
Modified Paths:
--------------
java-common/trunk/src/main/java/org/purl/sword/server/DummyServer.java
Modified: java-common/trunk/src/main/java/org/purl/sword/server/DummyServer.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/server/DummyServer.java 2008-12-05 21:44:10 UTC (rev 98)
+++ java-common/trunk/src/main/java/org/purl/sword/server/DummyServer.java 2008-12-05 21:45:30 UTC (rev 99)
@@ -44,15 +44,12 @@
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
-import javax.servlet.http.HttpServletResponse;
-
import org.purl.sword.atom.Author;
import org.purl.sword.atom.Content;
import org.purl.sword.atom.Contributor;
import org.purl.sword.atom.Generator;
import org.purl.sword.atom.InvalidMediaTypeException;
import org.purl.sword.atom.Link;
-import org.purl.sword.atom.Source;
import org.purl.sword.atom.Summary;
import org.purl.sword.atom.Title;
import org.purl.sword.base.Collection;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: SVN c. m. f. t. SWORD-A. p. <swo...@li...> - 2008-12-05 22:22:26
|
Revision: 98
http://sword-app.svn.sourceforge.net/sword-app/?rev=98&view=rev
Author: stuartlewis
Date: 2008-12-05 21:44:10 +0000 (Fri, 05 Dec 2008)
Log Message:
-----------
Make URL in dummey server configurable (adjusts for deployed context) and update web.xml with current set of demo repositories
Modified Paths:
--------------
java-common/trunk/src/main/java/org/purl/sword/server/DummyServer.java
java-webapp/trunk/src/main/webapp/WEB-INF/web.xml
Modified: java-common/trunk/src/main/java/org/purl/sword/server/DummyServer.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/server/DummyServer.java 2008-12-01 20:26:40 UTC (rev 97)
+++ java-common/trunk/src/main/java/org/purl/sword/server/DummyServer.java 2008-12-05 21:44:10 UTC (rev 98)
@@ -84,6 +84,7 @@
/** A counter to count submissions, so the response to a deposit can increment */
private static int counter = 0;
+
/**
* Provides a dumb but plausible service document - it contains
* an anonymous workspace and collection, and one personalised
@@ -109,13 +110,14 @@
ServiceDocument document = new ServiceDocument();
Service service = new Service("1.3", true, true);
document.setService(service);
-
+ String location = sdr.getLocation().substring(0, sdr.getLocation().length() - 16);
+
if (sdr.getLocation().contains("?nested=")) {
Workspace workspace = new Workspace();
workspace.setTitle("Nested service document workspace");
Collection collection = new Collection();
collection.setTitle("Nested collection: " + sdr.getLocation().substring(sdr.getLocation().indexOf('?') + 1));
- collection.setLocation("http://localhost:8080/client/deposit/nested");
+ collection.setLocation(location + "/deposit/nested");
collection.addAcceptPackaging("http://purl.org/net/sword-types/METSDSpaceSIP");
collection.addAcceptPackaging("http://purl.org/net/sword-types/bagit");
collection.addAccepts("application/zip");
@@ -130,7 +132,7 @@
workspace.setTitle("Anonymous submitters workspace");
Collection collection = new Collection();
collection.setTitle("Anonymous submitters collection");
- collection.setLocation("http://localhost:8080/client/deposit/anon");
+ collection.setLocation(location + "/deposit/anon");
collection.addAcceptPackaging("http://purl.org/net/sword-types/METSDSpaceSIP");
collection.addAcceptPackaging("http://purl.org/net/sword-types/bagit");
collection.addAccepts("application/zip");
@@ -138,11 +140,11 @@
collection.setAbstract("A collection that anonymous users can deposit into");
collection.setTreatment("This is a dummy server");
collection.setCollectionPolicy("No guarantee of service, or that deposits will be retained for any length of time.");
- collection.setService("http://localhost:8080/client/servicedocument?nested=anon");
+ collection.setService(location + "/client/servicedocument?nested=anon");
workspace.addCollection(collection);
collection = new Collection();
collection.setTitle("Anonymous submitters other collection");
- collection.setLocation("http://localhost:8080/client/deposit/anonymous");
+ collection.setLocation(location + "/deposit/anonymous");
collection.addAcceptPackaging("http://purl.org/net/sword-types/METSDSpaceSIP");
collection.addAcceptPackaging("http://purl.org/net/sword-types/bagit");
collection.addAccepts("application/zip");
@@ -158,7 +160,7 @@
workspace.setTitle("Authenticated workspace for " + username);
collection = new Collection();
collection.setTitle("Authenticated collection for " + username);
- collection.setLocation("http://localhost:8080/client/deposit/" + username);
+ collection.setLocation(location + "/deposit/" + username);
collection.addAccepts("application/zip");
collection.addAccepts("application/xml");
collection.addAcceptPackaging("http://purl.org/net/sword-types/METSDSpaceSIP");
@@ -166,11 +168,11 @@
collection.setAbstract("A collection that " + username + " can deposit into");
collection.setTreatment("This is a dummy server");
collection.setCollectionPolicy("No guarantee of service, or that deposits will be retained for any length of time.");
- collection.setService("http://localhost:8080/client/servicedocument?nested=authenticated");
+ collection.setService(location + "/client/servicedocument?nested=authenticated");
workspace.addCollection(collection);
collection = new Collection();
collection.setTitle("Second authenticated collection for " + username);
- collection.setLocation("http://localhost:8080/sword/deposit/" + username + "-2");
+ collection.setLocation(location + "/deposit/" + username + "-2");
collection.addAccepts("application/zip");
collection.addAccepts("application/xml");
collection.addAcceptPackaging("http://purl.org/net/sword-types/bagit", 0.123f);
@@ -189,7 +191,7 @@
workspace.setTitle("Personal workspace for " + onBehalfOf);
Collection collection = new Collection();
collection.setTitle("Personal collection for " + onBehalfOf);
- collection.setLocation("http://sword.aber.ac.uk/sword/deposit?user=" + onBehalfOf);
+ collection.setLocation(location + "/deposit?user=" + onBehalfOf);
collection.addAccepts("application/zip");
collection.addAccepts("application/xml");
collection.addAcceptPackaging("http://purl.org/net/sword-types/METSDSpaceSIP");
Modified: java-webapp/trunk/src/main/webapp/WEB-INF/web.xml
===================================================================
--- java-webapp/trunk/src/main/webapp/WEB-INF/web.xml 2008-12-01 20:26:40 UTC (rev 97)
+++ java-webapp/trunk/src/main/webapp/WEB-INF/web.xml 2008-12-05 21:44:10 UTC (rev 98)
@@ -34,7 +34,7 @@
<context-param>
<param-name>client-urls</param-name>
- <param-value>http://localhost:8080/client/servicedocument,http://demoprints.eprints.org/sword-app/servicedocument,http://sword.aber.ac.uk/dspace-sword/servicedocument,http://sword.intralibrary.com/IntraLibrary-Deposit/service,http://glen.dnsalias.org/sword/servicedocument</param-value>
+ <param-value>http://localhost:8080/client/servicedocument,http://dspace.swordapp.org/sword/servicedocument,http://demoprints.eprints.org/sword-app/servicedocument,http://sword.intralibrary.com/IntraLibrary-Deposit/service,http://glen.dnsalias.org/sword/servicedocument</param-value>
<description>
URLs for the client to connect to
</description>
@@ -45,9 +45,14 @@
<param-value></param-value>
</context-param>
- <context-param>
- <param-name>proxy-port</param-name>
- <param-value></param-value>
+ <context-param>
+ <param-name>proxy-port</param-name>
+ <param-value></param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>deposit-url</param-name>
+ <param-value>http://localhost:8080/client/</param-value>
</context-param>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: SVN c. m. f. t. SWORD-A. p. <swo...@li...> - 2008-12-01 20:26:43
|
Revision: 97
http://sword-app.svn.sourceforge.net/sword-app/?rev=97&view=rev
Author: stuartlewis
Date: 2008-12-01 20:26:40 +0000 (Mon, 01 Dec 2008)
Log Message:
-----------
Removed notion of format namespace from SWORDEntry (and updated clients appropriately - replaced with packaging instead)
Modified Paths:
--------------
java-common/trunk/src/main/java/org/purl/sword/base/SWORDEntry.java
java-common/trunk/src/main/java/org/purl/sword/client/CmdClient.java
java-common/trunk/src/main/java/org/purl/sword/client/ServicePanel.java
java-common/trunk/src/main/java/org/purl/sword/server/DummyServer.java
Modified: java-common/trunk/src/main/java/org/purl/sword/base/SWORDEntry.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/base/SWORDEntry.java 2008-11-29 18:00:27 UTC (rev 96)
+++ java-common/trunk/src/main/java/org/purl/sword/base/SWORDEntry.java 2008-12-01 20:26:40 UTC (rev 97)
@@ -71,11 +71,6 @@
protected String treatment;
/**
- * Used to record the format namespace.
- */
- protected String formatNamespace;
-
- /**
* Used to determine if the noOp value has been set.
*/
protected boolean noOpSet;
@@ -254,14 +249,6 @@
entry.appendChild(treatmentElement);
}
- if (formatNamespace != null)
- {
- Element formatNamespaceElement = new Element(
- Namespaces.PREFIX_SWORD + ":formatNamespace", Namespaces.NS_SWORD);
- formatNamespaceElement.appendChild(formatNamespace);
- entry.appendChild(formatNamespaceElement);
- }
-
if (verboseDescription != null)
{
Element verboseDescriptionElement = new Element(
@@ -331,17 +318,6 @@
log.error("Error accessing the content for the treatment element");
}
}
- else if (isInstanceOf(element, "formatNamespace", Namespaces.NS_SWORD))
- {
- try
- {
- formatNamespace = unmarshallString(element);
- }
- catch( UnmarshallException ume )
- {
- log.error("Error accessing the content for the formatNamespace element");
- }
- }
else if (isInstanceOf(element, "noOp", Namespaces.NS_SWORD))
{
try
@@ -387,26 +363,5 @@
}
}
} // for
- }
-
- /**
- * Get the format namespace.
- *
- * @return The format namespace.
- */
- public String getFormatNamespace()
- {
- return formatNamespace;
- }
-
- /**
- * Set the format namespace.
- *
- * @param formatNamespace The format namespace.
- */
- public void setFormatNamespace(String formatNamespace)
- {
- this.formatNamespace = formatNamespace;
- }
-
+ }
}
\ No newline at end of file
Modified: java-common/trunk/src/main/java/org/purl/sword/client/CmdClient.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/client/CmdClient.java 2008-11-29 18:00:27 UTC (rev 96)
+++ java-common/trunk/src/main/java/org/purl/sword/client/CmdClient.java 2008-12-01 20:26:40 UTC (rev 97)
@@ -444,7 +444,7 @@
System.out.println("Published: " + entry.getPublished());
System.out.println("Verbose Description: " + entry.getVerboseDescription());
System.out.println("Treatment: " + entry.getTreatment());
- System.out.println("Format Namespace: " + entry.getFormatNamespace());
+ System.out.println("Packaging: " + entry.getPackaging());
if( entry.isNoOpSet() )
{
Modified: java-common/trunk/src/main/java/org/purl/sword/client/ServicePanel.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/client/ServicePanel.java 2008-11-29 18:00:27 UTC (rev 96)
+++ java-common/trunk/src/main/java/org/purl/sword/client/ServicePanel.java 2008-12-01 20:26:40 UTC (rev 97)
@@ -692,7 +692,7 @@
addTableRow(buffer, "NoOp", entry.isNoOp());
// process formatNamespace
- addTableRow(buffer, "Format Namespace", entry.getFormatNamespace());
+ addTableRow(buffer, "Packaging", entry.getPackaging());
buffer.append("</table>");
Modified: java-common/trunk/src/main/java/org/purl/sword/server/DummyServer.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/server/DummyServer.java 2008-11-29 18:00:27 UTC (rev 96)
+++ java-common/trunk/src/main/java/org/purl/sword/server/DummyServer.java 2008-12-01 20:26:40 UTC (rev 97)
@@ -319,8 +319,6 @@
se.setNoOp(deposit.isNoOp());
- se.setFormatNamespace("http://www.standards-body.com/standardXYZ/v1/");
-
dr.setEntry(se);
return dr;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: SVN c. m. f. t. SWORD-A. p. <swo...@li...> - 2008-11-29 18:00:33
|
Revision: 96
http://sword-app.svn.sourceforge.net/sword-app/?rev=96&view=rev
Author: stuartlewis
Date: 2008-11-29 18:00:27 +0000 (Sat, 29 Nov 2008)
Log Message:
-----------
Changed X-Format-Namespace to X-Packaging (common and client updated)
Modified Paths:
--------------
java-common/trunk/src/main/java/org/purl/sword/base/Deposit.java
java-common/trunk/src/main/java/org/purl/sword/base/HttpHeaders.java
java-common/trunk/src/main/java/org/purl/sword/base/SWORDEntry.java
java-common/trunk/src/main/java/org/purl/sword/client/Client.java
java-common/trunk/src/main/java/org/purl/sword/client/PostMessage.java
java-common/trunk/src/main/java/org/purl/sword/client/ServletClient.java
java-common/trunk/src/main/java/org/purl/sword/server/DepositServlet.java
java-webapp/trunk/src/main/webapp/deposit.jsp
java-webapp/trunk/src/main/webapp/depositform.jsp
Modified: java-common/trunk/src/main/java/org/purl/sword/base/Deposit.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/base/Deposit.java 2008-11-29 15:14:32 UTC (rev 95)
+++ java-common/trunk/src/main/java/org/purl/sword/base/Deposit.java 2008-11-29 18:00:27 UTC (rev 96)
@@ -80,8 +80,8 @@
/** True if this is a no-operation command */
private boolean noOp;
- /** The format namespace */
- private String formatNamespace;
+ /** The packaging format */
+ private String packaging;
/** Deposit ID */
private String depositID;
@@ -192,15 +192,15 @@
/**
* @return the formatNamespace
*/
- public String getFormatNamespace() {
- return formatNamespace;
+ public String getPackaging() {
+ return packaging;
}
/**
* @param formatNamespace the formatNamespace to set
*/
- public void setFormatNamespace(String formatNamespace) {
- this.formatNamespace = formatNamespace;
+ public void setPackaging(String packaging) {
+ this.packaging = packaging;
}
/**
Modified: java-common/trunk/src/main/java/org/purl/sword/base/HttpHeaders.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/base/HttpHeaders.java 2008-11-29 15:14:32 UTC (rev 95)
+++ java-common/trunk/src/main/java/org/purl/sword/base/HttpHeaders.java 2008-11-29 18:00:27 UTC (rev 96)
@@ -64,9 +64,9 @@
public static final String X_ON_BEHALF_OF = "X-On-Behalf-Of";
/**
- * The HTTP Header label that specifies the Format Namespace information.
+ * The HTTP Header label that specifies the Packaging information.
*/
- public static final String X_FORMAT_NAMESPACE = "X-Format-Namespace";
+ public static final String X_PACKAGING = "X-Packaging";
/**
* The HTTP Header label that specifies the desired Verbose status.
Modified: java-common/trunk/src/main/java/org/purl/sword/base/SWORDEntry.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/base/SWORDEntry.java 2008-11-29 15:14:32 UTC (rev 95)
+++ java-common/trunk/src/main/java/org/purl/sword/base/SWORDEntry.java 2008-11-29 18:00:27 UTC (rev 96)
@@ -84,6 +84,11 @@
* The user agent
*/
protected String userAgent;
+
+ /**
+ * The packaging format
+ */
+ protected String packaging;
/**
* The logger.
@@ -207,6 +212,26 @@
}
/**
+ * Get the packaging format
+ *
+ * @return the packaging format
+ */
+ public String getPackaging()
+ {
+ return packaging;
+ }
+
+ /**
+ * Set the packaging format
+ *
+ * @param packaging the packaging format
+ */
+ public void setPackaging(String packaging)
+ {
+ this.packaging = packaging;
+ }
+
+ /**
* Overrides the marshall method in the parent Entry. This will
* call the parent marshall method and then add the additional
* elements that have been added in this subclass.
@@ -260,6 +285,14 @@
userAgentElement.appendChild(userAgent);
entry.appendChild(userAgentElement);
}
+
+ if (packaging != null)
+ {
+ Element packagingElement = new Element(
+ Namespaces.PREFIX_SWORD + ":packaging", Namespaces.NS_SWORD);
+ packagingElement.appendChild(packaging);
+ entry.appendChild(packagingElement);
+ }
}
/**
@@ -342,6 +375,17 @@
log.error("Error accessing the content for the userAgent element");
}
}
+ else if (isInstanceOf(element, "packaging", Namespaces.NS_SWORD))
+ {
+ try
+ {
+ packaging = unmarshallString(element);
+ }
+ catch( UnmarshallException ume )
+ {
+ log.error("Error accessing the content for the userAgent element");
+ }
+ }
} // for
}
Modified: java-common/trunk/src/main/java/org/purl/sword/client/Client.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/client/Client.java 2008-11-29 15:14:32 UTC (rev 95)
+++ java-common/trunk/src/main/java/org/purl/sword/client/Client.java 2008-11-29 18:00:27 UTC (rev 96)
@@ -374,10 +374,10 @@
httppost.addRequestHeader(new Header(HttpHeaders.X_VERBOSE, Boolean
.toString(message.isVerbose())));
- String formatNamespace = message.getFormatNamespace();
- if (formatNamespace != null && formatNamespace.length() > 0) {
+ String packaging = message.getPackaging();
+ if (packaging != null && packaging.length() > 0) {
httppost.addRequestHeader(new Header(
- HttpHeaders.X_FORMAT_NAMESPACE, formatNamespace));
+ HttpHeaders.X_PACKAGING, packaging));
}
String onBehalfOf = message.getOnBehalfOf();
Modified: java-common/trunk/src/main/java/org/purl/sword/client/PostMessage.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/client/PostMessage.java 2008-11-29 15:14:32 UTC (rev 95)
+++ java-common/trunk/src/main/java/org/purl/sword/client/PostMessage.java 2008-11-29 18:00:27 UTC (rev 96)
@@ -119,9 +119,9 @@
private boolean verbose;
/**
- * The format namespace for the deposit.
+ * The packaging format for the deposit.
*/
- private String formatNamespace;
+ private String packaging;
/**
* True if the deposit should simualte a checksum error. The client should check this
@@ -290,23 +290,23 @@
}
/**
- * Get the format namespace.
+ * Get the packaging format.
*
* @return The value.
*/
- public String getFormatNamespace()
+ public String getPackaging()
{
- return formatNamespace;
+ return packaging;
}
/**
- * Set the format namespace.
+ * Set the packaging format.
*
- * @param formatNamespace The format namespace.
+ * @param formatNamespace The packaging format.
*/
- public void setFormatNamespace(String formatNamespace)
+ public void setFormatNamespace(String packaging)
{
- this.formatNamespace = formatNamespace;
+ this.packaging = packaging;
}
/**
Modified: java-common/trunk/src/main/java/org/purl/sword/client/ServletClient.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/client/ServletClient.java 2008-11-29 15:14:32 UTC (rev 95)
+++ java-common/trunk/src/main/java/org/purl/sword/client/ServletClient.java 2008-11-29 18:00:27 UTC (rev 96)
@@ -380,6 +380,7 @@
request.setAttribute("summary", se.getSummary().getContent());
request.setAttribute("generator", se.getGenerator().getContent());
request.setAttribute("userAgent", se.getUserAgent());
+ request.setAttribute("packaging", se.getPackaging());
request.setAttribute("links", se.getLinks());
// Set the ServiceDocument and associated values
Modified: java-common/trunk/src/main/java/org/purl/sword/server/DepositServlet.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/server/DepositServlet.java 2008-11-29 15:14:32 UTC (rev 95)
+++ java-common/trunk/src/main/java/org/purl/sword/server/DepositServlet.java 2008-11-29 18:00:27 UTC (rev 96)
@@ -243,7 +243,7 @@
String md5 = request.getHeader("Content-MD5");
log.debug("Received file checksum header: " + md5);
if ((md5 != null) && (!md5.equals(receivedMD5))) {
- //TODO put an error doc in here
+ // Return an error document
this.makeErrorDocument(ErrorCodes.ERROR_CHECKSUM_MISMATCH,
HttpServletResponse.SC_PRECONDITION_FAILED,
"The received MD5 checksum for the deposited file did not match the checksum sent by the deposit client",
@@ -259,8 +259,8 @@
// Set the X-On-Behalf-Of header
d.setOnBehalfOf(request.getHeader(HttpHeaders.X_ON_BEHALF_OF.toString()));
- // Set the X-Format-Namespace header
- d.setFormatNamespace(request.getHeader(HttpHeaders.X_FORMAT_NAMESPACE));
+ // Set the X-Packaging header
+ d.setPackaging(request.getHeader(HttpHeaders.X_PACKAGING));
// Set the X-No-Op header
String noop = request.getHeader(HttpHeaders.X_NO_OP);
@@ -285,8 +285,7 @@
}
// Set the content disposition
- d.setContentDisposition(request
- .getHeader(HttpHeaders.CONTENT_DISPOSITION));
+ d.setContentDisposition(request.getHeader(HttpHeaders.CONTENT_DISPOSITION));
// Set the IP address
d.setIPAddress(request.getRemoteAddr());
@@ -310,7 +309,12 @@
if (request.getHeader(HttpHeaders.USER_AGENT.toString()) != null) {
dr.getEntry().setUserAgent(request.getHeader(HttpHeaders.USER_AGENT.toString()));
}
-
+
+ // Echo back the packaging format
+ if (request.getHeader(HttpHeaders.X_PACKAGING.toString()) != null) {
+ dr.getEntry().setPackaging(request.getHeader(HttpHeaders.X_PACKAGING.toString()));
+ }
+
// Print out the Deposit Response
response.setStatus(dr.getHttpResponse());
response.setContentType("application/atom+xml; charset=UTF-8");
Modified: java-webapp/trunk/src/main/webapp/deposit.jsp
===================================================================
--- java-webapp/trunk/src/main/webapp/deposit.jsp 2008-11-29 15:14:32 UTC (rev 95)
+++ java-webapp/trunk/src/main/webapp/deposit.jsp 2008-11-29 18:00:27 UTC (rev 96)
@@ -14,6 +14,7 @@
String summary = (String)request.getAttribute("summary");
String generator = (String)request.getAttribute("generator");
String userAgent = (String)request.getAttribute("userAgent");
+ String packaging = (String)request.getAttribute("packaging");
Iterator links = (Iterator)request.getAttribute("links");
%>
<html>
@@ -84,6 +85,7 @@
<li><strong>Treatment:</strong> <%= treatment %></li>
<li><strong>Generator:</strong> <%= generator %></li>
<li><strong>User Agent:</strong> <%= userAgent %></li>
+ <li><strong>Packaging:</strong> <%= packaging %></li>
</ul>
</div>
<table>
Modified: java-webapp/trunk/src/main/webapp/depositform.jsp
===================================================================
--- java-webapp/trunk/src/main/webapp/depositform.jsp 2008-11-29 15:14:32 UTC (rev 95)
+++ java-webapp/trunk/src/main/webapp/depositform.jsp 2008-11-29 18:00:27 UTC (rev 96)
@@ -62,7 +62,7 @@
Send noOp command: <input type="checkbox" name="noop" /><br />
</div>
<div id="section">
- Format namespace: <input type="text" name="formatnamespace" /><br />
+ Packaging format: <input type="text" name="formatnamespace" /><br />
Content-disposition: <input type="text" name="cd" /><br />
File Type (MIME type): <input type="text" name="filetype" /><br />
</div>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: SVN c. m. f. t. SWORD-A. p. <swo...@li...> - 2008-11-29 15:14:37
|
Revision: 95
http://sword-app.svn.sourceforge.net/sword-app/?rev=95&view=rev
Author: stuartlewis
Date: 2008-11-29 15:14:32 +0000 (Sat, 29 Nov 2008)
Log Message:
-----------
Add error description from SWORD error documents to the error header message
Modified Paths:
--------------
java-common/trunk/src/main/java/org/purl/sword/client/ServletClient.java
Modified: java-common/trunk/src/main/java/org/purl/sword/client/ServletClient.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/client/ServletClient.java 2008-11-29 14:26:40 UTC (rev 94)
+++ java-common/trunk/src/main/java/org/purl/sword/client/ServletClient.java 2008-11-29 15:14:32 UTC (rev 95)
@@ -50,7 +50,6 @@
import org.apache.commons.fileupload.FileItemFactory;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.fileupload.servlet.ServletFileUpload;
-import org.purl.sword.base.ChecksumUtils;
import org.purl.sword.base.DepositResponse;
import org.purl.sword.base.SWORDEntry;
import org.purl.sword.base.ServiceDocument;
@@ -60,7 +59,6 @@
*
* @author Stuart Lewis
*/
-
public class ServletClient extends HttpServlet {
/**
@@ -388,9 +386,15 @@
request.getRequestDispatcher("deposit.jsp").forward(request, response);
return;
} else {
- request.setAttribute("error", status.getCode() + " " + status.getMessage());
+ String error = status.getCode() + " " + status.getMessage() + " - ";
+ try {
+ error += resp.getEntry().getSummary().getContent();
+ } catch (Exception e) {
+ // Do nothing - we have default error message
+ }
+ request.setAttribute("error", error);
- // Try and get an error document
+ // Try and get an error document in xml
String xml = resp.marshall();
xml = xml.replaceAll("<", "<");
xml = xml.replaceAll(">", ">");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: SVN c. m. f. t. SWORD-A. p. <swo...@li...> - 2008-11-29 14:26:44
|
Revision: 94
http://sword-app.svn.sourceforge.net/sword-app/?rev=94&view=rev
Author: stuartlewis
Date: 2008-11-29 14:26:40 +0000 (Sat, 29 Nov 2008)
Log Message:
-----------
Improved SWORDErrorException to remove the need to specify a HTTP status (if will do it for you based on the SWORD error URI).
Modified Paths:
--------------
java-common/trunk/src/main/java/org/purl/sword/base/SWORDErrorException.java
java-common/trunk/src/main/java/org/purl/sword/server/DummyServer.java
Modified: java-common/trunk/src/main/java/org/purl/sword/base/SWORDErrorException.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/base/SWORDErrorException.java 2008-11-29 13:47:32 UTC (rev 93)
+++ java-common/trunk/src/main/java/org/purl/sword/base/SWORDErrorException.java 2008-11-29 14:26:40 UTC (rev 94)
@@ -61,12 +61,19 @@
* @param source The original exception that lead to this exception. This
* can be <code>null</code>.
*/
- public SWORDErrorException(String errorURI, int status, String description)
+ public SWORDErrorException(String errorURI, String description)
{
super(description);
this.errorURI = errorURI;
- this.status = status;
this.description = description;
+
+ if (errorURI.equals(ErrorCodes.ERROR_BAD_REQUEST)) { status = 400; }
+ else if (errorURI.equals(ErrorCodes.ERROR_CHECKSUM_MISMATCH)) { status = 412; }
+ else if (errorURI.equals(ErrorCodes.ERROR_CONTENT)) { status = 415; }
+ else if (errorURI.equals(ErrorCodes.MAX_UPLOAD_SIZE_EXCEEDED)) { status = 413; }
+ else if (errorURI.equals(ErrorCodes.MEDIATION_NOT_ALLOWED)) { status = 412; }
+ else if (errorURI.equals(ErrorCodes.TARGET_OWNER_UKNOWN)) { status = 400; }
+ else { status = 400; }
}
@@ -83,6 +90,15 @@
public int getStatus() {
return status;
}
+
+ /**
+ * Set the status
+ *
+ * @param status The HTTP status code
+ */
+ public void setStatus(int status) {
+ this.status = status;
+ }
/**
* @return the description
Modified: java-common/trunk/src/main/java/org/purl/sword/server/DummyServer.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/server/DummyServer.java 2008-11-29 13:47:32 UTC (rev 93)
+++ java-common/trunk/src/main/java/org/purl/sword/server/DummyServer.java 2008-11-29 14:26:40 UTC (rev 94)
@@ -221,7 +221,6 @@
if (((deposit.getOnBehalfOf() != null) && (!deposit.getOnBehalfOf().equals(""))) &&
(!deposit.getLocation().contains("deposit?user="))) {
throw new SWORDErrorException(ErrorCodes.MEDIATION_NOT_ALLOWED,
- HttpServletResponse.SC_PRECONDITION_FAILED,
"Mediated deposit not allowed to this collection");
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: SVN c. m. f. t. SWORD-A. p. <swo...@li...> - 2008-11-29 13:47:38
|
Revision: 93
http://sword-app.svn.sourceforge.net/sword-app/?rev=93&view=rev
Author: stuartlewis
Date: 2008-11-29 13:47:32 +0000 (Sat, 29 Nov 2008)
Log Message:
-----------
Update core client code to be able to send a user agent header
Modified Paths:
--------------
java-common/trunk/src/main/java/org/purl/sword/base/SWORDEntry.java
Modified: java-common/trunk/src/main/java/org/purl/sword/base/SWORDEntry.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/base/SWORDEntry.java 2008-11-28 20:45:22 UTC (rev 92)
+++ java-common/trunk/src/main/java/org/purl/sword/base/SWORDEntry.java 2008-11-29 13:47:32 UTC (rev 93)
@@ -79,6 +79,11 @@
* Used to determine if the noOp value has been set.
*/
protected boolean noOpSet;
+
+ /**
+ * The user agent
+ */
+ protected String userAgent;
/**
* The logger.
@@ -182,6 +187,26 @@
}
/**
+ * Get the user agent
+ *
+ * @return the user agent
+ */
+ public String getUserAgent()
+ {
+ return userAgent;
+ }
+
+ /**
+ * Set the user agent
+ *
+ * @param userAgent the user agent
+ */
+ public void setUserAgent(String userAgent)
+ {
+ this.userAgent = userAgent;
+ }
+
+ /**
* Overrides the marshall method in the parent Entry. This will
* call the parent marshall method and then add the additional
* elements that have been added in this subclass.
@@ -227,6 +252,14 @@
noOpElement.appendChild(Boolean.toString(noOp));
entry.appendChild(noOpElement);
}
+
+ if (userAgent != null)
+ {
+ Element userAgentElement = new Element(
+ Namespaces.PREFIX_SWORD + ":userAgent", Namespaces.NS_SWORD);
+ userAgentElement.appendChild(userAgent);
+ entry.appendChild(userAgentElement);
+ }
}
/**
@@ -254,7 +287,7 @@
{
element = elements.get(i);
- if( isInstanceOf(element, "treatment", Namespaces.NS_SWORD ))
+ if (isInstanceOf(element, "treatment", Namespaces.NS_SWORD))
{
try
{
@@ -265,7 +298,7 @@
log.error("Error accessing the content for the treatment element");
}
}
- else if( isInstanceOf(element, "formatNamespace", Namespaces.NS_SWORD ))
+ else if (isInstanceOf(element, "formatNamespace", Namespaces.NS_SWORD))
{
try
{
@@ -276,7 +309,7 @@
log.error("Error accessing the content for the formatNamespace element");
}
}
- else if( isInstanceOf(element, "noOp", Namespaces.NS_SWORD ))
+ else if (isInstanceOf(element, "noOp", Namespaces.NS_SWORD))
{
try
{
@@ -287,7 +320,7 @@
log.error("Error accessing the boolean value for noOp");
}
}
- else if( isInstanceOf(element, "verboseDescription", Namespaces.NS_SWORD ))
+ else if (isInstanceOf(element, "verboseDescription", Namespaces.NS_SWORD))
{
try
{
@@ -298,6 +331,17 @@
log.error("Error accessing the content for the verboseDescription element");
}
}
+ else if (isInstanceOf(element, "userAgent", Namespaces.NS_SWORD))
+ {
+ try
+ {
+ userAgent = unmarshallString(element);
+ }
+ catch( UnmarshallException ume )
+ {
+ log.error("Error accessing the content for the userAgent element");
+ }
+ }
} // for
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: SVN c. m. f. t. SWORD-A. p. <swo...@li...> - 2008-11-28 20:45:32
|
Revision: 92
http://sword-app.svn.sourceforge.net/sword-app/?rev=92&view=rev
Author: stuartlewis
Date: 2008-11-28 20:45:22 +0000 (Fri, 28 Nov 2008)
Log Message:
-----------
Adding a favicon.ico file
Added Paths:
-----------
java-webapp/trunk/src/main/webapp/favicon.ico
Added: java-webapp/trunk/src/main/webapp/favicon.ico
===================================================================
(Binary files differ)
Property changes on: java-webapp/trunk/src/main/webapp/favicon.ico
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: SVN c. m. f. t. SWORD-A. p. <swo...@li...> - 2008-11-28 20:39:35
|
Revision: 91
http://sword-app.svn.sourceforge.net/sword-app/?rev=91&view=rev
Author: stuartlewis
Date: 2008-11-28 20:39:30 +0000 (Fri, 28 Nov 2008)
Log Message:
-----------
Upgrade demo Servlet client to make use of the sword:userAgent element
Modified Paths:
--------------
java-common/trunk/src/main/java/org/purl/sword/client/Client.java
java-common/trunk/src/main/java/org/purl/sword/client/ServletClient.java
java-common/trunk/src/main/java/org/purl/sword/server/DepositServlet.java
java-webapp/trunk/src/main/webapp/deposit.jsp
Modified: java-common/trunk/src/main/java/org/purl/sword/client/Client.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/client/Client.java 2008-11-28 20:19:06 UTC (rev 90)
+++ java-common/trunk/src/main/java/org/purl/sword/client/Client.java 2008-11-28 20:39:30 UTC (rev 91)
@@ -389,7 +389,8 @@
String userAgent = message.getUserAgent();
if (containsValue(userAgent)) {
httppost.addRequestHeader(new Header(
- HttpHeaders.USER_AGENT, onBehalfOf));
+ HttpHeaders.USER_AGENT, userAgent));
+ System.out.println("USERAGENT = " + userAgent);
}
stream = new FileInputStream(message.getFilepath());
Modified: java-common/trunk/src/main/java/org/purl/sword/client/ServletClient.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/client/ServletClient.java 2008-11-28 20:19:06 UTC (rev 90)
+++ java-common/trunk/src/main/java/org/purl/sword/client/ServletClient.java 2008-11-28 20:39:30 UTC (rev 91)
@@ -56,7 +56,7 @@
import org.purl.sword.base.ServiceDocument;
/**
- * Example client that runs as a servlet.
+ * Example client that runs as a Servlet.
*
* @author Stuart Lewis
*/
@@ -66,7 +66,7 @@
/**
* The user agent name of this library
*/
- public static final String userAgent = "SWORDAPP Java Client: SWORD version 1.3 compatable";
+ public static final String userAgent = "SWORDAPP Java Client: SWORD version 1.3 compatible (http://sourceforge.net/projects/sword-app/)";
/**
* Temporary directory.
@@ -381,6 +381,7 @@
request.setAttribute("treatment", se.getTreatment());
request.setAttribute("summary", se.getSummary().getContent());
request.setAttribute("generator", se.getGenerator().getContent());
+ request.setAttribute("userAgent", se.getUserAgent());
request.setAttribute("links", se.getLinks());
// Set the ServiceDocument and associated values
Modified: java-common/trunk/src/main/java/org/purl/sword/server/DepositServlet.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/server/DepositServlet.java 2008-11-28 20:19:06 UTC (rev 90)
+++ java-common/trunk/src/main/java/org/purl/sword/server/DepositServlet.java 2008-11-28 20:39:30 UTC (rev 91)
@@ -305,6 +305,11 @@
// Get the DepositResponse
DepositResponse dr = myRepository.doDeposit(d);
+
+ // Echo back the user agent
+ if (request.getHeader(HttpHeaders.USER_AGENT.toString()) != null) {
+ dr.getEntry().setUserAgent(request.getHeader(HttpHeaders.USER_AGENT.toString()));
+ }
// Print out the Deposit Response
response.setStatus(dr.getHttpResponse());
Modified: java-webapp/trunk/src/main/webapp/deposit.jsp
===================================================================
--- java-webapp/trunk/src/main/webapp/deposit.jsp 2008-11-28 20:19:06 UTC (rev 90)
+++ java-webapp/trunk/src/main/webapp/deposit.jsp 2008-11-28 20:39:30 UTC (rev 91)
@@ -13,8 +13,8 @@
String treatment = (String)request.getAttribute("treatment");
String summary = (String)request.getAttribute("summary");
String generator = (String)request.getAttribute("generator");
+ String userAgent = (String)request.getAttribute("userAgent");
Iterator links = (Iterator)request.getAttribute("links");
-
%>
<html>
<head>
@@ -83,7 +83,7 @@
%>
<li><strong>Treatment:</strong> <%= treatment %></li>
<li><strong>Generator:</strong> <%= generator %></li>
-
+ <li><strong>User Agent:</strong> <%= userAgent %></li>
</ul>
</div>
<table>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: SVN c. m. f. t. SWORD-A. p. <swo...@li...> - 2008-11-28 20:19:11
|
Revision: 90
http://sword-app.svn.sourceforge.net/sword-app/?rev=90&view=rev
Author: stuartlewis
Date: 2008-11-28 20:19:06 +0000 (Fri, 28 Nov 2008)
Log Message:
-----------
Send user agent header, and remove unused md5 checksum (it is also calculated by the client, so no need for this client implementation to do so too)
Modified Paths:
--------------
java-common/trunk/src/main/java/org/purl/sword/client/ServletClient.java
Modified: java-common/trunk/src/main/java/org/purl/sword/client/ServletClient.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/client/ServletClient.java 2008-11-28 19:40:45 UTC (rev 89)
+++ java-common/trunk/src/main/java/org/purl/sword/client/ServletClient.java 2008-11-28 20:19:06 UTC (rev 90)
@@ -63,6 +63,11 @@
public class ServletClient extends HttpServlet {
+ /**
+ * The user agent name of this library
+ */
+ public static final String userAgent = "SWORDAPP Java Client: SWORD version 1.3 compatable";
+
/**
* Temporary directory.
*/
@@ -258,6 +263,7 @@
Client client = new Client();
try {
PostMessage message = new PostMessage();
+ message.setUserAgent(userAgent);
// Get the file
FileItemFactory factory = new DiskFileItemFactory();
@@ -266,9 +272,8 @@
ServletFileUpload upload = new ServletFileUpload(factory);
// Parse the request
- List items = upload.parseRequest(request);
- Iterator iter = items.iterator();
- String md5 = null;
+ List<FileItem> items = upload.parseRequest(request);
+ Iterator<FileItem> iter = items.iterator();
String u = null;
String p = null;
String contentDisposition = null;
@@ -279,7 +284,7 @@
boolean noOp = false;
boolean login = false;
while (iter.hasNext()) {
- FileItem item = (FileItem) iter.next();
+ FileItem item = iter.next();
if (item.isFormField()) {
String name = item.getFieldName();
String value = item.getString();
@@ -338,7 +343,6 @@
} else {
message.setFiletype(filetype);
}
- md5 = ChecksumUtils.generateMD5(fname);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: SVN c. m. f. t. SWORD-A. p. <swo...@li...> - 2008-11-28 19:40:50
|
Revision: 89
http://sword-app.svn.sourceforge.net/sword-app/?rev=89&view=rev
Author: stuartlewis
Date: 2008-11-28 19:40:45 +0000 (Fri, 28 Nov 2008)
Log Message:
-----------
Update core client code to be able to send a user agent header
Modified Paths:
--------------
java-common/trunk/src/main/java/org/purl/sword/base/HttpHeaders.java
java-common/trunk/src/main/java/org/purl/sword/client/Client.java
java-common/trunk/src/main/java/org/purl/sword/client/PostMessage.java
Modified: java-common/trunk/src/main/java/org/purl/sword/base/HttpHeaders.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/base/HttpHeaders.java 2008-11-28 19:32:48 UTC (rev 88)
+++ java-common/trunk/src/main/java/org/purl/sword/base/HttpHeaders.java 2008-11-28 19:40:45 UTC (rev 89)
@@ -43,6 +43,7 @@
* the SWORD protocol.
*
* @author Neil Taylor
+ * @author Stuart Lewis
*
*/
public interface HttpHeaders
@@ -81,6 +82,11 @@
* The HTTP Header that specifies the error code information.
*/
public static final String X_ERROR_CODE = "X-Error-Code";
+
+ /**
+ * The user agent.
+ */
+ public static final String USER_AGENT = "User-Agent";
/**
* The Slug header.
Modified: java-common/trunk/src/main/java/org/purl/sword/client/Client.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/client/Client.java 2008-11-28 19:32:48 UTC (rev 88)
+++ java-common/trunk/src/main/java/org/purl/sword/client/Client.java 2008-11-28 19:40:45 UTC (rev 89)
@@ -385,6 +385,12 @@
httppost.addRequestHeader(new Header(
HttpHeaders.X_ON_BEHALF_OF, onBehalfOf));
}
+
+ String userAgent = message.getUserAgent();
+ if (containsValue(userAgent)) {
+ httppost.addRequestHeader(new Header(
+ HttpHeaders.USER_AGENT, onBehalfOf));
+ }
stream = new FileInputStream(message.getFilepath());
Modified: java-common/trunk/src/main/java/org/purl/sword/client/PostMessage.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/client/PostMessage.java 2008-11-28 19:32:48 UTC (rev 88)
+++ java-common/trunk/src/main/java/org/purl/sword/client/PostMessage.java 2008-11-28 19:40:45 UTC (rev 89)
@@ -134,6 +134,11 @@
* The Slug header value.
*/
private String slug;
+
+ /**
+ * The user agent name
+ */
+ private String userAgent;
/**
* Get the filepath.
@@ -343,4 +348,20 @@
{
return this.slug;
}
+
+ /**
+ * @return the userAgent
+ */
+ public String getUserAgent() {
+ return userAgent;
+ }
+
+ /**
+ * Set the user agent
+ *
+ * @param userAgent the userAgent to set
+ */
+ public void setUserAgent(String userAgent) {
+ this.userAgent = userAgent;
+ }
}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: SVN c. m. f. t. SWORD-A. p. <swo...@li...> - 2008-11-28 19:32:52
|
Revision: 88
http://sword-app.svn.sourceforge.net/sword-app/?rev=88&view=rev
Author: stuartlewis
Date: 2008-11-28 19:32:48 +0000 (Fri, 28 Nov 2008)
Log Message:
-----------
Updated date in header
Modified Paths:
--------------
java-common/trunk/src/main/java/org/purl/sword/atom/Author.java
java-common/trunk/src/main/java/org/purl/sword/atom/Content.java
java-common/trunk/src/main/java/org/purl/sword/atom/ContentType.java
java-common/trunk/src/main/java/org/purl/sword/atom/Contributor.java
java-common/trunk/src/main/java/org/purl/sword/atom/Entry.java
java-common/trunk/src/main/java/org/purl/sword/atom/InvalidMediaTypeException.java
java-common/trunk/src/main/java/org/purl/sword/atom/Link.java
java-common/trunk/src/main/java/org/purl/sword/atom/Rights.java
java-common/trunk/src/main/java/org/purl/sword/atom/Source.java
java-common/trunk/src/main/java/org/purl/sword/atom/Summary.java
java-common/trunk/src/main/java/org/purl/sword/atom/TextConstruct.java
java-common/trunk/src/main/java/org/purl/sword/atom/Title.java
java-common/trunk/src/main/java/org/purl/sword/base/ChecksumUtils.java
java-common/trunk/src/main/java/org/purl/sword/base/Deposit.java
java-common/trunk/src/main/java/org/purl/sword/base/DepositResponse.java
java-common/trunk/src/main/java/org/purl/sword/base/HttpHeaders.java
java-common/trunk/src/main/java/org/purl/sword/base/Namespaces.java
java-common/trunk/src/main/java/org/purl/sword/base/SWORDAuthenticationException.java
java-common/trunk/src/main/java/org/purl/sword/base/SWORDEntry.java
java-common/trunk/src/main/java/org/purl/sword/base/SWORDException.java
java-common/trunk/src/main/java/org/purl/sword/base/ServiceDocument.java
java-common/trunk/src/main/java/org/purl/sword/base/ServiceDocumentRequest.java
java-common/trunk/src/main/java/org/purl/sword/base/SwordElementInterface.java
java-common/trunk/src/main/java/org/purl/sword/base/UnmarshallException.java
java-common/trunk/src/main/java/org/purl/sword/base/Workspace.java
java-common/trunk/src/main/java/org/purl/sword/base/XmlElement.java
Modified: java-common/trunk/src/main/java/org/purl/sword/atom/Author.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/atom/Author.java 2008-11-28 19:26:10 UTC (rev 87)
+++ java-common/trunk/src/main/java/org/purl/sword/atom/Author.java 2008-11-28 19:32:48 UTC (rev 88)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2007, Aberystwyth University
+ * Copyright (c) 2008, Aberystwyth University
*
* All rights reserved.
*
Modified: java-common/trunk/src/main/java/org/purl/sword/atom/Content.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/atom/Content.java 2008-11-28 19:26:10 UTC (rev 87)
+++ java-common/trunk/src/main/java/org/purl/sword/atom/Content.java 2008-11-28 19:32:48 UTC (rev 88)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2007, Aberystwyth University
+ * Copyright (c) 2008, Aberystwyth University
*
* All rights reserved.
*
Modified: java-common/trunk/src/main/java/org/purl/sword/atom/ContentType.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/atom/ContentType.java 2008-11-28 19:26:10 UTC (rev 87)
+++ java-common/trunk/src/main/java/org/purl/sword/atom/ContentType.java 2008-11-28 19:32:48 UTC (rev 88)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2007, Aberystwyth University
+ * Copyright (c) 2008, Aberystwyth University
*
* All rights reserved.
*
Modified: java-common/trunk/src/main/java/org/purl/sword/atom/Contributor.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/atom/Contributor.java 2008-11-28 19:26:10 UTC (rev 87)
+++ java-common/trunk/src/main/java/org/purl/sword/atom/Contributor.java 2008-11-28 19:32:48 UTC (rev 88)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2007, Aberystwyth University
+ * Copyright (c) 2008, Aberystwyth University
*
* All rights reserved.
*
Modified: java-common/trunk/src/main/java/org/purl/sword/atom/Entry.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/atom/Entry.java 2008-11-28 19:26:10 UTC (rev 87)
+++ java-common/trunk/src/main/java/org/purl/sword/atom/Entry.java 2008-11-28 19:32:48 UTC (rev 88)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2007, Aberystwyth University
+ * Copyright (c) 2008, Aberystwyth University
*
* All rights reserved.
*
Modified: java-common/trunk/src/main/java/org/purl/sword/atom/InvalidMediaTypeException.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/atom/InvalidMediaTypeException.java 2008-11-28 19:26:10 UTC (rev 87)
+++ java-common/trunk/src/main/java/org/purl/sword/atom/InvalidMediaTypeException.java 2008-11-28 19:32:48 UTC (rev 88)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2007, Aberystwyth University
+ * Copyright (c) 2008, Aberystwyth University
*
* All rights reserved.
*
Modified: java-common/trunk/src/main/java/org/purl/sword/atom/Link.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/atom/Link.java 2008-11-28 19:26:10 UTC (rev 87)
+++ java-common/trunk/src/main/java/org/purl/sword/atom/Link.java 2008-11-28 19:32:48 UTC (rev 88)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2007, Aberystwyth University
+ * Copyright (c) 2008, Aberystwyth University
*
* All rights reserved.
*
Modified: java-common/trunk/src/main/java/org/purl/sword/atom/Rights.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/atom/Rights.java 2008-11-28 19:26:10 UTC (rev 87)
+++ java-common/trunk/src/main/java/org/purl/sword/atom/Rights.java 2008-11-28 19:32:48 UTC (rev 88)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2007, Aberystwyth University
+ * Copyright (c) 2008, Aberystwyth University
*
* All rights reserved.
*
Modified: java-common/trunk/src/main/java/org/purl/sword/atom/Source.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/atom/Source.java 2008-11-28 19:26:10 UTC (rev 87)
+++ java-common/trunk/src/main/java/org/purl/sword/atom/Source.java 2008-11-28 19:32:48 UTC (rev 88)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2007, Aberystwyth University
+ * Copyright (c) 2008, Aberystwyth University
*
* All rights reserved.
*
Modified: java-common/trunk/src/main/java/org/purl/sword/atom/Summary.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/atom/Summary.java 2008-11-28 19:26:10 UTC (rev 87)
+++ java-common/trunk/src/main/java/org/purl/sword/atom/Summary.java 2008-11-28 19:32:48 UTC (rev 88)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2007, Aberystwyth University
+ * Copyright (c) 2008, Aberystwyth University
*
* All rights reserved.
*
Modified: java-common/trunk/src/main/java/org/purl/sword/atom/TextConstruct.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/atom/TextConstruct.java 2008-11-28 19:26:10 UTC (rev 87)
+++ java-common/trunk/src/main/java/org/purl/sword/atom/TextConstruct.java 2008-11-28 19:32:48 UTC (rev 88)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2007, Aberystwyth University
+ * Copyright (c) 2008, Aberystwyth University
*
* All rights reserved.
*
Modified: java-common/trunk/src/main/java/org/purl/sword/atom/Title.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/atom/Title.java 2008-11-28 19:26:10 UTC (rev 87)
+++ java-common/trunk/src/main/java/org/purl/sword/atom/Title.java 2008-11-28 19:32:48 UTC (rev 88)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2007, Aberystwyth University
+ * Copyright (c) 2008, Aberystwyth University
*
* All rights reserved.
*
Modified: java-common/trunk/src/main/java/org/purl/sword/base/ChecksumUtils.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/base/ChecksumUtils.java 2008-11-28 19:26:10 UTC (rev 87)
+++ java-common/trunk/src/main/java/org/purl/sword/base/ChecksumUtils.java 2008-11-28 19:32:48 UTC (rev 88)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2007, Aberystwyth University
+ * Copyright (c) 2008, Aberystwyth University
*
* All rights reserved.
*
Modified: java-common/trunk/src/main/java/org/purl/sword/base/Deposit.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/base/Deposit.java 2008-11-28 19:26:10 UTC (rev 87)
+++ java-common/trunk/src/main/java/org/purl/sword/base/Deposit.java 2008-11-28 19:32:48 UTC (rev 88)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2007, Aberystwyth University
+ * Copyright (c) 2008, Aberystwyth University
*
* All rights reserved.
*
Modified: java-common/trunk/src/main/java/org/purl/sword/base/DepositResponse.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/base/DepositResponse.java 2008-11-28 19:26:10 UTC (rev 87)
+++ java-common/trunk/src/main/java/org/purl/sword/base/DepositResponse.java 2008-11-28 19:32:48 UTC (rev 88)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2007, Aberystwyth University
+ * Copyright (c) 2008, Aberystwyth University
*
* All rights reserved.
*
Modified: java-common/trunk/src/main/java/org/purl/sword/base/HttpHeaders.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/base/HttpHeaders.java 2008-11-28 19:26:10 UTC (rev 87)
+++ java-common/trunk/src/main/java/org/purl/sword/base/HttpHeaders.java 2008-11-28 19:32:48 UTC (rev 88)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2007, Aberystwyth University
+ * Copyright (c) 2008, Aberystwyth University
*
* All rights reserved.
*
Modified: java-common/trunk/src/main/java/org/purl/sword/base/Namespaces.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/base/Namespaces.java 2008-11-28 19:26:10 UTC (rev 87)
+++ java-common/trunk/src/main/java/org/purl/sword/base/Namespaces.java 2008-11-28 19:32:48 UTC (rev 88)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2007, Aberystwyth University
+ * Copyright (c) 2008, Aberystwyth University
*
* All rights reserved.
*
Modified: java-common/trunk/src/main/java/org/purl/sword/base/SWORDAuthenticationException.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/base/SWORDAuthenticationException.java 2008-11-28 19:26:10 UTC (rev 87)
+++ java-common/trunk/src/main/java/org/purl/sword/base/SWORDAuthenticationException.java 2008-11-28 19:32:48 UTC (rev 88)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2007, Aberystwyth University
+ * Copyright (c) 2008, Aberystwyth University
*
* All rights reserved.
*
Modified: java-common/trunk/src/main/java/org/purl/sword/base/SWORDEntry.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/base/SWORDEntry.java 2008-11-28 19:26:10 UTC (rev 87)
+++ java-common/trunk/src/main/java/org/purl/sword/base/SWORDEntry.java 2008-11-28 19:32:48 UTC (rev 88)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2007, Aberystwyth University
+ * Copyright (c) 2008, Aberystwyth University
*
* All rights reserved.
*
Modified: java-common/trunk/src/main/java/org/purl/sword/base/SWORDException.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/base/SWORDException.java 2008-11-28 19:26:10 UTC (rev 87)
+++ java-common/trunk/src/main/java/org/purl/sword/base/SWORDException.java 2008-11-28 19:32:48 UTC (rev 88)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2007, Aberystwyth University
+ * Copyright (c) 2008, Aberystwyth University
*
* All rights reserved.
*
Modified: java-common/trunk/src/main/java/org/purl/sword/base/ServiceDocument.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/base/ServiceDocument.java 2008-11-28 19:26:10 UTC (rev 87)
+++ java-common/trunk/src/main/java/org/purl/sword/base/ServiceDocument.java 2008-11-28 19:32:48 UTC (rev 88)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2007, Aberystwyth University
+ * Copyright (c) 2008, Aberystwyth University
*
* All rights reserved.
*
Modified: java-common/trunk/src/main/java/org/purl/sword/base/ServiceDocumentRequest.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/base/ServiceDocumentRequest.java 2008-11-28 19:26:10 UTC (rev 87)
+++ java-common/trunk/src/main/java/org/purl/sword/base/ServiceDocumentRequest.java 2008-11-28 19:32:48 UTC (rev 88)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2007, Aberystwyth University
+ * Copyright (c) 2008, Aberystwyth University
*
* All rights reserved.
*
Modified: java-common/trunk/src/main/java/org/purl/sword/base/SwordElementInterface.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/base/SwordElementInterface.java 2008-11-28 19:26:10 UTC (rev 87)
+++ java-common/trunk/src/main/java/org/purl/sword/base/SwordElementInterface.java 2008-11-28 19:32:48 UTC (rev 88)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2007, Aberystwyth University
+ * Copyright (c) 2008, Aberystwyth University
*
* All rights reserved.
*
Modified: java-common/trunk/src/main/java/org/purl/sword/base/UnmarshallException.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/base/UnmarshallException.java 2008-11-28 19:26:10 UTC (rev 87)
+++ java-common/trunk/src/main/java/org/purl/sword/base/UnmarshallException.java 2008-11-28 19:32:48 UTC (rev 88)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2007, Aberystwyth University
+ * Copyright (c) 2008, Aberystwyth University
*
* All rights reserved.
*
Modified: java-common/trunk/src/main/java/org/purl/sword/base/Workspace.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/base/Workspace.java 2008-11-28 19:26:10 UTC (rev 87)
+++ java-common/trunk/src/main/java/org/purl/sword/base/Workspace.java 2008-11-28 19:32:48 UTC (rev 88)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2007, Aberystwyth University
+ * Copyright (c) 2008, Aberystwyth University
*
* All rights reserved.
*
Modified: java-common/trunk/src/main/java/org/purl/sword/base/XmlElement.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/base/XmlElement.java 2008-11-28 19:26:10 UTC (rev 87)
+++ java-common/trunk/src/main/java/org/purl/sword/base/XmlElement.java 2008-11-28 19:32:48 UTC (rev 88)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2007, Aberystwyth University
+ * Copyright (c) 2008, Aberystwyth University
*
* All rights reserved.
*
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: SVN c. m. f. t. SWORD-A. p. <swo...@li...> - 2008-11-28 19:26:15
|
Revision: 87
http://sword-app.svn.sourceforge.net/sword-app/?rev=87&view=rev
Author: stuartlewis
Date: 2008-11-28 19:26:10 +0000 (Fri, 28 Nov 2008)
Log Message:
-----------
Updated date in header
Modified Paths:
--------------
java-common/trunk/src/main/java/org/purl/sword/client/ClientConstants.java
java-common/trunk/src/main/java/org/purl/sword/client/ClientFactory.java
java-common/trunk/src/main/java/org/purl/sword/client/ClientOptions.java
java-common/trunk/src/main/java/org/purl/sword/client/ClientType.java
java-common/trunk/src/main/java/org/purl/sword/client/CmdClient.java
java-common/trunk/src/main/java/org/purl/sword/client/DebugOutputStream.java
java-common/trunk/src/main/java/org/purl/sword/client/GuiClient.java
java-common/trunk/src/main/java/org/purl/sword/client/MessageOutputPanel.java
java-common/trunk/src/main/java/org/purl/sword/client/PostDestination.java
java-common/trunk/src/main/java/org/purl/sword/client/PostDialog.java
java-common/trunk/src/main/java/org/purl/sword/client/PostMessage.java
java-common/trunk/src/main/java/org/purl/sword/client/PropertiesDialog.java
java-common/trunk/src/main/java/org/purl/sword/client/SWORDClient.java
java-common/trunk/src/main/java/org/purl/sword/client/SWORDClientException.java
java-common/trunk/src/main/java/org/purl/sword/client/SWORDComboBox.java
java-common/trunk/src/main/java/org/purl/sword/client/SWORDFormPanel.java
java-common/trunk/src/main/java/org/purl/sword/client/ServiceDialog.java
java-common/trunk/src/main/java/org/purl/sword/client/ServicePanel.java
java-common/trunk/src/main/java/org/purl/sword/client/ServiceSelectedListener.java
java-common/trunk/src/main/java/org/purl/sword/client/Status.java
java-common/trunk/src/main/java/org/purl/sword/server/DepositServlet.java
java-common/trunk/src/main/java/org/purl/sword/server/SWORDServer.java
java-common/trunk/src/main/java/org/purl/sword/server/ServiceDocumentServlet.java
Modified: java-common/trunk/src/main/java/org/purl/sword/client/ClientConstants.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/client/ClientConstants.java 2008-11-28 19:06:49 UTC (rev 86)
+++ java-common/trunk/src/main/java/org/purl/sword/client/ClientConstants.java 2008-11-28 19:26:10 UTC (rev 87)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2007, Aberystwyth University
+ * Copyright (c) 2008, Aberystwyth University
*
* All rights reserved.
*
Modified: java-common/trunk/src/main/java/org/purl/sword/client/ClientFactory.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/client/ClientFactory.java 2008-11-28 19:06:49 UTC (rev 86)
+++ java-common/trunk/src/main/java/org/purl/sword/client/ClientFactory.java 2008-11-28 19:26:10 UTC (rev 87)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2007, Aberystwyth University
+ * Copyright (c) 2008, Aberystwyth University
*
* All rights reserved.
*
Modified: java-common/trunk/src/main/java/org/purl/sword/client/ClientOptions.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/client/ClientOptions.java 2008-11-28 19:06:49 UTC (rev 86)
+++ java-common/trunk/src/main/java/org/purl/sword/client/ClientOptions.java 2008-11-28 19:26:10 UTC (rev 87)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2007, Aberystwyth University
+ * Copyright (c) 2008, Aberystwyth University
*
* All rights reserved.
*
Modified: java-common/trunk/src/main/java/org/purl/sword/client/ClientType.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/client/ClientType.java 2008-11-28 19:06:49 UTC (rev 86)
+++ java-common/trunk/src/main/java/org/purl/sword/client/ClientType.java 2008-11-28 19:26:10 UTC (rev 87)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2007, Aberystwyth University
+ * Copyright (c) 2008, Aberystwyth University
*
* All rights reserved.
*
Modified: java-common/trunk/src/main/java/org/purl/sword/client/CmdClient.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/client/CmdClient.java 2008-11-28 19:06:49 UTC (rev 86)
+++ java-common/trunk/src/main/java/org/purl/sword/client/CmdClient.java 2008-11-28 19:26:10 UTC (rev 87)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2007, Aberystwyth University
+ * Copyright (c) 2008, Aberystwyth University
*
* All rights reserved.
*
Modified: java-common/trunk/src/main/java/org/purl/sword/client/DebugOutputStream.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/client/DebugOutputStream.java 2008-11-28 19:06:49 UTC (rev 86)
+++ java-common/trunk/src/main/java/org/purl/sword/client/DebugOutputStream.java 2008-11-28 19:26:10 UTC (rev 87)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2007, Aberystwyth University
+ * Copyright (c) 2008, Aberystwyth University
*
* All rights reserved.
*
Modified: java-common/trunk/src/main/java/org/purl/sword/client/GuiClient.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/client/GuiClient.java 2008-11-28 19:06:49 UTC (rev 86)
+++ java-common/trunk/src/main/java/org/purl/sword/client/GuiClient.java 2008-11-28 19:26:10 UTC (rev 87)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2007, Aberystwyth University
+ * Copyright (c) 2008, Aberystwyth University
*
* All rights reserved.
*
Modified: java-common/trunk/src/main/java/org/purl/sword/client/MessageOutputPanel.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/client/MessageOutputPanel.java 2008-11-28 19:06:49 UTC (rev 86)
+++ java-common/trunk/src/main/java/org/purl/sword/client/MessageOutputPanel.java 2008-11-28 19:26:10 UTC (rev 87)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2007, Aberystwyth University
+ * Copyright (c) 2008, Aberystwyth University
*
* All rights reserved.
*
Modified: java-common/trunk/src/main/java/org/purl/sword/client/PostDestination.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/client/PostDestination.java 2008-11-28 19:06:49 UTC (rev 86)
+++ java-common/trunk/src/main/java/org/purl/sword/client/PostDestination.java 2008-11-28 19:26:10 UTC (rev 87)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2007, Aberystwyth University
+ * Copyright (c) 2008, Aberystwyth University
*
* All rights reserved.
*
Modified: java-common/trunk/src/main/java/org/purl/sword/client/PostDialog.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/client/PostDialog.java 2008-11-28 19:06:49 UTC (rev 86)
+++ java-common/trunk/src/main/java/org/purl/sword/client/PostDialog.java 2008-11-28 19:26:10 UTC (rev 87)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2007, Aberystwyth University
+ * Copyright (c) 2008, Aberystwyth University
*
* All rights reserved.
*
Modified: java-common/trunk/src/main/java/org/purl/sword/client/PostMessage.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/client/PostMessage.java 2008-11-28 19:06:49 UTC (rev 86)
+++ java-common/trunk/src/main/java/org/purl/sword/client/PostMessage.java 2008-11-28 19:26:10 UTC (rev 87)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2007, Aberystwyth University
+ * Copyright (c) 2008, Aberystwyth University
*
* All rights reserved.
*
Modified: java-common/trunk/src/main/java/org/purl/sword/client/PropertiesDialog.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/client/PropertiesDialog.java 2008-11-28 19:06:49 UTC (rev 86)
+++ java-common/trunk/src/main/java/org/purl/sword/client/PropertiesDialog.java 2008-11-28 19:26:10 UTC (rev 87)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2007, Aberystwyth University
+ * Copyright (c) 2008, Aberystwyth University
*
* All rights reserved.
*
Modified: java-common/trunk/src/main/java/org/purl/sword/client/SWORDClient.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/client/SWORDClient.java 2008-11-28 19:06:49 UTC (rev 86)
+++ java-common/trunk/src/main/java/org/purl/sword/client/SWORDClient.java 2008-11-28 19:26:10 UTC (rev 87)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2007, Aberystwyth University
+ * Copyright (c) 2008, Aberystwyth University
*
* All rights reserved.
*
Modified: java-common/trunk/src/main/java/org/purl/sword/client/SWORDClientException.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/client/SWORDClientException.java 2008-11-28 19:06:49 UTC (rev 86)
+++ java-common/trunk/src/main/java/org/purl/sword/client/SWORDClientException.java 2008-11-28 19:26:10 UTC (rev 87)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2007, Aberystwyth University
+ * Copyright (c) 2008, Aberystwyth University
*
* All rights reserved.
*
Modified: java-common/trunk/src/main/java/org/purl/sword/client/SWORDComboBox.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/client/SWORDComboBox.java 2008-11-28 19:06:49 UTC (rev 86)
+++ java-common/trunk/src/main/java/org/purl/sword/client/SWORDComboBox.java 2008-11-28 19:26:10 UTC (rev 87)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2007, Aberystwyth University
+ * Copyright (c) 2008, Aberystwyth University
*
* All rights reserved.
*
Modified: java-common/trunk/src/main/java/org/purl/sword/client/SWORDFormPanel.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/client/SWORDFormPanel.java 2008-11-28 19:06:49 UTC (rev 86)
+++ java-common/trunk/src/main/java/org/purl/sword/client/SWORDFormPanel.java 2008-11-28 19:26:10 UTC (rev 87)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2007, Aberystwyth University
+ * Copyright (c) 2008, Aberystwyth University
*
* All rights reserved.
*
@@ -34,6 +34,7 @@
* THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
+
package org.purl.sword.client;
import java.awt.Component;
Modified: java-common/trunk/src/main/java/org/purl/sword/client/ServiceDialog.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/client/ServiceDialog.java 2008-11-28 19:06:49 UTC (rev 86)
+++ java-common/trunk/src/main/java/org/purl/sword/client/ServiceDialog.java 2008-11-28 19:26:10 UTC (rev 87)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2007, Aberystwyth University
+ * Copyright (c) 2008, Aberystwyth University
*
* All rights reserved.
*
Modified: java-common/trunk/src/main/java/org/purl/sword/client/ServicePanel.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/client/ServicePanel.java 2008-11-28 19:06:49 UTC (rev 86)
+++ java-common/trunk/src/main/java/org/purl/sword/client/ServicePanel.java 2008-11-28 19:26:10 UTC (rev 87)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2007, Aberystwyth University
+ * Copyright (c) 2008, Aberystwyth University
*
* All rights reserved.
*
Modified: java-common/trunk/src/main/java/org/purl/sword/client/ServiceSelectedListener.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/client/ServiceSelectedListener.java 2008-11-28 19:06:49 UTC (rev 86)
+++ java-common/trunk/src/main/java/org/purl/sword/client/ServiceSelectedListener.java 2008-11-28 19:26:10 UTC (rev 87)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2007, Aberystwyth University
+ * Copyright (c) 2008, Aberystwyth University
*
* All rights reserved.
*
Modified: java-common/trunk/src/main/java/org/purl/sword/client/Status.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/client/Status.java 2008-11-28 19:06:49 UTC (rev 86)
+++ java-common/trunk/src/main/java/org/purl/sword/client/Status.java 2008-11-28 19:26:10 UTC (rev 87)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2007, Aberystwyth University
+ * Copyright (c) 2008, Aberystwyth University
*
* All rights reserved.
*
Modified: java-common/trunk/src/main/java/org/purl/sword/server/DepositServlet.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/server/DepositServlet.java 2008-11-28 19:06:49 UTC (rev 86)
+++ java-common/trunk/src/main/java/org/purl/sword/server/DepositServlet.java 2008-11-28 19:26:10 UTC (rev 87)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2007, Aberystwyth University
+ * Copyright (c) 2008, Aberystwyth University
*
* All rights reserved.
*
Modified: java-common/trunk/src/main/java/org/purl/sword/server/SWORDServer.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/server/SWORDServer.java 2008-11-28 19:06:49 UTC (rev 86)
+++ java-common/trunk/src/main/java/org/purl/sword/server/SWORDServer.java 2008-11-28 19:26:10 UTC (rev 87)
@@ -1,3 +1,40 @@
+/**
+ * Copyright (c) 2008, Aberystwyth University
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer.
+ *
+ * - Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * - Neither the name of the Centre for Advanced Software and
+ * Intelligent Systems (CASIS) nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+ * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
package org.purl.sword.server;
import org.purl.sword.base.Deposit;
Modified: java-common/trunk/src/main/java/org/purl/sword/server/ServiceDocumentServlet.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/server/ServiceDocumentServlet.java 2008-11-28 19:06:49 UTC (rev 86)
+++ java-common/trunk/src/main/java/org/purl/sword/server/ServiceDocumentServlet.java 2008-11-28 19:26:10 UTC (rev 87)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2007, Aberystwyth University
+ * Copyright (c) 2008, Aberystwyth University
*
* All rights reserved.
*
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: SVN c. m. f. t. SWORD-A. p. <swo...@li...> - 2008-11-28 19:06:54
|
Revision: 86
http://sword-app.svn.sourceforge.net/sword-app/?rev=86&view=rev
Author: stuartlewis
Date: 2008-11-28 19:06:49 +0000 (Fri, 28 Nov 2008)
Log Message:
-----------
Updated date in header
Modified Paths:
--------------
java-common/trunk/src/main/java/org/purl/sword/atom/Generator.java
Modified: java-common/trunk/src/main/java/org/purl/sword/atom/Generator.java
===================================================================
--- java-common/trunk/src/main/java/org/purl/sword/atom/Generator.java 2008-11-28 19:03:09 UTC (rev 85)
+++ java-common/trunk/src/main/java/org/purl/sword/atom/Generator.java 2008-11-28 19:06:49 UTC (rev 86)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2007, Aberystwyth University
+ * Copyright (c) 2008, Aberystwyth University
*
* All rights reserved.
*
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|