You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2008/07/12 21:52:32 UTC

svn commit: r676227 - in /ofbiz/trunk: applications/product/config/ProductErrorUiLabels.xml applications/product/script/org/ofbiz/product/feature/ProductFeatureServices.xml framework/base/src/base/org/ofbiz/base/util/UtilValidate.java

Author: jleroux
Date: Sat Jul 12 12:52:31 2008
New Revision: 676227

URL: http://svn.apache.org/viewvc?rev=676227&view=rev
Log:
Ooops, I just remember that the "list..." functions created in ProductDetail.bsh are always prefixed by "list" so the javascript reserved words check is not needed.

Modified:
    ofbiz/trunk/applications/product/config/ProductErrorUiLabels.xml
    ofbiz/trunk/applications/product/script/org/ofbiz/product/feature/ProductFeatureServices.xml
    ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilValidate.java

Modified: ofbiz/trunk/applications/product/config/ProductErrorUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/config/ProductErrorUiLabels.xml?rev=676227&r1=676226&r2=676227&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/config/ProductErrorUiLabels.xml (original)
+++ ofbiz/trunk/applications/product/config/ProductErrorUiLabels.xml Sat Jul 12 12:52:31 2008
@@ -40,8 +40,4 @@
         <value xml:lang="en">The Product Feature TypeId must contains only letters, underscore and digits and must begin by a letter. Please re-enter</value>
         <value xml:lang="fr">La réf. de type de caractéristique d'article ne doit contenir que des lettres, le tiret bas "_" et des chiffres et doit commencer par une lettre. Recommencez SVP</value>
     </property>
-    <property key="ProductFeatureTypeIdMustNotBeResevedWord">
-        <value xml:lang="en">The Product Feature TypeId must not be one of the reserved words, this is one of them. Please re-enter</value>
-        <value xml:lang="fr">La réf. de type de caractéristique d'article ne peut être un mot réservé, ce mot en est un. Recommencez SVP</value>
-    </property>
 </resource>

Modified: ofbiz/trunk/applications/product/script/org/ofbiz/product/feature/ProductFeatureServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/script/org/ofbiz/product/feature/ProductFeatureServices.xml?rev=676227&r1=676226&r2=676227&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/script/org/ofbiz/product/feature/ProductFeatureServices.xml (original)
+++ ofbiz/trunk/applications/product/script/org/ofbiz/product/feature/ProductFeatureServices.xml Sat Jul 12 12:52:31 2008
@@ -289,19 +289,7 @@
             </then>
         </if>
         <check-errors/>
-        
-        <if>
-            <condition>
-                <if-validate-method field-name="parameters.productFeatureTypeId" method="isJavaScriptReservedWord"></if-validate-method>
-            </condition>
-            <then>
-                <add-error>
-                    <fail-property resource="ProductErrorUiLabels" property="ProductFeatureTypeIdMustNotBeResevedWord"/>
-                </add-error>
-            </then>
-        </if>
-        <check-errors/>
-        
+                
         <make-value value-name="newEntity" entity-name="ProductFeatureType"/>
         <set-nonpk-fields map-name="parameters" value-name="newEntity"/>
         <set-pk-fields map-name="parameters" value-name="newEntity"/>

Modified: ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilValidate.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilValidate.java?rev=676227&r1=676226&r2=676227&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilValidate.java (original)
+++ ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilValidate.java Sat Jul 12 12:52:31 2008
@@ -604,30 +604,7 @@
         // All characters are numbers or letters.
         return true;
     }
-    
-    public static boolean isJavaScriptReservedWord(String s) {
-        String[] javaScriptReservedWord = {"abstract", "alert", "arguments", "Array", "blur", "boolean", "Boolean", "break", "byte",
-                "callee", "caller", "captureEventscase", "catch", "char", "class", "clearInterval", "clearTimeout", "close", "closed",
-                "confirm", "const", "constructor", "continue", "Date", "debugger", "default", "defaultStatusdelete", "do", "document",
-                "double", "else", "enum", "escape", "eval", "export", "extends", "false", "final", "finally", "find", "float", "for",
-                "focus", "frames", "function", "Function", "goto", "history", "home", "if", "implements", "import", "in", "Infinity",
-                "innerHeight", "innerWidth", "instanceof", "int", "interface", "isFinite", "isNaN", "java", "length", "location",
-                "locationbar", "long", "Math", "menubar", "moveBy", "moveTo", "name", "NaN", "native", "netscape", "new", "null",
-                "Number", "Object", "open", "opener", "outerHeight", "outerWidth", "package", "Packages", "pageXOffset", "pageYOffset",
-                "parent", "parseFloat", "parseInt", "personalbar", "print", "private", "prompt", "protected", "prototype", "public",
-                "RegExp", "releaseEventsresizeBy", "resizeTo", "return", "routeEvent", "scroll", "scrollbars", "scrollBy", "scrollTo",
-                "self", "setInterval", "setTimeout", "short", "static", "status", "statusbar", "stop", "String", "super", "switch",
-                "synchronized", "this", "throw", "throws", "toolbar", "top", "toString", "transient", "true", "try", "typeof", "unescape",
-                "unwatch", "valueOf", "var", "void", "watch", "while", "with", "window"};
-        for (String reservedWord : javaScriptReservedWord) {
-            if (reservedWord.equals(s)) {
-                return true;
-            }
-        }
-        return false;
-    }
-    
-    
+
     /* ================== METHODS TO CHECK VARIOUS FIELDS. ==================== */
 
     /** isSSN returns true if string s is a valid U.S. Social Security Number.  Must be 9 digits. */