mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-19 11:07:43 +00:00
First cut at HTML report integration
This commit is contained in:
parent
d7bd6cedd0
commit
d74e68be49
68
Core/src/org/sleuthkit/autopsy/report/HTMLReportModuleSettings.java
Executable file
68
Core/src/org/sleuthkit/autopsy/report/HTMLReportModuleSettings.java
Executable 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;
|
||||||
|
}
|
||||||
|
}
|
@ -123,6 +123,36 @@ class ReportHTML implements TableReportModule {
|
|||||||
}
|
}
|
||||||
return configPanel;
|
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
|
// Refesh the member variables
|
||||||
private void refresh() throws NoCurrentCaseException {
|
private void refresh() throws NoCurrentCaseException {
|
||||||
|
@ -33,6 +33,7 @@ final class ReportHTMLConfigurationPanel extends javax.swing.JPanel {
|
|||||||
initComponents();
|
initComponents();
|
||||||
|
|
||||||
// Load settings
|
// Load settings
|
||||||
|
// ELTODO REMOVE
|
||||||
String header = ModuleSettings.getConfigSetting("HTMLReport", "header"); //NON-NLS
|
String header = ModuleSettings.getConfigSetting("HTMLReport", "header"); //NON-NLS
|
||||||
String footer = ModuleSettings.getConfigSetting("HTMLReport", "footer"); //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 : "");
|
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.
|
* Get the header text.
|
||||||
*
|
*
|
||||||
|
@ -25,9 +25,7 @@ import java.io.IOException;
|
|||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user