Author: lektran
Date: Sun Jul 25 00:36:02 2010
New Revision: 978953
URL:
http://svn.apache.org/viewvc?rev=978953&view=revLog:
Changed the parameter map from <String, String> to <String, Object> since some macros use booleans and integers instead of strings. Changed the method to only wrap strings in double quotes.
Modified:
ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/MacroScreenRenderer.java
Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/MacroScreenRenderer.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/MacroScreenRenderer.java?rev=978953&r1=978952&r2=978953&view=diff==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/MacroScreenRenderer.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/MacroScreenRenderer.java Sun Jul 25 00:36:02 2010
@@ -102,16 +102,22 @@ public class MacroScreenRenderer impleme
}
}
- private void executeMacro(Appendable writer, String macroName, Map<String, String> parameters) throws IOException {
+ private void executeMacro(Appendable writer, String macroName, Map<String, Object> parameters) throws IOException {
StringBuilder sb = new StringBuilder("<@");
sb.append(macroName);
if (parameters != null) {
- for (Map.Entry<String, String> parameter : parameters.entrySet()) {
+ for (Map.Entry<String, Object> parameter : parameters.entrySet()) {
sb.append(' ');
sb.append(parameter.getKey());
- sb.append("=\"");
- sb.append(parameter.getValue().replaceAll("\"", "\\\\\""));
- sb.append('"');
+ sb.append("=");
+ Object value = parameter.getValue();
+ if (value instanceof String) {
+ sb.append('"');
+ sb.append(((String) value).replaceAll("\"", "\\\\\""));
+ sb.append('"');
+ } else {
+ sb.append(value);
+ }
}
}
sb.append(" />");