mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-17 10:17:41 +00:00
3203 add (Notable) to end of tags in generated reports
This commit is contained in:
parent
ba2f3640f2
commit
8dfd028c31
@ -71,6 +71,11 @@ public class TagsManager implements Closeable {
|
|||||||
|
|
||||||
}
|
}
|
||||||
@NbBundle.Messages({"TagsManager.notableTagEnding.text= (Notable)"})
|
@NbBundle.Messages({"TagsManager.notableTagEnding.text= (Notable)"})
|
||||||
|
/**
|
||||||
|
* Get String of text which is used to label tags as notable to the user.
|
||||||
|
*
|
||||||
|
* @return Bundle message TagsManager.notableTagEnding.text
|
||||||
|
*/
|
||||||
public static String getNotableTagLabel(){
|
public static String getNotableTagLabel(){
|
||||||
return Bundle.TagsManager_notableTagEnding_text();
|
return Bundle.TagsManager_notableTagEnding_text();
|
||||||
}
|
}
|
||||||
|
@ -63,6 +63,7 @@ import org.sleuthkit.datamodel.ContentTag;
|
|||||||
import org.sleuthkit.datamodel.Image;
|
import org.sleuthkit.datamodel.Image;
|
||||||
import org.sleuthkit.datamodel.SleuthkitCase;
|
import org.sleuthkit.datamodel.SleuthkitCase;
|
||||||
import org.sleuthkit.datamodel.TskCoreException;
|
import org.sleuthkit.datamodel.TskCoreException;
|
||||||
|
import org.sleuthkit.datamodel.TskData;
|
||||||
import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM;
|
import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM;
|
||||||
|
|
||||||
class ReportHTML implements TableReportModule {
|
class ReportHTML implements TableReportModule {
|
||||||
@ -688,7 +689,8 @@ class ReportHTML implements TableReportModule {
|
|||||||
}
|
}
|
||||||
for (int i = 0; i < tags.size(); i++) {
|
for (int i = 0; i < tags.size(); i++) {
|
||||||
ContentTag tag = tags.get(i);
|
ContentTag tag = tags.get(i);
|
||||||
linkToThumbnail.append(tag.getName().getDisplayName());
|
String notableString = tag.getName().getKnownStatus() == TskData.FileKnown.BAD ? TagsManager.getNotableTagLabel() : "";
|
||||||
|
linkToThumbnail.append(tag.getName().getDisplayName() + notableString);
|
||||||
if (i != tags.size() - 1) {
|
if (i != tags.size() - 1) {
|
||||||
linkToThumbnail.append(", ");
|
linkToThumbnail.append(", ");
|
||||||
}
|
}
|
||||||
|
@ -41,10 +41,12 @@ import javax.swing.event.ListDataListener;
|
|||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
import org.openide.windows.WindowManager;
|
import org.openide.windows.WindowManager;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.services.TagsManager;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.datamodel.BlackboardArtifact;
|
import org.sleuthkit.datamodel.BlackboardArtifact;
|
||||||
import org.sleuthkit.datamodel.TagName;
|
import org.sleuthkit.datamodel.TagName;
|
||||||
import org.sleuthkit.datamodel.TskCoreException;
|
import org.sleuthkit.datamodel.TskCoreException;
|
||||||
|
import org.sleuthkit.datamodel.TskData;
|
||||||
|
|
||||||
final class ReportVisualPanel2 extends JPanel {
|
final class ReportVisualPanel2 extends JPanel {
|
||||||
|
|
||||||
@ -102,7 +104,8 @@ final class ReportVisualPanel2 extends JPanel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (TagName tagName : tagNamesInUse) {
|
for (TagName tagName : tagNamesInUse) {
|
||||||
tagStates.put(tagName.getDisplayName(), Boolean.FALSE);
|
String notableString = tagName.getKnownStatus() == TskData.FileKnown.BAD ? TagsManager.getNotableTagLabel() : "";
|
||||||
|
tagStates.put(tagName.getDisplayName() + notableString, Boolean.FALSE);
|
||||||
}
|
}
|
||||||
tags.addAll(tagStates.keySet());
|
tags.addAll(tagStates.keySet());
|
||||||
|
|
||||||
|
@ -39,6 +39,7 @@ import java.util.TreeSet;
|
|||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.services.TagsManager;
|
||||||
import org.sleuthkit.autopsy.coreutils.EscapeUtil;
|
import org.sleuthkit.autopsy.coreutils.EscapeUtil;
|
||||||
import org.sleuthkit.autopsy.coreutils.ImageUtils;
|
import org.sleuthkit.autopsy.coreutils.ImageUtils;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
@ -299,7 +300,8 @@ class TableReportGenerator {
|
|||||||
// Give the modules the rows for the content tags.
|
// Give the modules the rows for the content tags.
|
||||||
for (ContentTag tag : tags) {
|
for (ContentTag tag : tags) {
|
||||||
// skip tags that we are not reporting on
|
// skip tags that we are not reporting on
|
||||||
if (passesTagNamesFilter(tag.getName().getDisplayName()) == false) {
|
String notableString = tag.getName().getKnownStatus() == TskData.FileKnown.BAD ? TagsManager.getNotableTagLabel() : "";
|
||||||
|
if (passesTagNamesFilter(tag.getName().getDisplayName() + notableString) == false) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -310,7 +312,7 @@ class TableReportGenerator {
|
|||||||
fileName = tag.getContent().getName();
|
fileName = tag.getContent().getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
ArrayList<String> rowData = new ArrayList<>(Arrays.asList(tag.getName().getDisplayName(), fileName, tag.getComment()));
|
ArrayList<String> rowData = new ArrayList<>(Arrays.asList(tag.getName().getDisplayName() + notableString, fileName, tag.getComment()));
|
||||||
Content content = tag.getContent();
|
Content content = tag.getContent();
|
||||||
if (content instanceof AbstractFile) {
|
if (content instanceof AbstractFile) {
|
||||||
AbstractFile file = (AbstractFile) content;
|
AbstractFile file = (AbstractFile) content;
|
||||||
@ -376,12 +378,13 @@ class TableReportGenerator {
|
|||||||
|
|
||||||
// Give the modules the rows for the content tags.
|
// Give the modules the rows for the content tags.
|
||||||
for (BlackboardArtifactTag tag : tags) {
|
for (BlackboardArtifactTag tag : tags) {
|
||||||
if (passesTagNamesFilter(tag.getName().getDisplayName()) == false) {
|
String notableString = tag.getName().getKnownStatus() == TskData.FileKnown.BAD ? TagsManager.getNotableTagLabel() : "";
|
||||||
|
if (passesTagNamesFilter(tag.getName().getDisplayName() + notableString) == false) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<String> row;
|
List<String> row;
|
||||||
row = new ArrayList<>(Arrays.asList(tag.getArtifact().getArtifactTypeName(), tag.getName().getDisplayName(), tag.getComment(), tag.getContent().getName()));
|
row = new ArrayList<>(Arrays.asList(tag.getArtifact().getArtifactTypeName(), tag.getName().getDisplayName() + notableString, tag.getComment(), tag.getContent().getName()));
|
||||||
tableReport.addRow(row);
|
tableReport.addRow(row);
|
||||||
|
|
||||||
// check if the tag is an image that we should later make a thumbnail for
|
// check if the tag is an image that we should later make a thumbnail for
|
||||||
@ -963,7 +966,8 @@ class TableReportGenerator {
|
|||||||
try {
|
try {
|
||||||
List<ContentTag> contentTags = Case.getCurrentCase().getServices().getTagsManager().getContentTagsByContent(content);
|
List<ContentTag> contentTags = Case.getCurrentCase().getServices().getTagsManager().getContentTagsByContent(content);
|
||||||
for (ContentTag ct : contentTags) {
|
for (ContentTag ct : contentTags) {
|
||||||
allTags.add(ct.getName().getDisplayName());
|
String notableString = ct.getName().getKnownStatus() == TskData.FileKnown.BAD ? TagsManager.getNotableTagLabel() : "";
|
||||||
|
allTags.add(ct.getName().getDisplayName() + notableString);
|
||||||
}
|
}
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException ex) {
|
||||||
errorList.add(NbBundle.getMessage(this.getClass(), "ReportGenerator.errList.failedGetContentTags"));
|
errorList.add(NbBundle.getMessage(this.getClass(), "ReportGenerator.errList.failedGetContentTags"));
|
||||||
@ -1000,7 +1004,8 @@ class TableReportGenerator {
|
|||||||
List<BlackboardArtifactTag> tags = Case.getCurrentCase().getServices().getTagsManager().getBlackboardArtifactTagsByArtifact(artifact);
|
List<BlackboardArtifactTag> tags = Case.getCurrentCase().getServices().getTagsManager().getBlackboardArtifactTagsByArtifact(artifact);
|
||||||
HashSet<String> uniqueTagNames = new HashSet<>();
|
HashSet<String> uniqueTagNames = new HashSet<>();
|
||||||
for (BlackboardArtifactTag tag : tags) {
|
for (BlackboardArtifactTag tag : tags) {
|
||||||
uniqueTagNames.add(tag.getName().getDisplayName());
|
String notableString = tag.getName().getKnownStatus() == TskData.FileKnown.BAD ? TagsManager.getNotableTagLabel() : "";
|
||||||
|
uniqueTagNames.add(tag.getName().getDisplayName() + notableString);
|
||||||
}
|
}
|
||||||
if (failsTagFilter(uniqueTagNames, tagNamesFilter)) {
|
if (failsTagFilter(uniqueTagNames, tagNamesFilter)) {
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user