You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by ju...@apache.org on 2002/05/17 07:54:32 UTC
cvs commit: jakarta-slide/src/webdav/server/org/apache/slide/webdav/method LockMethod.java OptionsMethod.java PropFindMethod.java PropPatchMethod.java ReportMethod.java SearchMethod.java UpdateMethod.java WebdavMethod.java
juergen 02/05/16 22:54:32
Modified: src/webdav/server/org/apache/slide/webdav/method
LockMethod.java OptionsMethod.java
PropFindMethod.java PropPatchMethod.java
ReportMethod.java SearchMethod.java
UpdateMethod.java WebdavMethod.java
Log:
Fixed bug: XML header was missing in XML response document.
XML response is now formatted (indention and line breaks).
(ralf)
Revision Changes Path
1.33 +4 -4 jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/LockMethod.java
Index: LockMethod.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/LockMethod.java,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- LockMethod.java 16 May 2002 07:39:24 -0000 1.32
+++ LockMethod.java 17 May 2002 05:54:32 -0000 1.33
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/LockMethod.java,v 1.32 2002/05/16 07:39:24 juergen Exp $
- * $Revision: 1.32 $
- * $Date: 2002/05/16 07:39:24 $
+ * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/LockMethod.java,v 1.33 2002/05/17 05:54:32 juergen Exp $
+ * $Revision: 1.33 $
+ * $Date: 2002/05/17 05:54:32 $
*
* ====================================================================
*
@@ -674,7 +674,7 @@
//System.out.println(generatedXML.toString());
resp.setContentType(TEXT_XML_UTF_8);
Writer writer = resp.getWriter();
- new org.jdom.output.XMLOutputter().output(prop, writer);
+ new org.jdom.output.XMLOutputter(XML_REPONSE_INDENT, true).output(new org.jdom.Document(prop), writer);
writer.flush();
} catch (Exception e) {
e.printStackTrace();
1.22 +5 -5 jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/OptionsMethod.java
Index: OptionsMethod.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/OptionsMethod.java,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- OptionsMethod.java 1 May 2002 15:04:26 -0000 1.21
+++ OptionsMethod.java 17 May 2002 05:54:32 -0000 1.22
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/OptionsMethod.java,v 1.21 2002/05/01 15:04:26 pnever Exp $
- * $Revision: 1.21 $
- * $Date: 2002/05/01 15:04:26 $
+ * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/OptionsMethod.java,v 1.22 2002/05/17 05:54:32 juergen Exp $
+ * $Revision: 1.22 $
+ * $Date: 2002/05/17 05:54:32 $
*
* ====================================================================
*
@@ -103,7 +103,7 @@
implements DeltavConstants, AclConstants {
// An XML outputter
- private XMLOutputter xmlOut = new XMLOutputter( " ", true, "UTF-8" );
+ private XMLOutputter xmlOut = new XMLOutputter(XML_REPONSE_INDENT, true, "UTF-8" );
private Namespace xmlNs = Namespace.getNamespace(DEFAULT_PREFIX, DEFAULT_NAMESPACE);
// private Namespace xmlNs = Namespace.getNamespace(DEFAULT_NAMESPACE);
@@ -271,7 +271,7 @@
ore.addContent( wscse );
}
try {
- xmlOut.output(ore, resp.getWriter());
+ xmlOut.output(new Document(ore), resp.getWriter());
}
catch( IOException x ) {
resp.setStatus( WebdavStatus.SC_INTERNAL_SERVER_ERROR );
1.71 +4 -4 jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PropFindMethod.java
Index: PropFindMethod.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PropFindMethod.java,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -r1.70 -r1.71
--- PropFindMethod.java 16 May 2002 07:39:24 -0000 1.70
+++ PropFindMethod.java 17 May 2002 05:54:32 -0000 1.71
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PropFindMethod.java,v 1.70 2002/05/16 07:39:24 juergen Exp $
- * $Revision: 1.70 $
- * $Date: 2002/05/16 07:39:24 $
+ * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PropFindMethod.java,v 1.71 2002/05/17 05:54:32 juergen Exp $
+ * $Revision: 1.71 $
+ * $Date: 2002/05/17 05:54:32 $
*
* ====================================================================
*
@@ -405,7 +405,7 @@
}
}
- new XMLOutputter().output(multistatusElement, resp.getWriter());
+ new XMLOutputter(XML_REPONSE_INDENT, true).output(new Document(multistatusElement), resp.getWriter());
}
1.43 +5 -4 jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PropPatchMethod.java
Index: PropPatchMethod.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PropPatchMethod.java,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -r1.42 -r1.43
--- PropPatchMethod.java 16 May 2002 07:39:24 -0000 1.42
+++ PropPatchMethod.java 17 May 2002 05:54:32 -0000 1.43
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PropPatchMethod.java,v 1.42 2002/05/16 07:39:24 juergen Exp $
- * $Revision: 1.42 $
- * $Date: 2002/05/16 07:39:24 $
+ * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PropPatchMethod.java,v 1.43 2002/05/17 05:54:32 juergen Exp $
+ * $Revision: 1.43 $
+ * $Date: 2002/05/17 05:54:32 $
*
* ====================================================================
*
@@ -555,7 +555,8 @@
try {
resp.setContentType(TEXT_XML_UTF_8);
Writer writer = resp.getWriter();
- new org.jdom.output.XMLOutputter().output(multistatus, writer);
+ new org.jdom.output.XMLOutputter(XML_REPONSE_INDENT, true).
+ output(new org.jdom.Document(multistatus), writer);
writer.flush();
} catch (Exception e) {
e.printStackTrace();
1.30 +6 -5 jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/ReportMethod.java
Index: ReportMethod.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/ReportMethod.java,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- ReportMethod.java 16 May 2002 07:39:24 -0000 1.29
+++ ReportMethod.java 17 May 2002 05:54:32 -0000 1.30
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/ReportMethod.java,v 1.29 2002/05/16 07:39:24 juergen Exp $
- * $Revision: 1.29 $
- * $Date: 2002/05/16 07:39:24 $
+ * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/ReportMethod.java,v 1.30 2002/05/17 05:54:32 juergen Exp $
+ * $Revision: 1.30 $
+ * $Date: 2002/05/17 05:54:32 $
*
* ====================================================================
*
@@ -167,7 +167,7 @@
/**
* An implementation of the DeltaV <code>REPORT</code> method.
*
- * @version $Revision: 1.29 $
+ * @version $Revision: 1.30 $
*
* @author <a href="mailto:ralf.stuckert@softwareag.com">Ralf Stuckert</a>
*/
@@ -609,7 +609,8 @@
executeLocateByHistoryReport(requestUri, resultElement, getDepth());
}
- new XMLOutputter().output(resultElement, getResponse().getWriter());
+ new XMLOutputter(XML_REPONSE_INDENT, true).
+ output(new Document(resultElement), getResponse().getWriter());
}
catch (PreconditionViolationException e) {
sendPreconditionViolation(e);
1.18 +4 -4 jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/SearchMethod.java
Index: SearchMethod.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/SearchMethod.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- SearchMethod.java 16 May 2002 07:39:24 -0000 1.17
+++ SearchMethod.java 17 May 2002 05:54:32 -0000 1.18
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/SearchMethod.java,v 1.17 2002/05/16 07:39:24 juergen Exp $
- * $Revision: 1.17 $
- * $Date: 2002/05/16 07:39:24 $
+ * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/SearchMethod.java,v 1.18 2002/05/17 05:54:32 juergen Exp $
+ * $Revision: 1.18 $
+ * $Date: 2002/05/17 05:54:32 $
*
* ====================================================================
*
@@ -283,7 +283,7 @@
private void sendResult (org.jdom.Document responseDoc)
throws org.jdom.JDOMException, IOException
{
- XMLOutputter xmlWriter = new XMLOutputter ();
+ XMLOutputter xmlWriter = new XMLOutputter (XML_REPONSE_INDENT, true);
xmlWriter.output (responseDoc, resp.getWriter());
}
1.5 +5 -4 jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/UpdateMethod.java
Index: UpdateMethod.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/UpdateMethod.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- UpdateMethod.java 15 May 2002 11:44:38 -0000 1.4
+++ UpdateMethod.java 17 May 2002 05:54:32 -0000 1.5
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/UpdateMethod.java,v 1.4 2002/05/15 11:44:38 juergen Exp $
- * $Revision: 1.4 $
- * $Date: 2002/05/15 11:44:38 $
+ * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/UpdateMethod.java,v 1.5 2002/05/17 05:54:32 juergen Exp $
+ * $Revision: 1.5 $
+ * $Date: 2002/05/17 05:54:32 $
*
* ====================================================================
*
@@ -291,7 +291,8 @@
resp.setStatus(WebdavStatus.SC_MULTI_STATUS);
resp.setContentType(TEXT_XML_UTF_8);
- new XMLOutputter().output(multistatusElement, resp.getWriter());
+ new XMLOutputter(XML_REPONSE_INDENT, true).
+ output(new Document(multistatusElement), resp.getWriter());
}
catch (Exception e) {
e.printStackTrace();
1.56 +11 -4 jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/WebdavMethod.java
Index: WebdavMethod.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/WebdavMethod.java,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -r1.55 -r1.56
--- WebdavMethod.java 15 May 2002 11:44:38 -0000 1.55
+++ WebdavMethod.java 17 May 2002 05:54:32 -0000 1.56
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/WebdavMethod.java,v 1.55 2002/05/15 11:44:38 juergen Exp $
- * $Revision: 1.55 $
- * $Date: 2002/05/15 11:44:38 $
+ * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/WebdavMethod.java,v 1.56 2002/05/17 05:54:32 juergen Exp $
+ * $Revision: 1.56 $
+ * $Date: 2002/05/17 05:54:32 $
*
* ====================================================================
*
@@ -136,6 +136,12 @@
*/
public static final String TEXT_XML_UTF_8 = "text/xml; charset=\"UTF-8\"";
+ /**
+ * The indent to use in the XML response.
+ */
+ public static final String XML_REPONSE_INDENT = " ";
+
+
private static final String LOG_CHANNEL = WebdavMethod.class.getName();
public static final String LOCK_TOKEN = "opaquelocktoken:";
@@ -620,7 +626,8 @@
resp.setStatus(violatedPrecondition.getStatusCode());
resp.setContentType(TEXT_XML_UTF_8);
- new org.jdom.output.XMLOutputter().output(getPreconditionViolationError(pve.getViolatedPrecondition()), resp.getWriter());
+ new org.jdom.output.XMLOutputter(XML_REPONSE_INDENT, true).
+ output(new org.jdom.Document(getPreconditionViolationError(pve.getViolatedPrecondition())), resp.getWriter());
}
}
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>