diff --git a/Core/src/org/sleuthkit/autopsy/timeline/TimeLineController.java b/Core/src/org/sleuthkit/autopsy/timeline/TimeLineController.java index c131df9139..e2b8771ad2 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/TimeLineController.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/TimeLineController.java @@ -902,9 +902,7 @@ public class TimeLineController { public void propertyChange(PropertyChangeEvent evt) { switch (Case.Events.valueOf(evt.getPropertyName())) { case BLACKBOARD_ARTIFACT_TAG_ADDED: - executor.submit(() -> { - return filteredEvents.handleArtifactTagAdded((BlackBoardArtifactTagAddedEvent) evt); - }); + executor.submit(() -> filteredEvents.handleArtifactTagAdded((BlackBoardArtifactTagAddedEvent) evt)); break; case BLACKBOARD_ARTIFACT_TAG_DELETED: executor.submit(() -> filteredEvents.handleArtifactTagDeleted((BlackBoardArtifactTagDeletedEvent) evt)); diff --git a/Core/src/org/sleuthkit/autopsy/timeline/actions/Bundle.properties b/Core/src/org/sleuthkit/autopsy/timeline/actions/Bundle.properties deleted file mode 100644 index b3aa51b866..0000000000 --- a/Core/src/org/sleuthkit/autopsy/timeline/actions/Bundle.properties +++ /dev/null @@ -1,246 +0,0 @@ -OpenIDE-Module-Name=Report -CTL_ReportWizardAction=Run Report -ArtifactSelectionDialog.titleLabel.text=Select which artifacts you would like to report on: -ArtifactSelectionDialog.okButton.text=OK -ReportVisualPanel1.reportModulesLabel.text=Report Modules: -ReportVisualPanel1.invalidModuleWarning=Encountered an invalid Report Module ({0}) -DefaultReportConfigurationPanel.infoLabel.text=This report will be configured on the next screen. -ReportVisualPanel2.dataLabel.text=Select which data to report on: -ReportVisualPanel2.deselectAllButton.text=Deselect All -ReportVisualPanel2.selectAllButton.text=Select All -ReportVisualPanel2.advancedButton.text=Data Types -ArtifactSelectionDialog.deselectAllButton.text=Deselect All -ArtifactSelectionDialog.selectAllButton.text=Select All -ReportGenerationPanel.closeButton.text=Close -ReportProgressPanel.reportLabel.text=reportLabel -ReportProgressPanel.pathLabel.text=pathLabel -ReportProgressPanel.separationLabel.text=: -ReportProgressPanel.statusMessageLabel.text=processingLabel -ReportGenerationPanel.titleLabel.text=Report Generation Progress -ReportVisualPanel2.taggedResultsRadioButton.text=Tagged Results -ReportVisualPanel2.allResultsRadioButton.text=All Results -ReportWizardFileOptionsVisualPanel.selectAllButton.text=Select All -ReportWizardFileOptionsVisualPanel.deselectAllButton.text=Deselect All -ReportWizardFileOptionsVisualPanel.jLabel1.text=Select items to include in File Report: -ArtifactSelectionDialog.dlgTitle.text=Advanced Artifact Selection -FileReportDataTypes.filename.text=Name -FileReportDataTypes.fileExt.text=File Extension -FileReportDataTypes.fileType.text=File Type -FileReportDataTypes.isDel.text=Is Deleted -FileReportDataTypes.aTime.text=Last Accessed -FileReportDataTypes.crTime.text=File Created -FileReportDataTypes.mTime.text=Last Modified -FileReportDataTypes.size.text=Size -FileReportDataTypes.address.text=Address -FileReportDataTypes.hash.text=Hash Value -FileReportDataTypes.knownStatus.text=Known Status -FileReportDataTypes.perms.text=Permissions -FileReportDataTypes.path.text=Full Path -FileReportText.getName.text=Files - Text -FileReportText.getDesc.text=A tab delimited text file containing information about individual files in the case. -ReportBodyFile.progress.querying=Querying files... -ReportBodyFile.ingestWarning.text=Warning, this report was run before ingest services completed\! -ReportBodyFile.progress.loading=Loading files... -ReportBodyFile.progress.processing=Now processing {0}... -ReportBodyFile.getName.text=TSK Body File -ReportBodyFile.getDesc.text=Body file format report with MAC times for every file. This format can be used for a timeline view. -ReportBodyFile.getFilePath.text=BodyFile.txt -ReportKML.progress.querying=Querying files... -ReportKML.progress.loading=Loading files... -ReportKML.getName.text=Google Earth/KML -ReportKML.getDesc.text=KML format report with coordinates for relevant files. This format can be used for google earth views. -ReportKML.getFilePath.text=ReportKML.kml -ReportBranding.defaultReportTitle.text=Autopsy Forensic Report -ReportBranding.defaultReportFooter.text=Powered by Autopsy Open Source Digital Forensics Platform - www.sleuthkit.org -ReportExcel.numAartifacts.text=Number of artifacts\: -ReportExcel.getName.text=Results - Excel -ReportExcel.getDesc.text=A report about results and tagged items in Excel (XLS) format. -ReportExcel.sheetName.text=Summary -ReportExcel.cellVal.summary=Summary -ReportExcel.cellVal.caseName=Case Name\: -ReportExcel.cellVal.caseNum=Case Number\: -ReportExcel.cellVal.examiner=Examiner\: -ReportExcel.cellVal.numImages=Number of Images\: -ReportGenerationPanel.confDlg.sureToClose.msg=Are you sure you'd like to close the dialog?\nAll reports will be canceled. -ReportGenerationPanel.confDlg.title.closing=Closing -ReportGenerationPanel.confDlg.cancelReport.msg=Are you sure you'd like to cancel the report? -ReportGenerator.displayProgress.title.text=Report Generation Progress... -ReportGenerator.progress.queryingDb.text=Querying database... -ReportGenerator.progress.processingFile.text=Now processing {0} -ReportGenerator.artifactTable.taggedResults.text=Contains results that were tagged with one of the following\: -ReportGenerator.progress.processing=Now processing {0}... -ReportGenerator.msgShow.skippingArtType.title=Skipping artifact type {0} in reports -ReportGenerator.msgShow.skippingArtType.msg=Unknown columns to report on -ReportGenerator.makeContTagTab.taggedFiles.msg=Contains files that were tagged with one of the following\: -ReportGenerator.makeBbArtTagTab.taggedRes.msg=This report only includes results tagged with\: -ReportGenerator.tagTable.header.resultType=Result Type -ReportGenerator.tagTable.header.tag=Tag -ReportGenerator.tagTable.header.comment=Comment -ReportGenerator.tagTable.header.srcFile=Source File -ReportGenerator.progress.createdThumb.text=Creating thumbnails... -ReportGenerator.htmlOutput.header.file=File -ReportGenerator.htmlOutput.header.tag=Tag -ReportGenerator.htmlOutput.header.comment=Comment -ReportGenerator.htmlOutput.header.timeModified=Modified Time -ReportGenerator.htmlOutput.header.timeChanged=Changed Time -ReportGenerator.htmlOutput.header.timeAccessed=Accessed Time -ReportGenerator.htmlOutput.header.timeCreated=Created Time -ReportGenerator.htmlOutput.header.size=Size (Bytes) -ReportGenerator.htmlOutput.header.hash=Hash -ReportGenerator.thumbnailTable.name=Thumbnails -ReportGenerator.thumbnailTable.desc=Contains thumbnails of images that are associated with tagged files and results. -ReportGenerator.writeKwHits.userSrchs=User Searches -ReportGenerator.progress.processingList=Now processing {0} ({1})... -ReportGenerator.artTableColHdr.url=URL -ReportGenerator.artTableColHdr.title=Title -ReportGenerator.artTableColHdr.dateCreated=Date Created -ReportGenerator.artTableColHdr.program=Program -ReportGenerator.artTableColHdr.urlDomainDecoded=URL Domain -ReportGenerator.artTableColHdr.srcFile=Source File -ReportGenerator.artTableColHdr.dateTime=Date/Time -ReportGenerator.artTableColHdr.name=Name -ReportGenerator.artTableColHdr.value=Value -ReportGenerator.artTableColHdr.dateAccessed=Date Accessed -ReportGenerator.artTableColHdr.referrer=Referrer -ReportGenerator.artTableColHdr.dest=Destination -ReportGenerator.artTableColHdr.sourceUrl=Source URL -ReportGenerator.artTableColHdr.path=Path -ReportGenerator.artTableColHdr.progName=Program Name -ReportGenerator.artTableColHdr.instDateTime=Install Date/Time -ReportGenerator.artTableColHdr.preview=Preview -ReportGenerator.artTableColHdr.file=File -ReportGenerator.artTableColHdr.size=Size -ReportGenerator.artTableColHdr.deviceId=Device ID -ReportGenerator.artTableColHdr.text=Text -ReportGenerator.artTableColHdr.domain=Domain -ReportGenerator.artTableColHdr.dateTaken=Date Taken -ReportGenerator.artTableColHdr.devManufacturer=Device Manufacturer -ReportGenerator.artTableColHdr.devMake=Device Make -ReportGenerator.artTableColHdr.devModel=Device Model -ReportGenerator.artTableColHdr.latitude=Latitude -ReportGenerator.artTableColHdr.longitude=Longitude -ReportGenerator.artTableColHdr.latitudeStart=Starting Latitude -ReportGenerator.artTableColHdr.longitudeStart=Starting Longitude -ReportGenerator.artTableColHdr.latitudeEnd=Ending Latitude -ReportGenerator.artTableColHdr.longitudeEnd=Ending Longitude -ReportGenerator.artTableColHdr.associatedArtifact=Associated Artifact -ReportGenerator.artTableColHdr.count=Count -ReportGenerator.artTableColHdr.personName=Person Name -ReportGenerator.artTableColHdr.phoneNumber=Phone Number -ReportGenerator.artTableColHdr.phoneNumHome=Phone Number (Home) -ReportGenerator.artTableColHdr.phoneNumOffice=Phone Number (Office) -ReportGenerator.artTableColHdr.phoneNumMobile=Phone Number (Mobile) -ReportGenerator.artTableColHdr.email=Email -ReportGenerator.artTableColHdr.msgType=Message Type -ReportGenerator.artTableColHdr.direction=Direction -ReportGenerator.artTableColHdr.readStatus=Read Status -ReportGenerator.artTableColHdr.fromPhoneNum=From Phone Number -ReportGenerator.artTableColHdr.fromEmail=From Email -ReportGenerator.artTableColHdr.toPhoneNum=To Phone Number -ReportGenerator.artTableColHdr.toEmail=To Email -ReportGenerator.artTableColHdr.subject=Subject -ReportGenerator.artTableColHdr.tskEmailTo=E-Mail To -ReportGenerator.artTableColHdr.tskEmailCc=E-Mail CC -ReportGenerator.artTableColHdr.tskEmailBcc=E-Mail BCC -ReportGenerator.artTableColHdr.tskEmailFrom=E-Mail From -ReportGenerator.artTableColHdr.tskMsgId=Message ID -ReportGenerator.artTableColHdr.tskDateTimeRcvd=Date Received -ReportGenerator.artTableColHdr.tskDateTimeSent=Date Sent -ReportGenerator.artTableColHdr.tskSubject=Subject -ReportGenerator.artTableColHdr.tskSetName=Set Name -ReportGenerator.artTableColHdr.tskInterestingFilesCategory=Rule -ReportGenerator.artTableColHdr.tskGpsRouteCategory=Category -ReportGenerator.artTableColHdr.tskPath=Path -ReportGenerator.artTableColHdr.calendarEntryType=Calendar Entry Type -ReportGenerator.artTableColHdr.description=Description -ReportGenerator.artTableColHdr.startDateTime=Start Date/Time -ReportGenerator.artTableColHdr.endDateTime=End Date/Time -ReportGenerator.artTableColHdr.location=Location -ReportGenerator.artTableColHdr.shortCut=Short Cut -ReportGenerator.artTableColHdr.deviceName=Device Name -ReportGenerator.artTableColHdr.deviceAddress=Device Address -ReportGenerator.artTableColHdr.altitude=Altitude -ReportGenerator.artTableColHdr.locationAddress=Location Address -ReportGenerator.artTableColHdr.category=Category -ReportGenerator.artTableColHdr.userId=User ID -ReportGenerator.artTableColHdr.userName=User Name -ReportGenerator.artTableColHdr.password=Password -ReportGenerator.artTableColHdr.appName=App Name -ReportGenerator.artTableColHdr.appPath=App Path -ReportGenerator.artTableColHdr.replytoAddress=ReplyTo Address -ReportGenerator.artTableColHdr.mailServer=Mail Server -ReportGenerator.artTableColHdr.tags=Tags -ReportGenerator.artTableColHdr.localPath=Local path -ReportGenerator.artTableColHdr.remotePath=Remote path -ReportGenerator.errors.reportErrorTitle=Error generating report -ReportGenerator.errors.reportErrorText=Error generating report: -ReportHTML.addThumbRows.dataType.title=Tagged Images - {0} -ReportHTML.addThumbRows.dataType.msg=Tagged Results and Contents that contain images. -ReportHTML.thumbLink.tags=Tags\: -ReportHTML.getName.text=Results - HTML -ReportHTML.getDesc.text=A report about results and tagged items in HTML format. -ReportHTML.writeIndex.title=Autopsy Report for case {0} -ReportHTML.writeIndex.noFrames.msg=Your browser is not compatible with our frame setup. -ReportHTML.writeIndex.noFrames.seeNav=Please see the navigation page for artifact links, -ReportHTML.writeIndex.seeSum=and the summary page for a case summary. -ReportHTML.writeNav.title=Report Navigation -ReportHTML.writeNav.h1=Report Navigation -ReportHTML.writeNav.summary=Case Summary -ReportHTML.writeSum.title=Case Summary -ReportHTML.writeSum.warningMsg=Warning, this report was run before ingest services completed\! -# -# autopsy/test/scripts/regression.py._html_report_diff() uses reportGenOn.text, caseName, caseNum, -# examiner as a regex signature to skip index.html and summary.html -# -ReportHTML.writeSum.reportGenOn.text=HTML Report Generated on {0} - - -ReportHTML.writeSum.numImageSum.imageInfoHeading=

Image Information\:

- -ReportProgressPanel.progress.queuing=Queuing... -ReportProgressPanel.initPathLabel.noFile=No report file -ReportProgressPanel.start.cancelButton.text=Cancel -ReportProgressPanel.start.progress.text=Starting report... -ReportProgressPanel.complete.processLbl.text=Complete -ReportProgressPanel.complete.processLb2.text=Completed with error -ReportProgressPanel.complete.cancelButton.text=Complete -ReportProgressPanel.cancel.cancelButton.toolTipText=Canceled -ReportProgressPanel.cancel.procLbl.text=Canceled -ReportVisualPanel1.getName.text=Select and Configure Report Modules -ReportVisualPanel2.getName.text=Configure Artifact Reports -ReportWizardAction.actionName.text=Generate Report -ReportWizardAction.reportWiz.title=Generate Report -ReportWizardAction.toolBarButton.text=Generate Report -ReportWizardFileOptionsPanel.finishButton.text=Finish -ReportWizardFileOptionsVisualPanel.getName.text=Configure File Report -ReportWizardPanel1.nextButton.text=Next > -ReportWizardPanel1.finishButton.text=Finish -ReportWizardPanel2.finishButton.text=Finish -ReportWizardPanel2.nextButton.text=Next > -ReportBodyFile.generateReport.srcModuleName.text=TSK Body File -ReportExcel.endReport.srcModuleName.text=Excel Report -ReportHTML.writeIndex.srcModuleName.text=HTML Report -ReportKML.genReport.srcModuleName.text=KML Report -ReportGenerator.artTableColHdr.extension.text=Extension -ReportGenerator.artTableColHdr.mimeType.text=MIME Type -ReportGenerator.artTableColHdr.processorArchitecture.text=Processor Architecture -ReportGenerator.artTableColHdr.osName.text=Operating System Name -ReportGenerator.artTableColHdr.osInstallDate.text=Install Date -ReportGenerator.errList.failedMakeRptFolder=Failed to make report folder, may be unable to generate reports. -ReportGenerator.notifyErr.errsDuringRptGen=Errors during report generation\: -ReportGenerator.errList.failedGetContentTags=Failed to get content tags. -ReportGenerator.errList.failedGetBBArtifactTags=Failed to get blackboard artifact tags. -ReportGenerator.errList.errGetContentFromBBArtifact=Error while getting content from a blackboard artifact to report on. -ReportGenerator.errList.failedGetBBAttribs=Failed to get Blackboard Attributes when generating report. -ReportGenerator.errList.failedGetBBArtifacts=Failed to get Blackboard Artifacts when generating report. -ReportGenerator.errList.failedQueryKWLists=Failed to query keyword lists. -ReportGenerator.errList.failedGetAbstractFileByID=Failed to get Abstract File by ID. -ReportGenerator.errList.failedQueryKWs=Failed to query keywords. -ReportGenerator.errList.failedQueryHashsetLists=Failed to query hashset lists. -ReportGenerator.errList.failedGetAbstractFileFromID=Failed to get Abstract File from ID. -ReportGenerator.errList.failedQueryHashsetHits=Failed to query hashsets hits. -ReportGenerator.errList.coreExceptionWhileGenRptRow=Core exception while generating row data for artifact report. -ReportKML.latLongStartPoint={0};{1};;{2} (Start)\n -ReportKML.latLongEndPoint={0};{1};;{2} (End)\n -ReportGenerationPanel.cancelButton.actionCommand=Cancel -ReportGenerationPanel.cancelButton.text=Cancel diff --git a/Core/src/org/sleuthkit/autopsy/timeline/actions/SaveSnapshotAsReport.java b/Core/src/org/sleuthkit/autopsy/timeline/actions/SaveSnapshotAsReport.java index 4f2028e421..aa46f70ed7 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/actions/SaveSnapshotAsReport.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/actions/SaveSnapshotAsReport.java @@ -25,7 +25,6 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.text.SimpleDateFormat; import java.util.Date; -import java.util.function.Supplier; import java.util.logging.Level; import javafx.embed.swing.SwingFXUtils; import javafx.scene.Node; @@ -54,7 +53,7 @@ import org.sleuthkit.datamodel.TskCoreException; public class SaveSnapshotAsReport extends Action { private static final Logger LOGGER = Logger.getLogger(SaveSnapshotAsReport.class.getName()); - private static final Image SNAP_SHOT = new Image("org/sleuthkit/autopsy/timeline/images/image.png", 16, 16, true, true); + private static final Image SNAP_SHOT = new Image("org/sleuthkit/autopsy/timeline/images/image.png", 16, 16, true, true); //NON_NLS private static final ButtonType OPEN = new ButtonType(Bundle.OpenReportAction_DisplayName(), ButtonBar.ButtonData.NO); private static final ButtonType OK = new ButtonType(ButtonType.OK.getText(), ButtonBar.ButtonData.CANCEL_CLOSE); @@ -68,20 +67,23 @@ public class SaveSnapshotAsReport extends Action { * @param nodeSupplier The Supplier of the node to snapshot. */ @NbBundle.Messages({ - "SaveSnapshot.action.name.text=Snapshot Report", - "SaveSnapshot.action.longText=Save a screen capture of the visualization as a report.", - "SaveSnapshot.fileChoose.title.text=Save snapshot to", + "Timeline.ModuleName=Timeline", + "SaveSnapShotAsReport.action.dialogs.title=Timeline", + "SaveSnapShotAsReport.action.name.text=Snapshot Report", + "SaveSnapShotAsReport.action.longText=Save a screen capture of the visualization as a report.", "# {0} - report file path", "SaveSnapShotAsReport.ReportSavedAt=Report saved at [{0}]", - "Timeline.ModuleName=Timeline", "SaveSnapShotAsReport.Success=Success", - "# {0} - uniqueness identifier, local date time at report creation time", - "SaveSnapsHotAsReport.ReportName=timeline-report-{0}", + "SaveSnapShotAsReport.Success=Success", "SaveSnapShotAsReport.FailedToAddReport=Failed to add snaphot to case as a report.", - "# {0} - report name", - "SaveSnapShotAsReport.ErrorWritingReport=Error writing report {0} to disk.",}) - public SaveSnapshotAsReport(TimeLineController controller, Supplier nodeSupplier) { - super(Bundle.SaveSnapshot_action_name_text()); - setLongText(Bundle.SaveSnapshot_action_longText()); + "# {0} - report path", + "SaveSnapShotAsReport.ErrorWritingReport=Error writing report to disk at {0}.", + "# {0} - generated default report name", + "SaveSnapShotAsReport.reportName.prompt=leave empty for default report name: {0}.", + "SaveSnapShotAsReport.reportName.header=Enter a report name for the Timeline Snapshot Report." + }) + public SaveSnapshotAsReport(TimeLineController controller, Node node) { + super(Bundle.SaveSnapShotAsReport_action_name_text()); + setLongText(Bundle.SaveSnapShotAsReport_action_longText()); setGraphic(new ImageView(SNAP_SHOT)); this.controller = controller; @@ -90,21 +92,22 @@ public class SaveSnapshotAsReport extends Action { setEventHandler(actionEvent -> { //capture generation date and use to make default report name Date generationDate = new Date(); - final String defaultReportName = FileUtil.escapeFileName(currentCase.getName() + " " + new SimpleDateFormat("MM-dd-yyyy-HH-mm-ss").format(generationDate)); + final String defaultReportName = FileUtil.escapeFileName(currentCase.getName() + " " + new SimpleDateFormat("MM-dd-yyyy-HH-mm-ss").format(generationDate)); //NON_NLS - BufferedImage snapshot = SwingFXUtils.fromFXImage(nodeSupplier.get().snapshot(null, null), null); + BufferedImage snapshot = SwingFXUtils.fromFXImage(node.snapshot(null, null), null); //prompt user to pick report name TextInputDialog textInputDialog = new TextInputDialog(); - textInputDialog.setTitle("Timeline"); - textInputDialog.getEditor().setPromptText("leave empty for default report name: " + defaultReportName); - textInputDialog.getEditor().setStyle("-fx-prompt-text-fill: derive(-fx-control-inner-background, -30%);"); - textInputDialog.setHeaderText("Enter a report name for the Timeline Snapshot Report."); + textInputDialog.setTitle(Bundle.SaveSnapShotAsReport_action_dialogs_title()); + textInputDialog.getEditor().setPromptText(Bundle.SaveSnapShotAsReport_reportName_prompt(defaultReportName)); + //keep prompt even if text field has focus, until user starts typing. + textInputDialog.getEditor().setStyle("-fx-prompt-text-fill: derive(-fx-control-inner-background, -30%);");//NON_NLS + textInputDialog.setHeaderText(Bundle.SaveSnapShotAsReport_reportName_header()); textInputDialog.showAndWait().ifPresent(enteredReportName -> { //reportName defaults to case name + timestamp if left blank String reportName = StringUtils.defaultIfBlank(enteredReportName, defaultReportName); - Path reportFolderPath = Paths.get(currentCase.getReportDirectory(), reportName, "Timeline Snapshot"); + Path reportFolderPath = Paths.get(currentCase.getReportDirectory(), reportName, "Timeline Snapshot"); //NON_NLS Path reportMainFilePath; try { @@ -115,7 +118,7 @@ public class SaveSnapshotAsReport extends Action { controller.getEventsModel().getZoomParamaters(), generationDate, snapshot).writeReport(); } catch (IOException ex) { - LOGGER.log(Level.SEVERE, "Error writing report to disk at " + reportFolderPath, ex); + LOGGER.log(Level.SEVERE, "Error writing report to disk at " + reportFolderPath, ex); //NON_NLS new Alert(Alert.AlertType.ERROR, Bundle.SaveSnapShotAsReport_ErrorWritingReport(reportFolderPath)).show(); return; } @@ -124,14 +127,14 @@ public class SaveSnapshotAsReport extends Action { //add main file as report to case Case.getCurrentCase().addReport(reportMainFilePath.toString(), Bundle.Timeline_ModuleName(), reportName); } catch (TskCoreException ex) { - LOGGER.log(Level.WARNING, "Failed to add " + reportMainFilePath.toString() + " to case as a report", ex); // + LOGGER.log(Level.WARNING, "Failed to add " + reportMainFilePath.toString() + " to case as a report", ex); //NON_NLS new Alert(Alert.AlertType.ERROR, Bundle.SaveSnapShotAsReport_FailedToAddReport()).show(); return; } //notify user of report location final Alert alert = new Alert(Alert.AlertType.INFORMATION, null, OPEN, OK); - alert.setTitle(Bundle.SaveSnapshot_action_name_text()); + alert.setTitle(Bundle.SaveSnapShotAsReport_action_dialogs_title()); alert.setHeaderText(Bundle.SaveSnapShotAsReport_Success()); //make action to open report, and hyperlinklable to invoke action diff --git a/Core/src/org/sleuthkit/autopsy/timeline/snapshot/SnapShotReportWriter.java b/Core/src/org/sleuthkit/autopsy/timeline/snapshot/SnapShotReportWriter.java index 3197e8ac2d..75377ff5bb 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/snapshot/SnapShotReportWriter.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/snapshot/SnapShotReportWriter.java @@ -98,7 +98,7 @@ public class SnapShotReportWriter { Files.createDirectories(reportFolderPath); //save the snapshot in the report directory - ImageIO.write(image, "png", reportFolderPath.resolve("snapshot.png").toFile()); + ImageIO.write(image, "png", reportFolderPath.resolve("snapshot.png").toFile()); //NON-NLS copyResources(); @@ -116,12 +116,12 @@ public class SnapShotReportWriter { private void writeSnapShotHTMLFile() throws IOException { //make a map of context objects to resolve template paramaters against HashMap snapShotContext = new HashMap<>(); - snapShotContext.put("reportTitle", reportName); - snapShotContext.put("startTime", zoomParams.getTimeRange().getStart().toString(DateTimeFormat.fullDateTime())); - snapShotContext.put("endTime", zoomParams.getTimeRange().getEnd().toString(DateTimeFormat.fullDateTime())); - snapShotContext.put("zoomParams", zoomParams); + snapShotContext.put("reportTitle", reportName); //NON-NLS + snapShotContext.put("startTime", zoomParams.getTimeRange().getStart().toString(DateTimeFormat.fullDateTime())); //NON-NLS + snapShotContext.put("endTime", zoomParams.getTimeRange().getEnd().toString(DateTimeFormat.fullDateTime())); //NON-NLS + snapShotContext.put("zoomParams", zoomParams); //NON-NLS - fillTemplateAndWrite("/org/sleuthkit/autopsy/timeline/snapshot/snapshot_template.html", "Snapshot", snapShotContext, reportFolderPath.resolve("snapshot.html")); + fillTemplateAndWrite("/org/sleuthkit/autopsy/timeline/snapshot/snapshot_template.html", "Snapshot", snapShotContext, reportFolderPath.resolve("snapshot.html")); //NON-NLS } /** @@ -135,10 +135,10 @@ public class SnapShotReportWriter { private Path writeIndexHTML() throws IOException { //make a map of context objects to resolve template paramaters against HashMap indexContext = new HashMap<>(); - indexContext.put("currentCase", currentCase); - Path reportIndexFile = reportFolderPath.resolve("index.html"); + indexContext.put("currentCase", currentCase); //NON-NLS + Path reportIndexFile = reportFolderPath.resolve("index.html"); //NON-NLS - fillTemplateAndWrite("/org/sleuthkit/autopsy/timeline/snapshot/index_template.html", "Index", indexContext, reportIndexFile); + fillTemplateAndWrite("/org/sleuthkit/autopsy/timeline/snapshot/index_template.html", "Index", indexContext, reportIndexFile); //NON-NLS return reportIndexFile; } @@ -150,13 +150,13 @@ public class SnapShotReportWriter { private void writeSummaryHTML() throws IOException { //make a map of context objects to resolve template paramaters against HashMap summaryContext = new HashMap<>(); - summaryContext.put("reportName", reportName); - summaryContext.put("reportBranding", reportBranding); - summaryContext.put("generationDateTime", new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").format(generationDate)); - summaryContext.put("ingestRunning", IngestManager.getInstance().isIngestRunning()); - summaryContext.put("currentCase", currentCase); + summaryContext.put("reportName", reportName); //NON-NLS + summaryContext.put("reportBranding", reportBranding); //NON-NLS + summaryContext.put("generationDateTime", new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").format(generationDate)); //NON-NLS + summaryContext.put("ingestRunning", IngestManager.getInstance().isIngestRunning()); //NON-NLS + summaryContext.put("currentCase", currentCase); //NON-NLS - fillTemplateAndWrite("/org/sleuthkit/autopsy/timeline/snapshot/summary_template.html", "Summary", summaryContext, reportFolderPath.resolve("summary.html")); + fillTemplateAndWrite("/org/sleuthkit/autopsy/timeline/snapshot/summary_template.html", "Summary", summaryContext, reportFolderPath.resolve("summary.html")); //NON-NLS } /** @@ -178,7 +178,7 @@ public class SnapShotReportWriter { private void fillTemplateAndWrite(final String templateLocation, final String templateName, Object context, final Path outPutFile) throws IOException { Mustache summaryMustache = mf.compile(new InputStreamReader(SnapShotReportWriter.class.getResourceAsStream(templateLocation)), templateName); - try (Writer writer = Files.newBufferedWriter(outPutFile, Charset.forName("UTF-8"))) { + try (Writer writer = Files.newBufferedWriter(outPutFile, Charset.forName("UTF-8"))) { //NON-NLS summaryMustache.execute(writer, context); } } @@ -194,36 +194,36 @@ public class SnapShotReportWriter { //pull generator and agency logos from branding String generatorLogoPath = reportBranding.getGeneratorLogoPath(); if (StringUtils.isNotBlank(generatorLogoPath)) { - Files.copy(Files.newInputStream(Paths.get(generatorLogoPath)), reportFolderPath.resolve("generator_logo.png")); + Files.copy(Files.newInputStream(Paths.get(generatorLogoPath)), reportFolderPath.resolve("generator_logo.png")); //NON-NLS } String agencyLogoPath = reportBranding.getAgencyLogoPath(); if (StringUtils.isNotBlank(agencyLogoPath)) { - Files.copy(Files.newInputStream(Paths.get(agencyLogoPath)), reportFolderPath.resolve("agency_logo.png")); + Files.copy(Files.newInputStream(Paths.get(agencyLogoPath)), reportFolderPath.resolve("agency_logo.png")); //NON-NLS } //copy navigation html - try (InputStream navStream = SnapShotReportWriter.class.getResourceAsStream("/org/sleuthkit/autopsy/timeline/snapshot/navigation.html")) { - Files.copy(navStream, reportFolderPath.resolve("nav.html")); + try (InputStream navStream = SnapShotReportWriter.class.getResourceAsStream("/org/sleuthkit/autopsy/timeline/snapshot/navigation.html")) { //NON-NLS + Files.copy(navStream, reportFolderPath.resolve("nav.html")); //NON-NLS } //copy favicon - try (InputStream faviconStream = SnapShotReportWriter.class.getResourceAsStream("/org/sleuthkit/autopsy/report/images/favicon.ico")) { - Files.copy(faviconStream, reportFolderPath.resolve("favicon.ico")); + try (InputStream faviconStream = SnapShotReportWriter.class.getResourceAsStream("/org/sleuthkit/autopsy/report/images/favicon.ico")) { //NON-NLS + Files.copy(faviconStream, reportFolderPath.resolve("favicon.ico")); //NON-NLS } //copy report summary icon - try (InputStream summaryStream = SnapShotReportWriter.class.getResourceAsStream("/org/sleuthkit/autopsy/report/images/summary.png")) { - Files.copy(summaryStream, reportFolderPath.resolve("summary.png")); + try (InputStream summaryStream = SnapShotReportWriter.class.getResourceAsStream("/org/sleuthkit/autopsy/report/images/summary.png")) { //NON-NLS + Files.copy(summaryStream, reportFolderPath.resolve("summary.png")); //NON-NLS } //copy snapshot icon - try (InputStream snapshotIconStream = SnapShotReportWriter.class.getResourceAsStream("/org/sleuthkit/autopsy/timeline/images/image.png")) { - Files.copy(snapshotIconStream, reportFolderPath.resolve("snapshot_icon.png")); + try (InputStream snapshotIconStream = SnapShotReportWriter.class.getResourceAsStream("/org/sleuthkit/autopsy/timeline/images/image.png")) { //NON-NLS + Files.copy(snapshotIconStream, reportFolderPath.resolve("snapshot_icon.png")); //NON-NLS } //copy main report css - try (InputStream resource = SnapShotReportWriter.class.getResourceAsStream("/org/sleuthkit/autopsy/timeline/snapshot/index.css")) { // - Files.copy(resource, reportFolderPath.resolve("index.css")); // + try (InputStream resource = SnapShotReportWriter.class.getResourceAsStream("/org/sleuthkit/autopsy/timeline/snapshot/index.css")) { //NON-NLS + Files.copy(resource, reportFolderPath.resolve("index.css")); //NON-NLS } //copy summary css - try (InputStream resource = SnapShotReportWriter.class.getResourceAsStream("/org/sleuthkit/autopsy/timeline/snapshot/summary.css")) { // - Files.copy(resource, reportFolderPath.resolve("summary.css")); // + try (InputStream resource = SnapShotReportWriter.class.getResourceAsStream("/org/sleuthkit/autopsy/timeline/snapshot/summary.css")) { //NON-NLS + Files.copy(resource, reportFolderPath.resolve("summary.css")); //NON-NLS } } } diff --git a/Core/src/org/sleuthkit/autopsy/timeline/ui/VisualizationPanel.java b/Core/src/org/sleuthkit/autopsy/timeline/ui/VisualizationPanel.java index 3e2cf1fbb7..1fe72b5aa8 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/ui/VisualizationPanel.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/ui/VisualizationPanel.java @@ -288,7 +288,7 @@ final public class VisualizationPanel extends BorderPane { setViewMode(controller.viewModeProperty().get()); //configure snapshor button / action - ActionUtils.configureButton(new SaveSnapshotAsReport(controller, () -> VisualizationPanel.this), snapShotButton); + ActionUtils.configureButton(new SaveSnapshotAsReport(controller, VisualizationPanel.this), snapShotButton); /////configure start and end pickers startLabel.setText(Bundle.VisualizationPanel_startLabel_text()); @@ -427,54 +427,54 @@ final public class VisualizationPanel extends BorderPane { histogramTask = new LoggedTask( NbBundle.getMessage(VisualizationPanel.class, "VisualizationPanel.histogramTask.title"), true) { // NON-NLS - private final Lighting lighting = new Lighting(); + private final Lighting lighting = new Lighting(); @Override protected Void call() throws Exception { - updateMessage(NbBundle.getMessage(VisualizationPanel.class, "VisualizationPanel.histogramTask.preparing")); // NON-NLS + updateMessage(NbBundle.getMessage(VisualizationPanel.class, "VisualizationPanel.histogramTask.preparing")); // NON-NLS - long max = 0; - final RangeDivisionInfo rangeInfo = RangeDivisionInfo.getRangeDivisionInfo(filteredEvents.getSpanningInterval()); - final long lowerBound = rangeInfo.getLowerBound(); - final long upperBound = rangeInfo.getUpperBound(); - Interval timeRange = new Interval(new DateTime(lowerBound, TimeLineController.getJodaTimeZone()), new DateTime(upperBound, TimeLineController.getJodaTimeZone())); + long max = 0; + final RangeDivisionInfo rangeInfo = RangeDivisionInfo.getRangeDivisionInfo(filteredEvents.getSpanningInterval()); + final long lowerBound = rangeInfo.getLowerBound(); + final long upperBound = rangeInfo.getUpperBound(); + Interval timeRange = new Interval(new DateTime(lowerBound, TimeLineController.getJodaTimeZone()), new DateTime(upperBound, TimeLineController.getJodaTimeZone())); - //extend range to block bounderies (ie day, month, year) - int p = 0; // progress counter + //extend range to block bounderies (ie day, month, year) + int p = 0; // progress counter - //clear old data, and reset ranges and series - Platform.runLater(() -> { - updateMessage(NbBundle.getMessage(VisualizationPanel.class, "VisualizationPanel.histogramTask.resetUI")); // NON-NLS + //clear old data, and reset ranges and series + Platform.runLater(() -> { + updateMessage(NbBundle.getMessage(VisualizationPanel.class, "VisualizationPanel.histogramTask.resetUI")); // NON-NLS - }); + }); - ArrayList bins = new ArrayList<>(); + ArrayList bins = new ArrayList<>(); - DateTime start = timeRange.getStart(); - while (timeRange.contains(start)) { - if (isCancelled()) { - return null; - } - DateTime end = start.plus(rangeInfo.getPeriodSize().getPeriod()); - final Interval interval = new Interval(start, end); - //increment for next iteration + DateTime start = timeRange.getStart(); + while (timeRange.contains(start)) { + if (isCancelled()) { + return null; + } + DateTime end = start.plus(rangeInfo.getPeriodSize().getPeriod()); + final Interval interval = new Interval(start, end); + //increment for next iteration - start = end; + start = end; - updateMessage(NbBundle.getMessage(VisualizationPanel.class, "VisualizationPanel.histogramTask.queryDb")); // NON-NLS - //query for current range - long count = filteredEvents.getEventCounts(interval).values().stream().mapToLong(Long::valueOf).sum(); - bins.add(count); + updateMessage(NbBundle.getMessage(VisualizationPanel.class, "VisualizationPanel.histogramTask.queryDb")); // NON-NLS + //query for current range + long count = filteredEvents.getEventCounts(interval).values().stream().mapToLong(Long::valueOf).sum(); + bins.add(count); - max = Math.max(count, max); + max = Math.max(count, max); - final double fMax = Math.log(max); - final ArrayList fbins = new ArrayList<>(bins); - Platform.runLater(() -> { - updateMessage(NbBundle.getMessage(VisualizationPanel.class, "VisualizationPanel.histogramTask.updateUI2")); // NON-NLS + final double fMax = Math.log(max); + final ArrayList fbins = new ArrayList<>(bins); + Platform.runLater(() -> { + updateMessage(NbBundle.getMessage(VisualizationPanel.class, "VisualizationPanel.histogramTask.updateUI2")); // NON-NLS - histogramBox.getChildren().clear(); + histogramBox.getChildren().clear(); for (Long bin : fbins) { if (isCancelled()) { @@ -499,7 +499,7 @@ final public class VisualizationPanel extends BorderPane { return null; } - }; + }; new Thread(histogramTask).start(); controller.monitorTask(histogramTask); }