airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hes...@apache.org
Subject svn commit: r1403308 - /airavata/sandbox/client-api-demo/src/main/webapp/x_host_descriptor_save.html
Date Mon, 29 Oct 2012 14:21:05 GMT
Author: heshan
Date: Mon Oct 29 14:21:05 2012
New Revision: 1403308

URL: http://svn.apache.org/viewvc?rev=1403308&view=rev
Log:
Saving host.

Modified:
    airavata/sandbox/client-api-demo/src/main/webapp/x_host_descriptor_save.html

Modified: airavata/sandbox/client-api-demo/src/main/webapp/x_host_descriptor_save.html
URL: http://svn.apache.org/viewvc/airavata/sandbox/client-api-demo/src/main/webapp/x_host_descriptor_save.html?rev=1403308&r1=1403307&r2=1403308&view=diff
==============================================================================
--- airavata/sandbox/client-api-demo/src/main/webapp/x_host_descriptor_save.html (original)
+++ airavata/sandbox/client-api-demo/src/main/webapp/x_host_descriptor_save.html Mon Oct 29
14:21:05 2012
@@ -61,6 +61,8 @@ Gatekeeper Endpoint : <input type="text"
             alert("button btn2 clicked!");
             var hostName = $("#hostName1").val();
             var hostAddress = $("#hostAddress1").val();
+            var hostEndpoint = $("#hostEndpoint1").val();
+            var gatekeeperEndpoint = $("#gatekeeperEndpoint1").val();
 
 //            var xml = $('<type:hostDescription xmlns:type="http://schemas.airavata.apache.org/gfac/type"><type:hostName>mylocalhost</type:hostName><type:hostAddress>127.0.01</type:hostAddress></type:hostDescription>');
             var xml = $('<type:hostDescription xmlns:type="http://schemas.airavata.apache.org/gfac/type"><type:hostName>'
+ hostName + '</type:hostName><type:hostAddress>' + hostAddress + '</type:hostAddress></type:hostDescription>');
@@ -83,23 +85,40 @@ Gatekeeper Endpoint : <input type="text"
 
             $.ajax({
                 headers: {
-                    Accept : "text/plain; charset=utf-8",
+                    Accept : "text/plain; charset=utf-8"
 
 //                    "Content-Type": "text/xml",
-                    contentType: "text/xml",
+//                    contentType: "text/xml",
 //                    "Content-Type": "text/plain; charset=utf-8",
-                    "Accept-Encoding" : ""
-                },
-                beforeSend: function(xhr, s) {
-                    xhr.setRequestHeader("Accept-Encoding" ,"");
-                    xhr.setRequestHeader("Content-Type", "text/xml");
+//                    "Accept-Encoding" : ""
                 },
+//                beforeSend: function(xhr, s) {
+//                    xhr.setRequestHeader("Accept-Encoding" ,"");
+//                    xhr.setRequestHeader("Content-Type", "text/xml");
+//                },
 
                 type: "POST",
 //                contentType : "application/x-www-form-urlencoded",
                 url: "http://localhost:7080/airavata-registry-rest-services/registry/api/hostdescriptor/save",
-                data: xmlString,
-                dataType: "xml"
+                data: {
+                    hostName: hostName,
+                    hostAddress: hostAddress,
+                    hostEndpoint : hostEndpoint,
+                    gatekeeperEndpoint : gatekeeperEndpoint
+                }
+//                dataType: "xml"
+
+
+                /*type: "POST",
+                 url: "http://localhost:6060/airavata-registry-rest-services/registry/api/hostdescriptor/save",
+                data: {name: "amit", id:"1" },
+                dataType: "json",
+                beforeSend: function(x) {
+                    if (x && x.overrideMimeType) {
+                        x.overrideMimeType("application/j-son;charset=UTF-8");
+                    }
+                }*/
+
             }).done(function( msg ) {
                         alert( "Data Saved: " + msg );
                     });



Mime
View raw message