* JobResource.java

add descriptive status to TITLE
This commit is contained in:
gojomo committed 2009-11-07 03:00:49 +00:00
1 parent 9b211165df
commit bda89f5617
1 file changed
+17 -12
@@ -89,7 +89,9 @@ public class JobResource extends Resource {
protected void writeHtml(Writer writer) {
PrintWriter pw = new PrintWriter(writer);
String jobTitle = cj.getShortName()+ " - Job main page";
String jobTitle = cj.getShortName() + " - "
+ getJobStatusDescription()
+ " - Job main page";
String baseRef = getRequest().getResourceRef().getBaseRef().toString();
if(!baseRef.endsWith("/")) {
baseRef += "/";
@@ -207,17 +209,8 @@ public class JobResource extends Resource {
}
}
pw.println("</div>");
if(!cj.isContainerOk()) {
pw.println("<h2>Unbuilt Job</h2>");
} else if(cj.isRunning()) {
pw.println("<h2>Active Job: "+cj.getCrawlController().getState()+"</h2>");
} else if(cj.isLaunchable()){
pw.println("<h2>Ready Job</h2>");
} else {
pw.println("<h2>Finished Job: "+cj.getCrawlController().getCrawlExitStatus()+"</h2>");
}
pw.println("<h2>Job is "+getJobStatusDescription()+"</h2>");
if(cj.isContainerOk()) {
pw.println("<b>Totals</b><br/>&nbsp;&nbsp;");
@@ -337,6 +330,18 @@ public class JobResource extends Resource {
pw.println("<hr/>");
pw.close();
}
public String getJobStatusDescription() {
if(!cj.isContainerOk()) {
return "Unbuilt";
} else if(cj.isRunning()) {
return "Active: "+cj.getCrawlController().getState();
} else if(cj.isLaunchable()){
return "Ready";
} else {
return "Finished: "+cj.getCrawlController().getCrawlExitStatus();
}
}
/**
* Print a link to the given File