Merge pull request #2248 from BasisOlivers/2200-2

Final UI for track ingest jobs.
This commit is contained in:
Richard Cordovano
2016-06-29 15:22:12 -04:00
committed by GitHub
17 changed files with 713 additions and 128 deletions
@@ -236,10 +236,6 @@ CasePropertiesForm.imagesTable.columnModel.title1=Remove
CasePropertiesForm.imagesTable.columnModel.title0=Path
LocalFilesPanel.jButton1.text=Change
LocalFilesPanel.displayNameLabel.text=Logical File Set Display Name: Default
CaseInformationPanel.jPanel1.TabConstraints.tabTitle=tab1
CasePropertiesForm.caseNumberField.text=
CasePropertiesForm.examinerField.text=
CasePropertiesForm.crDateField.text=
CasePropertiesForm.caseDirField.text=
CasePropertiesForm.caseTypeField.text=
CasePropertiesForm.dbNameField.text=
IngestJobInfoPanel.jLabel1.text=Ingest Modules
IngestJobInfoPanel.jLabel2.text=Ingest Jobs
CaseInformationPanel.closeButton.text=Close
@@ -25,7 +25,7 @@
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jPanel1" min="-2" max="-2" attributes="0"/>
<Component id="jPanel1" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
@@ -35,14 +35,21 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="tabbedPane" max="32767" attributes="0"/>
<Component id="tabbedPane" pref="709" max="32767" attributes="0"/>
<Group type="102" alignment="1" attributes="0">
<EmptySpace max="32767" attributes="0"/>
<Component id="closeButton" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="5" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<Component id="tabbedPane" pref="228" max="32767" attributes="0"/>
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Component id="tabbedPane" pref="223" max="32767" attributes="0"/>
<EmptySpace type="unrelated" min="-2" max="-2" attributes="0"/>
<Component id="closeButton" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="5" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@@ -57,6 +64,16 @@
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout"/>
</Container>
<Component class="javax.swing.JButton" name="closeButton">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/casemodule/Bundle.properties" key="CaseInformationPanel.closeButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="closeButtonActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Container>
</SubComponents>
@@ -1,45 +1,75 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
* Autopsy Forensic Browser
*
* Copyright 2011-2016 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.casemodule;
import java.awt.event.ActionListener;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import javax.swing.event.ChangeEvent;
import org.openide.util.NbBundle.Messages;
/**
*
* @author oliver
* Panel for displaying the case information, including both case details and
* ingest job history.
*/
public class CaseInformationPanel extends javax.swing.JPanel {
class CaseInformationPanel extends javax.swing.JPanel {
private static final Logger logger = Logger.getLogger(CaseInformationPanel.class.getName());
/**
* Creates new form CaseInformationPanel
*/
public CaseInformationPanel() {
CaseInformationPanel() {
initComponents();
customizeComponents();
}
@Messages({"CaseInformationPanel.caseDetails.header=Case Details"})
@Messages({"CaseInformationPanel.caseDetails.header=Case Details",
"CaseInformationPanel.ingestJobInfo.header=Ingest History",
"CaseInformationPanel.loadMetadataFail.message=Failed to load case metadata.",
"CaseInformationPanel.loadMetadataFail.title=Metadata load failure",})
private void customizeComponents() {
try {
Case currentCase = Case.getCurrentCase();
String crDate = currentCase.getCreatedDate();
String caseDir = currentCase.getCaseDirectory();
// put the image paths information into hashmap
Map<Long, String> imgPaths = Case.getImagePaths(currentCase.getSleuthkitCase());
CasePropertiesForm cpf = new CasePropertiesForm(currentCase, crDate, caseDir, imgPaths);
cpf.setSize(cpf.getPreferredSize());
this.tabbedPane.addTab(Bundle.CaseInformationPanel_caseDetails_header(), cpf);
this.tabbedPane.addTab(Bundle.CaseInformationPanel_ingestJobInfo_header(), new IngestJobInfoPanel());
this.tabbedPane.addChangeListener((ChangeEvent e) -> {
tabbedPane.getSelectedComponent().setSize(tabbedPane.getSelectedComponent().getPreferredSize());
});
} catch (CaseMetadata.CaseMetadataException ex) {
//TOLOG
logger.log(Level.SEVERE, "Failed to load case metadata.", ex);
JOptionPane.showMessageDialog(null, Bundle.IngestJobInfoPanel_loadIngestJob_error_text(), Bundle.IngestJobInfoPanel_loadIngestJob_error_title(), JOptionPane.ERROR_MESSAGE);
}
}
void addCloseButtonAction(ActionListener action) {
this.closeButton.addActionListener(action);
}
/**
* 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
@@ -51,20 +81,34 @@ public class CaseInformationPanel extends javax.swing.JPanel {
jPanel1 = new javax.swing.JPanel();
tabbedPane = new javax.swing.JTabbedPane();
closeButton = new javax.swing.JButton();
tabbedPane.setPreferredSize(new java.awt.Dimension(420, 200));
org.openide.awt.Mnemonics.setLocalizedText(closeButton, org.openide.util.NbBundle.getMessage(CaseInformationPanel.class, "CaseInformationPanel.closeButton.text")); // NOI18N
closeButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
closeButtonActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(tabbedPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(tabbedPane, javax.swing.GroupLayout.DEFAULT_SIZE, 709, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(closeButton)
.addGap(5, 5, 5))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addComponent(tabbedPane, javax.swing.GroupLayout.DEFAULT_SIZE, 228, Short.MAX_VALUE)
.addGap(0, 0, 0))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(tabbedPane, javax.swing.GroupLayout.DEFAULT_SIZE, 223, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(closeButton)
.addGap(5, 5, 5))
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
@@ -78,12 +122,17 @@ public class CaseInformationPanel extends javax.swing.JPanel {
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
}// </editor-fold>//GEN-END:initComponents
private void closeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_closeButtonActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_closeButtonActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton closeButton;
private javax.swing.JPanel jPanel1;
private javax.swing.JTabbedPane tabbedPane;
// End of variables declaration//GEN-END:variables
@@ -20,6 +20,9 @@ package org.sleuthkit.autopsy.casemodule;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.logging.Level;
import javax.swing.Action;
import javax.swing.JDialog;
@@ -27,6 +30,7 @@ import javax.swing.JFrame;
import org.openide.util.HelpCtx;
import org.openide.util.NbBundle;
import org.openide.util.actions.CallableSystemAction;
import org.openide.windows.WindowManager;
import org.sleuthkit.autopsy.coreutils.Logger;
/**
@@ -46,6 +50,12 @@ final class CasePropertiesAction extends CallableSystemAction {
CasePropertiesAction() {
putValue(Action.NAME, NbBundle.getMessage(CasePropertiesAction.class, "CTL_CasePropertiesAction")); // put the action Name
this.setEnabled(false);
Case.addEventSubscriber(Case.Events.CURRENT_CASE.toString(), new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
popUpWindow = null;
}
});
}
/**
@@ -54,31 +64,34 @@ final class CasePropertiesAction extends CallableSystemAction {
*/
@Override
public void performAction() {
try {
if (popUpWindow == null) {
// create the popUp window for it
String title = NbBundle.getMessage(this.getClass(), "CasePropertiesAction.window.title");
final JFrame frame = new JFrame(title);
popUpWindow = new JDialog(frame, title, false); // to make the popUp Window to be modal
popUpWindow = new JDialog((JFrame) WindowManager.getDefault().getMainWindow(), title, false);
try {
// create the case properties form
CaseInformationPanel caseInformationPanel = new CaseInformationPanel();
CaseInformationPanel caseInformationPanel = new CaseInformationPanel();
caseInformationPanel.addCloseButtonAction((ActionEvent e) -> {
popUpWindow.dispose();
});
// add the case properties form / panel to the popup window
popUpWindow.add(caseInformationPanel);
popUpWindow.setResizable(true);
popUpWindow.pack();
popUpWindow.add(caseInformationPanel);
popUpWindow.setResizable(true);
popUpWindow.pack();
// set the location of the popUp Window on the center of the screen
Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize();
double w = popUpWindow.getSize().getWidth();
double h = popUpWindow.getSize().getHeight();
popUpWindow.setLocation((int) ((screenDimension.getWidth() - w) / 2), (int) ((screenDimension.getHeight() - h) / 2));
// set the location of the popUp Window on the center of the screen
Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize();
double w = popUpWindow.getSize().getWidth();
double h = popUpWindow.getSize().getHeight();
popUpWindow.setLocation((int) ((screenDimension.getWidth() - w) / 2), (int) ((screenDimension.getHeight() - h) / 2));
popUpWindow.setVisible(true);
} catch (Exception ex) {
Logger.getLogger(CasePropertiesAction.class.getName()).log(Level.WARNING, "Error displaying Case Properties window.", ex); //NON-NLS
popUpWindow.setVisible(true);
} catch (Exception ex) {
Logger.getLogger(CasePropertiesAction.class.getName()).log(Level.WARNING, "Error displaying Case Properties window.", ex); //NON-NLS
}
}
popUpWindow.setVisible(true);
popUpWindow.toFront();
}
/**
@@ -126,9 +126,9 @@
<Component id="caseDirField" max="32767" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="caseTypeField" alignment="0" min="-2" pref="14" max="-2" attributes="0"/>
<Component id="lbDbType" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="lbDbType" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
@@ -283,31 +283,13 @@
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="caseNumberField">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/casemodule/Bundle.properties" key="CasePropertiesForm.caseNumberField.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="examinerField">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/casemodule/Bundle.properties" key="CasePropertiesForm.examinerField.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="crDateField">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/casemodule/Bundle.properties" key="CasePropertiesForm.crDateField.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="caseDirField">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/casemodule/Bundle.properties" key="CasePropertiesForm.caseDirField.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[25, 14]"/>
</Property>
@@ -315,9 +297,6 @@
</Component>
<Component class="javax.swing.JLabel" name="dbNameField">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/casemodule/Bundle.properties" key="CasePropertiesForm.dbNameField.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[25, 14]"/>
</Property>
@@ -325,9 +304,6 @@
</Component>
<Component class="javax.swing.JLabel" name="caseTypeField">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/casemodule/Bundle.properties" key="CasePropertiesForm.caseTypeField.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[1, 0]"/>
</Property>
@@ -196,19 +196,10 @@ class CasePropertiesForm extends javax.swing.JPanel {
lbDbName.setFont(lbDbName.getFont().deriveFont(lbDbName.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
lbDbName.setText(org.openide.util.NbBundle.getMessage(CasePropertiesForm.class, "CasePropertiesForm.lbDbName.text")); // NOI18N
caseNumberField.setText(org.openide.util.NbBundle.getMessage(CasePropertiesForm.class, "CasePropertiesForm.caseNumberField.text")); // NOI18N
examinerField.setText(org.openide.util.NbBundle.getMessage(CasePropertiesForm.class, "CasePropertiesForm.examinerField.text")); // NOI18N
crDateField.setText(org.openide.util.NbBundle.getMessage(CasePropertiesForm.class, "CasePropertiesForm.crDateField.text")); // NOI18N
caseDirField.setText(org.openide.util.NbBundle.getMessage(CasePropertiesForm.class, "CasePropertiesForm.caseDirField.text")); // NOI18N
caseDirField.setMinimumSize(new java.awt.Dimension(25, 14));
dbNameField.setText(org.openide.util.NbBundle.getMessage(CasePropertiesForm.class, "CasePropertiesForm.dbNameField.text")); // NOI18N
dbNameField.setMinimumSize(new java.awt.Dimension(25, 14));
caseTypeField.setText(org.openide.util.NbBundle.getMessage(CasePropertiesForm.class, "CasePropertiesForm.caseTypeField.text")); // NOI18N
caseTypeField.setMaximumSize(new java.awt.Dimension(1, 0));
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
@@ -276,7 +267,7 @@ class CasePropertiesForm extends javax.swing.JPanel {
.addComponent(caseDirLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(caseDirField, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(caseTypeField, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(lbDbType))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
</AuxValues>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace min="-2" pref="15" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
<Component id="jScrollPane1" pref="485" max="32767" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="8" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jScrollPane2" min="-2" pref="254" max="-2" attributes="0"/>
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="8" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jScrollPane1" pref="162" max="32767" attributes="0"/>
<Component id="jScrollPane2" pref="0" max="32767" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="10" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="javax.swing.JScrollPane" name="jScrollPane1">
<Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="null"/>
</Property>
</Properties>
<AuxValues>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="javax.swing.JTable" name="ingestJobTable">
<Properties>
<Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="ingestJobTableModel" type="code"/>
</Property>
<Property name="columnModel" type="javax.swing.table.TableColumnModel" editor="org.netbeans.modules.form.editors2.TableColumnModelEditor">
<TableColumnModel selectionModel="1"/>
</Property>
<Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor">
<TableHeader reorderingAllowed="false" resizingAllowed="true"/>
</Property>
</Properties>
</Component>
</SubComponents>
</Container>
<Component class="javax.swing.JLabel" name="jLabel1">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/casemodule/Bundle.properties" key="IngestJobInfoPanel.jLabel1.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel2">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/casemodule/Bundle.properties" key="IngestJobInfoPanel.jLabel2.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
<Container class="javax.swing.JScrollPane" name="jScrollPane2">
<AuxValues>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="javax.swing.JTable" name="ingestModuleTable">
<Properties>
<Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="ingestModuleTableModel" type="code"/>
</Property>
<Property name="columnModel" type="javax.swing.table.TableColumnModel" editor="org.netbeans.modules.form.editors2.TableColumnModelEditor">
<TableColumnModel selectionModel="0"/>
</Property>
<Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor">
<TableHeader reorderingAllowed="true" resizingAllowed="true"/>
</Property>
</Properties>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Form>
@@ -0,0 +1,261 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2011-2016 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.casemodule;
import java.beans.PropertyChangeEvent;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import javax.swing.event.ListSelectionEvent;
import javax.swing.table.AbstractTableModel;
import org.openide.util.NbBundle.Messages;
import org.sleuthkit.autopsy.ingest.IngestManager;
import org.sleuthkit.datamodel.IngestJobInfo;
import org.sleuthkit.datamodel.IngestModuleInfo;
import org.sleuthkit.datamodel.SleuthkitCase;
import org.sleuthkit.datamodel.TskCoreException;
/**
* Panel for displaying ingest job history.
*/
public final class IngestJobInfoPanel extends javax.swing.JPanel {
private static final Logger logger = Logger.getLogger(IngestJobInfoPanel.class.getName());
private List<IngestJobInfo> ingestJobs;
private IngestJobTableModel ingestJobTableModel = new IngestJobTableModel();
private IngestModuleTableModel ingestModuleTableModel = new IngestModuleTableModel(null);
private final DateFormat datetimeFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
/**
* Creates new form IngestJobInfoPanel
*/
public IngestJobInfoPanel() {
initComponents();
customizeComponents();
}
@Messages({"IngestJobInfoPanel.loadIngestJob.error.text=Failed to load ingest jobs.",
"IngestJobInfoPanel.loadIngestJob.error.title=Load Failure"})
private void customizeComponents() {
refresh();
this.ingestJobTable.getSelectionModel().addListSelectionListener((ListSelectionEvent e) -> {
this.ingestModuleTableModel = new IngestModuleTableModel(this.ingestJobs.get(ingestJobTable.getSelectedRow()));
this.ingestModuleTable.setModel(this.ingestModuleTableModel);
});
IngestManager.getInstance().addIngestJobEventListener((PropertyChangeEvent evt) -> {
if (evt.getPropertyName().equals(IngestManager.IngestJobEvent.STARTED.toString())
|| evt.getPropertyName().equals(IngestManager.IngestJobEvent.CANCELLED.toString())
|| evt.getPropertyName().equals(IngestManager.IngestJobEvent.COMPLETED.toString())) {
refresh();
}
});
}
private void refresh() {
SleuthkitCase skCase = Case.getCurrentCase().getSleuthkitCase();
try {
List<IngestJobInfo> ingestJobs = skCase.getIngestJobs();
this.ingestJobs = ingestJobs;
this.repaint();
} catch (TskCoreException ex) {
logger.log(Level.SEVERE, "Failed to load ingest jobs.", ex);
JOptionPane.showMessageDialog(null, Bundle.IngestJobInfoPanel_loadIngestJob_error_text(), Bundle.IngestJobInfoPanel_loadIngestJob_error_title(), JOptionPane.ERROR_MESSAGE);
}
}
@Messages({"IngestJobInfoPanel.IngestJobTableModel.DataSource.header=Data Source",
"IngestJobInfoPanel.IngestJobTableModel.StartTime.header=Start Time",
"IngestJobInfoPanel.IngestJobTableModel.EndTime.header=End Time",
"IngestJobInfoPanel.IngestJobTableModel.IngestStatus.header=Ingest Status"})
private class IngestJobTableModel extends AbstractTableModel {
private List<String> columnHeaders = new ArrayList<>();
IngestJobTableModel() {
columnHeaders.add(Bundle.IngestJobInfoPanel_IngestJobTableModel_DataSource_header());
columnHeaders.add(Bundle.IngestJobInfoPanel_IngestJobTableModel_StartTime_header());
columnHeaders.add(Bundle.IngestJobInfoPanel_IngestJobTableModel_EndTime_header());
columnHeaders.add(Bundle.IngestJobInfoPanel_IngestJobTableModel_IngestStatus_header());
}
@Override
public int getRowCount() {
return ingestJobs.size();
}
@Override
public int getColumnCount() {
return columnHeaders.size();
}
@Override
public Object getValueAt(int rowIndex, int columnIndex) {
IngestJobInfo currIngestJob = ingestJobs.get(rowIndex);
SleuthkitCase skCase = Case.getCurrentCase().getSleuthkitCase();
if (columnIndex == 0) {
try {
return skCase.getContentById(currIngestJob.getObjectId()).getName();
} catch (TskCoreException ex) {
logger.log(Level.SEVERE, "Failed to get content from db", ex);
return "";
}
} else if (columnIndex == 1) {
return datetimeFormat.format(currIngestJob.getStartDateTime());
} else if (columnIndex == 2) {
Date endDate = currIngestJob.getEndDateTime();
if (endDate.getTime() == 0) {
return "N/A";
}
return datetimeFormat.format(currIngestJob.getEndDateTime());
} else if (columnIndex == 3) {
return currIngestJob.getStatus().getDisplayName();
}
return null;
}
@Override
public String getColumnName(int column) {
return columnHeaders.get(column);
}
}
@Messages({"IngestJobInfoPanel.IngestModuleTableModel.ModuleName.header=Module Name",
"IngestJobInfoPanel.IngestModuleTableModel.ModuleVersion.header=Module Version"})
private class IngestModuleTableModel extends AbstractTableModel {
private List<String> columnHeaders = new ArrayList<>();
private IngestJobInfo currJob;
IngestModuleTableModel(IngestJobInfo currJob) {
columnHeaders.add(Bundle.IngestJobInfoPanel_IngestModuleTableModel_ModuleName_header());
columnHeaders.add(Bundle.IngestJobInfoPanel_IngestModuleTableModel_ModuleVersion_header());
this.currJob = currJob;
}
@Override
public int getRowCount() {
if (currJob == null) {
return 0;
}
return currJob.getIngestModuleInfo().size();
}
@Override
public int getColumnCount() {
return columnHeaders.size();
}
@Override
public Object getValueAt(int rowIndex, int columnIndex) {
if (currJob != null) {
IngestModuleInfo currIngestModule = currJob.getIngestModuleInfo().get(rowIndex);
if (columnIndex == 0) {
return currIngestModule.getDisplayName();
} else if (columnIndex == 1) {
return currIngestModule.getVersion();
}
return null;
}
return null;
}
@Override
public String getColumnName(int column) {
return columnHeaders.get(column);
}
}
/**
* 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
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jScrollPane1 = new javax.swing.JScrollPane();
ingestJobTable = new javax.swing.JTable();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jScrollPane2 = new javax.swing.JScrollPane();
ingestModuleTable = new javax.swing.JTable();
jScrollPane1.setBorder(null);
ingestJobTable.setModel(ingestJobTableModel);
ingestJobTable.getTableHeader().setReorderingAllowed(false);
jScrollPane1.setViewportView(ingestJobTable);
ingestJobTable.getColumnModel().getSelectionModel().setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(IngestJobInfoPanel.class, "IngestJobInfoPanel.jLabel1.text")); // NOI18N
org.openide.awt.Mnemonics.setLocalizedText(jLabel2, org.openide.util.NbBundle.getMessage(IngestJobInfoPanel.class, "IngestJobInfoPanel.jLabel2.text")); // NOI18N
ingestModuleTable.setModel(ingestModuleTableModel);
jScrollPane2.setViewportView(ingestModuleTable);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(15, 15, 15)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel2)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 485, Short.MAX_VALUE))
.addGap(8, 8, 8)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 254, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel1))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(8, 8, 8)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1)
.addComponent(jLabel2))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 162, Short.MAX_VALUE)
.addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
.addGap(10, 10, 10))
);
}// </editor-fold>//GEN-END:initComponents
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JTable ingestJobTable;
private javax.swing.JTable ingestModuleTable;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JScrollPane jScrollPane2;
// End of variables declaration//GEN-END:variables
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 897 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

@@ -114,3 +114,4 @@ IngestJobSettingsPanel.globalSettingsButton.text=Global Settings
gest
IngestJobSettingsPanel.globalSettingsButton.actionCommand=Advanced
IngestJobSettingsPanel.globalSettingsButton.text=Global Settings
IngestJobSettingsPanel.pastJobsButton.text=View Ingest History
@@ -34,44 +34,46 @@
<Group type="102" attributes="0">
<EmptySpace min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="modulesScrollPane" pref="256" max="32767" attributes="1"/>
<Group type="102" attributes="0">
<Component id="modulesScrollPane" pref="271" max="32767" attributes="1"/>
<EmptySpace min="-2" pref="10" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="24" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="processUnallocCheckbox" min="-2" max="-2" attributes="0"/>
<Group type="102" attributes="0">
<Component id="jButtonSelectAll" min="-2" pref="86" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="1" max="-2" attributes="0">
<Component id="jButtonSelectAll" max="32767" attributes="0"/>
<Component id="pastJobsButton" max="32767" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="5" max="-2" attributes="0"/>
<Component id="jButtonDeselectAll" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace min="-2" pref="32" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</Group>
<Component id="jPanel1" pref="324" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<EmptySpace min="-2" max="-2" attributes="0"/>
<Component id="jPanel1" pref="343" max="32767" attributes="0"/>
<EmptySpace min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<EmptySpace min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Group type="102" attributes="0">
<Component id="modulesScrollPane" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<EmptySpace min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jButtonDeselectAll" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jButtonSelectAll" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jButtonDeselectAll" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" max="-2" attributes="0"/>
<Component id="pastJobsButton" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" max="-2" attributes="0"/>
<Component id="processUnallocCheckbox" min="-2" pref="23" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<Group type="102" attributes="0">
<Component id="jPanel1" pref="428" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
@@ -135,8 +137,8 @@
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="descriptionLabel" pref="302" max="32767" attributes="0"/>
<Component id="jScrollPane1" alignment="1" max="32767" attributes="0"/>
<Component id="descriptionLabel" pref="0" max="32767" attributes="0"/>
<Component id="jScrollPane1" alignment="1" pref="321" max="32767" attributes="0"/>
<Group type="102" alignment="1" attributes="0">
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
<Component id="globalSettingsButton" min="-2" max="-2" attributes="0"/>
@@ -244,5 +246,15 @@
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="processUnallocCheckboxActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="pastJobsButton">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/ingest/Bundle.properties" key="IngestJobSettingsPanel.pastJobsButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="pastJobsButtonActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Form>
@@ -19,22 +19,37 @@
package org.sleuthkit.autopsy.ingest;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JTable;
import javax.swing.ListSelectionModel;
import javax.swing.SwingUtilities;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import javax.swing.table.AbstractTableModel;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.TableColumn;
import org.openide.util.NbBundle.Messages;
import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.casemodule.IngestJobInfoPanel;
import org.sleuthkit.autopsy.corecomponents.AdvancedConfigurationDialog;
import org.sleuthkit.datamodel.Content;
import org.sleuthkit.datamodel.IngestJobInfo;
import org.sleuthkit.datamodel.IngestModuleInfo;
import org.sleuthkit.datamodel.SleuthkitCase;
import org.sleuthkit.datamodel.TskCoreException;
/**
* User interface component to allow a user to make ingest job settings.
@@ -44,6 +59,10 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel {
private final IngestJobSettings settings;
private final List<IngestModuleModel> modules;
private IngestModuleModel selectedModule;
private IngestModulesTableModel tableModel = new IngestModulesTableModel();
private List<IngestJobInfo> ingestJobs;
private List<Content> dataSources;
private static final Logger logger = Logger.getLogger(IngestJobSettingsPanel.class.getName());
/**
* Construct a user interface component to allow a user to make ingest job
@@ -57,6 +76,39 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel {
for (IngestModuleTemplate moduleTemplate : settings.getIngestModuleTemplates()) {
this.modules.add(new IngestModuleModel(moduleTemplate));
}
SleuthkitCase skCase = Case.getCurrentCase().getSleuthkitCase();
try {
ingestJobs = skCase.getIngestJobs();
} catch (TskCoreException ex) {
logger.log(Level.SEVERE, "Failed to load ingest job information.", ex);
ingestJobs = new ArrayList<>();
}
this.dataSources = new ArrayList<>();
initComponents();
customizeComponents();
}
/**
* Construct a user interface component to allow a user to make ingest job
* settings.
*
* @param settings The initial settings for the ingest job.
* @param dataSources The data sources ingest is being run on.
*/
IngestJobSettingsPanel(IngestJobSettings settings, List<Content> dataSources) {
this.settings = settings;
this.modules = new ArrayList<>();
for (IngestModuleTemplate moduleTemplate : settings.getIngestModuleTemplates()) {
this.modules.add(new IngestModuleModel(moduleTemplate));
}
SleuthkitCase skCase = Case.getCurrentCase().getSleuthkitCase();
try {
ingestJobs = skCase.getIngestJobs();
} catch (TskCoreException ex) {
logger.log(Level.SEVERE, "Failed to load ingest job information.", ex);
ingestJobs = new ArrayList<>();
}
this.dataSources = dataSources;
initComponents();
customizeComponents();
}
@@ -82,7 +134,7 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel {
@Messages({"IngestJobSettingsPanel.noPerRunSettings=The selected module has no per-run settings."})
private void customizeComponents() {
modulesTable.setModel(new IngestModulesTableModel());
modulesTable.setModel(tableModel);
modulesTable.setTableHeader(null);
modulesTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
@@ -127,6 +179,10 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel {
});
modulesTable.setRowSelectionInterval(0, 0);
processUnallocCheckbox.setSelected(this.settings.getProcessUnallocatedSpace());
this.modulesTable.getColumnModel().getColumn(0).setMaxWidth(22);
this.modulesTable.getColumnModel().getColumn(1).setMaxWidth(20);
this.modulesTable.getColumnModel().getColumn(1).setMinWidth(20);
modulesTable.setRowHeight(20);
}
/**
@@ -150,6 +206,7 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel {
jButtonSelectAll = new javax.swing.JButton();
jButtonDeselectAll = new javax.swing.JButton();
processUnallocCheckbox = new javax.swing.JCheckBox();
pastJobsButton = new javax.swing.JButton();
setMaximumSize(new java.awt.Dimension(5750, 3000));
setMinimumSize(new java.awt.Dimension(0, 0));
@@ -201,8 +258,8 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel {
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(descriptionLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 302, Short.MAX_VALUE)
.addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(descriptionLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
.addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 321, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
.addComponent(globalSettingsButton)))
@@ -244,6 +301,13 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel {
}
});
pastJobsButton.setText(org.openide.util.NbBundle.getMessage(IngestJobSettingsPanel.class, "IngestJobSettingsPanel.pastJobsButton.text")); // NOI18N
pastJobsButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
pastJobsButtonActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
@@ -251,19 +315,19 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel {
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(modulesScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 256, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup()
.addComponent(modulesScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 271, Short.MAX_VALUE)
.addGap(10, 10, 10))
.addGroup(layout.createSequentialGroup()
.addGap(24, 24, 24)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(processUnallocCheckbox)
.addGroup(layout.createSequentialGroup()
.addComponent(jButtonSelectAll, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(jButtonSelectAll, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(pastJobsButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGap(5, 5, 5)
.addComponent(jButtonDeselectAll)))
.addGap(32, 32, 32)))
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 324, Short.MAX_VALUE)
.addGap(0, 0, Short.MAX_VALUE)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 343, Short.MAX_VALUE)
.addContainerGap())
);
layout.setVerticalGroup(
@@ -275,11 +339,13 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel {
.addComponent(modulesScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButtonDeselectAll)
.addComponent(jButtonSelectAll))
.addComponent(jButtonSelectAll)
.addComponent(jButtonDeselectAll))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(pastJobsButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(processUnallocCheckbox, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addGroup(layout.createSequentialGroup()
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 428, Short.MAX_VALUE)
.addContainerGap())))
);
@@ -319,6 +385,20 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel {
private void processUnallocCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_processUnallocCheckboxActionPerformed
this.settings.setProcessUnallocatedSpace(processUnallocCheckbox.isSelected());
}//GEN-LAST:event_processUnallocCheckboxActionPerformed
@Messages({"IngestJobSettingsPanel.pastJobsButton.action.frame.title=Ingest History"})
private void pastJobsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_pastJobsButtonActionPerformed
JDialog topFrame = (JDialog) SwingUtilities.getWindowAncestor(this);
JDialog dialog = new JDialog(topFrame, Bundle.IngestJobSettingsPanel_pastJobsButton_action_frame_title(), false);
IngestJobInfoPanel ingestInfo = new IngestJobInfoPanel();
dialog.add(ingestInfo);
Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize();
double w = dialog.getSize().getWidth();
double h = dialog.getSize().getHeight();
dialog.setLocation((int) ((screenDimension.getWidth() - w) / 2), (int) ((screenDimension.getHeight() - h) / 2));
dialog.setResizable(true);
dialog.pack();
dialog.setVisible(true);
}//GEN-LAST:event_pastJobsButtonActionPerformed
private void SelectAllModules(boolean set) {
for (IngestModuleModel module : modules) {
@@ -338,6 +418,7 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel {
private javax.swing.JSeparator jSeparator2;
private javax.swing.JScrollPane modulesScrollPane;
private javax.swing.JTable modulesTable;
private javax.swing.JButton pastJobsButton;
private javax.swing.JCheckBox processUnallocCheckbox;
private javax.swing.ButtonGroup timeGroup;
// End of variables declaration//GEN-END:variables
@@ -410,6 +491,9 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel {
*/
private class IngestModulesTableModel extends AbstractTableModel {
ImageIcon warningIcon = new ImageIcon("Core\\src\\org\\sleuthkit\\autopsy\\images\\warning_triangle.png");
ImageIcon infoIcon = new ImageIcon("Core\\src\\org\\sleuthkit\\autopsy\\images\\information-frame.png");
@Override
public int getRowCount() {
return modules.size();
@@ -417,7 +501,7 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel {
@Override
public int getColumnCount() {
return 2;
return 3;
}
@Override
@@ -425,6 +509,8 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel {
IngestModuleModel module = modules.get(rowIndex);
if (columnIndex == 0) {
return module.isEnabled();
} else if (columnIndex == 1) {
return getIcon(module);
} else {
return module.getName();
}
@@ -446,12 +532,68 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel {
public Class<?> getColumnClass(int c) {
return getValueAt(0, c).getClass();
}
private ImageIcon getIcon(IngestModuleModel module) {
if (dataSources.isEmpty()) {
return null;
}
boolean previousVersionRun = false;
for (IngestJobInfo ingestJob : ingestJobs) {
if (ingestJob.getStatus() != IngestJobInfo.IngestJobStatusType.COMPLETED) {
continue;
}
long objectId = ingestJob.getObjectId();
boolean isSameDataSource = false;
for (Content dataSource : dataSources) {
isSameDataSource = isSameDataSource || dataSource.getId() == objectId;
}
if (isSameDataSource) {
IngestModuleFactory factory = module.getIngestModuleTemplate().getModuleFactory();
if (factory.isDataSourceIngestModuleFactory()) {
String uniqueName = FactoryClassNameNormalizer.normalize(factory.getClass().getCanonicalName()) + "-"
+ factory.getModuleDisplayName() + "-"
+ IngestModuleInfo.IngestModuleType.DATA_SOURCE_LEVEL.toString() + "-"
+ factory.getModuleVersionNumber();
for (IngestModuleInfo ingestModuleInfo : ingestJob.getIngestModuleInfo()) {
boolean sameModule = ingestModuleInfo.getUniqueName().equals(uniqueName);
if (sameModule) {
if (ingestModuleInfo.getVersion().equals(module.getIngestModuleTemplate().getModuleFactory().getModuleVersionNumber())) {
return warningIcon;
}
}
previousVersionRun = previousVersionRun || sameModule;
}
}
if (factory.isFileIngestModuleFactory()) {
String uniqueName = FactoryClassNameNormalizer.normalize(factory.getClass().getCanonicalName()) + "-"
+ factory.getModuleDisplayName() + "-"
+ IngestModuleInfo.IngestModuleType.FILE_LEVEL.toString() + "-"
+ factory.getModuleVersionNumber();
for (IngestModuleInfo ingestModuleInfo : ingestJob.getIngestModuleInfo()) {
boolean sameModule = ingestModuleInfo.getUniqueName().equals(uniqueName);
if (sameModule) {
if (ingestModuleInfo.getVersion().equals(module.getIngestModuleTemplate().getModuleFactory().getModuleVersionNumber())) {
return warningIcon;
}
}
previousVersionRun = previousVersionRun || sameModule;
}
}
}
}
if (previousVersionRun) {
return infoIcon;
}
return null;
}
}
/**
* Custom cell renderer to create tool tips displaying ingest module
* descriptions.
*/
@Messages({"IngestJobSettingsPanel.IngestModulesTableRenderer.warning.message=This ingest module has been run before on this data source.",
"IngestJobSettingsPanel.IngestModulesTableRenderer.info.message=A previous version of this ingest module has been run before on this data source."})
private class IngestModulesTableRenderer extends DefaultTableCellRenderer {
List<String> tooltips = new ArrayList<>();
@@ -465,8 +607,17 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel {
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
if (1 == column) {
if (2 == column) {
setIcon(null);
setToolTipText(tooltips.get(row));
} else if (1 == column) {
setIcon((Icon) value);
setText("");
if (tableModel.warningIcon.equals(value)) {
setToolTipText(Bundle.IngestJobSettingsPanel_IngestModulesTableRenderer_warning_message());
} else if (tableModel.infoIcon.equals(value)) {
setToolTipText(Bundle.IngestJobSettingsPanel_IngestModulesTableRenderer_info_message());
}
}
return this;
}
@@ -67,6 +67,9 @@
</Property>
<Property name="autoResizeMode" type="int" value="0"/>
<Property name="autoscrolls" type="boolean" value="false"/>
<Property name="columnModel" type="javax.swing.table.TableColumnModel" editor="org.netbeans.modules.form.editors2.TableColumnModelEditor">
<TableColumnModel selectionModel="0"/>
</Property>
<Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor">
<Color id="Hand Cursor"/>
</Property>
@@ -35,10 +35,9 @@ import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.logging.Level;
import javax.swing.JLabel;
import javax.swing.JPanel;
import org.openide.util.NbBundle;
import org.sleuthkit.autopsy.coreutils.Logger;
import javax.swing.JTable;
import javax.swing.ListSelectionModel;
import javax.swing.SwingConstants;
@@ -49,10 +48,12 @@ import javax.swing.event.TableModelListener;
import javax.swing.table.AbstractTableModel;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.TableCellRenderer;
import org.sleuthkit.autopsy.ingest.IngestMessage.*;
import org.sleuthkit.datamodel.BlackboardArtifact;
import org.openide.util.NbBundle;
import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
import java.util.logging.Level;
import org.sleuthkit.autopsy.ingest.IngestMessage.*;
import org.sleuthkit.autopsy.ingest.IngestMessage.MessageType;
import org.sleuthkit.datamodel.BlackboardArtifact;
/**
* Notification window showing messages from modules to user
@@ -26,17 +26,14 @@ import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.image.BufferedImage;
import java.util.ArrayList;
import java.util.List;
import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import org.openide.util.NbBundle;
import org.openide.windows.WindowManager;
import org.sleuthkit.autopsy.ingest.IngestJobSettings.IngestType;
@@ -110,7 +107,7 @@ public final class RunIngestModulesDialog extends JDialog {
*/
IngestJobSettings ingestJobSettings = new IngestJobSettings(RunIngestModulesDialog.class.getCanonicalName(), this.ingestType);
RunIngestModulesDialog.showWarnings(ingestJobSettings);
this.ingestJobSettingsPanel = new IngestJobSettingsPanel(ingestJobSettings);
this.ingestJobSettingsPanel = new IngestJobSettingsPanel(ingestJobSettings, dataSources);
setPreferredSize(this.ingestJobSettingsPanel.getPreferredSize());
add(this.ingestJobSettingsPanel, BorderLayout.CENTER);
@@ -21,12 +21,12 @@ package org.sleuthkit.autopsy.modules.fileextmismatch;
import org.openide.util.NbBundle;
import org.openide.util.lookup.ServiceProvider;
import org.sleuthkit.autopsy.coreutils.Version;
import org.sleuthkit.autopsy.ingest.IngestModuleFactoryAdapter;
import org.sleuthkit.autopsy.ingest.FileIngestModule;
import org.sleuthkit.autopsy.ingest.IngestModuleFactory;
import org.sleuthkit.autopsy.ingest.IngestModuleFactoryAdapter;
import org.sleuthkit.autopsy.ingest.IngestModuleGlobalSettingsPanel;
import org.sleuthkit.autopsy.ingest.IngestModuleIngestJobSettings;
import org.sleuthkit.autopsy.ingest.IngestModuleIngestJobSettingsPanel;
import org.sleuthkit.autopsy.ingest.IngestModuleGlobalSettingsPanel;
/**
* An factory that creates file ingest modules that detect mismatches between