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/02/15 16:57:54 UTC

svn commit: r1446652 - in /uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main: java/org/apache/uima/ducc/ws/registry/ java/org/apache/uima/ducc/ws/server/ webapp/root/

Author: degenaro
Date: Fri Feb 15 15:57:54 2013
New Revision: 1446652

URL: http://svn.apache.org/r1446652
Log:
UIMA-2676 DUCC webserver (WS) Services presentation improvements...Type, State, Health

Modified:
    uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/registry/IServicesRegistry.java
    uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccHandlerJsonFormat.java
    uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccHandlerLegacy.java
    uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/services.jsp

Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/registry/IServicesRegistry.java
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/registry/IServicesRegistry.java?rev=1446652&r1=1446651&r2=1446652&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/registry/IServicesRegistry.java (original)
+++ uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/registry/IServicesRegistry.java Fri Feb 15 15:57:54 2013
@@ -31,6 +31,9 @@ public class IServicesRegistry {
 	public static final String implementors = IStateServices.implementors;
 	public static final String instances = IStateServices.instances;
 	public static final String numeric_id = IStateServices.numeric_id;
+	public static final String ping_active = IStateServices.ping_active;
+	public static final String service_class = IStateServices.service_class;
+	public static final String service_state = IStateServices.service_state;
 	public static final String user = IStateServices.user;
 	
 	// svc

Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccHandlerJsonFormat.java
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccHandlerJsonFormat.java?rev=1446652&r1=1446651&r2=1446652&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccHandlerJsonFormat.java (original)
+++ uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccHandlerJsonFormat.java Fri Feb 15 15:57:54 2013
@@ -856,6 +856,58 @@ public class DuccHandlerJsonFormat exten
 				row.add(new JsonPrimitive(id));
 				// Endpoint
 				row.add(new JsonPrimitive(name));
+				// Type
+				String type = "";
+				if(propertiesMeta != null) {
+					if(propertiesMeta.containsKey(IServicesRegistry.service_class)) {
+						String value = propertiesMeta.getProperty(IServicesRegistry.service_class);
+						if(value != null) {
+							type = value;
+						}
+					}
+				}
+				row.add(new JsonPrimitive(type));
+				// State
+				String state = "";
+				if(propertiesMeta != null) {
+					if(propertiesMeta.containsKey(IServicesRegistry.service_state)) {
+						String value = propertiesMeta.getProperty(IServicesRegistry.service_state);
+						if(value != null) {
+							state = value;
+						}
+					}
+				}
+				row.add(new JsonPrimitive(state));
+				// Health
+				String health = "";
+				if(propertiesMeta != null) {
+					if(propertiesMeta.containsKey(IServicesRegistry.ping_active)) {
+						String value = propertiesMeta.getProperty(IServicesRegistry.ping_active);
+						String text = "";
+						if(value != null) {
+							value = value.trim();
+							if(value.equals("true")) {
+								StringBuffer sb = new StringBuffer();
+								value = "up";
+								text = "pinging";
+								sb.append("<span class=\"health_green\" title=\""+text+"\">");
+								sb.append(value);
+								sb.append("</span>");
+								health = sb.toString();
+							}
+							else {
+								StringBuffer sb = new StringBuffer();
+								value = "down";
+								text = "not pinging";
+								sb.append("<span class=\"health_red\" title=\""+text+"\">");
+								sb.append(value);
+								sb.append("</span>");
+								health = sb.toString();
+							}
+						}
+					}
+				}
+				row.add(new JsonPrimitive(health));
 				// Instances
 				row.add(new JsonPrimitive(getValue(propertiesMeta,IStateServices.instances,"")));
 				// Deployments

Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccHandlerLegacy.java
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccHandlerLegacy.java?rev=1446652&r1=1446651&r2=1446652&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccHandlerLegacy.java (original)
+++ uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccHandlerLegacy.java Fri Feb 15 15:57:54 2013
@@ -742,6 +742,64 @@ public class DuccHandlerLegacy extends D
 				sb.append("<td>");
 				sb.append(name);
 				sb.append("</td>");
+				// Type
+				sb.append("<td>");
+				String type = "";
+				if(propertiesMeta != null) {
+					if(propertiesMeta.containsKey(IServicesRegistry.service_class)) {
+						String value = propertiesMeta.getProperty(IServicesRegistry.service_class);
+						if(type != null) {
+							type = value;
+						}
+					}
+				}
+				sb.append(type);
+				sb.append("</td>");
+				// State
+				sb.append("<td>");
+				String state = "";
+				if(propertiesMeta != null) {
+					if(propertiesMeta.containsKey(IServicesRegistry.service_state)) {
+						String value = propertiesMeta.getProperty(IServicesRegistry.service_state);
+						if(value != null) {
+							state = value;
+						}
+					}
+				}
+				sb.append(state);
+				sb.append("</td>");
+				// Health
+				sb.append("<td>");
+				String health = "";
+				if(propertiesMeta != null) {
+					if(propertiesMeta.containsKey(IServicesRegistry.ping_active)) {
+						String value = propertiesMeta.getProperty(IServicesRegistry.ping_active);
+						String text = "";
+						if(value != null) {
+							value = value.trim();
+							if(value.equals("true")) {
+								StringBuffer tbuf = new StringBuffer();
+								value = "up";
+								text = "pinging";
+								tbuf.append("<span class=\"health_green\" title=\""+text+"\">");
+								tbuf.append(value);
+								tbuf.append("</span>");
+								health = tbuf.toString();
+							}
+							else {
+								StringBuffer tbuf = new StringBuffer();
+								value = "down";
+								text = "not pinging";
+								tbuf.append("<span class=\"health_red\" title=\""+text+"\">");
+								tbuf.append(value);
+								tbuf.append("</span>");
+								health = tbuf.toString();
+							}
+						}
+					}
+				}
+				sb.append(health);
+				sb.append("</td>");
 				// No. of Instances
 				sb.append("<td>");
 				sb.append(getValue(propertiesMeta,IServicesRegistry.instances,""));

Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/services.jsp
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/services.jsp?rev=1446652&r1=1446651&r2=1446652&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/services.jsp (original)
+++ uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/services.jsp Fri Feb 15 15:57:54 2013
@@ -45,9 +45,9 @@ if (table_style.equals("scroll")) {
 			"aaSorting": [],
 			"fnRowCallback"  : function(nRow,aData,iDisplayIndex) {
                              		$('td:eq(0)', nRow).css( "text-align", "right" );
-                             		$('td:eq(2)', nRow).css( "text-align", "right" );
-                             		$('td:eq(3)', nRow).css( "text-align", "right" );
+                             		$('td:eq(5)', nRow).css( "text-align", "right" );
                              		$('td:eq(6)', nRow).css( "text-align", "right" );
+                             		$('td:eq(9)', nRow).css( "text-align", "right" );
                              		return nRow;
 			},
 		} );
@@ -94,31 +94,15 @@ if (table_style.equals("scroll")) {
 <%
 if (table_style.equals("scroll")) {
 %>
-<!--
-	<table id="services-table" width="100%">
-   	    <caption><b>Services Definitions List</b><br><i><small>click column heading to sort</small></i></caption>
-			<thead>
-			<tr class="ducc-header">
-			<th title="The service Id">Id</th>
-			<th title="The service name">Name</th>
-			<th title="The service number of instances">Instances</th>
-			<th title="The service number of deployments">Deployments</th>
-			<th class="ducc-no-filter" id="user_column_heading" title="The service owning user">User</th>
-			<th title="The service scheduling class">Class</th>
-			<th title="The service process memory size (GB)">Size</th>
-			<th title="The service description">Description</th>
-			</tr>
-			</thead>
-			<tbody id="services_list_area">
-   	  		</tbody>
-   	</table>
--->   	
 	<table id="services-table" width="100%">
 	<caption><b>Services Definitions List</b><br><i><small>click column heading to sort</small></i></caption>
 	<thead>
 	<tr class="ducc-header">
 		<th title="The service Id">Id</th>
 		<th title="The service name">Name</th>
+		<th title="The service type">Type</th>
+		<th title="The service state">State</th>
+		<th title="The service health">Health</th>
 		<th title="The service number of instances">Instances</th>
 		<th title="The service number of deployments">Deployments</th>
 		<th class="ducc-no-filter" id="user_column_heading" title="The service owning user">User</th>
@@ -145,6 +129,9 @@ if (table_style.equals("classic")) {
 		<tr class="ducc-head">
 		<th title="The service Id">Id</th>
 		<th title="The service name">Name</th>
+		<th title="The service type">Type</th>
+		<th title="The service state">State</th>
+		<th title="The service health">Health</th>
 		<th title="The service number of instances">Instances</th>
 		<th title="The service number of deployments">Deployments</th>
 		<th class="ducc-no-filter" id="user_column_heading" title="The service owning user">User</th>