bruno 2003/07/15 07:11:48
Modified: src/blocks/woody/java/org/apache/cocoon/woody/formmodel Field.java MultiValueField.java Log: Adapt to changes in Datatype interface Revision Changes Path 1.7 +2 -2 cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/Field.java Index: Field.java =================================================================== RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/Field.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- Field.java 5 Jul 2003 22:53:33 -0000 1.6 +++ Field.java 15 Jul 2003 14:11:48 -0000 1.7 @@ -116,7 +116,7 @@ // try to convert entered string to the field's native datatype if (enteredValue != null) { - value = definition.getDatatype().convertFromStringLocalized(enteredValue, formContext.getLocale()); + value = definition.getDatatype().convertFromString(enteredValue, formContext.getLocale()); if (value == null) conversionFailed = true; } else @@ -161,7 +161,7 @@ contentHandler.startElement(Constants.WI_NS, VALUE_EL, Constants.WI_PREFIX_COLON + VALUE_EL, Constants.EMPTY_ATTRS); String stringValue; if (value != null) - stringValue = definition.getDatatype().convertToStringLocalized(value, locale); + stringValue = definition.getDatatype().convertToString(value, locale); else stringValue = enteredValue; contentHandler.characters(stringValue.toCharArray(), 0, stringValue.length()); 1.4 +3 -5 cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/MultiValueField.java Index: MultiValueField.java =================================================================== RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/MultiValueField.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- MultiValueField.java 14 May 2003 11:45:44 -0000 1.3 +++ MultiValueField.java 15 Jul 2003 14:11:48 -0000 1.4 @@ -103,7 +103,7 @@ Object[] tempValues = new Object[enteredValues.length]; for (int i = 0; i < enteredValues.length; i++) { String param = enteredValues[i]; - tempValues[i] = definition.getDatatype().convertFromStringLocalized(param, formContext.getLocale()); + tempValues[i] = definition.getDatatype().convertFromString(param, formContext.getLocale()); if (tempValues[i] == null) { conversionFailed = true; break; @@ -143,16 +143,14 @@ if (values != null) { for (int i = 0; i < values.length; i++) { contentHandler.startElement(Constants.WI_NS, VALUE_EL, Constants.WI_PREFIX_COLON + VALUE_EL, Constants.EMPTY_ATTRS); - // Note: by intent not convertToStringLocalized - String value = definition.getDatatype().convertToString(values[i]); + String value = definition.getDatatype().getPlainConvertor().convertToString(values[i], locale, null); contentHandler.characters(value.toCharArray(), 0, value.length()); contentHandler.endElement(Constants.WI_NS, VALUE_EL, Constants.WI_PREFIX_COLON + VALUE_EL); } } else if (enteredValues != null) { for (int i = 0; i < enteredValues.length; i++) { contentHandler.startElement(Constants.WI_NS, VALUE_EL, Constants.WI_PREFIX_COLON + VALUE_EL, Constants.EMPTY_ATTRS); - // Note: by intent not convertToStringLocalized - String value = definition.getDatatype().convertToString(enteredValues[i]); + String value = definition.getDatatype().getPlainConvertor().convertToString(enteredValues[i], locale, null); contentHandler.characters(value.toCharArray(), 0, value.length()); contentHandler.endElement(Constants.WI_NS, VALUE_EL, Constants.WI_PREFIX_COLON + VALUE_EL); }