First cut at HTML report integration

This commit is contained in:
Eugene Livis 2019-08-21 14:31:11 -04:00
parent d7bd6cedd0
commit d74e68be49
4 changed files with 108 additions and 2 deletions

View File

@ -0,0 +1,68 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2019 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.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;
}
}

View File

@ -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 {

View File

@ -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.
*

View File

@ -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;