dpillot 2005/12/14 17:05:59 CET
Modified files:
core/src/java/org/jahia/ajax/monitors PDisplayAction.java
Log:
fix xml syntax and move method to schedulerservice
Revision Changes Path
1.5 +27 -18
jahia/core/src/java/org/jahia/ajax/monitors/PDisplayAction.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/jahia/core/src/java/org/jahia/ajax/monitors/PDisplayAction.java.diff?r1=1.4&r2=1.5&f=h
Index: PDisplayAction.java
===================================================================
RCS file:
/home/cvs/repository/jahia/core/src/java/org/jahia/ajax/monitors/PDisplayAction.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- PDisplayAction.java 12 Dec 2005 16:14:54 -0000 1.4
+++ PDisplayAction.java 14 Dec 2005 16:05:59 -0000 1.5
@@ -28,7 +28,7 @@
* (the better approximation we have for now of the "working charge" of
process server).
*
* @author joepi
- * @version $Id: PDisplayAction.java,v 1.4 2005/12/12 16:14:54 dpillot Exp $
+ * @version $Id: PDisplayAction.java,v 1.5 2005/12/14 16:05:59 dpillot Exp $
*/
public class PDisplayAction extends AjaxAction {
@@ -62,7 +62,8 @@
"Error: Must be logged in and have 'Admin' access");
return null;
}
- logger.debug("user:"+currentUser.getUsername()+"
(isroot:"+currentUser.isRoot()+")
(isAdmin:"+currentUser.isAdminMember(site.getID())+")");
+ //logger.debug("user:"+currentUser.getUsername()+"
(isroot:"+currentUser.isRoot()+")
(isAdmin:"+currentUser.isAdminMember(site.getID())+")");
+ /*
if (currentUser.isRoot()) {
process = getAllProcess();
} else if (currentUser.isAdminMember(site.getID())) {
@@ -70,16 +71,26 @@
} else {
process = getUserProcessList(currentUser);
}
- // concurrent threads running
- int threadCount = service.getCurrentlyExecutingJobs().size();
- StringBuffer buf=new StringBuffer();
- StringBuffer bufval = new StringBuffer();
- bufval.append(buildXmlElement("count",""+process.size()));
- bufval.append(buildXmlElement("running",""+threadCount));
- buildXmlElement(buf,"response",bufval.toString());
-
- sendResponse(buf.toString(),response);
-
+ */
+ process = service.getJobsDetails(currentUser,null);
+ String action = getParameter(request, "action", "");
+
+ if (action.equalsIgnoreCase("")) {
+ // concurrent threads running
+ int threadCount = service.getCurrentlyExecutingJobs().size();
+ StringBuffer buf = new StringBuffer();
+ buf.append(XML_HEADER);
+ buf.append("<response>\n");
+ buf.append(buildXmlElement("count", "" + process.size()));
+ buf.append(buildXmlElement("running", "" + threadCount));
+ buf.append("</response>\n");
+ sendResponse(buf.toString(), response);
+ } else {
+ logger.debug("action=" + action);
+ StringBuffer buf = new StringBuffer();
+ buf.append(XML_HEADER);
+ buf.append("<processlist>\n");
+ }
} catch (Exception e) {
logger.debug("error", e);
@@ -92,7 +103,7 @@
/**
* to get all process names
- *
+ * @deprecated
* @return a list of jobdetails
* @throws JahiaException
*/
@@ -110,7 +121,7 @@
/**
* to get only Site Process
- *
+ * @deprecated
* @param sitekey
* @return a list containing only jobdetails on the site
*/
@@ -138,7 +149,7 @@
/**
* to get only User process
- *
+ * @deprecated
* @param user
* @return a list containing only jobdetails for current user
*/
@@ -167,10 +178,8 @@
}
/**
* $Log: PDisplayAction.java,v $
- * Revision 1.4 2005/12/12 16:14:54 dpillot
- * added running info
+ * Revision 1.5 2005/12/14 16:05:59 dpillot
+ * fix xml syntax and move method to schedulerservice
*
- * Revision 1.3 2005/12/09 11:24:55 dpillot
- * added running info
*
*/
\ No newline at end of file