From 672a25056e20cf0251af9df84f609aa0b750cc90 Mon Sep 17 00:00:00 2001 From: Oliver Spohngellert Date: Thu, 14 Jan 2016 11:01:12 -0500 Subject: [PATCH 1/2] Fixed DirectoryTreeTopComponent to use the artifact ID and typeName instead of ARTIFACT_TYPE --- .../DirectoryTreeTopComponent.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/directorytree/DirectoryTreeTopComponent.java b/Core/src/org/sleuthkit/autopsy/directorytree/DirectoryTreeTopComponent.java index 1ba61a63f3..1fa77f5940 100644 --- a/Core/src/org/sleuthkit/autopsy/directorytree/DirectoryTreeTopComponent.java +++ b/Core/src/org/sleuthkit/autopsy/directorytree/DirectoryTreeTopComponent.java @@ -845,13 +845,14 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat @Override public void viewArtifact(final BlackboardArtifact art) { - BlackboardArtifact.ARTIFACT_TYPE type = BlackboardArtifact.ARTIFACT_TYPE.fromID(art.getArtifactTypeID()); + int typeID = art.getArtifactTypeID(); + String typeName = art.getArtifactTypeName(); Children rootChilds = em.getRootContext().getChildren(); Node treeNode = null; Node resultsNode = rootChilds.findChild(ResultsNode.NAME); Children resultsChilds = resultsNode.getChildren(); - if (type.equals(BlackboardArtifact.ARTIFACT_TYPE.TSK_HASHSET_HIT)) { - Node hashsetRootNode = resultsChilds.findChild(type.getLabel()); + if (typeID == BlackboardArtifact.ARTIFACT_TYPE.TSK_HASHSET_HIT.getTypeID()) { + Node hashsetRootNode = resultsChilds.findChild(typeName); Children hashsetRootChilds = hashsetRootNode.getChildren(); try { String setName = null; @@ -866,8 +867,8 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat } catch (TskException ex) { logger.log(Level.WARNING, "Error retrieving attributes", ex); //NON-NLS } - } else if (type.equals(BlackboardArtifact.ARTIFACT_TYPE.TSK_KEYWORD_HIT)) { - Node keywordRootNode = resultsChilds.findChild(type.getLabel()); + } else if (typeID == BlackboardArtifact.ARTIFACT_TYPE.TSK_KEYWORD_HIT.getTypeID()) { + Node keywordRootNode = resultsChilds.findChild(typeName); Children keywordRootChilds = keywordRootNode.getChildren(); try { String listName = null; @@ -893,9 +894,9 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat } catch (TskException ex) { logger.log(Level.WARNING, "Error retrieving attributes", ex); //NON-NLS } - } else if (type.equals(BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_FILE_HIT) - || type.equals(BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_ARTIFACT_HIT)) { - Node interestingItemsRootNode = resultsChilds.findChild(type.getLabel()); + } else if (typeID == BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_FILE_HIT.getTypeID() + || typeID == BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_ARTIFACT_HIT.getTypeID()) { + Node interestingItemsRootNode = resultsChilds.findChild(typeName); Children interestingItemsRootChildren = interestingItemsRootNode.getChildren(); try { String setName = null; @@ -916,7 +917,7 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat if (extractedChilds == null) { return; } - treeNode = extractedChilds.findChild(type.getLabel()); + treeNode = extractedChilds.findChild(typeName); } if (treeNode == null) { From 6886d36ac432443073f5b285e8fed0bf26357d61 Mon Sep 17 00:00:00 2001 From: Oliver Spohngellert Date: Thu, 14 Jan 2016 13:42:47 -0500 Subject: [PATCH 2/2] Added ingest module test for fixed DirectoryTreeTopComponent.viewArtifact --- .../UserArtifacts/UserArtifactIngestModule.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Core/src/org/sleuthkit/autopsy/modules/UserArtifacts/UserArtifactIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/UserArtifacts/UserArtifactIngestModule.java index eed8dff66e..b0ee6eb54b 100755 --- a/Core/src/org/sleuthkit/autopsy/modules/UserArtifacts/UserArtifactIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/UserArtifacts/UserArtifactIngestModule.java @@ -7,11 +7,16 @@ package org.sleuthkit.autopsy.modules.UserArtifacts; import com.sun.media.jfxmedia.logging.Logger; import java.util.List; +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.casemodule.services.FileManager; import org.sleuthkit.autopsy.ingest.DataSourceIngestModule; import org.sleuthkit.autopsy.ingest.DataSourceIngestModuleProgress; import org.sleuthkit.autopsy.ingest.IngestJobContext; +import org.sleuthkit.autopsy.ingest.IngestMessage; +import org.sleuthkit.autopsy.ingest.IngestServices; +import org.sleuthkit.autopsy.modules.hashdatabase.HashDbIngestModule; +import org.sleuthkit.autopsy.modules.hashdatabase.HashLookupModuleFactory; import org.sleuthkit.datamodel.AbstractFile; import org.sleuthkit.datamodel.BlackboardArtifact; import org.sleuthkit.datamodel.BlackboardAttribute; @@ -55,6 +60,12 @@ public class UserArtifactIngestModule implements DataSourceIngestModule { art2.addAttribute(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_MIN_COUNT, UserArtifactIngestModuleFactory.getModuleName(), 4)); progressBar.progress(1); + IngestServices.getInstance().postMessage(IngestMessage.createDataMessage( + "name", + UserArtifactIngestModuleFactory.getModuleName(), + "Test Results", + "Test", + art1)); return ProcessResult.OK; } catch (TskCoreException ex) { return ProcessResult.ERROR;