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/22 22:05:12 UTC

svn commit: r1401062 - in /airavata/sandbox/client-api-demo: ./ src/main/java/org/sample/airavata/api/ src/main/webapp/

Author: heshan
Date: Mon Oct 22 20:05:12 2012
New Revision: 1401062

URL: http://svn.apache.org/viewvc?rev=1401062&view=rev
Log:
Updating the UIs. Testing jquery rest calls.

Added:
    airavata/sandbox/client-api-demo/src/main/webapp/x_host_display.html
    airavata/sandbox/client-api-demo/src/main/webapp/x_host_save.html
Modified:
    airavata/sandbox/client-api-demo/deploy.sh
    airavata/sandbox/client-api-demo/src/main/java/org/sample/airavata/api/DescriptorRegistrationSample.java
    airavata/sandbox/client-api-demo/src/main/webapp/execute_app_result.jsp
    airavata/sandbox/client-api-demo/src/main/webapp/index.jsp
    airavata/sandbox/client-api-demo/src/main/webapp/register_app_result.jsp
    airavata/sandbox/client-api-demo/src/main/webapp/register_host_result.jsp

Modified: airavata/sandbox/client-api-demo/deploy.sh
URL: http://svn.apache.org/viewvc/airavata/sandbox/client-api-demo/deploy.sh?rev=1401062&r1=1401061&r2=1401062&view=diff
==============================================================================
--- airavata/sandbox/client-api-demo/deploy.sh (original)
+++ airavata/sandbox/client-api-demo/deploy.sh Mon Oct 22 20:05:12 2012
@@ -2,16 +2,26 @@
 echo "Building the source."
 mvn clean install -Dmaven.test.skip=true -o
 
-echo "Removing the old war ..."
+echo "Removing the old airavata-registry-rest-services ..."
+rm -r -f /home/heshan/Dev/sc12/demo1/apache-tomcat-7.0.28/webapps/client-api-demo*
+echo "Copying the airavata-registry-rest-services.war to webapps"
+cp /home/heshan/Dev/apache/trunk/airavata/sandbox/airavata-registry-rest/target/airavata-registry-rest-services.war /home/heshan/Dev/sc12/demo1/apache-tomcat-7.0.28/webapps
+
+echo "Removing the old client-api-demo war ..."
 rm -r -f /home/heshan/Dev/sc12/demo1/apache-tomcat-7.0.28/webapps/client-api-demo*
 echo "Copying the client-api-demo war to webapps"
 cp target/client-api-demo.war /home/heshan/Dev/sc12/demo1/apache-tomcat-7.0.28/webapps
 
+#cp /home/heshan/Dev/IdeaProjects/RESTfulExample/target/RESTfulExample.war /home/heshan/Dev/sc12/demo1/apache-tomcat-7.0.28/webapps
+
 sleep 10
 echo "Copying the repository.properties to webapp ..."
-cp /home/heshan/Dev/sc12/demo1/repository.properties /home/heshan/Dev/sc12/demo1/apache-tomcat-7.0.28/webapps/client-api-demo/WEB-INF/classes/
+cp /home/heshan/Dev/sc12/demo1/repository.properties /home/heshan/Dev/sc12/demo1/apache-tomcat-7.0.28/webapps/client-api-demo/WEB-INF/classes/ -v
 echo "Copying the deployment.properties to webapp ..."
-cp /home/heshan/Dev/sc12/demo1/deployment.properties /home/heshan/Dev/sc12/demo1/apache-tomcat-7.0.28/webapps/client-api-demo/
+cp /home/heshan/Dev/sc12/demo1/deployment.properties /home/heshan/Dev/sc12/demo1/apache-tomcat-7.0.28/webapps/client-api-demo/ -v
 echo "Copying the deployment.properties to webapp ... again to classes TODO : Fix this"
 cp /home/heshan/Dev/sc12/demo1/deployment.properties /home/heshan/Dev/sc12/demo1/apache-tomcat-7.0.28/webapps/client-api-demo/WEB-INF/classes/
 
+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
+

Modified: airavata/sandbox/client-api-demo/src/main/java/org/sample/airavata/api/DescriptorRegistrationSample.java
URL: http://svn.apache.org/viewvc/airavata/sandbox/client-api-demo/src/main/java/org/sample/airavata/api/DescriptorRegistrationSample.java?rev=1401062&r1=1401061&r2=1401062&view=diff
==============================================================================
--- airavata/sandbox/client-api-demo/src/main/java/org/sample/airavata/api/DescriptorRegistrationSample.java (original)
+++ airavata/sandbox/client-api-demo/src/main/java/org/sample/airavata/api/DescriptorRegistrationSample.java Mon Oct 22 20:05:12 2012
@@ -119,10 +119,7 @@ public class DescriptorRegistrationSampl
         }
     }
 
-    public static void execute(String username,
-                               String password,
-                               String registryRMIURI,
-                               String trustedCertLoc,
+    public static void execute(String trustedCertLoc,
                                String serviceName,
                                String inputName,
                                String inputValue,

Modified: airavata/sandbox/client-api-demo/src/main/webapp/execute_app_result.jsp
URL: http://svn.apache.org/viewvc/airavata/sandbox/client-api-demo/src/main/webapp/execute_app_result.jsp?rev=1401062&r1=1401061&r2=1401062&view=diff
==============================================================================
--- airavata/sandbox/client-api-demo/src/main/webapp/execute_app_result.jsp (original)
+++ airavata/sandbox/client-api-demo/src/main/webapp/execute_app_result.jsp Mon Oct 22 20:05:12 2012
@@ -21,10 +21,6 @@
 //            System.out.println("My proxy server   : " + myProxyServer);
 //            System.out.println("My proxy username : " + myProxyUsername);
 //            System.out.println("My proxy password : " + myProxyPassword);
-
-            final String username = request.getParameter("userName");
-            final String password = request.getParameter("password");
-            final String registryURL = request.getParameter("registryURL");
             final String trustedCertLoc = request.getParameter("certLocation");
 
 
@@ -37,7 +33,7 @@
 
                 new Thread() {
                     public void run() {
-                        DescriptorRegistrationSample.execute(username, password, registryURL, trustedCertLoc,
+                        DescriptorRegistrationSample.execute(trustedCertLoc,
                         serviceName, inputName, inputValue, outputName, myProxyServer, myProxyUsername, myProxyPassword);
                     }
 

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=1401062&r1=1401061&r2=1401062&view=diff
==============================================================================
--- airavata/sandbox/client-api-demo/src/main/webapp/index.jsp (original)
+++ airavata/sandbox/client-api-demo/src/main/webapp/index.jsp Mon Oct 22 20:05:12 2012
@@ -15,5 +15,7 @@
             <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_display.html">Registry Service Test Get</a></h4>
+            <h4><a href="./x_host_save.html">Registry Service Test Post</a></h4>
     </body>
 </html>
\ No newline at end of file

Modified: airavata/sandbox/client-api-demo/src/main/webapp/register_app_result.jsp
URL: http://svn.apache.org/viewvc/airavata/sandbox/client-api-demo/src/main/webapp/register_app_result.jsp?rev=1401062&r1=1401061&r2=1401062&view=diff
==============================================================================
--- airavata/sandbox/client-api-demo/src/main/webapp/register_app_result.jsp (original)
+++ airavata/sandbox/client-api-demo/src/main/webapp/register_app_result.jsp Mon Oct 22 20:05:12 2012
@@ -72,7 +72,7 @@
 
         %>
 
-        out.print("Registration DONE!");
+        Application Registration DONE!
 
     </body>
 </html>
\ No newline at end of file

Modified: airavata/sandbox/client-api-demo/src/main/webapp/register_host_result.jsp
URL: http://svn.apache.org/viewvc/airavata/sandbox/client-api-demo/src/main/webapp/register_host_result.jsp?rev=1401062&r1=1401061&r2=1401062&view=diff
==============================================================================
--- airavata/sandbox/client-api-demo/src/main/webapp/register_host_result.jsp (original)
+++ airavata/sandbox/client-api-demo/src/main/webapp/register_host_result.jsp Mon Oct 22 20:05:12 2012
@@ -30,7 +30,7 @@
 
     System.out.println("Host Registration was successful");
 %>
-out.print("Registration DONE!");
+    Host Registration DONE!
 
 </body>
 </html>
\ No newline at end of file

Added: airavata/sandbox/client-api-demo/src/main/webapp/x_host_display.html
URL: http://svn.apache.org/viewvc/airavata/sandbox/client-api-demo/src/main/webapp/x_host_display.html?rev=1401062&view=auto
==============================================================================
--- airavata/sandbox/client-api-demo/src/main/webapp/x_host_display.html (added)
+++ airavata/sandbox/client-api-demo/src/main/webapp/x_host_display.html Mon Oct 22 20:05:12 2012
@@ -0,0 +1,68 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+        "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+    <title></title>
+</head>
+<body>
+
+Testing .....<br/>
+
+Send an HTTP GET request to a page and get the result back<br/>
+
+<button>Get Workflow Information</button>
+
+
+<!--curl -v http://localhost:9080/airavata-services/registry/api/configuration?key=gfac.url-->
+<!--curl -v http://localhost:7080/airavata-registry-rest-services/registry/api/configuration?key=gfac.url-->
+
+<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js" type="text/javascript"></script>
+<script>
+    console.log("x_host_display javascript loaded!");
+    $(document).ready(function(){
+        $("button").click(function(){
+            console.log("Button click event triggered");
+            $.get("http://localhost:7080/airavata-registry-rest-services/registry/api/configuration?key=gfac.url",function(data,status){
+                alert("Data: " + data + "\nStatus: " + status);
+                $('#dataDiv').html(data);
+                console.log("Status : " + status);
+            });
+        });
+    });
+</script>
+
+<div id="dataDiv"></div>
+
+<script>
+    $(document).ready(function(){
+        $("#hide").click(function(){
+            $("p").hide();
+        });
+        $("#show").click(function(){
+            $("p").show();
+        });
+    });
+</script>
+
+<p>If you click on the "Hide" button, I will disappear.</p>
+<button id="hide">Hide</button>
+<button id="show">Show</button>
+
+</body>
+</html>
+
+
+
+
+
+
+<!--<script src="jquery.js"></script>-->
+<!--<script>-->
+<!--$(document).ready(function(){-->
+<!--$("button").click(function(){-->
+<!--$.get("http://localhost:9080/airavata-services/registry/api/configuration?key=gfac.url",function(data,status){-->
+<!--alert("Data: " + data + "\nStatus: " + status);-->
+<!--});-->
+<!--});-->
+<!--});-->
+<!--</script>-->
\ No newline at end of file

Added: 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=1401062&view=auto
==============================================================================
--- airavata/sandbox/client-api-demo/src/main/webapp/x_host_save.html (added)
+++ airavata/sandbox/client-api-demo/src/main/webapp/x_host_save.html Mon Oct 22 20:05:12 2012
@@ -0,0 +1,47 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+        "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+    <title></title>
+</head>
+<body>
+
+Send an HTTP POST
+
+<button>Get Workflow Information</button>
+
+
+<!--curl -H "Accept: text/plain" -X POST -d "key=dummy-key4&value=dummy-value&date=2012-09-21 04:09:56"
+http://localhost:9080/airavata-services/registry/api/save/configuration-->
+
+<!--$.post("test.php", { name: "John", time: "2pm" } );-->
+
+<!--<script src="jquery.js"></script>-->
+<!--<script>-->
+    <!--$(document).ready(function(){-->
+        <!--$("button").click(function(){-->
+            <!--$.post("http://localhost:9080/airavata-services/registry/api/save/configuration",function(data,status){-->
+                <!--alert("Data: " + data + "\nStatus: " + status);-->
+            <!--});-->
+        <!--});-->
+    <!--});-->
+<!--</script>-->
+
+<!--<script src="jquery.js"></script>-->
+<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js" type="text/javascript"></script>
+<script>
+    $(document).ready(function(){
+        $("button").click(function(){
+//            $.post("http://localhost:9080/airavata-services/registry/api/save/configuration",
+            $.post("http://localhost:7080/airavata-registry-rest-services/airavata-services/registry/api/save/configuration",
+                    { key: "dummy2", value: "date=2012-09-21 04:09:56" } ,function(data,status){
+                alert("Data: " + data + "\nStatus: " + status);
+            });
+        });
+    });
+</script>
+
+
+</body>
+</html>
+