incubator-adffaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mat...@apache.org
Subject svn commit: r449926 - in /incubator/adffaces/trunk/trinidad: src/site/xdoc/devguide/ trinidad-demo/src/main/webapp/jsLibs/ trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/
Date Tue, 26 Sep 2006 06:25:57 GMT
Author: matzew
Date: Mon Sep 25 23:25:55 2006
New Revision: 449926

URL: http://svn.apache.org/viewvc?view=rev&rev=449926
Log:
namespacing for client javascript. ADFFACES-168. Thx to Gabrielle Crawford

Modified:
    incubator/adffaces/trunk/trinidad/src/site/xdoc/devguide/clientValidation.xml
    incubator/adffaces/trunk/trinidad/trinidad-demo/src/main/webapp/jsLibs/passwordValidator.js
    incubator/adffaces/trunk/trinidad/trinidad-demo/src/main/webapp/jsLibs/ssnConverter.js
    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
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/Locale.js

Modified: incubator/adffaces/trunk/trinidad/src/site/xdoc/devguide/clientValidation.xml
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/src/site/xdoc/devguide/clientValidation.xml?view=diff&rev=449926&r1=449925&r2=449926
==============================================================================
--- incubator/adffaces/trunk/trinidad/src/site/xdoc/devguide/clientValidation.xml (original)
+++ incubator/adffaces/trunk/trinidad/src/site/xdoc/devguide/clientValidation.xml Mon Sep
25 23:25:55 2006
@@ -18,10 +18,10 @@
 
     <section name="Introduction">
       <P>
-      One of the benefits of Apache Trinidad is that it supports client-side versions of
converters and validators. This means that errors can be caught on the client and a round
trip avoided. This chapter will explain how a developer can write their own converters and
validators in such a way to take advantage of this feature. This chapter assumes knowledge
of JSF converters and validators, so please make sure you understand how they work before
continuing.
+      One of the benefits of Apache Trinidad is that it supports client-side versions of
converters and validators. This means that errors can be caught on the client and a round
trip avoided. This chapter will explain how a developer can write their own converters and
validators in such a way to take advantage of this feature. This chapter assumes knowledge
of JSF converters and validators, so please make sure you understand how they work before
continuing. Also note that javascript objects in Trinidad are prefixed with "Tr" in order
to avoid name collisions.
       </P>
       <p>
-      The basic idea of Apache Trinidad client conversion and validation is that it works
on the client in a very similar way to how it works on the server, except the language on
the client is javascript instead of java. There are javascript Converter objects that support
the methods getAsString() and getAsObject(). A Converter can throw a ConverterException. There
are javascript Validator objects that support the validate() method. A Validator can throw
a ValidatorException. 
+      The basic idea of Apache Trinidad client conversion and validation is that it works
on the client in a very similar way to how it works on the server, except the language on
the client is javascript instead of java. There are javascript converter objects that support
the methods getAsString() and getAsObject(). A TrConverter can throw a TrConverterException.
There are javascript validator objects that support the validate() method. A TrValidator can
throw a TrValidatorException. 
       </p>
     </section>
 
@@ -37,7 +37,7 @@
  * as the context and component are not passed to the getAsString or getAsObject method 
  *
  */
-function Converter()
+function TrConverter()
 {
 }
 
@@ -48,7 +48,7 @@
  * @param value Model object value to be converted 
  * @param label label to identify the editableValueHolder to the user 
  */
-Converter.prototype.getAsString = function(value, label){}
+TrConverter.prototype.getAsString = function(value, label){}
 
 /**
  * Convert the specified string value into a model data object 
@@ -57,10 +57,10 @@
  * @param value String value to be converted 
  * @param label label to identify the editableValueHolder to the user 
  */
-Converter.prototype.getAsObject = function(value, label){}
+TrConverter.prototype.getAsObject = function(value, label){}
 
 </source>
-Converters can throw a ConverterException, which should contain a facesMessage. Here is the
signature for FacesMessage:
+TrConverters can throw a TrConverterException, which should contain a TrFacesMessage. Here
is the signature for TrFacesMessage:
 <source>
 /**
  * Message similar to javax.faces.application.FacesMessage
@@ -72,23 +72,23 @@
  *                   SEVERITY_FATAL from the FacesMessage class.  Default is
  *                   SEVERITY_INFO
  */
-function FacesMessage(
+function TrFacesMessage(
   summary,
   detail,
   severity
   )
 </source>
-Here is the signature for ConverterException:
+Here is the signature for TrConverterException:
 <source>
 /** 
- * ConverterException is an exception thrown by the getAsObject() or getAsString() 
+ * TrConverterException is an exception thrown by the getAsObject() or getAsString() 
  * method of a Converter, to indicate that the requested conversion cannot be performed.
  *
- * @param facesMessage the FacesMessage associated with this exception
+ * @param facesMessage the TrFacesMessage associated with this exception
  * @param summary Localized summary message text, used to create only if facesMessage is
null
  * @param detail Localized detail message text, used only if facesMessage is null
  */
-function ConverterException(
+function TrConverterException(
   facesMessage, 
   summary,
   detail
@@ -100,7 +100,7 @@
 
 <source>
 /**
- * FastMessageFormatUtils is a greatly reduced version
+ * TrFastMessageFormatUtils is a greatly reduced version
  * of the java.text.MessageFormat class, but delivered as a utility. 
  * &lt;p&gt;
  * The only syntax supported by this class is simple index-based
@@ -117,7 +117,7 @@
  *     some'{'text{0}
  * &lt;/pre&gt;
  */
-function FastMessageFormatUtils()
+function TrFastMessageFormatUtils()
 
  /**
   * Formats the given array of strings based on the initial
@@ -126,7 +126,7 @@
   * @param {any...:undefined} Varargs objects to substitute for positional parameters.
   * Each parameter will be converted to a String and substituted into the format.
   */
-FastMessageFormatUtils.format = function(
+TrFastMessageFormatUtils.format = function(
   formatString, // error format string with embedded indexes to be replaced
   parameters    // {any...:undefined} Varargs objects to substitute for positional parameters.
   )
@@ -170,20 +170,20 @@
           var detail = this._messages[messageKey];
           if (detail != null)
           {
-            detail = FastMessageFormatUtils.format(detail, label, value);
+            detail = TrFastMessageFormatUtils.format(detail, label, value);
           }
         
-          var facesMessage = new FacesMessage(
+          var facesMessage = new TrFacesMessage(
                               this._messages[SSNConverter.SUMMARY],
                               detail,
-                              FacesMessage.SEVERITY_ERROR)
-         throw new ConverterException(facesMessage);
+                              TrFacesMessage.SEVERITY_ERROR)
+         throw new TrConverterException(facesMessage);
        }
        return null;
       }
       function SSNConverter(messages)
         {this._messages = messages;}
-      SSNConverter.prototype = new Converter();
+      SSNConverter.prototype = new TrConverter();
       SSNConverter.prototype.getAsString = ssnGetAsString;
       SSNConverter.prototype.getAsObject = ssnGetAsObject;
       SSNConverter.SUMMARY = 'SUM';
@@ -295,7 +295,7 @@
     
     <section name="Client-side Validators">
       <P> 
-      The general idea of writing client validators is almost exactly the same as writing
client converters. Let's say you've written a javax.faces.validator.Validator implementation
and now you want to add client-side validation. The first thing to do is write a version of
the validator in javascript. Here is the javascript code for the Validator "interface".
+      The general idea of writing client validators is almost exactly the same as writing
client converters. Let's say you've written a javax.faces.validator.Validator implementation
and now you want to add client-side validation. The first thing to do is write a version of
the validator in javascript. Here is the javascript code for the TrValidator "interface".
       <source>
 /**
  * Validator "interface" similar to javax.faces.validator.Validator,
@@ -303,7 +303,7 @@
  * as the context and component are not passed to the validate method 
  *
  */
-function Validator()
+function TrValidator()
 
 /**
  * Perform the correctness checks implemented by this Validator. 
@@ -312,20 +312,20 @@
  * @param value value to be validated 
  * @param label label to identify the editableValueHolder to the user
  */
-Validator.prototype.validate = function(value, label){}
+TrValidator.prototype.validate = function(value, label){}
       </source>
       
-      The validator can throw javascript ValidatorException objects:
+      The validator can throw javascript TrValidatorException objects:
 <source>      
 /**
- * A ValidatorException is an exception thrown by the validate() method of 
+ * A TrValidatorException is an exception thrown by the validate() method of 
  * a Validator to indicate that validation failed.
  *
  * @param facesMessage the FacesMessage associated with this exception
  * @param summary Localized summary message text, used only if facesMessage is null
  * @param detail Localized detail message text, used only if facesMessage is null
  */
-function ValidatorException(
+function TrValidatorException(
   facesMessage,
   summary, 
   detail

Modified: incubator/adffaces/trunk/trinidad/trinidad-demo/src/main/webapp/jsLibs/passwordValidator.js
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-demo/src/main/webapp/jsLibs/passwordValidator.js?view=diff&rev=449926&r1=449925&r2=449926
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-demo/src/main/webapp/jsLibs/passwordValidator.js
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-demo/src/main/webapp/jsLibs/passwordValidator.js
Mon Sep 25 23:25:55 2006
@@ -37,11 +37,11 @@
   
   if (hasNumber == false)
   {
-    var facesMessage = new FacesMessage(
+    var facesMessage = new TrFacesMessage(
                         this._messages[PasswordValidator.NUMBER_SUMMARY],
                         this._messages[PasswordValidator.NUMBER_DETAIL],
-                        FacesMessage.SEVERITY_ERROR)
-    throw new ValidatorException(facesMessage);
+                        TrFacesMessage.SEVERITY_ERROR)
+    throw new TrValidatorException(facesMessage);
   }
     
   return null;
@@ -49,7 +49,7 @@
 
 function PasswordValidator(messages)
   {this._messages = messages;}
-PasswordValidator.prototype = new Validator();
+PasswordValidator.prototype = new TrValidator();
 PasswordValidator.prototype.validate = passwordValidate;
 PasswordValidator.NUMBER_DETAIL = 'ND'; 
 PasswordValidator.NUMBER_SUMMARY = 'NS'; 

Modified: incubator/adffaces/trunk/trinidad/trinidad-demo/src/main/webapp/jsLibs/ssnConverter.js
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-demo/src/main/webapp/jsLibs/ssnConverter.js?view=diff&rev=449926&r1=449925&r2=449926
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-demo/src/main/webapp/jsLibs/ssnConverter.js
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-demo/src/main/webapp/jsLibs/ssnConverter.js
Mon Sep 25 23:25:55 2006
@@ -46,20 +46,20 @@
     var detail = this._messages[messageKey];
     if (detail != null)
     {
-      detail = FastMessageFormatUtils.format(detail, label, value);
+      detail = TrFastMessageFormatUtils.format(detail, label, value);
     }
   
-    var facesMessage = new FacesMessage(
+    var facesMessage = new TrFacesMessage(
                         this._messages[SSNConverter.SUMMARY],
                         detail,
-                        FacesMessage.SEVERITY_ERROR)
-   throw new ConverterException(facesMessage);
+                        TrFacesMessage.SEVERITY_ERROR)
+   throw new TrConverterException(facesMessage);
  }
  return null;
 }
 function SSNConverter(messages)
   {this._messages = messages;}
-SSNConverter.prototype = new Converter();
+SSNConverter.prototype = new TrConverter();
 SSNConverter.prototype.getAsString = ssnGetAsString;
 SSNConverter.prototype.getAsObject = ssnGetAsObject;
 SSNConverter.SUMMARY = 'SUM';

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=449926&r1=449925&r2=449926
==============================================================================
--- 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
Mon Sep 25 23:25:55 2006
@@ -28,7 +28,7 @@
   this._class    = "EncodingFormat";
 }
 
-EncodingFormat.prototype = new Validator();
+EncodingFormat.prototype = new TrValidator();
 
 //LFS - Length failed summary
 EncodingFormat.prototype.LFS  = "LFS";
@@ -55,7 +55,7 @@
                                               this._messages[this.LF],
                                               label,
                                               parseString);   
-      throw new ValidatorException(facesMessage);     
+      throw new TrValidatorException(facesMessage);     
     }
 
     i++;
@@ -108,7 +108,7 @@
                                               this._messages[this.LF],
                                               label,
                                               parseString);   
-      throw new ValidatorException(facesMessage);              
+      throw new TrValidatorException(facesMessage);              
     }
 
     i++;
@@ -145,7 +145,7 @@
                                             this._messages[this.LF],
                                             label,
                                             parseString);   
-    throw new ValidatorException(facesMessage);      
+    throw new TrValidatorException(facesMessage);      
   }
 
   return parseString;

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=449926&r1=449925&r2=449926
==============================================================================
--- 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
Mon Sep 25 23:25:55 2006
@@ -102,7 +102,7 @@
   var parseContext = new Object();
   parseContext.currIndex = 0;
   parseContext.parseString = parseString;
-  parseContext.parseException = new ConverterException(msg);
+  parseContext.parseException = new TrConverterException(msg);
   
   var parsedColor = new Color(0x00, 0x00, 0x00);
 
@@ -581,7 +581,7 @@
   this._pattern = pattern;
 }
 
-RGBColorFormat.prototype = new Converter();
+RGBColorFormat.prototype = new TrConverter();
 RGBColorFormat.prototype.getAsString = _rgbColorFormat;
 RGBColorFormat.prototype.getAsObject  = _rgbColorParse;
 

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=449926&r1=449925&r2=449926
==============================================================================
--- 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
Mon Sep 25 23:25:55 2006
@@ -2545,12 +2545,12 @@
   // format the detail error string
   if (detail != null)
   {
-    detail = FastMessageFormatUtils.format(detail, label, value, param2, param3);
+    detail = TrFastMessageFormatUtils.format(detail, label, value, param2, param3);
   }
   
-  return new FacesMessage(summary, 
+  return new TrFacesMessage(summary, 
                           detail, 
-                          FacesMessage.SEVERITY_ERROR);
+                          TrFacesMessage.SEVERITY_ERROR);
 }
 
 function _getGlobalErrorString(
@@ -2812,12 +2812,12 @@
   var value = _getValue(input);
 
   // use the message embedded in the validationError, if any
-  if (_instanceof(validationError, window["ConverterException"]))
+  if (_instanceof(validationError, window["TrConverterException"]))
   {
     errorFormat = validationError.getFacesMessage().getDetail();
   }
   // use the message embedded in the validationError, if any
-  else if (_instanceof(validationError, window["ValidatorException"]))
+  else if (_instanceof(validationError, window["TrValidatorException"]))
   {
     errorFormat = validationError.getFacesMessage().getDetail();
   }

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=449926&r1=449925&r2=449926
==============================================================================
--- 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
Mon Sep 25 23:25:55 2006
@@ -37,7 +37,7 @@
                                         messages[DecimalFormat.D],
                                         label,
                                         numberString);
-    throw new ConverterException(facesMessage);
+    throw new TrConverterException(facesMessage);
   }
        
 
@@ -54,7 +54,7 @@
                                         messages[DecimalFormat.D],
                                         label,
                                         numberString);
-      throw new ConverterException(facesMessage);
+      throw new TrConverterException(facesMessage);
     }
 
     // Remove the thousands separator - which Javascript doesn't want to see
@@ -127,14 +127,14 @@
           
           if ((messages == (void 0)) ||
               (messages[messageKey] == (void 0)))
-            throw  new ConverterException(null, null, "Conversion failed, but no appropriate
message found");  // default error format
+            throw  new TrConverterException(null, null, "Conversion failed, but no appropriate
message found");  // default error format
           else
           {
             facesMessage =  _createFacesMessage( messages[(messageKey + '_S')],
                                         messages[messageKey],
                                         label,
                                         numberString);
-            throw new ConverterException(facesMessage);
+            throw new TrConverterException(facesMessage);
           }
         }
         
@@ -147,7 +147,7 @@
                                         messages[DecimalFormat.D],
                                         label,
                                         numberString);
-  throw new ConverterException(facesMessage);
+  throw new TrConverterException(facesMessage);
 }
 
 function _decimalGetAsObject(
@@ -181,7 +181,7 @@
   this._class = "DecimalFormat";
 }
 
-DecimalFormat.prototype = new Converter();
+DecimalFormat.prototype = new TrConverter();
 DecimalFormat.prototype.getAsString  = _decimalGetAsString;
 DecimalFormat.prototype.getAsObject  = _decimalGetAsObject;
 
@@ -219,7 +219,7 @@
   }
   catch (e)
   {
-    throw new ValidatorException(e.getFacesMessage());
+    throw new TrValidatorException(e.getFacesMessage());
   }
 }
 
@@ -240,7 +240,7 @@
   this._class = "DecimalValidator";
 }
 
-DecimalValidator.prototype = new Validator();
+DecimalValidator.prototype = new TrValidator();
 DecimalValidator.prototype.validate  = _decimalValidate;
 
 
@@ -266,7 +266,7 @@
                                             label,
                                             parseString,
                                             this._pattern);                             
            
-    throw new ValidatorException(facesMessage); 
+    throw new TrValidatorException(facesMessage); 
   }
 }
 
@@ -286,5 +286,5 @@
 // no match pattern summary
 RegExpFormat.NMS = 'NMS';
 
-RegExpFormat.prototype = new Validator();
+RegExpFormat.prototype = new TrValidator();
 RegExpFormat.prototype.validate  = _regExpParse;

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=449926&r1=449925&r2=449926
==============================================================================
--- 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
Mon Sep 25 23:25:55 2006
@@ -117,7 +117,7 @@
   parseContext.parsedFullYear = (void 0);
   parseContext.parsedMonth = (void 0);
   parseContext.parsedDate = (void 0);
-  parseContext.parseException = new ConverterException( msg);
+  parseContext.parseException = new TrConverterException( msg);
 
   var parsedTime = new Date(0);
   parsedTime.setDate(1);
@@ -1279,6 +1279,6 @@
   this._pattern = patterns;
 }
 
-SimpleDateFormat.prototype = new Converter();
+SimpleDateFormat.prototype = new TrConverter();
 SimpleDateFormat.prototype.getAsString = _simpleDateFormat;
 SimpleDateFormat.prototype.getAsObject  = _simpleDateParse;

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/Locale.js
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/Locale.js?view=diff&rev=449926&r1=449925&r2=449926
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/Locale.js
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/Locale.js
Mon Sep 25 23:25:55 2006
@@ -554,10 +554,10 @@
  * as the context and component are not passed to the getAsString or getAsObject method 
  *
  */
-function Converter()
+function TrConverter()
 {
   // for debugging
-  this._class = "Converter";
+  this._class = "TrConverter";
 }
 
 /**
@@ -566,7 +566,7 @@
  * @param value Model object value to be converted 
  * @param label label to identify the editableValueHolder to the user 
  */
-Converter.prototype.getAsString = function(value, label){}
+TrConverter.prototype.getAsString = function(value, label){}
 
 /**
  * Convert the specified string value into a model data object 
@@ -575,7 +575,7 @@
  * @param value String value to be converted 
  * @param label label to identify the editableValueHolder to the user 
  */
-Converter.prototype.getAsObject = function(value, label){}
+TrConverter.prototype.getAsObject = function(value, label){}
 
 
 /**
@@ -584,31 +584,31 @@
  * as the context and component are not passed to the validate method 
  *
  */
-function Validator()
+function TrValidator()
 {
   // for debugging
-  this._class = "Validator";
+  this._class = "TrValidator";
 }
 
 /**
  * Perform the correctness checks implemented by this Validator. 
- * If any violations are found, a ValidatorException will be thrown 
- * containing the FacesMessage describing the failure. 
+ * If any violations are found, a TrValidatorException will be thrown 
+ * containing the TrFacesMessage describing the failure. 
  * @param value value to be validated 
  * @param label label to identify the editableValueHolder to the user
  */
-Validator.prototype.validate = function(value, label){}
+TrValidator.prototype.validate = function(value, label){}
 
 
 /** 
- * ConverterException is an exception thrown by the getAsObject() or getAsString() 
- * method of a Converter, to indicate that the requested conversion cannot be performed.
+ * TrConverterException is an exception thrown by the getAsObject() or getAsString() 
+ * method of a TrConverter, to indicate that the requested conversion cannot be performed.
  *
- * @param facesMessage the FacesMessage associated with this exception
+ * @param facesMessage the TrFacesMessage associated with this exception
  * @param summary Localized summary message text, used only if facesMessage is null
  * @param detail Localized detail message text, used only if facesMessage is null
  */
-function ConverterException(
+function TrConverterException(
   facesMessage, 
   summary,
   detail
@@ -617,9 +617,9 @@
   
   if (facesMessage == null)
   {
-      this._facesMessage = new FacesMessage(summary, 
+      this._facesMessage = new TrFacesMessage(summary, 
                                             detail,
-                                            FacesMessage.SEVERITY_ERROR);
+                                            TrFacesMessage.SEVERITY_ERROR);
   }
   else
   {
@@ -630,9 +630,9 @@
 }
 
 /**
- * Returns the FacesMessage associated with the exception.
+ * Returns the TrFacesMessage associated with the exception.
  */
-ConverterException.prototype.getFacesMessage = 
+TrConverterException.prototype.getFacesMessage = 
     function()
     {
       return this._facesMessage;
@@ -641,14 +641,14 @@
 
 
 /**
- * A ValidatorException is an exception thrown by the validate() method of 
+ * A TrValidatorException is an exception thrown by the validate() method of 
  * a Validator to indicate that validation failed.
  *
- * @param facesMessage the FacesMessage associated with this exception
+ * @param facesMessage the TrFacesMessage associated with this exception
  * @param summary Localized summary message text, used only if facesMessage is null
  * @param detail Localized detail message text, used only if facesMessage is null
  */
-function ValidatorException(
+function TrValidatorException(
   facesMessage,
   summary, 
   detail
@@ -657,9 +657,9 @@
   
   if (facesMessage == null)
   {
-      this._facesMessage = new FacesMessage(summary, 
+      this._facesMessage = new TrFacesMessage(summary, 
                                             detail,
-                                            FacesMessage.SEVERITY_ERROR);
+                                            TrFacesMessage.SEVERITY_ERROR);
   }
   else
   {
@@ -669,9 +669,9 @@
 
 
 /**
- * Returns the FacesMessage associated with the exception.
+ * Returns the TrFacesMessage associated with the exception.
  */
-ValidatorException.prototype.getFacesMessage = 
+TrValidatorException.prototype.getFacesMessage = 
   function()
   {
     return this._facesMessage;
@@ -687,7 +687,7 @@
  *                   SEVERITY_FATAL from the FacesMessage class.  Default is
  *                   SEVERITY_INFO
  */
-function FacesMessage(
+function TrFacesMessage(
   summary,
   detail,
   severity
@@ -698,7 +698,7 @@
   
   if(severity == null)
   {
-    this._severity = FacesMessage.SEVERITY_INFO;
+    this._severity = TrFacesMessage.SEVERITY_INFO;
   }
   else
   {
@@ -706,31 +706,31 @@
   }
 }
 
-FacesMessage.SEVERITY_INFO    = 0;
-FacesMessage.SEVERITY_WARN    = 1;
-FacesMessage.SEVERITY_ERROR   = 2;
-FacesMessage.SEVERITY_FATAL   = 3;
+TrFacesMessage.SEVERITY_INFO    = 0;
+TrFacesMessage.SEVERITY_WARN    = 1;
+TrFacesMessage.SEVERITY_ERROR   = 2;
+TrFacesMessage.SEVERITY_FATAL   = 3;
 
-FacesMessage._SEVERITY_DEFAULT = FacesMessage.SEVERITY_INFO;
+TrFacesMessage._SEVERITY_DEFAULT = TrFacesMessage.SEVERITY_INFO;
  
-FacesMessage.prototype.getDetail = 
+TrFacesMessage.prototype.getDetail = 
   function()
   {
     return this._detail;
   }
-FacesMessage.prototype.getSummary = 
+TrFacesMessage.prototype.getSummary = 
   function()
   {
     return this._summary;
   }
-FacesMessage.prototype.setDetail = 
+TrFacesMessage.prototype.setDetail = 
   function(
     detail
     )
   {
     this._detail = detail;
   }
-FacesMessage.prototype.setSummary = 
+TrFacesMessage.prototype.setSummary = 
   function(
     summary
     )
@@ -738,13 +738,13 @@
     this._summary = summary;
   }
 
-FacesMessage.prototype.getSeverity =
+TrFacesMessage.prototype.getSeverity =
   function()
   {
     return this._severity;
   }
     
-FacesMessage.prototype.setSeverity =
+TrFacesMessage.prototype.setSeverity =
   function(
     severity
   )
@@ -754,7 +754,7 @@
 
 
 /**
- * FastMessageFormatUtils is a greatly reduced version
+ * TrFastMessageFormatUtils is a greatly reduced version
  * of the java.text.MessageFormat class, but delivered as a utility. 
  * <p>
  * The only syntax supported by this class is simple index-based
@@ -771,9 +771,7 @@
  *     some'{'text{0}
  * </pre>
  */
-function FastMessageFormatUtils()
-{
-}
+var TrFastMessageFormatUtils = new Object();
 
  /**
   * Formats the given array of strings based on the initial
@@ -782,7 +780,7 @@
   * @param {any...:undefined} Varargs objects to substitute for positional parameters.
   * Each parameter will be converted to a String and substituted into the format.
   */
-FastMessageFormatUtils.format = function(
+TrFastMessageFormatUtils.format = function(
   formatString, // error format string with embedded indexes to be replaced
   parameters    // {any...:undefined} Varargs objects to substitute for positional parameters.
   )



Mime
View raw message