mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-06 21:00:22 +00:00
4792 fix counts and display of intra case results
This commit is contained in:
parent
2a04c86faa
commit
19797646a0
@ -44,6 +44,8 @@ import org.sleuthkit.autopsy.coreutils.Logger;
|
||||
import javax.swing.JFileChooser;
|
||||
import javax.swing.JMenuItem;
|
||||
import javax.swing.JOptionPane;
|
||||
import javax.swing.RowSorter;
|
||||
import javax.swing.SortOrder;
|
||||
import static javax.swing.JOptionPane.DEFAULT_OPTION;
|
||||
import static javax.swing.JOptionPane.PLAIN_MESSAGE;
|
||||
import static javax.swing.JOptionPane.ERROR_MESSAGE;
|
||||
@ -161,15 +163,8 @@ public class DataContentViewerOtherCases extends JPanel implements DataContentVi
|
||||
updateDataSourceSelection();
|
||||
}
|
||||
});
|
||||
// List<RowSorter.SortKey> sortKeys = new ArrayList<>();
|
||||
|
||||
// int caseNameColumnIndex = DataContentViewerOtherCasesTableModel.TableColumns.CASE_NAME.ordinal();
|
||||
// sortKeys.add(new RowSorter.SortKey(caseNameColumnIndex, SortOrder.ASCENDING));
|
||||
//
|
||||
// int dataSourceColumnIndex = DataContentViewerOtherCasesTableModel.TableColumns.DATA_SOURCE.ordinal();
|
||||
// sortKeys.add(new RowSorter.SortKey(dataSourceColumnIndex, SortOrder.ASCENDING));
|
||||
// sorter.setSortKeys(sortKeys);
|
||||
sorter.sort();
|
||||
caseTable.getRowSorter().toggleSortOrder(0);
|
||||
dataSourceTable.getRowSorter().toggleSortOrder(0);
|
||||
}
|
||||
|
||||
@Messages({"DataContentViewerOtherCases.correlatedArtifacts.isEmpty=There are no files or artifacts to correlate.",
|
||||
@ -403,7 +398,7 @@ public class DataContentViewerOtherCases extends JPanel implements DataContentVi
|
||||
// devices.put(deviceId, caseName);
|
||||
}
|
||||
|
||||
foundInLabel.setText(String.format(Bundle.DataContentViewerOtherCases_foundIn_text(), model.getRowCount(), cases.size(), devices.size()));
|
||||
foundInLabel.setText(String.format(Bundle.DataContentViewerOtherCases_foundIn_text(), model.getRowCount(), casesTableModel.getRowCount(), devices.size()));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -768,6 +763,8 @@ public class DataContentViewerOtherCases extends JPanel implements DataContentVi
|
||||
// get the attributes we can correlate on
|
||||
correlationAttributes.addAll(getCorrelationAttributesFromNode(node));
|
||||
Map<String, CorrelationCase> caseNames = new HashMap<>();
|
||||
int totalCount = 0;
|
||||
Set<String> dataSources = new HashSet<>();
|
||||
for (CorrelationAttributeInstance corAttr : correlationAttributes) {
|
||||
Map<UniquePathKey, OtherOccurrenceNodeInstanceData> correlatedNodeDataMap = new HashMap<>(0);
|
||||
|
||||
@ -776,48 +773,49 @@ public class DataContentViewerOtherCases extends JPanel implements DataContentVi
|
||||
for (OtherOccurrenceNodeInstanceData nodeData : correlatedNodeDataMap.values()) {
|
||||
if (nodeData.isCentralRepoNode()) {
|
||||
try {
|
||||
dataSources.add(makeDataSourceString(nodeData.getCorrelationAttributeInstance().getCorrelationCase().getCaseUUID(), nodeData.getDeviceID(), nodeData.getDataSourceName()));
|
||||
caseNames.put(nodeData.getCorrelationAttributeInstance().getCorrelationCase().getCaseUUID(), nodeData.getCorrelationAttributeInstance().getCorrelationCase());
|
||||
} catch (EamDbException ex) {
|
||||
System.out.println("can't get correlation case");
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
dataSources.add(makeDataSourceString(Case.getCurrentCaseThrows().getName(), nodeData.getDeviceID(), nodeData.getDataSourceName()));
|
||||
caseNames.put(Case.getCurrentCaseThrows().getName(), new CorrelationCase(Case.getCurrentCaseThrows().getName(), Case.getCurrentCaseThrows().getDisplayName()));
|
||||
} catch (NoCurrentCaseException ex){
|
||||
} catch (NoCurrentCaseException ex) {
|
||||
System.out.println("NO cURRENT CASE");
|
||||
}
|
||||
|
||||
}
|
||||
totalCount++;
|
||||
}
|
||||
}
|
||||
// if (caseNames.isEmpty()) {
|
||||
// setColumnWidthToText(0, Bundle.DataContentViewerOtherCases_table_noArtifacts());
|
||||
// } else if (0 == casesTableModel.getRowCount()) {
|
||||
// setColumnWidthToText(0, Bundle.DataContentViewerOtherCases_table_noResultsFound());
|
||||
// } else {
|
||||
for (CorrelationCase corCase : caseNames.values()) {
|
||||
casesTableModel.addNodeData(corCase);
|
||||
}
|
||||
// }
|
||||
|
||||
// if (correlationAttributes.isEmpty()) {
|
||||
// tableModel.addNodeData(new OtherOccurrenceNodeMessageData(Bundle.DataContentViewerOtherCases_table_noArtifacts()));
|
||||
// setColumnWidthToText(0, Bundle.DataContentViewerOtherCases_table_noArtifacts());
|
||||
// } else if (0 == tableModel.getRowCount()) {
|
||||
// tableModel.addNodeData(new OtherOccurrenceNodeMessageData(Bundle.DataContentViewerOtherCases_table_noResultsFound()));
|
||||
// setColumnWidthToText(0, Bundle.DataContentViewerOtherCases_table_noResultsFound());
|
||||
// } else {
|
||||
// setColumnWidths();
|
||||
// }
|
||||
if (correlationAttributes.isEmpty()) {
|
||||
tableModel.addNodeData(new OtherOccurrenceNodeMessageData(Bundle.DataContentViewerOtherCases_table_noArtifacts()));
|
||||
setColumnWidthToText(0, Bundle.DataContentViewerOtherCases_table_noArtifacts());
|
||||
} else if (0 == tableModel.getRowCount()) {
|
||||
tableModel.addNodeData(new OtherOccurrenceNodeMessageData(Bundle.DataContentViewerOtherCases_table_noResultsFound()));
|
||||
setColumnWidthToText(0, Bundle.DataContentViewerOtherCases_table_noResultsFound());
|
||||
} else {
|
||||
setColumnWidths();
|
||||
}
|
||||
setEarliestCaseDate();
|
||||
|
||||
setOccurrenceCounts();
|
||||
foundInLabel.setText(String.format(Bundle.DataContentViewerOtherCases_foundIn_text(), totalCount, casesTableModel.getRowCount(), dataSources.size()));
|
||||
|
||||
if (caseTable.getRowCount() > 0) {
|
||||
caseTable.setRowSelectionInterval(0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
private String makeDataSourceString(String caseUUID, String deviceId, String dataSourceName){
|
||||
return caseUUID + deviceId + dataSourceName;
|
||||
}
|
||||
|
||||
private void updateCaseSelection() {
|
||||
int[] selectedCaseIndexes = caseTable.getSelectedRows();
|
||||
DefaultTableModel dataSourceModel = (DefaultTableModel) dataSourceTable.getModel();
|
||||
@ -831,9 +829,13 @@ public class DataContentViewerOtherCases extends JPanel implements DataContentVi
|
||||
for (OtherOccurrenceNodeInstanceData nodeData : correlatedNodeDataMap.values()) {
|
||||
for (int selectedRow : selectedCaseIndexes) {
|
||||
try {
|
||||
if (nodeData.isCentralRepoNode()) {
|
||||
if (((CorrelationCase) casesTableModel.getRow(caseTable.convertRowIndexToModel(selectedRow))).getCaseUUID().equals(nodeData.getCorrelationAttributeInstance().getCorrelationCase().getCaseUUID())) {
|
||||
dataSourceModel.addRow(new Object[]{nodeData.getDataSourceName(), nodeData.getDeviceID()});
|
||||
}
|
||||
} else {
|
||||
dataSourceModel.addRow(new Object[]{nodeData.getDataSourceName(), nodeData.getDeviceID()});
|
||||
}
|
||||
} catch (EamDbException ex) {
|
||||
System.out.println("failure 1 to compare");
|
||||
}
|
||||
@ -859,10 +861,16 @@ public class DataContentViewerOtherCases extends JPanel implements DataContentVi
|
||||
for (int selectedCaseRow : selectedCaseIndexes) {
|
||||
for (int selectedDataSourceRow : selectedDataSources) {
|
||||
try {
|
||||
if (nodeData.isCentralRepoNode()) {
|
||||
if (((CorrelationCase) casesTableModel.getRow(caseTable.convertRowIndexToModel(selectedCaseRow))).getCaseUUID().equals(nodeData.getCorrelationAttributeInstance().getCorrelationCase().getCaseUUID())
|
||||
&& dataSourceModel.getValueAt(dataSourceTable.convertRowIndexToModel(selectedDataSourceRow), 1).toString().equals(nodeData.getDeviceID())) {
|
||||
tableModel.addNodeData(nodeData);
|
||||
}
|
||||
} else {
|
||||
if (dataSourceModel.getValueAt(dataSourceTable.convertRowIndexToModel(selectedDataSourceRow), 1).toString().equals(nodeData.getDeviceID())) {
|
||||
tableModel.addNodeData(nodeData);
|
||||
}
|
||||
}
|
||||
} catch (EamDbException ex) {
|
||||
System.out.println("failure 2 to compare");
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Central Repository
|
||||
*
|
||||
* Copyright 2015-2018 Basis Technology Corp.
|
||||
* Copyright 2015-2019 Basis Technology Corp.
|
||||
* Contact: carrier <at> sleuthkit <dot> org
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@ -126,9 +126,9 @@ public class DataContentViewerOtherCasesTableModel extends AbstractTableModel {
|
||||
* @return The value in the cell.
|
||||
*/
|
||||
private Object mapNodeMessageData(OtherOccurrenceNodeMessageData nodeData, TableColumns columnId) {
|
||||
// if (columnId == TableColumns.CASE_NAME) {
|
||||
// return nodeData.getDisplayMessage();
|
||||
// }
|
||||
if (columnId == TableColumns.ATTRIBUTE) {
|
||||
return nodeData.getDisplayMessage();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
@ -144,21 +144,6 @@ public class DataContentViewerOtherCasesTableModel extends AbstractTableModel {
|
||||
String value = Bundle.DataContentViewerOtherCasesTableModel_noData();
|
||||
|
||||
switch (columnId) {
|
||||
// case CASE_NAME:
|
||||
// if (null != nodeData.getCaseName()) {
|
||||
// value = nodeData.getCaseName();
|
||||
// }
|
||||
// break;
|
||||
// case DEVICE:
|
||||
// if (null != nodeData.getDeviceID()) {
|
||||
// value = nodeData.getDeviceID();
|
||||
// }
|
||||
// break;
|
||||
// case DATA_SOURCE:
|
||||
// if (null != nodeData.getDataSourceName()) {
|
||||
// value = nodeData.getDataSourceName();
|
||||
// }
|
||||
// break;
|
||||
case FILE_PATH:
|
||||
value = nodeData.getFilePath();
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user