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/05 16:37:40 UTC
svn commit: r1405839 - in /airavata/sandbox/client-api-demo/src/main/webapp:
x_app_descriptor_save_json.html x_app_descriptor_save_json.js
x_host_descriptor_save_json.html
Author: heshan
Date: Mon Nov 5 15:37:39 2012
New Revision: 1405839
URL: http://svn.apache.org/viewvc?rev=1405839&view=rev
Log:
Updating the UIs.
Modified:
airavata/sandbox/client-api-demo/src/main/webapp/x_app_descriptor_save_json.html
airavata/sandbox/client-api-demo/src/main/webapp/x_app_descriptor_save_json.js
airavata/sandbox/client-api-demo/src/main/webapp/x_host_descriptor_save_json.html
Modified: airavata/sandbox/client-api-demo/src/main/webapp/x_app_descriptor_save_json.html
URL: http://svn.apache.org/viewvc/airavata/sandbox/client-api-demo/src/main/webapp/x_app_descriptor_save_json.html?rev=1405839&r1=1405838&r2=1405839&view=diff
==============================================================================
--- airavata/sandbox/client-api-demo/src/main/webapp/x_app_descriptor_save_json.html (original)
+++ airavata/sandbox/client-api-demo/src/main/webapp/x_app_descriptor_save_json.html Mon Nov 5 15:37:39 2012
@@ -33,9 +33,7 @@ Output Name *: <input type="text
Output Type *: <input type="text" id="outputType1" name="outputType1" value="String" size="50"><br/>
<p2><b><i>Add outputs</i></b></p2><br/>
-
-<button name="btn2">Save Application</button>
-
+<button name="saveAppButton">Save Application</button>
<style>
p { background:#b0c4de; font-weight:bold; cursor:pointer;
Modified: airavata/sandbox/client-api-demo/src/main/webapp/x_app_descriptor_save_json.js
URL: http://svn.apache.org/viewvc/airavata/sandbox/client-api-demo/src/main/webapp/x_app_descriptor_save_json.js?rev=1405839&r1=1405838&r2=1405839&view=diff
==============================================================================
--- airavata/sandbox/client-api-demo/src/main/webapp/x_app_descriptor_save_json.js (original)
+++ airavata/sandbox/client-api-demo/src/main/webapp/x_app_descriptor_save_json.js Mon Nov 5 15:37:39 2012
@@ -33,7 +33,7 @@ $(document).ready(function(){
"<input type="text" id="outputType" + outputCount + "" name="outputType" + outputCount + "" size="50"><br/>");
});
- $('[name="btn2"]').click(function(){
+ $('[name="saveAppButton"]').click(function(){
var appName = $("#appName1").val();
var hostName = $("#hostName1").val();
var serviceName = $("#serviceName1").val();
Modified: airavata/sandbox/client-api-demo/src/main/webapp/x_host_descriptor_save_json.html
URL: http://svn.apache.org/viewvc/airavata/sandbox/client-api-demo/src/main/webapp/x_host_descriptor_save_json.html?rev=1405839&r1=1405838&r2=1405839&view=diff
==============================================================================
--- airavata/sandbox/client-api-demo/src/main/webapp/x_host_descriptor_save_json.html (original)
+++ airavata/sandbox/client-api-demo/src/main/webapp/x_host_descriptor_save_json.html Mon Nov 5 15:37:39 2012
@@ -6,6 +6,9 @@
</head>
<body>
+<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js" type="text/javascript"></script>
+<script type="text/javascript" src="x_host_descriptor_save_json.js" ></script>
+
<b> Register Host Description </b>
<br/>
@@ -25,117 +28,10 @@ Host Type : <select name="drop
<br/>
</div>
-<button name="btn2">Save Host</button>
+<button name="saveHostButton">Save Host</button>
-<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js" type="text/javascript"></script>
<script>
- function xmlToString(xml) {
- var xmlData = $(xml);
- var xmlString;
- if (window.ActiveXObject) {
- xmlString = xmlData.xml;
- } else {
- var oSerializer = new XMLSerializer();
- xmlString = oSerializer.serializeToString(xmlData[0]);
- }
- console.log(xmlString);
- return xmlString;
- }
-
- $(document).ready(function(){
- $(window).load(function () {
- $("div").hide();
- });
-
- $("select[name='drop1']").change(function() {
- //alert($(this).val());
- if("Local" == $(this).val()) {
- $("div").hide();
- } else {
- $("div").show();
- }
- });
-
- $('[name="btn2"]').click(function(){
- //alert($(this).val());
- var hostName = $("#hostName1").val();
- var hostAddress = $("#hostAddress1").val();
- var hostEndpoint = $("#hostEndpoint1").val();
- alert(hostEndpoint);
- alert(hostEndpoint);
- alert("hostEndpoint null :" + hostEndpoint == null);
- alert("hostEndpoint empty :" + hostEndpoint == "");
- var gatekeeperEndpoint = $("#gatekeeperEndpoint1").val();
- 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>');
-
- var xmlData= $(xml);
- var xmlString;
- if (window.ActiveXObject){
- xmlString = xmlData.xml;
- } else {
- var oSerializer = new XMLSerializer();
- xmlString = oSerializer.serializeToString(xmlData[0]);
- }
- console.log(xmlString);
-
- alert(hostName);
- alert(hostAddress);
- alert(xmlString);
-
-// if ($("select[name='drop1']").val() == "Local") {
- if (("" == hostEndpoint) || ("" == gatekeeperEndpoint)) {
- alert("if Case");
- $.ajax({
-// headers: {
-// Accept : "text/plain; charset=utf-8"
-// },
- beforeSend: function(x) {
- if (x && x.overrideMimeType) {
- x.overrideMimeType("application/j-son;charset=UTF-8");
- }
- },
-
- type: "POST",
- dataType: "json",
- contentType: "application/json;charset=utf-8",
-// url: "http://localhost:7080/airavata-registry-rest-services/registry/api/hostdescriptor/save/jason",
- url: "http://localhost:6060/airavata-registry-rest-services/registry/api/hostdescriptor/save/jason",
- data: JSON.stringify({
- "hostName": hostName,
- "hostAddress": hostAddress
- })
- }).done(function( msg ) {
- alert( "Data Saved: " + msg );
- });
- } else {
- alert("end Case");
- $.ajax({
-// headers: {
-// Accept : "text/plain; charset=utf-8"
-// },
- beforeSend: function(x) {
- if (x && x.overrideMimeType) {
- x.overrideMimeType("application/j-son;charset=UTF-8");
- }
- },
- type: "POST",
- dataType: "json",
- contentType: "application/json;charset=utf-8",
-// url: "http://localhost:7080/airavata-registry-rest-services/registry/api/hostdescriptor/save/jason",
- url: "http://localhost:6060/airavata-registry-rest-services/registry/api/hostdescriptor/save/jason",
- data: JSON.stringify({
- "hostName": hostName,
- "hostAddress": hostAddress,
- "hostEndpoint" : hostEndpoint,
- "gatekeeperEndpoint" : gatekeeperEndpoint
- })
- }).done(function( msg ) {
- alert( "Data Saved: " + msg );
- });
- }
- });
- });
</script>
</body>