diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CaseOpenAction.java b/Core/src/org/sleuthkit/autopsy/casemodule/CaseOpenAction.java
index 80f89c0fab..8a4f4b6c6f 100644
--- a/Core/src/org/sleuthkit/autopsy/casemodule/CaseOpenAction.java
+++ b/Core/src/org/sleuthkit/autopsy/casemodule/CaseOpenAction.java
@@ -37,16 +37,19 @@ import org.openide.DialogDisplayer;
import org.openide.NotifyDescriptor;
import org.sleuthkit.autopsy.coreutils.Logger;
import java.util.logging.Level;
+import org.openide.util.HelpCtx;
+import org.openide.util.actions.CallableSystemAction;
import org.sleuthkit.autopsy.ingest.IngestManager;
/**
* An action that opens an existing case.
*/
@ServiceProvider(service = CaseOpenAction.class)
-public final class CaseOpenAction implements ActionListener {
+public final class CaseOpenAction extends CallableSystemAction implements ActionListener {
private static final Logger logger = Logger.getLogger(CaseOpenAction.class.getName());
private static final String PROP_BASECASE = "LBL_BaseCase_PATH"; //NON-NLS
+ private static final long serialVersionUID = 1L;
private final JFileChooser fileChooser = new JFileChooser();
private final FileFilter caseMetadataFileFilter;
@@ -140,4 +143,18 @@ public final class CaseOpenAction implements ActionListener {
}).start();
}
}
+
+ @Override
+ public void performAction() {
+ }
+
+ @Override
+ public String getName() {
+ return NbBundle.getMessage(CaseOpenAction.class, "CTL_OpenAction");
+ }
+
+ @Override
+ public HelpCtx getHelpCtx() {
+ return HelpCtx.DEFAULT_HELP;
+ }
}
diff --git a/Experimental/manifest.mf b/Experimental/manifest.mf
index 62671108e7..80010b9686 100644
--- a/Experimental/manifest.mf
+++ b/Experimental/manifest.mf
@@ -1,6 +1,7 @@
Manifest-Version: 1.0
AutoUpdate-Show-In-Client: true
OpenIDE-Module: org.sleuthkit.autopsy.experimental
+OpenIDE-Module-Layer: org/sleuthkit/autopsy/experimental/autoingest/layer.xml
OpenIDE-Module-Localizing-Bundle: org/sleuthkit/autopsy/experimental/autoingest/Bundle.properties
OpenIDE-Module-Specification-Version: 1.0
diff --git a/Experimental/nbproject/project.xml b/Experimental/nbproject/project.xml
index de061ccc9d..0f79265597 100644
--- a/Experimental/nbproject/project.xml
+++ b/Experimental/nbproject/project.xml
@@ -39,6 +39,14 @@
9.8.1
+
+ org.openide.loaders
+
+
+
+ 7.63.2
+
+
org.openide.modules
diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestCaseOpenAction.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestCaseOpenAction.java
new file mode 100644
index 0000000000..aec567641d
--- /dev/null
+++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestCaseOpenAction.java
@@ -0,0 +1,99 @@
+/*
+ * Autopsy Forensic Browser
+ *
+ * Copyright 2015 Basis Technology Corp.
+ * Contact: carrier sleuthkit 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.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.logging.Level;
+import org.openide.util.HelpCtx;
+import org.openide.util.Lookup;
+import org.openide.util.NbBundle;
+import org.openide.util.actions.CallableSystemAction;
+import org.openide.util.actions.SystemAction;
+import org.sleuthkit.autopsy.casemodule.CaseCloseAction;
+import org.sleuthkit.autopsy.casemodule.CaseOpenAction;
+import org.sleuthkit.autopsy.coreutils.Logger;
+import org.sleuthkit.autopsy.casemodule.Case;
+import org.sleuthkit.autopsy.casemodule.StartupWindowProvider;
+import org.sleuthkit.autopsy.experimental.configuration.AutoIngestUserPreferences;
+
+final class AutoIngestCaseOpenAction extends CallableSystemAction implements ActionListener {
+
+ private static final Logger logger = Logger.getLogger(AutoIngestCaseOpenAction.class.getName());
+ private static final long serialVersionUID = 1L;
+
+ public AutoIngestCaseOpenAction() {
+ }
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+
+ AutoIngestUserPreferences.SelectedMode mode = AutoIngestUserPreferences.getMode();
+ switch (mode) {
+ case REVIEW:
+
+ if (Case.isCaseOpen()) {
+ /*
+ * In review mode, close the currently open case, if any, and
+ * then display the review mode cases panel. This can be
+ * accomplished by invoking CaseCloseAction because it calls
+ * StartupWindowProvider.getInstance().open() after it closes
+ * the current case.
+ */
+ SystemAction.get(CaseCloseAction.class).actionPerformed(e);
+ } else {
+ // no case is open, so show the startup window
+ StartupWindowProvider.getInstance().open();
+ }
+ break;
+
+ case AUTOMATED:
+ /*
+ * New case action is disabled in auto ingest mode.
+ */
+ break;
+
+ case STANDALONE:
+ /**
+ * In standalone mode, invoke default Autopsy version of CaseOpenAction.
+ */
+ Lookup.getDefault().lookup(CaseOpenAction.class).actionPerformed(e);
+ break;
+
+
+ default:
+ logger.log(Level.SEVERE, "Attempting to open case in unsupported mode {0}", mode.toString());
+ }
+ }
+
+ @Override
+ public void performAction() {
+ }
+
+ @Override
+ public String getName() {
+ return NbBundle.getMessage(AutoIngestCaseOpenAction.class, "CTL_OpenAction");
+ }
+
+ @Override
+ public HelpCtx getHelpCtx() {
+ return HelpCtx.DEFAULT_HELP;
+ }
+
+}
diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestDashboard.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestDashboard.java
index 6b858d5ed7..f0d19bdef3 100644
--- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestDashboard.java
+++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestDashboard.java
@@ -53,7 +53,12 @@ import org.netbeans.api.options.OptionsDisplayer;
import org.openide.DialogDisplayer;
import org.openide.LifecycleManager;
import org.openide.NotifyDescriptor;
+import org.openide.filesystems.FileObject;
+import org.openide.filesystems.FileUtil;
import org.openide.util.NbBundle;
+import org.openide.util.actions.CallableSystemAction;
+import org.sleuthkit.autopsy.casemodule.CaseNewAction;
+import org.sleuthkit.autopsy.casemodule.CaseOpenAction;
import org.sleuthkit.autopsy.core.ServicesMonitor;
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
import org.sleuthkit.autopsy.coreutils.NetworkUtils;
@@ -176,6 +181,8 @@ public final class AutoIngestDashboard extends JPanel implements Observer {
* controlling automated ingest for a single node within the cluster.
*/
private AutoIngestDashboard() {
+ disableUiMenuActions();
+
manager = AutoIngestManager.getInstance();
pendingTableModel = new DefaultTableModel(JobsTableModelColumns.headers, 0) {
@@ -217,6 +224,36 @@ public final class AutoIngestDashboard extends JPanel implements Observer {
*/
UIManager.put("PopupMenu.consumeEventOnClose", false);
}
+
+ private void disableUiMenuActions() {
+ /*
+ * Disable the new case action in auto ingest mode.
+ */
+ CallableSystemAction.get(CaseNewAction.class).setEnabled(false);
+
+ /*
+ * Disable the new case action in auto ingest mode.
+ */
+ CallableSystemAction.get(CaseOpenAction.class).setEnabled(false);
+ CallableSystemAction.get(AutoIngestCaseOpenAction.class).setEnabled(false);
+
+ /*
+ * Permanently delete the "Open Recent Cases" item in the "Case" menu.
+ * This is quite drastic, as it also affects Autopsy standalone mode on
+ * this machine, but we need to make sure a user can't open case in
+ * automated ingest mode. "Open Recent Cases" item can't be disabled via
+ * CallableSystemAction because of how it is defined in layer.xml, i.e.
+ * it is defined as "folder", not "file".
+ */
+ FileObject root = FileUtil.getConfigRoot();
+ FileObject openRecentCasesMenu = root.getFileObject("Menu/Case/OpenRecentCase");
+ if (openRecentCasesMenu != null) {
+ try {
+ openRecentCasesMenu.delete();
+ } catch (IOException ignore) {
+ }
+ }
+ }
/**
* Queries the services monitor and sets the text for the services status
diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/Bundle.properties b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/Bundle.properties
index 07362631c8..c119e136dd 100644
--- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/Bundle.properties
+++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/Bundle.properties
@@ -1,3 +1,4 @@
+CTL_OpenAction=Open Case...
AutoIngestDashboard.bnRefresh.text=&Refresh
AutoIngestDashboard.lbCompleted.text=Completed Jobs
AutoIngestDashboard.lbRunning.text=Running Jobs
@@ -218,7 +219,6 @@ SingleUserCaseImporter.FailedToComplete=Failed to complete processing of
SingleUserCaseImporter.CompletedBatch=Completed batch processing of
SingleUserCaseImporter.AbortingBatch=Aborting batch processing of
SingleUserCaseImporter.SourceImageMissing=. Source image missing for
-ReviewModeCasePanel.bnOptions.text=Op&tions
ReviewModeCasePanel.CaseHeaderText=Case
ReviewModeCasePanel.CreatedTimeHeaderText=Created Time
ReviewModeCasePanel.StatusIconHeaderText=Status
diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/ReviewModeCasePanel.form b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/ReviewModeCasePanel.form
index 545e7654f9..2756fa8da0 100644
--- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/ReviewModeCasePanel.form
+++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/ReviewModeCasePanel.form
@@ -33,8 +33,6 @@
-
-
@@ -63,7 +61,6 @@
-
@@ -236,15 +233,5 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/ReviewModeCasePanel.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/ReviewModeCasePanel.java
index 59cb071ffc..fc45308db7 100644
--- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/ReviewModeCasePanel.java
+++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/ReviewModeCasePanel.java
@@ -39,7 +39,6 @@ import javax.swing.table.TableColumn;
import org.sleuthkit.autopsy.casemodule.StartupWindowProvider;
import java.awt.Cursor;
import java.io.IOException;
-import org.netbeans.api.options.OptionsDisplayer;
import org.openide.windows.WindowManager;
import org.sleuthkit.autopsy.casemodule.CaseMetadata;
import org.sleuthkit.autopsy.experimental.autoingest.ReviewModeCaseManager.ReviewModeCaseManagerException;
@@ -385,7 +384,6 @@ public final class ReviewModeCasePanel extends JPanel {
rbDays = new javax.swing.JRadioButton();
rbGroupLabel = new javax.swing.JLabel();
bnShowLog = new javax.swing.JButton();
- bnOptions = new javax.swing.JButton();
setName("Completed Cases"); // NOI18N
@@ -492,13 +490,6 @@ public final class ReviewModeCasePanel extends JPanel {
}
});
- org.openide.awt.Mnemonics.setLocalizedText(bnOptions, org.openide.util.NbBundle.getMessage(ReviewModeCasePanel.class, "ReviewModeCasePanel.bnOptions.text")); // NOI18N
- bnOptions.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- bnOptionsActionPerformed(evt);
- }
- });
-
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
@@ -513,8 +504,6 @@ public final class ReviewModeCasePanel extends JPanel {
.addComponent(bnRefresh)
.addGap(18, 18, 18)
.addComponent(bnShowLog)
- .addGap(18, 18, 18)
- .addComponent(bnOptions)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(panelFilter, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(20, 20, 20))
@@ -536,8 +525,7 @@ public final class ReviewModeCasePanel extends JPanel {
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(bnOpen)
.addComponent(bnRefresh)
- .addComponent(bnShowLog)
- .addComponent(bnOptions))
+ .addComponent(bnShowLog))
.addGap(36, 36, 36))))
);
}// //GEN-END:initComponents
@@ -611,12 +599,6 @@ public final class ReviewModeCasePanel extends JPanel {
}
}//GEN-LAST:event_bnShowLogActionPerformed
- private void bnOptionsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bnOptionsActionPerformed
- setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
- OptionsDisplayer.getDefault().open();
- setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
- }//GEN-LAST:event_bnOptionsActionPerformed
-
private void casesTableMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_casesTableMouseClicked
if (evt.getClickCount() == 2) {
Path caseMetadataFilePath = Paths.get((String) caseTableModel.getValueAt(casesTable.getSelectedRow(),
@@ -628,7 +610,6 @@ public final class ReviewModeCasePanel extends JPanel {
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton bnOpen;
- private javax.swing.JButton bnOptions;
private javax.swing.JButton bnRefresh;
private javax.swing.JButton bnShowLog;
private javax.swing.JTable casesTable;
diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/layer.xml b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/layer.xml
new file mode 100644
index 0000000000..6711abd865
--- /dev/null
+++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/layer.xml
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/configuration/AutoIngestSettingsPanel.java b/Experimental/src/org/sleuthkit/autopsy/experimental/configuration/AutoIngestSettingsPanel.java
index fe8b81e853..78160ef17b 100644
--- a/Experimental/src/org/sleuthkit/autopsy/experimental/configuration/AutoIngestSettingsPanel.java
+++ b/Experimental/src/org/sleuthkit/autopsy/experimental/configuration/AutoIngestSettingsPanel.java
@@ -36,6 +36,7 @@ import java.awt.Dimension;
import java.nio.file.Paths;
import org.openide.util.ImageUtilities;
import javax.swing.JScrollPane;
+import javax.swing.SwingUtilities;
import org.sleuthkit.autopsy.coreutils.FileUtil;
import org.openide.windows.WindowManager;
import org.sleuthkit.autopsy.coreutils.Logger;
@@ -220,10 +221,12 @@ public class AutoIngestSettingsPanel extends javax.swing.JPanel {
needsSaving = true;
}
if (needsSaving) {
- JOptionPane.showMessageDialog(null,
- NbBundle.getMessage(AutoIngestSettingsPanel.class, "AutoIngestSettingsPanel.MustRestart"),
- NbBundle.getMessage(AutoIngestSettingsPanel.class, "AutoIngestSettingsPanel.restartRequiredLabel.text"),
- JOptionPane.WARNING_MESSAGE);
+ SwingUtilities.invokeLater(() -> {
+ JOptionPane.showMessageDialog(null,
+ NbBundle.getMessage(AutoIngestSettingsPanel.class, "AutoIngestSettingsPanel.MustRestart"),
+ NbBundle.getMessage(AutoIngestSettingsPanel.class, "AutoIngestSettingsPanel.restartRequiredLabel.text"),
+ JOptionPane.WARNING_MESSAGE);
+ });
}
AutoIngestUserPreferences.setMode(AutoIngestUserPreferences.SelectedMode.AUTOMATED);
@@ -240,10 +243,12 @@ public class AutoIngestSettingsPanel extends javax.swing.JPanel {
} else if (jRadioButtonReview.isSelected()) {
String thePath = AutoIngestUserPreferences.getAutoModeResultsFolder();
if (thePath != null && 0 != outputPathTextField.getText().compareTo(thePath)) {
- JOptionPane.showMessageDialog(null,
- NbBundle.getMessage(AutoIngestSettingsPanel.class, "AutoIngestSettingsPanel.MustRestart"),
- NbBundle.getMessage(AutoIngestSettingsPanel.class, "AutoIngestSettingsPanel.restartRequiredLabel.text"),
- JOptionPane.WARNING_MESSAGE);
+ SwingUtilities.invokeLater(() -> {
+ JOptionPane.showMessageDialog(null,
+ NbBundle.getMessage(AutoIngestSettingsPanel.class, "AutoIngestSettingsPanel.MustRestart"),
+ NbBundle.getMessage(AutoIngestSettingsPanel.class, "AutoIngestSettingsPanel.restartRequiredLabel.text"),
+ JOptionPane.WARNING_MESSAGE);
+ });
}
AutoIngestUserPreferences.setMode(AutoIngestUserPreferences.SelectedMode.REVIEW);