Author: heshan
Date: Tue Oct 30 19:17:03 2012
New Revision: 1403823

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

Added:
    airavata/sandbox/client-api-demo/src/main/webapp/x_app_descritpor_save.html
Modified:
    airavata/sandbox/client-api-demo/deploy.sh
    airavata/sandbox/client-api-demo/src/main/webapp/index.jsp

Modified: airavata/sandbox/client-api-demo/deploy.sh
URL: 
http://svn.apache.org/viewvc/airavata/sandbox/client-api-demo/deploy.sh?rev=1403823&r1=1403822&r2=1403823&view=diff
==============================================================================
--- airavata/sandbox/client-api-demo/deploy.sh (original)
+++ airavata/sandbox/client-api-demo/deploy.sh Tue Oct 30 19:17:03 2012
@@ -25,3 +25,4 @@ cp /home/heshan/Dev/sc12/demo1/deploymen
 echo "Copying jars from airavata/lib to webapps.../lib"
 cp 
/home/heshan/Dev/apache/trunk/airavata/trunk/modules/distribution/target/apache-airavata-0.5-SNAPSHOT/standalone-server/lib/*.jar
 
/home/heshan/Dev/sc12/demo1/apache-tomcat-7.0.28/webapps/client-api-demo/WEB-INF/lib
 
+#chromium-browser 
http://localhost:7080/client-api-demo/x_host_descriptor_save.html

Modified: airavata/sandbox/client-api-demo/src/main/webapp/index.jsp
URL: 
http://svn.apache.org/viewvc/airavata/sandbox/client-api-demo/src/main/webapp/index.jsp?rev=1403823&r1=1403822&r2=1403823&view=diff
==============================================================================
--- airavata/sandbox/client-api-demo/src/main/webapp/index.jsp (original)
+++ airavata/sandbox/client-api-demo/src/main/webapp/index.jsp Tue Oct 30 
19:17:03 2012
@@ -15,8 +15,12 @@
             <%--<h4><a href="./register_app.jsp">Register an 
Application</a></h4>--%>
             <%--<h4><a href="./execute_app.jsp">Execute an 
Application</a></h4>--%>
             <br>
+            <h4><a href="./x_host_descriptor_save.html">Save Host 
Descriptor</a></h4>
+            <h4><a href="./x_app_descriptor_save.html">Save App 
Descriptor</a></h4>
+
             <h4><a href="./x_host_display.html">Registry Service Test 
Get</a></h4>
             <h4><a href="./x_host_save.html">Registry Service Test 
Post</a></h4>
-            <h4><a href="./x_host_descriptor_save.html">Save Host 
Descriptor</a></h4>
+
+            <h4><a href="./x_host_descriptor_save_jason.html">Save Host 
Descriptor - jason</a></h4>
     </body>
 </html>
\ No newline at end of file

Added: 
airavata/sandbox/client-api-demo/src/main/webapp/x_app_descritpor_save.html
URL: 
http://svn.apache.org/viewvc/airavata/sandbox/client-api-demo/src/main/webapp/x_app_descritpor_save.html?rev=1403823&view=auto
==============================================================================
--- airavata/sandbox/client-api-demo/src/main/webapp/x_app_descritpor_save.html 
(added)
+++ airavata/sandbox/client-api-demo/src/main/webapp/x_app_descritpor_save.html 
Tue Oct 30 19:17:03 2012
@@ -0,0 +1,133 @@
+<!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/>
+//TODO: Add drop down
+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>
+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/>
+//TODO: Add drop down
+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/>
+//TODO: Add drop down
+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(){
+            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>


Reply via email to