private List getSummaryInfo(CrawlerStatus status) { List res = new ArrayList(); StatusTable.SummaryInfo statusSi = new StatusTable.SummaryInfo( "Status", ColumnDescriptor.TYPE_STRING, status.getCrawlStatusMsg()); ArchivalUnit au = status.getAu(); if (au != null) { AuState aus = AuUtil.getAuState(au); if (status.getCrawlStatus() == Crawler.STATUS_SUCCESSFUL && aus.hasNoSubstance()) { statusSi.setValueFootnote(FOOT_NO_SUBSTANCE_CRAWL_STATUS); } } res.add(statusSi); String sources = StringUtil.separatedString(status.getSources()); res.add(new StatusTable.SummaryInfo("Source", ColumnDescriptor.TYPE_STRING, sources)); String startUrls = StringUtil.separatedString(status.getStartUrls()); res.add( new StatusTable.SummaryInfo("Starting Url(s)", ColumnDescriptor.TYPE_STRING, startUrls)); return res; }
/** iterate over the mime-types makeRow for each */ private List getRows(CrawlerStatus status, String key) { Collection mimeTypes = status.getMimeTypes(); List rows = new ArrayList(); if (mimeTypes != null) { String mimeType; for (Iterator it = mimeTypes.iterator(); it.hasNext(); ) { mimeType = (String) it.next(); rows.add(makeRow(status, mimeType, key)); } } return rows; }
private void addIfNonZero(List res, String head, int val) { if (val != 0) { res.add(new StatusTable.SummaryInfo(head, ColumnDescriptor.TYPE_INT, new Long(val))); } }