mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-17 10:17:41 +00:00
4040 Associate the user name of who created a tag with that tag
This commit is contained in:
parent
55f60073dd
commit
3bbb3261c9
@ -859,13 +859,14 @@ public class SingleUserCaseConverter {
|
|||||||
if (value > biggestPK) {
|
if (value > biggestPK) {
|
||||||
biggestPK = value;
|
biggestPK = value;
|
||||||
}
|
}
|
||||||
outputStatement.executeUpdate("INSERT INTO content_tags (tag_id, obj_id, tag_name_id, comment, begin_byte_offset, end_byte_offset) VALUES (" //NON-NLS
|
outputStatement.executeUpdate("INSERT INTO content_tags (tag_id, obj_id, tag_name_id, comment, begin_byte_offset, end_byte_offset, user_name) VALUES (" //NON-NLS
|
||||||
+ value + ","
|
+ value + ","
|
||||||
+ inputResultSet.getLong(2) + ","
|
+ inputResultSet.getLong(2) + ","
|
||||||
+ inputResultSet.getLong(3) + ",'"
|
+ inputResultSet.getLong(3) + ",'"
|
||||||
+ inputResultSet.getString(4) + "',"
|
+ inputResultSet.getString(4) + "',"
|
||||||
+ inputResultSet.getLong(5) + ","
|
+ inputResultSet.getLong(5) + ","
|
||||||
+ inputResultSet.getLong(6) + ")"); //NON-NLS
|
+ inputResultSet.getLong(6) + ",'"
|
||||||
|
+ inputResultSet.getString(7)+ "')"); //NON-NLS
|
||||||
|
|
||||||
} catch (SQLException ex) {
|
} catch (SQLException ex) {
|
||||||
if (ex.getErrorCode() != 0) { // 0 if the entry already exists
|
if (ex.getErrorCode() != 0) { // 0 if the entry already exists
|
||||||
@ -892,7 +893,8 @@ public class SingleUserCaseConverter {
|
|||||||
+ value + ","
|
+ value + ","
|
||||||
+ inputResultSet.getLong(2) + ","
|
+ inputResultSet.getLong(2) + ","
|
||||||
+ inputResultSet.getLong(3) + ",'"
|
+ inputResultSet.getLong(3) + ",'"
|
||||||
+ inputResultSet.getString(4) + "')"); //NON-NLS
|
+ inputResultSet.getString(4) + "','"
|
||||||
|
+ inputResultSet.getString(5) + "')"); //NON-NLS
|
||||||
|
|
||||||
} catch (SQLException ex) {
|
} catch (SQLException ex) {
|
||||||
if (ex.getErrorCode() != 0) { // 0 if the entry already exists
|
if (ex.getErrorCode() != 0) { // 0 if the entry already exists
|
||||||
|
@ -27,6 +27,7 @@ import javax.swing.Action;
|
|||||||
import org.openide.nodes.Children;
|
import org.openide.nodes.Children;
|
||||||
import org.openide.nodes.Sheet;
|
import org.openide.nodes.Sheet;
|
||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
|
import org.openide.util.NbBundle.Messages;
|
||||||
import org.openide.util.lookup.Lookups;
|
import org.openide.util.lookup.Lookups;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
|
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
|
||||||
@ -59,6 +60,7 @@ public class BlackboardArtifactTagNode extends DisplayableItemNode {
|
|||||||
this.tag = tag;
|
this.tag = tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Messages({"BlackboardArtifactTagNode.createSheet.userName.text=User Name"})
|
||||||
@Override
|
@Override
|
||||||
protected Sheet createSheet() {
|
protected Sheet createSheet() {
|
||||||
Sheet propertySheet = super.createSheet();
|
Sheet propertySheet = super.createSheet();
|
||||||
@ -80,6 +82,7 @@ public class BlackboardArtifactTagNode extends DisplayableItemNode {
|
|||||||
Logger.getLogger(ContentTagNode.class.getName()).log(Level.SEVERE, "Failed to get path for content (id = " + tag.getContent().getId() + ")", ex); //NON-NLS
|
Logger.getLogger(ContentTagNode.class.getName()).log(Level.SEVERE, "Failed to get path for content (id = " + tag.getContent().getId() + ")", ex); //NON-NLS
|
||||||
contentPath = NbBundle.getMessage(this.getClass(), "BlackboardArtifactTagNode.createSheet.unavail.text");
|
contentPath = NbBundle.getMessage(this.getClass(), "BlackboardArtifactTagNode.createSheet.unavail.text");
|
||||||
}
|
}
|
||||||
|
|
||||||
properties.put(new NodeProperty<>(
|
properties.put(new NodeProperty<>(
|
||||||
NbBundle.getMessage(this.getClass(), "BlackboardArtifactTagNode.createSheet.srcFilePath.text"),
|
NbBundle.getMessage(this.getClass(), "BlackboardArtifactTagNode.createSheet.srcFilePath.text"),
|
||||||
NbBundle.getMessage(this.getClass(), "BlackboardArtifactTagNode.createSheet.srcFilePath.text"),
|
NbBundle.getMessage(this.getClass(), "BlackboardArtifactTagNode.createSheet.srcFilePath.text"),
|
||||||
@ -95,7 +98,11 @@ public class BlackboardArtifactTagNode extends DisplayableItemNode {
|
|||||||
NbBundle.getMessage(this.getClass(), "BlackboardArtifactTagNode.createSheet.comment.text"),
|
NbBundle.getMessage(this.getClass(), "BlackboardArtifactTagNode.createSheet.comment.text"),
|
||||||
"",
|
"",
|
||||||
tag.getComment()));
|
tag.getComment()));
|
||||||
|
properties.put(new NodeProperty<>(
|
||||||
|
NbBundle.getMessage(this.getClass(), "BlackboardArtifactTagNode.createSheet.userName.text"),
|
||||||
|
NbBundle.getMessage(this.getClass(), "BlackboardArtifactTagNode.createSheet.userName.text"),
|
||||||
|
"",
|
||||||
|
tag.getUserName()));
|
||||||
return propertySheet;
|
return propertySheet;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -132,7 +139,7 @@ public class BlackboardArtifactTagNode extends DisplayableItemNode {
|
|||||||
}
|
}
|
||||||
actions.add(new ViewTaggedArtifactAction(BlackboardArtifactTagNode_viewSourceArtifact_text(), artifact));
|
actions.add(new ViewTaggedArtifactAction(BlackboardArtifactTagNode_viewSourceArtifact_text(), artifact));
|
||||||
actions.addAll(DataModelActionsFactory.getActions(tag, true));
|
actions.addAll(DataModelActionsFactory.getActions(tag, true));
|
||||||
|
|
||||||
return actions.toArray(new Action[0]);
|
return actions.toArray(new Action[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,8 +59,8 @@ class ContentTagNode extends DisplayableItemNode {
|
|||||||
|
|
||||||
@Messages({
|
@Messages({
|
||||||
"ContentTagNode.createSheet.artifactMD5.displayName=MD5 Hash",
|
"ContentTagNode.createSheet.artifactMD5.displayName=MD5 Hash",
|
||||||
"ContentTagNode.createSheet.artifactMD5.name=MD5 Hash"
|
"ContentTagNode.createSheet.artifactMD5.name=MD5 Hash",
|
||||||
})
|
"ContentTagNode.createSheet.userName.text=User Name"})
|
||||||
@Override
|
@Override
|
||||||
protected Sheet createSheet() {
|
protected Sheet createSheet() {
|
||||||
Content content = tag.getContent();
|
Content content = tag.getContent();
|
||||||
@ -115,6 +115,11 @@ class ContentTagNode extends DisplayableItemNode {
|
|||||||
Bundle.ContentTagNode_createSheet_artifactMD5_displayName(),
|
Bundle.ContentTagNode_createSheet_artifactMD5_displayName(),
|
||||||
"",
|
"",
|
||||||
file != null ? StringUtils.defaultString(file.getMd5Hash()) : ""));
|
file != null ? StringUtils.defaultString(file.getMd5Hash()) : ""));
|
||||||
|
properties.put(new NodeProperty<>(
|
||||||
|
NbBundle.getMessage(this.getClass(), "ContentTagNode.createSheet.userName.text"),
|
||||||
|
NbBundle.getMessage(this.getClass(), "ContentTagNode.createSheet.userName.text"),
|
||||||
|
"",
|
||||||
|
tag.getUserName()));
|
||||||
return propertySheet;
|
return propertySheet;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -123,13 +128,14 @@ class ContentTagNode extends DisplayableItemNode {
|
|||||||
List<Action> actions = new ArrayList<>();
|
List<Action> actions = new ArrayList<>();
|
||||||
actions.addAll(Arrays.asList(super.getActions(context)));
|
actions.addAll(Arrays.asList(super.getActions(context)));
|
||||||
|
|
||||||
AbstractFile file = getLookup().lookup(AbstractFile.class);
|
AbstractFile file = getLookup().lookup(AbstractFile.class
|
||||||
|
);
|
||||||
if (file != null) {
|
if (file != null) {
|
||||||
actions.add(ViewFileInTimelineAction.createViewFileAction(file));
|
actions.add(ViewFileInTimelineAction.createViewFileAction(file));
|
||||||
}
|
}
|
||||||
|
|
||||||
actions.addAll(DataModelActionsFactory.getActions(tag, false));
|
actions.addAll(DataModelActionsFactory.getActions(tag, false));
|
||||||
|
|
||||||
return actions.toArray(new Action[actions.size()]);
|
return actions.toArray(new Action[actions.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,6 +38,7 @@ import java.util.Set;
|
|||||||
import java.util.TreeSet;
|
import java.util.TreeSet;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
|
import org.openide.util.NbBundle.Messages;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.casemodule.services.TagsManager;
|
import org.sleuthkit.autopsy.casemodule.services.TagsManager;
|
||||||
@ -264,6 +265,7 @@ class TableReportGenerator {
|
|||||||
/**
|
/**
|
||||||
* Make table for tagged files
|
* Make table for tagged files
|
||||||
*/
|
*/
|
||||||
|
@Messages({"ReportGenerator.tagTable.header.userName=User Name"})
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
private void makeContentTagsTables() {
|
private void makeContentTagsTables() {
|
||||||
|
|
||||||
@ -286,7 +288,8 @@ class TableReportGenerator {
|
|||||||
ArrayList<String> columnHeaders = new ArrayList<>(Arrays.asList(
|
ArrayList<String> columnHeaders = new ArrayList<>(Arrays.asList(
|
||||||
NbBundle.getMessage(this.getClass(), "ReportGenerator.htmlOutput.header.tag"),
|
NbBundle.getMessage(this.getClass(), "ReportGenerator.htmlOutput.header.tag"),
|
||||||
NbBundle.getMessage(this.getClass(), "ReportGenerator.htmlOutput.header.file"),
|
NbBundle.getMessage(this.getClass(), "ReportGenerator.htmlOutput.header.file"),
|
||||||
NbBundle.getMessage(this.getClass(), "ReportGenerator.htmlOutput.header.comment"),
|
NbBundle.getMessage(this.getClass(), "ReportGenerator.htmlOutput.header.comment"),
|
||||||
|
NbBundle.getMessage(this.getClass(), "ReportGenerator.tagTable.header.userName"),
|
||||||
NbBundle.getMessage(this.getClass(), "ReportGenerator.htmlOutput.header.timeModified"),
|
NbBundle.getMessage(this.getClass(), "ReportGenerator.htmlOutput.header.timeModified"),
|
||||||
NbBundle.getMessage(this.getClass(), "ReportGenerator.htmlOutput.header.timeChanged"),
|
NbBundle.getMessage(this.getClass(), "ReportGenerator.htmlOutput.header.timeChanged"),
|
||||||
NbBundle.getMessage(this.getClass(), "ReportGenerator.htmlOutput.header.timeAccessed"),
|
NbBundle.getMessage(this.getClass(), "ReportGenerator.htmlOutput.header.timeAccessed"),
|
||||||
@ -324,7 +327,7 @@ class TableReportGenerator {
|
|||||||
fileName = tag.getContent().getName();
|
fileName = tag.getContent().getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
ArrayList<String> rowData = new ArrayList<>(Arrays.asList(tag.getName().getDisplayName() + notableString, fileName, tag.getComment()));
|
ArrayList<String> rowData = new ArrayList<>(Arrays.asList(tag.getName().getDisplayName() + notableString, fileName, tag.getComment(), tag.getUserName()));
|
||||||
Content content = tag.getContent();
|
Content content = tag.getContent();
|
||||||
if (content instanceof AbstractFile) {
|
if (content instanceof AbstractFile) {
|
||||||
AbstractFile file = (AbstractFile) content;
|
AbstractFile file = (AbstractFile) content;
|
||||||
@ -386,7 +389,8 @@ class TableReportGenerator {
|
|||||||
NbBundle.getMessage(this.getClass(), "ReportGenerator.tagTable.header.resultType"),
|
NbBundle.getMessage(this.getClass(), "ReportGenerator.tagTable.header.resultType"),
|
||||||
NbBundle.getMessage(this.getClass(), "ReportGenerator.tagTable.header.tag"),
|
NbBundle.getMessage(this.getClass(), "ReportGenerator.tagTable.header.tag"),
|
||||||
NbBundle.getMessage(this.getClass(), "ReportGenerator.tagTable.header.comment"),
|
NbBundle.getMessage(this.getClass(), "ReportGenerator.tagTable.header.comment"),
|
||||||
NbBundle.getMessage(this.getClass(), "ReportGenerator.tagTable.header.srcFile"))));
|
NbBundle.getMessage(this.getClass(), "ReportGenerator.tagTable.header.srcFile"),
|
||||||
|
NbBundle.getMessage(this.getClass(), "ReportGenerator.tagTable.header.userName"))));
|
||||||
|
|
||||||
// Give the modules the rows for the content tags.
|
// Give the modules the rows for the content tags.
|
||||||
for (BlackboardArtifactTag tag : tags) {
|
for (BlackboardArtifactTag tag : tags) {
|
||||||
@ -396,7 +400,8 @@ class TableReportGenerator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
List<String> row;
|
List<String> row;
|
||||||
row = new ArrayList<>(Arrays.asList(tag.getArtifact().getArtifactTypeName(), tag.getName().getDisplayName() + notableString, tag.getComment(), tag.getContent().getName()));
|
row = new ArrayList<>(Arrays.asList(tag.getArtifact().getArtifactTypeName(), tag.getName().getDisplayName() + notableString,
|
||||||
|
tag.getComment(), tag.getContent().getName(), tag.getUserName()));
|
||||||
tableReport.addRow(row);
|
tableReport.addRow(row);
|
||||||
|
|
||||||
// check if the tag is an image that we should later make a thumbnail for
|
// check if the tag is an image that we should later make a thumbnail for
|
||||||
|
Loading…
x
Reference in New Issue
Block a user