mirror of
https://github.com/elisspace/autopsy.git
synced 2026-09-03 14:30:01 +00:00
Merge pull request #6177 from kellykelly3/6689-support-for-reporting-profiles
6689 - Added command line support for using report profiles
This commit is contained in:
@@ -2,11 +2,16 @@ OpenIDE-Module-Name=CommandLineAutopsy
|
||||
OptionsCategory_Keywords_Command_Line_Ingest_Settings=Command Line Ingest Settings
|
||||
OptionsCategory_Keywords_General=Options
|
||||
OptionsCategory_Name_Command_Line_Ingest=Command Line Ingest
|
||||
CommandLinePanel.jLabel1.text=Ingest is running from command line
|
||||
CommandLinePanel.jLabel1.text=Running command line taks.
|
||||
CommandLineStartupWindow.title.text=Running in Command Line Mode
|
||||
CommandLineIngestSettingsPanel.bnEditIngestSettings.text=Configure Ingest
|
||||
CommandLineIngestSettingsPanel.bnEditIngestSettings.text=Configure
|
||||
CommandLineIngestSettingsPanel.bnEditReportSettings.actionCommand=Report Module Settings
|
||||
CommandLineIngestSettingsPanel.bnEditReportSettings.toolTipText=Report generation settings for the command line processing mode context.
|
||||
CommandLineIngestSettingsPanel.bnEditReportSettings.text=Configure Reporting
|
||||
CommandLineIngestSettingsPanel.jLabelDescription.text=<html>You can create cases, add data sources, run ingest modules, and generate reports from the command line.<br>This options panel allows you to configure the settings to use when running ingest modules and generating reports.<br>See the user documentation for details.</html>
|
||||
CommandLineIngestSettingsPanel.bnEditReportSettings.text=Configure
|
||||
CommandLineIngestSettingsPanel.bnEditIngestSettings.toolTipText=Ingest job settings for the command line processing mode context.
|
||||
CommandLineIngestSettingsPanel.ingestDescriptionTextPane.text=Configure the profiles to use from the command line.
|
||||
CommandLineIngestSettingsPanel.reportDescriptionTextPane.text=Report profiles define which report module and configuration to use.
|
||||
CommandLineIngestSettingsPanel.reportProfileLabel.text=Report Profile:
|
||||
CommandLineIngestSettingsPanel.ingestProfileLabel.text=Ingest Profile:
|
||||
CommandLineIngestSettingsPanel.bnEditReportSettings.AccessibleContext.accessibleName=Configure
|
||||
CommandLineIngestSettingsPanel.jTextPane1.text=Ingest profiles define which ingest filters, modules and configuration to use.
|
||||
|
||||
@@ -1,12 +1,22 @@
|
||||
CommandLineIngestSettingPanel_empty_report_name_mgs=Report profile name was empty, no profile created.
|
||||
CommandLineIngestSettingPanel_existing_report_name_mgs=Report profile name was already exists, no profile created.
|
||||
CommandListIngestSettingsPanel_Default_Report_DisplayName=Default
|
||||
CommandListIngestSettingsPanel_Make_Config=Make new profile...
|
||||
CommandListIngestSettingsPanel_Report_Name_Msg=Please supply a report profile name:
|
||||
OpenIDE-Module-Name=CommandLineAutopsy
|
||||
OptionsCategory_Keywords_Command_Line_Ingest_Settings=Command Line Ingest Settings
|
||||
OptionsCategory_Keywords_General=Options
|
||||
OptionsCategory_Name_Command_Line_Ingest=Command Line Ingest
|
||||
CommandLinePanel.jLabel1.text=Ingest is running from command line
|
||||
CommandLinePanel.jLabel1.text=Running command line taks.
|
||||
CommandLineStartupWindow.title.text=Running in Command Line Mode
|
||||
CommandLineIngestSettingsPanel.bnEditIngestSettings.text=Configure Ingest
|
||||
CommandLineIngestSettingsPanel.bnEditIngestSettings.text=Configure
|
||||
CommandLineIngestSettingsPanel.bnEditReportSettings.actionCommand=Report Module Settings
|
||||
CommandLineIngestSettingsPanel.bnEditReportSettings.toolTipText=Report generation settings for the command line processing mode context.
|
||||
CommandLineIngestSettingsPanel.bnEditReportSettings.text=Configure Reporting
|
||||
CommandLineIngestSettingsPanel.jLabelDescription.text=<html>You can create cases, add data sources, run ingest modules, and generate reports from the command line.<br>This options panel allows you to configure the settings to use when running ingest modules and generating reports.<br>See the user documentation for details.</html>
|
||||
CommandLineIngestSettingsPanel.bnEditReportSettings.text=Configure
|
||||
CommandLineIngestSettingsPanel.bnEditIngestSettings.toolTipText=Ingest job settings for the command line processing mode context.
|
||||
CommandLineIngestSettingsPanel.ingestDescriptionTextPane.text=Configure the profiles to use from the command line.
|
||||
CommandLineIngestSettingsPanel.reportDescriptionTextPane.text=Report profiles define which report module and configuration to use.
|
||||
CommandLineIngestSettingsPanel.reportProfileLabel.text=Report Profile:
|
||||
CommandLineIngestSettingsPanel.ingestProfileLabel.text=Ingest Profile:
|
||||
CommandLineIngestSettingsPanel.bnEditReportSettings.AccessibleContext.accessibleName=Configure
|
||||
CommandLineIngestSettingsPanel.jTextPane1.text=Ingest profiles define which ingest filters, modules and configuration to use.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Autopsy Forensic Browser
|
||||
*
|
||||
* Copyright 2019-2019 Basis Technology Corp.
|
||||
* Copyright 2019-2020 Basis Technology Corp.
|
||||
* Contact: carrier <at> sleuthkit <dot> org
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -48,7 +48,8 @@ class CommandLineCommand {
|
||||
CASE_FOLDER_PATH,
|
||||
DATA_SOURCE_PATH,
|
||||
DATA_SOURCE_ID,
|
||||
INGEST_PROFILE_NAME;
|
||||
INGEST_PROFILE_NAME,
|
||||
REPORT_PROFILE_NAME;
|
||||
}
|
||||
|
||||
private final CommandType type;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Autopsy Forensic Browser
|
||||
*
|
||||
* Copyright 2019-2019 Basis Technology Corp.
|
||||
* Copyright 2019-2020 Basis Technology Corp.
|
||||
* Contact: carrier <at> sleuthkit <dot> org
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -42,7 +42,6 @@ import org.sleuthkit.autopsy.casemodule.Case.CaseType;
|
||||
import org.sleuthkit.autopsy.casemodule.CaseActionException;
|
||||
import org.sleuthkit.autopsy.casemodule.CaseDetails;
|
||||
import org.sleuthkit.autopsy.casemodule.CaseMetadata;
|
||||
import static org.sleuthkit.autopsy.casemodule.CaseMetadata.getFileExtension;
|
||||
import org.sleuthkit.autopsy.core.RuntimeProperties;
|
||||
import org.sleuthkit.autopsy.corecomponentinterfaces.DataSourceProcessorCallback;
|
||||
import static org.sleuthkit.autopsy.corecomponentinterfaces.DataSourceProcessorCallback.DataSourceProcessorResult.CRITICAL_ERRORS;
|
||||
@@ -166,7 +165,7 @@ public class CommandLineIngestManager extends CommandLineManager{
|
||||
openCase(baseCaseName, rootOutputDirectory, caseType);
|
||||
|
||||
String outputDirPath = getOutputDirPath(caseForJob);
|
||||
OutputGenerator.saveCreateCaseOutput(caseForJob, outputDirPath, baseCaseName);
|
||||
OutputGenerator.saveCreateCaseOutput(caseForJob, outputDirPath, baseCaseName);
|
||||
} catch (CaseActionException ex) {
|
||||
String baseCaseName = command.getInputs().get(CommandLineCommand.InputType.CASE_NAME.name());
|
||||
LOGGER.log(Level.SEVERE, "Error creating or opening case " + baseCaseName, ex);
|
||||
@@ -290,10 +289,15 @@ public class CommandLineIngestManager extends CommandLineManager{
|
||||
String caseDirPath = inputs.get(CommandLineCommand.InputType.CASE_FOLDER_PATH.name());
|
||||
caseForJob = CommandLineIngestManager.this.openCase(caseDirPath);
|
||||
}
|
||||
// generate reports
|
||||
String reportName = inputs.get(CommandLineCommand.InputType.REPORT_PROFILE_NAME.name());
|
||||
if (reportName == null) {
|
||||
reportName = CommandLineIngestSettingsPanel.getDefaultReportingConfigName();
|
||||
}
|
||||
|
||||
// generate reports
|
||||
ReportProgressIndicator progressIndicator = new ReportProgressIndicator(new LoggingProgressIndicator());
|
||||
ReportGenerator generator = new ReportGenerator(CommandLineIngestSettingsPanel.getReportingConfigName(), progressIndicator);
|
||||
ReportGenerator generator = new ReportGenerator(reportName, progressIndicator);
|
||||
generator.generateReports();
|
||||
} catch (CaseActionException ex) {
|
||||
String caseDirPath = command.getInputs().get(CommandLineCommand.InputType.CASE_FOLDER_PATH.name());
|
||||
@@ -343,7 +347,7 @@ public class CommandLineIngestManager extends CommandLineManager{
|
||||
* @param baseCaseName Case name
|
||||
* @param rootOutputDirectory Full path to directory in which case
|
||||
* output folder will be created
|
||||
* @param caseType Type of case being created
|
||||
* @param caseType Type of case being created
|
||||
*
|
||||
* @throws CaseActionException
|
||||
*/
|
||||
@@ -376,17 +380,11 @@ public class CommandLineIngestManager extends CommandLineManager{
|
||||
* @param caseForJob The case
|
||||
* @param dataSource The data source.
|
||||
*
|
||||
* @throws
|
||||
* AutoIngestDataSourceProcessor.AutoIngestDataSourceProcessorExceptioif
|
||||
* there
|
||||
* was
|
||||
* a
|
||||
* DSP
|
||||
* processing
|
||||
* error
|
||||
* @throws AutoIngestDataSourceProcessorException if there was a DSP
|
||||
* processing error.
|
||||
*
|
||||
* @throws ead running the job processing task is interrupted while
|
||||
* blocked, i.e., if auto ingest is shutting down.
|
||||
* @throws InterruptedException running the job processing task while
|
||||
* blocking, i.e., if auto ingest is shutting down.
|
||||
*/
|
||||
private void runDataSourceProcessor(Case caseForJob, AutoIngestDataSource dataSource) throws InterruptedException, AutoIngestDataSourceProcessor.AutoIngestDataSourceProcessorException {
|
||||
|
||||
|
||||
@@ -16,113 +16,207 @@
|
||||
<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"/>
|
||||
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,44,0,0,1,-112"/>
|
||||
</AuxValues>
|
||||
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="nodeScrollPane" alignment="1" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="nodeScrollPane" alignment="0" pref="421" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
|
||||
<SubComponents>
|
||||
<Container class="javax.swing.JScrollPane" name="nodeScrollPane">
|
||||
<Container class="javax.swing.JPanel" name="nodePanel">
|
||||
<Properties>
|
||||
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[0, 0]"/>
|
||||
<Dimension value="[100, 100]"/>
|
||||
</Property>
|
||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[803, 553]"/>
|
||||
<Dimension value="[801, 551]"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
|
||||
<BorderConstraints direction="Center"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
|
||||
<SubComponents>
|
||||
<Container class="javax.swing.JPanel" name="nodePanel">
|
||||
<Component class="javax.swing.JButton" name="bnEditIngestSettings">
|
||||
<Properties>
|
||||
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[100, 100]"/>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/commandlineingest/Bundle.properties" key="CommandLineIngestSettingsPanel.bnEditIngestSettings.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[801, 551]"/>
|
||||
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/commandlineingest/Bundle.properties" key="CommandLineIngestSettingsPanel.bnEditIngestSettings.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
<Property name="actionCommand" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/commandlineingest/Bundle.properties" key="CommandLineIngestSettingsPanel.bnEditIngestSettings.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="bnEditIngestSettings" alignment="0" min="-2" pref="155" max="-2" attributes="0"/>
|
||||
<Component id="jLabelDescription" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="bnEditReportSettings" alignment="0" min="-2" pref="155" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace pref="-34" max="32767" 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="27" max="-2" attributes="0"/>
|
||||
<Component id="jLabelDescription" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<Component id="bnEditIngestSettings" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="bnEditReportSettings" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace pref="381" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JButton" name="bnEditIngestSettings">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/commandlineingest/Bundle.properties" key="CommandLineIngestSettingsPanel.bnEditIngestSettings.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/commandlineingest/Bundle.properties" key="CommandLineIngestSettingsPanel.bnEditIngestSettings.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
<Property name="actionCommand" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/commandlineingest/Bundle.properties" key="CommandLineIngestSettingsPanel.bnEditIngestSettings.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="bnEditIngestSettingsActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabelDescription">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/commandlineingest/Bundle.properties" key="CommandLineIngestSettingsPanel.jLabelDescription.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="bnEditReportSettings">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/commandlineingest/Bundle.properties" key="CommandLineIngestSettingsPanel.bnEditReportSettings.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/commandlineingest/Bundle.properties" key="CommandLineIngestSettingsPanel.bnEditReportSettings.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
<Property name="actionCommand" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/commandlineingest/Bundle.properties" key="CommandLineIngestSettingsPanel.bnEditReportSettings.actionCommand" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="bnEditReportSettingsActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="bnEditIngestSettingsActionPerformed"/>
|
||||
</Events>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="2" gridY="2" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="9" insetsBottom="0" insetsRight="0" anchor="18" weightX="0.0" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="bnEditReportSettings">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/commandlineingest/Bundle.properties" key="CommandLineIngestSettingsPanel.bnEditReportSettings.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/commandlineingest/Bundle.properties" key="CommandLineIngestSettingsPanel.bnEditReportSettings.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
<Property name="actionCommand" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/commandlineingest/Bundle.properties" key="CommandLineIngestSettingsPanel.bnEditReportSettings.actionCommand" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<AccessibilityProperties>
|
||||
<Property name="AccessibleContext.accessibleName" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/commandlineingest/Bundle.properties" key="CommandLineIngestSettingsPanel.bnEditReportSettings.AccessibleContext.accessibleName" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</AccessibilityProperties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="bnEditReportSettingsActionPerformed"/>
|
||||
</Events>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="2" gridY="4" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="9" insetsBottom="0" insetsRight="0" anchor="18" weightX="0.0" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JTextPane" name="ingestDescriptionTextPane">
|
||||
<Properties>
|
||||
<Property name="editable" type="boolean" value="false"/>
|
||||
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||
<Color blue="f0" green="f0" id="Label.background" palette="3" red="f0" type="palette"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/commandlineingest/Bundle.properties" key="CommandLineIngestSettingsPanel.ingestDescriptionTextPane.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<AuxValues>
|
||||
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
|
||||
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
|
||||
</AuxValues>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="0" gridWidth="3" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="5" insetsLeft="5" insetsBottom="10" insetsRight="5" anchor="18" weightX="1.0" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="ingestProfileLabel">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/commandlineingest/Bundle.properties" key="CommandLineIngestSettingsPanel.ingestProfileLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<AuxValues>
|
||||
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
|
||||
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
|
||||
</AuxValues>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="2" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="25" insetsBottom="0" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JComboBox" name="ingestProfileCB">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
|
||||
<StringArray count="1">
|
||||
<StringItem index="0" value="Default"/>
|
||||
</StringArray>
|
||||
</Property>
|
||||
<Property name="enabled" type="boolean" value="false"/>
|
||||
</Properties>
|
||||
<AuxValues>
|
||||
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/>
|
||||
</AuxValues>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="1" gridY="2" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="5" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JTextPane" name="reportDescriptionTextPane">
|
||||
<Properties>
|
||||
<Property name="editable" type="boolean" value="false"/>
|
||||
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||
<Color blue="f0" green="f0" id="Label.background" palette="3" red="f0" type="palette"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/commandlineingest/Bundle.properties" key="CommandLineIngestSettingsPanel.reportDescriptionTextPane.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<AuxValues>
|
||||
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
|
||||
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
|
||||
</AuxValues>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="3" gridWidth="3" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="15" insetsLeft="5" insetsBottom="5" insetsRight="5" anchor="10" weightX="0.0" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="reportProfileLabel">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/commandlineingest/Bundle.properties" key="CommandLineIngestSettingsPanel.reportProfileLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<AuxValues>
|
||||
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
|
||||
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
|
||||
</AuxValues>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="4" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="25" insetsBottom="0" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JComboBox" name="reportProfileCB">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
|
||||
<StringArray count="0"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<AuxValues>
|
||||
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/>
|
||||
</AuxValues>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="1" gridY="4" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="5" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.Box$Filler" name="bottomFiller">
|
||||
<AuxValues>
|
||||
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
|
||||
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
|
||||
</AuxValues>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="5" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="1.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JTextPane" name="jTextPane1">
|
||||
<Properties>
|
||||
<Property name="editable" type="boolean" value="false"/>
|
||||
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||
<Color blue="f0" green="f0" id="Label.background" palette="3" red="f0" type="palette"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/commandlineingest/Bundle.properties" key="CommandLineIngestSettingsPanel.jTextPane1.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="1" gridWidth="3" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="10" insetsLeft="5" insetsBottom="5" insetsRight="5" anchor="17" weightX="0.0" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
</SubComponents>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Autopsy Forensic Browser
|
||||
*
|
||||
* Copyright 2019-2019 Basis Technology Corp.
|
||||
* Copyright 2019-2020 Basis Technology Corp.
|
||||
* Contact: carrier <at> sleuthkit <dot> org
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -21,12 +21,16 @@ package org.sleuthkit.autopsy.commandlineingest;
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Cursor;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import javax.swing.DefaultComboBoxModel;
|
||||
import javax.swing.JOptionPane;
|
||||
import org.openide.util.NbBundle.Messages;
|
||||
import org.sleuthkit.autopsy.ingest.IngestJobSettings;
|
||||
import org.sleuthkit.autopsy.ingest.IngestJobSettingsPanel;
|
||||
import org.openide.windows.WindowManager;
|
||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||
import static org.sleuthkit.autopsy.report.infrastructure.ReportWizardAction.doReportWizard;
|
||||
import org.sleuthkit.autopsy.report.infrastructure.ReportWizardAction;
|
||||
|
||||
/**
|
||||
* Configuration panel for auto ingest settings.
|
||||
@@ -36,7 +40,7 @@ public class CommandLineIngestSettingsPanel extends javax.swing.JPanel {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final Logger logger = Logger.getLogger(CommandLineIngestSettingsPanel.class.getName());
|
||||
|
||||
|
||||
private static final String REPORTING_CONFIGURATION_NAME = "CommandLineIngest";
|
||||
private static final boolean DISPLAY_CASE_SPECIFIC_DATA = false; // do not try to display case specific data
|
||||
private static final boolean RUN_REPORTS = false; // do not generate reports as part of running the report wizard
|
||||
@@ -48,12 +52,13 @@ public class CommandLineIngestSettingsPanel extends javax.swing.JPanel {
|
||||
*/
|
||||
public CommandLineIngestSettingsPanel(CommandLineIngestSettingsPanelController theController) {
|
||||
initComponents();
|
||||
setupReportList();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return the REPORTING_CONFIGURATION_NAME
|
||||
*/
|
||||
public static String getReportingConfigName() {
|
||||
public static String getDefaultReportingConfigName() {
|
||||
return REPORTING_CONFIGURATION_NAME;
|
||||
}
|
||||
|
||||
@@ -87,6 +92,58 @@ public class CommandLineIngestSettingsPanel extends javax.swing.JPanel {
|
||||
}
|
||||
}
|
||||
|
||||
@Messages({
|
||||
"CommandListIngestSettingsPanel_Default_Report_DisplayName=Default",
|
||||
"CommandListIngestSettingsPanel_Make_Config=Make new profile..."
|
||||
})
|
||||
/**
|
||||
* Initializes the report profile list combo box.
|
||||
*/
|
||||
private void setupReportList() {
|
||||
Set<String> configNames = ReportWizardAction.getReportConfigNames();
|
||||
configNames.remove(REPORTING_CONFIGURATION_NAME);
|
||||
|
||||
DefaultComboBoxModel<String> model = new DefaultComboBoxModel<>();
|
||||
model.addElement(Bundle.CommandListIngestSettingsPanel_Default_Report_DisplayName());
|
||||
for (String name : configNames) {
|
||||
model.addElement(name);
|
||||
}
|
||||
|
||||
model.addElement(Bundle.CommandListIngestSettingsPanel_Make_Config());
|
||||
|
||||
reportProfileCB.setModel(model);
|
||||
reportProfileCB.setSelectedIndex(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks to see if there is currently a profile define with the given name.
|
||||
*
|
||||
* @param name Profile name to check.
|
||||
*
|
||||
* @return True if there is a report with the given name.
|
||||
*/
|
||||
private boolean doesReportProfileNameExist(String name) {
|
||||
Set<String> configNames = ReportWizardAction.getReportConfigNames();
|
||||
return configNames.contains(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the currently selected report profile name from the cb. For backwards
|
||||
* compatibility if Default is selected, the existing default
|
||||
* profile name of CommandLineIngest will be returned.
|
||||
*
|
||||
* @return The selected profile name.
|
||||
*/
|
||||
private String getReportName() {
|
||||
String reportName = (String) reportProfileCB.getSelectedItem();
|
||||
|
||||
if (reportName.equals(Bundle.CommandListIngestSettingsPanel_Default_Report_DisplayName())) {
|
||||
reportName = REPORTING_CONFIGURATION_NAME;
|
||||
}
|
||||
|
||||
return reportName;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
@@ -95,20 +152,26 @@ public class CommandLineIngestSettingsPanel extends javax.swing.JPanel {
|
||||
@SuppressWarnings("unchecked")
|
||||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||
private void initComponents() {
|
||||
java.awt.GridBagConstraints gridBagConstraints;
|
||||
|
||||
nodeScrollPane = new javax.swing.JScrollPane();
|
||||
nodePanel = new javax.swing.JPanel();
|
||||
bnEditIngestSettings = new javax.swing.JButton();
|
||||
jLabelDescription = new javax.swing.JLabel();
|
||||
bnEditReportSettings = new javax.swing.JButton();
|
||||
javax.swing.JTextPane ingestDescriptionTextPane = new javax.swing.JTextPane();
|
||||
javax.swing.JLabel ingestProfileLabel = new javax.swing.JLabel();
|
||||
ingestProfileCB = new javax.swing.JComboBox<>();
|
||||
javax.swing.JTextPane reportDescriptionTextPane = new javax.swing.JTextPane();
|
||||
javax.swing.JLabel reportProfileLabel = new javax.swing.JLabel();
|
||||
reportProfileCB = new javax.swing.JComboBox<>();
|
||||
javax.swing.Box.Filler bottomFiller = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0));
|
||||
jTextPane1 = new javax.swing.JTextPane();
|
||||
|
||||
setPreferredSize(new java.awt.Dimension(810, 422));
|
||||
|
||||
nodeScrollPane.setMinimumSize(new java.awt.Dimension(0, 0));
|
||||
nodeScrollPane.setPreferredSize(new java.awt.Dimension(803, 553));
|
||||
setLayout(new java.awt.BorderLayout());
|
||||
|
||||
nodePanel.setMinimumSize(new java.awt.Dimension(100, 100));
|
||||
nodePanel.setPreferredSize(new java.awt.Dimension(801, 551));
|
||||
nodePanel.setLayout(new java.awt.GridBagLayout());
|
||||
|
||||
org.openide.awt.Mnemonics.setLocalizedText(bnEditIngestSettings, org.openide.util.NbBundle.getMessage(CommandLineIngestSettingsPanel.class, "CommandLineIngestSettingsPanel.bnEditIngestSettings.text")); // NOI18N
|
||||
bnEditIngestSettings.setToolTipText(org.openide.util.NbBundle.getMessage(CommandLineIngestSettingsPanel.class, "CommandLineIngestSettingsPanel.bnEditIngestSettings.toolTipText")); // NOI18N
|
||||
@@ -118,8 +181,12 @@ public class CommandLineIngestSettingsPanel extends javax.swing.JPanel {
|
||||
bnEditIngestSettingsActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
org.openide.awt.Mnemonics.setLocalizedText(jLabelDescription, org.openide.util.NbBundle.getMessage(CommandLineIngestSettingsPanel.class, "CommandLineIngestSettingsPanel.jLabelDescription.text")); // NOI18N
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 2;
|
||||
gridBagConstraints.gridy = 2;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
|
||||
gridBagConstraints.insets = new java.awt.Insets(0, 9, 0, 0);
|
||||
nodePanel.add(bnEditIngestSettings, gridBagConstraints);
|
||||
|
||||
org.openide.awt.Mnemonics.setLocalizedText(bnEditReportSettings, org.openide.util.NbBundle.getMessage(CommandLineIngestSettingsPanel.class, "CommandLineIngestSettingsPanel.bnEditReportSettings.text")); // NOI18N
|
||||
bnEditReportSettings.setToolTipText(org.openide.util.NbBundle.getMessage(CommandLineIngestSettingsPanel.class, "CommandLineIngestSettingsPanel.bnEditReportSettings.toolTipText")); // NOI18N
|
||||
@@ -129,48 +196,120 @@ public class CommandLineIngestSettingsPanel extends javax.swing.JPanel {
|
||||
bnEditReportSettingsActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 2;
|
||||
gridBagConstraints.gridy = 4;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
|
||||
gridBagConstraints.insets = new java.awt.Insets(0, 9, 0, 0);
|
||||
nodePanel.add(bnEditReportSettings, gridBagConstraints);
|
||||
bnEditReportSettings.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(CommandLineIngestSettingsPanel.class, "CommandLineIngestSettingsPanel.bnEditReportSettings.AccessibleContext.accessibleName")); // NOI18N
|
||||
|
||||
javax.swing.GroupLayout nodePanelLayout = new javax.swing.GroupLayout(nodePanel);
|
||||
nodePanel.setLayout(nodePanelLayout);
|
||||
nodePanelLayout.setHorizontalGroup(
|
||||
nodePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(nodePanelLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(nodePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(bnEditIngestSettings, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jLabelDescription, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(bnEditReportSettings, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
);
|
||||
nodePanelLayout.setVerticalGroup(
|
||||
nodePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(nodePanelLayout.createSequentialGroup()
|
||||
.addGap(27, 27, 27)
|
||||
.addComponent(jLabelDescription, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(bnEditIngestSettings)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(bnEditReportSettings)
|
||||
.addContainerGap(381, Short.MAX_VALUE))
|
||||
);
|
||||
ingestDescriptionTextPane.setEditable(false);
|
||||
ingestDescriptionTextPane.setBackground(javax.swing.UIManager.getDefaults().getColor("Label.background"));
|
||||
ingestDescriptionTextPane.setText(org.openide.util.NbBundle.getMessage(CommandLineIngestSettingsPanel.class, "CommandLineIngestSettingsPanel.ingestDescriptionTextPane.text")); // NOI18N
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 0;
|
||||
gridBagConstraints.gridwidth = 3;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
|
||||
gridBagConstraints.weightx = 1.0;
|
||||
gridBagConstraints.insets = new java.awt.Insets(5, 5, 10, 5);
|
||||
nodePanel.add(ingestDescriptionTextPane, gridBagConstraints);
|
||||
|
||||
nodeScrollPane.setViewportView(nodePanel);
|
||||
org.openide.awt.Mnemonics.setLocalizedText(ingestProfileLabel, org.openide.util.NbBundle.getMessage(CommandLineIngestSettingsPanel.class, "CommandLineIngestSettingsPanel.ingestProfileLabel.text")); // NOI18N
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 2;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
|
||||
gridBagConstraints.insets = new java.awt.Insets(0, 25, 0, 0);
|
||||
nodePanel.add(ingestProfileLabel, gridBagConstraints);
|
||||
|
||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
|
||||
this.setLayout(layout);
|
||||
layout.setHorizontalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(nodeScrollPane, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(nodeScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 421, Short.MAX_VALUE)
|
||||
);
|
||||
ingestProfileCB.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Default" }));
|
||||
ingestProfileCB.setEnabled(false);
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 1;
|
||||
gridBagConstraints.gridy = 2;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
|
||||
nodePanel.add(ingestProfileCB, gridBagConstraints);
|
||||
|
||||
reportDescriptionTextPane.setEditable(false);
|
||||
reportDescriptionTextPane.setBackground(javax.swing.UIManager.getDefaults().getColor("Label.background"));
|
||||
reportDescriptionTextPane.setText(org.openide.util.NbBundle.getMessage(CommandLineIngestSettingsPanel.class, "CommandLineIngestSettingsPanel.reportDescriptionTextPane.text")); // NOI18N
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 3;
|
||||
gridBagConstraints.gridwidth = 3;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.insets = new java.awt.Insets(15, 5, 5, 5);
|
||||
nodePanel.add(reportDescriptionTextPane, gridBagConstraints);
|
||||
|
||||
org.openide.awt.Mnemonics.setLocalizedText(reportProfileLabel, org.openide.util.NbBundle.getMessage(CommandLineIngestSettingsPanel.class, "CommandLineIngestSettingsPanel.reportProfileLabel.text")); // NOI18N
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 4;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
|
||||
gridBagConstraints.insets = new java.awt.Insets(0, 25, 0, 0);
|
||||
nodePanel.add(reportProfileLabel, gridBagConstraints);
|
||||
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 1;
|
||||
gridBagConstraints.gridy = 4;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
|
||||
nodePanel.add(reportProfileCB, gridBagConstraints);
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 5;
|
||||
gridBagConstraints.weighty = 1.0;
|
||||
nodePanel.add(bottomFiller, gridBagConstraints);
|
||||
|
||||
jTextPane1.setEditable(false);
|
||||
jTextPane1.setBackground(javax.swing.UIManager.getDefaults().getColor("Label.background"));
|
||||
jTextPane1.setText(org.openide.util.NbBundle.getMessage(CommandLineIngestSettingsPanel.class, "CommandLineIngestSettingsPanel.jTextPane1.text")); // NOI18N
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 1;
|
||||
gridBagConstraints.gridwidth = 3;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
|
||||
gridBagConstraints.insets = new java.awt.Insets(10, 5, 5, 5);
|
||||
nodePanel.add(jTextPane1, gridBagConstraints);
|
||||
|
||||
add(nodePanel, java.awt.BorderLayout.CENTER);
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
@Messages({
|
||||
"CommandListIngestSettingsPanel_Report_Name_Msg=Please supply a report profile name:",
|
||||
"CommandLineIngestSettingPanel_empty_report_name_mgs=Report profile name was empty, no profile created.",
|
||||
"CommandLineIngestSettingPanel_existing_report_name_mgs=Report profile name was already exists, no profile created."
|
||||
})
|
||||
private void bnEditReportSettingsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bnEditReportSettingsActionPerformed
|
||||
String reportName = getReportName();
|
||||
if (reportName.equals(Bundle.CommandListIngestSettingsPanel_Make_Config())) {
|
||||
reportName = JOptionPane.showInputDialog(this, Bundle.CommandListIngestSettingsPanel_Report_Name_Msg());
|
||||
|
||||
// User hit cancel
|
||||
if (reportName == null) {
|
||||
return;
|
||||
} else if (reportName.isEmpty()) {
|
||||
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), Bundle.CommandLineIngestSettingPanel_empty_report_name_mgs());
|
||||
return;
|
||||
} else if (doesReportProfileNameExist(reportName)) {
|
||||
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), Bundle.CommandLineIngestSettingPanel_existing_report_name_mgs());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
this.getParent().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
|
||||
doReportWizard(getReportingConfigName(), DISPLAY_CASE_SPECIFIC_DATA, RUN_REPORTS);
|
||||
doReportWizard(reportName, DISPLAY_CASE_SPECIFIC_DATA, RUN_REPORTS);
|
||||
|
||||
setupReportList();
|
||||
|
||||
if (((DefaultComboBoxModel) reportProfileCB.getModel()).getIndexOf(reportName) >= 0) {
|
||||
reportProfileCB.setSelectedItem(reportName);
|
||||
}
|
||||
|
||||
this.getParent().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
|
||||
}//GEN-LAST:event_bnEditReportSettingsActionPerformed
|
||||
|
||||
@@ -181,8 +320,9 @@ public class CommandLineIngestSettingsPanel extends javax.swing.JPanel {
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JButton bnEditIngestSettings;
|
||||
private javax.swing.JButton bnEditReportSettings;
|
||||
private javax.swing.JLabel jLabelDescription;
|
||||
private javax.swing.JComboBox<String> ingestProfileCB;
|
||||
private javax.swing.JTextPane jTextPane1;
|
||||
private javax.swing.JPanel nodePanel;
|
||||
private javax.swing.JScrollPane nodeScrollPane;
|
||||
private javax.swing.JComboBox<String> reportProfileCB;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Autopsy Forensic Browser
|
||||
*
|
||||
* Copyright 2019-2019 Basis Technology Corp.
|
||||
* Copyright 2019-2020 Basis Technology Corp.
|
||||
* Contact: carrier <at> sleuthkit <dot> org
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -51,8 +51,7 @@ public class CommandLineOptionProcessor extends OptionProcessor {
|
||||
private final Option runIngestCommandOption = Option.withoutArgument('r', "runIngest");
|
||||
private final Option ingestProfileOption = Option.requiredArgument('p', "ingestProfile");
|
||||
private final Option listAllDataSourcesCommandOption = Option.withoutArgument('l', "listAllDataSources");
|
||||
private final Option generateReportsOption = Option.withoutArgument('g', "generateReports");
|
||||
private final Option runUICommandOption = Option.requiredArgument('u', "runUI");
|
||||
private final Option generateReportsOption = Option.optionalArgument('g', "generateReports");
|
||||
|
||||
private boolean runFromCommandLine = false;
|
||||
|
||||
@@ -60,7 +59,7 @@ public class CommandLineOptionProcessor extends OptionProcessor {
|
||||
|
||||
final static String CASETYPE_MULTI = "multi";
|
||||
final static String CASETYPE_SINGLE = "single";
|
||||
|
||||
|
||||
@Override
|
||||
protected Set<Option> getOptions() {
|
||||
Set<Option> set = new HashSet<>();
|
||||
@@ -76,7 +75,6 @@ public class CommandLineOptionProcessor extends OptionProcessor {
|
||||
set.add(ingestProfileOption);
|
||||
set.add(listAllDataSourcesCommandOption);
|
||||
set.add(generateReportsOption);
|
||||
set.add(runUICommandOption);
|
||||
return set;
|
||||
}
|
||||
|
||||
@@ -115,7 +113,6 @@ public class CommandLineOptionProcessor extends OptionProcessor {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
String caseType = "";
|
||||
if (values.containsKey(caseTypeOption)) {
|
||||
argDirs = values.get(caseTypeOption);
|
||||
@@ -136,16 +133,16 @@ public class CommandLineOptionProcessor extends OptionProcessor {
|
||||
if (!caseType.equalsIgnoreCase(CASETYPE_MULTI) && !caseType.equalsIgnoreCase(CASETYPE_SINGLE)) {
|
||||
logger.log(Level.SEVERE, "'caseType' argument is invalid");
|
||||
System.err.println("'caseType' argument is invalid");
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (caseType.equalsIgnoreCase(CASETYPE_MULTI) && !FeatureAccessUtils.canCreateMultiUserCases()) {
|
||||
logger.log(Level.SEVERE, "Unable to create multi user case.");
|
||||
System.err.println("Unable to create multi user case. Confirm that multi user settings are configured correctly.");
|
||||
return;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
String caseBaseDir = "";
|
||||
if (values.containsKey(caseBaseDirOption)) {
|
||||
argDirs = values.get(caseBaseDirOption);
|
||||
@@ -358,8 +355,9 @@ public class CommandLineOptionProcessor extends OptionProcessor {
|
||||
commands.add(newCommand);
|
||||
runFromCommandLine = true;
|
||||
}
|
||||
|
||||
|
||||
// Add "GENERATE_REPORTS" command, if present
|
||||
String reportProfile = null;
|
||||
if (values.containsKey(generateReportsOption)) {
|
||||
|
||||
// 'caseDir' must only be specified if the case is not being created during the current run
|
||||
@@ -371,8 +369,26 @@ public class CommandLineOptionProcessor extends OptionProcessor {
|
||||
return;
|
||||
}
|
||||
|
||||
argDirs = values.get(generateReportsOption);
|
||||
if (argDirs.length > 0) {
|
||||
reportProfile = argDirs[0];
|
||||
}
|
||||
|
||||
// If the user doesn't supply an options for generateReports the
|
||||
// argsDirs length will be 0, so if reportProfile is empty
|
||||
// something is not right.
|
||||
if (reportProfile != null && reportProfile.isEmpty()) {
|
||||
logger.log(Level.SEVERE, "'generateReports' argument is empty");
|
||||
System.err.println("'generateReports' argument is empty");
|
||||
runFromCommandLine = false;
|
||||
return;
|
||||
}
|
||||
|
||||
CommandLineCommand newCommand = new CommandLineCommand(CommandLineCommand.CommandType.GENERATE_REPORTS);
|
||||
newCommand.addInputValue(CommandLineCommand.InputType.CASE_FOLDER_PATH.name(), caseDir);
|
||||
if (reportProfile != null) {
|
||||
newCommand.addInputValue(CommandLineCommand.InputType.REPORT_PROFILE_NAME.name(), reportProfile);
|
||||
}
|
||||
commands.add(newCommand);
|
||||
runFromCommandLine = true;
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<EmptySpace min="-2" pref="20" max="-2" attributes="0"/>
|
||||
<Component id="jLabel1" pref="305" max="32767" attributes="0"/>
|
||||
<Component id="jLabel1" max="32767" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Autopsy Forensic Browser
|
||||
*
|
||||
* Copyright 2019-2019 Basis Technology Corp.
|
||||
* Copyright 2019-2020 Basis Technology Corp.
|
||||
* Contact: carrier <at> sleuthkit <dot> org
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -52,7 +52,7 @@ class CommandLinePanel extends JPanel {
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||
.addGap(20, 20, 20)
|
||||
.addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 305, Short.MAX_VALUE)
|
||||
.addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addContainerGap())
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
|
||||
@@ -33,6 +33,7 @@ import java.text.MessageFormat;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.logging.Level;
|
||||
import javax.swing.ImageIcon;
|
||||
@@ -203,6 +204,21 @@ public final class ReportWizardAction extends CallableSystemAction implements Pr
|
||||
toolbarButton.setText(NbBundle.getMessage(this.getClass(), "ReportWizardAction.toolBarButton.text"));
|
||||
return toolbarButton;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a set of the existing report profile names, removing the special
|
||||
* named ReportAction.
|
||||
*
|
||||
* @return A set of user configurable report profiles, empty list is
|
||||
* returned if none were found.
|
||||
*/
|
||||
public static Set<String> getReportConfigNames() {
|
||||
Set<String> nameList = ReportingConfigLoader.getListOfReportConfigs();
|
||||
//Remove this default name, users cannot change this report.
|
||||
nameList.remove(REPORTING_CONFIGURATION_NAME);
|
||||
|
||||
return nameList;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set this action to be enabled/disabled
|
||||
|
||||
@@ -29,6 +29,8 @@ import java.nio.file.Paths;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
import java.util.logging.Level;
|
||||
import org.openide.util.io.NbObjectInputStream;
|
||||
import org.openide.util.io.NbObjectOutputStream;
|
||||
@@ -219,5 +221,27 @@ final class ReportingConfigLoader {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a list of the names of the report profiles in the
|
||||
* REPORT_CONFIG_FOLDER_PATH.
|
||||
*
|
||||
* @return Naturally ordered list of report profile names. If none were found
|
||||
* the list will be empty.
|
||||
*/
|
||||
static synchronized Set<String> getListOfReportConfigs() {
|
||||
File reportDirPath = new File(ReportingConfigLoader.REPORT_CONFIG_FOLDER_PATH);
|
||||
Set<String> reportNameList = new TreeSet<>();
|
||||
|
||||
if (!reportDirPath.exists()) {
|
||||
return reportNameList;
|
||||
}
|
||||
|
||||
for (File file : reportDirPath.listFiles()) {
|
||||
reportNameList.add(file.getName());
|
||||
}
|
||||
|
||||
return reportNameList;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user