incubator-adffaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mat...@apache.org
Subject svn commit: r476134 - in /incubator/adffaces/trunk/trinidad: trinidad-api/src/main/java/org/apache/myfaces/trinidad/convert/ trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/ trinidad-impl/src/main/java/org/apache/myfaces/trinida...
Date Fri, 17 Nov 2006 13:21:25 GMT
Author: matzew
Date: Fri Nov 17 05:21:23 2006
New Revision: 476134

URL: http://svn.apache.org/viewvc?view=rev&rev=476134
Log:
refactor client side converter/validator to lookup messagesKeys and not using constructor (ADFFACES-155)

Modified:
    incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/convert/DateTimeConverter.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/ByteConverter.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/ColorConverter.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/ConverterUtils.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/DateTimeConverter.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/DoubleConverter.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/FloatConverter.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/IntegerConverter.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/LongConverter.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/ShortConverter.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/ByteLengthValidator.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/DateRestrictionValidator.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/DateTimeRangeValidator.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/DoubleRangeValidator.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/LengthValidator.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/LongRangeValidator.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/RegExpValidator.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/CharSets.js
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/ColorFormat.js
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/Core.js
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/CoreFormat.js
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/DateFormat.js

Modified: incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/convert/DateTimeConverter.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/convert/DateTimeConverter.java?view=diff&rev=476134&r1=476133&r2=476134
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/convert/DateTimeConverter.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/convert/DateTimeConverter.java Fri Nov 17 05:21:23 2006
@@ -1050,7 +1050,7 @@
   {
     // if pattern is set then - conversion would have been carried out using
     // the pattern or secondary pattern.
-    String key = _getViolationMessageKey(pattern);
+    String key = getViolationMessageKey(pattern);
     return _getConvertErrorFacesMessage(context, key, params, component);
 
   }
@@ -1269,6 +1269,25 @@
     UIComponent component
     )
   {
+    Object msgPattern = getMessagePattern(context, key, params, component);
+    return MessageFactory.getMessage(context, key, msgPattern,
+                                     params, component);
+  }
+  
+  private String _getExample(FacesContext context, String pattern)
+  {
+    DateFormat format = _getDateFormat(context, pattern);
+    return format.format(_EXAMPLE_DATE);
+  }
+
+
+  protected Object getMessagePattern(
+      FacesContext context,
+      String key,
+      Object[] params,
+      UIComponent component
+      )
+  {
     Object msgPattern;
     if (key == CONVERT_DATE_MESSAGE_ID)
     {
@@ -1288,19 +1307,11 @@
       throw new IllegalArgumentException("Illegal message id "
                                         + "unexpected value " + key );
     }
-
-    return MessageFactory.getMessage(context, key, msgPattern,
-                                     params, component);
-  }
-
-  private String _getExample(FacesContext context, String pattern)
-  {
-    DateFormat format = _getDateFormat(context, pattern);
-    return format.format(_EXAMPLE_DATE);
+      
+    return msgPattern;
   }
 
-
-  private String _getViolationMessageKey(String pattern)
+  protected String getViolationMessageKey(String pattern)
   {
     String key = null;
     // if pattern is null, then use ViolationMessage based on type specified

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/ByteConverter.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/ByteConverter.java?view=diff&rev=476134&r1=476133&r2=476134
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/ByteConverter.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/ByteConverter.java Fri Nov 17 05:21:23 2006
@@ -110,11 +110,7 @@
     FacesContext context,
     UIComponent component)
   {
-    return ConverterUtils.getClientConversion(context, component,
-                                              MAXIMUM_MESSAGE_ID,
-                                              MINIMUM_MESSAGE_ID,
-                                              CONVERT_MESSAGE_ID,
-                                              _BYTE_MAX, _BYTE_MIN);
+    return _getTrByteConverter(context, component, _BYTE_MAX, _BYTE_MIN);
   }
 
   public Collection<String> getClientImportNames()
@@ -122,6 +118,24 @@
     return _IMPORT_NAMES;
   }
 
+  private static String _getTrByteConverter(
+      FacesContext context,
+      UIComponent component,
+      String maxVal,
+      String minVal)
+    {
+      StringBuffer outBuffer = new StringBuffer(250);
+
+      outBuffer.append("new TrByteConverter(");
+
+      outBuffer.append("null,null,0,");
+      outBuffer.append(maxVal);
+      outBuffer.append(',');
+      outBuffer.append(minVal);
+      outBuffer.append(")");
+
+      return outBuffer.toString();
+    }
 
   private static final String _BYTE_MAX = Byte.toString(Byte.MAX_VALUE);
   private static final String _BYTE_MIN = Byte.toString(Byte.MIN_VALUE);

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/ColorConverter.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/ColorConverter.java?view=diff&rev=476134&r1=476133&r2=476134
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/ColorConverter.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/ColorConverter.java Fri Nov 17 05:21:23 2006
@@ -26,12 +26,10 @@
 import org.apache.myfaces.trinidad.convert.ClientConverter;
 import org.apache.myfaces.trinidad.logging.TrinidadLogger;
 import org.apache.myfaces.trinidad.util.MessageFactory;
-
 import org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.XhtmlUtils;
 import org.apache.myfaces.trinidadinternal.share.text.RGBColorFormat;
 import org.apache.myfaces.trinidadinternal.ui.laf.base.xhtml.XhtmlLafUtils;
 
-
 /**
  * @author The Oracle ADF Faces Team
  */
@@ -168,12 +166,24 @@
       sb.append(",false,'");
     }
     
-    FacesMessage msg = _getConvertFacesMessage(context);
-    sb.append(XhtmlLafUtils.escapeJS(msg.getSummary())); 
-    sb.append("','");
-    sb.append(XhtmlLafUtils.escapeJS(msg.getDetail())); 
-    sb.append("','");
     sb.append(XhtmlLafUtils.escapeJS(patternsString));
+    
+    
+    String convMsgDet = getMessageDetailConvert();
+    if(convMsgDet != null)
+    {
+      Object[] params = new Object[] {"{0}", "{1}", "{2}"};
+
+      FacesMessage msg = MessageFactory.getMessage(context, CONVERT_MESSAGE_ID,
+                                             convMsgDet, params);
+      
+      sb.append("','");
+      sb.append(XhtmlLafUtils.escapeJS(msg.getSummary())); 
+      sb.append("','");
+      sb.append(XhtmlLafUtils.escapeJS(msg.getDetail())); 
+    }
+    
+    
     sb.append("')");
 
     return sb.toString();
@@ -245,18 +255,6 @@
     }
   }
 
-  private FacesMessage _getConvertFacesMessage(FacesContext context)
-  {
-    String convMsgDet = getMessageDetailConvert();
-
-   
-    // will get replaced in javascript
-    Object[] params = new Object[] {"{0}", "{1}", "{2}"};
-
-    return MessageFactory.getMessage(context, CONVERT_MESSAGE_ID,
-                                           convMsgDet, params);
-  }
-  
   private static final Collection<String> _IMPORT_NAMES = Collections.singletonList( "ColorFormat()" );
   private static final TrinidadLogger _LOG = TrinidadLogger.createTrinidadLogger(ColorConverter.class);
   private static final String _PATTERN_WRITTEN_KEY = "org.apache.myfaces.trinidadinternal.convert.ColorConverter._PATTERN_WRITTEN";

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/ConverterUtils.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/ConverterUtils.java?view=diff&rev=476134&r1=476133&r2=476134
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/ConverterUtils.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/ConverterUtils.java Fri Nov 17 05:21:23 2006
@@ -176,6 +176,9 @@
     }
   }
 
+  /**
+   * @deprecated method needs to an overhaul
+   */
   public static String getClientValidation(
     FacesContext context,
     UIComponent component,
@@ -261,7 +264,13 @@
     return outBuffer.toString();
   }
 
-
+  /**
+   * @deprecated not used currently
+   * @param context
+   * @param component
+   * @param defaultId
+   * @return
+   */
   public static String getClientConversion(
     FacesContext context,
     UIComponent component,

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/DateTimeConverter.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/DateTimeConverter.java?view=diff&rev=476134&r1=476133&r2=476134
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/DateTimeConverter.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/DateTimeConverter.java Fri Nov 17 05:21:23 2006
@@ -17,7 +17,6 @@
 
 import java.text.DateFormat;
 import java.text.SimpleDateFormat;
-
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Date;
@@ -27,31 +26,35 @@
 
 import javax.faces.application.FacesMessage;
 import javax.faces.component.UIComponent;
+import javax.faces.component.ValueHolder;
 import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
 import javax.faces.convert.ConverterException;
 import javax.faces.el.ValueBinding;
 
-import org.apache.myfaces.trinidad.logging.TrinidadLogger;
-
 import org.apache.myfaces.trinidad.context.RenderingContext;
-import org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.XhtmlUtils;
-import javax.faces.component.ValueHolder;
-import javax.faces.convert.Converter;
-
 import org.apache.myfaces.trinidad.convert.ClientConverter;
+import org.apache.myfaces.trinidad.logging.TrinidadLogger;
+import org.apache.myfaces.trinidad.util.MessageFactory;
+import org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.XhtmlUtils;
 import org.apache.myfaces.trinidadinternal.ui.laf.base.xhtml.XhtmlLafUtils;
 
 /**
- * <p>This class implements client side equivalent of DateTimeConverter.
- * This class pushes all relevant information to the client side so
- * that conversion can be enabled at the client side. </p>
- *
- * @version $Name:  $ ($Revision: adfrt/faces/adf-faces-impl/src/main/java/oracle/adfinternal/view/faces/convert/DateTimeConverter.java#0 $) $Date: 10-nov-2005.19:06:22 $
+ * <p>
+ * This class implements client side equivalent of DateTimeConverter. This class
+ * pushes all relevant information to the client side so that conversion can be
+ * enabled at the client side.
+ * </p>
+ * 
+ * @version $Name: $ ($Revision:
+ *          adfrt/faces/adf-faces-impl/src/main/java/oracle/adfinternal/view/faces/convert/DateTimeConverter.java#0 $)
+ *          $Date: 10-nov-2005.19:06:22 $
  * @author The Oracle ADF Faces Team
  */
-public class DateTimeConverter extends org.apache.myfaces.trinidad.convert.DateTimeConverter
-                               implements ClientConverter
-                                   
+public class DateTimeConverter extends
+    org.apache.myfaces.trinidad.convert.DateTimeConverter implements
+    ClientConverter
+
 {
   public DateTimeConverter()
   {
@@ -69,7 +72,8 @@
   }
 
   @Override
-  public String getAsString(FacesContext context, UIComponent component, Object value)
+  public String getAsString(FacesContext context, UIComponent component,
+      Object value)
   {
     if (value == null)
       return null;
@@ -83,9 +87,9 @@
     return super.getAsString(context, component, value);
   }
 
-
   @Override
-  public Object getAsObject(FacesContext context, UIComponent component, String value)
+  public Object getAsObject(FacesContext context, UIComponent component,
+      String value)
   {
     Object date = super.getAsObject(context, component, value);
     if (date == null)
@@ -95,17 +99,12 @@
   }
 
   /**
-   * Super class only returns instances of java.util.Date.
-   * However, the expected type of the attribute might be
-   * java.sql.Timestamp. Therefore, we must get the expected type
-   * and convert if necessary: bug 4549630:
+   * Super class only returns instances of java.util.Date. However, the expected
+   * type of the attribute might be java.sql.Timestamp. Therefore, we must get
+   * the expected type and convert if necessary: bug 4549630:
    */
-  static Object __typeConvert(
-    FacesContext context,
-    Converter converter,
-    UIComponent component,
-    String strValue,
-    Object value)
+  static Object __typeConvert(FacesContext context, Converter converter,
+      UIComponent component, String strValue, Object value)
   {
     assert value != null;
     ValueBinding binding = component.getValueBinding("value");
@@ -113,7 +112,8 @@
     {
       Class<?> expectedType = binding.getType(context);
       // Sometimes the type might be null, if it cannot be determined:
-      if ((expectedType != null) && (!expectedType.isAssignableFrom(value.getClass())))
+      if ((expectedType != null)
+          && (!expectedType.isAssignableFrom(value.getClass())))
       {
         // sometimes we might have to return the date/number as a string.
         // see bug 4602629:
@@ -125,10 +125,10 @@
           if (strValue.equals(holder.getValue()))
             return strValue;
           return converter.getAsString(context, component, value);
-        }
-        else
+        } else
         {
-          GenericConverterFactory fac = GenericConverterFactory.getCurrentInstance();
+          GenericConverterFactory fac = GenericConverterFactory
+              .getCurrentInstance();
           value = fac.convert(value, expectedType);
         }
       }
@@ -140,14 +140,15 @@
   public String getClientScript(FacesContext context, UIComponent component)
   {
 
-    if ( component == null)
+    if (component == null)
     {
-      _LOG.severe("The component is null, but it is needed for the client id, so no script written");
+      _LOG
+          .severe("The component is null, but it is needed for the client id, so no script written");
       return null;
     }
     // Add a JavaScript Object to store the datefield formats
-    // on the client-side.  We currently store the format string
-    // for each and every field.  It'd be more efficient to have
+    // on the client-side. We currently store the format string
+    // for each and every field. It'd be more efficient to have
     // an array of formats, then store for each field the
     // index of the format, especially if we could delay outputting
     // these objects to when the <form> closes.
@@ -158,7 +159,8 @@
       // =-=AEW Only if Javascript...
       // -= Simon Lessard =-
       // FIXME: JSF 1.2 specifies <String, Object>
-      Map<Object, Object> requestMap = context.getExternalContext().getRequestMap();
+      Map<Object, Object> requestMap = context.getExternalContext()
+          .getRequestMap();
 
       // this fetch could be at the place where we append, but has been
       // moved ahead to optimize use of StringBuffer
@@ -171,7 +173,7 @@
 
       if (requestMap.get(_PATTERN_WRITTEN_KEY) == null)
       {
-        requestMap.put( _PATTERN_WRITTEN_KEY, Boolean.TRUE);
+        requestMap.put(_PATTERN_WRITTEN_KEY, Boolean.TRUE);
         // only create the _dfs object if it doesn't exist. This is to
         // make sure we don't have problems like bug 3448873 where we
         // wipe out _dfs[xxx] values if we ppr the first date field on a
@@ -186,8 +188,7 @@
       buff.append(";");
 
       return buff.toString();
-    }
-    else
+    } else
     {
       _LOG.severe("Client id is null, no script rendered");
     }
@@ -195,10 +196,7 @@
     return null;
   }
 
-  public String getClientConversion(
-    FacesContext context,
-    UIComponent component
-    )
+  public String getClientConversion(FacesContext context, UIComponent component)
   {
     // for now, we are disabling the client-side validation when the
     // locale is not the page's locale.
@@ -215,52 +213,72 @@
 
       if (pattern == null)
         pattern = getSecondaryPattern();
-      Object[] params = new Object[] {"{0}", "{1}", "{2}"};
-      FacesMessage msg = getParseErrorMessage(context, component,
-                                        pattern, params);
-      String detailMessage = XhtmlLafUtils.escapeJS(msg.getDetail());
-      String summaryMessage = XhtmlLafUtils.escapeJS(msg.getSummary());
+
+      String key = getViolationMessageKey(pattern);
+
+      Object[] params = new Object[]
+      {
+          "{0}", "{1}", "{2}"
+      };
+      Object msgPattern = getMessagePattern(context, key, params, component);
+
+      FacesMessage msg = null;
+      String detailMessage = null;
+      String summaryMessage = null;
+      int customMessages = 0;
+      if (msgPattern != null)
+      {
+        msg = MessageFactory.getMessage(context, key, msgPattern, params,
+            component);
+        detailMessage = XhtmlLafUtils.escapeJS(msg.getDetail());
+        summaryMessage = XhtmlLafUtils.escapeJS(msg.getSummary());
+        key = "null";
+        customMessages = 6 + detailMessage.length() + summaryMessage.length();
+
+      }
       String exampleString = XhtmlLafUtils.escapeJS(getExample(context));
-      
-      StringBuffer outBuffer = new StringBuffer(36 + jsPattern.length() +
-                                                detailMessage.length() +
-                                                summaryMessage.length() +
-                                                exampleString.length());
+      String escapedKey = XhtmlLafUtils.escapeJS(key);
+
+      StringBuffer outBuffer = new StringBuffer(36 + jsPattern.length()
+          + exampleString.length() + escapedKey.length() + customMessages);
       outBuffer.append("new TrDateTimeConverter("); // 21
-      outBuffer.append(jsPattern);               // jsPattern.length
-      outBuffer.append(",null,'");               // 7
-      outBuffer.append(summaryMessage);          // summary message.length
-      outBuffer.append("','");                   // 3
-      outBuffer.append(detailMessage);           // detail message.length/
-      outBuffer.append("','");                   // 3
-      outBuffer.append(exampleString);           // exampleString.length
-      outBuffer.append("')");                    // 2
+      outBuffer.append(jsPattern); // jsPattern.length
+      outBuffer.append(",null,'"); // 7
+      outBuffer.append(exampleString); // exampleString.length
+      outBuffer.append("','"); // 3
+      outBuffer.append(escapedKey); // escapedKey.length
+
+      if (msgPattern != null)
+      {
+        outBuffer.append("','"); // 3
+        outBuffer.append(summaryMessage); // summary message.length
+        outBuffer.append("','"); // 3
+        outBuffer.append(detailMessage); // detail message.length/
+      }
+
+      outBuffer.append("')"); // 2
 
       return outBuffer.toString();
-    }
-    else
+    } else
     {
       // no pattern-matchable date
       return null;
     }
   }
 
-
   public Collection<String> getClientImportNames()
   {
     return _IMPORT_NAMES;
   }
 
-
-  public String getClientLibrarySource(
-   FacesContext context)
+  public String getClientLibrarySource(FacesContext context)
   {
     return null;
   }
 
-   /**
-   * Returns the number of columns of text a field should
-   * have to fully display the contents of a valid string.
+  /**
+   * Returns the number of columns of text a field should have to fully display
+   * the contents of a valid string.
    */
   public int getColumns()
   {
@@ -279,8 +297,7 @@
     {
       // for now, just return the length of the date pattern
       len = pattern.length();
-    }
-    else
+    } else
     {
       // If no pattern set, try converting to a pattern,
       // otherwise fall back to the length of "mm/dd/yyyy" -
@@ -290,17 +307,16 @@
 
       try
       {
-         FacesContext context = FacesContext.getCurrentInstance();
+        FacesContext context = FacesContext.getCurrentInstance();
         // this the pattern obtained by applying the styles
         Object format = getDateFormat(context, null);
         if (format instanceof SimpleDateFormat)
         {
-          applyPattern = ((SimpleDateFormat)format).toPattern();
+          applyPattern = ((SimpleDateFormat) format).toPattern();
         }
-      }
-      catch (ConverterException e)
+      } catch (ConverterException e)
       {
-         // Do nothing here. Any error that was there would have been reported
+        // Do nothing here. Any error that was there would have been reported
         ;
       }
 
@@ -310,7 +326,7 @@
         // styles then apply based on the secondary pattern
         applyPattern = getSecondaryPattern();
       }
-      if ( applyPattern != null )
+      if (applyPattern != null)
         len = applyPattern.length() + 2;
       else
         len = 10;
@@ -330,15 +346,16 @@
 
     if (component instanceof ValueHolder)
     {
-      Object value = ((ValueHolder)component).getValue();
+      Object value = ((ValueHolder) component).getValue();
       if (value == null)
         return null;
 
-      if(value instanceof Date)
+      if (value instanceof Date)
       {
-        return (Date)value;
+        return (Date) value;
       }
-      GenericConverterFactory fac = GenericConverterFactory.getCurrentInstance();
+      GenericConverterFactory fac = GenericConverterFactory
+          .getCurrentInstance();
       if (fac.isConvertible(value, Date.class))
       {
         return (Date) fac.convert(value, Date.class);
@@ -348,16 +365,15 @@
   }
 
   /**
-   * Override to represent the id of the TimeZone used by DateFormat
-   * as GMT offset value so that we always format Date based on
-   * GMTOffsetTimeZone style (z) instead of using standard short or long
-   * TimeZone names of Java, since these names are not available in
-   * client side JavaScript.
+   * Override to represent the id of the TimeZone used by DateFormat as GMT
+   * offset value so that we always format Date based on GMTOffsetTimeZone style
+   * (z) instead of using standard short or long TimeZone names of Java, since
+   * these names are not available in client side JavaScript.
    */
   @Override
   protected TimeZone getFormattingTimeZone(TimeZone tZone)
   {
-    TimeZone zone = (TimeZone)tZone.clone();
+    TimeZone zone = (TimeZone) tZone.clone();
 
     // set the id as "GMT Sign Hours : Minutes"
     StringBuffer zoneId = new StringBuffer(9);
@@ -368,8 +384,7 @@
       zoneId.append(_GMT_MINUS);
       // abs value
       rawOffset = -rawOffset;
-    }
-    else
+    } else
     {
       zoneId.append(_GMT_PLUS);
     }
@@ -394,11 +409,7 @@
     return zone;
   }
 
-
-
-  protected String getJSPattern(
-    FacesContext context
-    )
+  protected String getJSPattern(FacesContext context)
   {
     String jsPattern = null;
     String datePattern = getPattern();
@@ -411,15 +422,13 @@
         DateFormat format = getDateFormat(context, datePattern);
         if ((format != null) && (format instanceof SimpleDateFormat))
         {
-          datePattern = ((SimpleDateFormat)format).toPattern();
-        }
-        else
+          datePattern = ((SimpleDateFormat) format).toPattern();
+        } else
         {
           // no pattern available
           datePattern = _NO_JS_PATTERN;
         }
-      }
-      catch(ConverterException ce)
+      } catch (ConverterException ce)
       {
         // Let us be lenient.. if pattern cannot be created
         datePattern = _NO_JS_PATTERN;
@@ -427,8 +436,8 @@
     }
     // If secondary pattern is available push that to the Client side, thus
     // being lenient.
-    if ( (datePattern == null || datePattern == _NO_JS_PATTERN)
-                                       && getSecondaryPattern() != null)
+    if ((datePattern == null || datePattern == _NO_JS_PATTERN)
+        && getSecondaryPattern() != null)
     {
       int length = getSecondaryPattern().length() * 2 + 2;
       StringBuffer outBuffer = new StringBuffer(length);
@@ -440,7 +449,7 @@
     {
       String secondaryPattern = getSecondaryPattern();
 
-      if (datePattern != _NO_JS_PATTERN  )
+      if (datePattern != _NO_JS_PATTERN)
       {
         int length = datePattern.length() * 2 + 2;
         if (secondaryPattern != null)
@@ -448,8 +457,7 @@
 
         StringBuffer outBuffer = new StringBuffer(length);
         jsPattern = _getEscapedPattern(outBuffer, datePattern, secondaryPattern);
-      }
-      else
+      } else
       {
         jsPattern = datePattern;
       }
@@ -457,22 +465,16 @@
     return jsPattern;
   }
 
-  //get the escaped form of the pattern
-  private static void _escapePattern(
-    StringBuffer buffer,
-    String pattern
-    )
+  // get the escaped form of the pattern
+  private static void _escapePattern(StringBuffer buffer, String pattern)
   {
     buffer.append('\'');
     XhtmlUtils.escapeJS(buffer, pattern);
     buffer.append('\'');
   }
 
-  private static String _getEscapedPattern(
-    StringBuffer buffer,
-    String pattern,
-    String secondaryPattern
-    )
+  private static String _getEscapedPattern(StringBuffer buffer, String pattern,
+      String secondaryPattern)
   {
     if (secondaryPattern != null)
       buffer.append('[');
@@ -503,16 +505,16 @@
     Locale dateTimeConverterLocale = getLocale();
     if (dateTimeConverterLocale != null)
     {
-      Locale defaultLocale =
-        RenderingContext.getCurrentInstance().getLocaleContext().
-           getFormattingLocale();
+      Locale defaultLocale = RenderingContext.getCurrentInstance()
+          .getLocaleContext().getFormattingLocale();
       return !dateTimeConverterLocale.equals(defaultLocale);
     }
 
     return false;
   }
 
-  private static final TrinidadLogger _LOG = TrinidadLogger.createTrinidadLogger(DateTimeConverter.class);
+  private static final TrinidadLogger _LOG = TrinidadLogger
+      .createTrinidadLogger(DateTimeConverter.class);
 
   // RenderingContext key indicating the _dateFormat object
   // has been created
@@ -522,9 +524,14 @@
   private static final String _NO_JS_PATTERN = new String();
 
   private static final String _GMT_PLUS = "GMT+";
+
   private static final String _GMT_MINUS = "GMT-";
+
   private static final int _MILLIS_PER_HOUR = 60 * 60 * 1000;
+
   private static final int _MILLIS_PER_MINUTE = 60 * 1000;
-  private static final Collection<String> _IMPORT_NAMES = Collections.singletonList("TrDateTimeConverter()" );
+
+  private static final Collection<String> _IMPORT_NAMES = Collections
+      .singletonList("TrDateTimeConverter()");
 
 }

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/DoubleConverter.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/DoubleConverter.java?view=diff&rev=476134&r1=476133&r2=476134
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/DoubleConverter.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/DoubleConverter.java Fri Nov 17 05:21:23 2006
@@ -76,7 +76,7 @@
     FacesContext context,
     UIComponent component)
   {
-    return ConverterUtils.getClientConversion(context,component,CONVERT_MESSAGE_ID);
+    return _getTrDoubleConverter(context, component);
   }
 
   public Collection<String> getClientImportNames()
@@ -89,6 +89,20 @@
   {
     return null;
   }
+  
+  private String _getTrDoubleConverter(
+      FacesContext context,
+      UIComponent component)
+    {
+      StringBuffer outBuffer = new StringBuffer(250);
+
+      outBuffer.append("new TrDoubleConverter(");
+      outBuffer.append("'");
+      outBuffer.append("null");
+      outBuffer.append("')");
+
+      return outBuffer.toString();
+    }
 
   private static final Collection<String> _IMPORT_NAMES = Collections.singletonList( "TrNumberConverter()" );
 

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/FloatConverter.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/FloatConverter.java?view=diff&rev=476134&r1=476133&r2=476134
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/FloatConverter.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/FloatConverter.java Fri Nov 17 05:21:23 2006
@@ -76,7 +76,7 @@
    FacesContext context,
    UIComponent component)
   {
-    return ConverterUtils.getClientConversion(context,component,CONVERT_MESSAGE_ID);
+    return _getTrFloatConverter(context, component);
   }
 
   public Collection<String> getClientImportNames()
@@ -88,7 +88,23 @@
    FacesContext context)
   {
     return null;
-  }  
+  }
+  
+  private String _getTrFloatConverter(
+      FacesContext context,
+      UIComponent component)
+    {
+      StringBuffer outBuffer = new StringBuffer(250);
+
+      outBuffer.append("new TrFloatConverter(");
+      outBuffer.append("'");
+      outBuffer.append("null");
+      outBuffer.append("')");
+
+      return outBuffer.toString();
+    }
+
+
 
   private static final Collection<String> _IMPORT_NAMES = Collections.singletonList( "TrNumberConverter()" );  
 }

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/IntegerConverter.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/IntegerConverter.java?view=diff&rev=476134&r1=476133&r2=476134
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/IntegerConverter.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/IntegerConverter.java Fri Nov 17 05:21:23 2006
@@ -26,7 +26,6 @@
 import org.apache.myfaces.trinidad.convert.ClientConverter;
 import org.apache.myfaces.trinidad.util.IntegerUtils;
 
-
 /**
  * <p>Implementation for <code>java.lang.Integer</code> values.</p>
  *
@@ -117,11 +116,7 @@
     FacesContext context,
     UIComponent component)
   {
-    return ConverterUtils.getClientConversion(context, component,
-                                              MAXIMUM_MESSAGE_ID,
-                                              MINIMUM_MESSAGE_ID,
-                                              CONVERT_MESSAGE_ID,
-                                              _INT_MAX, _INT_MIN);
+    return _getTrIntegerConverter(context, component, _INT_MAX, _INT_MIN);
   }
 
 
@@ -130,6 +125,24 @@
     return _IMPORT_NAMES;
   }
 
+  private static String _getTrIntegerConverter(
+      FacesContext context,
+      UIComponent component,
+      String maxVal,
+      String minVal)
+    {
+      StringBuffer outBuffer = new StringBuffer(250);
+
+      outBuffer.append("new TrIntegerConverter(");
+
+      outBuffer.append("null,null,0,");
+      outBuffer.append(maxVal);
+      outBuffer.append(',');
+      outBuffer.append(minVal);
+      outBuffer.append(")");
+
+      return outBuffer.toString();
+    }
 
   private static final String  _INT_MIN
     = IntegerUtils.getString(Integer.MIN_VALUE);

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/LongConverter.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/LongConverter.java?view=diff&rev=476134&r1=476133&r2=476134
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/LongConverter.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/LongConverter.java Fri Nov 17 05:21:23 2006
@@ -113,11 +113,7 @@
     FacesContext context,
     UIComponent component)
   {
-    return ConverterUtils.getClientConversion(context, component,
-                                              MAXIMUM_MESSAGE_ID,
-                                              MINIMUM_MESSAGE_ID,
-                                              CONVERT_MESSAGE_ID,
-                                              _LONG_MAX, _LONG_MIN);
+    return _getTrLongConverter(context, component, _LONG_MAX, _LONG_MIN);
   }
 
 
@@ -126,6 +122,24 @@
     return _IMPORT_NAMES;
   }
 
+  private static String _getTrLongConverter(
+      FacesContext context,
+      UIComponent component,
+      String maxVal,
+      String minVal)
+    {
+      StringBuffer outBuffer = new StringBuffer(250);
+
+      outBuffer.append("new TrLongConverter(");
+
+      outBuffer.append("null,null,0,");
+      outBuffer.append(maxVal);
+      outBuffer.append(',');
+      outBuffer.append(minVal);
+      outBuffer.append(")");
+
+      return outBuffer.toString();
+    }
 
   private static final String _LONG_MIN
     = IntegerUtils.getString(Long.MIN_VALUE);

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/ShortConverter.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/ShortConverter.java?view=diff&rev=476134&r1=476133&r2=476134
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/ShortConverter.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/ShortConverter.java Fri Nov 17 05:21:23 2006
@@ -107,11 +107,7 @@
     FacesContext context,
     UIComponent component)
   {
-    return ConverterUtils.getClientConversion(context, component,
-                                              MAXIMUM_MESSAGE_ID,
-                                              MINIMUM_MESSAGE_ID,
-                                              CONVERT_MESSAGE_ID,
-                                              _SHORT_MAX, _SHORT_MIN);
+    return _getTrShortConverter(context, component, _SHORT_MAX, _SHORT_MIN);
   }
   
   public String getClientLibrarySource(
@@ -124,6 +120,25 @@
   {
     return _IMPORT_NAMES;
   }
+  
+  private static String _getTrShortConverter(
+      FacesContext context,
+      UIComponent component,
+      String maxVal,
+      String minVal)
+    {
+      StringBuffer outBuffer = new StringBuffer(250);
+
+      outBuffer.append("new TrShortConverter(");
+
+      outBuffer.append("null,null,0,");
+      outBuffer.append(maxVal);
+      outBuffer.append(',');
+      outBuffer.append(minVal);
+      outBuffer.append(")");
+
+      return outBuffer.toString();
+    }
 
   private static final String _SHORT_MAX = Short.toString(Short.MAX_VALUE);
   private static final String _SHORT_MIN = Short.toString(Short.MIN_VALUE);

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/ByteLengthValidator.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/ByteLengthValidator.java?view=diff&rev=476134&r1=476133&r2=476134
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/ByteLengthValidator.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/ByteLengthValidator.java Fri Nov 17 05:21:23 2006
@@ -18,21 +18,16 @@
 
 import java.nio.charset.Charset;
 import java.nio.charset.IllegalCharsetNameException;
-
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.Set;
 
-import javax.faces.application.FacesMessage;
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
 
 import org.apache.myfaces.trinidad.logging.TrinidadLogger;
-import org.apache.myfaces.trinidad.util.MessageFactory;
-
 import org.apache.myfaces.trinidad.validator.ClientValidator;
-import org.apache.myfaces.trinidadinternal.ui.laf.base.xhtml.XhtmlLafUtils;
 
 /**
  * <p>Enables byte length validation at the client side. </p>
@@ -48,14 +43,12 @@
     super();
   }
 
-  
   public String getClientLibrarySource(
    FacesContext context)
   {
     return null;
   }
 
-
   /**
    * {@inheritDoc}
    */
@@ -109,17 +102,11 @@
       }
     }
 
-    FacesMessage message = _getEscapedJsMaximumMessage(context);
-    
     String maxLength = String.valueOf(getMaximum());
 
     constr.append(maxLength);
 
-    constr.append(",{LF:'");
-    constr.append(XhtmlLafUtils.escapeJS(message.getDetail()));
-    constr.append("',LFS:'");
-    constr.append(XhtmlLafUtils.escapeJS(message.getSummary()));
-    constr.append( "'})");
+    constr.append(")");
 
     return constr.toString();
   }
@@ -180,23 +167,6 @@
     return _UNSUPPORTED_TYPE;
   }
 
-  private FacesMessage _getEscapedJsMaximumMessage(
-    FacesContext context)
-  {
-    String maxMsgDetail = getMessageDetailMaximum();
-    String maxLength = String.valueOf(getMaximum());
-    String label = "{0}";    // this will get substituted on the client
-
-    Object[] params = new Object[] {label, "{1}", maxLength};
-
-    return  MessageFactory.getMessage(context,
-                                  ByteLengthValidator.MAXIMUM_MESSAGE_ID,
-                                  maxMsgDetail,
-                                  params);
-
-  }
-
-
   // Type where all characters are single byte
   static private final int _SINGLE_BYTE_TYPE = 0;
 
@@ -432,4 +402,4 @@
  private static final TrinidadLogger _LOG =  TrinidadLogger.createTrinidadLogger(ByteLengthValidator.class);
 
 
-}
+}
\ No newline at end of file

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/DateRestrictionValidator.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/DateRestrictionValidator.java?view=diff&rev=476134&r1=476133&r2=476134
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/DateRestrictionValidator.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/DateRestrictionValidator.java Fri Nov 17 05:21:23 2006
@@ -24,14 +24,11 @@
 import java.util.Map;
 
 import javax.faces.validator.ValidatorException;
-import javax.faces.application.FacesMessage;
 import javax.faces.context.FacesContext;
 import javax.faces.component.UIComponent;
 
-import org.apache.myfaces.trinidad.util.MessageFactory;
 import org.apache.myfaces.trinidad.validator.ClientValidator;
 import org.apache.myfaces.trinidadinternal.convert.GenericConverterFactory;
-import org.apache.myfaces.trinidadinternal.ui.laf.base.xhtml.XhtmlLafUtils;
 import org.apache.myfaces.trinidadinternal.util.JsonUtils;
 
 /**
@@ -107,7 +104,7 @@
       monthValues  = "null";
     }
 
-    return _getTrDateRestrictionValidator(context, component, WEEKDAY_MESSAGE_ID, MONTH_MESSAGE_ID, VALIDATOR_ID, weekdaysValues, monthValues);
+    return _getTrDateRestrictionValidator(context, component, weekdaysValues, monthValues);
   }
   
   
@@ -120,43 +117,11 @@
   private static String _getTrDateRestrictionValidator(
       FacesContext context,
       UIComponent component,
-      String weekId,
-      String monthId,
-      String defaultId,
       String weekdaysValues,
       String monthValues)
   {
-    StringBuffer outBuffer = new StringBuffer(250);
+    StringBuffer outBuffer = new StringBuffer();
     outBuffer.append("new TrDateRestrictionValidator(");
-
-    FacesMessage weekMessage =
-      MessageFactory.getMessage(context, weekId,
-                                  new Object[]{"{0}", "{1}", "{2}"});
-
-    outBuffer.append("{WV:'");
-    outBuffer.append(XhtmlLafUtils.escapeJS(weekMessage.getDetail()));
-
-    outBuffer.append("',WV_S:'");
-    outBuffer.append(XhtmlLafUtils.escapeJS(weekMessage.getSummary()));    
-
-    FacesMessage monthMessage =
-      MessageFactory.getMessage(context, monthId,
-                                  new Object[]{"{0}", "{1}", "{2}"});
-
-    outBuffer.append("',MV:'");
-    outBuffer.append(XhtmlLafUtils.escapeJS(monthMessage.getDetail()));
-    outBuffer.append("',MV_S:'");
-    outBuffer.append(XhtmlLafUtils.escapeJS(monthMessage.getSummary()));  
-    
-    FacesMessage defaultMessage =
-      MessageFactory.getMessage(context, defaultId,
-                                  new Object[]{"{0}", "{1}"});
-
-    outBuffer.append("',D:'");
-    outBuffer.append(XhtmlLafUtils.escapeJS(defaultMessage.getDetail())); 
-    outBuffer.append("',D_S:'");
-    outBuffer.append(XhtmlLafUtils.escapeJS(defaultMessage.getSummary()));
-    outBuffer.append("'},null,0,");
     outBuffer.append(weekdaysValues);
     outBuffer.append(',');
     outBuffer.append(monthValues);

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/DateTimeRangeValidator.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/DateTimeRangeValidator.java?view=diff&rev=476134&r1=476133&r2=476134
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/DateTimeRangeValidator.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/DateTimeRangeValidator.java Fri Nov 17 05:21:23 2006
@@ -18,12 +18,11 @@
 import java.util.Collections;
 import java.util.Date;
 
-import javax.faces.validator.ValidatorException;
-import javax.faces.context.FacesContext;
 import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.validator.ValidatorException;
 
 import org.apache.myfaces.trinidad.validator.ClientValidator;
-import org.apache.myfaces.trinidadinternal.convert.ConverterUtils;
 import org.apache.myfaces.trinidadinternal.convert.GenericConverterFactory;
 
 public class DateTimeRangeValidator extends org.apache.myfaces.trinidad.validator.DateTimeRangeValidator
@@ -77,11 +76,8 @@
     String maxStr = (max == null) ? null : Long.toString(max.getTime());
     String minStr = (min == null) ? null : Long.toString(min.getTime());
     
-    return  ConverterUtils.getClientValidation(context, component,
-                                               MAXIMUM_MESSAGE_ID,
-                                               MINIMUM_MESSAGE_ID,
-                                               org.apache.myfaces.trinidad.validator.DateTimeRangeValidator.VALIDATOR_ID,
-                                               maxStr, minStr, "TrDateTimeRangeValidator");
+    return _getTrDateTimeRangeValidator(context, component, maxStr, minStr);
+    
   }
   
   
@@ -90,6 +86,23 @@
   {
     return null;
   }
+  
+  private static String _getTrDateTimeRangeValidator(
+      FacesContext context,
+      UIComponent component,
+      String max,
+      String min)
+  {
+    StringBuffer outBuffer = new StringBuffer();
+    outBuffer.append("new TrDateTimeRangeValidator(");
+    outBuffer.append(max);
+    outBuffer.append(',');
+    outBuffer.append(min);
+    outBuffer.append(")");
+
+    return outBuffer.toString();
+  }
+
   
   private static final Collection<String> _IMPORT_NAMES = Collections.singletonList( "TrNumberConverter()" );
   

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/DoubleRangeValidator.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/DoubleRangeValidator.java?view=diff&rev=476134&r1=476133&r2=476134
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/DoubleRangeValidator.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/DoubleRangeValidator.java Fri Nov 17 05:21:23 2006
@@ -23,10 +23,6 @@
 import javax.faces.context.FacesContext;
 
 import org.apache.myfaces.trinidad.validator.ClientValidator;
-import org.apache.myfaces.trinidadinternal.convert.ConverterUtils;
-
-
-
 
 /**
  * <p>Implementation for <code>java.lang.Long</code> values.</p>
@@ -62,11 +58,7 @@
     String maxStr = Double.toString(getMaximum());
     String minStr = Double.toString(getMinimum());
     
-    return  ConverterUtils.getClientValidation(context, component,
-                                               MAXIMUM_MESSAGE_ID,
-                                               MINIMUM_MESSAGE_ID,
-                                               javax.faces.validator.DoubleRangeValidator.VALIDATOR_ID,
-                                               maxStr, minStr, "TrRangeValidator");
+    return  _getTrRangeValidator(context, component, maxStr, minStr);
   }
   
   
@@ -74,6 +66,22 @@
    FacesContext context)
   {
     return null;
+  }
+  
+  private static String _getTrRangeValidator(
+      FacesContext context,
+      UIComponent component,
+      String max,
+      String min)
+  {
+    StringBuffer outBuffer = new StringBuffer();
+    outBuffer.append("new TrRangeValidator(");
+    outBuffer.append(max);
+    outBuffer.append(',');
+    outBuffer.append(min);
+    outBuffer.append(")");
+
+    return outBuffer.toString();
   }
   
   private static final Collection<String> _IMPORT_NAMES = Collections.singletonList( "TrNumberConverter()" );

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/LengthValidator.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/LengthValidator.java?view=diff&rev=476134&r1=476133&r2=476134
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/LengthValidator.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/LengthValidator.java Fri Nov 17 05:21:23 2006
@@ -24,10 +24,6 @@
 
 import org.apache.myfaces.trinidad.util.IntegerUtils;
 import org.apache.myfaces.trinidad.validator.ClientValidator;
-import org.apache.myfaces.trinidadinternal.convert.ConverterUtils;
-
-
-
 
 /**
  * <p>Implementation for <code>java.lang.Long</code> values.</p>
@@ -61,20 +57,33 @@
   {
     String maxStr = IntegerUtils.getString(getMaximum());
     String minStr = IntegerUtils.getString(getMinimum());
-    return  ConverterUtils.getClientValidation(context, component,
-                                               MAXIMUM_MESSAGE_ID,
-                                               MINIMUM_MESSAGE_ID,
-                                               javax.faces.validator.LengthValidator.VALIDATOR_ID,
-                                               maxStr, minStr, "TrLengthValidator");
+    
+    return _getTrLengthValidator(context, component, maxStr, minStr);
+
   }
   
-  
   public String getClientLibrarySource(
    FacesContext context)
   {
     return null;
   }
   
+  private static String _getTrLengthValidator(
+      FacesContext context,
+      UIComponent component,
+      String max,
+      String min)
+  {
+    StringBuffer outBuffer = new StringBuffer();
+    outBuffer.append("new TrLengthValidator(");
+    outBuffer.append(max);
+    outBuffer.append(',');
+    outBuffer.append(min);
+    outBuffer.append(")");
+
+    return outBuffer.toString();
+  }
+
   private static final Collection<String> _IMPORT_NAMES = Collections.singletonList( "TrNumberConverter()" );
 
 }

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/LongRangeValidator.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/LongRangeValidator.java?view=diff&rev=476134&r1=476133&r2=476134
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/LongRangeValidator.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/LongRangeValidator.java Fri Nov 17 05:21:23 2006
@@ -24,10 +24,6 @@
 
 import org.apache.myfaces.trinidad.util.IntegerUtils;
 import org.apache.myfaces.trinidad.validator.ClientValidator;
-import org.apache.myfaces.trinidadinternal.convert.ConverterUtils;
-
-
-
 
 /**
  * <p>Implementation for <code>java.lang.Long</code> values.</p>
@@ -61,20 +57,33 @@
   {
     String maxStr = IntegerUtils.getString(getMaximum());
     String minStr = IntegerUtils.getString(getMinimum());
-    return  ConverterUtils.getClientValidation(context, component,
-                                               MAXIMUM_MESSAGE_ID,
-                                               MINIMUM_MESSAGE_ID,
-                                               javax.faces.validator.LongRangeValidator.VALIDATOR_ID,
-                                               maxStr, minStr, "TrRangeValidator");
+    
+    return _getTrRangeValidator(context, component, maxStr, minStr);
+
   }
   
-  
   public String getClientLibrarySource(
    FacesContext context)
   {
     return null;
   }
   
+  private static String _getTrRangeValidator(
+      FacesContext context,
+      UIComponent component,
+      String max,
+      String min)
+  {
+    StringBuffer outBuffer = new StringBuffer();
+    outBuffer.append("new TrRangeValidator(");
+    outBuffer.append(max);
+    outBuffer.append(',');
+    outBuffer.append(min);
+    outBuffer.append(")");
+
+    return outBuffer.toString();
+  }
+
   private static final Collection<String> _IMPORT_NAMES = Collections.singletonList( "TrNumberConverter()" );
 
 }

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/RegExpValidator.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/RegExpValidator.java?view=diff&rev=476134&r1=476133&r2=476134
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/RegExpValidator.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/RegExpValidator.java Fri Nov 17 05:21:23 2006
@@ -18,12 +18,9 @@
 import java.util.Collection;
 import java.util.Collections;
 
-import javax.faces.application.FacesMessage;
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
 
-import org.apache.myfaces.trinidad.util.MessageFactory;
-
 import org.apache.myfaces.trinidad.validator.ClientValidator;
 import org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.XhtmlUtils;
 
@@ -64,24 +61,12 @@
    
     String jsPattern = XhtmlUtils.escapeJS(getPattern());
     
-    FacesMessage message = _getNoMatchMessage(context);
-    String esNoMatchMsgPattern = XhtmlUtils.escapeJS(message.getDetail());
-    String esNoMatchMsgSummaryPattern = 
-                             XhtmlUtils.escapeJS(message.getSummary());
-
+    StringBuffer outBuffer = new StringBuffer(22
+                                              + jsPattern.length());
 
-    StringBuffer outBuffer = new StringBuffer(39
-                                              + jsPattern.length()
-                                              + esNoMatchMsgPattern.length()
-                                              + esNoMatchMsgSummaryPattern.length());
-
-    outBuffer.append("new TrRegExpValidator('"); // 22
+    outBuffer.append("new TrRegExpValidator("); // 21
     outBuffer.append(jsPattern);
-    outBuffer.append("',{NM:'");            //  7
-    outBuffer.append(esNoMatchMsgPattern);
-    outBuffer.append("',NMS:'");            //  7
-    outBuffer.append(esNoMatchMsgSummaryPattern);
-    outBuffer.append("'})");                // 3
+    outBuffer.append(")");                // 1
 
     return outBuffer.toString();
   }
@@ -97,18 +82,5 @@
     return null;
   }
 
-  private FacesMessage _getNoMatchMessage(
-    FacesContext context)
-  {
-    String noMatchMsg = getMessageDetailNoMatch(); 
-    Object[] params = new Object[] {"{0}", "{1}", "{2}"};
-
-    return MessageFactory.getMessage(context,
-                                  RegExpValidator.NO_MATCH_MESSAGE_ID,
-                                  noMatchMsg,
-                                  params);
-  }
-
-
   private static final Collection<String> _IMPORT_NAMES = Collections.singletonList( "TrRegExpValidator()" );     
-}
+}
\ No newline at end of file

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/CharSets.js
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/CharSets.js?view=diff&rev=476134&r1=476133&r2=476134
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/CharSets.js (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/CharSets.js Fri Nov 17 05:21:23 2006
@@ -15,29 +15,21 @@
  */
 
 function TrByteLengthValidator(
-  length,
-  messages
+  length
   )
 {
   this._length   = length;
-  this._messages = messages;
   this._class    = "TrByteLengthValidator";
 }
 
 TrByteLengthValidator.prototype = new TrValidator();
 
-//LFS - Length failed summary
-TrByteLengthValidator.prototype.LFS  = "LFS";
-//LF - Length failed
-TrByteLengthValidator.prototype.LF  = "LF";
-
 function CjkFormat(
-  length,
-  messages
+  length
   )
 {
   this._base = TrByteLengthValidator;
-  this._base(length, messages);
+  this._base(length);
   this._class = "CjkFormat";
   
 }
@@ -59,8 +51,7 @@
    
     if (length < 0)
     {
-      var facesMessage = _createFacesMessage( this._messages[this.LFS],
-                                              this._messages[this.LF],
+      var facesMessage = _createFacesMessage( "org.apache.myfaces.trinidad.validator.ByteLengthValidator.MAXIMUM",
                                               label,
                                               parseString);   
       throw new TrValidatorException(facesMessage);     
@@ -76,12 +67,11 @@
 
 
 function Utf8Format(
-  length,
-  messages
+  length
   )
 {
   this._base = TrByteLengthValidator;
-  this._base(length, messages);
+  this._base(length);
   this._class = "Utf8Format";
 }
 
@@ -111,8 +101,7 @@
 
     if (length < 0)
     {
-      var facesMessage = _createFacesMessage( this._messages[this.LFS],
-                                              this._messages[this.LF],
+      var facesMessage = _createFacesMessage( "org.apache.myfaces.trinidad.validator.ByteLengthValidator.MAXIMUM",
                                               label,
                                               parseString);   
       throw new TrValidatorException(facesMessage);              
@@ -125,12 +114,11 @@
 }
 
 function SBFormat(
-  length,
-  messages
+  length
   )
 {
   this._base = TrByteLengthValidator;
-  this._base(length, messages);
+  this._base(length);
   this._class = "SBFormat";
   
 }
@@ -144,10 +132,9 @@
 {
   if (this._length < parseString.length)
   {
-    var facesMessage = _createFacesMessage( this._messages[this.LFS],
-                                            this._messages[this.LF],
-                                            label,
-                                            parseString);   
+    var facesMessage = _createFacesMessage( "org.apache.myfaces.trinidad.validator.ByteLengthValidator.MAXIMUM",
+                                              label,
+                                              parseString);   
     throw new TrValidatorException(facesMessage);      
   }
 

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/ColorFormat.js
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/ColorFormat.js?view=diff&rev=476134&r1=476133&r2=476134
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/ColorFormat.js (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/ColorFormat.js Fri Nov 17 05:21:23 2006
@@ -20,16 +20,16 @@
 function TrColorConverter(
   pattern,
   allowsTransparent,
-  msg_summary,
-  msg_detail,
-  patternsString)
+  patternsString,
+  summary,
+  detail)
 {
   // for debugging
   this._class = "TrColorConverter";
   this._allowsTransparent = allowsTransparent;  
-  this._msg_summary = msg_summary; 
-  this._msg_detail = msg_detail;
   this._patternsString = patternsString;     
+  this._summary = summary;
+  this._detail = detail;
   
   if (pattern != null)
   {
@@ -89,11 +89,24 @@
   if (this._allowsTransparent && _cfTrans == parseString)
     return new TrColor(0,0,0,0);
      
-  var facesMessage = _createFacesMessage( this._msg_summary,
-                                          this._msg_detail,
-                                          label,
-                                          parseString,
-                                          this._patternsString);
+  var facesMessage;
+  
+  if(this._summary == undefined)
+  {
+    facesMessage = _createFacesMessage("org.apache.myfaces.trinidad.convert.ColorConverter.CONVERT",
+                                            label,
+                                            parseString,
+                                            this._patternsString);
+  }
+  else
+  {
+    facesMessage = _createCustomFacesMessage(this._summary,
+                                            this._detail,
+                                            label,
+                                            parseString,
+                                            this._patternsString);
+  }
+  
   
   var pattern = this._pattern;                                       
   if (typeof pattern == "string")

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/Core.js
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/Core.js?view=diff&rev=476134&r1=476133&r2=476134
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/Core.js (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/Core.js Fri Nov 17 05:21:23 2006
@@ -2538,6 +2538,34 @@
  * {3} - extra param
  */
 function _createFacesMessage(
+  key,
+  label,
+  value,
+  param2,  
+  param3
+)
+{  
+  var summary = TrMessageFactory.getSummaryString(key);
+  var detail = TrMessageFactory.getDetailString(key);
+  // format the detail error string
+  if (detail != null)
+  {
+    detail = TrFastMessageFormatUtils.format(detail, label, value, param2, param3);
+  }
+  return new TrFacesMessage(summary, 
+                          detail, 
+                          TrFacesMessage.SEVERITY_ERROR);
+}
+
+/**
+ * Used for the converters and validators we provide which all have the form
+ *
+ * {0} - label
+ * {1} - string value
+ * {2} - extra param
+ * {3} - extra param
+ */
+function _createCustomFacesMessage(
   summary,
   detail,
   label,
@@ -2557,6 +2585,7 @@
                           detail, 
                           TrFacesMessage.SEVERITY_ERROR);
 }
+
 
 function _getGlobalErrorString(
   input,

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/CoreFormat.js
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/CoreFormat.js?view=diff&rev=476134&r1=476133&r2=476134
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/CoreFormat.js (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/CoreFormat.js Fri Nov 17 05:21:23 2006
@@ -14,27 +14,27 @@
  * limitations under the License.
  */
 
-function TrNumberConverter(
-  messages,
+function TrIntegerConverter(
+  message,
   maxPrecision,
   maxScale,
   maxValue,
   minValue)
 {
-  this._messages = messages;
+  this._message = message;
   this._maxPrecision = maxPrecision;
   this._maxScale = maxScale;
   this._maxValue = maxValue;
   this._minValue = minValue;
 
   // for debugging
-  this._class = "TrNumberConverter";
+  this._class = "TrIntegerConverter";
 }
 
-TrNumberConverter.prototype = new TrConverter();
+TrIntegerConverter.prototype = new TrConverter();
 
 
-TrNumberConverter.prototype.getAsString = function(
+TrIntegerConverter.prototype.getAsString = function(
   number,
   label
   )
@@ -42,48 +42,240 @@
   return "" + number;
 }
 
-TrNumberConverter.prototype.getAsObject = function(
+TrIntegerConverter.prototype.getAsObject = function(
   numberString,
   label
   )
 {
   return _decimalParse(numberString, 
-                       this._messages,
+                       this._message,
+                       "org.apache.myfaces.trinidad.convert.IntegerConverter",
                        this._maxPrecision,
                        this._maxScale,
                        this._maxValue,
                        this._minValue,
                        label);
 }
+function TrLongConverter(
+  message,
+  maxPrecision,
+  maxScale,
+  maxValue,
+  minValue)
+{
+  this._message = message;
+  this._maxPrecision = maxPrecision;
+  this._maxScale = maxScale;
+  this._maxValue = maxValue;
+  this._minValue = minValue;
 
+  // for debugging
+  this._class = "TrLongConverter";
+}
 
+TrLongConverter.prototype = new TrConverter();
 
-// Less fraction digits
-TrNumberConverter.LFD = 'LFD';
-// Less integer digits
-TrNumberConverter.LID = 'LID';
-// Less value
-TrNumberConverter.LV  = 'LV';
-// More value
-TrNumberConverter.MV  = 'MV';
-// default
-TrNumberConverter.D   = 'D';
 
+TrLongConverter.prototype.getAsString = function(
+  number,
+  label
+  )
+{
+  return "" + number;
+}
 
-function TrRangeValidator(
-  messages,
+TrLongConverter.prototype.getAsObject = function(
+  numberString,
+  label
+  )
+{
+  return _decimalParse(numberString, 
+                       this._message,
+                       "org.apache.myfaces.trinidad.convert.LongConverter",
+                       this._maxPrecision,
+                       this._maxScale,
+                       this._maxValue,
+                       this._minValue,
+                       label);
+}
+function TrShortConverter(
+  message,
+  maxPrecision,
+  maxScale,
+  maxValue,
+  minValue)
+{
+  this._message = message;
+  this._maxPrecision = maxPrecision;
+  this._maxScale = maxScale;
+  this._maxValue = maxValue;
+  this._minValue = minValue;
+
+  // for debugging
+  this._class = "TrShortConverter";
+}
+
+TrShortConverter.prototype = new TrConverter();
+
+
+TrShortConverter.prototype.getAsString = function(
+  number,
+  label
+  )
+{
+  return "" + number;
+}
+
+TrShortConverter.prototype.getAsObject = function(
+  numberString,
+  label
+  )
+{
+  return _decimalParse(numberString, 
+                       this._message,
+                       "org.apache.myfaces.trinidad.convert.ShortConverter",
+                       this._maxPrecision,
+                       this._maxScale,
+                       this._maxValue,
+                       this._minValue,
+                       label);
+}
+function TrByteConverter(
+  message,
+  maxPrecision,
+  maxScale,
+  maxValue,
+  minValue)
+{
+  this._message = message;
+  this._maxPrecision = maxPrecision;
+  this._maxScale = maxScale;
+  this._maxValue = maxValue;
+  this._minValue = minValue;
+
+  // for debugging
+  this._class = "TrByteConverter";
+}
+
+TrByteConverter.prototype = new TrConverter();
+
+
+TrByteConverter.prototype.getAsString = function(
+  number,
+  label
+  )
+{
+  return "" + number;
+}
+
+TrByteConverter.prototype.getAsObject = function(
+  numberString,
+  label
+  )
+{
+  return _decimalParse(numberString, 
+                       this._message,
+                       "org.apache.myfaces.trinidad.convert.ByteConverter",
+                       this._maxPrecision,
+                       this._maxScale,
+                       this._maxValue,
+                       this._minValue,
+                       label);
+}
+
+function TrDoubleConverter(
+  message,
   maxPrecision,
   maxScale,
   maxValue,
   minValue)
 {
-  this._messages = messages;
+  this._message = message;
   this._maxPrecision = maxPrecision;
   this._maxScale = maxScale;
   this._maxValue = maxValue;
   this._minValue = minValue;
 
   // for debugging
+  this._class = "TrDoubleConverter";
+}
+
+TrDoubleConverter.prototype = new TrConverter();
+
+
+TrDoubleConverter.prototype.getAsString = function(
+  number,
+  label
+  )
+{
+  return "" + number;
+}
+
+TrDoubleConverter.prototype.getAsObject = function(
+  numberString,
+  label
+  )
+{
+  return _decimalParse(numberString, 
+                       this._message,
+                       "org.apache.myfaces.trinidad.convert.DoubleConverter",
+                       this._maxPrecision,
+                       this._maxScale,
+                       this._maxValue,
+                       this._minValue,
+                       label);
+}
+function TrFloatConverter(
+  message,
+  maxPrecision,
+  maxScale,
+  maxValue,
+  minValue)
+{
+  this._message = message;
+  this._maxPrecision = maxPrecision;
+  this._maxScale = maxScale;
+  this._maxValue = maxValue;
+  this._minValue = minValue;
+
+  // for debugging
+  this._class = "TrFloatConverter";
+}
+
+TrFloatConverter.prototype = new TrConverter();
+
+TrFloatConverter.prototype.getAsString = function(
+  number,
+  label
+  )
+{
+  return "" + number;
+}
+
+TrFloatConverter.prototype.getAsObject = function(
+  numberString,
+  label
+  )
+{
+  return _decimalParse(numberString, 
+                       this._message,
+                       "org.apache.myfaces.trinidad.convert.FloatConverter",
+                       this._maxPrecision,
+                       this._maxScale,
+                       this._maxValue,
+                       this._minValue,
+                       label);
+}
+
+
+function TrRangeValidator(
+  maxValue,
+  minValue)
+{
+  this._maxValue = maxValue;
+  this._minValue = minValue;
+
+  // for debugging
   this._class = "TrRangeValidator";
 }
 
@@ -104,33 +296,27 @@
   {
     if(numberValue>this._maxValue)
     {
-      facesMessage = _createFacesMessage(this._messages[(TrNumberConverter.LV+ '_S')],
-                                       this._messages[TrNumberConverter.LV],
+      facesMessage = _createFacesMessage("org.apache.myfaces.trinidad.validator.LongRangeValidator.MAXIMUM",
                                         label,
-                                        string);
+                                        string,
+                                        ""+this._maxValue);
     }
     else
     {
-      facesMessage = _createFacesMessage(this._messages[(TrNumberConverter.MV+ '_S')],
-                                       this._messages[TrNumberConverter.MV],
+      facesMessage = _createFacesMessage("org.apache.myfaces.trinidad.validator.LongRangeValidator.MINIMUM",
                                         label,
-                                        string);
+                                        string,
+                                        ""+this._minValue);
     }
     throw new TrConverterException(facesMessage);
   }
 }
 
 function TrLengthValidator(
-  messages,
-  maxPrecision,
-  maxScale,
   maxValue,
   minValue)
 {
  
-  this._messages = messages;
-  this._maxPrecision = maxPrecision;
-  this._maxScale = maxScale;
   this._maxValue = maxValue;
   this._minValue = minValue;
 
@@ -154,25 +340,20 @@
   }
   else
   {
-    facesMessage = _createFacesMessage(this._messages[(TrNumberConverter.D+ '_S')],
-                                       this._messages[TrNumberConverter.D],
+    facesMessage = _createFacesMessage("org.apache.myfaces.trinidad.validator.LengthValidator.NOT_IN_RANGE",
                                         label,
-                                        string);
+                                        string,
+                                        ""+this._minValue,
+                                        ""+this._maxValue);
     throw new TrConverterException(facesMessage);
   }
 }
 
 function TrDateTimeRangeValidator(
-  messages,
-  maxPrecision,
-  maxScale,
   maxValue,
   minValue)
 {
  
-  this._messages = messages;
-  this._maxPrecision = maxPrecision;
-  this._maxScale = maxScale;
   this._maxValue = maxValue;
   this._minValue = minValue;
 
@@ -196,27 +377,22 @@
   }
   else
   {
-    facesMessage = _createFacesMessage(this._messages[(TrNumberConverter.D+ '_S')],
-                                       this._messages[TrNumberConverter.D],
+    facesMessage = _createFacesMessage("org.apache.myfaces.trinidad.validator.DateTimeRangeValidator.NOT_IN_RANGE",
                                         label,
-                                        ""+value);
+                                        ""+value,
+                                        ""+new Date(this._minValue),
+                                        ""+new Date(this._maxValue));
     throw new TrConverterException(facesMessage);
   }
   
 }
 
 function TrDateRestrictionValidator(
-  messages,
-  maxPrecision,
-  maxScale,
   weekdaysValue,
   monthValue,
   weekdaysMap,
   monthMap)
 {
-  this._messages = messages;
-  this._maxPrecision = maxPrecision;
-  this._maxScale = maxScale;
   this._weekdaysValue = weekdaysValue;
   this._monthValue = monthValue;
   this._weekdaysMap = weekdaysMap;
@@ -226,20 +402,12 @@
   this._class = "TrDateRestrictionValidator";
 }
 
-// weekday value
-TrDateRestrictionValidator.WV = 'WV';
-// month value
-TrDateRestrictionValidator.MV  = 'MV';
-// default
-TrDateRestrictionValidator.D   = 'D';
-
 TrDateRestrictionValidator.prototype = new TrValidator();
 TrDateRestrictionValidator.prototype.validate  = function(
   value,
   label
 )
 {
-
   submittedDay = value.getDay();
   weekDaysArray = eval(this._weekdaysValue);
   if(weekDaysArray)
@@ -249,8 +417,7 @@
   	{
   		if(weekDaysArray[i].toLowerCase() == dayString)
   		{
-        facesMessage = _createFacesMessage(this._messages[(TrDateRestrictionValidator.WV+ '_S')],
-                                       this._messages[TrDateRestrictionValidator.WV],
+        facesMessage = _createFacesMessage("org.apache.myfaces.trinidad.validator.DateRestrictionValidator.WEEKDAY",
                                         label,
                                         ""+value,
                                         dayString);
@@ -268,8 +435,7 @@
   	{
   		if(monthArray[i].toLowerCase() == monthString)
   		{
-        facesMessage = _createFacesMessage(this._messages[(TrDateRestrictionValidator.MV+ '_S')],
-                                       this._messages[TrDateRestrictionValidator.MV],
+        facesMessage = _createFacesMessage("org.apache.myfaces.trinidad.validator.DateRestrictionValidator.MONTH",
                                         label,
                                         ""+value,
                                         monthString);
@@ -282,9 +448,8 @@
 
 function _decimalParse(
   numberString,
-  messages,
-  maxPrecision,
-  maxScale,
+  message,
+  standardKey,
   maxValue,
   minValue,
   label
@@ -312,10 +477,24 @@
     if ((numberString.indexOf(grouping) == 0) ||
         (numberString.lastIndexOf(grouping) ==  (numberString.length - 1)))
     {
-      facesMessage =  _createFacesMessage( messages[(TrNumberConverter.D+ '_S')],
-                                        messages[TrNumberConverter.D],
-                                        label,
-                                        numberString);
+      if(message == null)
+      {
+        facesMessage =  _createFacesMessage( standardKey+".CONVERT",
+                                          label,
+                                          numberString);
+      }
+      else
+      { 
+        facesMessage =  _createFacesMessage( standardKey+".CONVERT",
+                                          label,
+                                          numberString);
+        //var summary = "";
+        //var detail = "";
+        //facesMessage =  _createCustomMessage( summary,
+                                          //detail,
+                                          //label,
+                                          //numberString);
+      }
       throw new TrConverterException(facesMessage);
     }
 
@@ -351,26 +530,16 @@
       }
       
       var messageKey;
+      //not true for float/double converter
       if ((maxValue != null) &&
           (result  > maxValue))
       {
-        messageKey = TrNumberConverter.LV;
+        messageKey = standardKey+".MAXIMUM";
       }
       else if ((minValue != null) &&
                (result  < minValue))
       {
-        messageKey = TrNumberConverter.MV;
-      }
-      else if ((maxPrecision != null) &&
-               (integerDigits  > maxPrecision))
-      {
-        messageKey = TrNumberConverter.LID;
-      }
-
-      else if ((maxScale != null) &&
-               (fractionDigits  > maxScale))
-      {
-        messageKey = TrNumberConverter.LFD;
+        messageKey = standardKey+".MINIMUM";
       }
 
       if (messageKey != null)
@@ -381,8 +550,7 @@
           throw  new TrConverterException(null, null, "Conversion failed, but no appropriate message found");  // default error format
         else
         {
-          facesMessage =  _createFacesMessage( messages[(messageKey + '_S')],
-                                      messages[messageKey],
+          facesMessage =  _createFacesMessage( messageKey,
                                       label,
                                       numberString);
           throw new TrConverterException(facesMessage);
@@ -392,28 +560,20 @@
     }
   }
 
-  facesMessage = _createFacesMessage( messages[(TrNumberConverter.D+ '_S')],
-                                        messages[TrNumberConverter.D],
+  facesMessage = _createFacesMessage( standardKey+".CONVERT",
                                         label,
                                         numberString);
   throw new TrConverterException(facesMessage);
 }
 
 function TrRegExpValidator(
-  pattern,
-  messages
+  pattern
   )
 {  
   this._pattern  = pattern;
-  this._messages = messages;
   this._class = "TrRegExpValidator";
 }
 
-// no match pattern
-TrRegExpValidator.NM = 'NM';
-// no match pattern summary
-TrRegExpValidator.NMS = 'NMS';
-
 TrRegExpValidator.prototype = new TrValidator();
 TrRegExpValidator.prototype.validate  = function(
   parseString,
@@ -432,8 +592,7 @@
   }
   else
   {    
-    var facesMessage = _createFacesMessage( this._messages[TrRegExpValidator.NMS],
-                                            this._messages[TrRegExpValidator.NM],
+    var facesMessage = _createFacesMessage( "org.apache.myfaces.trinidad.validator.RegExpValidator.NO_MATCH",
                                             label,
                                             parseString,
                                             this._pattern);                                          

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/DateFormat.js
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/DateFormat.js?view=diff&rev=476134&r1=476133&r2=476134
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/DateFormat.js (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/DateFormat.js Fri Nov 17 05:21:23 2006
@@ -1019,18 +1019,19 @@
 function TrDateTimeConverter(
   pattern,  
   locale,
-  msg_summary,
-  msg_detail,
-  exampleString
+  exampleString,
+  key,
+  summary,
+  detail
   )
 {
 
   // for debugging
   this._class = "TrDateTimeConverter";
-  this._msg_summary = msg_summary;
-  this._msg_detail = msg_detail;
   this._exampleString = exampleString;
-  
+  this._key = key;
+  this._summary = summary;
+  this._detail = detail;
   
   // save the Locale elements for the specified locale, or client locale
   // if no locale is specified
@@ -1089,11 +1090,22 @@
 
   var pattern = this._pattern;
   
-  var facesMessage = _createFacesMessage( this._msg_summary,
-                                          this._msg_detail,
+  var facesMessage;
+  if(this._key != "null")
+  {
+    facesMessage = _createFacesMessage( this._key,
+                                          label,
+                                          parseString,
+                                          this._exampleString);
+  }
+  else
+  {
+    facesMessage = _createCustomFacesMessage( this._summary,
+                                          this._detail,
                                           label,
                                           parseString,
-                                          this._exampleString);                                      
+                                          this._exampleString);
+  }
   if (typeof pattern == "string")
   {
     return this._simpleDateParseImpl(parseString,



Mime
View raw message