6191 fix user created filter

This commit is contained in:
William Schaefer 2020-03-24 16:45:56 -04:00
parent 98945c304c
commit f83f95f89d
5 changed files with 25 additions and 25 deletions

View File

@ -44,7 +44,6 @@ FileSearchPanel.hashSetCheckbox.text=Hash Set:
FileSearchPanel.tagsCheckbox.text=Tag: FileSearchPanel.tagsCheckbox.text=Tag:
FileSearchPanel.interestingItemsCheckbox.text=Interesting Item: FileSearchPanel.interestingItemsCheckbox.text=Interesting Item:
FileSearchPanel.scoreCheckbox.text=Has Score: FileSearchPanel.scoreCheckbox.text=Has Score:
FileSearchPanel.exifCheckbox.text=Possibly User Created
FileSearchPanel.notableCheckbox.text=Must have been tagged as notable FileSearchPanel.notableCheckbox.text=Must have been tagged as notable
FileSearchPanel.objectsCheckbox.text=Object Detected: FileSearchPanel.objectsCheckbox.text=Object Detected:
ResultsPanel.currentPageLabel.text=Page: - ResultsPanel.currentPageLabel.text=Page: -
@ -68,3 +67,4 @@ DiscoveryTopComponent.documentsButton.text=Documents
DocumentPanel.fileSizeLabel.toolTipText= DocumentPanel.fileSizeLabel.toolTipText=
DocumentPanel.isDeletedLabel.toolTipText= DocumentPanel.isDeletedLabel.toolTipText=
ImageThumbnailPanel.isDeletedLabel.toolTipText= ImageThumbnailPanel.isDeletedLabel.toolTipText=
FileSearchPanel.userCreatedCheckbox.text=Possibly User Created

View File

@ -96,7 +96,6 @@ FileSearchFiltering.DataSourceFilter.datasource={0}({1})
# {0} - filters # {0} - filters
FileSearchFiltering.DataSourceFilter.desc=Files in data source(s): {0} FileSearchFiltering.DataSourceFilter.desc=Files in data source(s): {0}
FileSearchFiltering.DataSourceFilter.or=\ or FileSearchFiltering.DataSourceFilter.or=\ or
FileSearchFiltering.ExifFilter.desc=Files that contain EXIF data
# {0} - filters # {0} - filters
FileSearchFiltering.FileTypeFilter.desc=Files with type: {0} FileSearchFiltering.FileTypeFilter.desc=Files with type: {0}
FileSearchFiltering.FileTypeFilter.or=\ or FileSearchFiltering.FileTypeFilter.or=\ or
@ -133,6 +132,7 @@ FileSearchFiltering.SizeFilter.range=({0} to {1})
# {0} - tag names # {0} - tag names
FileSearchFiltering.TagsFilter.desc=Files that have been tagged {0} FileSearchFiltering.TagsFilter.desc=Files that have been tagged {0}
FileSearchFiltering.TagsFilter.or=\ or FileSearchFiltering.TagsFilter.or=\ or
FileSearchFiltering.UserCreatedFilter.desc=Files that contain EXIF data
FileSearchPanel.dialogTitle.text=Test file search FileSearchPanel.dialogTitle.text=Test file search
FileSearchPanel.sortingPanel.border.title=Grouping FileSearchPanel.sortingPanel.border.title=Grouping
FileSearchPanel.searchButton.text=Show FileSearchPanel.searchButton.text=Show
@ -163,7 +163,6 @@ FileSearchPanel.hashSetCheckbox.text=Hash Set:
FileSearchPanel.tagsCheckbox.text=Tag: FileSearchPanel.tagsCheckbox.text=Tag:
FileSearchPanel.interestingItemsCheckbox.text=Interesting Item: FileSearchPanel.interestingItemsCheckbox.text=Interesting Item:
FileSearchPanel.scoreCheckbox.text=Has Score: FileSearchPanel.scoreCheckbox.text=Has Score:
FileSearchPanel.exifCheckbox.text=Possibly User Created
FileSearchPanel.notableCheckbox.text=Must have been tagged as notable FileSearchPanel.notableCheckbox.text=Must have been tagged as notable
FileSearchPanel.objectsCheckbox.text=Object Detected: FileSearchPanel.objectsCheckbox.text=Object Detected:
FileSorter.SortingMethod.datasource.displayName=Data Source FileSorter.SortingMethod.datasource.displayName=Data Source
@ -213,6 +212,7 @@ DiscoveryTopComponent.documentsButton.text=Documents
DocumentPanel.fileSizeLabel.toolTipText= DocumentPanel.fileSizeLabel.toolTipText=
DocumentPanel.isDeletedLabel.toolTipText= DocumentPanel.isDeletedLabel.toolTipText=
ImageThumbnailPanel.isDeletedLabel.toolTipText= ImageThumbnailPanel.isDeletedLabel.toolTipText=
FileSearchPanel.userCreatedCheckbox.text=Possibly User Created
ResultsPanel.unableToCreate.text=Unable to create summary. ResultsPanel.unableToCreate.text=Unable to create summary.
ResultsPanel.viewFileInDir.name=View File in Directory ResultsPanel.viewFileInDir.name=View File in Directory
VideoThumbnailPanel.bytes.text=bytes VideoThumbnailPanel.bytes.text=bytes

View File

@ -842,14 +842,14 @@ class FileSearchFiltering {
} }
/** /**
* A filter for specifying that the file must have EXIF data. * A filter for specifying that the file must have user content suspected data.
*/ */
static class ExifFilter extends FileFilter { static class UserCreatedFilter extends FileFilter {
/** /**
* Create the ExifFilter * Create the ExifFilter
*/ */
ExifFilter() { UserCreatedFilter() {
// Nothing to save // Nothing to save
} }
@ -857,14 +857,14 @@ class FileSearchFiltering {
String getWhereClause() { String getWhereClause() {
return "(obj_id IN (SELECT obj_id from blackboard_artifacts WHERE artifact_id IN " return "(obj_id IN (SELECT obj_id from blackboard_artifacts WHERE artifact_id IN "
+ "(SELECT artifact_id FROM blackboard_attributes WHERE artifact_type_id = " + "(SELECT artifact_id FROM blackboard_attributes WHERE artifact_type_id = "
+ BlackboardArtifact.ARTIFACT_TYPE.TSK_METADATA_EXIF.getTypeID() + ")))"; + BlackboardArtifact.ARTIFACT_TYPE.TSK_USER_CONTENT_SUSPECTED.getTypeID() + ")))";
} }
@NbBundle.Messages({ @NbBundle.Messages({
"FileSearchFiltering.ExifFilter.desc=Files that contain EXIF data",}) "FileSearchFiltering.UserCreatedFilter.desc=Files that contain EXIF data",})
@Override @Override
String getDesc() { String getDesc() {
return Bundle.FileSearchFiltering_ExifFilter_desc(); return Bundle.FileSearchFiltering_UserCreatedFilter_desc();
} }
} }

View File

@ -516,10 +516,10 @@
</Constraint> </Constraint>
</Constraints> </Constraints>
</Component> </Component>
<Component class="javax.swing.JCheckBox" name="exifCheckbox"> <Component class="javax.swing.JCheckBox" name="userCreatedCheckbox">
<Properties> <Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/filequery/Bundle.properties" key="FileSearchPanel.exifCheckbox.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/> <ResourceString bundle="org/sleuthkit/autopsy/filequery/Bundle.properties" key="FileSearchPanel.userCreatedCheckbox.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property> </Property>
</Properties> </Properties>
<Constraints> <Constraints>

View File

@ -408,16 +408,16 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
} }
/** /**
* Setup the exif filter settings. * Setup the user created filter settings.
* *
* @param visible Boolean indicating if the filter should be visible. * @param visible Boolean indicating if the filter should be visible.
* @param enabled Boolean indicating if the filter should be enabled. * @param enabled Boolean indicating if the filter should be enabled.
* @param selected Boolean indicating if the filter should be selected. * @param selected Boolean indicating if the filter should be selected.
*/ */
private void exifFilterSettings(boolean visible, boolean enabled, boolean selected) { private void userCreatedFilterSettings(boolean visible, boolean enabled, boolean selected) {
exifCheckbox.setVisible(visible); userCreatedCheckbox.setVisible(visible);
exifCheckbox.setEnabled(enabled); userCreatedCheckbox.setEnabled(enabled);
exifCheckbox.setSelected(selected); userCreatedCheckbox.setSelected(selected);
} }
/** /**
@ -467,7 +467,7 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
selectedFrequencyIndices = new int[]{1, 2, 3, 4, 5, 6, 7}; selectedFrequencyIndices = new int[]{1, 2, 3, 4, 5, 6, 7};
} }
crFrequencyFilterSettings(true, enabled, resetSelected || crFrequencyCheckbox.isSelected(), resetSelected == true ? selectedFrequencyIndices : null); crFrequencyFilterSettings(true, enabled, resetSelected || crFrequencyCheckbox.isSelected(), resetSelected == true ? selectedFrequencyIndices : null);
exifFilterSettings(true, enabled, !resetSelected && exifCheckbox.isSelected()); userCreatedFilterSettings(true, enabled, !resetSelected && userCreatedCheckbox.isSelected());
objectsFilterSettings(true, enabled, !resetSelected && objectsCheckbox.isSelected(), null); objectsFilterSettings(true, enabled, !resetSelected && objectsCheckbox.isSelected(), null);
hashSetFilterSettings(true, enabled, !resetSelected && hashSetCheckbox.isSelected(), null); hashSetFilterSettings(true, enabled, !resetSelected && hashSetCheckbox.isSelected(), null);
interestingItemsFilterSettings(true, enabled, !resetSelected && interestingItemsCheckbox.isSelected(), null); interestingItemsFilterSettings(true, enabled, !resetSelected && interestingItemsCheckbox.isSelected(), null);
@ -499,7 +499,7 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
selectedFrequencyIndices = new int[]{1, 2, 3, 4, 5, 6, 7}; selectedFrequencyIndices = new int[]{1, 2, 3, 4, 5, 6, 7};
} }
crFrequencyFilterSettings(true, enabled, resetSelected || crFrequencyCheckbox.isSelected(), resetSelected == true ? selectedFrequencyIndices : null); crFrequencyFilterSettings(true, enabled, resetSelected || crFrequencyCheckbox.isSelected(), resetSelected == true ? selectedFrequencyIndices : null);
exifFilterSettings(true, enabled, !resetSelected && exifCheckbox.isSelected()); userCreatedFilterSettings(true, enabled, !resetSelected && userCreatedCheckbox.isSelected());
objectsFilterSettings(true, enabled, !resetSelected && objectsCheckbox.isSelected(), null); objectsFilterSettings(true, enabled, !resetSelected && objectsCheckbox.isSelected(), null);
hashSetFilterSettings(true, enabled, !resetSelected && hashSetCheckbox.isSelected(), null); hashSetFilterSettings(true, enabled, !resetSelected && hashSetCheckbox.isSelected(), null);
interestingItemsFilterSettings(true, enabled, !resetSelected && interestingItemsCheckbox.isSelected(), null); interestingItemsFilterSettings(true, enabled, !resetSelected && interestingItemsCheckbox.isSelected(), null);
@ -531,7 +531,7 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
selectedFrequencyIndices = new int[]{1, 2, 3, 4, 5, 6, 7}; selectedFrequencyIndices = new int[]{1, 2, 3, 4, 5, 6, 7};
} }
crFrequencyFilterSettings(true, enabled, resetSelected || crFrequencyCheckbox.isSelected(), resetSelected == true ? selectedFrequencyIndices : null); crFrequencyFilterSettings(true, enabled, resetSelected || crFrequencyCheckbox.isSelected(), resetSelected == true ? selectedFrequencyIndices : null);
exifFilterSettings(true, enabled, !resetSelected && exifCheckbox.isSelected()); userCreatedFilterSettings(false, false, false);
objectsFilterSettings(false, false, false, null); objectsFilterSettings(false, false, false, null);
hashSetFilterSettings(true, enabled, !resetSelected && hashSetCheckbox.isSelected(), null); hashSetFilterSettings(true, enabled, !resetSelected && hashSetCheckbox.isSelected(), null);
interestingItemsFilterSettings(true, enabled, !resetSelected && interestingItemsCheckbox.isSelected(), null); interestingItemsFilterSettings(true, enabled, !resetSelected && interestingItemsCheckbox.isSelected(), null);
@ -941,8 +941,8 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
filters.add(new FileSearchFiltering.TagsFilter(tagsList.getSelectedValuesList())); filters.add(new FileSearchFiltering.TagsFilter(tagsList.getSelectedValuesList()));
} }
if (exifCheckbox.isSelected()) { if (userCreatedCheckbox.isSelected()) {
filters.add(new FileSearchFiltering.ExifFilter()); filters.add(new FileSearchFiltering.UserCreatedFilter());
} }
if (notableCheckbox.isSelected()) { if (notableCheckbox.isSelected()) {
@ -1148,7 +1148,7 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
tagsCheckbox = new javax.swing.JCheckBox(); tagsCheckbox = new javax.swing.JCheckBox();
interestingItemsCheckbox = new javax.swing.JCheckBox(); interestingItemsCheckbox = new javax.swing.JCheckBox();
scoreCheckbox = new javax.swing.JCheckBox(); scoreCheckbox = new javax.swing.JCheckBox();
exifCheckbox = new javax.swing.JCheckBox(); userCreatedCheckbox = new javax.swing.JCheckBox();
notableCheckbox = new javax.swing.JCheckBox(); notableCheckbox = new javax.swing.JCheckBox();
objectsScrollPane = new javax.swing.JScrollPane(); objectsScrollPane = new javax.swing.JScrollPane();
objectsList = new javax.swing.JList<>(); objectsList = new javax.swing.JList<>();
@ -1474,14 +1474,14 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
gridBagConstraints.insets = new java.awt.Insets(0, 6, 4, 0); gridBagConstraints.insets = new java.awt.Insets(0, 6, 4, 0);
filtersPanel.add(scoreCheckbox, gridBagConstraints); filtersPanel.add(scoreCheckbox, gridBagConstraints);
org.openide.awt.Mnemonics.setLocalizedText(exifCheckbox, org.openide.util.NbBundle.getMessage(FileSearchPanel.class, "FileSearchPanel.exifCheckbox.text")); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(userCreatedCheckbox, org.openide.util.NbBundle.getMessage(FileSearchPanel.class, "FileSearchPanel.userCreatedCheckbox.text")); // NOI18N
gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0; gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 3; gridBagConstraints.gridy = 3;
gridBagConstraints.gridwidth = 4; gridBagConstraints.gridwidth = 4;
gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START; gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
gridBagConstraints.insets = new java.awt.Insets(0, 6, 4, 6); gridBagConstraints.insets = new java.awt.Insets(0, 6, 4, 6);
filtersPanel.add(exifCheckbox, gridBagConstraints); filtersPanel.add(userCreatedCheckbox, gridBagConstraints);
org.openide.awt.Mnemonics.setLocalizedText(notableCheckbox, org.openide.util.NbBundle.getMessage(FileSearchPanel.class, "FileSearchPanel.notableCheckbox.text")); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(notableCheckbox, org.openide.util.NbBundle.getMessage(FileSearchPanel.class, "FileSearchPanel.notableCheckbox.text")); // NOI18N
gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints = new java.awt.GridBagConstraints();
@ -1948,7 +1948,6 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
private javax.swing.JButton deleteButton; private javax.swing.JButton deleteButton;
private javax.swing.JLabel errorLabel; private javax.swing.JLabel errorLabel;
private javax.swing.JRadioButton excludeRadioButton; private javax.swing.JRadioButton excludeRadioButton;
private javax.swing.JCheckBox exifCheckbox;
private javax.swing.JRadioButton fullRadioButton; private javax.swing.JRadioButton fullRadioButton;
private javax.swing.JComboBox<GroupingAttributeType> groupByCombobox; private javax.swing.JComboBox<GroupingAttributeType> groupByCombobox;
private javax.swing.JComboBox<GroupSortingAlgorithm> groupSortingComboBox; private javax.swing.JComboBox<GroupSortingAlgorithm> groupSortingComboBox;
@ -1983,6 +1982,7 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
private javax.swing.JCheckBox tagsCheckbox; private javax.swing.JCheckBox tagsCheckbox;
private javax.swing.JList<TagName> tagsList; private javax.swing.JList<TagName> tagsList;
private javax.swing.JScrollPane tagsScrollPane; private javax.swing.JScrollPane tagsScrollPane;
private javax.swing.JCheckBox userCreatedCheckbox;
// End of variables declaration//GEN-END:variables // End of variables declaration//GEN-END:variables
} }