blob: 7c738948ca79ac1c2ebf1652daa0c0237e3fba80 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
</head>
<body>
<b> Register Host Description </b><br/>
Application Name *: <input type="text" id="appName1" name="appName" value="EchoLocal" size="50"><br/>
Executable location *: <input type="text" id="exeuctableLocation1" name="exeuctableLocation" value="/bin/echo" size="50"><br/>
Scratch Working Dir.*: <input type="text" id="scratchWorkingDirectory1" name="scratchWorkingDirectory" value="/scratch/01437/ogce/test" size="50"><br/>
Host Name *: <input type="text" name="hostName" id="hostName1" size="75"><br/>
Project Acc. number : <input type="text" id="projAccNumber1" name="projAccNumber" value="TG-STA110014S" size="50"><br/>
Queue Name : <input type="text" id="queueName1" name="queueName" value="development" size="50"><br/>
CPU count : <input type="text" id="cpuCount1" name="cpuCount" value="1" size="50"><br/>
Node count : <input type="text" id="nodeCount1" name="nodeCount" value="1" size="50"><br/>
Max memory : <input type="text" id="maxMemory1" name="maxMemory" value="100" size="50"><br/>
<b>SERVICE</b><br/>
Service Name *: <input type="text" id="serviceName1" name="serviceName" value="SimpleEcho" size="50"><br/>
Input Name *: <input type="text" id="inputName1" name="inputName" value="echo_input" size="50"><br/>
Input Type *: <input type="text" id="inputType1" name="inputType" value="String" size="50"><br/>
Output Name *: <input type="text" id="outputName1" name="outputName" value="echo_output" size="50"><br/>
Output Type *: <input type="text" id="outputType1" name="outputType" value="String" size="50"><br/>
<button name="btn2">Save Application</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());
alert("btn2 clicked");
var appName = $("#appName1").val();
var exeuctableLocation = $("#exeuctableLocation1").val();
var scratchWorkingDirectory = $("#scratchWorkingDirectory1").val();
var hostName = $("#hostName1").val();
//alert($(this).val());
var projAccNumber = $("#projAccNumber1").val();
var queueName = $("#queueName1").val();
var cpuCount = $("#cpuCount1").val();
var nodeCount = $("#nodeCount1").val();
var maxMemory = $("#maxMemory1").val();
var serviceName = $("#serviceName1").val();
var inputName1 = $("#inputName1").val();
var inputType1 = $("#inputType1").val();
var outputName = $("#outputName1").val();
var outputType = $("#outputType1").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);
$.ajax({
headers: {
Accept : "text/plain; charset=utf-8"
},
/*beforeSend: function(xhr, s) {
xhr.setRequestHeader("Accept-Encoding" ,"");
xhr.setRequestHeader("Content-Type", "text/xml");
},*/
type: "POST",
url: "http://localhost:7080/airavata-registry-rest-services/registry/api/applicationdescriptor/build/save/test",
data: {
appName : appName,
exeuctableLocation : exeuctableLocation,
scratchWorkingDirectory : scratchWorkingDirectory,
hostName: hostName,
projAccNumber : projAccNumber,
queueName : queueName,
cpuCount : cpuCount,
nodeCount : nodeCount,
maxMemory : maxMemory,
serviceName : serviceName,
inputName1 : inputName1,
inputType1 : inputType1,
outputName : outputName,
outputType : outputType
}
}).done(function( msg ) {
alert( "Data Saved: " + msg );
});
});
});
</script>
</body>
</html>