From 783d48b49c5e256ba786941000fa69a4f02b5967 Mon Sep 17 00:00:00 2001 From: Adam Miller Date: Thu, 26 Jul 2012 16:42:56 -0700 Subject: [PATCH] Removing old commented out code --- .../archive/crawler/restlet/JobResource.java | 272 ------------------ 1 file changed, 272 deletions(-) diff --git a/engine/src/main/java/org/archive/crawler/restlet/JobResource.java b/engine/src/main/java/org/archive/crawler/restlet/JobResource.java index 2d1ad7c5..d5e79611 100644 --- a/engine/src/main/java/org/archive/crawler/restlet/JobResource.java +++ b/engine/src/main/java/org/archive/crawler/restlet/JobResource.java @@ -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(""); -// pw.println(""); -// pw.println(""); -// pw.println("" + jobTitle + ""); -// pw.println(""); -// pw.println(""); -// pw.println(""); -// pw.print("

Job " + cj.getShortName() + " ("); - -// 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(")

"); -// -// Flash.renderFlashesHTML(pw, getRequest()); - -// if (cj.isProfile()) { -// pw.print("

As a profile, 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.

"); -// } - - // button controls -// pw.println("
"); -// // PREP, LAUNCH -// pw.println("
"); -// pw.println(""); -// pw.print(""); -// pw.print(""); - -// // PAUSE, UNPAUSE, CHECKPOINT -// pw.print(""); -// pw.print(""); -// pw.print(""); -// pw.print(""); -// pw.println(""); -// -// // TERMINATE, RESET -// pw.print("\n"); -// pw.print(""); -// pw.println(""); -// pw.println("
"); - - // display checkpoint options -// if (cj.getCheckpointService() != null) { -// Checkpoint recoveryCheckpoint = cj.getCheckpointService() -// .getRecoveryCheckpoint(); -// if (recoveryCheckpoint != null) { -// pw.println("
recover from " -// + recoveryCheckpoint.getName() + "
"); -// } else if (cj.getCheckpointService().hasAvailableCheckpoints() -// && cj.isLaunchable()) { -// pw.println("
select an available checkpoint before launch to recover:"); -// pw.println("
"); -// } -// } -// -// pw.println("
"); - -// // configuration -// pw.print("
configuration: "); -// printLinkedFile(pw, cj.getPrimaryConfig()); -// pw.println("
"); -// for (File f : cj.getImportedConfigs(cj.getPrimaryConfig())) { -// pw.print("
imported: "); -// printLinkedFile(pw, f); -// pw.println("
"); -// } - -// pw.print("

Job Log "); -// pw.print("(more)"); -// pw.println("

"); -// pw.println("
"); -// if (cj.getJobLog().exists()) { -// try { -// List logLines = new LinkedList(); -// FileUtils.pagedLines(cj.getJobLog(), -1, -5, logLines); -// Collections.reverse(logLines); -// for (String line : logLines) { -// pw.print("
"); -// StringEscapeUtils.escapeHtml(pw, line); -// pw.println("
"); -// } -// } catch (IOException ioe) { -// pw.println("
error reading job log
"); -// } -// } -// pw.println("
"); -// -// pw.println("

Job is " + cj.getJobStatusDescription() + "

"); - -// if (cj.hasApplicationContext()) { -// pw.println("
"); - -// pw.println("
Totals
"); -// pw.println("
" + cj.uriTotalsReport() + "
"); -// pw.println("
" + cj.sizeTotalsReport() + "
"); -// -// pw.println("
Alerts
"); -// pw.print("
"); -// pw.println(cj.getAlertCount() == 0 ? "none" : cj -// .getAlertCount()); -// if (cj.getAlertCount() > 0) { -// printLinkedFile(pw, cj.getCrawlController().getLoggerModule() -// .getAlertsLogPath().getFile(), "tail alert log...", -// "format=paged&pos=-1&lines=-128"); -//// } -// pw.println("
"); -// -// pw.println("
Rates
"); -// pw.println("
" + cj.rateReport() + "
"); -// -// pw.println("
Load
"); -// pw.println("
" + cj.loadReport() + "
"); -// -// pw.println("
Elapsed
"); -// pw.println("
" + cj.elapsedReport() + "
"); -// -// pw.println("
Threads
"); -// pw.println("
" + cj.threadReport() + " 
"); -// -// pw.println("
Frontier
"); -// pw.println("
" + cj.frontierReport() + " 
"); - -// pw.println("
Memory
"); -// pw.println("
" + getEngine().heapReport() + "
"); -// -// pw.println("
"); - -// if ((cj.isRunning() || (cj.hasApplicationContext() && !cj -// .isLaunchable())) -// && cj.getCrawlController().getLoggerModule() -// .getCrawlLogPath().getFile().exists()) { - // show crawl log for running or finished crawls -// pw.print("

Crawl Log "); -// printLinkedFile(pw, cj.getCrawlController().getLoggerModule() -// .getCrawlLogPath().getFile(), "more", -// "format=paged&pos=-1&lines=-128&reverse=y"); -// pw.println("

"); -// pw.println("
");
-//                try {
-//                    List logLines = new LinkedList();
-//                    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("
"); -// } - -// } - -// if (cj.hasApplicationContext()) { -// pw.println("

Reports

"); -// 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("" -// + shortName + ""); -// } -// } -// } - -// pw.println("

Files

"); -// pw.println("

Browse Job Directory

"); -// // specific paths from wired context -// pw.println("

Configuration-referenced Paths

"); -// if (cj.getConfigPaths().isEmpty()) { -// pw.println("build the job to discover referenced paths"); -// } else { -// pw.println("
"); -// for (String cppp : cj.getConfigPaths().keySet()) { -// ConfigPath cp = cj.getConfigPaths().get(cppp); -// pw.println("
" + cppp + ": " + cp.getName() + "
"); -// pw.println("
"); -// if (!StringUtils.isEmpty(cp.getPath())) { -// printLinkedFile( -// pw, -// cp.getFile(), -// cp.getFile().toString(), -// cp.getPath().endsWith(".log") ? "format=paged&pos=-1&lines=-128&reverse=y" -// : null); -// } else { -// pw.println("unset"); -// } -// pw.println("
"); -// } -// pw.println("
"); -// -// } - -// pw.println("

Advanced

"); -// pw.println("

Scripting console

"); -// -// if (!cj.hasApplicationContext()) { -// pw.println("build the job to browse bean instances"); -// } else { -// pw.println("

Browse beans

"); -// } - -// pw.println("

Copy

"); -// pw.println("
Copy job to " -// + "" -// + "" -// + "
"); -// // pw.println("
"); -// -// pw.println(""); -// pw.println(""); } /**