mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-12 16:06:15 +00:00
7918 delete OO viewer code to use caseDB
This commit is contained in:
parent
5fed7dfdfb
commit
9e39dcff3e
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Central Repository
|
* Central Repository
|
||||||
*
|
*
|
||||||
* Copyright 2018-2019 Basis Technology Corp.
|
* Copyright 2018-2021 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -123,16 +123,6 @@ public class NodeData {
|
|||||||
comment = newComment;
|
comment = newComment;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Check if this is a central repo node.
|
|
||||||
*
|
|
||||||
* @return true if this node was created from a central repo instance, false
|
|
||||||
* otherwise
|
|
||||||
*/
|
|
||||||
public boolean isCentralRepoNode() {
|
|
||||||
return (originalCorrelationInstance != null);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the case name
|
* Get the case name
|
||||||
*
|
*
|
||||||
|
@ -263,13 +263,6 @@ public final class OtherOccurrences {
|
|||||||
nodeDataMap.put(uniquePathKey, newNode);
|
nodeDataMap.put(uniquePathKey, newNode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (file != null && corAttr.getCorrelationType().getDisplayName().equals("Files")) {
|
|
||||||
List<AbstractFile> caseDbFiles = getCaseDbMatches(corAttr, openCase, file);
|
|
||||||
|
|
||||||
for (AbstractFile caseDbFile : caseDbFiles) {
|
|
||||||
addOrUpdateNodeData(openCase, nodeDataMap, caseDbFile);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return nodeDataMap;
|
return nodeDataMap;
|
||||||
} catch (CentralRepoException ex) {
|
} catch (CentralRepoException ex) {
|
||||||
logger.log(Level.SEVERE, "Error getting artifact instances from database.", ex); // NON-NLS
|
logger.log(Level.SEVERE, "Error getting artifact instances from database.", ex); // NON-NLS
|
||||||
@ -277,11 +270,7 @@ public final class OtherOccurrences {
|
|||||||
logger.log(Level.INFO, "Error getting artifact instances from database.", ex); // NON-NLS
|
logger.log(Level.INFO, "Error getting artifact instances from database.", ex); // NON-NLS
|
||||||
} catch (NoCurrentCaseException ex) {
|
} catch (NoCurrentCaseException ex) {
|
||||||
logger.log(Level.SEVERE, "Exception while getting open case.", ex); // NON-NLS
|
logger.log(Level.SEVERE, "Exception while getting open case.", ex); // NON-NLS
|
||||||
} catch (TskCoreException ex) {
|
}
|
||||||
// do nothing.
|
|
||||||
// @@@ Review this behavior
|
|
||||||
logger.log(Level.SEVERE, "Exception while querying open case.", ex); // NON-NLS
|
|
||||||
}
|
|
||||||
|
|
||||||
return new HashMap<>(
|
return new HashMap<>(
|
||||||
0);
|
0);
|
||||||
|
@ -22,7 +22,6 @@ import java.util.Objects;
|
|||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.centralrepository.contentviewer.OtherOccurrencesPanel;
|
|
||||||
import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepoException;
|
import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepoException;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
|
|
||||||
|
@ -329,8 +329,8 @@ public final class OtherOccurrencesPanel extends javax.swing.JPanel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
casesTableModel.clearTable();
|
casesTableModel.clearTable();
|
||||||
|
|
||||||
OtherOccurrenceOneTypeWorker.OneTypeData data = get();
|
OtherOccurrenceOneTypeWorker.OneTypeData data = get();
|
||||||
correlationAttributes.addAll(data.getCorrelationAttributesToAdd());
|
correlationAttributes.addAll(data.getCorrelationAttributesToAdd());
|
||||||
for (CorrelationCase corCase : data.getCaseNames().values()) {
|
for (CorrelationCase corCase : data.getCaseNames().values()) {
|
||||||
casesTableModel.addCorrelationCase(new CorrelationCaseWrapper(corCase));
|
casesTableModel.addCorrelationCase(new CorrelationCaseWrapper(corCase));
|
||||||
@ -447,12 +447,8 @@ public final class OtherOccurrencesPanel extends javax.swing.JPanel {
|
|||||||
for (NodeData nodeData : correlatedNodeDataMap.values()) {
|
for (NodeData nodeData : correlatedNodeDataMap.values()) {
|
||||||
for (int selectedRow : selectedCaseIndexes) {
|
for (int selectedRow : selectedCaseIndexes) {
|
||||||
try {
|
try {
|
||||||
if (nodeData.isCentralRepoNode()) {
|
if (casesTableModel.getCorrelationCase(casesTable.convertRowIndexToModel(selectedRow)) != null
|
||||||
if (casesTableModel.getCorrelationCase(casesTable.convertRowIndexToModel(selectedRow)) != null
|
&& casesTableModel.getCorrelationCase(casesTable.convertRowIndexToModel(selectedRow)).getCaseUUID().equals(nodeData.getCorrelationAttributeInstance().getCorrelationCase().getCaseUUID())) {
|
||||||
&& casesTableModel.getCorrelationCase(casesTable.convertRowIndexToModel(selectedRow)).getCaseUUID().equals(nodeData.getCorrelationAttributeInstance().getCorrelationCase().getCaseUUID())) {
|
|
||||||
dataSourcesTableModel.addNodeData(nodeData);
|
|
||||||
}
|
|
||||||
} else if (currentCaseName != null && (casesTableModel.getCorrelationCase(casesTable.convertRowIndexToModel(selectedRow)).getCaseUUID().equals(currentCaseName))) {
|
|
||||||
dataSourcesTableModel.addNodeData(nodeData);
|
dataSourcesTableModel.addNodeData(nodeData);
|
||||||
}
|
}
|
||||||
} catch (CentralRepoException ex) {
|
} catch (CentralRepoException ex) {
|
||||||
@ -505,15 +501,9 @@ public final class OtherOccurrencesPanel extends javax.swing.JPanel {
|
|||||||
for (int selectedDataSourceRow : selectedDataSources) {
|
for (int selectedDataSourceRow : selectedDataSources) {
|
||||||
int rowModelIndex = dataSourcesTable.convertRowIndexToModel(selectedDataSourceRow);
|
int rowModelIndex = dataSourcesTable.convertRowIndexToModel(selectedDataSourceRow);
|
||||||
try {
|
try {
|
||||||
if (nodeData.isCentralRepoNode()) {
|
if (dataSourcesTableModel.getCaseUUIDForRow(rowModelIndex).equals(nodeData.getCorrelationAttributeInstance().getCorrelationCase().getCaseUUID())
|
||||||
if (dataSourcesTableModel.getCaseUUIDForRow(rowModelIndex).equals(nodeData.getCorrelationAttributeInstance().getCorrelationCase().getCaseUUID())
|
&& dataSourcesTableModel.getDeviceIdForRow(rowModelIndex).equals(nodeData.getDeviceID())) {
|
||||||
&& dataSourcesTableModel.getDeviceIdForRow(rowModelIndex).equals(nodeData.getDeviceID())) {
|
filesTableModel.addNodeData(nodeData);
|
||||||
filesTableModel.addNodeData(nodeData);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (dataSourcesTableModel.getDeviceIdForRow(dataSourcesTable.convertRowIndexToModel(selectedDataSourceRow)).equals(nodeData.getDeviceID())) {
|
|
||||||
filesTableModel.addNodeData(nodeData);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} catch (CentralRepoException ex) {
|
} catch (CentralRepoException ex) {
|
||||||
logger.log(Level.WARNING, "Unable to get correlation attribute instance from OtherOccurrenceNodeInstanceData for case " + nodeData.getCaseName(), ex);
|
logger.log(Level.WARNING, "Unable to get correlation attribute instance from OtherOccurrenceNodeInstanceData for case " + nodeData.getCaseName(), ex);
|
||||||
@ -876,8 +866,7 @@ public final class OtherOccurrencesPanel extends javax.swing.JPanel {
|
|||||||
int rowIndex = filesTable.getSelectedRow();
|
int rowIndex = filesTable.getSelectedRow();
|
||||||
List<NodeData> selectedFile = filesTableModel.getListOfNodesForFile(rowIndex);
|
List<NodeData> selectedFile = filesTableModel.getListOfNodesForFile(rowIndex);
|
||||||
if (!selectedFile.isEmpty() && selectedFile.get(0) instanceof NodeData) {
|
if (!selectedFile.isEmpty() && selectedFile.get(0) instanceof NodeData) {
|
||||||
NodeData instanceData = selectedFile.get(0);
|
enableCentralRepoActions = true;
|
||||||
enableCentralRepoActions = instanceData.isCentralRepoNode();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
showCaseDetailsMenuItem.setVisible(enableCentralRepoActions);
|
showCaseDetailsMenuItem.setVisible(enableCentralRepoActions);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user