You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by de...@apache.org on 2013/04/01 14:04:12 UTC

svn commit: r1463125 - in /uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main: java/org/apache/uima/ducc/ws/server/ webapp/root/$banner/ webapp/root/js/

Author: degenaro
Date: Mon Apr  1 12:04:11 2013
New Revision: 1463125

URL: http://svn.apache.org/r1463125
Log:
UIMA-2781 DUCC WS relocate logged-in and -out status info so as to consume less real estate

Modified:
    uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccHandler.java
    uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/$links.jsp
    uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/c2-status-job-details.jsp
    uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/c2-status-jobs.jsp
    uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/c2-status-reservation-details.jsp
    uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/c2-status-reservations.jsp
    uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/c2-status-service-details.jsp
    uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/c2-status-services.jsp
    uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/c2-status-system-administration.jsp
    uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/c2-status-system-classes.jsp
    uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/c2-status-system-daemons.jsp
    uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/c2-status-system-machines.jsp
    uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/js/ducc.js

Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccHandler.java
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccHandler.java?rev=1463125&r1=1463124&r2=1463125&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccHandler.java (original)
+++ uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccHandler.java Mon Apr  1 12:04:11 2013
@@ -102,6 +102,7 @@ public class DuccHandler extends DuccAbs
 	private String duccVersion						= duccContext+"/version";
 	
 	private String duccLoginLink					= duccContext+"/login-link";
+	private String duccLogoutLink					= duccContext+"/logout-link";
 	private String duccAuthenticationStatus 		= duccContext+"/authentication-status";
 	private String duccAuthenticatorVersion 		= duccContext+"/authenticator-version";
 	
@@ -196,13 +197,42 @@ public class DuccHandler extends DuccAbs
 		String methodName = "handleDuccServletLoginLink";
 		duccLogger.trace(methodName, null, messages.fetch("enter"));
 		StringBuffer sb = new StringBuffer();
-		String link = "https://"+request.getServerName()+":"+getDuccWebServer().getPortSsl()+"/";
-		String href = "<a href=\""+link+"login.html\" onclick=\"var newWin = window.open(this.href,'child','height=600,width=475,scrollbars');  newWin.focus(); return false;\">Login</a>";
-		sb.append(href);
+		boolean userAuth = isAuthenticated(request,response);
+        if (userAuth) {
+        	sb.append("<span class=\"status_on\">");
+        	sb.append("Logged-in");
+        	sb.append("<span>");
+        }
+        else {
+    		String link = "https://"+request.getServerName()+":"+getDuccWebServer().getPortSsl()+"/";
+    		String href = "<a href=\""+link+"login.html\" onclick=\"var newWin = window.open(this.href,'child','height=600,width=475,scrollbars');  newWin.focus(); return false;\">Login</a>";
+    		sb.append(href);
+        }
 		response.getWriter().println(sb);
 		duccLogger.trace(methodName, null, messages.fetch("exit"));
 	}	
-
+	
+	private void handleDuccServletLogoutLink(String target,Request baseRequest,HttpServletRequest request,HttpServletResponse response) 
+	throws IOException, ServletException
+	{
+		String methodName = "handleDuccServletLogoutLink";
+		duccLogger.trace(methodName, null, messages.fetch("enter"));
+		StringBuffer sb = new StringBuffer();
+		boolean userAuth = isAuthenticated(request,response);
+        if (userAuth) {
+    		String link = "https://"+request.getServerName()+":"+getDuccWebServer().getPortSsl()+"/";
+    		String href = "<a href=\""+link+"logout.html\" onclick=\"var newWin = window.open(this.href,'child','height=600,width=475,scrollbars');  newWin.focus(); return false;\">Logout</a>";
+    		sb.append(href);
+        }
+        else {
+        	sb.append("<span class=\"status_off\">");
+        	sb.append("Logged-out");
+        	sb.append("<span>");
+        }
+		response.getWriter().println(sb);
+		duccLogger.trace(methodName, null, messages.fetch("exit"));
+	}	
+	
 	private void handleDuccServletVersion(String target,Request baseRequest,HttpServletRequest request,HttpServletResponse response) 
 	throws IOException, ServletException
 	{
@@ -224,12 +254,12 @@ public class DuccHandler extends DuccAbs
 		boolean userAuth = isAuthenticated(request,response);
         if (userAuth) {
         	sb.append("<span class=\"status_on\">");
-        	sb.append("logged in");
+        	sb.append("logged-in");
         	sb.append("<span>");
         }
         else {
         	sb.append("<span class=\"status_off\">");
-        	sb.append("logged out");
+        	sb.append("logged-out");
         	sb.append("<span>");
         }
 		response.getWriter().println(sb);
@@ -3034,6 +3064,9 @@ public class DuccHandler extends DuccAbs
 			else if(reqURI.startsWith(duccLoginLink)) {
 				handleDuccServletLoginLink(target, baseRequest, request, response);
 			}
+			else if(reqURI.startsWith(duccLogoutLink)) {
+				handleDuccServletLogoutLink(target, baseRequest, request, response);
+			}
 			else if(reqURI.startsWith(duccJobIdData)) {
 				handleDuccServletJobIdData(target, baseRequest, request, response);
 				DuccWebUtil.noCache(response);

Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/$links.jsp
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/%24banner/%24links.jsp?rev=1463125&r1=1463124&r2=1463125&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/$links.jsp (original)
+++ uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/$links.jsp Mon Apr  1 12:04:11 2013
@@ -20,7 +20,7 @@ under the License.
 <tr>
 <td><span id="login_link_area"></span>
 <td>|
-<td><span id="logout_link_area"><a href="logout.html" onclick="var newWin = window.open(this.href,'child','height=600,width=475,scrollbars'); newWin.focus(); return false;">Logout</a></span>
+<td><span id="logout_link_area"></span>
 <td>|
 <td><span id="preferences_link_area"><a href="preferences.html" onclick="var newWin = window.open(this.href,'child','height=600,width=900,scrollbars'); newWin.focus(); return false;">Preferences</a></span>
 <td>|

Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/c2-status-job-details.jsp
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/%24banner/c2-status-job-details.jsp?rev=1463125&r1=1463124&r2=1463125&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/c2-status-job-details.jsp (original)
+++ uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/c2-status-job-details.jsp Mon Apr  1 12:04:11 2013
@@ -28,10 +28,6 @@ under the License.
 <td valign="top" align="right" title="The percentage of shares inuse">Utilization:&nbsp
 <td valign="top"><span class="utilizationtitle" id="utilization_area">?</span>
 </tr>
-<tr>
-<td valign="top" align="right">Authentication:&nbsp
-<td valign="top"><span class="authenticationtitle" id="authentication_area">?</span>
-</tr>
 </table>
 </form>
 </div> 
\ No newline at end of file

Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/c2-status-jobs.jsp
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/%24banner/c2-status-jobs.jsp?rev=1463125&r1=1463124&r2=1463125&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/c2-status-jobs.jsp (original)
+++ uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/c2-status-jobs.jsp Mon Apr  1 12:04:11 2013
@@ -29,10 +29,6 @@ under the License.
 <td valign="top"><span class="utilizationtitle" id="utilization_area">?</span>
 </tr>
 <tr>
-<td valign="top" align="right">Authentication:&nbsp
-<td valign="top"><span class="authenticationtitle" id="authentication_area">?</span>
-</tr>
-<tr>
 <%@ include file="$users.jsp" %>
 </tr>
 <tr>

Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/c2-status-reservation-details.jsp
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/%24banner/c2-status-reservation-details.jsp?rev=1463125&r1=1463124&r2=1463125&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/c2-status-reservation-details.jsp (original)
+++ uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/c2-status-reservation-details.jsp Mon Apr  1 12:04:11 2013
@@ -28,10 +28,6 @@ under the License.
 <td valign="top" align="right" title="The percentage of shares inuse">Utilization:&nbsp
 <td valign="top"><span class="utilizationtitle" id="utilization_area">?</span>
 </tr>
-<tr>
-<td valign="top" align="right">Authentication:&nbsp
-<td valign="top"><span class="authenticationtitle" id="authentication_area">?</span>
-</tr>
 </table>
 </form>
 </div> 
\ No newline at end of file

Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/c2-status-reservations.jsp
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/%24banner/c2-status-reservations.jsp?rev=1463125&r1=1463124&r2=1463125&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/c2-status-reservations.jsp (original)
+++ uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/c2-status-reservations.jsp Mon Apr  1 12:04:11 2013
@@ -29,10 +29,6 @@ under the License.
 <td valign="top"><span class="utilizationtitle" id="utilization_area">?</span>
 </tr>
 <tr>
-<td valign="top" align="right">Authentication:&nbsp
-<td valign="top"><span class="authenticationtitle" id="authentication_area">?</span>
-</tr>
-<tr>
 <%@ include file="$users.jsp" %>
 </tr>
 <tr>

Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/c2-status-service-details.jsp
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/%24banner/c2-status-service-details.jsp?rev=1463125&r1=1463124&r2=1463125&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/c2-status-service-details.jsp (original)
+++ uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/c2-status-service-details.jsp Mon Apr  1 12:04:11 2013
@@ -28,10 +28,6 @@ under the License.
 <td valign="top" align="right" title="The percentage of shares inuse">Utilization:&nbsp
 <td valign="top"><span class="utilizationtitle" id="utilization_area">?</span>
 </tr>
-<tr>
-<td valign="top" align="right">Authentication:&nbsp
-<td valign="top"><span class="authenticationtitle" id="authentication_area">?</span>
-</tr>
 </table>
 </form>
 </div> 
\ No newline at end of file

Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/c2-status-services.jsp
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/%24banner/c2-status-services.jsp?rev=1463125&r1=1463124&r2=1463125&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/c2-status-services.jsp (original)
+++ uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/c2-status-services.jsp Mon Apr  1 12:04:11 2013
@@ -29,10 +29,6 @@ under the License.
 <td valign="top"><span class="utilizationtitle" id="utilization_area">?</span>
 </tr>
 <tr>
-<td valign="top" align="right">Authentication:&nbsp
-<td valign="top"><span class="authenticationtitle" id="authentication_area">?</span>
-</tr>
-<tr>
 <%@ include file="$users.jsp" %>
 </tr>
 <tr>

Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/c2-status-system-administration.jsp
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/%24banner/c2-status-system-administration.jsp?rev=1463125&r1=1463124&r2=1463125&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/c2-status-system-administration.jsp (original)
+++ uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/c2-status-system-administration.jsp Mon Apr  1 12:04:11 2013
@@ -28,10 +28,6 @@ under the License.
 <td valign="top" align="right" title="The percentage of shares inuse">Utilization:&nbsp
 <td valign="top"><span class="utilizationtitle" id="utilization_area">?</span>
 </tr>
-<tr>
-<td valign="top" align="right">Authentication:&nbsp
-<td valign="top"><span class="authenticationtitle" id="authentication_area">?</span>
-</tr>
 </table>
 </form>
 </div> 
\ No newline at end of file

Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/c2-status-system-classes.jsp
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/%24banner/c2-status-system-classes.jsp?rev=1463125&r1=1463124&r2=1463125&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/c2-status-system-classes.jsp (original)
+++ uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/c2-status-system-classes.jsp Mon Apr  1 12:04:11 2013
@@ -28,10 +28,6 @@ under the License.
 <td valign="top" align="right" title="The percentage of shares inuse">Utilization:&nbsp
 <td valign="top"><span class="utilizationtitle" id="utilization_area">?</span>
 </tr>
-<tr>
-<td valign="top" align="right">Authentication:&nbsp
-<td valign="top"><span class="authenticationtitle" id="authentication_area">?</span>
-</tr>
 </table>
 </form>
 </div> 
\ No newline at end of file

Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/c2-status-system-daemons.jsp
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/%24banner/c2-status-system-daemons.jsp?rev=1463125&r1=1463124&r2=1463125&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/c2-status-system-daemons.jsp (original)
+++ uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/c2-status-system-daemons.jsp Mon Apr  1 12:04:11 2013
@@ -28,10 +28,6 @@ under the License.
 <td valign="top" align="right" title="The percentage of shares inuse">Utilization:&nbsp
 <td valign="top"><span class="utilizationtitle" id="utilization_area">?</span>
 </tr>
-<tr>
-<td valign="top" align="right">Authentication:&nbsp
-<td valign="top"><span class="authenticationtitle" id="authentication_area">?</span>
-</tr>
 </table>
 </form>
 </div> 
\ No newline at end of file

Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/c2-status-system-machines.jsp
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/%24banner/c2-status-system-machines.jsp?rev=1463125&r1=1463124&r2=1463125&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/c2-status-system-machines.jsp (original)
+++ uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/$banner/c2-status-system-machines.jsp Mon Apr  1 12:04:11 2013
@@ -28,10 +28,6 @@ under the License.
 <td valign="top" align="right" title="The percentage of shares inuse">Utilization:&nbsp
 <td valign="top"><span class="utilizationtitle" id="utilization_area">?</span>
 </tr>
-<tr>
-<td valign="top" align="right">Authentication:&nbsp
-<td valign="top"><span class="authenticationtitle" id="authentication_area">?</span>
-</tr>
 </table>
 </form>
 </div> 
\ No newline at end of file

Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/js/ducc.js
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/js/ducc.js?rev=1463125&r1=1463124&r2=1463125&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/js/ducc.js (original)
+++ uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/js/ducc.js Mon Apr  1 12:04:11 2013
@@ -141,6 +141,14 @@ function ducc_links()
 				$("#login_link_area").html(data);
 			}
 		});
+		$.ajax(
+		{
+			url : "/ducc-servlet/logout-link",
+			success : function (data) 
+			{
+				$("#logout_link_area").html(data);
+			}
+		});
 	}
 	catch(err) {
 		ducc_error("ducc_links",err);
@@ -175,6 +183,7 @@ function ducc_authentication()
 				$("#authentication_area").html(data);
 			}
 		});
+		ducc_links();
 	}
 	catch(err) {
 		ducc_error("ducc_authentication",err);