From c3bfcf00cd815fc74f45bddcadf81f83af14cf25 Mon Sep 17 00:00:00 2001 From: Alex Ebadirad Date: Thu, 15 Mar 2012 13:53:33 -0700 Subject: [PATCH 1/2] Added css styling to exported html report. Signed-off-by: Alex Ebadirad --- .../autopsy/recentactivity/ExtractIE.java | 4 +- .../sleuthkit/autopsy/report/reportHTML.java | 102 +++++++++--------- .../sleuthkit/autopsy/report/reportPanel.java | 2 +- 3 files changed, 55 insertions(+), 53 deletions(-) diff --git a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/ExtractIE.java b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/ExtractIE.java index 540bc15a54..1d3440d940 100755 --- a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/ExtractIE.java +++ b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/ExtractIE.java @@ -259,10 +259,10 @@ public class ExtractIE { // implements BrowserActivity { } if(!ddtime.isEmpty()){ ddtime = ddtime.replace("T"," "); - ddtime = ddtime.substring(ddtime.length()-4); + ddtime = ddtime.substring(ddtime.length()-5); } if(!actime.isEmpty()){ - actime = actime.replace("z"," "); + actime = actime.replace("T"," "); actime = actime.substring(0,actime.length()-5); } diff --git a/Report/src/org/sleuthkit/autopsy/report/reportHTML.java b/Report/src/org/sleuthkit/autopsy/report/reportHTML.java index df962744ff..4c764d06e0 100644 --- a/Report/src/org/sleuthkit/autopsy/report/reportHTML.java +++ b/Report/src/org/sleuthkit/autopsy/report/reportHTML.java @@ -4,7 +4,9 @@ */ package org.sleuthkit.autopsy.report; +import java.io.BufferedWriter; import java.io.File; +import java.io.FileWriter; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.ArrayList; @@ -26,8 +28,8 @@ import org.sleuthkit.datamodel.SleuthkitCase; public class reportHTML { //Declare our publically accessible formatted report, this will change everytime they run a report - public StringBuilder formatted_Report = new StringBuilder(); - + public static StringBuilder formatted_Report = new StringBuilder(); + public static String htmlPath = ""; public reportHTML (HashMap> report, reportFilter rr){ @@ -35,6 +37,9 @@ public reportHTML (HashMap> re Case currentCase = Case.getCurrentCase(); // get the most updated case SleuthkitCase skCase = currentCase.getSleuthkitCase(); String caseName = currentCase.getName(); + String rrpath = System.getProperty("user.dir"); + rrpath = rrpath.substring(0, rrpath.length()-14); + rrpath = rrpath + "autopsy\\thirdparty\\"; Integer imagecount = currentCase.getImageIDs().length; Integer filesystemcount = currentCase.getRootObjectsCount(); DateFormat datetimeFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); @@ -42,41 +47,42 @@ public reportHTML (HashMap> re Date date = new Date(); String datetime = datetimeFormat.format(date); String datenotime = dateFormat.format(date); - // String CSS = "" - // + "body {padding: 30px; margin: 0; background: #FFFFFF; font: 13px/20px Arial, Helvetica, sans-serif; color: #535353;} " - // + "h1 {font-size: 26px; color: #005577; margin: 0 0 20px 0;} " - // + "h2 {font-size: 20px; font-weight: normal; color: #0077aa; margin: 40px 0 10px 0; padding: 0 0 10px 0; border-bottom: 1px solid #dddddd;} " - // + "h3 {font-size: 16px;color: #0077aa; margin: 40px 0 10px 0;} " - // + "p {margin: 0 0 20px 0;} table {width: 100%; padding: 0; margin: 0; border-collapse: collapse; border-bottom: 1px solid #e5e5e5;} " - // + "table thead th {display: table-cell; text-align: left; padding: 8px 16px; background: #e5e5e5; color: #777;font-size: 11px;text-shadow: #e9f9fd 0 1px 0; border-top: 1px solid #dedede; border-bottom: 2px solid #dedede;} " - // + "table tr th:nth-child(1) {text-align: center; width: 60px;} table td {display: table-cell; padding: 8px 16px; font: 13px/20px Arial, Helvetica, sans-serif;} " - // + "table tr:nth-child(even) td {background: #f3f3f3;} " - // + "table tr td:nth-child(1) {text-align: center; width: 60px; background: #f3f3f3;} " - // + "table tr:nth-child(even) td:nth-child(1) {background: #eaeaea;}" - // + ""; + String CSS = ""; //Add additional header information formatted_Report.append("Autopsy Report for Case:").append(caseName).append(""); - + formatted_Report.append(CSS); //formatted_Report.append(""); - formatted_Report.append("
"); + formatted_Report.append("
"); // Add summary information now - // formatted_Report.append(""); - formatted_Report.append("

Report for Case: ").append(caseName).append("

"); - formatted_Report.append("

Case Summary

HTML Report Generated by Autopsy 3 on ").append(datetime).append("