File reportIndex = new File(getHtmlLocation(), "index.html"); //$NON-NLS-1$ if (!reportIndex.exists()) { reportIndex.createNewFile(); buffer.append(HTML_HEADER); buffer.append(OPEN_HTML).append(OPEN_HEAD).append(CONTENT_TYPE_META); writeMetadataHeaders(buffer); buffer.append(OPEN_TITLE).append(getIndexTitle()).append(CLOSE_TITLE); buffer.append(CLOSE_HEAD); buffer.append(OPEN_BODY); buffer.append(OPEN_H3).append(getIndexTitle()).append(CLOSE_H3); writeMetadataSummary(buffer); getFilteredCount(); writeFilterCount(buffer); "<a href=\"./not_searched.html\">", "</a></p>\n" })); //$NON-NLS-1$//$NON-NLS-2$ if (result.size() > 0) { buffer.append(getProblemSummaryTable()); if (result.size() > 0) { for (Object obj : result) { if (obj instanceof Report) { Report report = (Report) obj; File refereehtml = new File(getReportsRoot(), report.name + File.separator + "index.html"); //$NON-NLS-1$ String link = extractLinkFrom(getReportsRoot(), refereehtml.getAbsolutePath()); buffer.append(getReferenceTableEntry(report, link)); buffer.append(getNoReportsInformation());
/** * Returns the HTML markup for one entry in the problem summary table. * * @param report * @param link * @return a single reference table entry */ private Object getReferenceTableEntry(Report report, String link) { StringBuilder buffer = new StringBuilder(); buffer.append(OPEN_TR); buffer.append("<td><b><a href=\"").append(link).append("\">").append(getBundleOnlyName(report.name)).append("</a>").append(CLOSE_B).append(CLOSE_TD); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ buffer.append("\t<td align=\"left\">").append(getVersion(report.name)).append(CLOSE_TD); //$NON-NLS-1$ buffer.append("\t<td align=\"center\">").append(report.typeProblems).append(CLOSE_TD); //$NON-NLS-1$ buffer.append("\t<td align=\"center\">").append(report.methodProblems).append(CLOSE_TD); //$NON-NLS-1$ buffer.append("\t<td align=\"center\">").append(report.fieldProblems).append(CLOSE_TD); //$NON-NLS-1$ buffer.append("\t<td align=\"center\">").append(report.getTotal()).append(CLOSE_TD); //$NON-NLS-1$ buffer.append(CLOSE_TR); return buffer.toString(); }
@Override void writeMetadataSummary(StringBuilder buffer) throws Exception { MissingRefMetadata metadata = (MissingRefMetadata) getMetadata(); buffer.append(OPEN_H4).append(SearchMessages.MissingRefReportConverter_MetadataTitle).append(CLOSE_H4); buffer.append("<table border=\"0px\" title=\"").append(SearchMessages.MissingRefReportConverter_MetadataTableTitle).append("\"width=\"50%\">"); //$NON-NLS-1$ //$NON-NLS-2$ buffer.append(OPEN_TR); buffer.append(openTD(14)).append(SearchMessages.MissingRefReportConverter_ReportDate).append(CLOSE_TD); buffer.append(openTD(36)).append(metadata.getRunAtDate()).append(CLOSE_TD); buffer.append(CLOSE_TR); buffer.append(OPEN_TR); buffer.append(openTD(14)).append(SearchMessages.MissingRefReportConverter_ProfileLocation).append(CLOSE_TD); String value = metadata.getProfile(); buffer.append(openTD(36)).append((value != null ? value : SearchMessages.MissingRefReportConverter_NONE)).append(CLOSE_TD); buffer.append(CLOSE_TR); buffer.append(OPEN_TR); buffer.append(openTD(14)).append(SearchMessages.MissingRefReportConverter_ReportLocation).append(CLOSE_TD); value = metadata.getReportLocation(); buffer.append(openTD(36)).append((value != null ? value : SearchMessages.MissingRefReportConverter_NONE)).append(CLOSE_TD); buffer.append(CLOSE_TR); buffer.append(OPEN_TR); buffer.append(openTD(14)).append(SearchMessages.MissingRefReportConverter_ApiUseScanLocations).append(CLOSE_TD); value = metadata.getApiUseScans(); buffer.append(openTD(36)).append((value != null ? value : SearchMessages.MissingRefReportConverter_NONE)).append(CLOSE_TD); buffer.append(CLOSE_TR); buffer.append(CLOSE_TD); buffer.append(CLOSE_TR); buffer.append(CLOSE_TABLE); }
File originhtml = null; try { File htmlroot = new File(getHtmlLocation(), report.name); if (!htmlroot.exists()) { htmlroot.mkdirs();