Author: degenaro Date: Wed May 14 19:58:56 2014 New Revision: 1594694 URL: http://svn.apache.org/r1594694 Log: UIMA-3432 DUCC Web Server (WS) to show better Reason (rationale) on hover for cancellation: Monitor ended; Monitor ping overdue; Terminate button pressed
Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccAbstractHandler.java 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/java/org/apache/uima/ducc/ws/server/DuccWebMonitorJob.java uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccWebMonitorManagedReservation.java Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccAbstractHandler.java URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccAbstractHandler.java?rev=1594694&r1=1594693&r2=1594694&view=diff ============================================================================== --- uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccAbstractHandler.java (original) +++ uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccAbstractHandler.java Wed May 14 19:58:56 2014 @@ -1049,7 +1049,7 @@ public abstract class DuccAbstractHandle default: IRationale rationale = job.getCompletionRationale(); if(rationale != null) { - sb.append("<span title=\""+rationale+"\">"); + sb.append("<span title="+rationale+">"); } else { sb.append("<span>"); 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=1594694&r1=1594693&r2=1594694&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 Wed May 14 19:58:56 2014 @@ -45,6 +45,7 @@ import javax.servlet.http.HttpServletRes import org.apache.uima.ducc.cli.ws.json.MachineFacts; import org.apache.uima.ducc.cli.ws.json.MachineFactsList; +import org.apache.uima.ducc.common.CancelReasons.CancelReason; import org.apache.uima.ducc.common.NodeConfiguration; import org.apache.uima.ducc.common.boot.DuccDaemonRuntimeProperties; import org.apache.uima.ducc.common.boot.DuccDaemonRuntimeProperties.DaemonName; @@ -3515,6 +3516,9 @@ public class DuccHandler extends DuccAbs if(HandlersHelper.isUserAuthorized(request,resourceOwnerUserId)) { String arg1 = "-"+name; String arg2 = value; + String arg3 = "--"+SpecificationProperties.key_reason; + String reason = CancelReason.TerminateButtonPressed.getText(); + String arg4 = "\""+reason+"\""; String userId = duccWebSessionManager.getUserId(request); String cp = System.getProperty("java.class.path"); String java = "/bin/java"; @@ -3523,14 +3527,14 @@ public class DuccHandler extends DuccAbs DuccCookies.RequestRole requestRole = DuccCookies.getRole(request); switch(requestRole) { case Administrator: - String arg3 = "--"+SpecificationProperties.key_role_administrator; - String[] arglistAdministrator = { "-u", userId, "--", jhome+java, "-cp", cp, jclass, arg1, arg2, arg3 }; + String arg5 = "--"+SpecificationProperties.key_role_administrator; + String[] arglistAdministrator = { "-u", userId, "--", jhome+java, "-cp", cp, jclass, arg1, arg2, arg3, arg4, arg5 }; result = DuccAsUser.duckling(userId, arglistAdministrator); response.getWriter().println(result); break; case User: default: - String[] arglistUser = { "-u", userId, "--", jhome+java, "-cp", cp, jclass, arg1, arg2 }; + String[] arglistUser = { "-u", userId, "--", jhome+java, "-cp", cp, jclass, arg1, arg2, arg3, arg4 }; result = DuccAsUser.duckling(userId, arglistUser); response.getWriter().println(result); break; Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccWebMonitorJob.java URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccWebMonitorJob.java?rev=1594694&r1=1594693&r2=1594694&view=diff ============================================================================== --- uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccWebMonitorJob.java (original) +++ uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccWebMonitorJob.java Wed May 14 19:58:56 2014 @@ -25,6 +25,7 @@ import java.util.Iterator; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicInteger; +import org.apache.uima.ducc.common.CancelReasons.CancelReason; import org.apache.uima.ducc.common.json.MonitorInfo; import org.apache.uima.ducc.common.utils.DuccLogger; import org.apache.uima.ducc.common.utils.DuccLoggerComponents; @@ -312,7 +313,8 @@ public class DuccWebMonitorJob { String arg1 = "--"+JobRequestProperties.key_id; String arg2 = ""+duccId; String arg3 = "--"+SpecificationProperties.key_reason; - String arg4 = "\"Canceled by monitor (submitter terminated)\""; + String reason = CancelReason.MonitorPingOverdue.getText(); + String arg4 = "\""+reason+"\""; String[] arglistUser = { "-u", userId, "--", jhome+java, "-cp", cp, jclass, arg1, arg2, arg3, arg4 }; String result = DuccAsUser.duckling(userId, arglistUser); Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccWebMonitorManagedReservation.java URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccWebMonitorManagedReservation.java?rev=1594694&r1=1594693&r2=1594694&view=diff ============================================================================== --- uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccWebMonitorManagedReservation.java (original) +++ uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccWebMonitorManagedReservation.java Wed May 14 19:58:56 2014 @@ -25,6 +25,7 @@ import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicInteger; +import org.apache.uima.ducc.common.CancelReasons.CancelReason; import org.apache.uima.ducc.common.json.MonitorInfo; import org.apache.uima.ducc.common.utils.DuccLogger; import org.apache.uima.ducc.common.utils.DuccLoggerComponents; @@ -318,7 +319,8 @@ public class DuccWebMonitorManagedReserv String arg1 = "--"+JobRequestProperties.key_id; String arg2 = ""+duccId; String arg3 = "--"+SpecificationProperties.key_reason; - String arg4 = "\"Canceled by monitor (submitter terminated)\""; + String reason = CancelReason.MonitorPingOverdue.getText(); + String arg4 = "\""+reason+"\""; String[] arglistUser = { "-u", userId, "--", jhome+java, "-cp", cp, jclass, arg1, arg2, arg3, arg4 }; String result = DuccAsUser.duckling(userId, arglistUser);