diff --git a/Core/src/org/sleuthkit/autopsy/report/Report.java b/Core/src/org/sleuthkit/autopsy/report/Report.java
index c60e8f4b35..56bf70d1f3 100644
--- a/Core/src/org/sleuthkit/autopsy/report/Report.java
+++ b/Core/src/org/sleuthkit/autopsy/report/Report.java
@@ -38,6 +38,7 @@ import java.text.SimpleDateFormat;
import java.util.List;
import org.apache.commons.lang.StringEscapeUtils;
import org.openide.util.Exceptions;
+import org.sleuthkit.datamodel.AbstractFile;
import org.sleuthkit.datamodel.TskCoreException;
public class Report {
@@ -67,12 +68,12 @@ public class Report {
tempdbconnect.executeStmt("DROP TABLE IF EXISTS report_list;");
tempdbconnect.executeStmt("DROP TABLE IF EXISTS report_name;");
tempdbconnect.executeStmt("DROP TABLE IF EXISTS report;");
- String temp1 = "CREATE TABLE report_keyword AS SELECT value_text as keyword,blackboard_attributes.attribute_type_id, blackboard_attributes.artifact_id FROM blackboard_attributes WHERE attribute_type_id = " + BlackboardAttribute.ATTRIBUTE_TYPE.TSK_KEYWORD.getTypeID() + ";";
+ String temp1 = "CREATE TABLE report_keyword AS SELECT value_text as keyword, blackboard_attributes.attribute_type_id, blackboard_attributes.artifact_id FROM blackboard_attributes WHERE attribute_type_id = " + BlackboardAttribute.ATTRIBUTE_TYPE.TSK_KEYWORD.getTypeID() + ";";
String temp2 = "CREATE TABLE report_preview AS SELECT value_text as preview, blackboard_attributes.attribute_type_id, blackboard_attributes.artifact_id FROM blackboard_attributes WHERE attribute_type_id = " + BlackboardAttribute.ATTRIBUTE_TYPE.TSK_KEYWORD_PREVIEW.getTypeID() + ";";
String temp3 = "CREATE TABLE report_exp AS SELECT value_text as exp, blackboard_attributes.attribute_type_id, blackboard_attributes.artifact_id FROM blackboard_attributes WHERE attribute_type_id = " + BlackboardAttribute.ATTRIBUTE_TYPE.TSK_KEYWORD_REGEXP.getTypeID() + ";";
String temp4 = "CREATE TABLE report_list AS SELECT value_text as list, blackboard_attributes.attribute_type_id, blackboard_attributes.artifact_id FROM blackboard_attributes WHERE attribute_type_id = " + BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SET_NAME.getTypeID() + ";";
- String temp5 = "CREATE TABLE report_name AS SELECT name, report_keyword.artifact_id from tsk_files,blackboard_artifacts, report_keyword WHERE blackboard_artifacts.artifact_id = report_keyword.artifact_id AND blackboard_artifacts.obj_id = tsk_files.obj_id;";
- String temp6 = "CREATE TABLE report AS SELECT keyword,preview,exp,list,name from report_keyword "
+ String temp5 = "CREATE TABLE report_name AS SELECT name, report_keyword.artifact_id, tsk_files.obj_id as obj_id from tsk_files, blackboard_artifacts, report_keyword WHERE blackboard_artifacts.artifact_id = report_keyword.artifact_id AND blackboard_artifacts.obj_id = tsk_files.obj_id;";
+ String temp6 = "CREATE TABLE report AS SELECT keyword, preview, exp, list, name, obj_id from report_keyword "
+ "LEFT JOIN report_preview ON report_keyword.artifact_id=report_preview.artifact_id "
+ "LEFT JOIN report_exp ON report_keyword.artifact_id=report_exp.artifact_id "
+ "LEFT JOIN report_list ON report_keyword.artifact_id=report_list.artifact_id "
@@ -83,20 +84,27 @@ public class Report {
tempdbconnect.executeStmt(temp4);
tempdbconnect.executeStmt(temp5);
tempdbconnect.executeStmt(temp6);
- ResultSet uniqueresults = tempdbconnect.executeQry("SELECT keyword, exp, preview, list, name FROM report ORDER BY keyword ASC");
+ ResultSet uniqueresults = tempdbconnect.executeQry("SELECT keyword, exp, preview, list, name, obj_id FROM report ORDER BY keyword ASC");
String keyword = "";
while (uniqueresults.next()) {
+ Long objId = uniqueresults.getLong("obj_id");
+ AbstractFile file = null;
+ try {
+ file = tempDb.getAbstractFileById(objId);
+ } catch (TskCoreException ex) {
+ logger.log(Level.WARNING, "Could not get AbstractFile from TSK ", ex);
+ }
StringBuilder table = new StringBuilder();
if (uniqueresults.getString("keyword") == null ? keyword == null : uniqueresults.getString("keyword").equals(keyword)) {
} else {
table.append("
\n");
keyword = uniqueresults.getString("keyword");
table.append("").append(keyword).append("\n");
- table.append("
").append("File Name").append(" | Preview | Keyword List |
---|
").append("File Name").append(" | Preview | Keyword List | Path |
---|---|---|---|
").append(uniqueresults.getString("name")).append(" | \n"); String previewreplace = StringEscapeUtils.escapeHtml(uniqueresults.getString("preview")); - table.append("").append(previewreplace.replaceAll("").append(" | ").append(uniqueresults.getString("list")).append(" (").append(uniqueresults.getString("exp") == null ? keyword : uniqueresults.getString("exp")).append(")").append(" | ").append("").append(previewreplace.replaceAll("").append(" | ").append(uniqueresults.getString("list")).append(" (").append(uniqueresults.getString("exp") == null ? keyword : uniqueresults.getString("exp")).append(")").append(" | ").append("").append(file != null ? file.getUniquePath() : "").append(" | ").append("\n"); out.write(table.toString()); } tempdbconnect.executeStmt("DROP TABLE IF EXISTS report_keyword;"); diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportHTML.java b/Core/src/org/sleuthkit/autopsy/report/ReportHTML.java index 4e868a6158..cd3f726fba 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportHTML.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportHTML.java @@ -328,7 +328,7 @@ public class ReportHTML implements ReportModule { nav.append("
").append(attributes.get(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_NAME.getTypeID())).append(" | \n"); - row.append("").append(file.getUniquePath()).append(" | \n"); row.append("").append(file != null ? file.getName() : "").append(" | \n"); + row.append("").append(file.getUniquePath()).append(" | \n"); row.append("