Author: indika
Date: Thu Jan 10 04:13:47 2008
New Revision: 12117

Log:

fix for 375


Modified:
   
branches/esb/java/1.6/esb/java/modules/distribution/src/main/www/extensions/core/js/mediators/dblookup_mediator.js
   
branches/esb/java/1.6/esb/java/modules/distribution/src/main/www/extensions/core/js/mediators/dbreport_mediator.js
   
branches/esb/java/1.6/esb/java/modules/distribution/src/main/www/extensions/core/js/mediators/property.js
   
branches/esb/java/1.6/esb/java/modules/distribution/src/main/www/extensions/core/js/mediators/xquery_mediator.js

Modified: 
branches/esb/java/1.6/esb/java/modules/distribution/src/main/www/extensions/core/js/mediators/dblookup_mediator.js
==============================================================================
--- 
branches/esb/java/1.6/esb/java/modules/distribution/src/main/www/extensions/core/js/mediators/dblookup_mediator.js
  (original)
+++ 
branches/esb/java/1.6/esb/java/modules/distribution/src/main/www/extensions/core/js/mediators/dblookup_mediator.js
  Thu Jan 10 04:13:47 2008
@@ -545,9 +545,9 @@
                     var propertytype = 
propertytrs[j].children[1].children[0].options[
                         
propertytrs[j].children[1].children[0].selectedIndex].value;
                     if (propertytype == "value") {
-                        propertystr += "value='" + 
propertytrs[j].children[2].children[0].value + "' ";
+                        propertystr += "value='" + 
convertAllXmlSpecialChars(propertytrs[j].children[2].children[0].value) + "' ";
                     } else if (propertytype == "expression") {
-                        propertystr += "expression='" + 
propertytrs[j].children[2].children[0].value + "' ";
+                        propertystr += "expression='" + 
convertAllXmlSpecialChars(propertytrs[j].children[2].children[0].value) + "' ";
                     }
                     if (namespce != undefined && namespce != null) {
                         for (var g = 0; g < namespce.length; g++) {
@@ -660,8 +660,13 @@
     for (var j = 0; j < propertytrs.length; j++) {
         if (window.ActiveXObject) {
             if (propertytrs[j].children[0].children[0].value != "" && 
propertytrs[j].children[1].children[0].value != "") {
+                var name = trim(propertytrs[j].children[0].children[0].value);
+                if (!namevalidate(name)) {
+                    esbwarning(INVALID_NAME, TYPE_INFO);
+                    return false;
+                }
                 var propertystr = "<syn:result 
xmlns:syn='http://ws.apache.org/ns/synapse' name='"
-                    + propertytrs[j].children[0].children[0].value + "' ";
+                    + name + "' ";
                 propertystr += "column='" + 
propertytrs[j].children[1].children[0].value + "' ";
                 statement.appendChild(createesbelement(propertystr + "/>"));
             } else {
@@ -1015,10 +1020,15 @@
     for (var j = 0; j < propertytrs.length; j++) {
         if (window.ActiveXObject) {
             if (propertytrs[j].children[0].children[0].value != "" && 
propertytrs[j].children[0].children[0].value != "Select A Value" && 
propertytrs[j].children[1].children[0].value != "") {
+                var name = trim(propertytrs[j].children[0].children[0].value);
+                if (!namevalidate(name)) {
+                    esbwarning(INVALID_NAME, TYPE_INFO);
+                    return false;
+                }
                 var propertystr = "<syn:property 
xmlns:syn='http://ws.apache.org/ns/synapse' name='"
-                    + propertytrs[j].children[0].children[0].value + "' ";
+                    + name + "' ";
 
-                propertystr += "value='" + 
propertytrs[j].children[1].children[0].value + "' ";
+                propertystr += "value='" + 
convertAllXmlSpecialChars(propertytrs[j].children[1].children[0].value) + "' ";
                 mediator.appendChild(createesbelement(propertystr + "/>"));
             } else {
                 if (propertytrs[j].children[0].children[0].value == ""

Modified: 
branches/esb/java/1.6/esb/java/modules/distribution/src/main/www/extensions/core/js/mediators/dbreport_mediator.js
==============================================================================
--- 
branches/esb/java/1.6/esb/java/modules/distribution/src/main/www/extensions/core/js/mediators/dbreport_mediator.js
  (original)
+++ 
branches/esb/java/1.6/esb/java/modules/distribution/src/main/www/extensions/core/js/mediators/dbreport_mediator.js
  Thu Jan 10 04:13:47 2008
@@ -549,9 +549,9 @@
                     var propertytype = 
propertytrs[j].children[1].children[0].options[
                         
propertytrs[j].children[1].children[0].selectedIndex].value;
                     if (propertytype == "value") {
-                        propertystr += "value='" + 
propertytrs[j].children[2].children[0].value + "' ";
+                        propertystr += "value='" + 
convertAllXmlSpecialChars(propertytrs[j].children[2].children[0].value) + "' ";
                     } else if (propertytype == "expression") {
-                        propertystr += "expression='" + 
propertytrs[j].children[2].children[0].value + "' ";
+                        propertystr += "expression='" + 
convertAllXmlSpecialChars(propertytrs[j].children[2].children[0].value) + "' ";
                     }
                     if (namespce != undefined && namespce != null) {
                         for (var g = 0; g < namespce.length; g++) {
@@ -663,8 +663,13 @@
     for (var j = 0; j < propertytrs.length; j++) {
         if (window.ActiveXObject) {
             if (propertytrs[j].children[0].children[0].value != "" && 
propertytrs[j].children[1].children[0].value != "") {
+                var name = trim(propertytrs[j].children[0].children[0].value);
+                if (!namevalidate(name)) {
+                    esbwarning(INVALID_NAME, TYPE_INFO);
+                    return false;
+                }
                 var propertystr = "<syn:result 
xmlns:syn='http://ws.apache.org/ns/synapse' name='"
-                    + propertytrs[j].children[0].children[0].value + "' ";
+                    + name + "' ";
                 propertystr += "column='" + 
propertytrs[j].children[1].children[0].value + "' ";
                 statement.appendChild(createesbelement(propertystr + "/>"));
             } else {
@@ -1018,10 +1023,15 @@
     for (var j = 0; j < propertytrs.length; j++) {
         if (window.ActiveXObject) {
             if (propertytrs[j].children[0].children[0].value != "" && 
propertytrs[j].children[0].children[0].value != "Select A Value" && 
propertytrs[j].children[1].children[0].value != "") {
+                var name = trim(propertytrs[j].children[0].children[0].value);
+                if (!namevalidate(name)) {
+                    esbwarning(INVALID_NAME, TYPE_INFO);
+                    return false;
+                }
                 var propertystr = "<syn:property 
xmlns:syn='http://ws.apache.org/ns/synapse' name='"
-                    + propertytrs[j].children[0].children[0].value + "' ";
+                    + name + "' ";
 
-                propertystr += "value='" + 
propertytrs[j].children[1].children[0].value + "' ";
+                propertystr += "value='" + 
convertAllXmlSpecialChars(propertytrs[j].children[1].children[0].value) + "' ";
                 mediator.appendChild(createesbelement(propertystr + "/>"));
             } else {
                 if (propertytrs[j].children[0].children[0].value == ""

Modified: 
branches/esb/java/1.6/esb/java/modules/distribution/src/main/www/extensions/core/js/mediators/property.js
==============================================================================
--- 
branches/esb/java/1.6/esb/java/modules/distribution/src/main/www/extensions/core/js/mediators/property.js
   (original)
+++ 
branches/esb/java/1.6/esb/java/modules/distribution/src/main/www/extensions/core/js/mediators/property.js
   Thu Jan 10 04:13:47 2008
@@ -154,9 +154,9 @@
             var propertytype = propertytrs[j].children[1].children[0].options[
                 propertytrs[j].children[1].children[0].selectedIndex].value;
             if (propertytype == "value") {
-                propertystr += "value='" + 
propertytrs[j].children[2].children[0].value + "' ";
+                propertystr += "value='" + 
convertAllXmlSpecialChars(propertytrs[j].children[2].children[0].value) + "' ";
             } else if (propertytype == "expression") {
-                propertystr += "expression='" + 
propertytrs[j].children[2].children[0].value + "' ";
+                propertystr += "expression='" + 
convertAllXmlSpecialChars(propertytrs[j].children[2].children[0].value) + "' ";
             }
             if 
(namespaces[mediator.getAttribute("esb_med_pos").concat(".").concat(j)] != 
undefined) {
                 var nss = 
namespaces[mediator.getAttribute("esb_med_pos").concat(".").concat(j)];
@@ -284,7 +284,7 @@
 
             var featurestr = "<syn:feature 
xmlns:syn='http://ws.apache.org/ns/synapse' name='"
                 + name + "' ";
-            featurestr += "value='" + 
features[j].children[1].children[0].value + "' ";
+            featurestr += "value='" + 
convertAllXmlSpecialChars(features[j].children[1].children[0].value) + "' ";
             mediator.appendChild(createesbelement(featurestr + "/>"));
         } else {
             var name = features[j].childNodes[0].childNodes[0].value;

Modified: 
branches/esb/java/1.6/esb/java/modules/distribution/src/main/www/extensions/core/js/mediators/xquery_mediator.js
==============================================================================
--- 
branches/esb/java/1.6/esb/java/modules/distribution/src/main/www/extensions/core/js/mediators/xquery_mediator.js
    (original)
+++ 
branches/esb/java/1.6/esb/java/modules/distribution/src/main/www/extensions/core/js/mediators/xquery_mediator.js
    Thu Jan 10 04:13:47 2008
@@ -188,13 +188,13 @@
                     if (propertytype == "value") {
                         var value = 
propertytrs[j].children[3].children[0].value;
                         if (value != null && value != undefined && trim(value) 
!= "") {
-                            propertystr += "value='" + trim(value) + "' ";
+                            propertystr += "value='" + 
convertAllXmlSpecialChars(trim(value)) + "' ";
                         } else {
                             esbwarning("Varibale value must be defined for the 
variable type :" + propertytrs[j].children[0].children[0].value, TYPE_INFO);
                             return false;
                         }
                     } else if (propertytype == "expression") {
-                        propertystr += "expression='" + 
propertytrs[j].children[3].children[0].value + "' ";
+                        propertystr += "expression='" + 
convertAllXmlSpecialChars(trim(propertytrs[j].children[3].children[0].value)) + 
"' ";
                     }
                     if (namespce != undefined && namespce != null) {
                         for (var g = 0; g < namespce.length; g++) {

_______________________________________________
Esb-java-dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/esb-java-dev

Reply via email to