diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/services/TagsManager.java b/Core/src/org/sleuthkit/autopsy/casemodule/services/TagsManager.java index 29de1a0e29..2f113dec83 100755 --- a/Core/src/org/sleuthkit/autopsy/casemodule/services/TagsManager.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/services/TagsManager.java @@ -201,7 +201,7 @@ public class TagsManager implements Closeable { * @throws TskCoreException */ public void addBlackboardArtifactTag(BlackboardArtifact artifact, TagName tagName, String comment) throws TskCoreException { - tskCase.addBlackboardArtifactTag(new BlackboardArtifactTag(artifact, tagName, comment)); + tskCase.addBlackboardArtifactTag(new BlackboardArtifactTag(artifact, tskCase.getContentById(artifact.getObjectID()), tagName, comment)); } void deleteBlackboardArtifactTag(BlackboardArtifactTag tag) throws TskCoreException { diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/BlackboardArtifactTagNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/BlackboardArtifactTagNode.java index a3eae02719..5a603bbcf5 100755 --- a/Core/src/org/sleuthkit/autopsy/datamodel/BlackboardArtifactTagNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/BlackboardArtifactTagNode.java @@ -18,10 +18,13 @@ */ package org.sleuthkit.autopsy.datamodel; +import java.util.logging.Level; +import java.util.logging.Logger; import org.openide.nodes.Children; import org.openide.nodes.Sheet; import org.openide.util.lookup.Lookups; import org.sleuthkit.datamodel.BlackboardArtifactTag; +import org.sleuthkit.datamodel.TskCoreException; /** * Instances of this class wrap BlackboardArtifactTag objects. In the Autopsy @@ -31,18 +34,19 @@ import org.sleuthkit.datamodel.BlackboardArtifactTag; * either content or blackboard artifact tag nodes. */ public class BlackboardArtifactTagNode extends DisplayableItemNode { - private static final String ICON_PATH = "org/sleuthkit/autopsy/images/tag-folder-blue-icon-16.png"; // RJCTODO: Want better icons? + private static final String ICON_PATH = "org/sleuthkit/autopsy/images/tag-folder-blue-icon-16.png"; + private final BlackboardArtifactTag tag; public BlackboardArtifactTagNode(BlackboardArtifactTag tag) { - super(Children.LEAF, Lookups.fixed(tag, tag.getArtifact())); - super.setName(tag.getArtifact().getDisplayName()); - super.setDisplayName(tag.getArtifact().getDisplayName()); + super(Children.LEAF, Lookups.fixed(tag, tag.getArtifact(), tag.getContent())); + super.setName(tag.getContent().getName()); + super.setDisplayName(tag.getContent().getName()); this.setIconBaseWithExtension(ICON_PATH); + this.tag = tag; } @Override protected Sheet createSheet() { - // RJCTODO: Make additional properties as needed for DataResultViewers Sheet propertySheet = super.createSheet(); Sheet.Set properties = propertySheet.get(Sheet.PROPERTIES); if (properties == null) { @@ -50,15 +54,23 @@ public class BlackboardArtifactTagNode extends DisplayableItemNode { propertySheet.put(properties); } - properties.put(new NodeProperty("Name", "Name", "", getName())); - + properties.put(new NodeProperty("Source File", "Source File", "", tag.getContent().getName())); + String contentPath; + try { + contentPath = tag.getContent().getUniquePath(); + } + catch (TskCoreException ex) { + Logger.getLogger(ContentTagNode.class.getName()).log(Level.SEVERE, "Failed to get path for content (id = " + tag.getContent().getId() + ")", ex); + contentPath = "Unavailable"; + } + properties.put(new NodeProperty("Source File Path", "Source File Path", "", contentPath)); + properties.put(new NodeProperty("Result Type", "Result Type", "", tag.getArtifact().getDisplayName())); + return propertySheet; } @Override public T accept(DisplayableItemNodeVisitor v) { - // See classes derived from DisplayableItemNodeVisitor - // for behavior added using the Visitor pattern. return v.visit(this); } diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/ContentTagNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/ContentTagNode.java index 940fc6ab9d..2c893b3fb5 100755 --- a/Core/src/org/sleuthkit/autopsy/datamodel/ContentTagNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/ContentTagNode.java @@ -19,6 +19,8 @@ package org.sleuthkit.autopsy.datamodel; +import java.util.logging.Level; +import java.util.logging.Logger; import org.openide.nodes.Children; import org.openide.nodes.Sheet; import org.openide.util.lookup.Lookups; @@ -45,7 +47,6 @@ public class ContentTagNode extends DisplayableItemNode { @Override protected Sheet createSheet() { - // RJCTODO: Make additional properties as needed for DataResultViewers Sheet propertySheet = super.createSheet(); Sheet.Set properties = propertySheet.get(Sheet.PROPERTIES); if (properties == null) { @@ -53,13 +54,13 @@ public class ContentTagNode extends DisplayableItemNode { propertySheet.put(properties); } - properties.put(new NodeProperty("Source File", "Source File", "", getName())); + properties.put(new NodeProperty("Source File", "Source File", "", tag.getContent().getName())); String contentPath; try { contentPath = tag.getContent().getUniquePath(); } catch (TskCoreException ex) { - // RJCTODO: Add to log + Logger.getLogger(ContentTagNode.class.getName()).log(Level.SEVERE, "Failed to get path for content (id = " + tag.getContent().getId() + ")", ex); contentPath = "Unavailable"; } properties.put(new NodeProperty("Source File Path", "Source File Path", "", contentPath)); @@ -69,8 +70,6 @@ public class ContentTagNode extends DisplayableItemNode { @Override public T accept(DisplayableItemNodeVisitor v) { - // See classes derived from DisplayableItemNodeVisitor - // for behavior added using the Visitor pattern. return v.visit(this); }