You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2012/05/16 11:27:31 UTC
svn commit: r1339081 - in /ofbiz/trunk:
applications/accounting/src/org/ofbiz/accounting/thirdparty/clearcommerce/
applications/product/src/org/ofbiz/shipment/thirdparty/usps/
framework/base/dtd/ framework/base/src/org/ofbiz/base/util/
framework/base/s...
Author: jleroux
Date: Wed May 16 09:27:31 2012
New Revision: 1339081
URL: http://svn.apache.org/viewvc?rev=1339081&view=rev
Log:
Revert all the changes related to CommonEmptyHeader, part base-catalog.xml and labels in CommonUiLabels.xml.
I have a doubt about SaveLabelsToXmlFile.java, I will check after commit...
Modified:
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/clearcommerce/CCPaymentServices.java
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsMockApiServlet.java
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsServices.java
ofbiz/trunk/framework/base/dtd/ofbiz-properties.xsd
ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilXml.java
ofbiz/trunk/framework/base/src/org/ofbiz/base/util/string/UelFunctions.java
ofbiz/trunk/framework/common/config/CommonUiLabels.xml
ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/labelmanager/SaveLabelsToXmlFile.java
Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/clearcommerce/CCPaymentServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/clearcommerce/CCPaymentServices.java?rev=1339081&r1=1339080&r2=1339081&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/clearcommerce/CCPaymentServices.java (original)
+++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/clearcommerce/CCPaymentServices.java Wed May 16 09:27:31 2012
@@ -888,7 +888,7 @@ public class CCPaymentServices {
OutputStream os = new ByteArrayOutputStream();
try {
- UtilXml.writeXmlDocument(requestDocument, os, "UTF-8", true, false, 0, false);
+ UtilXml.writeXmlDocument(requestDocument, os, "UTF-8", true, false, 0);
} catch (TransformerException e) {
throw new ClearCommerceException("Error serializing requestDocument: " + e.getMessage());
}
Modified: ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsMockApiServlet.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsMockApiServlet.java?rev=1339081&r1=1339080&r2=1339081&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsMockApiServlet.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsMockApiServlet.java Wed May 16 09:27:31 2012
@@ -118,7 +118,7 @@ public class UspsMockApiServlet extends
OutputStream os = new ByteArrayOutputStream();
try {
- UtilXml.writeXmlDocument(responseDocument, os, "UTF-8", true, false, 0, false);
+ UtilXml.writeXmlDocument(responseDocument, os, "UTF-8", true, false, 0);
} catch (TransformerException e) {
Debug.logInfo(e, module);
return;
Modified: ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsServices.java?rev=1339081&r1=1339080&r2=1339081&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsServices.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsServices.java Wed May 16 09:27:31 2012
@@ -1711,7 +1711,7 @@ public class UspsServices {
OutputStream os = new ByteArrayOutputStream();
try {
- UtilXml.writeXmlDocument(requestDocument, os, "UTF-8", true, false, 0, false);
+ UtilXml.writeXmlDocument(requestDocument, os, "UTF-8", true, false, 0);
} catch (TransformerException e) {
throw new UspsRequestException(
UtilProperties.getMessage(resourceError,
Modified: ofbiz/trunk/framework/base/dtd/ofbiz-properties.xsd
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/dtd/ofbiz-properties.xsd?rev=1339081&r1=1339080&r2=1339081&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/dtd/ofbiz-properties.xsd (original)
+++ ofbiz/trunk/framework/base/dtd/ofbiz-properties.xsd Wed May 16 09:27:31 2012
@@ -42,7 +42,6 @@ under the License.
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute ref="xml:lang"/>
- <xs:attribute ref="xml:space"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilXml.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilXml.java?rev=1339081&r1=1339080&r2=1339081&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilXml.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilXml.java Wed May 16 09:27:31 2012
@@ -158,24 +158,20 @@ public class UtilXml {
// ----- TrAX Methods ----------------- //
- /**
- * @deprecated : use the keepSpace version Creates a JAXP TrAX Transformer suitable for pretty-printing an XML document. This method is provided as
- * an alternative to the deprecated <code>org.apache.xml.serialize.OutputFormat</code> class.
- * @param encoding
- * Optional encoding, defaults to UTF-8
- * @param omitXmlDeclaration
- * If <code>true</code> the xml declaration will be omitted from the output
- * @param indent
- * If <code>true</code>, the output will be indented
- * @param indentAmount
- * If <code>indent</code> is <code>true</code>, the number of spaces to indent. Default is 4.
+ /** Creates a JAXP TrAX Transformer suitable for pretty-printing an
+ * XML document. This method is provided as an alternative to the
+ * deprecated <code>org.apache.xml.serialize.OutputFormat</code> class.
+ * @param encoding Optional encoding, defaults to UTF-8
+ * @param omitXmlDeclaration If <code>true</code> the xml declaration
+ * will be omitted from the output
+ * @param indent If <code>true</code>, the output will be indented
+ * @param indentAmount If <code>indent</code> is <code>true</code>,
+ * the number of spaces to indent. Default is 4.
* @return A <code>Transformer</code> instance
* @see <a href="http://java.sun.com/javase/6/docs/api/javax/xml/transform/package-summary.html">JAXP TrAX</a>
* @throws TransformerConfigurationException
*/
- @Deprecated
- public static Transformer createOutputTransformer(String encoding, boolean omitXmlDeclaration, boolean indent, int indentAmount)
- throws TransformerConfigurationException {
+ public static Transformer createOutputTransformer(String encoding, boolean omitXmlDeclaration, boolean indent, int indentAmount) throws TransformerConfigurationException {
StringBuilder sb = new StringBuilder();
sb.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
sb.append("<xsl:stylesheet xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" xmlns:xalan=\"http://xml.apache.org/xslt\" version=\"1.0\">\n");
@@ -202,56 +198,6 @@ public class UtilXml {
return transformerFactory.newTransformer(new StreamSource(bis));
}
- /**
- * Creates a JAXP TrAX Transformer suitable for pretty-printing an XML document. This method is provided as an alternative to the deprecated
- * <code>org.apache.xml.serialize.OutputFormat</code> class.
- *
- * @param encoding
- * Optional encoding, defaults to UTF-8
- * @param omitXmlDeclaration
- * If <code>true</code> the xml declaration will be omitted from the output
- * @param indent
- * If <code>true</code>, the output will be indented
- * @param indentAmount
- * If <code>indent</code> is <code>true</code>, the number of spaces to indent. Default is 4.
- * @param keepSpace
- * If <code>true</code> spaces are preserved, else striped
- * @return A <code>Transformer</code> instance
- * @see <a href="http://java.sun.com/javase/6/docs/api/javax/xml/transform/package-summary.html">JAXP TrAX</a>
- * @throws TransformerConfigurationException
- */
- public static Transformer createOutputTransformer(String encoding, boolean omitXmlDeclaration, boolean indent, int indentAmount, boolean keepSpace)
- throws TransformerConfigurationException {
- StringBuilder sb = new StringBuilder();
- sb.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
- sb.append("<xsl:stylesheet xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" xmlns:xalan=\"http://xml.apache.org/xslt\" version=\"1.0\">\n");
- sb.append("<xsl:output method=\"xml\" encoding=\"");
- sb.append(encoding == null ? "UTF-8" : encoding);
- sb.append("\"");
- if (omitXmlDeclaration) {
- sb.append(" omit-xml-declaration=\"yes\"");
- }
- sb.append(" indent=\"");
- sb.append(indent ? "yes" : "no");
- sb.append("\"");
- if (indent) {
- sb.append(" xalan:indent-amount=\"");
- sb.append(indentAmount <= 0 ? 4 : indentAmount);
- sb.append("\"");
- }
- if (keepSpace) {
- sb.append("/>\n<xsl:preserve-space elements=\"*\"/>\n");
- } else {
- sb.append("/>\n<xsl:strip-space elements=\"*\"/>\n");
- }
- sb.append("<xsl:template match=\"@*|node()\">\n");
- sb.append("<xsl:copy><xsl:apply-templates select=\"@*|node()\"/></xsl:copy>\n");
- sb.append("</xsl:template>\n</xsl:stylesheet>\n");
- ByteArrayInputStream bis = new ByteArrayInputStream(sb.toString().getBytes());
- TransformerFactory transformerFactory = TransformerFactory.newInstance();
- return transformerFactory.newTransformer(new StreamSource(bis));
- }
-
/** Serializes a DOM <code>Node</code> to an <code>OutputStream</code>
* using JAXP TrAX.
* @param transformer A <code>Transformer</code> instance
@@ -266,56 +212,24 @@ public class UtilXml {
transformer.transform(source, result);
}
- /**
- * @deprecated : use the keepSpace version Serializes a DOM <code>Node</code> to an <code>OutputStream</code> using JAXP TrAX.
- * @param node
- * The <code>Node</code> to serialize
- * @param os
- * The <code>OutputStream</code> to serialize to
- * @param encoding
- * Optional encoding, defaults to UTF-8
- * @param omitXmlDeclaration
- * If <code>true</code> the xml declaration will be omitted from the output
- * @param indent
- * If <code>true</code>, the output will be indented
- * @param indentAmount
- * If <code>indent</code> is <code>true</code>, the number of spaces to indent. Default is 4.
+ /** Serializes a DOM <code>Node</code> to an <code>OutputStream</code>
+ * using JAXP TrAX.
+ * @param node The <code>Node</code> to serialize
+ * @param os The <code>OutputStream</code> to serialize to
+ * @param encoding Optional encoding, defaults to UTF-8
+ * @param omitXmlDeclaration If <code>true</code> the xml declaration
+ * will be omitted from the output
+ * @param indent If <code>true</code>, the output will be indented
+ * @param indentAmount If <code>indent</code> is <code>true</code>,
+ * the number of spaces to indent. Default is 4.
* @see <a href="http://java.sun.com/javase/6/docs/api/javax/xml/transform/package-summary.html">JAXP TrAX</a>
* @throws TransformerException
*/
- @Deprecated
- public static void writeXmlDocument(Node node, OutputStream os, String encoding, boolean omitXmlDeclaration, boolean indent, int indentAmount)
- throws TransformerException {
+ public static void writeXmlDocument(Node node, OutputStream os, String encoding, boolean omitXmlDeclaration, boolean indent, int indentAmount) throws TransformerException {
Transformer transformer = createOutputTransformer(encoding, omitXmlDeclaration, indent, indentAmount);
transformDomDocument(transformer, node, os);
}
- /**
- * Serializes a DOM <code>Node</code> to an <code>OutputStream</code> using JAXP TrAX.
- *
- * @param node
- * The <code>Node</code> to serialize
- * @param os
- * The <code>OutputStream</code> to serialize to
- * @param encoding
- * Optional encoding, defaults to UTF-8
- * @param omitXmlDeclaration
- * If <code>true</code> the xml declaration will be omitted from the output
- * @param keepSpace
- * If <code>true</code> spaces are preserved, else striped
- * @param indent
- * If <code>true</code>, the output will be indented
- * @param indentAmount
- * If <code>indent</code> is <code>true</code>, the number of spaces to indent. Default is 4.
- * @see <a href="http://java.sun.com/javase/6/docs/api/javax/xml/transform/package-summary.html">JAXP TrAX</a>
- * @throws TransformerException
- */
- public static void writeXmlDocument(Node node, OutputStream os, String encoding, boolean omitXmlDeclaration, boolean indent, int indentAmount,
- boolean keepSpace) throws TransformerException {
- Transformer transformer = createOutputTransformer(encoding, omitXmlDeclaration, indent, indentAmount, keepSpace);
- transformDomDocument(transformer, node, os);
- }
-
// ----- Java Object Marshalling/Unmarshalling ----- //
/** Deserialize an object from an <code>InputStream</code>.
@@ -411,9 +325,9 @@ public class UtilXml {
return;
}
// OutputFormat defaults are: indent on, indent = 4, include XML declaration,
- // charset = UTF-8, line width = 72, strip spaces
+ // charset = UTF-8, line width = 72
try {
- writeXmlDocument(node, os, "UTF-8", false, true, 4, false);
+ writeXmlDocument(node, os, "UTF-8", false, true, 4);
} catch (TransformerException e) {
// Wrapping this exception for backwards compatibility
throw new IOException(e.getMessage());
Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/string/UelFunctions.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/string/UelFunctions.java?rev=1339081&r1=1339080&r2=1339081&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/string/UelFunctions.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/string/UelFunctions.java Wed May 16 09:27:31 2012
@@ -484,7 +484,7 @@ public class UelFunctions {
File file = FileUtil.getFile(str);
if (file != null) {
FileOutputStream os = new FileOutputStream(file);
- UtilXml.writeXmlDocument(node, os, encoding, omitXmlDeclaration, indent, indentAmount, false);
+ UtilXml.writeXmlDocument(node, os, encoding, omitXmlDeclaration, indent, indentAmount);
os.close();
return true;
} else {
@@ -530,7 +530,7 @@ public class UelFunctions {
public static String toXmlString(Node node, String encoding, boolean omitXmlDeclaration, boolean indent, int indentAmount) {
try {
ByteArrayOutputStream os = new ByteArrayOutputStream();
- UtilXml.writeXmlDocument(node, os, encoding, omitXmlDeclaration, indent, indentAmount, false);
+ UtilXml.writeXmlDocument(node, os, encoding, omitXmlDeclaration, indent, indentAmount);
os.close();
return os.toString();
} catch (Exception e) {
Modified: ofbiz/trunk/framework/common/config/CommonUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/config/CommonUiLabels.xml?rev=1339081&r1=1339080&r2=1339081&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/config/CommonUiLabels.xml (original)
+++ ofbiz/trunk/framework/common/config/CommonUiLabels.xml Wed May 16 09:27:31 2012
@@ -8,7 +8,6 @@
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
-
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
@@ -18,7 +17,7 @@
specific language governing permissions and limitations
under the License.
-->
-<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-properties.xsd">
+<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<property key="AP">
<value xml:lang="de">Kreditoren</value>
<value xml:lang="en">AP</value>
Modified: ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/labelmanager/SaveLabelsToXmlFile.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/labelmanager/SaveLabelsToXmlFile.java?rev=1339081&r1=1339080&r2=1339081&view=diff
==============================================================================
--- ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/labelmanager/SaveLabelsToXmlFile.java (original)
+++ ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/labelmanager/SaveLabelsToXmlFile.java Wed May 16 09:27:31 2012
@@ -34,8 +34,10 @@ import org.ofbiz.base.util.UtilPropertie
import org.ofbiz.base.util.UtilValidate;
import org.ofbiz.base.util.UtilXml;
import org.ofbiz.base.util.cache.UtilCache;
+
import org.ofbiz.service.DispatchContext;
import org.ofbiz.service.ServiceUtil;
+
import org.w3c.dom.Comment;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -149,7 +151,7 @@ public class SaveLabelsToXmlFile {
if (apacheLicenseText != null) {
fos.write(apacheLicenseText.getBytes());
}
- UtilXml.writeXmlDocument(resourceElem, fos, "UTF-8", !(apacheLicenseText == null), true, 4, true);
+ UtilXml.writeXmlDocument(resourceElem, fos, "UTF-8", !(apacheLicenseText == null), true, 4);
} finally {
fos.close();
// clear cache to see immediately the new labels and