airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hes...@apache.org
Subject svn commit: r1405933 - in /airavata/sandbox/client-api-demo: ./ src/main/webapp/ src/main/webapp/html/ src/main/webapp/js/ src/main/webapp/jsp/
Date Mon, 05 Nov 2012 20:16:19 GMT
Author: heshan
Date: Mon Nov  5 20:16:18 2012
New Revision: 1405933

URL: http://svn.apache.org/viewvc?rev=1405933&view=rev
Log:
Adding Host edit functionality (TODO: dynmic population of data based on user input. 
Moved unused html to a seperate directory.

Added:
    airavata/sandbox/client-api-demo/src/main/webapp/html/
    airavata/sandbox/client-api-demo/src/main/webapp/html/x_app_descriptor_save.html
      - copied unchanged from r1405927, airavata/sandbox/client-api-demo/src/main/webapp/x_app_descriptor_save.html
    airavata/sandbox/client-api-demo/src/main/webapp/html/x_host_descriptor_save.html
      - copied unchanged from r1405927, airavata/sandbox/client-api-demo/src/main/webapp/x_host_descriptor_save.html
    airavata/sandbox/client-api-demo/src/main/webapp/html/x_host_display.html
      - copied unchanged from r1405927, airavata/sandbox/client-api-demo/src/main/webapp/x_host_display.html
    airavata/sandbox/client-api-demo/src/main/webapp/html/x_host_save.html
      - copied unchanged from r1405927, airavata/sandbox/client-api-demo/src/main/webapp/x_host_save.html
    airavata/sandbox/client-api-demo/src/main/webapp/js/x_host_descriptor_edit_json.js
    airavata/sandbox/client-api-demo/src/main/webapp/x_host_descriptor_edit_json.html
Removed:
    airavata/sandbox/client-api-demo/src/main/webapp/x_app_descriptor_save.html
    airavata/sandbox/client-api-demo/src/main/webapp/x_host_descriptor_save.html
    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/pom.xml
    airavata/sandbox/client-api-demo/src/main/webapp/index.html
    airavata/sandbox/client-api-demo/src/main/webapp/jsp/index.jsp

Modified: airavata/sandbox/client-api-demo/pom.xml
URL: http://svn.apache.org/viewvc/airavata/sandbox/client-api-demo/pom.xml?rev=1405933&r1=1405932&r2=1405933&view=diff
==============================================================================
--- airavata/sandbox/client-api-demo/pom.xml (original)
+++ airavata/sandbox/client-api-demo/pom.xml Mon Nov  5 20:16:18 2012
@@ -24,7 +24,7 @@
         <jackrabbit.version>2.2.7</jackrabbit.version>
         <logback.version>0.9.20</logback.version>
         <org.slf4j.version>1.6.1</org.slf4j.version>
-        <log4j.version>1.2.16</log4j.version>
+        <log4j.version>1.2.15</log4j.version>
         <axiom.version>1.2.8</axiom.version>
         <surefire.version>2.12</surefire.version>
         <jcr.version>2.0</jcr.version>
@@ -101,6 +101,12 @@
             <groupId>org.apache.jackrabbit</groupId>
             <artifactId>jackrabbit-core</artifactId>
             <version>${jackrabbit.version}</version>
+            <!--<exclusions>-->
+                <!--<exclusion>-->
+                    <!--<groupId>org.slf4j</groupId>-->
+                    <!--<artifactId>jcl-over-slf4j</artifactId>-->
+                <!--</exclusion>-->
+            <!--</exclusions>-->
         </dependency>
         <dependency>
             <groupId>org.apache.jackrabbit</groupId>
@@ -308,6 +314,11 @@
             <version>${airavata.version}</version>
         </dependency>
         <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+            <version>5.0.8</version>
+        </dependency>
+        <dependency>
             <groupId>org.apache.airavata</groupId>
             <artifactId>airavata-workflow-execution-context</artifactId>
             <version>${airavata.version}</version>

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=1405933&r1=1405932&r2=1405933&view=diff
==============================================================================
--- airavata/sandbox/client-api-demo/src/main/webapp/index.html (original)
+++ airavata/sandbox/client-api-demo/src/main/webapp/index.html Mon Nov  5 20:16:18 2012
@@ -29,10 +29,10 @@
 						<li><a href="x_host_descriptor_save_json.html">Save 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="x_host_descriptor_save.html">Save Host	Descriptors</a></li>
-						<li><a href="x_app_descriptor_save.html">Save App Descriptors</a></li>
-						<li><a href="x_host_display.html">Registry Service Test	Get</a></li>
-						<li><a href="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>

Added: 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=1405933&view=auto
==============================================================================
--- airavata/sandbox/client-api-demo/src/main/webapp/js/x_host_descriptor_edit_json.js (added)
+++ airavata/sandbox/client-api-demo/src/main/webapp/js/x_host_descriptor_edit_json.js Mon
Nov  5 20:16:18 2012
@@ -0,0 +1,84 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+function initButtons() {
+    $("#hostType").change(function() {
+        if("Local" == $(this).val()) {
+            $(".endpoint").hide();
+        } else {
+            $(".endpoint").show();
+        }
+    });
+
+    $("#saveHostButton").click(function(){
+        var hostName = $("#hostName1").val();
+        var hostAddress = $("#hostAddress1").val();
+        var hostEndpoint = $("#hostEndpoint1").val();
+        var gatekeeperEndpoint = $("#gatekeeperEndpoint1").val();
+
+        if (("" == hostEndpoint) || ("" == gatekeeperEndpoint)) {
+            alert("if Case");
+            $.ajax({
+
+                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/update",
+                data: JSON.stringify({
+                    "hostname": hostName,
+                    "hostAddress": hostAddress
+                })
+            }).done(function( msg ) {
+                    alert( "Data Saved: " + msg );
+                });
+        } else {
+            alert("end Case");
+            $.ajax({
+                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/update",
+                data: JSON.stringify({
+                    "hostname": hostName,
+                    "hostAddress": hostAddress,
+                    "hostEndpoint" : hostEndpoint,
+                    "gatekeeperEndpoint" : gatekeeperEndpoint
+                })
+            }).done(function( msg ) {
+                    alert( "Data Saved: " + msg );
+                });
+        }
+
+    });
+}
+
+$(document).ready(function(){
+    $(".endpoint").hide();
+    initButtons();
+});
\ No newline at end of file

Modified: airavata/sandbox/client-api-demo/src/main/webapp/jsp/index.jsp
URL: http://svn.apache.org/viewvc/airavata/sandbox/client-api-demo/src/main/webapp/jsp/index.jsp?rev=1405933&r1=1405932&r2=1405933&view=diff
==============================================================================
--- airavata/sandbox/client-api-demo/src/main/webapp/jsp/index.jsp (original)
+++ airavata/sandbox/client-api-demo/src/main/webapp/jsp/index.jsp Mon Nov  5 20:16:18 2012
@@ -22,11 +22,11 @@
             <h4><a href="../x_host_descriptor_save_json.html">Save Host Descriptor
- jason</a></h4>
             <h4><a href="../x_app_descriptor_save_json.html">Save App Descriptor
- Jason</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="../html/x_host_descriptor_save.html">Save Host Descriptor</a></h4>
+            <h4><a href="../html/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="../html/x_host_display.html">Registry Service Test Get</a></h4>
+            <h4><a href="../html/x_host_save.html">Registry Service Test Post</a></h4>
 
     </body>
 </html>
\ No newline at end of file

Added: airavata/sandbox/client-api-demo/src/main/webapp/x_host_descriptor_edit_json.html
URL: http://svn.apache.org/viewvc/airavata/sandbox/client-api-demo/src/main/webapp/x_host_descriptor_edit_json.html?rev=1405933&view=auto
==============================================================================
--- airavata/sandbox/client-api-demo/src/main/webapp/x_host_descriptor_edit_json.html (added)
+++ airavata/sandbox/client-api-demo/src/main/webapp/x_host_descriptor_edit_json.html Mon
Nov  5 20:16:18 2012
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <title>Update Host Description</title>
+    <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen">
+    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js" type="text/javascript"></script>
+    <script src="js/x_host_descriptor_edit_json.js"></script>
+</head>
+<body>
+
+<div class="navbar navbar-inverse navbar-fixed-top">
+    <div class="navbar-inner">
+        <div class="container-fluid">
+            <a class="brand" href="">Airavata API Demo</a>
+        </div>
+    </div>
+</div>
+<br><br>
+
+
+<h3>Update Host Description</h3>
+<div class="well row">
+    <div class="span7">
+        <p class="span7">
+            <label class="span3">Host Name</label><input class="span4" type="text"
name="hostName" id="hostName1" size="75">
+            <label class="span3">Host Address</label><input class="span4"
type="text" name="hostAddress" id="hostAddress1" size="75">
+            <label class="span3">Host Type</label> <select class="span4" id="hostType">
+            <option selected="selected">Local</option>
+            <option>Globus</option>
+        </select>
+            <label class="span3 endpoint">Host Endpoint</label><input class="span4
endpoint" type="text" name="hostEndpoint" id="hostEndpoint1" size="75">
+            <label class="span3 endpoint">Gatekeeper Endpoint</label><input
class="span4 endpoint" type="text" name="gatekeeperEndpoint" id="gatekeeperEndpoint1" size="75">
+        </p>
+    </div>
+</div>
+<button class="btn btn-primary btn-medium" id="saveHostButton">Save	Host</button>
+
+</body>
+</html>



Mime
View raw message