[wsas-java-dev] svn commit r3877 - trunk/wsas/java/modules/www/extensions/core/js

svn at wso2.org svn at wso2.org
Fri Jun 15 07:39:57 PDT 2007


Author: saminda
Date: Fri Jun 15 07:39:54 2007
New Revision: 3877

Modified:
   trunk/wsas/java/modules/www/extensions/core/js/data_service.js
Log:
Update


Modified: trunk/wsas/java/modules/www/extensions/core/js/data_service.js
==============================================================================
--- trunk/wsas/java/modules/www/extensions/core/js/data_service.js	(original)
+++ trunk/wsas/java/modules/www/extensions/core/js/data_service.js	Fri Jun 15 07:39:54 2007
@@ -11,6 +11,7 @@
 var curDataServiceOutputMappingType = null;
 
 var newDataService = false;
+var rootDocument;
 
 function addNewDataService(){
 	var getDSNamePrompt = "Enter the name of the data service"
@@ -35,7 +36,9 @@
         case "gecko":
         case "opera":
         case "safari": {
-             newDataObject = document.implementation.createDocument("","return",null);
+            rootDocument = document.implementation.createDocument("", "", null);
+            newDataObject = rootDocument.createElement("return");
+            break;
         }
         default: {
             wso2.wsf.Util.alertWarning("DOM document can not be created");
@@ -44,10 +47,10 @@
 
     }
 
-	var dataRowObj = newDataObject.createElement("data");
+	var dataRowObj = rootDocument.createElement("data");
 	dataRowObj.setAttribute("name", tempValue);
 
-	var configObj = newDataObject.createElement("config");
+	var configObj = rootDocument.createElement("config");
 	configObj.appendChild(createPropelement("org.wso2.ws.dataservice.driver", "Fill in the Value"));
 	configObj.appendChild(createPropelement("org.wso2.ws.dataservice.protocol", "Fill in the Value"));
 	configObj.appendChild(createPropelement("org.wso2.ws.dataservice.user", "Fill in the Value"));
@@ -57,7 +60,7 @@
 
 	newDataObject.appendChild(dataRowObj);
 
-	var tempDataServiceObj = newDataObject.createElement("temp");
+	var tempDataServiceObj = rootDocument.createElement("temp");
 	tempDataServiceObj.appendChild(newDataObject);
 	addNewDataServiceEchoDataElement(tempDataServiceObj);
 }
@@ -120,7 +123,7 @@
 
 	var sqlObj = dataServiceQueryObj.getElementsByTagName("sql").item(0);
 	sqlObj.removeChild(sqlObj.childNodes.item(0));
-	sqlObj.appendChild(newDataObject.createTextNode(dataServiceSQL));
+	sqlObj.appendChild(rootDocument.createTextNode(dataServiceSQL));
 
 	var resultObj = dataServiceQueryObj.getElementsByTagName("result").item(0);
 	resultObj.setAttribute("element", dataServiceWrapElement);
@@ -237,23 +240,23 @@
 }
 
 function createOpElement(opName, queryName){
-	var opObj = newDataObject.createElement("operation");
+	var opObj = rootDocument.createElement("operation");
 	opObj.setAttribute("name", opName);
-	var queryObj = newDataObject.createElement("call-query")
+	var queryObj = rootDocument.createElement("call-query")
 	queryObj.setAttribute("href", queryName);
 	opObj.appendChild(queryObj);
 	return opObj;
 }
 
 function createPropelement(propName, propValue){
-	var propObj = newDataObject.createElement("property");
-	propObj.appendChild(newDataObject.createTextNode(propValue));
+	var propObj = rootDocument.createElement("property");
+	propObj.appendChild(rootDocument.createTextNode(propValue));
 	propObj.setAttribute("name", propName);
 	return propObj;
 }
 
 function createInputMappingElement(elementName, sqlType){
-	var imElement = newDataObject.createElement("param");
+	var imElement = rootDocument.createElement("param");
 	imElement.setAttribute("name", elementName);
 	imElement.setAttribute("sqlType", sqlType);
 	return imElement;
@@ -261,14 +264,14 @@
 
 
 function createOutputMappingElement(elementName, dataColumn){
-	var imElement = newDataObject.createElement("element");
+	var imElement = rootDocument.createElement("element");
 	imElement.setAttribute("name", elementName);
 	imElement.setAttribute("column", dataColumn);
 	return imElement;
 }
 
 function createOutputMappingQuery(queryName){
-	var imElement = newDataObject.createElement("call-query");
+	var imElement = rootDocument.createElement("call-query");
 	imElement.setAttribute("href", queryName);
 	return imElement;
 }
@@ -276,13 +279,13 @@
 function configPropertyOnChange(propName, propValue) {
 	var propObj = getNodeWithPropertyFromCollection(dataServiceObj.getElementsByTagName("property"), "name", propName);
 	propObj.removeChild(propObj.firstChild);
-	propObj.appendChild(newDataObject.createTextNode(propValue));
+	propObj.appendChild(rootDocument.createTextNode(propValue));
 }
 
 function querySQLOnChange(sqlStatement){
 	var sqlObj = dataServiceQueryObj.getElementsByTagName("sql").item(0);
 	sqlObj.removeChild(sqlObj.childNodes.item(0));
-	sqlObj.appendChild(newDataObject.createTextNode(sqlStatement));
+	sqlObj.appendChild(rootDocument.createTextNode(sqlStatement));
 }
 
 function queryWENOnChange(WEN){
@@ -327,12 +330,12 @@
         return false;
     }
 
-	var queryEle = newDataObject.createElement("query");
+	var queryEle = rootDocument.createElement("query");
 	queryEle.setAttribute("id", tempValue);
 	
-	var sqlEle = newDataObject.createElement("sql");
-	sqlEle.appendChild(newDataObject.createTextNode(""));
-	var resultEle = newDataObject.createElement("result");
+	var sqlEle = rootDocument.createElement("sql");
+	sqlEle.appendChild(rootDocument.createTextNode(""));
+	var resultEle = rootDocument.createElement("result");
 	
 	resultEle.setAttribute("element", "element");
 	




More information about the Wsas-java-dev mailing list