response.sendError(HttpServletResponse.SC_FORBIDDEN, "You must be logged in as WGA administrator!");
return;
}
String jobToShow = request.getParameter("name");
Job job = getCore().getScheduler().getJob(jobToShow);
if (job == null) {
response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Unknown job: " + jobToShow);
return;
}
response.setContentType("text/html");
Writer out = response.getWriter();
out.write("<HTML><HEAD>");
out.write("\n<script language=\"javascript\">\nvar running=" + Boolean.valueOf(job.isRunning()).toString() + ";\n</script>\n");
/*
* if (job.isRunning()) {
* out.write("<META HTTP-EQUIV=\"refresh\" CONTENT=\"3\"/>"); } else {
* out.write("<META HTTP-EQUIV=\"refresh\" CONTENT=\"6\"/>"); }
*/
out.write("</HEAD>");
out.write("<BODY style=\"background-color:white; font-family:sans-serif; font-size:10pt\">");
String log = job.getLog();
LineNumberReader reader = new LineNumberReader(new StringReader(log));
String line;
while ((line = reader.readLine()) != null) {
out.write(line);
out.write("<BR/>");
}
if (!job.isRunning() && job.getEndMessage() != null) {
out.write("<p>");
out.write("<table border=\"1\" cellpadding=\"5\"><tr><td>");
out.write(job.getEndMessage());
out.write("</td></tr></table>");
out.write("</p>");
}
out.write("<a id=\"bottomLink\" name=\"bottom\"> </a></BODY></HTML>");