19 package org.sleuthkit.autopsy.report.modules.datasourcesummaryexport;
21 import java.util.Arrays;
22 import java.util.Collections;
23 import java.util.List;
24 import org.apache.commons.lang3.tuple.Pair;
25 import org.openide.util.NbBundle.Messages;
38 "ExportPastCases_caseColumn_title=Case",
39 "ExportPastCases_countColumn_title=Count",
40 "ExportPastCases_notableFileTable_tabName=Cases with common notable items",
41 "ExportPastCases_seenResultsTable_tabName=Cases with the same addresses",
42 "ExportPastCases_seenDevicesTable_tabName=Cases with the same device IDs",})
43 class ExportPastCases {
45 private final PastCasesSummary pastSummary;
48 private static final ColumnModel<Pair<String, Long>, DefaultCellModel<?>> CASE_COL =
new ColumnModel<>(
49 Bundle.ExportPastCases_caseColumn_title(),
50 (pair) ->
new DefaultCellModel<>(pair.getKey()),
55 private static final ColumnModel<Pair<String, Long>, DefaultCellModel<?>> COUNT_COL =
new ColumnModel<>(
56 Bundle.ExportPastCases_countColumn_title(),
57 (pair) ->
new DefaultCellModel<>(pair.getValue()),
62 private static List<ColumnModel<Pair<String, Long>, DefaultCellModel<?>>> DEFAULT_TEMPLATE
63 = Arrays.asList(CASE_COL, COUNT_COL);
66 pastSummary =
new PastCasesSummary();
69 List<ExcelExport.ExcelSheetExport> getExports(DataSource dataSource) {
70 DataFetcher<DataSource, PastCasesResult> pastCasesFetcher = (ds) -> pastSummary.getPastCasesData(ds);
71 PastCasesResult result = getFetchResult(pastCasesFetcher,
"Past cases sheets", dataSource);
73 return Collections.emptyList();
77 getTableExport(DEFAULT_TEMPLATE, Bundle.ExportPastCases_notableFileTable_tabName(), result.getPreviouslyNotable()),
78 getTableExport(DEFAULT_TEMPLATE, Bundle.ExportPastCases_seenResultsTable_tabName(), result.getPreviouslySeenResults()),
79 getTableExport(DEFAULT_TEMPLATE, Bundle.ExportPastCases_seenDevicesTable_tabName(), result.getPreviouslySeenDevices())