airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ami...@apache.org
Subject svn commit: r1522719 - in /airavata/trunk: modules/rest/client/ modules/rest/client/src/main/java/org/apache/airavata/rest/utils/ modules/security/src/main/java/org/apache/airavata/security/util/ samples/sample-gateway/ samples/sample-gateway/src/main/...
Date Thu, 12 Sep 2013 20:38:20 GMT
Author: amilaj
Date: Thu Sep 12 20:38:19 2013
New Revision: 1522719

URL: http://svn.apache.org/r1522719
Log:
Attempting to fix AIRAVATA-914. And also adding some improvments made to sample gateway

Added:
    airavata/trunk/samples/sample-gateway/src/main/webapp/gateway/job_execute.jsp
    airavata/trunk/samples/sample-gateway/src/main/webapp/gateway/logout.jsp
    airavata/trunk/samples/sample-gateway/src/main/webapp/images/
Modified:
    airavata/trunk/modules/rest/client/pom.xml
    airavata/trunk/modules/rest/client/src/main/java/org/apache/airavata/rest/utils/BasicAuthHeaderUtil.java
    airavata/trunk/modules/security/src/main/java/org/apache/airavata/security/util/PasswordDigester.java
    airavata/trunk/samples/sample-gateway/pom.xml
    airavata/trunk/samples/sample-gateway/src/main/java/org/apache/airavata/sample/gateway/SampleGateway.java
    airavata/trunk/samples/sample-gateway/src/main/java/org/apache/airavata/sample/gateway/userstore/GatewayUserStore.java
    airavata/trunk/samples/sample-gateway/src/main/webapp/gateway/acs.jsp
    airavata/trunk/samples/sample-gateway/src/main/webapp/gateway/callback.jsp
    airavata/trunk/samples/sample-gateway/src/main/webapp/gateway/job.jsp
    airavata/trunk/samples/sample-gateway/src/main/webapp/gateway/list_users.jsp
    airavata/trunk/samples/sample-gateway/src/main/webapp/gateway/user.jsp
    airavata/trunk/samples/sample-gateway/src/main/webapp/index.jsp
    airavata/trunk/samples/sample-gateway/src/test/java/org/apache/airavata/sample/gateway/executor/WorkflowExecutorTest.java

Modified: airavata/trunk/modules/rest/client/pom.xml
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/rest/client/pom.xml?rev=1522719&r1=1522718&r2=1522719&view=diff
==============================================================================
--- airavata/trunk/modules/rest/client/pom.xml (original)
+++ airavata/trunk/modules/rest/client/pom.xml Thu Sep 12 20:38:19 2013
@@ -24,9 +24,9 @@
 	<artifactId>airavata-rest-client</artifactId>
 	<packaging>jar</packaging>
 	<name>airavata-rest-client</name>
-	<build>
+	<!--build>
 		<finalName>airavata-rest-client</finalName>
-	</build>
+	</build-->
 	<dependencies>
 
 		<dependency>

Modified: airavata/trunk/modules/rest/client/src/main/java/org/apache/airavata/rest/utils/BasicAuthHeaderUtil.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/rest/client/src/main/java/org/apache/airavata/rest/utils/BasicAuthHeaderUtil.java?rev=1522719&r1=1522718&r2=1522719&view=diff
==============================================================================
--- airavata/trunk/modules/rest/client/src/main/java/org/apache/airavata/rest/utils/BasicAuthHeaderUtil.java
(original)
+++ airavata/trunk/modules/rest/client/src/main/java/org/apache/airavata/rest/utils/BasicAuthHeaderUtil.java
Thu Sep 12 20:38:19 2013
@@ -24,11 +24,18 @@ package org.apache.airavata.rest.utils;
 import com.sun.jersey.api.client.WebResource;
 import org.apache.airavata.registry.api.PasswordCallback;
 import org.apache.commons.codec.binary.Base64;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import javax.ws.rs.core.Cookie;
 import javax.ws.rs.core.MultivaluedMap;
+import java.io.UnsupportedEncodingException;
 
 public class BasicAuthHeaderUtil {
+
+    protected static Logger log = LoggerFactory.getLogger(BasicAuthHeaderUtil.class);
+
+
     /**
      * A method to use by clients in the case of Basic Access authentication.
      * Creates Basic Auth header structure.
@@ -40,7 +47,14 @@ public class BasicAuthHeaderUtil {
     public static String getBasicAuthHeader(String userName, String password) {
 
         String credentials = userName + ":" + password;
-        String encodedString = new String(Base64.encodeBase64(credentials.getBytes()));
+        String encodedString = null;
+        try {
+            encodedString = new String(Base64.encodeBase64(credentials.getBytes("UTF-8")));
+        } catch (UnsupportedEncodingException e) {
+            // TODO we need to do proper exception handling
+            log.error("Error encoding credentials. ", e);
+            throw new RuntimeException("Error encoding credentials. ", e);
+        }
         return "Basic " + encodedString;
     }
 

Modified: airavata/trunk/modules/security/src/main/java/org/apache/airavata/security/util/PasswordDigester.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/security/src/main/java/org/apache/airavata/security/util/PasswordDigester.java?rev=1522719&r1=1522718&r2=1522719&view=diff
==============================================================================
--- airavata/trunk/modules/security/src/main/java/org/apache/airavata/security/util/PasswordDigester.java
(original)
+++ airavata/trunk/modules/security/src/main/java/org/apache/airavata/security/util/PasswordDigester.java
Thu Sep 12 20:38:19 2013
@@ -26,6 +26,7 @@ import org.apache.airavata.security.User
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.io.UnsupportedEncodingException;
 import java.security.MessageDigest;
 import java.security.NoSuchAlgorithmException;
 
@@ -69,7 +70,11 @@ public class PasswordDigester {
             } catch (NoSuchAlgorithmException e) {
                 throw new UserStoreException("Error creating message digest with hash algorithm
- " + hashMethod, e);
             }
-            return new String(messageDigest.digest(password.getBytes()));
+            try {
+                return new String(messageDigest.digest(password.getBytes("UTF-8")));
+            } catch (UnsupportedEncodingException e) {
+                throw new UserStoreException("Unable to create password digest", e);
+            }
         }
 
     }

Modified: airavata/trunk/samples/sample-gateway/pom.xml
URL: http://svn.apache.org/viewvc/airavata/trunk/samples/sample-gateway/pom.xml?rev=1522719&r1=1522718&r2=1522719&view=diff
==============================================================================
--- airavata/trunk/samples/sample-gateway/pom.xml (original)
+++ airavata/trunk/samples/sample-gateway/pom.xml Thu Sep 12 20:38:19 2013
@@ -297,8 +297,24 @@
 
     </dependencies>
 
+
     <build>
         <finalName>SampleGateway</finalName>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-war-plugin</artifactId>
+                <version>2.4</version>
+                <configuration>
+                    <webResources>
+                        <resource>
+                            <!-- this is relative to the pom.xml directory -->
+                            <directory>src/main/resources</directory>
+                        </resource>
+                    </webResources>
+                </configuration>
+            </plugin>
+        </plugins>
     </build>
 
     <properties>

Modified: airavata/trunk/samples/sample-gateway/src/main/java/org/apache/airavata/sample/gateway/SampleGateway.java
URL: http://svn.apache.org/viewvc/airavata/trunk/samples/sample-gateway/src/main/java/org/apache/airavata/sample/gateway/SampleGateway.java?rev=1522719&r1=1522718&r2=1522719&view=diff
==============================================================================
--- airavata/trunk/samples/sample-gateway/src/main/java/org/apache/airavata/sample/gateway/SampleGateway.java
(original)
+++ airavata/trunk/samples/sample-gateway/src/main/java/org/apache/airavata/sample/gateway/SampleGateway.java
Thu Sep 12 20:38:19 2013
@@ -47,6 +47,8 @@ public class SampleGateway {
 
     public static final String GATEWAY_SESSION = "Gateway";
 
+    private static boolean databaseStarted = false;
+
     protected static Logger log = LoggerFactory.getLogger(GatewayUserStore.class);
 
     public SampleGateway(ServletContext servletContext) throws Exception {
@@ -58,10 +60,13 @@ public class SampleGateway {
         String host = servletContext.getInitParameter("jdbc.host");
         String driver = servletContext.getInitParameter("jdbc.driver");
 
-        // Start the database
-        DerbyUtil.startDerbyInServerMode(host,
-                port, userName,
-                password);
+        if (!databaseStarted) {
+            // Start the database
+            DerbyUtil.startDerbyInServerMode(host,
+                    port, userName,
+                    password);
+        }
+
 
         String jdbcUrl = getJDBCUrl(host, port, userName, password);
 
@@ -71,7 +76,10 @@ public class SampleGateway {
                 password,
                 driver);
 
-        GatewayUserStore.initializeData(dbUtil);
+        if (!databaseStarted) {
+            GatewayUserStore.initializeData(dbUtil);
+            databaseStarted = true;
+        }
 
         gatewayUserStore = new GatewayUserStore(dbUtil);
 
@@ -130,6 +138,10 @@ public class SampleGateway {
         this.gatewayUserStore.updateTokens(tokenId);
     }
 
+    public String getTokenIdForUser(String user) {
+        return this.gatewayUserStore.getUserToken(user);
+    }
+
 
     public boolean authenticate(String userName, String password) {
 

Modified: airavata/trunk/samples/sample-gateway/src/main/java/org/apache/airavata/sample/gateway/userstore/GatewayUserStore.java
URL: http://svn.apache.org/viewvc/airavata/trunk/samples/sample-gateway/src/main/java/org/apache/airavata/sample/gateway/userstore/GatewayUserStore.java?rev=1522719&r1=1522718&r2=1522719&view=diff
==============================================================================
--- airavata/trunk/samples/sample-gateway/src/main/java/org/apache/airavata/sample/gateway/userstore/GatewayUserStore.java
(original)
+++ airavata/trunk/samples/sample-gateway/src/main/java/org/apache/airavata/sample/gateway/userstore/GatewayUserStore.java
Thu Sep 12 20:38:19 2013
@@ -382,6 +382,65 @@ public class GatewayUserStore {
 
     }
 
+
+
+    public String getUserToken(String userName) {
+
+        String sql = "select token_id from Users where user_name=?";
+
+        PreparedStatement preparedStatement = null;
+        ResultSet resultSet = null;
+        Connection connection = null;
+
+        try {
+
+            connection = dbUtil.getConnection();
+            preparedStatement = connection.prepareStatement(sql);
+
+            preparedStatement.setString(1, userName);
+
+            resultSet = preparedStatement.executeQuery();
+
+            if (resultSet.next()) {
+                return resultSet.getString("token_id");
+            }
+
+        } catch (SQLException e) {
+            String errorString = "Error retrieving token for user " + userName;
+            log.error(errorString, e);
+
+            throw new RuntimeException(errorString, e);
+        } finally {
+
+            if (resultSet != null) {
+                try {
+                    resultSet.close();
+                } catch (SQLException e) {
+                    log.error("Error closing result set", e);
+                }
+            }
+
+            if (preparedStatement != null) {
+                try {
+                    preparedStatement.close();
+                } catch (SQLException e) {
+                    log.error("Error closing prepared statement", e);
+                }
+            }
+
+            if (connection != null) {
+                try {
+                    connection.close();
+                } catch (SQLException e) {
+                    log.error("Error closing connection", e);
+                }
+            }
+        }
+
+        return null;
+
+    }
+
     public static String getPasswordRegularExpression() {
         return "'^[a-zA-Z0-9_-]{6,15}$'";
     }

Modified: airavata/trunk/samples/sample-gateway/src/main/webapp/gateway/acs.jsp
URL: http://svn.apache.org/viewvc/airavata/trunk/samples/sample-gateway/src/main/webapp/gateway/acs.jsp?rev=1522719&r1=1522718&r2=1522719&view=diff
==============================================================================
--- airavata/trunk/samples/sample-gateway/src/main/webapp/gateway/acs.jsp (original)
+++ airavata/trunk/samples/sample-gateway/src/main/webapp/gateway/acs.jsp Thu Sep 12 20:38:19
2013
@@ -29,7 +29,15 @@
 
 <html>
 <body>
+
+<table width="100%" border="0">
+    <tr bgcolor="#999999"><td align="right"><a href="user.jsp"><font
color="#f5f5f5">Home</font> </a> <a href="logout.jsp"><font color="#f5f5f5">Logout</font></a></td></tr>
+</table>
+
 <h2>Sample Gateway</h2>
+
+
+
 <p>This demonstrates how portal can use Credential Store to obtain community credentials
...</p>
 <form name="input" action="https://localhost:8443/airavata/acs-start-servlet" method="post">
 

Modified: airavata/trunk/samples/sample-gateway/src/main/webapp/gateway/callback.jsp
URL: http://svn.apache.org/viewvc/airavata/trunk/samples/sample-gateway/src/main/webapp/gateway/callback.jsp?rev=1522719&r1=1522718&r2=1522719&view=diff
==============================================================================
--- airavata/trunk/samples/sample-gateway/src/main/webapp/gateway/callback.jsp (original)
+++ airavata/trunk/samples/sample-gateway/src/main/webapp/gateway/callback.jsp Thu Sep 12
20:38:19 2013
@@ -41,6 +41,11 @@
 
 <html>
 <body>
+
+<table width="100%" border="0">
+    <tr bgcolor="#999999"><td align="right"><a href="user.jsp"><font
color="#f5f5f5">Home</font> </a> <a href="logout.jsp"><font color="#f5f5f5">Logout</font></a></td></tr>
+</table>
+
 <h2>Sample Gateway</h2>
 <%
     out.println("The received token id - ");

Modified: airavata/trunk/samples/sample-gateway/src/main/webapp/gateway/job.jsp
URL: http://svn.apache.org/viewvc/airavata/trunk/samples/sample-gateway/src/main/webapp/gateway/job.jsp?rev=1522719&r1=1522718&r2=1522719&view=diff
==============================================================================
--- airavata/trunk/samples/sample-gateway/src/main/webapp/gateway/job.jsp (original)
+++ airavata/trunk/samples/sample-gateway/src/main/webapp/gateway/job.jsp Thu Sep 12 20:38:19
2013
@@ -1,8 +1,73 @@
+<%@ page import="org.apache.airavata.sample.gateway.SampleGateway" %>
+<%
+    SampleGateway sampleGateway = null;
+    sampleGateway = (SampleGateway)session.getAttribute(SampleGateway.GATEWAY_SESSION);
+
+    String user = (String) session.getAttribute("userName");
+
+    String token = sampleGateway.getTokenIdForUser(user);
+%>
+
 <html>
 <body>
+
+<table width="100%" border="0">
+    <tr bgcolor="#999999"><td align="right"><a href="user.jsp"><font
color="#f5f5f5">Home</font> </a> <a href="logout.jsp"><font color="#f5f5f5">Logout</font></a></td></tr>
+</table>
+
 <h2>Sample Gateway</h2>
 
 <p>Execute a Workflow.</p>
 
+<img border="0" src="../images/echowf.png" alt="Echo Workflow">
+
+<form name="executeJob" action="job_execute.jsp" method="post">
+
+    <table border="0">
+        <tr>
+            <td><b>Configure Echo Workflow</b></td>
+        </tr>
+
+        <tr>
+            <td>Host Name</td>
+            <td><input type="text" name="hostName" size="65"></td>
+        </tr>
+        <tr>
+            <td>Host Address</td>
+            <td><input type="text" name="hostAddress" size="65"></td>
+        </tr>
+        <tr>
+            <td>Gate Keeper Address</td>
+            <td><input type="text" name="gateKeeperAddress" size="65"></td>
+        </tr>
+        <tr>
+            <td>GRID FTP Endpoint</td>
+            <td><input type="text" name="gridFTPEndpoint" size="65"></td>
+        </tr>
+        <tr>
+            <td>Project Number</td>
+            <td><input type="text" name="projectNumber" size="65"></td>
+        </tr>
+        <tr>
+            <td>Queue Name</td>
+            <td><input type="text" name="queueName" size="65"></td>
+        </tr>
+        <tr>
+            <td>Working Directory</td>
+            <td><input type="text" name="workingDirectory" size="65"></td>
+        </tr>
+        <tr>
+            <td>Echo Input</td>
+            <td><input type="text" name="echoInput" size="65"></td>
+        </tr>
+        <tr>
+            <td>Associated Token Id</td>
+            <td><%=token%></td>
+        </tr>
+    </table>
+
+    <input type="submit" value="Configure & Run">
+</form>
+
 </body>
 </html>
\ No newline at end of file

Added: airavata/trunk/samples/sample-gateway/src/main/webapp/gateway/job_execute.jsp
URL: http://svn.apache.org/viewvc/airavata/trunk/samples/sample-gateway/src/main/webapp/gateway/job_execute.jsp?rev=1522719&view=auto
==============================================================================
--- airavata/trunk/samples/sample-gateway/src/main/webapp/gateway/job_execute.jsp (added)
+++ airavata/trunk/samples/sample-gateway/src/main/webapp/gateway/job_execute.jsp Thu Sep
12 20:38:19 2013
@@ -0,0 +1,101 @@
+<%@ page import="org.apache.airavata.sample.gateway.SampleGateway" %>
+<%@ page import="org.apache.airavata.sample.gateway.ExecutionParameters" %>
+<%@ page import="org.apache.airavata.sample.gateway.executor.WorkflowExecutor" %>
+<%@ page import="org.apache.airavata.workflow.model.wf.Workflow" %>
+<%@ page import="java.util.Arrays" %>
+<%
+    SampleGateway sampleGateway = null;
+    sampleGateway = (SampleGateway)session.getAttribute(SampleGateway.GATEWAY_SESSION);
+
+    String user = (String) session.getAttribute("userName");
+
+    String token = sampleGateway.getTokenIdForUser(user);
+
+    String hostName = request.getParameter("hostName");
+    String hostAddress = request.getParameter("hostAddress");
+    String gateKeeperAddress = request.getParameter("gateKeeperAddress");
+    String gridFTPEndpoint = request.getParameter("gridFTPEndpoint");
+    String projectNumber = request.getParameter("projectNumber");
+    String queueName = request.getParameter("queueName");
+    String workingDirectory = request.getParameter("workingDirectory");
+    String echoInput = request.getParameter("echoInput");
+
+    ExecutionParameters executionParameters = new ExecutionParameters();
+
+    executionParameters.setHostAddress(hostAddress);
+    executionParameters.setHostName(hostName);
+    executionParameters.setGateKeeperAddress(gateKeeperAddress);
+    executionParameters.setGridftpAddress(gridFTPEndpoint);
+    executionParameters.setProjectNumber(projectNumber);
+    executionParameters.setQueueName(queueName);
+    executionParameters.setWorkingDirectory(workingDirectory);
+
+    WorkflowExecutor workflowExecutor = new WorkflowExecutor("default");
+
+    String errorMessage = null;
+    StackTraceElement[] stackTraceElements = null;
+    String output = null;
+
+    Workflow workflow = null;
+    try {
+        workflow = workflowExecutor.setupExperiment(executionParameters);
+    } catch (Exception e) {
+
+        e.printStackTrace();
+
+        errorMessage = "An error occurred while setting up the experiment " + e.getMessage();
+        stackTraceElements = e.getStackTrace();
+    }
+
+    if (errorMessage == null) {
+        try {
+            output = workflowExecutor.runWorkflow(workflow, Arrays.asList("echo_output="
+ echoInput),
+                    token, user);
+        } catch (Exception e) {
+            e.printStackTrace();
+
+            errorMessage = "An error occurred while running the experiment " + e.getMessage();
+            stackTraceElements = e.getStackTrace();
+        }
+
+    }
+
+%>
+
+<html>
+<body>
+
+<table width="100%" border="0">
+    <tr bgcolor="#999999"><td align="right"><a href="user.jsp"><font
color="#f5f5f5">Home</font> </a> <a href="logout.jsp"><font color="#f5f5f5">Logout</font></a></td></tr>
+</table>
+
+<h2>Sample Gateway</h2>
+
+<p>Workflow Execution Results.</p>
+
+<%
+    if (errorMessage == null) {
+%>
+<p>Workflow successfully executed.</p>
+<p>Output <%=output%> </p>
+
+<%
+    } else {
+%>
+
+<p><%=errorMessage%></p>
+<p>Detail Error</p>
+<p>
+<%
+    for (StackTraceElement stackTraceElement : stackTraceElements) {
+%>
+    <%=stackTraceElement.toString()%> <br>
+<%
+    }
+    }
+%>
+</p>
+
+
+</body>
+</html>
\ No newline at end of file

Modified: airavata/trunk/samples/sample-gateway/src/main/webapp/gateway/list_users.jsp
URL: http://svn.apache.org/viewvc/airavata/trunk/samples/sample-gateway/src/main/webapp/gateway/list_users.jsp?rev=1522719&r1=1522718&r2=1522719&view=diff
==============================================================================
--- airavata/trunk/samples/sample-gateway/src/main/webapp/gateway/list_users.jsp (original)
+++ airavata/trunk/samples/sample-gateway/src/main/webapp/gateway/list_users.jsp Thu Sep 12
20:38:19 2013
@@ -18,8 +18,14 @@
     <title>List Users</title>
 </head>
 <body>
+
+<table width="100%" border="0">
+    <tr bgcolor="#999999"><td align="right"><a href="user.jsp"><font
color="#f5f5f5">Home</font> </a> <a href="logout.jsp"><font color="#f5f5f5">Logout</font></a></td></tr>
+</table>
+
 <h1>Sample Gateway</h1>
 
+
 <p> This page lists all users and their attributes. </p>
 
 <table>

Added: airavata/trunk/samples/sample-gateway/src/main/webapp/gateway/logout.jsp
URL: http://svn.apache.org/viewvc/airavata/trunk/samples/sample-gateway/src/main/webapp/gateway/logout.jsp?rev=1522719&view=auto
==============================================================================
--- airavata/trunk/samples/sample-gateway/src/main/webapp/gateway/logout.jsp (added)
+++ airavata/trunk/samples/sample-gateway/src/main/webapp/gateway/logout.jsp Thu Sep 12 20:38:19
2013
@@ -0,0 +1,17 @@
+<%@ page import="org.apache.airavata.sample.gateway.SampleGateway" %><%
+    session.removeAttribute("userName");
+    session.removeAttribute(SampleGateway.GATEWAY_SESSION);
+    session.invalidate();
+%>
+
+<html>
+<head>
+    <script language=javascript>
+        function redirect(){
+            window.location = "../index.jsp";
+        }
+    </script>
+</head>
+<body onload="redirect()">
+</body>
+</html>
\ No newline at end of file

Modified: airavata/trunk/samples/sample-gateway/src/main/webapp/gateway/user.jsp
URL: http://svn.apache.org/viewvc/airavata/trunk/samples/sample-gateway/src/main/webapp/gateway/user.jsp?rev=1522719&r1=1522718&r2=1522719&view=diff
==============================================================================
--- airavata/trunk/samples/sample-gateway/src/main/webapp/gateway/user.jsp (original)
+++ airavata/trunk/samples/sample-gateway/src/main/webapp/gateway/user.jsp Thu Sep 12 20:38:19
2013
@@ -8,31 +8,48 @@
 --%>
 <%@ page contentType="text/html;charset=UTF-8" language="java" %>
 <%
-    SampleGateway sampleGateway = null;
-    sampleGateway = (SampleGateway)session.getAttribute(SampleGateway.GATEWAY_SESSION);
+    String loginScreen = request.getParameter("loginScreen");
 
-    if (sampleGateway == null) {
-        sampleGateway = new SampleGateway(session.getServletContext());
-    }
+    String user = (String)session.getAttribute("userName");
+    boolean authenticate = false;
+
+    if (loginScreen != null && loginScreen.equals("true")) {
+        SampleGateway sampleGateway = null;
+        sampleGateway = (SampleGateway) session.getAttribute(SampleGateway.GATEWAY_SESSION);
+
+        if (sampleGateway == null) {
+            sampleGateway = new SampleGateway(session.getServletContext());
+        }
 
-    session.setAttribute(SampleGateway.GATEWAY_SESSION, sampleGateway);
+        session.setAttribute(SampleGateway.GATEWAY_SESSION, sampleGateway);
 
-    String user = request.getParameter("username");
-    String password = request.getParameter("password");
+        user = request.getParameter("username");
+        String password = request.getParameter("password");
 
-    boolean authenticate = sampleGateway.authenticate(user, password);
+        authenticate = sampleGateway.authenticate(user, password);
+    } else {
+        authenticate = true;
+    }
 
 %>
 <html>
+
 <head>
     <title>Manage</title>
 </head>
 <body>
+
+<table width="100%" border="0">
+    <tr bgcolor="#999999"><td align="right"><a href="user.jsp"><font
color="#f5f5f5">Home</font> </a> <a href="logout.jsp"><font color="#f5f5f5">Logout</font></a></td></tr>
+</table>
+
 <h1>Sample Gateway</h1>
 
 <%
     if (authenticate) {
 
+        session.setAttribute("userName", user);
+
         if (SampleGateway.isAdmin(user)) {
 %>
 <h1>Administration</h1>
@@ -49,7 +66,7 @@
      } else {
 %>
 
-<p> You are a normal user. You are not allowed to operate on this page.</p>
+<p> You are a normal user. Click <a href="job.jsp">here</a> to configure
and run "Echo" workflow on a GRID machine.</p>
 
 <%
      }

Modified: airavata/trunk/samples/sample-gateway/src/main/webapp/index.jsp
URL: http://svn.apache.org/viewvc/airavata/trunk/samples/sample-gateway/src/main/webapp/index.jsp?rev=1522719&r1=1522718&r2=1522719&view=diff
==============================================================================
--- airavata/trunk/samples/sample-gateway/src/main/webapp/index.jsp (original)
+++ airavata/trunk/samples/sample-gateway/src/main/webapp/index.jsp Thu Sep 12 20:38:19 2013
@@ -7,6 +7,8 @@
 <h2>Welcome to Sample Gateway</h2>
 
 <form name="input" action="gateway/user.jsp" method="post">
+    <input type="hidden" name="loginScreen" value="true">
+
     <table border="0" width="100%">
         <tr bgcolor="#999999">
             <td><font color="#f5f5f5">Login ...</font></td>

Modified: airavata/trunk/samples/sample-gateway/src/test/java/org/apache/airavata/sample/gateway/executor/WorkflowExecutorTest.java
URL: http://svn.apache.org/viewvc/airavata/trunk/samples/sample-gateway/src/test/java/org/apache/airavata/sample/gateway/executor/WorkflowExecutorTest.java?rev=1522719&r1=1522718&r2=1522719&view=diff
==============================================================================
--- airavata/trunk/samples/sample-gateway/src/test/java/org/apache/airavata/sample/gateway/executor/WorkflowExecutorTest.java
(original)
+++ airavata/trunk/samples/sample-gateway/src/test/java/org/apache/airavata/sample/gateway/executor/WorkflowExecutorTest.java
Thu Sep 12 20:38:19 2013
@@ -47,8 +47,6 @@ public class WorkflowExecutorTest {
         Workflow workflow = workflowExecutor.setupExperiment(executionParameters);
         workflowExecutor.runWorkflow(workflow, Arrays.asList("echo_output=Hello World"));
 
-        System.out.println("sadsd");
-
     }
 
     //@Test
@@ -75,7 +73,7 @@ public class WorkflowExecutorTest {
 
     }
 
-    //@Test
+    @Test
     public void testRunWorkflowStampedeUS3WithToken() throws Exception {
 
         WorkflowExecutor workflowExecutor = getSampleGatewayExecutor();
@@ -83,7 +81,7 @@ public class WorkflowExecutorTest {
 
         Workflow workflow = workflowExecutor.setupExperiment(executionParameters);
         workflowExecutor.runWorkflow(workflow, Arrays.asList("echo_output=Hello World"),
-                "a70b5c63-48d8-4a34-9b9a-d77f74894fb8X", "bunny");
+                "9964c023-7d30-4247-a6eb-b0c9cd7be138", "bunny");
 
     }
 



Mime
View raw message