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/11/16 22:16:32 UTC
svn commit: r1410574 - in /airavata/sandbox/client-api-demo/src/main/webapp:
index.html js/x_app_descriptor_view_jason.js
js/x_host_descriptor_edit_json.js js/x_host_descriptor_save_json.js
js/x_host_descriptor_view_json.js
Author: heshan
Date: Fri Nov 16 21:16:31 2012
New Revision: 1410574
URL: http://svn.apache.org/viewvc?rev=1410574&view=rev
Log:
Using the trunk version of rest services.
Modified:
airavata/sandbox/client-api-demo/src/main/webapp/index.html
airavata/sandbox/client-api-demo/src/main/webapp/js/x_app_descriptor_view_jason.js
airavata/sandbox/client-api-demo/src/main/webapp/js/x_host_descriptor_edit_json.js
airavata/sandbox/client-api-demo/src/main/webapp/js/x_host_descriptor_save_json.js
airavata/sandbox/client-api-demo/src/main/webapp/js/x_host_descriptor_view_json.js
Modified: airavata/sandbox/client-api-demo/src/main/webapp/index.html
URL: http://svn.apache.org/viewvc/airavata/sandbox/client-api-demo/src/main/webapp/index.html?rev=1410574&r1=1410573&r2=1410574&view=diff
==============================================================================
--- airavata/sandbox/client-api-demo/src/main/webapp/index.html (original)
+++ airavata/sandbox/client-api-demo/src/main/webapp/index.html Fri Nov 16 21:16:31 2012
@@ -51,10 +51,10 @@
<li><a href="x_host_descriptor_edit_json.html">Edit Host Descriptors</a></li>
<!--<li><a href="x_app_descriptor_save_json.html">Save App Descriptors</a></li>-->
<li class="nav-header">Others</li>
- <li><a href="html/x_host_descriptor_save.html">Save Host Descriptors</a></li>
- <li><a href="html/x_app_descriptor_save.html">Save App Descriptors</a></li>
- <li><a href="html/x_host_display.html">Registry Service Test Get</a></li>
- <li><a href="html/x_host_save.html">Registry Service Test Post</a></li>
+ <!--<li><a href="html/x_host_descriptor_save.html">Save Host Descriptors</a></li>-->
+ <!--<li><a href="html/x_app_descriptor_save.html">Save App Descriptors</a></li>-->
+ <!--<li><a href="html/x_host_display.html">Registry Service Test Get</a></li>-->
+ <!--<li><a href="html/x_host_save.html">Registry Service Test Post</a></li>-->
</ul>
</div>
</div>
Modified: airavata/sandbox/client-api-demo/src/main/webapp/js/x_app_descriptor_view_jason.js
URL: http://svn.apache.org/viewvc/airavata/sandbox/client-api-demo/src/main/webapp/js/x_app_descriptor_view_jason.js?rev=1410574&r1=1410573&r2=1410574&view=diff
==============================================================================
--- airavata/sandbox/client-api-demo/src/main/webapp/js/x_app_descriptor_view_jason.js (original)
+++ airavata/sandbox/client-api-demo/src/main/webapp/js/x_app_descriptor_view_jason.js Fri Nov 16 21:16:31 2012
@@ -20,7 +20,6 @@
$(document).ready(function(){
$('[name="btn2"]').click(function(){
-
$.ajax({
beforeSend: function(x) {
if (x && x.overrideMimeType) {
@@ -31,38 +30,10 @@ $(document).ready(function(){
dataType: "json",
contentType: "application/json;charset=utf-8",
url: "http://localhost:7080/airavata-registry-rest-services/registry/api/applicationdescriptor/alldescriptors",
- /*success: function(data, status, settings) {
- var keys=[],result='';
- $.each(data.applicationDescriptors,function(i,row){
- $.each(row,function(key,value){
- if ($.inArray(key,keys)==-1) {
- if (key != "serviceDescriptor") {
- keys.push(key);
- }
- }
- })
- });
- result+="<thead><tr>";
- $.each(keys,function(i,key){
- result+="<th>"+key+"<\/th>";
- });
- result+="<\/tr><\/thead><tbody>";
- $.each(data.hostDescriptions,function(i,row){
- result+="<tr>";
- $.each(keys,function(i,key){
- result+="<td>"+ (row[key]||'') + "<\/td>";
- });
- result+="<\/tr>";
- });
- result+="<\/tbody>";
- $('#display').html(result);
- },*/
error: function(ajaxrequest, ajaxOptions, thrownError){
alert(thrownError);
}
-
}).done(function(msg) {
-// alert( "Data Saved: " + JSON.stringify(msg));
$("#jason-text").html(JSON.stringify(msg));
});
Modified: airavata/sandbox/client-api-demo/src/main/webapp/js/x_host_descriptor_edit_json.js
URL: http://svn.apache.org/viewvc/airavata/sandbox/client-api-demo/src/main/webapp/js/x_host_descriptor_edit_json.js?rev=1410574&r1=1410573&r2=1410574&view=diff
==============================================================================
--- airavata/sandbox/client-api-demo/src/main/webapp/js/x_host_descriptor_edit_json.js (original)
+++ airavata/sandbox/client-api-demo/src/main/webapp/js/x_host_descriptor_edit_json.js Fri Nov 16 21:16:31 2012
@@ -32,6 +32,8 @@ function initButtons() {
var hostEndpoint = $("#hostEndpoint1").val();
var gatekeeperEndpoint = $("#gatekeeperEndpoint1").val();
+ var updateUrl = "http://localhost:7080/airavata-rest-services/registry/api/descriptors/hostdescriptor/update";
+
if (("" == hostEndpoint) || ("" == gatekeeperEndpoint)) {
alert("if Case");
$.ajax({
@@ -44,7 +46,7 @@ function initButtons() {
type: "POST",
dataType: "json",
contentType: "application/json;charset=utf-8",
- url: "http://localhost:7080/airavata-registry-rest-services/registry/api/hostdescriptor/update",
+ url: updateUrl,
data: JSON.stringify({
"hostname": hostName,
"hostAddress": hostAddress
@@ -63,7 +65,7 @@ function initButtons() {
type: "POST",
dataType: "json",
contentType: "application/json;charset=utf-8",
- url: "http://localhost:7080/airavata-registry-rest-services/registry/api/hostdescriptor/update",
+ url: updateUrl,
data: JSON.stringify({
"hostname": hostName,
"hostAddress": hostAddress,
@@ -79,6 +81,7 @@ function initButtons() {
$("#deleteHostButton").click(function(){
var hostName = $("#hostName1").val();
+ var deleteUrl = "http://localhost:7080/airavata-rest-services/registry/api/descriptors/hostdescriptor/delete";
alert("Delete button clicked!");
$.ajax({
@@ -90,7 +93,7 @@ function initButtons() {
type: "DELETE",
// dataType: "json",
contentType: "application/json;charset=utf-8",
- url: "http://localhost:7080/airavata-registry-rest-services/registry/api/hostdescriptor/delete",
+ url: deleteUrl,
data: {
"hostName": hostName
}
Modified: airavata/sandbox/client-api-demo/src/main/webapp/js/x_host_descriptor_save_json.js
URL: http://svn.apache.org/viewvc/airavata/sandbox/client-api-demo/src/main/webapp/js/x_host_descriptor_save_json.js?rev=1410574&r1=1410573&r2=1410574&view=diff
==============================================================================
--- airavata/sandbox/client-api-demo/src/main/webapp/js/x_host_descriptor_save_json.js (original)
+++ airavata/sandbox/client-api-demo/src/main/webapp/js/x_host_descriptor_save_json.js Fri Nov 16 21:16:31 2012
@@ -57,6 +57,9 @@ function initButtons() {
}
console.log(xmlString);
+ var url = "http://localhost:7080/airavata-rest-services/registry/api/descriptors/hostdescriptor/save"
+// var url = "http://localhost:7080/airavata-registry-rest-services/registry/api/hostdescriptor/save";
+
if (("" == hostEndpoint) || ("" == gatekeeperEndpoint)) {
alert("if Case");
$.ajax({
@@ -70,7 +73,7 @@ function initButtons() {
type: "POST",
dataType: "json",
contentType: "application/json;charset=utf-8",
- url: "http://localhost:7080/airavata-registry-rest-services/registry/api/hostdescriptor/save",
+ url: url,
data: JSON.stringify({
"hostname": hostName,
"hostAddress": hostAddress
@@ -89,7 +92,7 @@ function initButtons() {
type: "POST",
dataType: "json",
contentType: "application/json;charset=utf-8",
- url: "http://localhost:7080/airavata-registry-rest-services/registry/api/hostdescriptor/save",
+ url: url,
data: JSON.stringify({
"hostname": hostName,
"hostAddress": hostAddress,
Modified: airavata/sandbox/client-api-demo/src/main/webapp/js/x_host_descriptor_view_json.js
URL: http://svn.apache.org/viewvc/airavata/sandbox/client-api-demo/src/main/webapp/js/x_host_descriptor_view_json.js?rev=1410574&r1=1410573&r2=1410574&view=diff
==============================================================================
--- airavata/sandbox/client-api-demo/src/main/webapp/js/x_host_descriptor_view_json.js (original)
+++ airavata/sandbox/client-api-demo/src/main/webapp/js/x_host_descriptor_view_json.js Fri Nov 16 21:16:31 2012
@@ -20,6 +20,7 @@
$(document).ready(function(){
$('[name="btn2"]').click(function(){
+ var url = "http://localhost:7080/airavata-rest-services/registry/api/descriptors/get/hostdescriptors";
$.ajax({
beforeSend: function(x) {
@@ -30,7 +31,7 @@ $(document).ready(function(){
type: "GET",
dataType: "json",
contentType: "application/json;charset=utf-8",
- url: "http://localhost:7080/airavata-registry-rest-services/registry/api/get/hostdescriptors",
+ url: url,
success: function(data, status, settings) {
var keys=[],result='';
$.each(data.hostDescriptions,function(i,row){