diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/artifactviewers/Bundle.properties-MERGED b/Core/src/org/sleuthkit/autopsy/contentviewers/artifactviewers/Bundle.properties-MERGED index 77bea497af6bbaf1bf98c4c04c72eff48f9f7d26..24083965fbd2f744009cf799f1570a82799db516 100644 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/artifactviewers/Bundle.properties-MERGED +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/artifactviewers/Bundle.properties-MERGED @@ -61,6 +61,7 @@ DefaultArtifactContentViewer.attrsTableHeader.type=Type DefaultArtifactContentViewer.attrsTableHeader.value=Value DefaultArtifactContentViewer.copyMenuItem.text=Copy DefaultArtifactContentViewer.selectAllMenuItem.text=Select All +MessageAccountPanel.account.justification=Account found in Message artifact MessageAccountPanel_button_create_label=Create MessageAccountPanel_button_view_label=View MessageAccountPanel_contact_label=Contact: @@ -85,5 +86,6 @@ MessageArtifactViewer.subjectLabel.text=Subject: MessageArtifactViewer.attachmentsPanel.TabConstraints.tabTitle=Attachments MessageArtifactViewer.ccText.text=cc list goes here MessageArtifactViewer.textbodyScrollPane.TabConstraints.tabTitle=Text +PersonaAccountFetcher.account.justification=Account found in Call Log artifact # {0} - Persona count PersonaDisplayTask_persona_count_suffix=(1 of {0}) diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/artifactviewers/MessageAccountPanel.java b/Core/src/org/sleuthkit/autopsy/contentviewers/artifactviewers/MessageAccountPanel.java index a63d2238a5e611021adff6f174ccb2ad234a57ab..1e63876cfd2bfa12ad1fe12a73891c20311ce49e 100755 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/artifactviewers/MessageAccountPanel.java +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/artifactviewers/MessageAccountPanel.java @@ -36,8 +36,11 @@ import javax.swing.LayoutStyle.ComponentPlacement; import javax.swing.SwingUtilities; import javax.swing.SwingWorker; +import org.openide.util.NbBundle; import org.openide.util.NbBundle.Messages; import org.sleuthkit.autopsy.casemodule.Case; +import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepoAccount; +import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepoException; import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepository; import org.sleuthkit.autopsy.centralrepository.datamodel.Persona; import org.sleuthkit.autopsy.centralrepository.datamodel.PersonaAccount; @@ -51,6 +54,7 @@ import org.sleuthkit.datamodel.BlackboardArtifact; import org.sleuthkit.datamodel.BlackboardAttribute; import org.sleuthkit.datamodel.CommunicationsManager; +import org.sleuthkit.datamodel.InvalidAccountIDException; import org.sleuthkit.datamodel.DataSource; import org.sleuthkit.datamodel.TskCoreException; @@ -453,6 +457,9 @@ private class PersonaButtonListener implements ActionListener { this.accountContainer = accountContainer; } + @NbBundle.Messages({ + "MessageAccountPanel.account.justification=Account found in Message artifact" + }) @Override public void actionPerformed(ActionEvent e) { Persona persona = accountContainer.getPersona(); @@ -467,8 +474,28 @@ public void actionPerformed(ActionEvent e) { // Pre populate the persona name and accounts if we have them. PersonaDetailsPanel personaPanel = createPersonaDialog.getDetailsPanel(); + // Set a default name personaPanel.setPersonaName(accountContainer.getAccount().getTypeSpecificID()); + // Set up each matching account. We don't know what type of account we have, so check all the types to + // find any matches. + try { + for (CentralRepoAccount.CentralRepoAccountType type : CentralRepository.getInstance().getAllAccountTypes()) { + try { + // Try to load any matching accounts of this type. Throws an InvalidAccountIDException if the account is the + // wrong format (i.e., when we try to load email accounts for a phone number-type string). + CentralRepoAccount account = CentralRepository.getInstance().getAccount(type, accountContainer.getAccount().getTypeSpecificID()); + if (account != null) { + personaPanel.addAccount(account, Bundle.MessageAccountPanel_account_justification(), Persona.Confidence.HIGH); + } + } catch (InvalidAccountIDException ex2) { + // These are expected when the account identifier doesn't match the format of the account type. + } + } + } catch (CentralRepoException ex) { + logger.log(Level.SEVERE, "Error looking up account types in the central repository", ex); + } + // display the dialog now createPersonaDialog.display(); } else { diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/artifactviewers/PersonaAccountFetcher.java b/Core/src/org/sleuthkit/autopsy/contentviewers/artifactviewers/PersonaAccountFetcher.java index 2ffef0ce3e8ec5085270b79074c67804eea01066..834785801d9b7c8b2e9fe5a9de19d7c223918b9c 100755 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/artifactviewers/PersonaAccountFetcher.java +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/artifactviewers/PersonaAccountFetcher.java @@ -30,17 +30,23 @@ import java.util.logging.Level; import javax.swing.JButton; import javax.swing.SwingWorker; +import org.openide.util.NbBundle; import org.openide.util.NbBundle.Messages; import org.sleuthkit.autopsy.casemodule.Case; +import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepoAccount; +import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepoException; +import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepository; import org.sleuthkit.autopsy.centralrepository.datamodel.Persona; import org.sleuthkit.autopsy.centralrepository.datamodel.PersonaAccount; import org.sleuthkit.autopsy.centralrepository.persona.PersonaDetailsDialog; import org.sleuthkit.autopsy.centralrepository.persona.PersonaDetailsDialogCallback; import org.sleuthkit.autopsy.centralrepository.persona.PersonaDetailsMode; +import org.sleuthkit.autopsy.centralrepository.persona.PersonaDetailsPanel; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.datamodel.Account; import org.sleuthkit.datamodel.BlackboardArtifact; import org.sleuthkit.datamodel.CommunicationsManager; +import org.sleuthkit.datamodel.InvalidAccountIDException; /** * SwingWorker for fetching and updating Persona controls. @@ -173,11 +179,43 @@ private class CreatePersonaButtonListener implements ActionListener { this.personaSearcherData = personaSearcherData; } + @NbBundle.Messages({ + "PersonaAccountFetcher.account.justification=Account found in Call Log artifact" + }) @Override public void actionPerformed(java.awt.event.ActionEvent evt) { // Launch the Persona Create dialog - new PersonaDetailsDialog(parentComponent, - PersonaDetailsMode.CREATE, null, new PersonaCreateCallbackImpl(parentComponent, personaSearcherData)); + + PersonaDetailsDialog dialog = new PersonaDetailsDialog(parentComponent, + PersonaDetailsMode.CREATE, null, new PersonaCreateCallbackImpl(parentComponent, personaSearcherData), false); + + // Pre populate the persona name and accounts if we have them. + PersonaDetailsPanel personaPanel = dialog.getDetailsPanel(); + + // Set a default name + personaPanel.setPersonaName(personaSearcherData.getAccountIdentifer()); + + // Set up each matching account. We don't know what type of account we have, so check all the types to + // find any matches. + try { + for (CentralRepoAccount.CentralRepoAccountType type : CentralRepository.getInstance().getAllAccountTypes()) { + try { + // Try to load any matching accounts of this type. Throws an InvalidAccountIDException if the account is the + // wrong format (i.e., when we try to load email accounts for a phone number-type string). + CentralRepoAccount account = CentralRepository.getInstance().getAccount(type, personaSearcherData.getAccountIdentifer()); + if (account != null) { + personaPanel.addAccount(account, Bundle.PersonaAccountFetcher_account_justification(), Persona.Confidence.HIGH); + } + } catch (InvalidAccountIDException ex2) { + // These are expected when the account identifier doesn't match the format of the account type. + } + } + } catch (CentralRepoException ex) { + logger.log(Level.SEVERE, "Error looking up account types in the central repository", ex); + } + + // display the dialog now + dialog.display(); } }