diff --git a/Core/src/org/sleuthkit/autopsy/report/HTMLReportModuleSettings.java b/Core/src/org/sleuthkit/autopsy/report/HTMLReportModuleSettings.java new file mode 100755 index 0000000000..1a6b5a8dda --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/report/HTMLReportModuleSettings.java @@ -0,0 +1,68 @@ +/* + * Autopsy Forensic Browser + * + * Copyright 2019 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.report; + +/** + * Settings for the HTML report module. + */ +class HTMLReportModuleSettings implements ReportModuleSettings { + + private static final long serialVersionUID = 1L; + + private String header; + private String footer; + + HTMLReportModuleSettings(String header, String footer) { + this.header = header; + this.footer = footer; + } + + @Override + public long getVersionNumber() { + return serialVersionUID; + } + + /** + * @return the header + */ + String getHeader() { + return header; + } + + /** + * @param header the header to set + */ + void setHeader(String header) { + this.header = header; + } + + /** + * @return the footer + */ + String getFooter() { + return footer; + } + + /** + * @param footer the footer to set + */ + void setFooter(String footer) { + this.footer = footer; + } +} \ No newline at end of file diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportHTML.java b/Core/src/org/sleuthkit/autopsy/report/ReportHTML.java index e7bb2f313d..e524736e21 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportHTML.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportHTML.java @@ -123,6 +123,36 @@ class ReportHTML implements TableReportModule { } return configPanel; } + + /** + * Get default configuration for this report module. + * + * @return Object which contains default report module settings. + */ + @Override + public ReportModuleSettings getDefaultConfiguration() { + return new NoReportModuleSettings(); + } + + /** + * Get current configuration for this report module. + * + * @return Object which contains current report module settings. + */ + @Override + public ReportModuleSettings getConfiguration() { + return new NoReportModuleSettings(); + } + + /** + * Set report module configuration. + * + * @param settings Object which contains report module settings. + */ + @Override + public void setConfiguration(ReportModuleSettings settings) { + // NO-OP + } // Refesh the member variables private void refresh() throws NoCurrentCaseException { diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportHTMLConfigurationPanel.java b/Core/src/org/sleuthkit/autopsy/report/ReportHTMLConfigurationPanel.java index fbaa9d3a1a..f67b059a96 100755 --- a/Core/src/org/sleuthkit/autopsy/report/ReportHTMLConfigurationPanel.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportHTMLConfigurationPanel.java @@ -33,6 +33,7 @@ final class ReportHTMLConfigurationPanel extends javax.swing.JPanel { initComponents(); // Load settings + // ELTODO REMOVE String header = ModuleSettings.getConfigSetting("HTMLReport", "header"); //NON-NLS String footer = ModuleSettings.getConfigSetting("HTMLReport", "footer"); //NON-NLS @@ -40,6 +41,15 @@ final class ReportHTMLConfigurationPanel extends javax.swing.JPanel { footerTextField.setText(footer != null ? footer : ""); } + void setConfiguration(HTMLReportModuleSettings settings) { + headerTextField.setText(settings.getHeader()); + footerTextField.setText(settings.getFooter()); + } + + HTMLReportModuleSettings getConfiguration() { + return new HTMLReportModuleSettings(headerTextField.getText(), footerTextField.getText()); + } + /** * Get the header text. * diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportingConfigLoader.java b/Core/src/org/sleuthkit/autopsy/report/ReportingConfigLoader.java index a17894dda8..1a05f8539c 100755 --- a/Core/src/org/sleuthkit/autopsy/report/ReportingConfigLoader.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportingConfigLoader.java @@ -25,9 +25,7 @@ import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; -import java.util.ArrayList; import java.util.Iterator; -import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.logging.Level;