Merge pull request #6556 from wschaeferB/7050-PolishDomainDetailViewers

7050 polish domain detail viewers
This commit is contained in:
Richard Cordovano 2020-12-29 18:05:00 -05:00 committed by GitHub
commit ab87da96f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 256 additions and 73 deletions

View File

@ -46,10 +46,24 @@ DataContentViewerArtifact.failedToGetSourcePath.message=Failed to get source fil
DefaultTableArtifactContentViewer.attrsTableHeader.sources=Source(s) DefaultTableArtifactContentViewer.attrsTableHeader.sources=Source(s)
DefaultTableArtifactContentViewer.attrsTableHeader.type=Type DefaultTableArtifactContentViewer.attrsTableHeader.type=Type
DefaultTableArtifactContentViewer.attrsTableHeader.value=Value DefaultTableArtifactContentViewer.attrsTableHeader.value=Value
GeneralPurposeArtifactViewer.details.attrHeader=Attributes GeneralPurposeArtifactViewer.dates.created=Created
GeneralPurposeArtifactViewer.dates.end=End
GeneralPurposeArtifactViewer.dates.start=Start
GeneralPurposeArtifactViewer.dates.time=Time
GeneralPurposeArtifactViewer.details.attrHeader=Details
GeneralPurposeArtifactViewer.details.bookmarkHeader=Bookmark Details
GeneralPurposeArtifactViewer.details.cachedHeader=Cached File
GeneralPurposeArtifactViewer.details.cookieHeader=Cookie Details
GeneralPurposeArtifactViewer.details.dataSource=Data Source GeneralPurposeArtifactViewer.details.dataSource=Data Source
GeneralPurposeArtifactViewer.details.datesHeader=Dates
GeneralPurposeArtifactViewer.details.downloadHeader=Downloaded File
GeneralPurposeArtifactViewer.details.file=File GeneralPurposeArtifactViewer.details.file=File
GeneralPurposeArtifactViewer.details.historyHeader=Visit Details
GeneralPurposeArtifactViewer.details.otherHeader=Other
GeneralPurposeArtifactViewer.details.searchHeader=Web Search
GeneralPurposeArtifactViewer.details.sourceHeader=Source GeneralPurposeArtifactViewer.details.sourceHeader=Source
GeneralPurposeArtifactViewer.noFile.text=\ (no longer exists)
GeneralPurposeArtifactViewer.term.label=Term
GeneralPurposeArtifactViewer.unknown.text=Unknown GeneralPurposeArtifactViewer.unknown.text=Unknown
GeneralPurposeArtifactViewer_menuitem_copy=Copy GeneralPurposeArtifactViewer_menuitem_copy=Copy
MessageAccountPanel.account.justification=Account found in Message artifact MessageAccountPanel.account.justification=Account found in Message artifact

View File

@ -1,11 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.4" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo"> <Form version="1.4" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<Properties>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[0, 0]"/>
</Property>
</Properties>
<AuxValues> <AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/> <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
@ -16,18 +11,30 @@
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,0,0,0,0,0,0"/>
</AuxValues> </AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
<SubComponents>
<Container class="javax.swing.JPanel" name="detailsPanel">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
<BorderConstraints direction="First"/>
</Constraint>
</Constraints>
<Layout> <Layout>
<DimensionLayout dim="0"> <DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="400" max="32767" attributes="0"/> <EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group> </Group>
</DimensionLayout> </DimensionLayout>
<DimensionLayout dim="1"> <DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="300" max="32767" attributes="0"/> <EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group> </Group>
</DimensionLayout> </DimensionLayout>
</Layout> </Layout>
</Container>
</SubComponents>
</Form> </Form>

View File

@ -29,6 +29,7 @@ import java.awt.datatransfer.StringSelection;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -39,6 +40,7 @@ import javax.swing.JPopupMenu;
import javax.swing.JScrollPane; import javax.swing.JScrollPane;
import javax.swing.JTextPane; import javax.swing.JTextPane;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import org.apache.commons.lang.StringUtils;
import org.openide.util.NbBundle; import org.openide.util.NbBundle;
import org.openide.util.lookup.ServiceProvider; import org.openide.util.lookup.ServiceProvider;
import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.Logger;
@ -76,6 +78,7 @@ public class GeneralPurposeArtifactViewer extends AbstractArtifactDetailsPanel i
BlackboardAttribute.ATTRIBUTE_TYPE.TSK_VALUE.getTypeID(), BlackboardAttribute.ATTRIBUTE_TYPE.TSK_TEXT.getTypeID(), BlackboardAttribute.ATTRIBUTE_TYPE.TSK_VALUE.getTypeID(), BlackboardAttribute.ATTRIBUTE_TYPE.TSK_TEXT.getTypeID(),
BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PATH.getTypeID(), BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PATH_ID.getTypeID(), BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PATH.getTypeID(), BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PATH_ID.getTypeID(),
BlackboardAttribute.ATTRIBUTE_TYPE.TSK_HEADERS.getTypeID()}; BlackboardAttribute.ATTRIBUTE_TYPE.TSK_HEADERS.getTypeID()};
private static final List<Integer> TYPES_WITH_DATE_SECTION = Arrays.asList(new Integer[]{BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_COOKIE.getTypeID()});
private final GridBagLayout gridBagLayout = new GridBagLayout(); private final GridBagLayout gridBagLayout = new GridBagLayout();
private final GridBagConstraints gridBagConstraints = new GridBagConstraints(); private final GridBagConstraints gridBagConstraints = new GridBagConstraints();
private final Map<Integer, Integer[]> orderingMap = new HashMap<>(); private final Map<Integer, Integer[]> orderingMap = new HashMap<>();
@ -85,13 +88,51 @@ public class GeneralPurposeArtifactViewer extends AbstractArtifactDetailsPanel i
*/ */
@ThreadConfined(type = ThreadConfined.ThreadType.AWT) @ThreadConfined(type = ThreadConfined.ThreadType.AWT)
public GeneralPurposeArtifactViewer() { public GeneralPurposeArtifactViewer() {
orderingMap.put(BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_BOOKMARK.getTypeID(), DEFAULT_ORDERING); addOrderings();
orderingMap.put(BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_CACHE.getTypeID(), DEFAULT_ORDERING);
orderingMap.put(BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_DOWNLOAD.getTypeID(), DEFAULT_ORDERING);
orderingMap.put(BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_SEARCH_QUERY.getTypeID(), DEFAULT_ORDERING);
orderingMap.put(BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_HISTORY.getTypeID(), DEFAULT_ORDERING);
orderingMap.put(BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_BOOKMARK.getTypeID(), DEFAULT_ORDERING);
initComponents(); initComponents();
detailsPanel.setLayout(gridBagLayout);
}
/**
* Private helper method to add the orderings used for each artifact type to
* the map for lookup.
*/
private void addOrderings() {
orderingMap.put(BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_BOOKMARK.getTypeID(), new Integer[]{BlackboardAttribute.ATTRIBUTE_TYPE.TSK_NAME.getTypeID(),
BlackboardAttribute.ATTRIBUTE_TYPE.TSK_TITLE.getTypeID(),
BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_ACCESSED.getTypeID(), BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_CREATED.getTypeID(),
BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_START.getTypeID(), BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_END.getTypeID(),
BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DOMAIN.getTypeID(), BlackboardAttribute.ATTRIBUTE_TYPE.TSK_URL.getTypeID(),
BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PROG_NAME.getTypeID()});
orderingMap.put(BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_CACHE.getTypeID(), new Integer[]{BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DOMAIN.getTypeID(),
BlackboardAttribute.ATTRIBUTE_TYPE.TSK_URL.getTypeID(),
BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_ACCESSED.getTypeID(), BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_CREATED.getTypeID(),
BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_START.getTypeID(), BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_END.getTypeID(),
BlackboardAttribute.ATTRIBUTE_TYPE.TSK_HEADERS.getTypeID(), BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PATH.getTypeID(),
BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PROG_NAME.getTypeID()});
orderingMap.put(BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_DOWNLOAD.getTypeID(), new Integer[]{BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DOMAIN.getTypeID(),
BlackboardAttribute.ATTRIBUTE_TYPE.TSK_URL.getTypeID(),
BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_ACCESSED.getTypeID(), BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_CREATED.getTypeID(),
BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_START.getTypeID(), BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_END.getTypeID(),
BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PATH.getTypeID(),
BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PROG_NAME.getTypeID()});
orderingMap.put(BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_SEARCH_QUERY.getTypeID(), new Integer[]{BlackboardAttribute.ATTRIBUTE_TYPE.TSK_TEXT.getTypeID(),
BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_ACCESSED.getTypeID(), BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_CREATED.getTypeID(),
BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_START.getTypeID(), BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_END.getTypeID(),
BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DOMAIN.getTypeID(),
BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PROG_NAME.getTypeID()});
orderingMap.put(BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_HISTORY.getTypeID(), new Integer[]{BlackboardAttribute.ATTRIBUTE_TYPE.TSK_TITLE.getTypeID(),
BlackboardAttribute.ATTRIBUTE_TYPE.TSK_USER_NAME.getTypeID(),
BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_ACCESSED.getTypeID(), BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_CREATED.getTypeID(),
BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_START.getTypeID(), BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_END.getTypeID(),
BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DOMAIN.getTypeID(), BlackboardAttribute.ATTRIBUTE_TYPE.TSK_URL.getTypeID(),
BlackboardAttribute.ATTRIBUTE_TYPE.TSK_REFERRER.getTypeID(),
BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PROG_NAME.getTypeID()});
orderingMap.put(BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_COOKIE.getTypeID(), new Integer[]{BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DOMAIN.getTypeID(),
BlackboardAttribute.ATTRIBUTE_TYPE.TSK_URL.getTypeID(),
BlackboardAttribute.ATTRIBUTE_TYPE.TSK_NAME.getTypeID(),
BlackboardAttribute.ATTRIBUTE_TYPE.TSK_VALUE.getTypeID(),
BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PROG_NAME.getTypeID()});
} }
@ThreadConfined(type = ThreadConfined.ThreadType.AWT) @ThreadConfined(type = ThreadConfined.ThreadType.AWT)
@ -114,15 +155,14 @@ public class GeneralPurposeArtifactViewer extends AbstractArtifactDetailsPanel i
attributeMap.put(bba.getAttributeType().getTypeID(), attrList); attributeMap.put(bba.getAttributeType().getTypeID(), attrList);
} }
dataSourceName = artifact.getDataSource().getName(); dataSourceName = artifact.getDataSource().getName();
sourceFileName = artifact.getParent().getName(); sourceFileName = artifact.getParent().getUniquePath();
} catch (TskCoreException ex) { } catch (TskCoreException ex) {
logger.log(Level.WARNING, "Unable to get attributes for artifact " + artifact.getArtifactID(), ex); logger.log(Level.WARNING, "Unable to get attributes for artifact " + artifact.getArtifactID(), ex);
} }
updateView(artifact, attributeMap, dataSourceName, sourceFileName); updateView(artifact, attributeMap, dataSourceName, sourceFileName);
} }
this.setLayout(this.gridBagLayout); revalidate();
this.revalidate(); repaint();
this.repaint();
} }
/** /**
@ -131,7 +171,7 @@ public class GeneralPurposeArtifactViewer extends AbstractArtifactDetailsPanel i
@ThreadConfined(type = ThreadConfined.ThreadType.AWT) @ThreadConfined(type = ThreadConfined.ThreadType.AWT)
private void resetComponent() { private void resetComponent() {
// clear the panel // clear the panel
this.removeAll(); detailsPanel.removeAll();
gridBagConstraints.anchor = GridBagConstraints.FIRST_LINE_START; gridBagConstraints.anchor = GridBagConstraints.FIRST_LINE_START;
gridBagConstraints.gridy = 0; gridBagConstraints.gridy = 0;
gridBagConstraints.gridx = LABEL_COLUMN; gridBagConstraints.gridx = LABEL_COLUMN;
@ -144,24 +184,31 @@ public class GeneralPurposeArtifactViewer extends AbstractArtifactDetailsPanel i
@ThreadConfined(type = ThreadConfined.ThreadType.AWT) @ThreadConfined(type = ThreadConfined.ThreadType.AWT)
@Override @Override
public Component getComponent() { public Component getComponent() {
// Slap a vertical scrollbar on the panel. // Slap a vertical scrollbar on the panel
return new JScrollPane(this, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); return new JScrollPane(this, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
} }
@ThreadConfined(type = ThreadConfined.ThreadType.AWT) @ThreadConfined(type = ThreadConfined.ThreadType.AWT)
@Override @Override
public boolean isSupported(BlackboardArtifact artifact) { public boolean isSupported(BlackboardArtifact artifact) {
return (artifact != null) return (artifact != null)
&& (artifact.getArtifactTypeID() == BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_HISTORY.getTypeID() && (artifact.getArtifactTypeID() == BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_HISTORY.getTypeID()
|| artifact.getArtifactTypeID() == BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_SEARCH_QUERY.getTypeID() || artifact.getArtifactTypeID() == BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_SEARCH_QUERY.getTypeID()
|| artifact.getArtifactTypeID() == BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_COOKIE.getTypeID() || artifact.getArtifactTypeID() == BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_COOKIE.getTypeID()
|| artifact.getArtifactTypeID() == BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_BOOKMARK.getTypeID()); || artifact.getArtifactTypeID() == BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_BOOKMARK.getTypeID()
|| artifact.getArtifactTypeID() == BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_DOWNLOAD.getTypeID()
|| artifact.getArtifactTypeID() == BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_CACHE.getTypeID()
|| artifact.getArtifactTypeID() == BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_ACCOUNT_TYPE.getTypeID()
|| artifact.getArtifactTypeID() == BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_FORM_ADDRESS.getTypeID()
|| artifact.getArtifactTypeID() == BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_FORM_AUTOFILL.getTypeID());
} }
@NbBundle.Messages({"GeneralPurposeArtifactViewer.details.attrHeader=Attributes", @NbBundle.Messages({"GeneralPurposeArtifactViewer.details.attrHeader=Details",
"GeneralPurposeArtifactViewer.details.sourceHeader=Source", "GeneralPurposeArtifactViewer.details.sourceHeader=Source",
"GeneralPurposeArtifactViewer.details.dataSource=Data Source", "GeneralPurposeArtifactViewer.details.dataSource=Data Source",
"GeneralPurposeArtifactViewer.details.file=File"}) "GeneralPurposeArtifactViewer.details.file=File",
"GeneralPurposeArtifactViewer.details.datesHeader=Dates"})
/** /**
* This method is called from within the constructor to initialize the form. * This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always * WARNING: Do NOT modify this code. The content of this method is always
@ -171,18 +218,22 @@ public class GeneralPurposeArtifactViewer extends AbstractArtifactDetailsPanel i
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() { private void initComponents() {
setPreferredSize(new java.awt.Dimension(0, 0)); detailsPanel = new javax.swing.JPanel();
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); setLayout(new java.awt.BorderLayout());
this.setLayout(layout);
layout.setHorizontalGroup( javax.swing.GroupLayout detailsPanelLayout = new javax.swing.GroupLayout(detailsPanel);
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) detailsPanel.setLayout(detailsPanelLayout);
.addGap(0, 400, Short.MAX_VALUE) detailsPanelLayout.setHorizontalGroup(
detailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 0, Short.MAX_VALUE)
); );
layout.setVerticalGroup( detailsPanelLayout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) detailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 300, Short.MAX_VALUE) .addGap(0, 0, Short.MAX_VALUE)
); );
add(detailsPanel, java.awt.BorderLayout.PAGE_START);
}// </editor-fold>//GEN-END:initComponents }// </editor-fold>//GEN-END:initComponents
/** /**
@ -195,11 +246,18 @@ public class GeneralPurposeArtifactViewer extends AbstractArtifactDetailsPanel i
* @param sourceFileName The name of the file that caused the creation of * @param sourceFileName The name of the file that caused the creation of
* the artifact. * the artifact.
*/ */
@NbBundle.Messages({"GeneralPurposeArtifactViewer.dates.created=Created",
"GeneralPurposeArtifactViewer.dates.start=Start",
"GeneralPurposeArtifactViewer.dates.end=End",
"GeneralPurposeArtifactViewer.dates.time=Time",
"GeneralPurposeArtifactViewer.term.label=Term",
"GeneralPurposeArtifactViewer.details.otherHeader=Other",
"GeneralPurposeArtifactViewer.noFile.text= (no longer exists)"})
@ThreadConfined(type = ThreadConfined.ThreadType.AWT) @ThreadConfined(type = ThreadConfined.ThreadType.AWT)
private void updateView(BlackboardArtifact artifact, Map<Integer, List<BlackboardAttribute>> attributeMap, String dataSourceName, String sourceFileName) { private void updateView(BlackboardArtifact artifact, Map<Integer, List<BlackboardAttribute>> attributeMap, String dataSourceName, String sourceFilePath) {
final Integer artifactTypeId = artifact.getArtifactTypeID(); final Integer artifactTypeId = artifact.getArtifactTypeID();
if (!(artifactTypeId < 1 || artifactTypeId >= Integer.MAX_VALUE)) { if (!(artifactTypeId < 1 || artifactTypeId >= Integer.MAX_VALUE)) {
addHeader(Bundle.GeneralPurposeArtifactViewer_details_attrHeader()); addDetailsHeader(artifactTypeId);
Integer[] orderingArray = orderingMap.get(artifactTypeId); Integer[] orderingArray = orderingMap.get(artifactTypeId);
if (orderingArray == null) { if (orderingArray == null) {
orderingArray = DEFAULT_ORDERING; orderingArray = DEFAULT_ORDERING;
@ -209,13 +267,35 @@ public class GeneralPurposeArtifactViewer extends AbstractArtifactDetailsPanel i
if (attrList != null) { if (attrList != null) {
for (BlackboardAttribute bba : attrList) { for (BlackboardAttribute bba : attrList) {
if (bba.getAttributeType().getTypeName().startsWith("TSK_DATETIME")) { if (bba.getAttributeType().getTypeName().startsWith("TSK_DATETIME")) {
if (artifact.getArtifactTypeID() == BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_SEARCH_QUERY.getTypeID()) {
addNameValueRow(Bundle.GeneralPurposeArtifactViewer_dates_time(), TimeUtilities.epochToTime(bba.getValueLong(), ContentUtils.getTimeZone(artifact)));
} else {
addNameValueRow(bba.getAttributeType().getDisplayName(), TimeUtilities.epochToTime(bba.getValueLong(), ContentUtils.getTimeZone(artifact))); addNameValueRow(bba.getAttributeType().getDisplayName(), TimeUtilities.epochToTime(bba.getValueLong(), ContentUtils.getTimeZone(artifact)));
}
} else if (bba.getAttributeType().getTypeID() == BlackboardAttribute.ATTRIBUTE_TYPE.TSK_TEXT.getTypeID() && artifact.getArtifactTypeID() == BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_SEARCH_QUERY.getTypeID()) {
addNameValueRow(Bundle.GeneralPurposeArtifactViewer_term_label(), bba.getDisplayString());
} else if (bba.getAttributeType().getTypeID() == BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PATH.getTypeID()) {
String displayString = bba.getDisplayString();
if (!attributeMap.containsKey(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PATH_ID.getTypeID())) {
displayString += Bundle.GeneralPurposeArtifactViewer_noFile_text();
}
addNameValueRow(bba.getAttributeType().getDisplayName(), displayString);
} else { } else {
addNameValueRow(bba.getAttributeType().getDisplayName(), bba.getDisplayString()); addNameValueRow(bba.getAttributeType().getDisplayName(), bba.getDisplayString());
} }
} }
} }
} }
if (TYPES_WITH_DATE_SECTION.contains(BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_COOKIE.getTypeID())) {
boolean headerAdded = false;
headerAdded = addDates(Bundle.GeneralPurposeArtifactViewer_dates_created(), attributeMap.remove(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_CREATED.getTypeID()), headerAdded);
headerAdded = addDates(Bundle.GeneralPurposeArtifactViewer_dates_start(), attributeMap.remove(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_START.getTypeID()), headerAdded);
headerAdded = addDates(Bundle.GeneralPurposeArtifactViewer_dates_end(), attributeMap.remove(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_END.getTypeID()), headerAdded);
addDates(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME.getDisplayName(), attributeMap.remove(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME.getTypeID()), headerAdded);
}
if (!attributeMap.keySet().isEmpty()) {
addHeader(Bundle.GeneralPurposeArtifactViewer_details_otherHeader());
for (int key : attributeMap.keySet()) { for (int key : attributeMap.keySet()) {
for (BlackboardAttribute bba : attributeMap.get(key)) { for (BlackboardAttribute bba : attributeMap.get(key)) {
if (bba.getAttributeType().getTypeName().startsWith("TSK_DATETIME")) { if (bba.getAttributeType().getTypeName().startsWith("TSK_DATETIME")) {
@ -225,14 +305,74 @@ public class GeneralPurposeArtifactViewer extends AbstractArtifactDetailsPanel i
} }
} }
} }
}
addHeader(Bundle.GeneralPurposeArtifactViewer_details_sourceHeader()); addHeader(Bundle.GeneralPurposeArtifactViewer_details_sourceHeader());
addNameValueRow(Bundle.GeneralPurposeArtifactViewer_details_dataSource(), dataSourceName); addNameValueRow(Bundle.GeneralPurposeArtifactViewer_details_dataSource(), dataSourceName);
addNameValueRow(Bundle.GeneralPurposeArtifactViewer_details_file(), sourceFileName); addNameValueRow(Bundle.GeneralPurposeArtifactViewer_details_file(), sourceFilePath);
// add veritcal glue at the end // add veritcal glue at the end
addPageEndGlue(); addPageEndGlue();
} }
} }
/**
* Private helper method to add all dates in a given attribute list.
*
* @param label Specific String to use in place of attributes display
* name.
* @param attrList List of attributes to add dates for.
* @param headerExists If the "Dates" header has already been displayed.
*
* @return True if the "Dates" header has been displayed, false otherwise.
*/
private boolean addDates(String label, List<BlackboardAttribute> attrList, boolean headerExists) {
boolean headerAdded = headerExists;
if (attrList != null) {
if (!headerAdded) {
addHeader(Bundle.GeneralPurposeArtifactViewer_details_datesHeader());
headerAdded = true;
}
String labelToUse = label;
for (BlackboardAttribute bba : attrList) {
if (StringUtils.isBlank(label)) {
labelToUse = bba.getAttributeType().getDisplayName();
}
addNameValueRow(labelToUse, bba.getDisplayString());
}
}
return headerAdded;
}
/**
* Helper method to add an artifact specific details header.
*
* @param artifactTypeId ID of artifact type to add header for.
*/
@NbBundle.Messages({"GeneralPurposeArtifactViewer.details.bookmarkHeader=Bookmark Details",
"GeneralPurposeArtifactViewer.details.historyHeader=Visit Details",
"GeneralPurposeArtifactViewer.details.downloadHeader=Downloaded File",
"GeneralPurposeArtifactViewer.details.searchHeader=Web Search",
"GeneralPurposeArtifactViewer.details.cachedHeader=Cached File",
"GeneralPurposeArtifactViewer.details.cookieHeader=Cookie Details",})
private void addDetailsHeader(int artifactTypeId) {
String header;
if (artifactTypeId == BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_HISTORY.getTypeID()) {
header = Bundle.GeneralPurposeArtifactViewer_details_historyHeader();
} else if (artifactTypeId == BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_BOOKMARK.getTypeID()) {
header = Bundle.GeneralPurposeArtifactViewer_details_bookmarkHeader();
} else if (artifactTypeId == BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_CACHE.getTypeID()) {
header = Bundle.GeneralPurposeArtifactViewer_details_cachedHeader();
} else if (artifactTypeId == BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_COOKIE.getTypeID()) {
header = Bundle.GeneralPurposeArtifactViewer_details_cookieHeader();
} else if (artifactTypeId == BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_DOWNLOAD.getTypeID()) {
header = Bundle.GeneralPurposeArtifactViewer_details_downloadHeader();
} else if (artifactTypeId == BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_SEARCH_QUERY.getTypeID()) {
header = Bundle.GeneralPurposeArtifactViewer_details_searchHeader();
} else {
header = Bundle.GeneralPurposeArtifactViewer_details_attrHeader();
}
addHeader(header);
}
/** /**
* Adds a new heading to the panel. * Adds a new heading to the panel.
* *
@ -248,7 +388,7 @@ public class GeneralPurposeArtifactViewer extends AbstractArtifactDetailsPanel i
// the first section // the first section
if (gridBagConstraints.gridy != 0) { if (gridBagConstraints.gridy != 0) {
gridBagConstraints.gridy++; gridBagConstraints.gridy++;
add(new javax.swing.JLabel(" "), gridBagConstraints); detailsPanel.add(new javax.swing.JLabel(" "), gridBagConstraints);
addLineEndGlue(); addLineEndGlue();
} }
gridBagConstraints.gridy++; gridBagConstraints.gridy++;
@ -261,7 +401,7 @@ public class GeneralPurposeArtifactViewer extends AbstractArtifactDetailsPanel i
// make it large and bold // make it large and bold
headingLabel.setFont(headingLabel.getFont().deriveFont(Font.BOLD, headingLabel.getFont().getSize() + 2)); headingLabel.setFont(headingLabel.getFont().deriveFont(Font.BOLD, headingLabel.getFont().getSize() + 2));
// add to panel // add to panel
add(headingLabel, gridBagConstraints); detailsPanel.add(headingLabel, gridBagConstraints);
// reset constraints to normal // reset constraints to normal
gridBagConstraints.gridwidth = LABEL_WIDTH; gridBagConstraints.gridwidth = LABEL_WIDTH;
// add line end glue // add line end glue
@ -292,7 +432,7 @@ public class GeneralPurposeArtifactViewer extends AbstractArtifactDetailsPanel i
gridBagConstraints.weightx = GLUE_WEIGHT_X; // take up all the horizontal space gridBagConstraints.weightx = GLUE_WEIGHT_X; // take up all the horizontal space
gridBagConstraints.fill = GridBagConstraints.BOTH; gridBagConstraints.fill = GridBagConstraints.BOTH;
javax.swing.Box.Filler horizontalFiller = new javax.swing.Box.Filler(new Dimension(0, 0), new Dimension(0, 0), new Dimension(32767, 0)); javax.swing.Box.Filler horizontalFiller = new javax.swing.Box.Filler(new Dimension(0, 0), new Dimension(0, 0), new Dimension(32767, 0));
add(horizontalFiller, gridBagConstraints); detailsPanel.add(horizontalFiller, gridBagConstraints);
// restore fill & weight // restore fill & weight
gridBagConstraints.fill = GridBagConstraints.NONE; gridBagConstraints.fill = GridBagConstraints.NONE;
gridBagConstraints.weightx = TEXT_WEIGHT_X; gridBagConstraints.weightx = TEXT_WEIGHT_X;
@ -306,7 +446,7 @@ public class GeneralPurposeArtifactViewer extends AbstractArtifactDetailsPanel i
gridBagConstraints.weighty = 1.0; // take up all the vertical space gridBagConstraints.weighty = 1.0; // take up all the vertical space
gridBagConstraints.fill = GridBagConstraints.VERTICAL; gridBagConstraints.fill = GridBagConstraints.VERTICAL;
javax.swing.Box.Filler vertFiller = new javax.swing.Box.Filler(new Dimension(0, 0), new Dimension(0, 0), new Dimension(0, 32767)); javax.swing.Box.Filler vertFiller = new javax.swing.Box.Filler(new Dimension(0, 0), new Dimension(0, 0), new Dimension(0, 32767));
add(vertFiller, gridBagConstraints); detailsPanel.add(vertFiller, gridBagConstraints);
} }
/** /**
@ -325,7 +465,7 @@ public class GeneralPurposeArtifactViewer extends AbstractArtifactDetailsPanel i
// set text // set text
keyLabel.setText(keyString + ": "); keyLabel.setText(keyString + ": ");
// add to panel // add to panel
add(keyLabel, gridBagConstraints); detailsPanel.add(keyLabel, gridBagConstraints);
return keyLabel; return keyLabel;
} }
@ -348,6 +488,8 @@ public class GeneralPurposeArtifactViewer extends AbstractArtifactDetailsPanel i
cloneConstraints.fill = GridBagConstraints.BOTH; cloneConstraints.fill = GridBagConstraints.BOTH;
// set text // set text
valueField.setText(valueString); valueField.setText(valueString);
// scroll to start of text
valueField.setCaretPosition(0);
// attach a right click menu with Copy option // attach a right click menu with Copy option
valueField.addMouseListener(new java.awt.event.MouseAdapter() { valueField.addMouseListener(new java.awt.event.MouseAdapter() {
@Override @Override
@ -356,7 +498,7 @@ public class GeneralPurposeArtifactViewer extends AbstractArtifactDetailsPanel i
} }
}); });
// add label to panel // add label to panel
add(valueField, cloneConstraints); detailsPanel.add(valueField, cloneConstraints);
// end the line // end the line
addLineEndGlue(); addLineEndGlue();
return valueField; return valueField;
@ -389,5 +531,6 @@ public class GeneralPurposeArtifactViewer extends AbstractArtifactDetailsPanel i
// Variables declaration - do not modify//GEN-BEGIN:variables // Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JPanel detailsPanel;
// End of variables declaration//GEN-END:variables // End of variables declaration//GEN-END:variables
} }

View File

@ -18,7 +18,9 @@
*/ */
package org.sleuthkit.autopsy.discovery.ui; package org.sleuthkit.autopsy.discovery.ui;
import java.awt.Component;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JScrollPane;
import org.sleuthkit.autopsy.coreutils.ThreadConfined; import org.sleuthkit.autopsy.coreutils.ThreadConfined;
import org.sleuthkit.datamodel.BlackboardArtifact; import org.sleuthkit.datamodel.BlackboardArtifact;
@ -28,6 +30,12 @@ import org.sleuthkit.datamodel.BlackboardArtifact;
*/ */
public abstract class AbstractArtifactDetailsPanel extends JPanel { public abstract class AbstractArtifactDetailsPanel extends JPanel {
@ThreadConfined(type = ThreadConfined.ThreadType.AWT)
public Component getComponent() {
// Slap a vertical scrollbar on the panel.
return new JScrollPane(this, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
}
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**

View File

@ -328,6 +328,8 @@ final class ArtifactsListPanel extends AbstractArtifactListPanel {
@NbBundle.Messages({"ArtifactsListPanel.titleColumn.name=Title", @NbBundle.Messages({"ArtifactsListPanel.titleColumn.name=Title",
"ArtifactsListPanel.fileNameColumn.name=Name", "ArtifactsListPanel.fileNameColumn.name=Name",
"ArtifactsListPanel.dateColumn.name=Date/Time", "ArtifactsListPanel.dateColumn.name=Date/Time",
"ArtifactsListPanel.urlColumn.name=URL",
"ArtifactsListPanel.termColumn.name=Term",
"ArtifactsListPanel.mimeTypeColumn.name=MIME Type"}) "ArtifactsListPanel.mimeTypeColumn.name=MIME Type"})
@Override @Override
public String getColumnName(int column) { public String getColumnName(int column) {
@ -335,11 +337,19 @@ final class ArtifactsListPanel extends AbstractArtifactListPanel {
case 0: case 0:
return Bundle.ArtifactsListPanel_dateColumn_name(); return Bundle.ArtifactsListPanel_dateColumn_name();
case 1: case 1:
if (artifactType == BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_CACHE || artifactType == BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_DOWNLOAD) { if (artifactType != null) {
switch (artifactType) {
case TSK_WEB_CACHE:
case TSK_WEB_DOWNLOAD:
return Bundle.ArtifactsListPanel_fileNameColumn_name(); return Bundle.ArtifactsListPanel_fileNameColumn_name();
} else { case TSK_WEB_COOKIE:
return Bundle.ArtifactsListPanel_titleColumn_name(); return Bundle.ArtifactsListPanel_urlColumn_name();
case TSK_WEB_SEARCH_QUERY:
return Bundle.ArtifactsListPanel_termColumn_name();
default:
} }
}
return Bundle.ArtifactsListPanel_titleColumn_name();
case 2: case 2:
return Bundle.ArtifactsListPanel_mimeTypeColumn_name(); return Bundle.ArtifactsListPanel_mimeTypeColumn_name();
default: default:

View File

@ -3,7 +3,9 @@ ArtifactMenuMouseAdapter_label=Extract Files
ArtifactsListPanel.dateColumn.name=Date/Time ArtifactsListPanel.dateColumn.name=Date/Time
ArtifactsListPanel.fileNameColumn.name=Name ArtifactsListPanel.fileNameColumn.name=Name
ArtifactsListPanel.mimeTypeColumn.name=MIME Type ArtifactsListPanel.mimeTypeColumn.name=MIME Type
ArtifactsListPanel.termColumn.name=Term
ArtifactsListPanel.titleColumn.name=Title ArtifactsListPanel.titleColumn.name=Title
ArtifactsListPanel.urlColumn.name=URL
ArtifactsListPanel.value.noValue=No value available. ArtifactsListPanel.value.noValue=No value available.
ArtifactTypeFilterPanel.selectionNeeded.text=At least one Result type must be selected. ArtifactTypeFilterPanel.selectionNeeded.text=At least one Result type must be selected.
CTL_OpenDiscoveryAction=Discovery CTL_OpenDiscoveryAction=Discovery

View File

@ -91,7 +91,7 @@ final class DomainArtifactsTabPanel extends JPanel {
break; break;
} }
if (rightPanel != null) { if (rightPanel != null) {
jSplitPane1.setRightComponent(new JScrollPane(rightPanel)); jSplitPane1.setRightComponent(rightPanel.getComponent());
} }
} }

View File

@ -20,7 +20,6 @@ package org.sleuthkit.autopsy.discovery.ui;
import com.google.common.eventbus.Subscribe; import com.google.common.eventbus.Subscribe;
import java.util.logging.Level; import java.util.logging.Level;
import javax.swing.JScrollPane;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener; import javax.swing.event.ListSelectionListener;
@ -64,7 +63,7 @@ class MiniTimelinePanel extends javax.swing.JPanel {
rightPanel = new GeneralPurposeArtifactViewer(); rightPanel = new GeneralPurposeArtifactViewer();
} }
rightPanel.setArtifact(artifact); rightPanel.setArtifact(artifact);
mainSplitPane.setRightComponent(new JScrollPane(rightPanel)); mainSplitPane.setRightComponent(rightPanel.getComponent());
validate(); validate();
repaint(); repaint();
} }
@ -88,7 +87,7 @@ class MiniTimelinePanel extends javax.swing.JPanel {
artifactListPanel.addSelectionListener(artifactListener); artifactListPanel.addSelectionListener(artifactListener);
leftSplitPane.setLeftComponent(dateListPanel); leftSplitPane.setLeftComponent(dateListPanel);
leftSplitPane.setRightComponent(artifactListPanel); leftSplitPane.setRightComponent(artifactListPanel);
mainSplitPane.setRightComponent(rightPanel); mainSplitPane.setRightComponent(rightPanel.getComponent());
} }
/** /**