mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-12 16:06:15 +00:00
Merge branch 'develop' of github.com:sleuthkit/autopsy into 7212-xleappSources
This commit is contained in:
commit
07146d5792
@ -277,17 +277,20 @@ public final class DiscoveryEventUtils {
|
||||
public static final class MiniTimelineResultEvent {
|
||||
|
||||
private final List<MiniTimelineResult> results = new ArrayList<>();
|
||||
private final String domain;
|
||||
|
||||
/**
|
||||
* Construct a new MiniTimelineResultEvent.
|
||||
*
|
||||
* @param results The list of MiniTimelineResults contained in this
|
||||
* event.
|
||||
* @param domain The domain the results are for.
|
||||
*/
|
||||
public MiniTimelineResultEvent(List<MiniTimelineResult> results) {
|
||||
public MiniTimelineResultEvent(List<MiniTimelineResult> results, String domain) {
|
||||
if (results != null) {
|
||||
this.results.addAll(results);
|
||||
}
|
||||
this.domain = domain;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -298,6 +301,15 @@ public final class DiscoveryEventUtils {
|
||||
public List<MiniTimelineResult> getResultList() {
|
||||
return Collections.unmodifiableList(results);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the domain this list of results is for.
|
||||
*
|
||||
* @return The domain the list of results is for.
|
||||
*/
|
||||
public String getDomain() {
|
||||
return domain;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -172,6 +172,7 @@ public final class DiscoveryTopComponent extends TopComponent {
|
||||
DiscoveryEventUtils.getDiscoveryEventBus().unregister(resultsPanel);
|
||||
DiscoveryEventUtils.getDiscoveryEventBus().unregister(detailsPanel);
|
||||
if (detailsPanel instanceof DomainDetailsPanel) {
|
||||
((DomainDetailsPanel) detailsPanel).unregister();
|
||||
selectedDomainTabName = ((DomainDetailsPanel) detailsPanel).getSelectedTabName();
|
||||
}
|
||||
resetBottomComponent();
|
||||
|
@ -2,13 +2,13 @@
|
||||
|
||||
<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
|
||||
<Properties>
|
||||
<Property name="enabled" type="boolean" value="false"/>
|
||||
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[0, 0]"/>
|
||||
</Property>
|
||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[0, 0]"/>
|
||||
</Property>
|
||||
<Property name="enabled" type="boolean" value="false"/>
|
||||
</Properties>
|
||||
<AuxValues>
|
||||
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/>
|
||||
|
@ -39,7 +39,6 @@ final class DomainDetailsPanel extends JPanel {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private ArtifactsWorker singleArtifactDomainWorker;
|
||||
private MiniTimelineWorker miniTimelineWorker;
|
||||
private String domain;
|
||||
private String selectedTabName = null;
|
||||
|
||||
@ -51,7 +50,9 @@ final class DomainDetailsPanel extends JPanel {
|
||||
@ThreadConfined(type = ThreadConfined.ThreadType.AWT)
|
||||
DomainDetailsPanel() {
|
||||
initComponents();
|
||||
jTabbedPane1.add(Bundle.DomainDetailsPanel_miniTimelineTitle_text(), new MiniTimelinePanel());
|
||||
MiniTimelinePanel timelinePanel = new MiniTimelinePanel();
|
||||
DiscoveryEventUtils.getDiscoveryEventBus().register(timelinePanel);
|
||||
jTabbedPane1.add(Bundle.DomainDetailsPanel_miniTimelineTitle_text(), timelinePanel);
|
||||
for (BlackboardArtifact.ARTIFACT_TYPE type : SearchData.Type.DOMAIN.getArtifactTypes()) {
|
||||
jTabbedPane1.add(type.getDisplayName(), new DomainArtifactsTabPanel(type));
|
||||
}
|
||||
@ -141,14 +142,9 @@ final class DomainDetailsPanel extends JPanel {
|
||||
* mini timeline view to populate.
|
||||
*/
|
||||
private void runMiniTimelineWorker(MiniTimelinePanel miniTimelinePanel) {
|
||||
if (miniTimelineWorker != null && !miniTimelineWorker.isDone()) {
|
||||
miniTimelineWorker.cancel(true);
|
||||
}
|
||||
if (miniTimelinePanel.getStatus() == DomainArtifactsTabPanel.ArtifactRetrievalStatus.UNPOPULATED) {
|
||||
DiscoveryEventUtils.getDiscoveryEventBus().register(miniTimelinePanel);
|
||||
miniTimelinePanel.setStatus(DomainArtifactsTabPanel.ArtifactRetrievalStatus.POPULATING);
|
||||
miniTimelineWorker = new MiniTimelineWorker(domain);
|
||||
miniTimelineWorker.execute();
|
||||
miniTimelinePanel.setStatus(DomainArtifactsTabPanel.ArtifactRetrievalStatus.POPULATING, domain);
|
||||
new MiniTimelineWorker(domain).execute();
|
||||
}
|
||||
}
|
||||
|
||||
@ -189,7 +185,7 @@ final class DomainDetailsPanel extends JPanel {
|
||||
if (comp instanceof DomainArtifactsTabPanel) {
|
||||
((DomainArtifactsTabPanel) comp).setStatus(DomainArtifactsTabPanel.ArtifactRetrievalStatus.UNPOPULATED);
|
||||
} else if (comp instanceof MiniTimelinePanel) {
|
||||
((MiniTimelinePanel) comp).setStatus(DomainArtifactsTabPanel.ArtifactRetrievalStatus.UNPOPULATED);
|
||||
((MiniTimelinePanel) comp).setStatus(DomainArtifactsTabPanel.ArtifactRetrievalStatus.UNPOPULATED, domain);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -228,4 +224,15 @@ final class DomainDetailsPanel extends JPanel {
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JTabbedPane jTabbedPane1;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
|
||||
/*
|
||||
* Unregister the MiniTimelinePanel from the event bus.
|
||||
*/
|
||||
void unregister() {
|
||||
for (Component comp : jTabbedPane1.getComponents()) {
|
||||
if (comp instanceof MiniTimelinePanel) {
|
||||
DiscoveryEventUtils.getDiscoveryEventBus().unregister(comp);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -19,13 +19,11 @@
|
||||
package org.sleuthkit.autopsy.discovery.ui;
|
||||
|
||||
import com.google.common.eventbus.Subscribe;
|
||||
import java.util.logging.Level;
|
||||
import javax.swing.SwingUtilities;
|
||||
import javax.swing.event.ListSelectionEvent;
|
||||
import javax.swing.event.ListSelectionListener;
|
||||
import org.openide.util.NbBundle;
|
||||
import org.sleuthkit.autopsy.contentviewers.artifactviewers.GeneralPurposeArtifactViewer;
|
||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||
import org.sleuthkit.autopsy.coreutils.ThreadConfined;
|
||||
import org.sleuthkit.autopsy.discovery.search.DiscoveryEventUtils;
|
||||
import org.sleuthkit.datamodel.BlackboardArtifact;
|
||||
@ -41,7 +39,7 @@ final class MiniTimelinePanel extends javax.swing.JPanel {
|
||||
private final MiniTimelineArtifactListPanel artifactListPanel = new MiniTimelineArtifactListPanel();
|
||||
private DomainArtifactsTabPanel.ArtifactRetrievalStatus status = DomainArtifactsTabPanel.ArtifactRetrievalStatus.UNPOPULATED;
|
||||
private AbstractArtifactDetailsPanel rightPanel = new GeneralPurposeArtifactViewer();
|
||||
private static final Logger logger = Logger.getLogger(MiniTimelinePanel.class.getName());
|
||||
private String selectedDomain = null;
|
||||
private final ListSelectionListener artifactListener;
|
||||
private final ListSelectionListener dateListener;
|
||||
|
||||
@ -106,11 +104,13 @@ final class MiniTimelinePanel extends javax.swing.JPanel {
|
||||
/**
|
||||
* Manually set the status of the panel.
|
||||
*
|
||||
* @param status The ArtifactRetrievalStatus of the panel.
|
||||
* @param status The ArtifactRetrievalStatus of the panel
|
||||
* @param domain The domain the panel is currently reflecting.
|
||||
*/
|
||||
@ThreadConfined(type = ThreadConfined.ThreadType.AWT)
|
||||
void setStatus(DomainArtifactsTabPanel.ArtifactRetrievalStatus status) {
|
||||
void setStatus(DomainArtifactsTabPanel.ArtifactRetrievalStatus status, String domain) {
|
||||
this.status = status;
|
||||
this.selectedDomain = domain;
|
||||
if (status == DomainArtifactsTabPanel.ArtifactRetrievalStatus.UNPOPULATED) {
|
||||
artifactListPanel.clearList();
|
||||
dateListPanel.clearList();
|
||||
@ -123,7 +123,6 @@ final class MiniTimelinePanel extends javax.swing.JPanel {
|
||||
removeAll();
|
||||
add(new LoadingPanel(Bundle.MiniTimelinePanel_loadingPanel_details()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -135,23 +134,19 @@ final class MiniTimelinePanel extends javax.swing.JPanel {
|
||||
@Subscribe
|
||||
void handleMiniTimelineResultEvent(DiscoveryEventUtils.MiniTimelineResultEvent miniTimelineResultEvent) {
|
||||
SwingUtilities.invokeLater(() -> {
|
||||
dateListPanel.removeListSelectionListener(dateListener);
|
||||
artifactListPanel.removeSelectionListener(artifactListener);
|
||||
dateListPanel.addArtifacts(miniTimelineResultEvent.getResultList());
|
||||
status = DomainArtifactsTabPanel.ArtifactRetrievalStatus.POPULATED;
|
||||
setEnabled(!dateListPanel.isEmpty());
|
||||
dateListPanel.addSelectionListener(dateListener);
|
||||
artifactListPanel.addSelectionListener(artifactListener);
|
||||
dateListPanel.selectFirst();
|
||||
removeAll();
|
||||
add(mainSplitPane);
|
||||
revalidate();
|
||||
repaint();
|
||||
try {
|
||||
DiscoveryEventUtils.getDiscoveryEventBus().unregister(this);
|
||||
} catch (IllegalArgumentException notRegistered) {
|
||||
logger.log(Level.INFO, "Attempting to unregister mini timeline view which was not registered");
|
||||
// attempting to remove a tab that was never registered
|
||||
if (miniTimelineResultEvent.getDomain().equals(selectedDomain)) {
|
||||
dateListPanel.removeListSelectionListener(dateListener);
|
||||
artifactListPanel.removeSelectionListener(artifactListener);
|
||||
dateListPanel.addArtifacts(miniTimelineResultEvent.getResultList());
|
||||
status = DomainArtifactsTabPanel.ArtifactRetrievalStatus.POPULATED;
|
||||
setEnabled(!dateListPanel.isEmpty());
|
||||
dateListPanel.addSelectionListener(dateListener);
|
||||
artifactListPanel.addSelectionListener(artifactListener);
|
||||
dateListPanel.selectFirst();
|
||||
removeAll();
|
||||
add(mainSplitPane);
|
||||
revalidate();
|
||||
repaint();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ import org.sleuthkit.autopsy.discovery.search.DomainSearch;
|
||||
/**
|
||||
* SwingWorker to retrieve a list of artifacts for a specified type and domain.
|
||||
*/
|
||||
class MiniTimelineWorker extends SwingWorker<List<MiniTimelineResult>, Void> {
|
||||
class MiniTimelineWorker extends SwingWorker<Void, Void> {
|
||||
|
||||
private final static Logger logger = Logger.getLogger(MiniTimelineWorker.class.getName());
|
||||
private final String domain;
|
||||
@ -51,12 +51,13 @@ class MiniTimelineWorker extends SwingWorker<List<MiniTimelineResult>, Void> {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<MiniTimelineResult> doInBackground() throws Exception {
|
||||
protected Void doInBackground() throws Exception {
|
||||
List<MiniTimelineResult> results = new ArrayList<>();
|
||||
if (!StringUtils.isBlank(domain)) {
|
||||
DomainSearch domainSearch = new DomainSearch();
|
||||
try {
|
||||
results.addAll(domainSearch.getAllArtifactsForDomain(Case.getCurrentCase().getSleuthkitCase(), domain));
|
||||
DiscoveryEventUtils.getDiscoveryEventBus().post(new DiscoveryEventUtils.MiniTimelineResultEvent(results, domain));
|
||||
} catch (DiscoveryException ex) {
|
||||
if (ex.getCause() instanceof InterruptedException) {
|
||||
this.cancel(true);
|
||||
@ -66,22 +67,19 @@ class MiniTimelineWorker extends SwingWorker<List<MiniTimelineResult>, Void> {
|
||||
}
|
||||
}
|
||||
}
|
||||
return results;
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void done() {
|
||||
List<MiniTimelineResult> results = new ArrayList<>();
|
||||
if (!isCancelled()) {
|
||||
try {
|
||||
results.addAll(get());
|
||||
DiscoveryEventUtils.getDiscoveryEventBus().post(new DiscoveryEventUtils.MiniTimelineResultEvent(results));
|
||||
get();
|
||||
} catch (InterruptedException | ExecutionException ex) {
|
||||
logger.log(Level.SEVERE, "Exception while trying to get list of artifacts for Domain details for mini timeline view for domain: " + domain, ex);
|
||||
} catch (CancellationException ignored) {
|
||||
//Worker was cancelled after previously finishing its background work, exception ignored to cut down on non-helpful logging
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -284,7 +284,11 @@ class Ingester {
|
||||
//Make a SolrInputDocument out of the field map
|
||||
SolrInputDocument updateDoc = new SolrInputDocument();
|
||||
for (String key : fields.keySet()) {
|
||||
updateDoc.addField(key, Chunker.sanitize((String)fields.get(key)).toString());
|
||||
if (fields.get(key).getClass() == String.class) {
|
||||
updateDoc.addField(key, Chunker.sanitize((String)fields.get(key)).toString());
|
||||
} else {
|
||||
updateDoc.addField(key, fields.get(key));
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
|
@ -62,7 +62,11 @@ class LanguageSpecificContentIndexingHelper {
|
||||
//Make a SolrInputDocument out of the field map
|
||||
SolrInputDocument updateDoc = new SolrInputDocument();
|
||||
for (String key : fields.keySet()) {
|
||||
updateDoc.addField(key, Chunker.sanitize((String)fields.get(key)).toString());
|
||||
if (fields.get(key).getClass() == String.class) {
|
||||
updateDoc.addField(key, Chunker.sanitize((String)fields.get(key)).toString());
|
||||
} else {
|
||||
updateDoc.addField(key, fields.get(key));
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
|
@ -628,9 +628,11 @@ def normalize_db_entry(line, files_table, vs_parts_table, vs_info_table, fs_info
|
||||
if legacy_artifact_id != 'NULL' and legacy_artifact_id in artifact_table.keys():
|
||||
fields_list[6] = artifact_table[legacy_artifact_id]
|
||||
|
||||
fields_list[1] = cleanupEventDescription(fields_list[1])
|
||||
fields_list[2] = cleanupEventDescription(fields_list[2])
|
||||
fields_list[3] = cleanupEventDescription(fields_list[3])
|
||||
|
||||
if fields_list[1] == fields_list[2] and fields_list[1] == fields_list[3]:
|
||||
fields_list[1] = cleanupEventDescription(fields_list[1])
|
||||
fields_list[2] = cleanupEventDescription(fields_list[2])
|
||||
fields_list[3] = cleanupEventDescription(fields_list[3])
|
||||
|
||||
newLine = ('INSERT INTO "tsk_event_descriptions" VALUES(' + ','.join(fields_list[1:]) + ');') # remove report_id
|
||||
return newLine
|
||||
|
Loading…
x
Reference in New Issue
Block a user