diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java index 95509c4c16f21af924aa03ab0b699c7c5ed39ec1..694e7b1c084544bd47128da8821cfaa134f47b1c 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java @@ -95,8 +95,7 @@ public final class ImageGalleryController { private static final Logger logger = Logger.getLogger(ImageGalleryController.class.getName()); private static final Set<IngestManager.IngestJobEvent> INGEST_JOB_EVENTS_OF_INTEREST = EnumSet.of(IngestManager.IngestJobEvent.DATA_SOURCE_ANALYSIS_STARTED, IngestManager.IngestJobEvent.DATA_SOURCE_ANALYSIS_COMPLETED); private static final Set<IngestManager.IngestModuleEvent> INGEST_MODULE_EVENTS_OF_INTEREST = EnumSet.of(IngestManager.IngestModuleEvent.DATA_ADDED, IngestManager.IngestModuleEvent.FILE_DONE); - - private static String DEFAULT_TAG_SET_NAME = "Project VIC"; + /* * The file limit for image gallery. If the selected data source (or all * data sources, if that option is selected) has more than this many files @@ -738,7 +737,7 @@ private TagSet getCategoryTagSet() throws TskCoreException { List<TagSet> tagSetList = getCaseDatabase().getTaggingManager().getTagSets(); if (tagSetList != null && !tagSetList.isEmpty()) { for (TagSet set : tagSetList) { - if (set.getName().equals(getCategoryTagSetName())) { + if (set.getName().equals(ImageGalleryService.PROJECT_VIC_TAG_SET_NAME)) { return set; } } @@ -749,14 +748,6 @@ private TagSet getCategoryTagSet() throws TskCoreException { } } - /** - * Returns the name of the category tag set. - * - * @return Tagset name - */ - static String getCategoryTagSetName() { - return DEFAULT_TAG_SET_NAME; - } /** * A listener for ingest module application events. diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryService.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryService.java index 176b6e1a44a5e480dbc42cca2538c6173ffa5380..4a8664eb6f7250c9ff49293217b19302bba511f0 100755 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryService.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryService.java @@ -44,20 +44,32 @@ }) public class ImageGalleryService implements AutopsyService { - private static final String CATEGORY_ONE_NAME = "Child Exploitation (Illegal)"; - private static final String CATEGORY_TWO_NAME = "Child Exploitation (Non-Illegal/Age Difficult)"; - private static final String CATEGORY_THREE_NAME = "CGI/Animation (Child Exploitive)"; - private static final String CATEGORY_FOUR_NAME = "Exemplar/Comparison (Internal Use Only)"; - private static final String CATEGORY_FIVE_NAME = "Non-pertinent"; - - private static final List<TagNameDefinition> DEFAULT_CATEGORY_DEFINITION = new ArrayList<>(); + /* Image Gallery has its own definition of Project VIC tag names because + * these will be used if the Project Vic module is not installed. These will + * get added when a case is opened if the tag set is not already defined. + * + * The following list of names must be kept in sync with the CountryManager + * code in the ProjectVic module. + * + * Autopsy Core Tag code and TSK DataModel upgrade code also have a + * references to the "Projet VIC" set name. Be careful changing any of these names. + */ + static String PROJECT_VIC_TAG_SET_NAME = "Project VIC"; + private static final String PV_US_CAT0 = "Non-Pertinent"; + private static final String PV_US_CAT1 = "Child Abuse Material - (CAM)"; + private static final String PV_US_CAT2 = "Child Exploitive (Non-CAM) Age Difficult"; + private static final String PV_US_CAT3 = "CGI/Animation - Child Exploitive"; + private static final String PV_US_CAT4 = "Comparison Images"; + + private static final List<TagNameDefinition> PROJECT_VIC_US_CATEGORIES = new ArrayList<>(); static { - DEFAULT_CATEGORY_DEFINITION.add(new TagNameDefinition(CATEGORY_ONE_NAME, "", TagName.HTML_COLOR.RED, TskData.FileKnown.BAD)); - DEFAULT_CATEGORY_DEFINITION.add(new TagNameDefinition(CATEGORY_TWO_NAME, "", TagName.HTML_COLOR.LIME, TskData.FileKnown.BAD)); - DEFAULT_CATEGORY_DEFINITION.add(new TagNameDefinition(CATEGORY_THREE_NAME, "", TagName.HTML_COLOR.YELLOW, TskData.FileKnown.BAD)); - DEFAULT_CATEGORY_DEFINITION.add(new TagNameDefinition(CATEGORY_FOUR_NAME, "", TagName.HTML_COLOR.PURPLE, TskData.FileKnown.UNKNOWN)); - DEFAULT_CATEGORY_DEFINITION.add(new TagNameDefinition(CATEGORY_FIVE_NAME, "", TagName.HTML_COLOR.FUCHSIA, TskData.FileKnown.UNKNOWN)); + // NOTE: The colors here are what will be shown in the border + PROJECT_VIC_US_CATEGORIES.add(new TagNameDefinition(PV_US_CAT0, "", TagName.HTML_COLOR.GREEN, TskData.FileKnown.UNKNOWN)); + PROJECT_VIC_US_CATEGORIES.add(new TagNameDefinition(PV_US_CAT1, "", TagName.HTML_COLOR.RED, TskData.FileKnown.BAD)); + PROJECT_VIC_US_CATEGORIES.add(new TagNameDefinition(PV_US_CAT2, "", TagName.HTML_COLOR.YELLOW, TskData.FileKnown.BAD)); + PROJECT_VIC_US_CATEGORIES.add(new TagNameDefinition(PV_US_CAT3, "", TagName.HTML_COLOR.FUCHSIA, TskData.FileKnown.BAD)); + PROJECT_VIC_US_CATEGORIES.add(new TagNameDefinition(PV_US_CAT4, "", TagName.HTML_COLOR.BLUE, TskData.FileKnown.UNKNOWN)); } @Override @@ -91,17 +103,17 @@ public void openCaseResources(CaseContext context) throws AutopsyServiceExceptio // Check to see if the Project VIC tag set exists, if not create a // tag set using the default tags. - boolean addDefaultTagSet = true; + boolean addProjVicTagSet = true; List<TagSet> tagSets = context.getCase().getServices().getTagsManager().getAllTagSets(); for (TagSet set : tagSets) { - if (set.getName().equals(ImageGalleryController.getCategoryTagSetName())) { - addDefaultTagSet = false; + if (set.getName().equals(PROJECT_VIC_TAG_SET_NAME)) { + addProjVicTagSet = false; break; } } - if (addDefaultTagSet) { - addDefaultTagSet(context.getCase()); + if (addProjVicTagSet) { + addProjetVicTagSet(context.getCase()); } ImageGalleryController.createController(context.getCase()); @@ -134,13 +146,11 @@ public void closeCaseResources(CaseContext context) throws AutopsyServiceExcepti * * @throws TskCoreException */ - private void addDefaultTagSet(Case currentCase) throws TskCoreException { + private void addProjetVicTagSet(Case currentCase) throws TskCoreException { List<TagName> tagNames = new ArrayList<>(); - for (TagNameDefinition def : DEFAULT_CATEGORY_DEFINITION) { + for (TagNameDefinition def : PROJECT_VIC_US_CATEGORIES) { tagNames.add(currentCase.getSleuthkitCase().addOrUpdateTagName(def.getDisplayName(), def.getDescription(), def.getColor(), def.getKnownStatus())); } - - currentCase.getServices().getTagsManager().addTagSet(ImageGalleryController.getCategoryTagSetName(), tagNames); + currentCase.getServices().getTagsManager().addTagSet(PROJECT_VIC_TAG_SET_NAME, tagNames); } - } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenAction.java index 2df0ee2ed1f71ff177cd633002ad0ce1341a8153..92ea3241052d70e997a95df4dc9d215fdf6cc57f 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenAction.java @@ -157,7 +157,10 @@ public void performAction() { } Platform.runLater(() -> { ImageGalleryController controller; + // @@@ This call gets a lock. We shouldn't do this in the UI.... controller = ImageGalleryController.getController(currentCase); + + // Display an error if we could not get the controller and return if (controller == null) { Alert errorDIalog = new Alert(Alert.AlertType.ERROR); errorDIalog.initModality(Modality.APPLICATION_MODAL); @@ -174,6 +177,7 @@ public void performAction() { return; } + // Make sure the user is aware of Single vs Multi-user behaviors if (currentCase.getCaseType() == Case.CaseType.MULTI_USER_CASE && ImageGalleryPreferences.isMultiUserCaseInfoDialogDisabled() == false) { Alert dialog = new Alert(Alert.AlertType.INFORMATION); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/CategoryManager.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/CategoryManager.java index 8419fb40fe2d559361e13f67afe89b2f6f088b58..4464a60fc75fc47ef6dd2c2ed0614a13dc14fdfd 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/CategoryManager.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/CategoryManager.java @@ -99,9 +99,9 @@ synchronized public void invalidateCaches() { } /** - * get the number of file with the given {@link DhsImageCategory} + * get the number of file with the given tag * - * @param cat get the number of files with Category = cat + * @param tagName get the number of files with Category = tagName * * @return the number of files with the given Category */ @@ -110,20 +110,18 @@ synchronized public long getCategoryCount(TagName tagName) { } /** - * increment the cached value for the number of files with the given - * {@link DhsImageCategory} + * increment the cached value for the number of files with the given tag * - * @param cat the Category to increment + * @param tagName the Category to increment */ synchronized public void incrementCategoryCount(TagName tagName) { categoryCounts.getUnchecked(tagName).increment(); } /** - * decrement the cached value for the number of files with the given - * DhsImageCategory + * decrement the cached value for the number of files with the given tag * - * @param cat the Category to decrement + * @param tagName the Category to decrement */ synchronized public void decrementCategoryCount(TagName tagName) { categoryCounts.getUnchecked(tagName).decrement(); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableDB.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableDB.java index 3aa39bd2fd7cf51ae06875eb756bd07fcc15cb4a..ab4a2cbe6a45be1ade86d66499cb13677ca56d1d 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableDB.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableDB.java @@ -207,19 +207,19 @@ public enum DrawableDbBuildStatusEnum { */ UNKNOWN, /** - * Analyis (an ingest job or image gallery database rebuild) for the + * Analysis (an ingest job or image gallery database rebuild) for the * data source is in progress. */ IN_PROGRESS, /** - * Analyis (an ingest job or image gallery database rebuild) for the + * Analysis (an ingest job or image gallery database rebuild) for the * data source has been completed and at least one file in the data * source has a MIME type (ingest filters may have been applied, so some * files may not have been typed). */ COMPLETE, /** - * Analyis (an ingest job or image gallery database rebuild) for the + * Analysis (an ingest job or image gallery database rebuild) for the * data source has been completed, but the files for the data source * were not assigned a MIME type (file typing was not enabled). */