mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-15 09:17:42 +00:00
Auto-fill create personas dialog for messages and call logs
This commit is contained in:
parent
1b00de0afe
commit
f75a5ee96a
@ -61,6 +61,7 @@ DefaultArtifactContentViewer.attrsTableHeader.type=Type
|
|||||||
DefaultArtifactContentViewer.attrsTableHeader.value=Value
|
DefaultArtifactContentViewer.attrsTableHeader.value=Value
|
||||||
DefaultArtifactContentViewer.copyMenuItem.text=Copy
|
DefaultArtifactContentViewer.copyMenuItem.text=Copy
|
||||||
DefaultArtifactContentViewer.selectAllMenuItem.text=Select All
|
DefaultArtifactContentViewer.selectAllMenuItem.text=Select All
|
||||||
|
MessageAccountPanel.account.justification=Account found in Message artifact
|
||||||
MessageAccountPanel_button_create_label=Create
|
MessageAccountPanel_button_create_label=Create
|
||||||
MessageAccountPanel_button_view_label=View
|
MessageAccountPanel_button_view_label=View
|
||||||
MessageAccountPanel_contact_label=Contact:
|
MessageAccountPanel_contact_label=Contact:
|
||||||
@ -85,5 +86,6 @@ MessageArtifactViewer.subjectLabel.text=Subject:
|
|||||||
MessageArtifactViewer.attachmentsPanel.TabConstraints.tabTitle=Attachments
|
MessageArtifactViewer.attachmentsPanel.TabConstraints.tabTitle=Attachments
|
||||||
MessageArtifactViewer.ccText.text=cc list goes here
|
MessageArtifactViewer.ccText.text=cc list goes here
|
||||||
MessageArtifactViewer.textbodyScrollPane.TabConstraints.tabTitle=Text
|
MessageArtifactViewer.textbodyScrollPane.TabConstraints.tabTitle=Text
|
||||||
|
PersonaAccountFetcher.account.justification=Account found in Call Log artifact
|
||||||
# {0} - Persona count
|
# {0} - Persona count
|
||||||
PersonaDisplayTask_persona_count_suffix=(1 of {0})
|
PersonaDisplayTask_persona_count_suffix=(1 of {0})
|
||||||
|
@ -36,8 +36,11 @@ import javax.swing.JPanel;
|
|||||||
import javax.swing.LayoutStyle.ComponentPlacement;
|
import javax.swing.LayoutStyle.ComponentPlacement;
|
||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
import javax.swing.SwingWorker;
|
import javax.swing.SwingWorker;
|
||||||
|
import org.openide.util.NbBundle;
|
||||||
import org.openide.util.NbBundle.Messages;
|
import org.openide.util.NbBundle.Messages;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
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.CentralRepository;
|
||||||
import org.sleuthkit.autopsy.centralrepository.datamodel.Persona;
|
import org.sleuthkit.autopsy.centralrepository.datamodel.Persona;
|
||||||
import org.sleuthkit.autopsy.centralrepository.datamodel.PersonaAccount;
|
import org.sleuthkit.autopsy.centralrepository.datamodel.PersonaAccount;
|
||||||
@ -51,6 +54,7 @@ import org.sleuthkit.datamodel.Account;
|
|||||||
import org.sleuthkit.datamodel.BlackboardArtifact;
|
import org.sleuthkit.datamodel.BlackboardArtifact;
|
||||||
import org.sleuthkit.datamodel.BlackboardAttribute;
|
import org.sleuthkit.datamodel.BlackboardAttribute;
|
||||||
import org.sleuthkit.datamodel.CommunicationsManager;
|
import org.sleuthkit.datamodel.CommunicationsManager;
|
||||||
|
import org.sleuthkit.datamodel.InvalidAccountIDException;
|
||||||
import org.sleuthkit.datamodel.TskCoreException;
|
import org.sleuthkit.datamodel.TskCoreException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -450,6 +454,9 @@ final class MessageAccountPanel extends JPanel {
|
|||||||
this.accountContainer = accountContainer;
|
this.accountContainer = accountContainer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NbBundle.Messages({
|
||||||
|
"MessageAccountPanel.account.justification=Account found in Message artifact"
|
||||||
|
})
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
Persona persona = accountContainer.getPersona();
|
Persona persona = accountContainer.getPersona();
|
||||||
@ -464,8 +471,28 @@ final class MessageAccountPanel extends JPanel {
|
|||||||
// Pre populate the persona name and accounts if we have them.
|
// Pre populate the persona name and accounts if we have them.
|
||||||
PersonaDetailsPanel personaPanel = createPersonaDialog.getDetailsPanel();
|
PersonaDetailsPanel personaPanel = createPersonaDialog.getDetailsPanel();
|
||||||
|
|
||||||
|
// Set a default name
|
||||||
personaPanel.setPersonaName(accountContainer.getAccount().getTypeSpecificID());
|
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
|
// display the dialog now
|
||||||
createPersonaDialog.display();
|
createPersonaDialog.display();
|
||||||
} else {
|
} else {
|
||||||
|
@ -30,17 +30,23 @@ import java.util.concurrent.ExecutionException;
|
|||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import javax.swing.JButton;
|
import javax.swing.JButton;
|
||||||
import javax.swing.SwingWorker;
|
import javax.swing.SwingWorker;
|
||||||
|
import org.openide.util.NbBundle;
|
||||||
import org.openide.util.NbBundle.Messages;
|
import org.openide.util.NbBundle.Messages;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
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.Persona;
|
||||||
import org.sleuthkit.autopsy.centralrepository.datamodel.PersonaAccount;
|
import org.sleuthkit.autopsy.centralrepository.datamodel.PersonaAccount;
|
||||||
import org.sleuthkit.autopsy.centralrepository.persona.PersonaDetailsDialog;
|
import org.sleuthkit.autopsy.centralrepository.persona.PersonaDetailsDialog;
|
||||||
import org.sleuthkit.autopsy.centralrepository.persona.PersonaDetailsDialogCallback;
|
import org.sleuthkit.autopsy.centralrepository.persona.PersonaDetailsDialogCallback;
|
||||||
import org.sleuthkit.autopsy.centralrepository.persona.PersonaDetailsMode;
|
import org.sleuthkit.autopsy.centralrepository.persona.PersonaDetailsMode;
|
||||||
|
import org.sleuthkit.autopsy.centralrepository.persona.PersonaDetailsPanel;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.datamodel.Account;
|
import org.sleuthkit.datamodel.Account;
|
||||||
import org.sleuthkit.datamodel.BlackboardArtifact;
|
import org.sleuthkit.datamodel.BlackboardArtifact;
|
||||||
import org.sleuthkit.datamodel.CommunicationsManager;
|
import org.sleuthkit.datamodel.CommunicationsManager;
|
||||||
|
import org.sleuthkit.datamodel.InvalidAccountIDException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SwingWorker for fetching and updating Persona controls.
|
* SwingWorker for fetching and updating Persona controls.
|
||||||
@ -173,11 +179,43 @@ class PersonaAccountFetcher extends SwingWorker<Map<String, Collection<Persona>>
|
|||||||
this.personaSearcherData = personaSearcherData;
|
this.personaSearcherData = personaSearcherData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NbBundle.Messages({
|
||||||
|
"PersonaAccountFetcher.account.justification=Account found in Call Log artifact"
|
||||||
|
})
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
// Launch the Persona Create dialog
|
// 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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user