perfsonar-dev - perfsonar: r2621 - branches/perfsonarui/src/org/perfsonar/perfsonarui
Subject: perfsonar development work
List archive
- From:
- To:
- Subject: perfsonar: r2621 - branches/perfsonarui/src/org/perfsonar/perfsonarui
- Date: Thu, 9 Aug 2007 13:58:54 -0400
Author: nina
Date: 2007-08-09 13:58:53 -0400 (Thu, 09 Aug 2007)
New Revision: 2621
Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/AbstractMARequest.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/PSLogger.java
Log:
Introduced static AbstractMARequest.document2String(Document) method and
updated relevant files to use it
Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/AbstractMARequest.java
===================================================================
--- branches/perfsonarui/src/org/perfsonar/perfsonarui/AbstractMARequest.java
2007-08-09 17:34:49 UTC (rev 2620)
+++ branches/perfsonarui/src/org/perfsonar/perfsonarui/AbstractMARequest.java
2007-08-09 17:58:53 UTC (rev 2621)
@@ -22,7 +22,6 @@
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
-import java.io.IOException;
import java.io.StringReader;
import java.io.StringWriter;
import java.net.URL;
@@ -34,11 +33,6 @@
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.rpc.ServiceException;
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
@@ -395,21 +389,22 @@
}
public static String document2string(Document doc) throws Exception {
+ /*
try {
StringWriter out = new StringWriter();
DOMSource domSource = new DOMSource(doc);
StreamResult streamResult = new StreamResult(out);
TransformerFactory tf = TransformerFactory.newInstance();
Transformer serializer = tf.newTransformer();
-
serializer.setOutputProperty(OutputKeys.ENCODING,"ISO-8859-1");
+ serializer.setOutputProperty(OutputKeys.ENCODING,"UTF-8");
serializer.setOutputProperty(OutputKeys.INDENT,"yes");
serializer.transform(domSource, streamResult);
return out.toString();
} catch (Throwable x) {
return x.toString();
}
+ */
- /*
StringWriter outWriter = new StringWriter();
OutputFormat format = new OutputFormat(doc);
format.setLineWidth(65);
@@ -419,7 +414,7 @@
XMLSerializer output = new XMLSerializer(outWriter, format);
output.serialize(doc);
return outWriter.toString();
- */
+
}
}
Modified: branches/perfsonarui/src/org/perfsonar/perfsonarui/PSLogger.java
===================================================================
--- branches/perfsonarui/src/org/perfsonar/perfsonarui/PSLogger.java
2007-08-09 17:34:49 UTC (rev 2620)
+++ branches/perfsonarui/src/org/perfsonar/perfsonarui/PSLogger.java
2007-08-09 17:58:53 UTC (rev 2621)
@@ -197,34 +197,11 @@
}
}
private void debugDocument(Document doc) {
- /*
try {
- StringWriter outWriter = new StringWriter();
- OutputFormat format = new OutputFormat(doc);
- format.setLineWidth(65);
- format.setIndenting(true);
- format.setIndent(2);
-
- XMLSerializer output = new XMLSerializer(outWriter, format);
- output.serialize(doc);
- log4jLogger.debug(outWriter.toString());
+ log4jLogger.debug(AbstractMARequest.document2string(doc));
} catch (Throwable x) {
debugThrowable(x);
}
- */
- try {
- StringWriter out = new StringWriter();
- DOMSource domSource = new DOMSource(doc);
- StreamResult streamResult = new StreamResult(out);
- TransformerFactory tf = TransformerFactory.newInstance();
- Transformer serializer = tf.newTransformer();
-
serializer.setOutputProperty(OutputKeys.ENCODING,"ISO-8859-1");
- serializer.setOutputProperty(OutputKeys.INDENT,"yes");
- serializer.transform(domSource, streamResult);
- log4jLogger.debug(out.toString());
- } catch (Throwable x) {
- debugThrowable(x);
- }
}
private void debugThrowable(Throwable problem) {
if (problem != null) {
- perfsonar: r2621 - branches/perfsonarui/src/org/perfsonar/perfsonarui, svnlog, 08/09/2007
Archive powered by MHonArc 2.6.16.