diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AdHocSearchPanel.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AdHocSearchPanel.java index 6190f392e8..c9aa061400 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AdHocSearchPanel.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AdHocSearchPanel.java @@ -148,7 +148,7 @@ abstract class AdHocSearchPanel extends javax.swing.JPanel { } /** - * Get a list of data source display name. + * Get a list of data source display names. * * @return The list of data source name */ diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Bundle.properties-MERGED b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Bundle.properties-MERGED index 02244f9477..25a07a1bbb 100755 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Bundle.properties-MERGED +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Bundle.properties-MERGED @@ -5,10 +5,12 @@ AccountsText.nextPage.exception.msg=No next page. AccountsText.previousItem.exception.msg=No previous item. AccountsText.previousPage.exception.msg=No previous page. CannotRunFileTypeDetection=Unable to run file type detection. +CTL_ExtractAllTermsAction=Extract Unique Words DropdownListSearchPanel.selected=Ad Hoc Search data source filter is selected DropdownSingleTermSearchPanel.selected=Ad Hoc Search data source filter is selected DropdownSingleTermSearchPanel.warning.text=Boundary characters ^ and $ do not match word boundaries. Consider\nreplacing with an explicit list of boundary characters, such as [ \\.,] DropdownSingleTermSearchPanel.warning.title=Warning +ExtractAllTermsAction.getName.text=Extract Unique Words ExtractedContentPanel.setMarkup.panelTxt=Loading text... Please wait # {0} - Content name ExtractedContentPanel.SetMarkup.progress.loading=Loading text for {0} diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ExtractAllTermsAction.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ExtractAllTermsAction.java new file mode 100755 index 0000000000..560d018349 --- /dev/null +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ExtractAllTermsAction.java @@ -0,0 +1,68 @@ +/* + * Autopsy Forensic Browser + * + * Copyright 2021 Basis Technology Corp. + * Contact: carrier sleuthkit 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.keywordsearch; + +import java.awt.event.ActionEvent; +import org.openide.awt.ActionID; +import org.openide.awt.ActionReference; +import org.openide.awt.ActionRegistration; +import org.openide.util.HelpCtx; +import org.openide.util.NbBundle; +import org.openide.util.actions.CallableSystemAction; +import org.sleuthkit.autopsy.casemodule.Case; + +/** + * Action for accessing the Search Other Cases dialog. + */ +@ActionID(category = "Tools", id = "org.sleuthkit.autopsy.keywordsearch.ExtractAllTermsAction") +@ActionRegistration(displayName = "#CTL_OtherCasesSearchAction=Search All Cases", lazy = false) +@ActionReference(path = "Menu/Tools", position = 202) +@NbBundle.Messages({"CTL_ExtractAllTermsAction=Extract Unique Words"}) +public class ExtractAllTermsAction extends CallableSystemAction { + + @Override + public boolean isEnabled() { + return Case.isCaseOpen(); + } + + @Override + public void actionPerformed(ActionEvent event) { + performAction(); + } + + @Override + public void performAction() { + // ELTODO AllCasesSearchDialog dialog = new AllCasesSearchDialog(); + // ELTODO dialog.display(); + int a = 5; + } + + @NbBundle.Messages({ + "ExtractAllTermsAction.getName.text=Extract Unique Words"}) + @Override + public String getName() { + return Bundle.ExtractAllTermsAction_getName_text(); + } + + @Override + public HelpCtx getHelpCtx() { + return HelpCtx.DEFAULT_HELP; + } + +} diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/IndexFinder.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/IndexFinder.java index 99fef29810..dc9179291d 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/IndexFinder.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/IndexFinder.java @@ -21,10 +21,8 @@ package org.sleuthkit.autopsy.keywordsearch; import java.io.File; import java.nio.file.Paths; import java.util.List; -import java.util.logging.Level; import org.apache.commons.lang.math.NumberUtils; import org.sleuthkit.autopsy.casemodule.Case; -import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.appservices.AutopsyService; /** @@ -32,7 +30,6 @@ import org.sleuthkit.autopsy.appservices.AutopsyService; */ class IndexFinder { - private static final Logger logger = Logger.getLogger(IndexFinder.class.getName()); private static final String KWS_OUTPUT_FOLDER_NAME = "keywordsearch"; private static final String KWS_DATA_FOLDER_NAME = "data"; private static final String INDEX_FOLDER_NAME = "index"; @@ -48,7 +45,7 @@ class IndexFinder { return CURRENT_SOLR_SCHEMA_VERSION; } - static Index findLatestVersionIndexDir(List allIndexes) { + static Index findLatestVersionIndex(List allIndexes) { for (Index index : allIndexes) { if (index.getSolrVersion().equals(CURRENT_SOLR_VERSION) && index.getSchemaVersion().equals(CURRENT_SOLR_SCHEMA_VERSION)) { return index; @@ -57,7 +54,7 @@ class IndexFinder { return null; } - static Index createLatestVersionIndexDir(Case theCase) throws AutopsyService.AutopsyServiceException { + static Index createLatestVersionIndex(Case theCase) throws AutopsyService.AutopsyServiceException { String indexFolderName = "solr" + CURRENT_SOLR_VERSION + "_schema" + CURRENT_SOLR_SCHEMA_VERSION; // new index should be stored in "\ModuleOutput\keywordsearch\data\solrX_schemaY\index" File targetDirPath = Paths.get(theCase.getModuleDirectory(), KWS_OUTPUT_FOLDER_NAME, KWS_DATA_FOLDER_NAME, indexFolderName, INDEX_FOLDER_NAME).toFile(); //NON-NLS diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/SolrSearchService.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/SolrSearchService.java index 31ce328cc2..7eea0c3c2f 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/SolrSearchService.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/SolrSearchService.java @@ -309,14 +309,14 @@ public class SolrSearchService implements KeywordSearchService, AutopsyService { // new case that doesn't have an existing index. create new index folder progressUnitsCompleted++; progress.progress(Bundle.SolrSearch_creatingNewIndex_msg(), progressUnitsCompleted); - currentVersionIndex = IndexFinder.createLatestVersionIndexDir(theCase); + currentVersionIndex = IndexFinder.createLatestVersionIndex(theCase); // add current index to the list of indexes that exist for this case indexes.add(currentVersionIndex); } else { // check if one of the existing indexes is for latest Solr version and schema progressUnitsCompleted++; progress.progress(Bundle.SolrSearch_checkingForLatestIndex_msg(), progressUnitsCompleted); - currentVersionIndex = IndexFinder.findLatestVersionIndexDir(indexes); + currentVersionIndex = IndexFinder.findLatestVersionIndex(indexes); if (currentVersionIndex == null) { // found existing index(es) but none were for latest Solr version and schema version progressUnitsCompleted++;