Merge pull request #2245 from eugene7646/timeline_report_branding_1838

1838 Fixed branding issues for Timeline reports
This commit is contained in:
Richard Cordovano 2016-06-27 17:23:52 -04:00 committed by GitHub
commit e260c2a77d
3 changed files with 12 additions and 5 deletions

View File

@ -135,7 +135,8 @@ public class SnapShotReportWriter {
private Path writeIndexHTML() throws IOException { private Path writeIndexHTML() throws IOException {
//make a map of context objects to resolve template paramaters against //make a map of context objects to resolve template paramaters against
HashMap<String, Object> indexContext = new HashMap<>(); HashMap<String, Object> indexContext = new HashMap<>();
indexContext.put("currentCase", currentCase); //NON-NLS indexContext.put("reportBranding", reportBranding); //NON-NLS
indexContext.put("reportName", reportName); //NON-NLS
Path reportIndexFile = reportFolderPath.resolve("index.html"); //NON-NLS Path reportIndexFile = reportFolderPath.resolve("index.html"); //NON-NLS
fillTemplateAndWrite("/org/sleuthkit/autopsy/timeline/snapshot/index_template.html", "Index", indexContext, reportIndexFile); //NON-NLS fillTemplateAndWrite("/org/sleuthkit/autopsy/timeline/snapshot/index_template.html", "Index", indexContext, reportIndexFile); //NON-NLS
@ -206,9 +207,15 @@ public class SnapShotReportWriter {
Files.copy(navStream, reportFolderPath.resolve("nav.html")); //NON-NLS Files.copy(navStream, reportFolderPath.resolve("nav.html")); //NON-NLS
} }
//copy favicon //copy favicon
try (InputStream faviconStream = SnapShotReportWriter.class.getResourceAsStream("/org/sleuthkit/autopsy/report/images/favicon.ico")) { //NON-NLS if (StringUtils.isBlank(agencyLogoPath)) {
Files.copy(faviconStream, reportFolderPath.resolve("favicon.ico")); //NON-NLS // use default Autopsy icon if custom icon is not set
try (InputStream faviconStream = SnapShotReportWriter.class.getResourceAsStream("/org/sleuthkit/autopsy/report/images/favicon.ico")) { //NON-NLS
Files.copy(faviconStream, reportFolderPath.resolve("favicon.ico")); //NON-NLS
}
} else {
Files.copy(Files.newInputStream(Paths.get(agencyLogoPath)), reportFolderPath.resolve("favicon.ico")); //NON-NLS
} }
//copy report summary icon //copy report summary icon
try (InputStream summaryStream = SnapShotReportWriter.class.getResourceAsStream("/org/sleuthkit/autopsy/report/images/summary.png")) { //NON-NLS try (InputStream summaryStream = SnapShotReportWriter.class.getResourceAsStream("/org/sleuthkit/autopsy/report/images/summary.png")) { //NON-NLS
Files.copy(summaryStream, reportFolderPath.resolve("summary.png")); //NON-NLS Files.copy(summaryStream, reportFolderPath.resolve("summary.png")); //NON-NLS

View File

@ -1,6 +1,6 @@
<head> <head>
<title>Autopsy Report for {{curentCase.getName}}</title> <title>{{reportBranding.getReportTitle}} for {{reportName}}</title>
<link rel="icon" type="image/ico" href="favicon.ico" /> <link rel="icon" type="image/ico" href="favicon.ico" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head> </head>

View File

@ -13,7 +13,7 @@
<div class="title"> <div class="title">
{{#reportBranding.getAgencyLogoPath}} {{#reportBranding.getAgencyLogoPath}}
<div class="left"> <div class="left">
<img src="{{agency_logo.png}}" /> <img src="agency_logo.png" />
</div> </div>
<div class="right"> <div class="right">
{{/reportBranding.getAgencyLogoPath}} {{/reportBranding.getAgencyLogoPath}}