mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-06 21:00:22 +00:00
table showing right
This commit is contained in:
parent
a4a3e0f42e
commit
c8b7bb2a31
@ -71,8 +71,6 @@ import org.sleuthkit.datamodel.BlackboardArtifact.Category;
|
|||||||
import org.sleuthkit.datamodel.BlackboardAttribute;
|
import org.sleuthkit.datamodel.BlackboardAttribute;
|
||||||
import org.sleuthkit.datamodel.DataArtifact;
|
import org.sleuthkit.datamodel.DataArtifact;
|
||||||
import org.sleuthkit.datamodel.Score;
|
import org.sleuthkit.datamodel.Score;
|
||||||
import org.sleuthkit.datamodel.Score.Priority;
|
|
||||||
import org.sleuthkit.datamodel.Score.Significance;
|
|
||||||
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.TSK_FS_NAME_FLAG_ENUM;
|
import org.sleuthkit.datamodel.TskData.TSK_FS_NAME_FLAG_ENUM;
|
||||||
@ -215,13 +213,13 @@ public class ScoreDAO extends AbstractDAO {
|
|||||||
String filterSql = Stream.of(filterSqlPair.getRight(), dsClause)
|
String filterSql = Stream.of(filterSqlPair.getRight(), dsClause)
|
||||||
.filter(StringUtils::isNotBlank)
|
.filter(StringUtils::isNotBlank)
|
||||||
.collect(Collectors.joining("\nAND "));
|
.collect(Collectors.joining("\nAND "));
|
||||||
|
|
||||||
if (StringUtils.isNotBlank(filterSql)) {
|
if (StringUtils.isNotBlank(filterSql)) {
|
||||||
filterSql = "\n WHERE " + filterSql;
|
filterSql = "\n WHERE " + filterSql;
|
||||||
}
|
}
|
||||||
|
|
||||||
return "(SELECT COUNT(aggr_score.obj_id) "
|
return "(SELECT COUNT(aggr_score.obj_id) "
|
||||||
+ BASE_AGGR_SCORE_QUERY
|
+ BASE_AGGR_SCORE_QUERY
|
||||||
+ filterSql
|
+ filterSql
|
||||||
+ ") AS "
|
+ ") AS "
|
||||||
+ filterSqlPair.getLeft();
|
+ filterSqlPair.getLeft();
|
||||||
@ -365,23 +363,28 @@ public class ScoreDAO extends AbstractDAO {
|
|||||||
List<AbstractFile> files = getCase().findAllFilesWhere("obj_id IN (" + joinedFileIds + ")");
|
List<AbstractFile> files = getCase().findAllFilesWhere("obj_id IN (" + joinedFileIds + ")");
|
||||||
|
|
||||||
for (AbstractFile file : files) {
|
for (AbstractFile file : files) {
|
||||||
dataRows.add(new FileRowDTO(
|
List<Object> cellValues = Arrays.asList(
|
||||||
file,
|
|
||||||
file.getId(),
|
|
||||||
file.getName(),
|
file.getName(),
|
||||||
file.getNameExtension(),
|
Bundle.ScoreDAO_types_filelbl(),
|
||||||
MediaTypeUtils.getExtensionMediaType(file.getNameExtension()),
|
file.getUniquePath(),
|
||||||
file.isDirNameFlagSet(TSK_FS_NAME_FLAG_ENUM.ALLOC),
|
file.getCtime() <= 0
|
||||||
file.getType(),
|
? null
|
||||||
// the modified column types: source name, type, path, created time
|
: TimeZoneUtils.getFormattedTime(file.getCtime())
|
||||||
Arrays.asList(
|
);
|
||||||
|
|
||||||
|
dataRows.add(new ScoreResultRowDTO(
|
||||||
|
new FileRowDTO(
|
||||||
|
file,
|
||||||
|
file.getId(),
|
||||||
file.getName(),
|
file.getName(),
|
||||||
Bundle.ScoreDAO_types_filelbl(),
|
file.getNameExtension(),
|
||||||
file.getUniquePath(),
|
MediaTypeUtils.getExtensionMediaType(file.getNameExtension()),
|
||||||
file.getCtime() <= 0
|
file.isDirNameFlagSet(TSK_FS_NAME_FLAG_ENUM.ALLOC),
|
||||||
? null
|
file.getType(),
|
||||||
: TimeZoneUtils.getFormattedTime(file.getCtime())
|
cellValues),
|
||||||
)));
|
// the modified column types: source name, type, path, created time
|
||||||
|
cellValues,
|
||||||
|
file.getId()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -396,23 +399,30 @@ public class ScoreDAO extends AbstractDAO {
|
|||||||
// all rows should be data artifact rows, and can be appended accordingly
|
// all rows should be data artifact rows, and can be appended accordingly
|
||||||
for (RowDTO rowDTO : artTableData.rows) {
|
for (RowDTO rowDTO : artTableData.rows) {
|
||||||
if (rowDTO instanceof DataArtifactRowDTO dataArtRow) {
|
if (rowDTO instanceof DataArtifactRowDTO dataArtRow) {
|
||||||
dataRows.add(new DataArtifactRowDTO(
|
BlackboardArtifact.Type artifactType = dataArtRow.getArtifact().getType();
|
||||||
dataArtRow.getArtifact(),
|
List<Object> cellValues = Arrays.asList(
|
||||||
dataArtRow.getSrcContent(),
|
dataArtRow.getSrcContent().getName(),
|
||||||
dataArtRow.getLinkedFile(),
|
artifactType.getDisplayName(),
|
||||||
dataArtRow.isTimelineSupported(),
|
dataArtRow.getArtifact().getUniquePath(),
|
||||||
Arrays.asList(
|
getTimeStamp(dataArtRow.getArtifact())
|
||||||
dataArtRow.getSrcContent().getName(),
|
);
|
||||||
dataArtRow.getArtifact().getType().getDisplayName(),
|
|
||||||
dataArtRow.getArtifact().getUniquePath(),
|
dataRows.add(new ScoreResultRowDTO(
|
||||||
getTimeStamp(dataArtRow.getArtifact())
|
new DataArtifactRowDTO(
|
||||||
),
|
dataArtRow.getArtifact(),
|
||||||
|
dataArtRow.getSrcContent(),
|
||||||
|
dataArtRow.getLinkedFile(),
|
||||||
|
dataArtRow.isTimelineSupported(),
|
||||||
|
cellValues,
|
||||||
|
dataArtRow.getId()),
|
||||||
|
artifactType,
|
||||||
|
cellValues,
|
||||||
dataArtRow.getId()));
|
dataArtRow.getId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
return new BaseSearchResultsDTO(
|
return new BaseSearchResultsDTO(
|
||||||
SCORE_TYPE_ID,
|
SCORE_TYPE_ID,
|
||||||
Bundle.ScoreDAO_mainNode_displayName(),
|
Bundle.ScoreDAO_mainNode_displayName(),
|
||||||
|
@ -0,0 +1,65 @@
|
|||||||
|
/*
|
||||||
|
* Autopsy Forensic Browser
|
||||||
|
*
|
||||||
|
* Copyright 2023 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.mainui.datamodel;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import org.sleuthkit.datamodel.BlackboardArtifact;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Score results dto.
|
||||||
|
*/
|
||||||
|
public class ScoreResultRowDTO extends BaseRowDTO {
|
||||||
|
private static final String TYPE_ID = "SCORE_RESULT_ROW";
|
||||||
|
|
||||||
|
public static String getTypeIdForClass() {
|
||||||
|
return TYPE_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private final FileRowDTO fileDTO;
|
||||||
|
private final DataArtifactRowDTO artifactDTO;
|
||||||
|
private final BlackboardArtifact.Type artifactType;
|
||||||
|
|
||||||
|
|
||||||
|
public ScoreResultRowDTO(FileRowDTO fileDTO, List<Object> cellValues, long id) {
|
||||||
|
super(cellValues, TYPE_ID, id);
|
||||||
|
this.fileDTO = fileDTO;
|
||||||
|
this.artifactDTO = null;
|
||||||
|
this.artifactType = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ScoreResultRowDTO(DataArtifactRowDTO artifactDTO, BlackboardArtifact.Type artifactType, List<Object> cellValues, long id) {
|
||||||
|
super(cellValues, TYPE_ID, id);
|
||||||
|
this.fileDTO = null;
|
||||||
|
this.artifactDTO = artifactDTO;
|
||||||
|
this.artifactType = artifactType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FileRowDTO getFileDTO() {
|
||||||
|
return fileDTO;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DataArtifactRowDTO getArtifactDTO() {
|
||||||
|
return artifactDTO;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BlackboardArtifact.Type getArtifactType() {
|
||||||
|
return artifactType;
|
||||||
|
}
|
||||||
|
}
|
@ -92,8 +92,8 @@ public class SearchResultChildFactory extends ChildFactory<ChildKey> {
|
|||||||
String typeId = key.getRow().getTypeId();
|
String typeId = key.getRow().getTypeId();
|
||||||
try {
|
try {
|
||||||
if (ScoreResultRowDTO.getTypeIdForClass().equals(typeId) && key.getRow() instanceof ScoreResultRowDTO scoreRow) {
|
if (ScoreResultRowDTO.getTypeIdForClass().equals(typeId) && key.getRow() instanceof ScoreResultRowDTO scoreRow) {
|
||||||
if (scoreRow.getArtifactDTO() != null) {
|
if (scoreRow.getArtifactDTO() != null && scoreRow.getArtifactType() != null) {
|
||||||
String iconPath = IconsUtil.getIconFilePath(scoreRow.getArtifactTypeId());
|
String iconPath = IconsUtil.getIconFilePath(scoreRow.getArtifactType().getTypeID());
|
||||||
return new DataArtifactNode(key.getSearchResults(), scoreRow.getArtifactDTO(), iconPath, nodeThreadPool);
|
return new DataArtifactNode(key.getSearchResults(), scoreRow.getArtifactDTO(), iconPath, nodeThreadPool);
|
||||||
} else if (scoreRow.getFileDTO() != null) {
|
} else if (scoreRow.getFileDTO() != null) {
|
||||||
return new FileNode(key.getSearchResults(), scoreRow.getFileDTO(), true, nodeThreadPool);
|
return new FileNode(key.getSearchResults(), scoreRow.getFileDTO(), true, nodeThreadPool);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user