Removing old commented out code

This commit is contained in:
Adam Miller
2013-03-11 16:58:28 -07:00
parent a32f00c2b3
commit 783d48b49c
@@ -281,278 +281,6 @@ public class JobResource extends BaseResource {
throw new RuntimeException(e);
}
// PrintWriter pw = new PrintWriter(writer);
// String jobTitle = cj.getShortName() + " - "
// + cj.getJobStatusDescription() + " - Job main page";
// String baseRef = getRequest().getResourceRef().getBaseRef().toString();
// if (!baseRef.endsWith("/")) {
// baseRef += "/";
// }
// TODO: replace with use a templating system (FreeMarker?)
// pw.println("<!DOCTYPE html>");
// pw.println("<html>");
// pw.println("<head>");
// pw.println("<title>" + jobTitle + "</title>");
// pw.println("<base href='" + baseRef + "'>");
// pw.println("<link rel=\"stylesheet\" type=\"text/css\" href=\""
// + getStylesheetRef() + "\">");
// pw.println("</head><body>");
// pw.print("<h1>Job <i>" + cj.getShortName() + "</i> (");
// if (cj.isLaunchInfoPartial()) {
// pw.print("at least ");
// }
// pw.print(cj.getLaunchCount() + " launches");
// if (cj.getLastLaunch() != null) {
// long ago = System.currentTimeMillis()
// - cj.getLastLaunch().getMillis();
// pw.print(", last "
// + ArchiveUtils.formatMillisecondsToConventional(ago, 2)
// + " ago");
// }
// pw.println(")</h1>");
//
// Flash.renderFlashesHTML(pw, getRequest());
// if (cj.isProfile()) {
// pw.print("<p>As a <i>profile</i>, this job may be built for "
// + "testing purposes but not launched. Use the 'copy job to' "
// + "functionality at bottom to copy this profile to a "
// + "launchable job.</p>");
// }
// button controls
// pw.println("<form style='white-space:nowrap' method='POST'>");
// // PREP, LAUNCH
// pw.println("<div>");
// pw.println("<span class=\"bgroup\">");
// pw.print("<input type='submit' name='action' value='build'");
// if (cj.hasApplicationContext()) {
// pw.print(" disabled='disabled' title='build job'");
// }
// pw.println(">");
// pw.print("<input type='submit' name='action' value='launch'");
// if (cj.isProfile()) {
// pw.print(" disabled='disabled' title='profiles cannot be launched'");
// }
// if (!cj.isLaunchable()) {
// pw.print(" disabled='disabled'");
// }
// pw.println("></span>");
// // PAUSE, UNPAUSE, CHECKPOINT
// pw.print("<span class=\"bgroup\">");
// pw.print("<input");
// if (!cj.isPausable()) {
// pw.print(" disabled");
// }
// pw.println(" type='submit' name='action' value='pause'>");
// pw.print("<input");
// if (!cj.isUnpausable()) {
// pw.print(" disabled");
// }
// pw.println(" type='submit' name='action' value='unpause'>");
// pw.print("<input");
// if (!cj.isRunning()) {
// pw.print(" disabled");
// }
// pw.println(" type='submit' name='action' value='checkpoint'>");
// pw.println("</span>");
//
// // TERMINATE, RESET
// pw.print("<span class=\"bgroup\">\n<input");
// if (!cj.isRunning()) {
// pw.print(" disabled");
// }
// pw.println(" type='submit' name='action' value='terminate'>");
// pw.print("<input type='submit' name='action' value='teardown' ");
// pw.print(cj.hasApplicationContext() ? ""
// : " disabled='disabled' title='no instance'");
// pw.println(">");
// pw.println("</span>");
// pw.println("</div>");
// display checkpoint options
// if (cj.getCheckpointService() != null) {
// Checkpoint recoveryCheckpoint = cj.getCheckpointService()
// .getRecoveryCheckpoint();
// if (recoveryCheckpoint != null) {
// pw.println("<div>recover from <i>"
// + recoveryCheckpoint.getName() + "</i></div>");
// } else if (cj.getCheckpointService().hasAvailableCheckpoints()
// && cj.isLaunchable()) {
// pw.println("<div>select an available checkpoint before launch to recover:");
// pw.println("<select name='checkpoint'><option> </option>");
// for (File f : cj.getCheckpointService()
// .findAvailableCheckpointDirectories()) {
// pw.println("<option>" + f.getName() + "</option>");
// }
// pw.println("</select></div>");
// }
// }
//
// pw.println("</form>");
// // configuration
// pw.print("<div>configuration: ");
// printLinkedFile(pw, cj.getPrimaryConfig());
// pw.println("</div>");
// for (File f : cj.getImportedConfigs(cj.getPrimaryConfig())) {
// pw.print("<div>imported: ");
// printLinkedFile(pw, f);
// pw.println("</div>");
// }
// pw.print("<h2>Job Log ");
// pw.print("(<a href='jobdir/" + cj.getJobLog().getName()
// + "?format=paged&amp;pos=-1&amp;lines=-128&amp;reverse=y'><i>more</i></a>)");
// pw.println("</h2>");
// pw.println("<div class=\"log\">");
// if (cj.getJobLog().exists()) {
// try {
// List<String> logLines = new LinkedList<String>();
// FileUtils.pagedLines(cj.getJobLog(), -1, -5, logLines);
// Collections.reverse(logLines);
// for (String line : logLines) {
// pw.print("<div>");
// StringEscapeUtils.escapeHtml(pw, line);
// pw.println("</div>");
// }
// } catch (IOException ioe) {
// pw.println("<div class=\"error\">error reading job log</div>");
// }
// }
// pw.println("</div>");
//
// pw.println("<h2>Job is " + cj.getJobStatusDescription() + "</h2>");
// if (cj.hasApplicationContext()) {
// pw.println("<dl id=\"jobstats\">");
// pw.println("<dt>Totals</dt>");
// pw.println("<dd><div>" + cj.uriTotalsReport() + "</div>");
// pw.println("<div>" + cj.sizeTotalsReport() + "</div></dd>");
//
// pw.println("<dt>Alerts</dt>");
// pw.print("<dd>");
// pw.println(cj.getAlertCount() == 0 ? "<i>none</i>" : cj
// .getAlertCount());
// if (cj.getAlertCount() > 0) {
// printLinkedFile(pw, cj.getCrawlController().getLoggerModule()
// .getAlertsLogPath().getFile(), "tail alert log...",
// "format=paged&amp;pos=-1&amp;lines=-128");
//// }
// pw.println("</dd>");
//
// pw.println("<dt>Rates</dt>");
// pw.println("<dd>" + cj.rateReport() + "</dd>");
//
// pw.println("<dt>Load</dt>");
// pw.println("<dd>" + cj.loadReport() + "</dd>");
//
// pw.println("<dt>Elapsed</dt>");
// pw.println("<dd>" + cj.elapsedReport() + "</dd>");
//
// pw.println("<dt><a href=\"report/ToeThreadsReport\">Threads</a></dt>");
// pw.println("<dd>" + cj.threadReport() + "&nbsp;</dd>");
//
// pw.println("<dt><a href='report/FrontierSummaryReport'>Frontier</a></dt>");
// pw.println("<dd>" + cj.frontierReport() + "&nbsp;</dd>");
// pw.println("<dt>Memory</dt>");
// pw.println("<dd>" + getEngine().heapReport() + "</dd>");
//
// pw.println("</dl>");
// if ((cj.isRunning() || (cj.hasApplicationContext() && !cj
// .isLaunchable()))
// && cj.getCrawlController().getLoggerModule()
// .getCrawlLogPath().getFile().exists()) {
// show crawl log for running or finished crawls
// pw.print("<h3>Crawl Log ");
// printLinkedFile(pw, cj.getCrawlController().getLoggerModule()
// .getCrawlLogPath().getFile(), "<i>more</i>",
// "format=paged&amp;pos=-1&amp;lines=-128&amp;reverse=y");
// pw.println("</h3>");
// pw.println("<pre style='overflow:auto'>");
// try {
// List<String> logLines = new LinkedList<String>();
// FileUtils.pagedLines(cj.getCrawlController()
// .getLoggerModule().getCrawlLogPath().getFile(), -1,
// -10, logLines);
// Collections.reverse(logLines);
// for (String line : logLines) {
// StringEscapeUtils.escapeHtml(pw, line);
// pw.println();
// }
// } catch (IOException ioe) {
// pw.println("--error reading crawl log--");
// }
// pw.println("</pre>");
// }
// }
// if (cj.hasApplicationContext()) {
// pw.println("<h2>Reports</h2>");
// for (Report report : cj.getCrawlController().getStatisticsTracker()
// .getReports()) {
// if (report.getShouldReportDuringCrawl()) {
// String className = report.getClass().getSimpleName();
// String shortName = className.substring(0,
// className.length() - "Report".length());
// pw.println("<a href='report/" + className + "'>"
// + shortName + "</a>");
// }
// }
// }
// pw.println("<h2>Files</h2>");
// pw.println("<h3>Browse <a href='jobdir'>Job Directory</a></h3>");
// // specific paths from wired context
// pw.println("<h3>Configuration-referenced Paths</h3>");
// if (cj.getConfigPaths().isEmpty()) {
// pw.println("<i>build the job to discover referenced paths</i>");
// } else {
// pw.println("<dl>");
// for (String cppp : cj.getConfigPaths().keySet()) {
// ConfigPath cp = cj.getConfigPaths().get(cppp);
// pw.println("<dt>" + cppp + ": " + cp.getName() + "</dt>");
// pw.println("<dd>");
// if (!StringUtils.isEmpty(cp.getPath())) {
// printLinkedFile(
// pw,
// cp.getFile(),
// cp.getFile().toString(),
// cp.getPath().endsWith(".log") ? "format=paged&amp;pos=-1&amp;lines=-128&amp;reverse=y"
// : null);
// } else {
// pw.println("<i>unset</i>");
// }
// pw.println("</dd>");
// }
// pw.println("</dl>");
//
// }
// pw.println("<h2>Advanced</h2>");
// pw.println("<h3><a href='script'>Scripting console</a></h3>");
//
// if (!cj.hasApplicationContext()) {
// pw.println("<i>build the job to browse bean instances</i>");
// } else {
// pw.println("<h3><a href='beans'>Browse beans</a></h3>");
// }
// pw.println("<h2>Copy</h2>");
// pw.println("<form method='POST'>Copy job to <input name='copyTo'>"
// + "<input value='copy' type='submit'>"
// + "<input id='asProfile' type='checkbox' name='asProfile'>"
// + "<label for='asProfile'>as profile</label></form>");
// // pw.println("<hr>");
//
// pw.println("</body>");
// pw.println("</html>");
}
/**