mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-17 18:17:43 +00:00
3201 merge conflicts with changes from 3199
This commit is contained in:
commit
e091dc72b5
@ -99,11 +99,9 @@
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JTable" name="casesTable">
|
||||
<Properties>
|
||||
<Property name="autoCreateRowSorter" type="boolean" value="true"/>
|
||||
<Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
|
||||
<Connection code="caseTableModel" type="code"/>
|
||||
</Property>
|
||||
<Property name="autoResizeMode" type="int" value="4"/>
|
||||
<Property name="rowHeight" type="int" value="20"/>
|
||||
<Property name="selectionModel" type="javax.swing.ListSelectionModel" editor="org.netbeans.modules.form.editors2.JTableSelectionModelEditor">
|
||||
<JTableSelectionModel selectionMode="0"/>
|
||||
|
@ -23,14 +23,18 @@ import java.awt.Desktop;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import javax.swing.JDialog;
|
||||
import javax.swing.JOptionPane;
|
||||
import javax.swing.RowSorter;
|
||||
import javax.swing.SortOrder;
|
||||
import javax.swing.event.ListSelectionEvent;
|
||||
import javax.swing.table.DefaultTableModel;
|
||||
import javax.swing.table.TableColumn;
|
||||
import javax.swing.table.TableRowSorter;
|
||||
import org.sleuthkit.autopsy.casemodule.MultiUserCaseManager.MultiUserCase;
|
||||
import org.sleuthkit.autopsy.coordinationservice.CoordinationService;
|
||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||
@ -146,6 +150,7 @@ final class MultiUserCasesPanel extends javax.swing.JPanel {
|
||||
|
||||
casesTable.removeColumn(casesTable.getColumn(OUTPUT_FOLDER_HEADER));
|
||||
casesTable.removeColumn(casesTable.getColumn(METADATA_FILE_HEADER));
|
||||
casesTable.setRowSorter(new RowSorter<>(caseTableModel));
|
||||
|
||||
/*
|
||||
* Listen for row selection changes and set button state for the current
|
||||
@ -313,6 +318,36 @@ final class MultiUserCasesPanel extends javax.swing.JPanel {
|
||||
return ((currentTime - inputTime) / (1000 * 60 * 60 * 24)) < (numberOfUnits * multiplier);
|
||||
}
|
||||
|
||||
/**
|
||||
* RowSorter which makes columns whose type is Date to be sorted first in
|
||||
* Descending order then in Ascending order
|
||||
*/
|
||||
private static class RowSorter<M extends DefaultTableModel> extends TableRowSorter<M> {
|
||||
|
||||
RowSorter(M tModel) {
|
||||
super(tModel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toggleSortOrder(int column) {
|
||||
if (!this.getModel().getColumnClass(column).equals(Date.class)) {
|
||||
super.toggleSortOrder(column); //if it isn't a date column perform the regular sorting
|
||||
} else {
|
||||
ArrayList<RowSorter.SortKey> sortKeys = new ArrayList<>(getSortKeys());
|
||||
if (sortKeys.isEmpty() || sortKeys.get(0).getColumn() != column) { //sort descending
|
||||
sortKeys.add(0, new RowSorter.SortKey(column, SortOrder.DESCENDING));
|
||||
} else if (sortKeys.get(0).getSortOrder() == SortOrder.ASCENDING) {
|
||||
sortKeys.removeIf(key -> key.getColumn() == column);
|
||||
sortKeys.add(0, new RowSorter.SortKey(column, SortOrder.DESCENDING));
|
||||
} else {
|
||||
sortKeys.removeIf(key -> key.getColumn() == column);
|
||||
sortKeys.add(0, new RowSorter.SortKey(column, SortOrder.ASCENDING));
|
||||
}
|
||||
setSortKeys(sortKeys);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is called from within the constructor to initialize the form.
|
||||
* WARNING: Do NOT modify this code. The content of this method is always
|
||||
@ -345,9 +380,7 @@ final class MultiUserCasesPanel extends javax.swing.JPanel {
|
||||
}
|
||||
});
|
||||
|
||||
casesTable.setAutoCreateRowSorter(true);
|
||||
casesTable.setModel(caseTableModel);
|
||||
casesTable.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_ALL_COLUMNS);
|
||||
casesTable.setRowHeight(20);
|
||||
casesTable.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
|
||||
casesTable.addMouseListener(new java.awt.event.MouseAdapter() {
|
||||
|
@ -28,6 +28,7 @@ import javax.annotation.concurrent.Immutable;
|
||||
import org.sleuthkit.autopsy.coreutils.ModuleSettings;
|
||||
import org.sleuthkit.datamodel.TagName;
|
||||
import org.sleuthkit.autopsy.datamodel.tags.Category;
|
||||
import org.sleuthkit.datamodel.TskData;
|
||||
|
||||
/**
|
||||
* A tag name definition consisting of a display name, description and color.
|
||||
@ -42,11 +43,10 @@ final class TagNameDefinition implements Comparable<TagNameDefinition> {
|
||||
TagsManager.getNotableItemText(), Category.ONE.getDisplayName(),
|
||||
Category.TWO.getDisplayName(), Category.THREE.getDisplayName(),
|
||||
Category.FOUR.getDisplayName(), Category.FIVE.getDisplayName());
|
||||
static final String NOTABLE = "(Notable)";
|
||||
private final String displayName;
|
||||
private final String description;
|
||||
private final TagName.HTML_COLOR color;
|
||||
private final String knownStatusDenoted;
|
||||
private final TskData.FileKnown knownStatusDenoted;
|
||||
|
||||
/**
|
||||
* Constructs a tag name definition consisting of a display name,
|
||||
@ -57,12 +57,12 @@ final class TagNameDefinition implements Comparable<TagNameDefinition> {
|
||||
* @param color The color for the tag name.
|
||||
* @param knownStatus The status denoted by the tag.
|
||||
*/
|
||||
TagNameDefinition(String displayName, String description, TagName.HTML_COLOR color, String knownStatus) {
|
||||
|
||||
TagNameDefinition(String displayName, String description, TagName.HTML_COLOR color, TskData.FileKnown status) {
|
||||
this.displayName = displayName;
|
||||
this.description = description;
|
||||
this.color = color;
|
||||
this.knownStatusDenoted = knownStatus;
|
||||
|
||||
this.knownStatusDenoted = status;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -99,7 +99,7 @@ final class TagNameDefinition implements Comparable<TagNameDefinition> {
|
||||
* otherwise.
|
||||
*/
|
||||
boolean isNotable() {
|
||||
return knownStatusDenoted.equals(NOTABLE);
|
||||
return knownStatusDenoted == TskData.FileKnown.BAD;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -162,7 +162,7 @@ final class TagNameDefinition implements Comparable<TagNameDefinition> {
|
||||
* that is used by the tags settings file.
|
||||
*/
|
||||
private String toSettingsFormat() {
|
||||
return displayName + "," + description + "," + color.name() + "," + knownStatusDenoted;
|
||||
return displayName + "," + description + "," + color.name() + "," + knownStatusDenoted.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -189,21 +189,21 @@ final class TagNameDefinition implements Comparable<TagNameDefinition> {
|
||||
if (tagNameAttributes.length == 3) {
|
||||
standardTags.remove(tagNameAttributes[0]); //Use standard tag's saved settings instead of default settings
|
||||
if (badTags.contains(tagNameAttributes[0])) {
|
||||
tagNames.add(new TagNameDefinition(tagNameAttributes[0], tagNameAttributes[1], TagName.HTML_COLOR.valueOf(tagNameAttributes[2]), NOTABLE));
|
||||
tagNames.add(new TagNameDefinition(tagNameAttributes[0], tagNameAttributes[1], TagName.HTML_COLOR.valueOf(tagNameAttributes[2]), TskData.FileKnown.BAD));
|
||||
} else {
|
||||
tagNames.add(new TagNameDefinition(tagNameAttributes[0], tagNameAttributes[1], TagName.HTML_COLOR.valueOf(tagNameAttributes[2]), "")); //add the default value for that tag
|
||||
tagNames.add(new TagNameDefinition(tagNameAttributes[0], tagNameAttributes[1], TagName.HTML_COLOR.valueOf(tagNameAttributes[2]), TskData.FileKnown.UNKNOWN)); //add the default value for that tag
|
||||
}
|
||||
} else if (tagNameAttributes.length == 4) {
|
||||
standardTags.remove(tagNameAttributes[0]); //Use standard tag's saved settings instead of default settings
|
||||
tagNames.add(new TagNameDefinition(tagNameAttributes[0], tagNameAttributes[1], TagName.HTML_COLOR.valueOf(tagNameAttributes[2]), tagNameAttributes[3]));
|
||||
tagNames.add(new TagNameDefinition(tagNameAttributes[0], tagNameAttributes[1], TagName.HTML_COLOR.valueOf(tagNameAttributes[2]), TskData.FileKnown.valueOf(tagNameAttributes[3])));
|
||||
}
|
||||
}
|
||||
}
|
||||
for (String standardTagName : standardTags) {
|
||||
if (STANDARD_NOTABLE_TAG_DISPLAY_NAMES.contains(standardTagName)) {
|
||||
tagNames.add(new TagNameDefinition(standardTagName, "", TagName.HTML_COLOR.NONE, NOTABLE));
|
||||
tagNames.add(new TagNameDefinition(standardTagName, "", TagName.HTML_COLOR.NONE, TskData.FileKnown.BAD));
|
||||
} else {
|
||||
tagNames.add(new TagNameDefinition(standardTagName, "", TagName.HTML_COLOR.NONE, "")); //add the default value for that tag
|
||||
tagNames.add(new TagNameDefinition(standardTagName, "", TagName.HTML_COLOR.NONE, TskData.FileKnown.UNKNOWN)); //add the default value for that tag
|
||||
}
|
||||
}
|
||||
return tagNames;
|
||||
|
@ -31,6 +31,7 @@ import org.openide.util.NbBundle;
|
||||
import org.sleuthkit.autopsy.corecomponents.OptionsPanel;
|
||||
import org.sleuthkit.autopsy.ingest.IngestManager;
|
||||
import org.sleuthkit.datamodel.TagName;
|
||||
import org.sleuthkit.datamodel.TskData;
|
||||
|
||||
/**
|
||||
* A panel to allow the user to create and delete custom tag types.
|
||||
@ -297,8 +298,8 @@ final class TagOptionsPanel extends javax.swing.JPanel implements OptionsPanel {
|
||||
TagNameDialog dialog = new TagNameDialog();
|
||||
TagNameDialog.BUTTON_PRESSED result = dialog.getResult();
|
||||
if (result == TagNameDialog.BUTTON_PRESSED.OK) {
|
||||
String status = dialog.isTagNotable() ? "(Notable)" : "";
|
||||
TagNameDefinition newTagType = new TagNameDefinition(dialog.getTagName(), dialog.getTagDesciption(), DEFAULT_COLOR, status);
|
||||
TskData.FileKnown status = dialog.isTagNotable() ? TskData.FileKnown.BAD : TskData.FileKnown.UNKNOWN;
|
||||
TagNameDefinition newTagType = new TagNameDefinition(dialog.getTagName(), DEFAULT_DESCRIPTION, DEFAULT_COLOR, status);
|
||||
/*
|
||||
* If tag name already exists, don't add the tag name.
|
||||
*/
|
||||
@ -331,7 +332,7 @@ final class TagOptionsPanel extends javax.swing.JPanel implements OptionsPanel {
|
||||
TagNameDialog dialog = new TagNameDialog(originalTagName);
|
||||
TagNameDialog.BUTTON_PRESSED result = dialog.getResult();
|
||||
if (result == TagNameDialog.BUTTON_PRESSED.OK) {
|
||||
String status = dialog.isTagNotable() ? "(Notable)" : "";
|
||||
TskData.FileKnown status = dialog.isTagNotable() ? TskData.FileKnown.BAD : TskData.FileKnown.UNKNOWN;
|
||||
TagNameDefinition newTagType = new TagNameDefinition(dialog.getTagName(), dialog.getTagDesciption(), DEFAULT_COLOR, status);
|
||||
/*
|
||||
* If tag name already exists, don't add the tag name.
|
||||
|
@ -37,6 +37,7 @@ import org.sleuthkit.datamodel.ContentTag;
|
||||
import org.sleuthkit.datamodel.SleuthkitCase;
|
||||
import org.sleuthkit.datamodel.TagName;
|
||||
import org.sleuthkit.datamodel.TskCoreException;
|
||||
import org.sleuthkit.datamodel.TskData;
|
||||
|
||||
/**
|
||||
* A per case Autopsy service that manages the addition of content and artifact
|
||||
@ -228,7 +229,7 @@ public class TagsManager implements Closeable {
|
||||
* name to the case database.
|
||||
*/
|
||||
public synchronized TagName addTagName(String displayName) throws TagNameAlreadyExistsException, TskCoreException {
|
||||
return addTagName(displayName, "", TagName.HTML_COLOR.NONE, "");
|
||||
return addTagName(displayName, "", TagName.HTML_COLOR.NONE, TskData.FileKnown.UNKNOWN);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -247,7 +248,7 @@ public class TagsManager implements Closeable {
|
||||
* name to the case database.
|
||||
*/
|
||||
public synchronized TagName addTagName(String displayName, String description) throws TagNameAlreadyExistsException, TskCoreException {
|
||||
return addTagName(displayName, description, TagName.HTML_COLOR.NONE, "");
|
||||
return addTagName(displayName, description, TagName.HTML_COLOR.NONE, TskData.FileKnown.UNKNOWN);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -266,9 +267,9 @@ public class TagsManager implements Closeable {
|
||||
* name to the case database.
|
||||
*/
|
||||
public synchronized TagName addTagName(String displayName, String description, TagName.HTML_COLOR color) throws TagNameAlreadyExistsException, TskCoreException {
|
||||
String knownStatus = "";
|
||||
TskData.FileKnown knownStatus = TskData.FileKnown.UNKNOWN;
|
||||
if (getNotableTagDisplayNames().contains(displayName)) {
|
||||
knownStatus = TagNameDefinition.NOTABLE;
|
||||
knownStatus = TskData.FileKnown.BAD;
|
||||
}
|
||||
return addTagName(displayName, description, color, knownStatus);
|
||||
}
|
||||
@ -290,7 +291,7 @@ public class TagsManager implements Closeable {
|
||||
* @throws TskCoreException If there is an error adding the tag
|
||||
* name to the case database.
|
||||
*/
|
||||
public synchronized TagName addTagName(String displayName, String description, TagName.HTML_COLOR color, String knownStatus) throws TagNameAlreadyExistsException, TskCoreException {
|
||||
public synchronized TagName addTagName(String displayName, String description, TagName.HTML_COLOR color, TskData.FileKnown knownStatus) throws TagNameAlreadyExistsException, TskCoreException {
|
||||
try {
|
||||
TagName tagName = caseDb.addTagName(displayName, description, color);
|
||||
Set<TagNameDefinition> customTypes = TagNameDefinition.getTagNameDefinitions();
|
||||
|
@ -73,25 +73,4 @@ public class DurationCellRenderer extends GrayableCellRenderer {
|
||||
return this;
|
||||
}
|
||||
|
||||
void grayCellIfTableNotEnabled(JTable table, boolean isSelected) {
|
||||
if (table.isEnabled()) {
|
||||
/*
|
||||
* The table is enabled, make the foreground and background the
|
||||
* normal selected or unselected color.
|
||||
*/
|
||||
if (isSelected) {
|
||||
setBackground(table.getSelectionBackground());
|
||||
setForeground(table.getSelectionForeground());
|
||||
} else {
|
||||
setBackground(table.getBackground());
|
||||
setForeground(table.getForeground());
|
||||
}
|
||||
} else {
|
||||
/*
|
||||
* The table is disabled, make the foreground and background gray.
|
||||
*/
|
||||
setBackground(Color.lightGray);
|
||||
setForeground(Color.darkGray);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ public class GrayableCellRenderer extends DefaultTableCellRenderer {
|
||||
return this;
|
||||
}
|
||||
|
||||
void grayCellIfTableNotEnabled(JTable table, boolean isSelected) {
|
||||
public void grayCellIfTableNotEnabled(JTable table, boolean isSelected) {
|
||||
if (table.isEnabled()) {
|
||||
/*
|
||||
* The table is enabled, make the foreground and background the
|
||||
|
@ -48,25 +48,4 @@ class ShortDateCellRenderer extends GrayableCellRenderer {
|
||||
return this;
|
||||
}
|
||||
|
||||
void grayCellIfTableNotEnabled(JTable table, boolean isSelected) {
|
||||
if (table.isEnabled()) {
|
||||
/*
|
||||
* The table is enabled, make the foreground and background the
|
||||
* normal selected or unselected color.
|
||||
*/
|
||||
if (isSelected) {
|
||||
setBackground(table.getSelectionBackground());
|
||||
setForeground(table.getSelectionForeground());
|
||||
} else {
|
||||
setBackground(table.getBackground());
|
||||
setForeground(table.getForeground());
|
||||
}
|
||||
} else {
|
||||
/*
|
||||
* The table is disabled, make the foreground and background gray.
|
||||
*/
|
||||
setBackground(Color.lightGray);
|
||||
setForeground(Color.darkGray);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -140,9 +140,35 @@ public class IngestOptionsPanel extends IngestModuleGlobalSettingsPanel implemen
|
||||
|
||||
@Override
|
||||
public void addPropertyChangeListener(PropertyChangeListener l) {
|
||||
filterPanel.addPropertyChangeListener(l);
|
||||
settingsPanel.addPropertyChangeListener(l);
|
||||
profilePanel.addPropertyChangeListener(l);
|
||||
super.addPropertyChangeListener(l);
|
||||
/*
|
||||
* There is at least one look and feel library that follows the bad
|
||||
* practice of calling overrideable methods in a constructor, e.g.:
|
||||
*
|
||||
* at
|
||||
* javax.swing.plaf.synth.SynthPanelUI.installListeners(SynthPanelUI.java:83)
|
||||
* at
|
||||
* javax.swing.plaf.synth.SynthPanelUI.installUI(SynthPanelUI.java:63)
|
||||
* at javax.swing.JComponent.setUI(JComponent.java:666) at
|
||||
* javax.swing.JPanel.setUI(JPanel.java:153) at
|
||||
* javax.swing.JPanel.updateUI(JPanel.java:126) at
|
||||
* javax.swing.JPanel.<init>(JPanel.java:86) at
|
||||
* javax.swing.JPanel.<init>(JPanel.java:109) at
|
||||
* javax.swing.JPanel.<init>(JPanel.java:117)
|
||||
*
|
||||
* When this happens, the following child components of this JPanel
|
||||
* subclass have not been constructed yet, since this panel's
|
||||
* constructor has not been called yet.
|
||||
*/
|
||||
if (null != filterPanel) {
|
||||
filterPanel.addPropertyChangeListener(l);
|
||||
}
|
||||
if (null != settingsPanel) {
|
||||
settingsPanel.addPropertyChangeListener(l);
|
||||
}
|
||||
if (null != profilePanel) {
|
||||
profilePanel.addPropertyChangeListener(l);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -177,7 +177,29 @@ class ProfilePanel extends IngestModuleGlobalSettingsPanel {
|
||||
|
||||
@Override
|
||||
public void addPropertyChangeListener(PropertyChangeListener l) {
|
||||
ingestSettingsPanel.addPropertyChangeListener(l);
|
||||
super.addPropertyChangeListener(l);
|
||||
/*
|
||||
* There is at least one look and feel library that follows the bad
|
||||
* practice of calling overrideable methods in a constructor, e.g.:
|
||||
*
|
||||
* at
|
||||
* javax.swing.plaf.synth.SynthPanelUI.installListeners(SynthPanelUI.java:83)
|
||||
* at
|
||||
* javax.swing.plaf.synth.SynthPanelUI.installUI(SynthPanelUI.java:63)
|
||||
* at javax.swing.JComponent.setUI(JComponent.java:666) at
|
||||
* javax.swing.JPanel.setUI(JPanel.java:153) at
|
||||
* javax.swing.JPanel.updateUI(JPanel.java:126) at
|
||||
* javax.swing.JPanel.<init>(JPanel.java:86) at
|
||||
* javax.swing.JPanel.<init>(JPanel.java:109) at
|
||||
* javax.swing.JPanel.<init>(JPanel.java:117)
|
||||
*
|
||||
* When this happens, the following child components of this JPanel
|
||||
* subclass have not been constructed yet, since this panel's
|
||||
* constructor has not been called yet.
|
||||
*/
|
||||
if (null != ingestSettingsPanel) {
|
||||
ingestSettingsPanel.addPropertyChangeListener(l);
|
||||
}
|
||||
}
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JPanel jPanel1;
|
||||
|
@ -169,7 +169,6 @@
|
||||
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/experimental/autoingest/Bundle.properties" key="AutoIngestControlPanel.pendingTable.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
<Property name="autoResizeMode" type="int" value="4"/>
|
||||
<Property name="rowHeight" type="int" value="20" postCode="pendingTable.setSelectionModel(new DefaultListSelectionModel() {
 private static final long serialVersionUID = 1L;
 @Override
 public void setSelectionInterval(int index0, int index1) {
 if (index0 == pendingTable.getSelectedRow()) {
 pendingTable.clearSelection();
 } else {
 super.setSelectionInterval(index0, index1);
 }
 }
});"/>
|
||||
<Property name="selectionModel" type="javax.swing.ListSelectionModel" editor="org.netbeans.modules.form.editors2.JTableSelectionModelEditor">
|
||||
<JTableSelectionModel selectionMode="0"/>
|
||||
@ -193,7 +192,6 @@
|
||||
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/experimental/autoingest/Bundle.properties" key="AutoIngestControlPanel.runningTable.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
<Property name="autoResizeMode" type="int" value="4"/>
|
||||
<Property name="rowHeight" type="int" value="20" postCode="runningTable.setSelectionModel(new DefaultListSelectionModel() {
 private static final long serialVersionUID = 1L;
 @Override
 public void setSelectionInterval(int index0, int index1) {
 if (index0 == runningTable.getSelectedRow()) {
 runningTable.clearSelection();
 } else {
 super.setSelectionInterval(index0, index1);
 }
 }
});"/>
|
||||
<Property name="selectionModel" type="javax.swing.ListSelectionModel" editor="org.netbeans.modules.form.editors2.JTableSelectionModelEditor">
|
||||
<JTableSelectionModel selectionMode="0"/>
|
||||
@ -217,7 +215,6 @@
|
||||
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/experimental/autoingest/Bundle.properties" key="AutoIngestControlPanel.completedTable.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
<Property name="autoResizeMode" type="int" value="4"/>
|
||||
<Property name="rowHeight" type="int" value="20" postCode="completedTable.setSelectionModel(new DefaultListSelectionModel() {
 private static final long serialVersionUID = 1L;
 @Override
 public void setSelectionInterval(int index0, int index1) {
 if (index0 == completedTable.getSelectedRow()) {
 completedTable.clearSelection();
 } else {
 super.setSelectionInterval(index0, index1);
 }
 }
});"/>
|
||||
<Property name="selectionModel" type="javax.swing.ListSelectionModel" editor="org.netbeans.modules.form.editors2.JTableSelectionModelEditor">
|
||||
<JTableSelectionModel selectionMode="0"/>
|
||||
|
@ -39,7 +39,6 @@ import javax.swing.DefaultListSelectionModel;
|
||||
import java.awt.Color;
|
||||
import java.beans.PropertyChangeEvent;
|
||||
import java.io.File;
|
||||
import java.util.Collections;
|
||||
import java.util.logging.Logger;
|
||||
import javax.swing.JOptionPane;
|
||||
import javax.swing.JPanel;
|
||||
@ -141,6 +140,8 @@ public final class AutoIngestControlPanel extends JPanel implements Observer {
|
||||
private static final int GENERIC_COL_MAX_WIDTH = 2000;
|
||||
private static final int PENDING_TABLE_COL_PREFERRED_WIDTH = 280;
|
||||
private static final int RUNNING_TABLE_COL_PREFERRED_WIDTH = 175;
|
||||
private static final int PRIORITY_COLUMN_PREFERRED_WIDTH = 60;
|
||||
private static final int PRIORITY_COLUMN_MAX_WIDTH = 150;
|
||||
private static final int ACTIVITY_TIME_COL_MIN_WIDTH = 250;
|
||||
private static final int ACTIVITY_TIME_COL_MAX_WIDTH = 450;
|
||||
private static final int TIME_COL_MIN_WIDTH = 30;
|
||||
@ -180,6 +181,7 @@ public final class AutoIngestControlPanel extends JPanel implements Observer {
|
||||
* ordinal or a column header string.
|
||||
*/
|
||||
@Messages({
|
||||
"AutoIngestControlPanel.JobsTableModel.ColumnHeader.Priority=Prioritized",
|
||||
"AutoIngestControlPanel.JobsTableModel.ColumnHeader.Case=Case",
|
||||
"AutoIngestControlPanel.JobsTableModel.ColumnHeader.ImageFolder=Data Source",
|
||||
"AutoIngestControlPanel.JobsTableModel.ColumnHeader.HostName=Host Name",
|
||||
@ -206,8 +208,8 @@ public final class AutoIngestControlPanel extends JPanel implements Observer {
|
||||
STATUS(NbBundle.getMessage(AutoIngestControlPanel.class, "AutoIngestControlPanel.JobsTableModel.ColumnHeader.Status")),
|
||||
CASE_DIRECTORY_PATH(NbBundle.getMessage(AutoIngestControlPanel.class, "AutoIngestControlPanel.JobsTableModel.ColumnHeader.CaseFolder")),
|
||||
IS_LOCAL_JOB(NbBundle.getMessage(AutoIngestControlPanel.class, "AutoIngestControlPanel.JobsTableModel.ColumnHeader.LocalJob")),
|
||||
MANIFEST_FILE_PATH(NbBundle.getMessage(AutoIngestControlPanel.class, "AutoIngestControlPanel.JobsTableModel.ColumnHeader.ManifestFilePath"));
|
||||
|
||||
MANIFEST_FILE_PATH(NbBundle.getMessage(AutoIngestControlPanel.class, "AutoIngestControlPanel.JobsTableModel.ColumnHeader.ManifestFilePath")),
|
||||
PRIORITY(NbBundle.getMessage(AutoIngestControlPanel.class, "AutoIngestControlPanel.JobsTableModel.ColumnHeader.Priority"));
|
||||
private final String header;
|
||||
|
||||
private JobsTableModelColumns(String header) {
|
||||
@ -230,7 +232,8 @@ public final class AutoIngestControlPanel extends JPanel implements Observer {
|
||||
STAGE_TIME.getColumnHeader(),
|
||||
CASE_DIRECTORY_PATH.getColumnHeader(),
|
||||
IS_LOCAL_JOB.getColumnHeader(),
|
||||
MANIFEST_FILE_PATH.getColumnHeader()};
|
||||
MANIFEST_FILE_PATH.getColumnHeader(),
|
||||
PRIORITY.getColumnHeader()};
|
||||
}
|
||||
|
||||
/**
|
||||
@ -262,32 +265,11 @@ public final class AutoIngestControlPanel extends JPanel implements Observer {
|
||||
|
||||
manager = AutoIngestManager.getInstance();
|
||||
|
||||
pendingTableModel = new DefaultTableModel(JobsTableModelColumns.headers, 0) {
|
||||
private static final long serialVersionUID = 1L;
|
||||
pendingTableModel = new AutoIngestTableModel(JobsTableModelColumns.headers, 0);
|
||||
|
||||
@Override
|
||||
public boolean isCellEditable(int row, int column) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
runningTableModel = new AutoIngestTableModel(JobsTableModelColumns.headers, 0);
|
||||
|
||||
runningTableModel = new DefaultTableModel(JobsTableModelColumns.headers, 0) {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Override
|
||||
public boolean isCellEditable(int row, int column) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
completedTableModel = new DefaultTableModel(JobsTableModelColumns.headers, 0) {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Override
|
||||
public boolean isCellEditable(int row, int column) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
completedTableModel = new AutoIngestTableModel(JobsTableModelColumns.headers, 0);
|
||||
|
||||
initComponents(); // Generated code.
|
||||
setServicesStatusMessage();
|
||||
@ -295,7 +277,7 @@ public final class AutoIngestControlPanel extends JPanel implements Observer {
|
||||
initRunningJobsTable();
|
||||
initCompletedJobsTable();
|
||||
initButtons();
|
||||
|
||||
completedTable.getRowSorter().toggleSortOrder(JobsTableModelColumns.COMPLETED_TIME.ordinal());
|
||||
/*
|
||||
* Must set this flag, otherwise pop up menus don't close properly.
|
||||
*/
|
||||
@ -415,10 +397,16 @@ public final class AutoIngestControlPanel extends JPanel implements Observer {
|
||||
column.setPreferredWidth(TIME_COL_PREFERRED_WIDTH);
|
||||
column.setWidth(TIME_COL_PREFERRED_WIDTH);
|
||||
|
||||
column = pendingTable.getColumn(JobsTableModelColumns.PRIORITY.getColumnHeader());
|
||||
column.setCellRenderer(new PrioritizedIconCellRenderer());
|
||||
column.setMaxWidth(PRIORITY_COLUMN_MAX_WIDTH);
|
||||
column.setPreferredWidth(PRIORITY_COLUMN_PREFERRED_WIDTH);
|
||||
column.setWidth(PRIORITY_COLUMN_PREFERRED_WIDTH);
|
||||
|
||||
/**
|
||||
* Prevent sorting when a column header is clicked.
|
||||
* Allow sorting when a column header is clicked.
|
||||
*/
|
||||
pendingTable.setAutoCreateRowSorter(false);
|
||||
pendingTable.setRowSorter(new AutoIngestRowSorter<>(pendingTableModel));
|
||||
|
||||
/*
|
||||
* Create a row selection listener to enable/disable the prioritize
|
||||
@ -457,7 +445,7 @@ public final class AutoIngestControlPanel extends JPanel implements Observer {
|
||||
runningTable.removeColumn(runningTable.getColumn(JobsTableModelColumns.CASE_DIRECTORY_PATH.getColumnHeader()));
|
||||
runningTable.removeColumn(runningTable.getColumn(JobsTableModelColumns.IS_LOCAL_JOB.getColumnHeader()));
|
||||
runningTable.removeColumn(runningTable.getColumn(JobsTableModelColumns.MANIFEST_FILE_PATH.getColumnHeader()));
|
||||
|
||||
runningTable.removeColumn(runningTable.getColumn(JobsTableModelColumns.PRIORITY.getColumnHeader()));
|
||||
/*
|
||||
* Set up a column to display the cases associated with the jobs.
|
||||
*/
|
||||
@ -527,9 +515,9 @@ public final class AutoIngestControlPanel extends JPanel implements Observer {
|
||||
}
|
||||
|
||||
private void updateRunningTableButtonsBasedOnSelectedRow() {
|
||||
int row = runningTable.getSelectedRow();
|
||||
int row = runningTable.convertRowIndexToModel(runningTable.getSelectedRow());
|
||||
if (row >= 0 && row < runningTable.getRowCount()) {
|
||||
if ((boolean) runningTableModel.getValueAt(row, JobsTableModelColumns.IS_LOCAL_JOB.ordinal())) {
|
||||
if ((boolean) runningTable.getModel().getValueAt(row, JobsTableModelColumns.IS_LOCAL_JOB.ordinal())) {
|
||||
enableRunningTableButtons(true);
|
||||
return;
|
||||
}
|
||||
@ -547,13 +535,13 @@ public final class AutoIngestControlPanel extends JPanel implements Observer {
|
||||
* does not remove the columns from the model, just from this table.
|
||||
*/
|
||||
completedTable.removeColumn(completedTable.getColumn(JobsTableModelColumns.STARTED_TIME.getColumnHeader()));
|
||||
completedTable.removeColumn(completedTable.getColumn(JobsTableModelColumns.HOST_NAME.getColumnHeader()));
|
||||
completedTable.removeColumn(completedTable.getColumn(JobsTableModelColumns.STAGE.getColumnHeader()));
|
||||
completedTable.removeColumn(completedTable.getColumn(JobsTableModelColumns.STAGE_TIME.getColumnHeader()));
|
||||
completedTable.removeColumn(completedTable.getColumn(JobsTableModelColumns.IS_LOCAL_JOB.getColumnHeader()));
|
||||
completedTable.removeColumn(completedTable.getColumn(JobsTableModelColumns.HOST_NAME.getColumnHeader()));
|
||||
completedTable.removeColumn(completedTable.getColumn(JobsTableModelColumns.CASE_DIRECTORY_PATH.getColumnHeader()));
|
||||
completedTable.removeColumn(completedTable.getColumn(JobsTableModelColumns.MANIFEST_FILE_PATH.getColumnHeader()));
|
||||
|
||||
completedTable.removeColumn(completedTable.getColumn(JobsTableModelColumns.PRIORITY.getColumnHeader()));
|
||||
/*
|
||||
* Set up a column to display the cases associated with the jobs.
|
||||
*/
|
||||
@ -606,9 +594,9 @@ public final class AutoIngestControlPanel extends JPanel implements Observer {
|
||||
column.setWidth(STATUS_COL_PREFERRED_WIDTH);
|
||||
|
||||
/*
|
||||
* Prevent sorting when a column header is clicked.
|
||||
* Allow sorting when a column header is clicked.
|
||||
*/
|
||||
completedTable.setAutoCreateRowSorter(false);
|
||||
completedTable.setRowSorter(new AutoIngestRowSorter<>(completedTableModel));
|
||||
|
||||
/*
|
||||
* Create a row selection listener to enable/disable the delete case and
|
||||
@ -985,7 +973,6 @@ public final class AutoIngestControlPanel extends JPanel implements Observer {
|
||||
List<AutoIngestJob> completedJobs = new ArrayList<>();
|
||||
manager.getJobs(pendingJobs, runningJobs, completedJobs);
|
||||
// Sort the completed jobs list by completed date
|
||||
Collections.sort(completedJobs, new AutoIngestJob.CompletedDateDescendingComparator());
|
||||
EventQueue.invokeLater(new RefreshComponentsTask(pendingJobs, runningJobs, completedJobs));
|
||||
}
|
||||
}
|
||||
@ -1033,9 +1020,9 @@ public final class AutoIngestControlPanel extends JPanel implements Observer {
|
||||
*/
|
||||
|
||||
if (null != pendingJobs) {
|
||||
Path currentRow = getSelectedEntry(pendingTable, pendingTableModel);
|
||||
refreshTable(pendingJobs, pendingTableModel, null);
|
||||
setSelectedEntry(pendingTable, pendingTableModel, currentRow);
|
||||
Path currentRow = getSelectedEntry(pendingTable);
|
||||
refreshTable(pendingJobs, (DefaultTableModel) pendingTable.getModel(), null);
|
||||
setSelectedEntry(pendingTable, currentRow);
|
||||
}
|
||||
|
||||
if (null != runningJobs) {
|
||||
@ -1044,15 +1031,15 @@ public final class AutoIngestControlPanel extends JPanel implements Observer {
|
||||
} else {
|
||||
updateRunningTableButtonsBasedOnSelectedRow();
|
||||
}
|
||||
Path currentRow = getSelectedEntry(runningTable, runningTableModel);
|
||||
refreshTable(runningJobs, runningTableModel, null);
|
||||
setSelectedEntry(runningTable, runningTableModel, currentRow);
|
||||
Path currentRow = getSelectedEntry(runningTable);
|
||||
refreshTable(runningJobs, (DefaultTableModel) runningTable.getModel(), null);
|
||||
setSelectedEntry(runningTable, currentRow);
|
||||
}
|
||||
|
||||
if (null != completedJobs) {
|
||||
Path currentRow = getSelectedEntry(completedTable, completedTableModel);
|
||||
refreshTable(completedJobs, completedTableModel, null);
|
||||
setSelectedEntry(completedTable, completedTableModel, currentRow);
|
||||
Path currentRow = getSelectedEntry(completedTable);
|
||||
refreshTable(completedJobs, (DefaultTableModel) completedTable.getModel(), null);
|
||||
setSelectedEntry(completedTable, currentRow);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1090,12 +1077,12 @@ public final class AutoIngestControlPanel extends JPanel implements Observer {
|
||||
*
|
||||
* @return a path representing the current selection
|
||||
*/
|
||||
Path getSelectedEntry(JTable table, DefaultTableModel tableModel) {
|
||||
Path getSelectedEntry(JTable table) {
|
||||
try {
|
||||
int currentlySelectedRow = table.getSelectedRow();
|
||||
int currentlySelectedRow = table.convertRowIndexToModel(table.getSelectedRow());
|
||||
if (currentlySelectedRow >= 0 && currentlySelectedRow < table.getRowCount()) {
|
||||
return Paths.get(tableModel.getValueAt(currentlySelectedRow, JobsTableModelColumns.CASE.ordinal()).toString(),
|
||||
tableModel.getValueAt(currentlySelectedRow, JobsTableModelColumns.DATA_SOURCE.ordinal()).toString());
|
||||
return Paths.get(table.getModel().getValueAt(currentlySelectedRow, JobsTableModelColumns.CASE.ordinal()).toString(),
|
||||
table.getModel().getValueAt(currentlySelectedRow, JobsTableModelColumns.DATA_SOURCE.ordinal()).toString());
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
return null;
|
||||
@ -1111,12 +1098,12 @@ public final class AutoIngestControlPanel extends JPanel implements Observer {
|
||||
* @param tableModel The tableModel of the table to set
|
||||
* @param path The path of the item to set
|
||||
*/
|
||||
void setSelectedEntry(JTable table, DefaultTableModel tableModel, Path path) {
|
||||
void setSelectedEntry(JTable table, Path path) {
|
||||
if (path != null) {
|
||||
try {
|
||||
for (int row = 0; row < table.getRowCount(); ++row) {
|
||||
Path temp = Paths.get(tableModel.getValueAt(row, JobsTableModelColumns.CASE.ordinal()).toString(),
|
||||
tableModel.getValueAt(row, JobsTableModelColumns.DATA_SOURCE.ordinal()).toString());
|
||||
Path temp = Paths.get(table.getModel().getValueAt(row, JobsTableModelColumns.CASE.ordinal()).toString(),
|
||||
table.getModel().getValueAt(row, JobsTableModelColumns.DATA_SOURCE.ordinal()).toString());
|
||||
if (temp.compareTo(path) == 0) { // found it
|
||||
table.setRowSelectionInterval(row, row);
|
||||
return;
|
||||
@ -1159,7 +1146,8 @@ public final class AutoIngestControlPanel extends JPanel implements Observer {
|
||||
((Date.from(Instant.now()).getTime()) - (status.getStartDate().getTime())), // ACTIVITY_TIME
|
||||
job.getCaseDirectoryPath(), // CASE_DIRECTORY_PATH
|
||||
job.getProcessingHostName().equals(LOCAL_HOST_NAME), // IS_LOCAL_JOB
|
||||
job.getManifest().getFilePath()}); // MANIFEST_FILE_PATH
|
||||
job.getManifest().getFilePath(), // MANIFEST_FILE_PATH
|
||||
job.getPriority()}); // PRIORITY
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
SYS_LOGGER.log(Level.SEVERE, "Dashboard error refreshing table", ex);
|
||||
@ -1171,9 +1159,9 @@ public final class AutoIngestControlPanel extends JPanel implements Observer {
|
||||
*/
|
||||
private void refreshTables() {
|
||||
JobsSnapshot jobsSnapshot = manager.getCurrentJobsSnapshot();
|
||||
refreshTable(jobsSnapshot.getCompletedJobs(), completedTableModel, null);
|
||||
refreshTable(jobsSnapshot.getPendingJobs(), pendingTableModel, null);
|
||||
refreshTable(jobsSnapshot.getRunningJobs(), runningTableModel, null);
|
||||
refreshTable(jobsSnapshot.getCompletedJobs(), (DefaultTableModel) completedTable.getModel(), null);
|
||||
refreshTable(jobsSnapshot.getPendingJobs(), (DefaultTableModel) pendingTable.getModel(), null);
|
||||
refreshTable(jobsSnapshot.getRunningJobs(), (DefaultTableModel) runningTable.getModel(), null);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1214,7 +1202,6 @@ public final class AutoIngestControlPanel extends JPanel implements Observer {
|
||||
|
||||
pendingTable.setModel(pendingTableModel);
|
||||
pendingTable.setToolTipText(org.openide.util.NbBundle.getMessage(AutoIngestControlPanel.class, "AutoIngestControlPanel.pendingTable.toolTipText")); // NOI18N
|
||||
pendingTable.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_ALL_COLUMNS);
|
||||
pendingTable.setRowHeight(20);
|
||||
pendingTable.setSelectionModel(new DefaultListSelectionModel() {
|
||||
private static final long serialVersionUID = 1L;
|
||||
@ -1232,7 +1219,6 @@ public final class AutoIngestControlPanel extends JPanel implements Observer {
|
||||
|
||||
runningTable.setModel(runningTableModel);
|
||||
runningTable.setToolTipText(org.openide.util.NbBundle.getMessage(AutoIngestControlPanel.class, "AutoIngestControlPanel.runningTable.toolTipText")); // NOI18N
|
||||
runningTable.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_ALL_COLUMNS);
|
||||
runningTable.setRowHeight(20);
|
||||
runningTable.setSelectionModel(new DefaultListSelectionModel() {
|
||||
private static final long serialVersionUID = 1L;
|
||||
@ -1250,7 +1236,6 @@ public final class AutoIngestControlPanel extends JPanel implements Observer {
|
||||
|
||||
completedTable.setModel(completedTableModel);
|
||||
completedTable.setToolTipText(org.openide.util.NbBundle.getMessage(AutoIngestControlPanel.class, "AutoIngestControlPanel.completedTable.toolTipText")); // NOI18N
|
||||
completedTable.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_ALL_COLUMNS);
|
||||
completedTable.setRowHeight(20);
|
||||
completedTable.setSelectionModel(new DefaultListSelectionModel() {
|
||||
private static final long serialVersionUID = 1L;
|
||||
@ -1428,10 +1413,10 @@ public final class AutoIngestControlPanel extends JPanel implements Observer {
|
||||
.addComponent(completedScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 920, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
|
||||
.addComponent(bnCancelJob, javax.swing.GroupLayout.DEFAULT_SIZE, 117, Short.MAX_VALUE)
|
||||
.addComponent(bnShowProgress, javax.swing.GroupLayout.DEFAULT_SIZE, 116, Short.MAX_VALUE)
|
||||
.addComponent(bnCancelModule, javax.swing.GroupLayout.DEFAULT_SIZE, 117, Short.MAX_VALUE)
|
||||
.addComponent(bnDeleteCase, javax.swing.GroupLayout.DEFAULT_SIZE, 117, Short.MAX_VALUE)
|
||||
.addComponent(bnCancelJob, javax.swing.GroupLayout.PREFERRED_SIZE, 117, Short.MAX_VALUE)
|
||||
.addComponent(bnShowProgress, javax.swing.GroupLayout.PREFERRED_SIZE, 116, Short.MAX_VALUE)
|
||||
.addComponent(bnCancelModule, javax.swing.GroupLayout.PREFERRED_SIZE, 117, Short.MAX_VALUE)
|
||||
.addComponent(bnDeleteCase, javax.swing.GroupLayout.PREFERRED_SIZE, 117, Short.MAX_VALUE)
|
||||
.addComponent(bnShowCaseLog, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(bnReprocessJob, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
@ -1538,11 +1523,11 @@ public final class AutoIngestControlPanel extends JPanel implements Observer {
|
||||
"AutoIngestControlPanel.DeletionFailed=Deletion failed for job"
|
||||
})
|
||||
private void bnDeleteCaseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bnDeleteCaseActionPerformed
|
||||
if (completedTableModel.getRowCount() < 0 || completedTable.getSelectedRow() < 0) {
|
||||
if (completedTable.getModel().getRowCount() < 0 || completedTable.getSelectedRow() < 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
String caseName = (String) completedTable.getValueAt(completedTable.getSelectedRow(), JobsTableModelColumns.CASE.ordinal());
|
||||
String caseName = (String) completedTable.getModel().getValueAt(completedTable.convertRowIndexToModel(completedTable.getSelectedRow()), JobsTableModelColumns.CASE.ordinal());
|
||||
Object[] options = {
|
||||
org.openide.util.NbBundle.getMessage(AutoIngestControlPanel.class, "ConfirmationDialog.Delete"),
|
||||
org.openide.util.NbBundle.getMessage(AutoIngestControlPanel.class, "ConfirmationDialog.DoNotDelete")
|
||||
@ -1559,8 +1544,8 @@ public final class AutoIngestControlPanel extends JPanel implements Observer {
|
||||
if (reply == JOptionPane.YES_OPTION) {
|
||||
bnDeleteCase.setEnabled(false);
|
||||
bnShowCaseLog.setEnabled(false);
|
||||
if (completedTableModel.getRowCount() > 0 && completedTable.getSelectedRow() >= 0) {
|
||||
Path caseDirectoryPath = (Path) completedTableModel.getValueAt(completedTable.getSelectedRow(), JobsTableModelColumns.CASE_DIRECTORY_PATH.ordinal());
|
||||
if (completedTable.getModel().getRowCount() > 0 && completedTable.getSelectedRow() >= 0) {
|
||||
Path caseDirectoryPath = (Path) completedTable.getModel().getValueAt(completedTable.convertRowIndexToModel(completedTable.getSelectedRow()), JobsTableModelColumns.CASE_DIRECTORY_PATH.ordinal());
|
||||
completedTable.clearSelection();
|
||||
this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
|
||||
CaseDeletionResult result = manager.deleteCase(caseName, caseDirectoryPath);
|
||||
@ -1706,9 +1691,10 @@ public final class AutoIngestControlPanel extends JPanel implements Observer {
|
||||
*/
|
||||
@Messages({"AutoIngestControlPanel.casePrioritization.errorMessage=An error occurred when prioritizing the case. Some or all jobs may not have been prioritized."})
|
||||
private void bnPrioritizeCaseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bnPrioritizeCaseActionPerformed
|
||||
if (pendingTableModel.getRowCount() > 0 && pendingTable.getSelectedRow() >= 0) {
|
||||
if (pendingTable.getModel().getRowCount() > 0 && pendingTable.getSelectedRow() >= 0) {
|
||||
this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
|
||||
String caseName = (pendingTableModel.getValueAt(pendingTable.getSelectedRow(), JobsTableModelColumns.CASE.ordinal())).toString();
|
||||
|
||||
String caseName = (pendingTable.getModel().getValueAt(pendingTable.convertRowIndexToModel(pendingTable.getSelectedRow()), JobsTableModelColumns.CASE.ordinal())).toString();
|
||||
try {
|
||||
manager.prioritizeCase(caseName);
|
||||
} catch (AutoIngestManager.AutoIngestManagerException ex) {
|
||||
@ -1734,9 +1720,9 @@ public final class AutoIngestControlPanel extends JPanel implements Observer {
|
||||
})
|
||||
private void bnShowCaseLogActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bnShowCaseLogActionPerformed
|
||||
try {
|
||||
int selectedRow = completedTable.getSelectedRow();
|
||||
int selectedRow = completedTable.convertRowIndexToModel(completedTable.getSelectedRow());
|
||||
if (selectedRow != -1) {
|
||||
Path caseDirectoryPath = (Path) completedTableModel.getValueAt(selectedRow, JobsTableModelColumns.CASE_DIRECTORY_PATH.ordinal());
|
||||
Path caseDirectoryPath = (Path) completedTable.getModel().getValueAt(selectedRow, JobsTableModelColumns.CASE_DIRECTORY_PATH.ordinal());
|
||||
if (null != caseDirectoryPath) {
|
||||
Path pathToLog = AutoIngestJobLogger.getLogPath(caseDirectoryPath);
|
||||
if (pathToLog.toFile().exists()) {
|
||||
@ -1765,9 +1751,9 @@ public final class AutoIngestControlPanel extends JPanel implements Observer {
|
||||
|
||||
@Messages({"AutoIngestControlPanel.jobPrioritization.errorMessage=An error occurred when prioritizing the job."})
|
||||
private void bnPrioritizeJobActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bnPrioritizeJobActionPerformed
|
||||
if (pendingTableModel.getRowCount() > 0 && pendingTable.getSelectedRow() >= 0) {
|
||||
if (pendingTable.getModel().getRowCount() > 0 && pendingTable.getSelectedRow() >= 0) {
|
||||
this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
|
||||
Path manifestFilePath = (Path) (pendingTableModel.getValueAt(pendingTable.getSelectedRow(), JobsTableModelColumns.MANIFEST_FILE_PATH.ordinal()));
|
||||
Path manifestFilePath = (Path) (pendingTable.getModel().getValueAt(pendingTable.convertRowIndexToModel(pendingTable.getSelectedRow()), JobsTableModelColumns.MANIFEST_FILE_PATH.ordinal()));
|
||||
try {
|
||||
manager.prioritizeJob(manifestFilePath);
|
||||
} catch (AutoIngestManager.AutoIngestManagerException ex) {
|
||||
@ -1794,11 +1780,11 @@ public final class AutoIngestControlPanel extends JPanel implements Observer {
|
||||
}//GEN-LAST:event_bnOpenLogDirActionPerformed
|
||||
|
||||
private void bnReprocessJobActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bnReprocessJobActionPerformed
|
||||
if (completedTableModel.getRowCount() < 0 || completedTable.getSelectedRow() < 0) {
|
||||
if (completedTable.getModel().getRowCount() < 0 || completedTable.getSelectedRow() < 0) {
|
||||
return;
|
||||
}
|
||||
this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
|
||||
Path manifestPath = (Path) completedTableModel.getValueAt(completedTable.getSelectedRow(), JobsTableModelColumns.MANIFEST_FILE_PATH.ordinal());
|
||||
Path manifestPath = (Path) completedTable.getModel().getValueAt(completedTable.convertRowIndexToModel(completedTable.getSelectedRow()), JobsTableModelColumns.MANIFEST_FILE_PATH.ordinal());
|
||||
manager.reprocessJob(manifestPath);
|
||||
refreshTables();
|
||||
AutoIngestControlPanel.this.setCursor(Cursor.getDefaultCursor());
|
||||
@ -1833,4 +1819,33 @@ public final class AutoIngestControlPanel extends JPanel implements Observer {
|
||||
private javax.swing.JTextField tbStatusMessage;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
|
||||
private class AutoIngestTableModel extends DefaultTableModel {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private AutoIngestTableModel(String[] headers, int i) {
|
||||
super(headers, i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCellEditable(int row, int column) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getColumnClass(int columnIndex) {
|
||||
if (columnIndex == JobsTableModelColumns.PRIORITY.ordinal()) {
|
||||
return Integer.class;
|
||||
} else if (columnIndex == JobsTableModelColumns.CREATED_TIME.ordinal()
|
||||
|| columnIndex == JobsTableModelColumns.COMPLETED_TIME.ordinal()
|
||||
|| columnIndex == JobsTableModelColumns.STARTED_TIME.ordinal()
|
||||
|| columnIndex == JobsTableModelColumns.STAGE_TIME.ordinal()) {
|
||||
return Date.class;
|
||||
} else if (columnIndex == JobsTableModelColumns.STATUS.ordinal()) {
|
||||
return Boolean.class;
|
||||
} else {
|
||||
return super.getColumnClass(columnIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -106,7 +106,6 @@
|
||||
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/experimental/autoingest/Bundle.properties" key="AutoIngestDashboard.pendingTable.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
<Property name="autoResizeMode" type="int" value="4"/>
|
||||
<Property name="rowHeight" type="int" value="20" postCode="pendingTable.setSelectionModel(new DefaultListSelectionModel() {
 private static final long serialVersionUID = 1L;
 @Override
 public void setSelectionInterval(int index0, int index1) {
 if (index0 == pendingTable.getSelectedRow()) {
 pendingTable.clearSelection();
 } else {
 super.setSelectionInterval(index0, index1);
 }
 }
});"/>
|
||||
<Property name="selectionModel" type="javax.swing.ListSelectionModel" editor="org.netbeans.modules.form.editors2.JTableSelectionModelEditor">
|
||||
<JTableSelectionModel selectionMode="0"/>
|
||||
@ -130,7 +129,6 @@
|
||||
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/experimental/autoingest/Bundle.properties" key="AutoIngestDashboard.runningTable.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
<Property name="autoResizeMode" type="int" value="4"/>
|
||||
<Property name="rowHeight" type="int" value="20" postCode="runningTable.setSelectionModel(new DefaultListSelectionModel() {
 private static final long serialVersionUID = 1L;
 @Override
 public void setSelectionInterval(int index0, int index1) {
 if (index0 == runningTable.getSelectedRow()) {
 runningTable.clearSelection();
 } else {
 super.setSelectionInterval(index0, index1);
 }
 }
});"/>
|
||||
<Property name="selectionModel" type="javax.swing.ListSelectionModel" editor="org.netbeans.modules.form.editors2.JTableSelectionModelEditor">
|
||||
<JTableSelectionModel selectionMode="0"/>
|
||||
@ -154,7 +152,6 @@
|
||||
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/experimental/autoingest/Bundle.properties" key="AutoIngestDashboard.completedTable.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
<Property name="autoResizeMode" type="int" value="4"/>
|
||||
<Property name="rowHeight" type="int" value="20" postCode="completedTable.setSelectionModel(new DefaultListSelectionModel() {
 private static final long serialVersionUID = 1L;
 @Override
 public void setSelectionInterval(int index0, int index1) {
 if (index0 == completedTable.getSelectedRow()) {
 completedTable.clearSelection();
 } else {
 super.setSelectionInterval(index0, index1);
 }
 }
});"/>
|
||||
<Property name="selectionModel" type="javax.swing.ListSelectionModel" editor="org.netbeans.modules.form.editors2.JTableSelectionModelEditor">
|
||||
<JTableSelectionModel selectionMode="0"/>
|
||||
|
@ -51,13 +51,15 @@ import org.sleuthkit.autopsy.guiutils.StatusIconCellRenderer;
|
||||
/**
|
||||
* A dashboard for monitoring an automated ingest cluster.
|
||||
*/
|
||||
public final class AutoIngestDashboard extends JPanel implements Observer {
|
||||
final class AutoIngestDashboard extends JPanel implements Observer {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final int GENERIC_COL_MIN_WIDTH = 30;
|
||||
private static final int GENERIC_COL_MAX_WIDTH = 2000;
|
||||
private static final int PENDING_TABLE_COL_PREFERRED_WIDTH = 280;
|
||||
private static final int RUNNING_TABLE_COL_PREFERRED_WIDTH = 175;
|
||||
private static final int PRIORITY_COLUMN_PREFERRED_WIDTH = 60;
|
||||
private static final int PRIORITY_COLUMN_MAX_WIDTH = 150;
|
||||
private static final int STAGE_TIME_COL_MIN_WIDTH = 250;
|
||||
private static final int STAGE_TIME_COL_MAX_WIDTH = 450;
|
||||
private static final int TIME_COL_MIN_WIDTH = 30;
|
||||
@ -103,32 +105,11 @@ public final class AutoIngestDashboard extends JPanel implements Observer {
|
||||
* Constructs a panel for monitoring an automated ingest cluster.
|
||||
*/
|
||||
private AutoIngestDashboard() {
|
||||
pendingTableModel = new DefaultTableModel(JobsTableModelColumns.headers, 0) {
|
||||
private static final long serialVersionUID = 1L;
|
||||
pendingTableModel = new AutoIngestTableModel(JobsTableModelColumns.headers, 0);
|
||||
|
||||
@Override
|
||||
public boolean isCellEditable(int row, int column) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
runningTableModel = new AutoIngestTableModel(JobsTableModelColumns.headers, 0);
|
||||
|
||||
runningTableModel = new DefaultTableModel(JobsTableModelColumns.headers, 0) {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Override
|
||||
public boolean isCellEditable(int row, int column) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
completedTableModel = new DefaultTableModel(JobsTableModelColumns.headers, 0) {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Override
|
||||
public boolean isCellEditable(int row, int column) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
completedTableModel = new AutoIngestTableModel(JobsTableModelColumns.headers, 0);
|
||||
|
||||
initComponents();
|
||||
setServicesStatusMessage();
|
||||
@ -246,10 +227,15 @@ public final class AutoIngestDashboard extends JPanel implements Observer {
|
||||
column.setPreferredWidth(TIME_COL_PREFERRED_WIDTH);
|
||||
column.setWidth(TIME_COL_PREFERRED_WIDTH);
|
||||
|
||||
/**
|
||||
* Prevent sorting when a column header is clicked.
|
||||
column = pendingTable.getColumn(JobsTableModelColumns.PRIORITY.getColumnHeader());
|
||||
column.setCellRenderer(new PrioritizedIconCellRenderer());
|
||||
column.setMaxWidth(PRIORITY_COLUMN_MAX_WIDTH);
|
||||
column.setPreferredWidth(PRIORITY_COLUMN_PREFERRED_WIDTH);
|
||||
column.setWidth(PRIORITY_COLUMN_PREFERRED_WIDTH);
|
||||
/*
|
||||
* Allow sorting when a column header is clicked.
|
||||
*/
|
||||
pendingTable.setAutoCreateRowSorter(false);
|
||||
pendingTable.setRowSorter(new AutoIngestRowSorter<>(pendingTableModel));
|
||||
|
||||
/*
|
||||
* Create a row selection listener to enable/disable the Prioritize
|
||||
@ -261,7 +247,7 @@ public final class AutoIngestDashboard extends JPanel implements Observer {
|
||||
}
|
||||
int row = pendingTable.getSelectedRow();
|
||||
|
||||
boolean enablePrioritizeButtons = (row >= 0 && row < pendingTable.getRowCount());
|
||||
boolean enablePrioritizeButtons = (row >= 0 && row < pendingTable.getRowCount());
|
||||
this.prioritizeJobButton.setEnabled(enablePrioritizeButtons);
|
||||
this.prioritizeCaseButton.setEnabled(enablePrioritizeButtons);
|
||||
});
|
||||
@ -283,7 +269,7 @@ public final class AutoIngestDashboard extends JPanel implements Observer {
|
||||
runningTable.removeColumn(runningTable.getColumn(JobsTableModelColumns.CASE_DIRECTORY_PATH.getColumnHeader()));
|
||||
runningTable.removeColumn(runningTable.getColumn(JobsTableModelColumns.MANIFEST_FILE_PATH.getColumnHeader()));
|
||||
runningTable.removeColumn(runningTable.getColumn(JobsTableModelColumns.JOB.getColumnHeader()));
|
||||
|
||||
runningTable.removeColumn(runningTable.getColumn(JobsTableModelColumns.PRIORITY.getColumnHeader()));
|
||||
/*
|
||||
* Set up a column to display the cases associated with the jobs.
|
||||
*/
|
||||
@ -357,7 +343,7 @@ public final class AutoIngestDashboard extends JPanel implements Observer {
|
||||
completedTable.removeColumn(completedTable.getColumn(JobsTableModelColumns.CASE_DIRECTORY_PATH.getColumnHeader()));
|
||||
completedTable.removeColumn(completedTable.getColumn(JobsTableModelColumns.MANIFEST_FILE_PATH.getColumnHeader()));
|
||||
completedTable.removeColumn(completedTable.getColumn(JobsTableModelColumns.JOB.getColumnHeader()));
|
||||
|
||||
completedTable.removeColumn(completedTable.getColumn(JobsTableModelColumns.PRIORITY.getColumnHeader()));
|
||||
/*
|
||||
* Set up a column to display the cases associated with the jobs.
|
||||
*/
|
||||
@ -408,11 +394,10 @@ public final class AutoIngestDashboard extends JPanel implements Observer {
|
||||
column.setMaxWidth(STATUS_COL_MAX_WIDTH);
|
||||
column.setPreferredWidth(STATUS_COL_PREFERRED_WIDTH);
|
||||
column.setWidth(STATUS_COL_PREFERRED_WIDTH);
|
||||
|
||||
/*
|
||||
* Prevent sorting when a column header is clicked.
|
||||
* Allow sorting when a column header is clicked.
|
||||
*/
|
||||
completedTable.setAutoCreateRowSorter(false);
|
||||
completedTable.setRowSorter(new AutoIngestRowSorter<>(completedTableModel));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -479,6 +464,7 @@ public final class AutoIngestDashboard extends JPanel implements Observer {
|
||||
((Date.from(Instant.now()).getTime()) - (status.getStartDate().getTime())), // STAGE_TIME
|
||||
job.getCaseDirectoryPath(), // CASE_DIRECTORY_PATH
|
||||
job.getManifest().getFilePath(), // MANIFEST_FILE_PATH
|
||||
job.getPriority(), // PRIORITY
|
||||
job
|
||||
});
|
||||
}
|
||||
@ -544,6 +530,7 @@ public final class AutoIngestDashboard extends JPanel implements Observer {
|
||||
* described by either an enum ordinal or a column header string.
|
||||
*/
|
||||
private enum JobsTableModelColumns {
|
||||
@Messages({"AutoIngestDashboard.JobsTableModel.ColumnHeader.Priority=Prioritized"})
|
||||
|
||||
CASE(NbBundle.getMessage(AutoIngestDashboard.class, "AutoIngestDashboard.JobsTableModel.ColumnHeader.Case")),
|
||||
DATA_SOURCE(NbBundle.getMessage(AutoIngestDashboard.class, "AutoIngestDashboard.JobsTableModel.ColumnHeader.ImageFolder")),
|
||||
@ -556,6 +543,7 @@ public final class AutoIngestDashboard extends JPanel implements Observer {
|
||||
STATUS(NbBundle.getMessage(AutoIngestDashboard.class, "AutoIngestDashboard.JobsTableModel.ColumnHeader.Status")),
|
||||
CASE_DIRECTORY_PATH(NbBundle.getMessage(AutoIngestDashboard.class, "AutoIngestDashboard.JobsTableModel.ColumnHeader.CaseFolder")),
|
||||
MANIFEST_FILE_PATH(NbBundle.getMessage(AutoIngestDashboard.class, "AutoIngestDashboard.JobsTableModel.ColumnHeader.ManifestFilePath")),
|
||||
PRIORITY(NbBundle.getMessage(AutoIngestControlPanel.class, "AutoIngestDashboard.JobsTableModel.ColumnHeader.Priority")),
|
||||
JOB(NbBundle.getMessage(AutoIngestDashboard.class, "AutoIngestDashboard.JobsTableModel.ColumnHeader.Job"));
|
||||
|
||||
private final String header;
|
||||
@ -580,6 +568,7 @@ public final class AutoIngestDashboard extends JPanel implements Observer {
|
||||
STAGE_TIME.getColumnHeader(),
|
||||
CASE_DIRECTORY_PATH.getColumnHeader(),
|
||||
MANIFEST_FILE_PATH.getColumnHeader(),
|
||||
PRIORITY.getColumnHeader(),
|
||||
JOB.getColumnHeader()
|
||||
};
|
||||
};
|
||||
@ -671,7 +660,6 @@ public final class AutoIngestDashboard extends JPanel implements Observer {
|
||||
|
||||
pendingTable.setModel(pendingTableModel);
|
||||
pendingTable.setToolTipText(org.openide.util.NbBundle.getMessage(AutoIngestDashboard.class, "AutoIngestDashboard.pendingTable.toolTipText")); // NOI18N
|
||||
pendingTable.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_ALL_COLUMNS);
|
||||
pendingTable.setRowHeight(20);
|
||||
pendingTable.setSelectionModel(new DefaultListSelectionModel() {
|
||||
private static final long serialVersionUID = 1L;
|
||||
@ -689,7 +677,6 @@ public final class AutoIngestDashboard extends JPanel implements Observer {
|
||||
|
||||
runningTable.setModel(runningTableModel);
|
||||
runningTable.setToolTipText(org.openide.util.NbBundle.getMessage(AutoIngestDashboard.class, "AutoIngestDashboard.runningTable.toolTipText")); // NOI18N
|
||||
runningTable.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_ALL_COLUMNS);
|
||||
runningTable.setRowHeight(20);
|
||||
runningTable.setSelectionModel(new DefaultListSelectionModel() {
|
||||
private static final long serialVersionUID = 1L;
|
||||
@ -707,7 +694,6 @@ public final class AutoIngestDashboard extends JPanel implements Observer {
|
||||
|
||||
completedTable.setModel(completedTableModel);
|
||||
completedTable.setToolTipText(org.openide.util.NbBundle.getMessage(AutoIngestDashboard.class, "AutoIngestDashboard.completedTable.toolTipText")); // NOI18N
|
||||
completedTable.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_ALL_COLUMNS);
|
||||
completedTable.setRowHeight(20);
|
||||
completedTable.setSelectionModel(new DefaultListSelectionModel() {
|
||||
private static final long serialVersionUID = 1L;
|
||||
@ -909,4 +895,33 @@ public final class AutoIngestDashboard extends JPanel implements Observer {
|
||||
private javax.swing.JTextField tbServicesStatusMessage;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
|
||||
private class AutoIngestTableModel extends DefaultTableModel {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private AutoIngestTableModel(String[] headers, int i) {
|
||||
super(headers, i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCellEditable(int row, int column) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getColumnClass(int columnIndex) {
|
||||
if (columnIndex == JobsTableModelColumns.PRIORITY.ordinal()) {
|
||||
return Integer.class;
|
||||
} else if (columnIndex == JobsTableModelColumns.CREATED_TIME.ordinal()
|
||||
|| columnIndex == JobsTableModelColumns.COMPLETED_TIME.ordinal()
|
||||
|| columnIndex == JobsTableModelColumns.STARTED_TIME.ordinal()
|
||||
|| columnIndex == JobsTableModelColumns.STAGE_TIME.ordinal()) {
|
||||
return Date.class;
|
||||
} else if (columnIndex == JobsTableModelColumns.STATUS.ordinal()) {
|
||||
return Boolean.class;
|
||||
} else {
|
||||
return super.getColumnClass(columnIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -498,6 +498,7 @@ public final class AutoIngestManager extends Observable implements PropertyChang
|
||||
}
|
||||
SYS_LOGGER.log(Level.INFO, "Starting input scan of {0}", rootInputDirectory);
|
||||
InputDirScanner scanner = new InputDirScanner();
|
||||
|
||||
scanner.scan();
|
||||
SYS_LOGGER.log(Level.INFO, "Completed input scan of {0}", rootInputDirectory);
|
||||
}
|
||||
@ -553,10 +554,12 @@ public final class AutoIngestManager extends Observable implements PropertyChang
|
||||
if (!prioritizedJobs.isEmpty()) {
|
||||
++maxPriority;
|
||||
for (AutoIngestJob job : prioritizedJobs) {
|
||||
int oldPriority = job.getPriority();
|
||||
job.setPriority(maxPriority);
|
||||
try {
|
||||
this.updateCoordinationServiceNode(job);
|
||||
job.setPriority(maxPriority);
|
||||
} catch (CoordinationServiceException | InterruptedException ex) {
|
||||
job.setPriority(oldPriority);
|
||||
throw new AutoIngestManagerException("Error updating case priority", ex);
|
||||
}
|
||||
}
|
||||
@ -607,12 +610,14 @@ public final class AutoIngestManager extends Observable implements PropertyChang
|
||||
*/
|
||||
if (null != prioritizedJob) {
|
||||
++maxPriority;
|
||||
int oldPriority = prioritizedJob.getPriority();
|
||||
prioritizedJob.setPriority(maxPriority);
|
||||
try {
|
||||
this.updateCoordinationServiceNode(prioritizedJob);
|
||||
} catch (CoordinationServiceException | InterruptedException ex) {
|
||||
prioritizedJob.setPriority(oldPriority);
|
||||
throw new AutoIngestManagerException("Error updating job priority", ex);
|
||||
}
|
||||
prioritizedJob.setPriority(maxPriority);
|
||||
}
|
||||
|
||||
Collections.sort(pendingJobs, new AutoIngestJob.PriorityComparator());
|
||||
@ -1041,8 +1046,8 @@ public final class AutoIngestManager extends Observable implements PropertyChang
|
||||
|
||||
if (null != manifest) {
|
||||
/*
|
||||
* Update the mapping of case names to manifest paths that is
|
||||
* used for case deletion.
|
||||
* Update the mapping of case names to manifest paths that
|
||||
* is used for case deletion.
|
||||
*/
|
||||
String caseName = manifest.getCaseName();
|
||||
Path manifestPath = manifest.getFilePath();
|
||||
@ -1056,8 +1061,8 @@ public final class AutoIngestManager extends Observable implements PropertyChang
|
||||
}
|
||||
|
||||
/*
|
||||
* Add a job to the pending jobs queue, the completed jobs list,
|
||||
* or do crashed job recovery, as required.
|
||||
* Add a job to the pending jobs queue, the completed jobs
|
||||
* list, or do crashed job recovery, as required.
|
||||
*/
|
||||
try {
|
||||
byte[] rawData = coordinationService.getNodeData(CoordinationService.CategoryNode.MANIFESTS, manifestPath.toString());
|
||||
@ -1077,7 +1082,7 @@ public final class AutoIngestManager extends Observable implements PropertyChang
|
||||
break;
|
||||
case DELETED:
|
||||
/*
|
||||
* Ignore jobs marked as "deleted."
|
||||
* Ignore jobs marked as "deleted."
|
||||
*/
|
||||
break;
|
||||
default:
|
||||
@ -1237,48 +1242,38 @@ public final class AutoIngestManager extends Observable implements PropertyChang
|
||||
if (null != manifestLock) {
|
||||
SYS_LOGGER.log(Level.SEVERE, "Attempting crash recovery for {0}", manifestPath);
|
||||
try {
|
||||
Path caseDirectoryPath = PathUtils.findCaseDirectory(rootOutputDirectory, manifest.getCaseName());
|
||||
|
||||
/*
|
||||
* Create the recovery job.
|
||||
*/
|
||||
AutoIngestJob job = new AutoIngestJob(nodeData);
|
||||
int numberOfCrashes = job.getNumberOfCrashes();
|
||||
++numberOfCrashes;
|
||||
job.setNumberOfCrashes(numberOfCrashes);
|
||||
job.setCompletedDate(new Date(0));
|
||||
Path caseDirectoryPath = PathUtils.findCaseDirectory(rootOutputDirectory, manifest.getCaseName());
|
||||
if (numberOfCrashes <= AutoIngestUserPreferences.getMaxNumTimesToProcessImage()) {
|
||||
++numberOfCrashes;
|
||||
job.setNumberOfCrashes(numberOfCrashes);
|
||||
if (numberOfCrashes <= AutoIngestUserPreferences.getMaxNumTimesToProcessImage()) {
|
||||
job.setCompletedDate(new Date(0));
|
||||
} else {
|
||||
job.setCompletedDate(Date.from(Instant.now()));
|
||||
}
|
||||
}
|
||||
|
||||
if (null != caseDirectoryPath) {
|
||||
job.setCaseDirectoryPath(caseDirectoryPath);
|
||||
job.setErrorsOccurred(true);
|
||||
try {
|
||||
/*
|
||||
* Write the alert file and do the logging.
|
||||
*/
|
||||
AutoIngestAlertFile.create(caseDirectoryPath);
|
||||
} catch (AutoIngestAlertFileException ex) {
|
||||
SYS_LOGGER.log(Level.SEVERE, String.format("Error creating alert file for crashed job for %s", manifestPath), ex);
|
||||
}
|
||||
} else {
|
||||
job.setErrorsOccurred(false);
|
||||
}
|
||||
|
||||
/*
|
||||
* Update the coordination service node for the job. If
|
||||
* this fails, leave the recovery to another host.
|
||||
*/
|
||||
try {
|
||||
updateCoordinationServiceNode(job);
|
||||
if (numberOfCrashes <= AutoIngestUserPreferences.getMaxNumTimesToProcessImage()) {
|
||||
newPendingJobsList.add(job);
|
||||
} else {
|
||||
newCompletedJobsList.add(new AutoIngestJob(nodeData));
|
||||
}
|
||||
} catch (CoordinationServiceException ex) {
|
||||
SYS_LOGGER.log(Level.SEVERE, String.format("Error attempting to set node data for %s", manifestPath), ex);
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Write the alert file and do the logging.
|
||||
*/
|
||||
if (null != caseDirectoryPath) {
|
||||
try {
|
||||
AutoIngestAlertFile.create(nodeData.getCaseDirectoryPath());
|
||||
} catch (AutoIngestAlertFileException ex) {
|
||||
SYS_LOGGER.log(Level.SEVERE, String.format("Error creating alert file for crashed job for %s", manifestPath), ex);
|
||||
}
|
||||
}
|
||||
if (numberOfCrashes <= AutoIngestUserPreferences.getMaxNumTimesToProcessImage()) {
|
||||
job.setProcessingStatus(AutoIngestJob.ProcessingStatus.PENDING);
|
||||
if (null != caseDirectoryPath) {
|
||||
@ -1292,13 +1287,32 @@ public final class AutoIngestManager extends Observable implements PropertyChang
|
||||
job.setProcessingStatus(AutoIngestJob.ProcessingStatus.COMPLETED);
|
||||
if (null != caseDirectoryPath) {
|
||||
try {
|
||||
new AutoIngestJobLogger(manifest.getFilePath(), manifest.getDataSourceFileName(), nodeData.getCaseDirectoryPath()).logCrashRecoveryNoRetry();
|
||||
new AutoIngestJobLogger(manifest.getFilePath(), manifest.getDataSourceFileName(), caseDirectoryPath).logCrashRecoveryNoRetry();
|
||||
} catch (AutoIngestJobLoggerException ex) {
|
||||
SYS_LOGGER.log(Level.SEVERE, String.format("Error creating case auto ingest log entry for crashed job for %s", manifestPath), ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Update the coordination service node for the job. If
|
||||
* this fails, leave the recovery to another host.
|
||||
*/
|
||||
try {
|
||||
updateCoordinationServiceNode(job);
|
||||
} catch (CoordinationServiceException ex) {
|
||||
SYS_LOGGER.log(Level.SEVERE, String.format("Error attempting to set node data for %s", manifestPath), ex);
|
||||
return;
|
||||
}
|
||||
|
||||
nodeData = new AutoIngestJobNodeData(job);
|
||||
|
||||
if (numberOfCrashes <= AutoIngestUserPreferences.getMaxNumTimesToProcessImage()) {
|
||||
newPendingJobsList.add(job);
|
||||
} else {
|
||||
newCompletedJobsList.add(new AutoIngestJob(nodeData));
|
||||
}
|
||||
|
||||
} finally {
|
||||
try {
|
||||
manifestLock.release();
|
||||
|
@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Autopsy Forensic Browser
|
||||
*
|
||||
* Copyright 2011-2017 Basis Technology Corp.
|
||||
* Contact: carrier <at> sleuthkit <dot> org
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.sleuthkit.autopsy.experimental.autoingest;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import javax.swing.RowSorter;
|
||||
import javax.swing.SortOrder;
|
||||
import javax.swing.table.DefaultTableModel;
|
||||
import javax.swing.table.TableRowSorter;
|
||||
|
||||
/**
|
||||
* RowSorter which makes columns whose type is Date to be sorted first in
|
||||
* Descending order then in Ascending order
|
||||
*/
|
||||
class AutoIngestRowSorter<M extends DefaultTableModel> extends TableRowSorter<M> {
|
||||
|
||||
AutoIngestRowSorter(M tModel) {
|
||||
super(tModel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toggleSortOrder(int column) {
|
||||
if (!this.getModel().getColumnClass(column).equals(Date.class) && !this.getModel().getColumnClass(column).equals(Integer.class)) {
|
||||
//currently the only Integer column this sorter is being applied to is the Priority column
|
||||
super.toggleSortOrder(column); //if it isn't a date or Integer column perform the regular sorting
|
||||
} else {
|
||||
ArrayList<RowSorter.SortKey> sortKeys = new ArrayList<>(getSortKeys());
|
||||
if (sortKeys.isEmpty() || sortKeys.get(0).getColumn() != column) { //sort descending
|
||||
sortKeys.add(0, new RowSorter.SortKey(column, SortOrder.DESCENDING));
|
||||
} else if (sortKeys.get(0).getSortOrder() == SortOrder.ASCENDING) {
|
||||
sortKeys.removeIf(key -> key.getColumn() == column);
|
||||
sortKeys.add(0, new RowSorter.SortKey(column, SortOrder.DESCENDING));
|
||||
} else {
|
||||
sortKeys.removeIf(key -> key.getColumn() == column);
|
||||
sortKeys.add(0, new RowSorter.SortKey(column, SortOrder.ASCENDING));
|
||||
}
|
||||
setSortKeys(sortKeys);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Autopsy Forensic Browser
|
||||
*
|
||||
* Copyright 2017 Basis Technology Corp.
|
||||
* Contact: carrier <at> sleuthkit <dot> org
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.sleuthkit.autopsy.experimental.autoingest;
|
||||
|
||||
import java.awt.Component;
|
||||
import javax.swing.ImageIcon;
|
||||
import javax.swing.JTable;
|
||||
import static javax.swing.SwingConstants.CENTER;
|
||||
import org.openide.util.ImageUtilities;
|
||||
import org.openide.util.NbBundle.Messages;
|
||||
import org.sleuthkit.autopsy.guiutils.GrayableCellRenderer;
|
||||
import org.sleuthkit.autopsy.guiutils.StatusIconCellRenderer;
|
||||
|
||||
/**
|
||||
* A JTable cell renderer that represents whether the priority value of a job
|
||||
* has ever been increased, tick if prioritized nothing if not.
|
||||
*/
|
||||
class PrioritizedIconCellRenderer extends GrayableCellRenderer {
|
||||
|
||||
|
||||
@Messages({
|
||||
"PrioritizedIconCellRenderer.prioritized.tooltiptext=This job has been prioritized. The most recently prioritized job should be processed next.",
|
||||
"PrioritizedIconCellRenderer.notPrioritized.tooltiptext=This job has not been prioritized."
|
||||
})
|
||||
private static final long serialVersionUID = 1L;
|
||||
static final ImageIcon checkedIcon = new ImageIcon(ImageUtilities.loadImage("org/sleuthkit/autopsy/experimental/images/tick.png", false));
|
||||
|
||||
@Override
|
||||
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
|
||||
setHorizontalAlignment(CENTER);
|
||||
if ((value instanceof Integer)) {
|
||||
if ((int) value == 0) {
|
||||
setIcon(null);
|
||||
setToolTipText(org.openide.util.NbBundle.getMessage(PrioritizedIconCellRenderer.class, "PrioritizedIconCellRenderer.notPrioritized.tooltiptext"));
|
||||
} else {
|
||||
setIcon(checkedIcon);
|
||||
setToolTipText(org.openide.util.NbBundle.getMessage(PrioritizedIconCellRenderer.class, "PrioritizedIconCellRenderer.prioritized.tooltiptext"));
|
||||
}
|
||||
}
|
||||
grayCellIfTableNotEnabled(table, isSelected);
|
||||
|
||||
return this;
|
||||
}
|
||||
}
|
@ -139,8 +139,31 @@ final class GlobalListSettingsPanel extends javax.swing.JPanel implements Option
|
||||
@Override
|
||||
public void addPropertyChangeListener(PropertyChangeListener l) {
|
||||
super.addPropertyChangeListener(l);
|
||||
listsManagementPanel.addPropertyChangeListener(l);
|
||||
editListPanel.addPropertyChangeListener(l);
|
||||
/*
|
||||
* There is at least one look and feel library that follows the bad
|
||||
* practice of calling overrideable methods in a constructor, e.g.:
|
||||
*
|
||||
* at
|
||||
* javax.swing.plaf.synth.SynthPanelUI.installListeners(SynthPanelUI.java:83)
|
||||
* at
|
||||
* javax.swing.plaf.synth.SynthPanelUI.installUI(SynthPanelUI.java:63)
|
||||
* at javax.swing.JComponent.setUI(JComponent.java:666) at
|
||||
* javax.swing.JPanel.setUI(JPanel.java:153) at
|
||||
* javax.swing.JPanel.updateUI(JPanel.java:126) at
|
||||
* javax.swing.JPanel.<init>(JPanel.java:86) at
|
||||
* javax.swing.JPanel.<init>(JPanel.java:109) at
|
||||
* javax.swing.JPanel.<init>(JPanel.java:117)
|
||||
*
|
||||
* When this happens, the following child components of this JPanel
|
||||
* subclass have not been constructed yet, since this panel's
|
||||
* constructor has not been called yet.
|
||||
*/
|
||||
if (null != listsManagementPanel) {
|
||||
listsManagementPanel.addPropertyChangeListener(l);
|
||||
}
|
||||
if (null != editListPanel) {
|
||||
editListPanel.addPropertyChangeListener(l);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -52,9 +52,34 @@ final class KeywordSearchGlobalSettingsPanel extends IngestModuleGlobalSettingsP
|
||||
@Override
|
||||
public void addPropertyChangeListener(PropertyChangeListener l) {
|
||||
super.addPropertyChangeListener(l);
|
||||
listsPanel.addPropertyChangeListener(l);
|
||||
languagesPanel.addPropertyChangeListener(l);
|
||||
generalPanel.addPropertyChangeListener(l);
|
||||
/*
|
||||
* There is at least one look and feel library that follows the bad
|
||||
* practice of calling overrideable methods in a constructor, e.g.:
|
||||
*
|
||||
* at
|
||||
* javax.swing.plaf.synth.SynthPanelUI.installListeners(SynthPanelUI.java:83)
|
||||
* at
|
||||
* javax.swing.plaf.synth.SynthPanelUI.installUI(SynthPanelUI.java:63)
|
||||
* at javax.swing.JComponent.setUI(JComponent.java:666) at
|
||||
* javax.swing.JPanel.setUI(JPanel.java:153) at
|
||||
* javax.swing.JPanel.updateUI(JPanel.java:126) at
|
||||
* javax.swing.JPanel.<init>(JPanel.java:86) at
|
||||
* javax.swing.JPanel.<init>(JPanel.java:109) at
|
||||
* javax.swing.JPanel.<init>(JPanel.java:117)
|
||||
*
|
||||
* When this happens, the following child components of this JPanel
|
||||
* subclass have not been constructed yet, since this panel's
|
||||
* constructor has not been called yet.
|
||||
*/
|
||||
if (null != listsPanel) {
|
||||
listsPanel.addPropertyChangeListener(l);
|
||||
}
|
||||
if (null != languagesPanel) {
|
||||
languagesPanel.addPropertyChangeListener(l);
|
||||
}
|
||||
if (null != generalPanel) {
|
||||
generalPanel.addPropertyChangeListener(l);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1,5 +1,5 @@
|
||||
#Updated by build script
|
||||
#Thu, 07 Sep 2017 13:53:53 -0400
|
||||
#Wed, 08 Nov 2017 17:45:11 -0500
|
||||
LBL_splash_window_title=Starting Autopsy
|
||||
SPLASH_HEIGHT=314
|
||||
SPLASH_WIDTH=538
|
||||
@ -8,4 +8,4 @@ SplashRunningTextBounds=0,289,538,18
|
||||
SplashRunningTextColor=0x0
|
||||
SplashRunningTextFontSize=19
|
||||
|
||||
currentVersion=Autopsy 4.4.2
|
||||
currentVersion=Autopsy 4.5.0
|
||||
|
@ -1,4 +1,4 @@
|
||||
#Updated by build script
|
||||
#Thu, 07 Sep 2017 13:53:53 -0400
|
||||
CTL_MainWindow_Title=Autopsy 4.4.2
|
||||
CTL_MainWindow_Title_No_Project=Autopsy 4.4.2
|
||||
#Wed, 08 Nov 2017 17:45:11 -0500
|
||||
CTL_MainWindow_Title=Autopsy 4.5.0
|
||||
CTL_MainWindow_Title_No_Project=Autopsy 4.5.0
|
||||
|
Loading…
x
Reference in New Issue
Block a user