Author: indika
Date: Mon Dec 17 00:57:17 2007
New Revision: 11217
Log:
fixes for ESB-JAVA 406
Modified:
trunk/esb/java/modules/distribution/src/main/www/extensions/core/js/commons.js
trunk/esb/java/modules/distribution/src/main/www/extensions/core/js/mediators/filter_mediator.js
trunk/esb/java/modules/distribution/src/main/www/extensions/core/js/mediators/makefault_mediator.js
trunk/esb/java/modules/distribution/src/main/www/extensions/core/js/mediators/switch_mediator.js
trunk/esb/java/modules/distribution/src/main/www/extensions/core/js/sequences.js
Modified:
trunk/esb/java/modules/distribution/src/main/www/extensions/core/js/commons.js
==============================================================================
---
trunk/esb/java/modules/distribution/src/main/www/extensions/core/js/commons.js
(original)
+++
trunk/esb/java/modules/distribution/src/main/www/extensions/core/js/commons.js
Mon Dec 17 00:57:17 2007
@@ -30,6 +30,7 @@
if ((code > 47 && code < 59) // number
|| (code > 64 && code < 91)// capital
|| (code > 96 && code < 123)// simple
+ || (code == 46) //dot
|| code == 95) // underscore
{
}
@@ -243,6 +244,24 @@
convertedStr = relpaceString(convertedStr, "<", "<");
convertedStr = relpaceString(convertedStr, ">", ">");
convertedStr = relpaceString(convertedStr, """, '"');
+ // convertedStr = relpaceString(convertedStr, "'", "'");
+
+ //Replace all the invalid code with correct code
+ convertedStr = relpaceString(convertedStr, "&", "&");
+ convertedStr = relpaceString(convertedStr, "<", "<");
+ convertedStr = relpaceString(convertedStr, ">", ">");
+ convertedStr = relpaceString(convertedStr, '"', """);
+ // convertedStr = relpaceString(convertedStr, "'", "'");
+ return convertedStr;
+
+}
+
+function convertAllXmlSpecialChars(originalStr) {
+ //Replace all the correct code with invalid code
+ var convertedStr = relpaceString(originalStr, "&", "&");
+ convertedStr = relpaceString(convertedStr, "<", "<");
+ convertedStr = relpaceString(convertedStr, ">", ">");
+ convertedStr = relpaceString(convertedStr, """, '"');
convertedStr = relpaceString(convertedStr, "'", "'");
//Replace all the invalid code with correct code
@@ -252,7 +271,6 @@
convertedStr = relpaceString(convertedStr, '"', """);
convertedStr = relpaceString(convertedStr, "'", "'");
return convertedStr;
-
}
function relpaceString(originalStr, originalword, relaceword) {
Modified:
trunk/esb/java/modules/distribution/src/main/www/extensions/core/js/mediators/filter_mediator.js
==============================================================================
---
trunk/esb/java/modules/distribution/src/main/www/extensions/core/js/mediators/filter_mediator.js
(original)
+++
trunk/esb/java/modules/distribution/src/main/www/extensions/core/js/mediators/filter_mediator.js
Mon Dec 17 00:57:17 2007
@@ -35,14 +35,14 @@
}
} else {
if ((_source != null && _source.value != "")) {
- mediator.setAttribute("source",
convertToValidXMlString(trim(_source.value)));
+ mediator.setAttribute("source", trim(_source.value));
} else {
esbwarning("The source XPath must be specified for the filter
mediator", TYPE_INFO);
return false;
}
if (regex != null && regex.value != "") {
- mediator.setAttribute("regex",
convertToValidXMlString(trim(regex.value)));
+ mediator.setAttribute("regex", trim(regex.value));
} else {
esbwarning("The regular expression must be specified for the
filter mediator", TYPE_INFO);
return false;
Modified:
trunk/esb/java/modules/distribution/src/main/www/extensions/core/js/mediators/makefault_mediator.js
==============================================================================
---
trunk/esb/java/modules/distribution/src/main/www/extensions/core/js/mediators/makefault_mediator.js
(original)
+++
trunk/esb/java/modules/distribution/src/main/www/extensions/core/js/mediators/makefault_mediator.js
Mon Dec 17 00:57:17 2007
@@ -39,7 +39,7 @@
var codeElement = document.getElementById("codeValue");
var selectedIndex = codeElement.selectedIndex;
var codeValue = codeElement[selectedIndex].value;
-
+
//code and reason have to be filled by the user code can not be blank
(selection control)
if (reasonContent != "") {
@@ -79,12 +79,12 @@
if (reasonelem.getAttribute("expression") != null) {
reasonelem.removeAttribute("expression");
}
- reasonelem.setAttribute("value",
convertToValidXMlString(trim(reasonContent)));
+ reasonelem.setAttribute("value", trim(reasonContent));
} else {
if (reasonelem.getAttribute("value") != null) {
reasonelem.removeAttribute("value");
}
- reasonelem.setAttribute("expression",
convertToValidXMlString(trim(reasonContent)));
+ reasonelem.setAttribute("expression", trim(reasonContent));
}
if (selectedVersion == "soap12") {
@@ -92,20 +92,20 @@
if (document.getElementById("node").value != "") {
mediator.appendChild(createesbelement(
"<syn:node
xmlns:syn='http://ws.apache.org/ns/synapse'>"
- +
convertToValidXMlString(trim(document.getElementById("node").value)) +
"</syn:node>"));
+ + trim(document.getElementById("node").value)
+ "</syn:node>"));
}
}
if (document.getElementById("role").value != "") {
mediator.appendChild(createesbelement(
"<syn:role xmlns:syn='http://ws.apache.org/ns/synapse'>"
- +
convertToValidXMlString(trim(document.getElementById("role").value)) +
"</syn:role>"));
+ + trim(document.getElementById("role").value) +
"</syn:role>"));
}
if (document.getElementById("detail") != null &&
document.getElementById("detail").value != "") {
mediator.appendChild(createesbelement(
"<syn:detail xmlns:syn='http://ws.apache.org/ns/synapse'>"
- +
convertToValidXMlString(trim(document.getElementById("detail").value)) +
"</syn:detail>"));
+ + trim(document.getElementById("detail").value) +
"</syn:detail>"));
}
} else {
Modified:
trunk/esb/java/modules/distribution/src/main/www/extensions/core/js/mediators/switch_mediator.js
==============================================================================
---
trunk/esb/java/modules/distribution/src/main/www/extensions/core/js/mediators/switch_mediator.js
(original)
+++
trunk/esb/java/modules/distribution/src/main/www/extensions/core/js/mediators/switch_mediator.js
Mon Dec 17 00:57:17 2007
@@ -37,7 +37,7 @@
var regexvalue = document.getElementById("regex_val");
if (regexvalue != undefined && regexvalue != null && regexvalue !=
"undefined" && regexvalue.value != "") {
- mediator.setAttribute("regex",
convertToValidXMlString(regexvalue.value));
+ mediator.setAttribute("regex", regexvalue.value);
} else if(!validate) {
esbwarning("The regular expression must be specified for each case",
TYPE_INFO);
return false;
Modified:
trunk/esb/java/modules/distribution/src/main/www/extensions/core/js/sequences.js
==============================================================================
---
trunk/esb/java/modules/distribution/src/main/www/extensions/core/js/sequences.js
(original)
+++
trunk/esb/java/modules/distribution/src/main/www/extensions/core/js/sequences.js
Mon Dec 17 00:57:17 2007
@@ -780,7 +780,7 @@
internalmodel.rolebackname = internalmodel.sequencename;
var sequencestr = getmediatorstring(internalmodel.sequence);
var body_xml = '<ns1:saveSequence
xmlns:ns1="http://org.apache.synapse/xsd">' +
- '<ns1:sequenceElement>' +
relpaceString(relpaceString(trim(sequencestr), "&", "&"), "&", "&") +
'</ns1:sequenceElement>' +
+ '<ns1:sequenceElement>' +trim(sequencestr) +
'</ns1:sequenceElement>' +
'</ns1:saveSequence>';
var callURL = serverURL + "/" + SEQUENCE_ADMIN + "/" + "saveSequence";
@@ -860,7 +860,7 @@
var sequencestr = getmediatorstring(internalmodel.sequence);
var body_xml = '<ns1:addSequence
xmlns:ns1="http://org.apache.synapse/xsd">' +
- '<ns1:sequenceElement>' +
relpaceString(relpaceString(trim(sequencestr), "&", "&"), "&", "&") +
'</ns1:sequenceElement>' +
+ '<ns1:sequenceElement>' + trim(sequencestr)+
'</ns1:sequenceElement>' +
'</ns1:addSequence>';
var callURL = serverURL + "/" + SEQUENCE_ADMIN + "/" + "addSequence";
@@ -1074,7 +1074,7 @@
for (var i = 0; i < mediator.attributes.length; i++) {
if (mediator.attributes[i].name != "esb_med_pos") {
mediatorstring += ' '
- + mediator.attributes[i].name + '="' +
mediator.attributes[i].value + '"';
+ +
convertAllXmlSpecialChars(mediator.attributes[i].name) + '="' +
convertAllXmlSpecialChars(mediator.attributes[i].value) + '"';
}
}
}
_______________________________________________
Esb-java-dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/esb-java-dev