Initial layout

This commit is contained in:
Eugene Livis 2021-01-27 11:08:47 -05:00
parent 79256fd853
commit ee3f471e39
5 changed files with 75 additions and 8 deletions

View File

@ -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 * @return The list of data source name
*/ */

View File

@ -5,10 +5,12 @@ AccountsText.nextPage.exception.msg=No next page.
AccountsText.previousItem.exception.msg=No previous item. AccountsText.previousItem.exception.msg=No previous item.
AccountsText.previousPage.exception.msg=No previous page. AccountsText.previousPage.exception.msg=No previous page.
CannotRunFileTypeDetection=Unable to run file type detection. CannotRunFileTypeDetection=Unable to run file type detection.
CTL_ExtractAllTermsAction=Extract Unique Words
DropdownListSearchPanel.selected=Ad Hoc Search data source filter is selected DropdownListSearchPanel.selected=Ad Hoc Search data source filter is selected
DropdownSingleTermSearchPanel.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.text=Boundary characters ^ and $ do not match word boundaries. Consider\nreplacing with an explicit list of boundary characters, such as [ \\.,]
DropdownSingleTermSearchPanel.warning.title=Warning DropdownSingleTermSearchPanel.warning.title=Warning
ExtractAllTermsAction.getName.text=Extract Unique Words
ExtractedContentPanel.setMarkup.panelTxt=<span style='font-style:italic'>Loading text... Please wait</span> ExtractedContentPanel.setMarkup.panelTxt=<span style='font-style:italic'>Loading text... Please wait</span>
# {0} - Content name # {0} - Content name
ExtractedContentPanel.SetMarkup.progress.loading=Loading text for {0} ExtractedContentPanel.SetMarkup.progress.loading=Loading text for {0}

View File

@ -0,0 +1,68 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2021 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.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;
}
}

View File

@ -21,10 +21,8 @@ package org.sleuthkit.autopsy.keywordsearch;
import java.io.File; import java.io.File;
import java.nio.file.Paths; import java.nio.file.Paths;
import java.util.List; import java.util.List;
import java.util.logging.Level;
import org.apache.commons.lang.math.NumberUtils; import org.apache.commons.lang.math.NumberUtils;
import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.autopsy.appservices.AutopsyService; import org.sleuthkit.autopsy.appservices.AutopsyService;
/** /**
@ -32,7 +30,6 @@ import org.sleuthkit.autopsy.appservices.AutopsyService;
*/ */
class IndexFinder { 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_OUTPUT_FOLDER_NAME = "keywordsearch";
private static final String KWS_DATA_FOLDER_NAME = "data"; private static final String KWS_DATA_FOLDER_NAME = "data";
private static final String INDEX_FOLDER_NAME = "index"; private static final String INDEX_FOLDER_NAME = "index";
@ -48,7 +45,7 @@ class IndexFinder {
return CURRENT_SOLR_SCHEMA_VERSION; return CURRENT_SOLR_SCHEMA_VERSION;
} }
static Index findLatestVersionIndexDir(List<Index> allIndexes) { static Index findLatestVersionIndex(List<Index> allIndexes) {
for (Index index : allIndexes) { for (Index index : allIndexes) {
if (index.getSolrVersion().equals(CURRENT_SOLR_VERSION) && index.getSchemaVersion().equals(CURRENT_SOLR_SCHEMA_VERSION)) { if (index.getSolrVersion().equals(CURRENT_SOLR_VERSION) && index.getSchemaVersion().equals(CURRENT_SOLR_SCHEMA_VERSION)) {
return index; return index;
@ -57,7 +54,7 @@ class IndexFinder {
return null; 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; String indexFolderName = "solr" + CURRENT_SOLR_VERSION + "_schema" + CURRENT_SOLR_SCHEMA_VERSION;
// new index should be stored in "\ModuleOutput\keywordsearch\data\solrX_schemaY\index" // 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 File targetDirPath = Paths.get(theCase.getModuleDirectory(), KWS_OUTPUT_FOLDER_NAME, KWS_DATA_FOLDER_NAME, indexFolderName, INDEX_FOLDER_NAME).toFile(); //NON-NLS

View File

@ -309,14 +309,14 @@ public class SolrSearchService implements KeywordSearchService, AutopsyService {
// new case that doesn't have an existing index. create new index folder // new case that doesn't have an existing index. create new index folder
progressUnitsCompleted++; progressUnitsCompleted++;
progress.progress(Bundle.SolrSearch_creatingNewIndex_msg(), 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 // add current index to the list of indexes that exist for this case
indexes.add(currentVersionIndex); indexes.add(currentVersionIndex);
} else { } else {
// check if one of the existing indexes is for latest Solr version and schema // check if one of the existing indexes is for latest Solr version and schema
progressUnitsCompleted++; progressUnitsCompleted++;
progress.progress(Bundle.SolrSearch_checkingForLatestIndex_msg(), progressUnitsCompleted); progress.progress(Bundle.SolrSearch_checkingForLatestIndex_msg(), progressUnitsCompleted);
currentVersionIndex = IndexFinder.findLatestVersionIndexDir(indexes); currentVersionIndex = IndexFinder.findLatestVersionIndex(indexes);
if (currentVersionIndex == null) { if (currentVersionIndex == null) {
// found existing index(es) but none were for latest Solr version and schema version // found existing index(es) but none were for latest Solr version and schema version
progressUnitsCompleted++; progressUnitsCompleted++;