Merge pull request #4955 from APriestman/5253_callLogs

5253 Put call logs under a call log node instead of unthreaded
This commit is contained in:
Richard Cordovano 2019-06-26 16:53:31 -04:00 committed by GitHub
commit 71cf19cccb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 68 additions and 11 deletions

View File

@ -27,6 +27,7 @@ MessageViewer_columnHeader_To=To
MessageViewer_no_messages=<No messages found for selected account> MessageViewer_no_messages=<No messages found for selected account>
MessageViewer_tabTitle=Messages MessageViewer_tabTitle=Messages
MessageViewer_viewMessage_all=All MessageViewer_viewMessage_all=All
MessageViewer_viewMessage_calllogs=Call Logs
MessageViewer_viewMessage_selected=Selected MessageViewer_viewMessage_selected=Selected
MessageViewer_viewMessage_unthreaded=Unthreaded MessageViewer_viewMessage_unthreaded=Unthreaded
SummaryViewer.countsPanel.border.title=Counts SummaryViewer.countsPanel.border.title=Counts

View File

@ -48,6 +48,7 @@ import org.sleuthkit.autopsy.datamodel.BlackboardArtifactNode;
class MessageNode extends BlackboardArtifactNode { class MessageNode extends BlackboardArtifactNode {
public static final String UNTHREADED_ID = "<UNTHREADED>"; public static final String UNTHREADED_ID = "<UNTHREADED>";
public static final String CALL_LOG_ID = "<CALLLOG>";
private static final Logger logger = Logger.getLogger(MessageNode.class.getName()); private static final Logger logger = Logger.getLogger(MessageNode.class.getName());
@ -87,9 +88,14 @@ class MessageNode extends BlackboardArtifactNode {
sheetSet.put(new NodeProperty<>("Type", Bundle.MessageNode_Node_Property_Type(), "", getDisplayName())); //NON-NLS sheetSet.put(new NodeProperty<>("Type", Bundle.MessageNode_Node_Property_Type(), "", getDisplayName())); //NON-NLS
sheetSet.put(new NodeProperty<>("ThreadID", "ThreadID","",threadID == null ? UNTHREADED_ID : threadID)); //NON-NLS
final BlackboardArtifact artifact = getArtifact(); final BlackboardArtifact artifact = getArtifact();
if (artifact.getArtifactTypeID() == BlackboardArtifact.ARTIFACT_TYPE.TSK_CALLLOG.getTypeID()) {
sheetSet.put(new NodeProperty<>("ThreadID", "ThreadID","",CALL_LOG_ID)); //NON-NLS
} else {
sheetSet.put(new NodeProperty<>("ThreadID", "ThreadID","",threadID == null ? UNTHREADED_ID : threadID)); //NON-NLS
}
BlackboardArtifact.ARTIFACT_TYPE fromID = BlackboardArtifact.ARTIFACT_TYPE.fromID(artifact.getArtifactTypeID()); BlackboardArtifact.ARTIFACT_TYPE fromID = BlackboardArtifact.ARTIFACT_TYPE.fromID(artifact.getArtifactTypeID());
if (null != fromID) { if (null != fromID) {

View File

@ -82,7 +82,8 @@ public class MessageViewer extends JPanel implements RelationshipsViewer {
"MessageViewer_no_messages=<No messages found for selected account>", "MessageViewer_no_messages=<No messages found for selected account>",
"MessageViewer_viewMessage_all=All", "MessageViewer_viewMessage_all=All",
"MessageViewer_viewMessage_selected=Selected", "MessageViewer_viewMessage_selected=Selected",
"MessageViewer_viewMessage_unthreaded=Unthreaded",}) "MessageViewer_viewMessage_unthreaded=Unthreaded",
"MessageViewer_viewMessage_calllogs=Call Logs"})
/** /**
* Creates new form MessageViewer * Creates new form MessageViewer
@ -228,7 +229,11 @@ public class MessageViewer extends JPanel implements RelationshipsViewer {
if (!subject.isEmpty()) { if (!subject.isEmpty()) {
threadNameLabel.setText(subject); threadNameLabel.setText(subject);
} else { } else {
threadNameLabel.setText(Bundle.MessageViewer_viewMessage_unthreaded()); if (threadIDList.contains(MessageNode.CALL_LOG_ID)) {
threadNameLabel.setText(Bundle.MessageViewer_viewMessage_calllogs());
} else {
threadNameLabel.setText(Bundle.MessageViewer_viewMessage_unthreaded());
}
} }
showMessagesPane(); showMessagesPane();

View File

@ -98,10 +98,16 @@ public class MessagesChildNodeFactory extends ChildFactory<BlackboardArtifact>{
continue; continue;
} }
// We want all artifacts that do not have "threadIDs" to appear as one thread in the UI // We want email and message artifacts that do not have "threadIDs" to appear as one thread in the UI
// To achive this assign any artifact that does not have a threadID // To achive this assign any artifact that does not have a threadID
// the "UNTHREADED_ID" // the "UNTHREADED_ID"
String artifactThreadID = MessageNode.UNTHREADED_ID; // All call logs will default to a single call logs thread
String artifactThreadID;
if (fromID == BlackboardArtifact.ARTIFACT_TYPE.TSK_CALLLOG) {
artifactThreadID = MessageNode.CALL_LOG_ID;
} else {
artifactThreadID = MessageNode.UNTHREADED_ID;
}
BlackboardAttribute attribute = bba.getAttribute(new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_THREAD_ID)); BlackboardAttribute attribute = bba.getAttribute(new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_THREAD_ID));
if(attribute != null) { if(attribute != null) {

View File

@ -123,10 +123,16 @@ final class ThreadChildNodeFactory extends ChildFactory<BlackboardArtifact> {
|| fromID == BlackboardArtifact.ARTIFACT_TYPE.TSK_CALLLOG || fromID == BlackboardArtifact.ARTIFACT_TYPE.TSK_CALLLOG
|| fromID == BlackboardArtifact.ARTIFACT_TYPE.TSK_MESSAGE) { || fromID == BlackboardArtifact.ARTIFACT_TYPE.TSK_MESSAGE) {
// We want all artifacts that do not have "threadIDs" to appear as one thread in the UI // We want email and message artifacts that do not have "threadIDs" to appear as one thread in the UI
// To achive this assign any artifact that does not have a threadID // To achive this assign any artifact that does not have a threadID
// the "UNTHREADED_ID" // the "UNTHREADED_ID"
String threadID = MessageNode.UNTHREADED_ID; // All call logs will default to a single call logs thread
String threadID;
if (fromID == BlackboardArtifact.ARTIFACT_TYPE.TSK_CALLLOG) {
threadID = MessageNode.CALL_LOG_ID;
} else {
threadID = MessageNode.UNTHREADED_ID;
}
BlackboardAttribute attribute = bba.getAttribute(new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_THREAD_ID)); BlackboardAttribute attribute = bba.getAttribute(new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_THREAD_ID));
if(attribute != null) { if(attribute != null) {
@ -170,13 +176,46 @@ final class ThreadChildNodeFactory extends ChildFactory<BlackboardArtifact> {
if (attribute != null) { if (attribute != null) {
return new ThreadNode(bba, attribute.getValueString(), preferredAction); return new ThreadNode(bba, attribute.getValueString(), preferredAction);
} else { } else {
// Only one of these should occur. if (bba.getArtifactTypeID() == BlackboardArtifact.ARTIFACT_TYPE.TSK_CALLLOG.getTypeID()) {
return new UnthreadedNode(); return new CallLogNode();
} else {
// Only one of these should occur.
return new UnthreadedNode();
}
} }
} }
/** /**
* An this node represents the "unthreaded" thread. * This node represents the "call log" thread.
*/
final class CallLogNode extends AbstractNode {
/**
* Construct an instance of a CallLogNode.
*/
CallLogNode() {
super(Children.LEAF);
setDisplayName("Call Logs");
this.setIconBaseWithExtension("org/sleuthkit/autopsy/communications/images/unthreaded.png" );
}
@Override
protected Sheet createSheet() {
Sheet sheet = super.createSheet();
Sheet.Set sheetSet = sheet.get(Sheet.PROPERTIES);
if (sheetSet == null) {
sheetSet = Sheet.createPropertiesSet();
sheet.put(sheetSet);
}
// Give this node a threadID of "CALL_LOG_ID"
sheetSet.put(new NodeProperty<>("ThreadID", "ThreadID","",MessageNode.CALL_LOG_ID));
return sheet;
}
}
/**
* This node represents the "unthreaded" thread.
*/ */
final class UnthreadedNode extends AbstractNode { final class UnthreadedNode extends AbstractNode {
/** /**

View File

@ -25,7 +25,7 @@ import org.openide.nodes.Sheet;
import org.sleuthkit.datamodel.BlackboardArtifact; import org.sleuthkit.datamodel.BlackboardArtifact;
/** /**
* An AbstractNode subclass which wraps a MessagNode object. Doing this allows * An AbstractNode subclass which wraps a MessageNode object. Doing this allows
* for the reuse of the createSheet and other function from MessageNode, but * for the reuse of the createSheet and other function from MessageNode, but
* also some customizing of how a ThreadNode is shown. * also some customizing of how a ThreadNode is shown.
*/ */