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

svn at wso2.org svn at wso2.org
Tue Jun 5 06:48:01 PDT 2007


Author: saminda
Date: Tue Jun  5 06:47:51 2007
New Revision: 3544

Modified:
   trunk/wsas/java/modules/www/extensions/core/js/rampart_config.js
   trunk/wsas/java/modules/www/extensions/core/js/rampart_specific_transformer.js
Log:
Fixes to rampart configurations 


Modified: trunk/wsas/java/modules/www/extensions/core/js/rampart_config.js
==============================================================================
--- trunk/wsas/java/modules/www/extensions/core/js/rampart_config.js	(original)
+++ trunk/wsas/java/modules/www/extensions/core/js/rampart_config.js	Tue Jun  5 06:47:51 2007
@@ -66,7 +66,8 @@
 
     } else {
         var isChecked = false;
-        isUserSelectedScenario = false; // This will stabilizes the back button 
+        isUserSelectedScenario = false;
+        // This will stabilizes the back button
         var objs = document.getElementsByName(CONFIGURATION_SCENARIO_GROUP);
         if (objs != null) {
             var objsLength = objs.length;
@@ -186,7 +187,7 @@
                    '</req:getSecurityAssignment>\n';
 
     var callURL = serverURL + "/" + SECURITY_SCENARIO_CONFIG_ADMIN ;
-    new wso2.wsf.WSRequest(callURL,"getSecurityAssignment",body_xml,utRelatedWSCallCallback);
+    new wso2.wsf.WSRequest(callURL, "getSecurityAssignment", body_xml, utRelatedWSCallCallback);
 
 }
 function utRelatedWSCallCallback() {
@@ -248,19 +249,19 @@
     var body_xml = '<ns1:assignUsersAndRoles xmlns:ns1="http://org.apache.axis2/xsd">\n' +
                    '<serviceName>' + getServiceSpecificName() + '</serviceName>' +
                    '<serviceVersion></serviceVersion>' +
-                   '<scenarioId>'+ getScenarioId() + '</scenarioId>' + 
+                   '<scenarioId>' + getScenarioId() + '</scenarioId>' +
                    users +
                    roles +
                    '</ns1:assignUsersAndRoles>';
     var callURL = serverURL + "/" + SECURITY_SCENARIO_CONFIG_ADMIN ;
-    new wso2.wsf.WSRequest(callURL,"assignUsersAndRoles",body_xml,assignUsersAndRolesCallback);
+    new wso2.wsf.WSRequest(callURL, "assignUsersAndRoles", body_xml, assignUsersAndRolesCallback);
 
 }
 
 function assignUsersAndRolesCallback() {
 
     wso2.wsf.Util.alertMessage("Security scenario successfully applied");
-    
+
     showSecurityConfigurationInfo();
 
 }
@@ -271,12 +272,12 @@
                    '</req:getServiceUsersWithDescriptionRequest>\n';
 
     var callURL = serverURL + "/" + "ServiceAdmin" ;
-    new wso2.wsf.WSRequest(callURL,"getServiceUsersWithDescription",body_xml,listUsersCallback1);
+    new wso2.wsf.WSRequest(callURL, "getServiceUsersWithDescription", body_xml, listUsersCallback1);
 }
 
 function listUsersCallback1() {
 
-    transformationWithoutHistory(this.req.responseXML,"rampart/scenario1.xsl", document.getElementById("divServiceUNameToeknAuthUsers"));
+    transformationWithoutHistory(this.req.responseXML, "rampart/scenario1.xsl", document.getElementById("divServiceUNameToeknAuthUsers"));
     loadUsersComboBox1();
 }
 
@@ -286,7 +287,7 @@
                    ' </req:getUsersRequest>\n';
 
     var callURL = serverURL + "/" + "UserAdmin" + "/" ;
-    new wso2.wsf.WSRequest(callURL,body_xml,"getUsers",loadUsersCallback1);
+    new wso2.wsf.WSRequest(callURL, body_xml, "getUsers", loadUsersCallback1);
 }
 
 function loadUsersCallback1() {
@@ -310,13 +311,13 @@
                    '</req:getServiceRolesWithDescriptionRequest>\n';
 
     var callURL = serverURL + "/" + "ServiceAdmin" ;
-    new wso2.wsf.WSRequest(callURL,"getServiceRolesWithDescription",body_xml,listRolesCallback1);
+    new wso2.wsf.WSRequest(callURL, "getServiceRolesWithDescription", body_xml, listRolesCallback1);
 
 }
 
 function listRolesCallback1() {
 
-    transformationWithoutHistory(this.req.responseXML,"rampart/scenario1.xsl", document.getElementById("divServiceUNameToeknAuthRoles"));
+    transformationWithoutHistory(this.req.responseXML, "rampart/scenario1.xsl", document.getElementById("divServiceUNameToeknAuthRoles"));
     showlistServiceUsersHeader(document.getElementById('listServiceUsersHeader'));
     document.getElementById('divServiceUNameToeknAuthUsers').style.display = "inline";
     document.getElementById('listServiceUsersHeader').style.display = "inline";
@@ -337,7 +338,7 @@
                    '<username>' + un + '</username>' +
                    '</ns1:assignUserToService>';
     var callURL = serverURL + "/" + SECURITY_SCENARIO_CONFIG_ADMIN ;
-    new wso2.wsf.WSRequest(callURL,"assignUserToService",body_xml,assignUserToServiceCallback);
+    new wso2.wsf.WSRequest(callURL, "assignUserToService", body_xml, assignUserToServiceCallback);
 }
 
 function assignUserToServiceCallback() {
@@ -355,7 +356,7 @@
                    '</ns1:assignRoleToService>';
 
     var callURL = serverURL + "/" + SECURITY_SCENARIO_CONFIG_ADMIN ;
-    new wso2.wsf.WSRequest(callURL,"assignRoleToService",body_xml,assignRoleToServiceCallback);
+    new wso2.wsf.WSRequest(callURL, "assignRoleToService", body_xml, assignRoleToServiceCallback);
 }
 
 function assignRoleToServiceCallback() {
@@ -373,7 +374,7 @@
                        '</ns1:unassignUserFromService>';
 
         var callURL = serverURL + "/" + SECURITY_SCENARIO_CONFIG_ADMIN ;
-        new wso2.wsf.WSRequest(callURL,"unassignUserFromService",body_xml,unassignUserRoleFromServiceCallback);
+        new wso2.wsf.WSRequest(callURL, "unassignUserFromService", body_xml, unassignUserRoleFromServiceCallback);
     }
 }
 
@@ -388,7 +389,7 @@
                        '</ns1:unassignRoleFromService>';
 
         var callURL = serverURL + "/" + SECURITY_SCENARIO_CONFIG_ADMIN ;
-        new wso2.wsf.WSRequest(callURL,"unassignRoleFromService",body_xml,unassignUserRoleFromServiceCallback);
+        new wso2.wsf.WSRequest(callURL, "unassignRoleFromService", body_xml, unassignUserRoleFromServiceCallback);
     }
 }
 
@@ -417,7 +418,7 @@
                    '<serviceName>' + getServiceSpecificName() + '</serviceName>\n' +
                    '</ns1:getServiceKeyStores>';
     var callURL = serverURL + "/" + CRYPTO_ADMIN_STRING ;
-    new wso2.wsf.WSRequest(callURL,"getServiceKeyStores",body_xml,listTrustStoresCallback);
+    new wso2.wsf.WSRequest(callURL, "getServiceKeyStores", body_xml, listTrustStoresCallback);
 }
 
 function listTrustStoresCallback() {
@@ -425,7 +426,7 @@
     /*var data = getBody(xhReq.responseXML);
     alert(xmlSerializerToString(data));*/
 
-    rampartSpecificTransformationWithoutHistory("scenario2.xsl", document.getElementById("divAvailableCertifcateStores"));
+    rampartSpecificTransformationWithoutHistory(this.req.responseXML, "scenario2.xsl", document.getElementById("divAvailableCertifcateStores"));
     showlistServiceUsersHeader(document.getElementById('genericScenarioHeader'));
     document.getElementById('divButtonRawForGenericScenario').style.display = "inline";
 }
@@ -465,7 +466,7 @@
                    '</ns1:assignKeyStores>\n';
 
     var callURL = serverURL + "/" + SECURITY_SCENARIO_CONFIG_ADMIN ;
-    new wso2.wsf.WSRequest(callURL,"assignKeyStores",body_xml,assignKeyStoresCallback);
+    new wso2.wsf.WSRequest(callURL, "assignKeyStores", body_xml, assignKeyStoresCallback);
 
 }
 
@@ -485,12 +486,13 @@
                    '</ns1:disableSecurity>';
 
     var callURL = serverURL + "/" + SECURITY_SCENARIO_CONFIG_ADMIN ;
-    new wso2.wsf.WSRequest(callURL,"disableSecurity",body_xml,DisableSecurityCallback);
+    new wso2.wsf.WSRequest(callURL, "disableSecurity", body_xml, DisableSecurityCallback);
 }
 
 function DisableSecurityCallback() {
 
-    wso2.wsf.Util.alertMessage("Security has been disabled for service [" + getServiceSpecificName() + "]");
+    wso2.wsf.Util.alertMessage("Security has been disabled for service [" +
+                               getServiceSpecificName() + "]");
     showSecurityConfigurationInfo();
 }
 

Modified: trunk/wsas/java/modules/www/extensions/core/js/rampart_specific_transformer.js
==============================================================================
--- trunk/wsas/java/modules/www/extensions/core/js/rampart_specific_transformer.js	(original)
+++ trunk/wsas/java/modules/www/extensions/core/js/rampart_specific_transformer.js	Tue Jun  5 06:47:51 2007
@@ -5,40 +5,23 @@
 
 var rampartExtensionPath = "rampart";
 
-function rampartSpecificTransformationWithoutHistory(xslFile, objDiv, paramArray) {
-    var xmlDoc = this.req.responseXML;
-    rampartSpecificTransformer(xmlDoc, xslFile, objDiv,false, paramArray);
+function rampartSpecificTransformationWithoutHistory(xmlDoc,xslFile, objDiv, paramArray) {
+    rampartSpecificTransformer(xmlDoc, xslFile, objDiv, false, paramArray);
     wso2.wsf.Util.showOnlyOneMain(objDiv, true);
 }
 
 function rampartSpecificTransformer(xml, xslFileName, objDiv, isAbsPath, paramArray) {
-    try {
-        mozillaSpecificXSLLoader(xslFileName);
-        /* setting the parameters */
-        if (paramArray) {
-            xsltProcessor.setParameter(null, "topLevelHeading", paramArray[0]);
-        }
-        var fragment = xsltProcessor.transformToFragment(xml, document);
-        objDiv.innerHTML = ""; // Decouple the older xhtml first
-        objDiv.appendChild(fragment);
-
-    } catch(e) {
-        try {
-
-            ieSpecificXSLLoader(xml, xslFileName, objDiv, paramArray);
-
-        } catch(e) {
-            alert("Encountered an error : " + e);
-        }
-
-    }
+    
+    var xsltTransformer = new wso2.wsf.XSLTHelper();
+    var path = "extensions/core/xslt/" + rampartExtensionPath + "/" + xslFileName;
+    xsltTransformer.transform(objDiv, xml, path, true, false, new Array(["topLevelHeading",paramArray[0]]));
 }
 
 function mozillaSpecificXSLLoader(xslFileName) {
     /*xslProcessor variable is avaiable from wso2_adminui */
-    xsltProcessor  = new XSLTProcessor();
+    xsltProcessor = new XSLTProcessor();
     var p = createXMLHttpRequest();
-    var fullPath = URL + "/extensions/core/xslt/" + rampartExtensionPath +"/"+xslFileName;
+    var fullPath = URL + "/extensions/core/xslt/" + rampartExtensionPath + "/" + xslFileName;
     p.open("GET", fullPath, false);
     p.send(null);
 
@@ -47,7 +30,7 @@
 }
 
 function ieSpecificXSLLoader(xml, fileName, objDiv, paramArray) {
-    var fullPath = URL + "/extensions/core/xslt/" + rampartExtensionPath +"/"+fileName;
+    var fullPath = URL + "/extensions/core/xslt/" + rampartExtensionPath + "/" + fileName;
     transformXMLIE(xml, fullPath, objDiv, paramArray);
 }
 




More information about the Wsas-java-dev mailing list