You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by he...@apache.org on 2012/10/25 07:54:25 UTC

svn commit: r1401983 - in /airavata/sandbox/client-api-demo/src/main/webapp: x_host_descriptor_save.html x_host_save.html

Author: heshan
Date: Thu Oct 25 05:54:25 2012
New Revision: 1401983

URL: http://svn.apache.org/viewvc?rev=1401983&view=rev
Log:
UI update.

Modified:
    airavata/sandbox/client-api-demo/src/main/webapp/x_host_descriptor_save.html
    airavata/sandbox/client-api-demo/src/main/webapp/x_host_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=1401983&r1=1401982&r2=1401983&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 Thu Oct 25 05:54:25 2012
@@ -79,28 +79,32 @@ Gatekeeper Endpoint : <input type="text"
             alert(hostAddress);
             alert(xmlString);
 
+
+
             $.ajax({
                 headers: {
                     Accept : "text/plain; charset=utf-8",
-                    "Content-Type" : "text/xml"
+
+//                    "Content-Type": "text/xml",
+                    contentType: "text/xml",
 //                    "Content-Type": "text/plain; charset=utf-8",
-//                    "Accept-Encoding" : ""
+                    "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:6060/airavata-registry-rest-services/registry/api/hostdescriptor/save",
+                url: "http://localhost:7080/airavata-registry-rest-services/registry/api/hostdescriptor/save",
                 data: xmlString,
-                dataType: "xml",
-                cache: false,
-                error: function() { alert("No data found."); },
-                success: function(xml) {
-                    alert("it works");
-//                    alert($(xml).find("project")[0].attr("id"));
-                }
+                dataType: "xml"
             }).done(function( msg ) {
                         alert( "Data Saved: " + msg );
                     });
 
+
 //            $.post("http://localhost:7080/airavata-registry-rest-services/registry/api/hostdescriptor/save",
 
             /*$.post("http://localhost:6060/airavata-registry-rest-services/registry/api/hostdescriptor/save",

Modified: airavata/sandbox/client-api-demo/src/main/webapp/x_host_save.html
URL: http://svn.apache.org/viewvc/airavata/sandbox/client-api-demo/src/main/webapp/x_host_save.html?rev=1401983&r1=1401982&r2=1401983&view=diff
==============================================================================
--- airavata/sandbox/client-api-demo/src/main/webapp/x_host_save.html (original)
+++ airavata/sandbox/client-api-demo/src/main/webapp/x_host_save.html Thu Oct 25 05:54:25 2012
@@ -17,7 +17,8 @@ Send an HTTP POST
     $(document).ready(function(){
 
         $('[name="btn1"]').click(function(){
-            $.post("http://localhost:7080/airavata-registry-rest-services/registry/api/save/configuration",
+//            $.post("http://localhost:7080/airavata-registry-rest-services/registry/api/save/configuration",
+            $.post("http://localhost:6060/airavata-registry-rest-services/registry/api/save/configuration",
                     { key: "dummy3", value: "value3" , date : "2011-10-22 00:00:00"} ,function(data,status){
 // TODO : REST api should send some response back in case of a successful invocation of service.
                         alert("Button 1 clicked !");
@@ -37,7 +38,8 @@ Send an HTTP POST
 <script>
     $(document).ready(function(){
         $('[name="btn2"]').click(function(){
-            $.post("http://localhost:7080/airavata-registry-rest-services/registry/api/hostdescriptor/save",
+//            $.post("http://localhost:7080/airavata-registry-rest-services/registry/api/hostdescriptor/save",
+            $.post("http://localhost:6060/airavata-registry-rest-services/registry/api/hostdescriptor/save",
                     { host: "&lt;type:hostDescription xmlns:type=&quot;http://schemas.airavata.apache.org/gfac/type&quot;&gt;&lt;type:hostName&gt;testHost1&lt;/type:hostName&gt;&lt;type:hostAddress&gt;aaaa&lt;/type:hostAddress&gt;&lt;/type:hostDescription"} ,function(data,status){
 // TODO : REST api should send some response back in case of a successful invocation of service.
 //                alert("Data: " + data + "\nStatus: " + status);