mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-14 17:06:16 +00:00
Updated error messages and surrounding logic for KWS.
This commit is contained in:
parent
ba9e2f7fcc
commit
426fc0a881
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2011-2017 Basis Technology Corp.
|
* Copyright 2011-2018 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -35,6 +35,7 @@ import org.apache.solr.client.solrj.SolrQuery;
|
|||||||
import org.apache.solr.client.solrj.SolrRequest.METHOD;
|
import org.apache.solr.client.solrj.SolrRequest.METHOD;
|
||||||
import org.apache.solr.client.solrj.response.QueryResponse;
|
import org.apache.solr.client.solrj.response.QueryResponse;
|
||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
|
import org.openide.util.NbBundle.Messages;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.autopsy.coreutils.Version;
|
import org.sleuthkit.autopsy.coreutils.Version;
|
||||||
import org.sleuthkit.datamodel.BlackboardArtifact;
|
import org.sleuthkit.datamodel.BlackboardArtifact;
|
||||||
@ -52,7 +53,7 @@ import org.sleuthkit.datamodel.TskCoreException;
|
|||||||
*/
|
*/
|
||||||
class AccountsText implements IndexedText {
|
class AccountsText implements IndexedText {
|
||||||
|
|
||||||
private static final Logger logger = Logger.getLogger(AccountsText.class.getName());
|
private static final Logger LOGGER = Logger.getLogger(AccountsText.class.getName());
|
||||||
private static final boolean DEBUG = (Version.getBuildType() == Version.Type.DEVELOPMENT);
|
private static final boolean DEBUG = (Version.getBuildType() == Version.Type.DEVELOPMENT);
|
||||||
|
|
||||||
private static final String CCN_REGEX = "(%?)(B?)([0-9][ \\-]*?){12,19}(\\^?)";
|
private static final String CCN_REGEX = "(%?)(B?)([0-9][ \\-]*?){12,19}(\\^?)";
|
||||||
@ -284,15 +285,6 @@ class AccountsText implements IndexedText {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@NbBundle.Messages({"AccountsText.getMarkup.noMatchMsg="
|
|
||||||
+ "<html><pre><span style\\\\='background\\\\:yellow'>There were no keyword hits on this page. <br />"
|
|
||||||
+ "The keyword could have been in the file name."
|
|
||||||
+ " <br />Advance to another page if present, or to view the original text, choose File Text"
|
|
||||||
+ " <br />in the drop down menu to the right...</span></pre></html>",
|
|
||||||
"AccountsText.getMarkup.queryFailedMsg="
|
|
||||||
+ "<html><pre><span style\\\\='background\\\\:yellow'>Failed to retrieve keyword hit results."
|
|
||||||
+ " <br />Confirm that Autopsy can connect to the Solr server. "
|
|
||||||
+ "<br /></span></pre></html>"})
|
|
||||||
public String getText() {
|
public String getText() {
|
||||||
try {
|
try {
|
||||||
loadPageInfo(); //inits once
|
loadPageInfo(); //inits once
|
||||||
@ -320,8 +312,8 @@ class AccountsText implements IndexedText {
|
|||||||
// extracted content (minus highlight tags) is HTML-escaped
|
// extracted content (minus highlight tags) is HTML-escaped
|
||||||
return "<html><pre>" + highlightedText + "</pre></html>"; //NON-NLS
|
return "<html><pre>" + highlightedText + "</pre></html>"; //NON-NLS
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
logger.log(Level.SEVERE, "Error getting highlighted text for Solr doc id " + this.solrObjectId + ", chunkID " + this.currentPage, ex); //NON-NLS
|
LOGGER.log(Level.SEVERE, "Error getting highlighted text for Solr doc id " + this.solrObjectId + ", chunkID " + this.currentPage, ex); //NON-NLS
|
||||||
return Bundle.AccountsText_getMarkup_queryFailedMsg();
|
return NbBundle.getMessage(ExtractedContentViewer.class, "ExtractedContentViewer.getText.error.msg");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,11 +54,6 @@ AbstractKeywordSearchPerformer.search.noFilesInIdxMsg=<html>No files are in inde
|
|||||||
AbstractKeywordSearchPerformer.search.noFilesIdxdMsg=<html>No files were indexed.<br />Re-ingest the image with the Keyword Search Module enabled. </html>
|
AbstractKeywordSearchPerformer.search.noFilesIdxdMsg=<html>No files were indexed.<br />Re-ingest the image with the Keyword Search Module enabled. </html>
|
||||||
ExtractedContentViewer.toolTip=Displays extracted text from files and keyword-search results. Requires Keyword Search ingest to be run on a file to activate this viewer.
|
ExtractedContentViewer.toolTip=Displays extracted text from files and keyword-search results. Requires Keyword Search ingest to be run on a file to activate this viewer.
|
||||||
ExtractedContentViewer.getTitle=Indexed Text
|
ExtractedContentViewer.getTitle=Indexed Text
|
||||||
ExtractedContentViewer.getSolrContent.knownFileMsg=<p style\=''font-style\:italic''>{0} is a known file (based on MD5 hash) and does not have text in the index.</p>
|
|
||||||
ExtractedContentViewer.getSolrContent.noTxtYetMsg=<p style\=''font-style\:italic''>{0} does not have text in the index.<br/>It may have no text, not been analyzed yet, or keyword search was not enabled during ingest.</p>
|
|
||||||
ExtractedContentViewer.getSolrContent.txtBodyItal=<span style\=''font-style\:italic''>{0}</span>
|
|
||||||
HighlightedMatchesSource.getMarkup.noMatchMsg=<span>Failed to retrieve indexed text for keyword hit. Advance to another page if present, or to view the original text, choose File Text in the drop down menu to the right. Alternatively, you may choose to extract file content and search for the hit using an external application (e.g. a text editor).</span>
|
|
||||||
HighlightedMatchesSource.getMarkup.queryFailedMsg=<html><pre><span style\\\\\='background\\\\\:yellow'>Failed to retrieve keyword hit results. <br />Confirm that Autopsy can connect to the Solr server. <br /></span></pre></html>
|
|
||||||
HighlightedMatchesSource.toString=Search Results
|
HighlightedMatchesSource.toString=Search Results
|
||||||
Installer.reportPortError=Indexing server port {0} is not available. Check if your security software does not block {1} and consider changing {2} in {3} property file in the application user folder. Then try rebooting your system if another process was causing the conflict.
|
Installer.reportPortError=Indexing server port {0} is not available. Check if your security software does not block {1} and consider changing {2} in {3} property file in the application user folder. Then try rebooting your system if another process was causing the conflict.
|
||||||
Installer.reportStopPortError=Indexing server stop port {0} is not available. Consider changing {1} in {2} property file in the application user folder.
|
Installer.reportStopPortError=Indexing server stop port {0} is not available. Consider changing {1} in {2} property file in the application user folder.
|
||||||
@ -272,7 +267,6 @@ KeywordSearchGlobalSearchSettingsPanel.timeRadioButton5.text=No periodic searche
|
|||||||
SolrConnectionCheck.HostnameOrPort=Invalid hostname and/or port number.
|
SolrConnectionCheck.HostnameOrPort=Invalid hostname and/or port number.
|
||||||
SolrConnectionCheck.Hostname=Invalid hostname.
|
SolrConnectionCheck.Hostname=Invalid hostname.
|
||||||
SolrConnectionCheck.MissingHostname=Missing hostname.
|
SolrConnectionCheck.MissingHostname=Missing hostname.
|
||||||
RawText.getText.error.msg=Error getting text
|
|
||||||
GlobalListsManagementPanel.newListButton.text=New List
|
GlobalListsManagementPanel.newListButton.text=New List
|
||||||
GlobalListsManagementPanel.importButton.text=Import List
|
GlobalListsManagementPanel.importButton.text=Import List
|
||||||
GlobalListsManagementPanel.keywordListsLabel.text=Keyword Lists:
|
GlobalListsManagementPanel.keywordListsLabel.text=Keyword Lists:
|
||||||
|
@ -46,7 +46,6 @@ AbstractKeywordSearchPerformer.search.noFilesIdxdMsg=<html>\u30a4\u30f3\u30c7\u3
|
|||||||
ExtractedContentPanel.setMarkup.panelTxt=<span style\='font-style\:italic'>\u30c6\u30ad\u30b9\u30c8\u30ed\u30fc\u30c9\u4e2d...\u3057\u3070\u3089\u304f\u304a\u5f85\u3061\u304f\u3060\u3055\u3044\u3002</span>
|
ExtractedContentPanel.setMarkup.panelTxt=<span style\='font-style\:italic'>\u30c6\u30ad\u30b9\u30c8\u30ed\u30fc\u30c9\u4e2d...\u3057\u3070\u3089\u304f\u304a\u5f85\u3061\u304f\u3060\u3055\u3044\u3002</span>
|
||||||
ExtractedContentViewer.toolTip=\u30d5\u30a1\u30a4\u30eb\u3084\u30ad\u30fc\u30ef\u30fc\u30c9\u691c\u7d22\u7d50\u679c\u304b\u3089\u62bd\u51fa\u3055\u308c\u305f\u30c6\u30ad\u30b9\u30c8\u3092\u8868\u793a\u3002\u3053\u306e\u30d3\u30e5\u30fc\u30a2\u3092\u6709\u52b9\u5316\u3059\u308b\u306b\u306f\u3001\u30d5\u30a1\u30a4\u30eb\u306b\u5bfe\u3057\u3066\u30ad\u30fc\u30ef\u30fc\u30c9\u691c\u7d22\u30a4\u30f3\u30b8\u30a7\u30b9\u30c8\u3092\u5b9f\u884c\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002
|
ExtractedContentViewer.toolTip=\u30d5\u30a1\u30a4\u30eb\u3084\u30ad\u30fc\u30ef\u30fc\u30c9\u691c\u7d22\u7d50\u679c\u304b\u3089\u62bd\u51fa\u3055\u308c\u305f\u30c6\u30ad\u30b9\u30c8\u3092\u8868\u793a\u3002\u3053\u306e\u30d3\u30e5\u30fc\u30a2\u3092\u6709\u52b9\u5316\u3059\u308b\u306b\u306f\u3001\u30d5\u30a1\u30a4\u30eb\u306b\u5bfe\u3057\u3066\u30ad\u30fc\u30ef\u30fc\u30c9\u691c\u7d22\u30a4\u30f3\u30b8\u30a7\u30b9\u30c8\u3092\u5b9f\u884c\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002
|
||||||
ExtractedContentViewer.getTitle=\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u5316\u3055\u308c\u305f\u30c6\u30ad\u30b9\u30c8
|
ExtractedContentViewer.getTitle=\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u5316\u3055\u308c\u305f\u30c6\u30ad\u30b9\u30c8
|
||||||
ExtractedContentViewer.getSolrContent.knownFileMsg=<p style\=''font-style\:italic''>{0}\u306f\u65e2\u77e5\u30d5\u30a1\u30a4\u30eb\u3067\u3059\uff08MDS\u30cf\u30c3\u30b7\u30e5\u306b\u57fa\u3065\u304f\u3068\uff09\u3002\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306b\u30c6\u30ad\u30b9\u30c8\u304c\u3042\u308a\u307e\u305b\u3093\u3002</p>
|
|
||||||
ExtractedContentViewer.getSolrContent.noTxtYetMsg=<p style\=''font-style\:italic''>{0}\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306b\u30c6\u30ad\u30b9\u30c8\u304c\u3042\u308a\u307e\u305b\u3093\u3002<br/>\u30c6\u30ad\u30b9\u30c8\u304c\u7121\u3044\u304b\u3001\u307e\u3060\u89e3\u6790\u3055\u308c\u3066\u3044\u306a\u3044\u304b\u3001\u30ad\u30fc\u30ef\u30fc\u30c9\u691c\u7d22\u304c\u30a4\u30f3\u30b8\u30a7\u30b9\u30c8\u4e2d\u306b\u6709\u52b9\u5316\u3055\u308c\u3066\u3044\u306a\u304b\u3063\u305f\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002</p>
|
ExtractedContentViewer.getSolrContent.noTxtYetMsg=<p style\=''font-style\:italic''>{0}\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306b\u30c6\u30ad\u30b9\u30c8\u304c\u3042\u308a\u307e\u305b\u3093\u3002<br/>\u30c6\u30ad\u30b9\u30c8\u304c\u7121\u3044\u304b\u3001\u307e\u3060\u89e3\u6790\u3055\u308c\u3066\u3044\u306a\u3044\u304b\u3001\u30ad\u30fc\u30ef\u30fc\u30c9\u691c\u7d22\u304c\u30a4\u30f3\u30b8\u30a7\u30b9\u30c8\u4e2d\u306b\u6709\u52b9\u5316\u3055\u308c\u3066\u3044\u306a\u304b\u3063\u305f\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002</p>
|
||||||
HighlightedMatchesSource.toString=\u691c\u7d22\u7d50\u679c
|
HighlightedMatchesSource.toString=\u691c\u7d22\u7d50\u679c
|
||||||
Installer.reportPortError=\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u30b5\u30fc\u30d0\u30fc\u30dd\u30fc\u30c8 {0} \u306f\u5229\u7528\u3067\u304d\u307e\u305b\u3093\u3002\u4f7f\u7528\u3057\u3066\u3044\u308b\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u304c {1} \u3092\u30d6\u30ed\u30c3\u30af\u3057\u3066\u3044\u306a\u3044\u304b\u78ba\u8a8d\u3057\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30e6\u30fc\u30b6\u30fc\u30d5\u30a9\u30eb\u30c0\u30fc\u5185\u306e{3}\u30d7\u30ed\u30d1\u30c6\u30a3\u30d5\u30a1\u30a4\u30eb\u306e{2}\u3092\u5909\u66f4\u3059\u308b\u691c\u8a0e\u3092\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3082\u3057\u4ed6\u306e\u51e6\u7406\u304c\u554f\u984c\u306e\u539f\u56e0\u3067\u3042\u308c\u3070\u3001\u30b7\u30b9\u30c6\u30e0\u3092\u518d\u8d77\u52d5\u3057\u3066\u4e0b\u3055\u3044\u3002
|
Installer.reportPortError=\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u30b5\u30fc\u30d0\u30fc\u30dd\u30fc\u30c8 {0} \u306f\u5229\u7528\u3067\u304d\u307e\u305b\u3093\u3002\u4f7f\u7528\u3057\u3066\u3044\u308b\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u304c {1} \u3092\u30d6\u30ed\u30c3\u30af\u3057\u3066\u3044\u306a\u3044\u304b\u78ba\u8a8d\u3057\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30e6\u30fc\u30b6\u30fc\u30d5\u30a9\u30eb\u30c0\u30fc\u5185\u306e{3}\u30d7\u30ed\u30d1\u30c6\u30a3\u30d5\u30a1\u30a4\u30eb\u306e{2}\u3092\u5909\u66f4\u3059\u308b\u691c\u8a0e\u3092\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3082\u3057\u4ed6\u306e\u51e6\u7406\u304c\u554f\u984c\u306e\u539f\u56e0\u3067\u3042\u308c\u3070\u3001\u30b7\u30b9\u30c6\u30e0\u3092\u518d\u8d77\u52d5\u3057\u3066\u4e0b\u3055\u3044\u3002
|
||||||
@ -261,7 +260,6 @@ KeywordSearchModuleFactory.getIngestJobSettingsPanel.exception.msg=\u8a2d\u5b9a\
|
|||||||
SearchRunner.Searcher.done.err.msg=\u30ad\u30fc\u30ef\u30fc\u30c9\u691c\u7d22\u3092\u5b9f\u884c\u4e2d\u306b\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f
|
SearchRunner.Searcher.done.err.msg=\u30ad\u30fc\u30ef\u30fc\u30c9\u691c\u7d22\u3092\u5b9f\u884c\u4e2d\u306b\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f
|
||||||
KeywordSearchGlobalSearchSettingsPanel.timeRadioButton5.text=\u5b9a\u671f\u7684\u691c\u7d22\u7121\u3057
|
KeywordSearchGlobalSearchSettingsPanel.timeRadioButton5.text=\u5b9a\u671f\u7684\u691c\u7d22\u7121\u3057
|
||||||
KeywordSearchGlobalSearchSettingsPanel.timeRadioButton5.toolTipText=\u5168\u4f53\u7684\u306b\u4e00\u756a\u901f\u3044\u3067\u3059\u304c\u3001\u51e6\u7406\u304c\u5b8c\u4e86\u3059\u308b\u307e\u3067\u7d50\u679c\u306f\u8868\u793a\u3055\u308c\u307e\u305b\u3093
|
KeywordSearchGlobalSearchSettingsPanel.timeRadioButton5.toolTipText=\u5168\u4f53\u7684\u306b\u4e00\u756a\u901f\u3044\u3067\u3059\u304c\u3001\u51e6\u7406\u304c\u5b8c\u4e86\u3059\u308b\u307e\u3067\u7d50\u679c\u306f\u8868\u793a\u3055\u308c\u307e\u305b\u3093
|
||||||
HighlightedMatchesSource.getMarkup.queryFailedMsg=<html><pre><span style\\\\\='background\\\\\:yellow'>\u30ad\u30fc\u30ef\u30fc\u30c9\u306b\u30d2\u30c3\u30c8\u3057\u305f\u7d50\u679c\u3092\u53d6\u5f97\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002<br />Autopsy\u304cSolr\u30b5\u30fc\u30d0\u30fc\u306b\u63a5\u7d9a\u3067\u304d\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br /></span></pre></html>\
|
|
||||||
KeywordSearch.openCore.notification.msg=\u30ad\u30fc\u30ef\u30fc\u30c9\u691c\u7d22\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u958b\u3051\u307e\u305b\u3093\u3067\u3057\u305f
|
KeywordSearch.openCore.notification.msg=\u30ad\u30fc\u30ef\u30fc\u30c9\u691c\u7d22\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u958b\u3051\u307e\u305b\u3093\u3067\u3057\u305f
|
||||||
KeywordSearch.closeCore.notification.msg=\u30ad\u30fc\u30ef\u30fc\u30c9\u691c\u7d22\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u9589\u3058\u308b\u969b\u306b\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f
|
KeywordSearch.closeCore.notification.msg=\u30ad\u30fc\u30ef\u30fc\u30c9\u691c\u7d22\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u9589\u3058\u308b\u969b\u306b\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f
|
||||||
KeywordSearchListsManagementPanel.fileExtensionFilterLb2=\u30ad\u30fc\u30ef\u30fc\u30c9\u30ea\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u30a8\u30f3\u30b1\u30fc\u30b9\u3059\u308b(txt)
|
KeywordSearchListsManagementPanel.fileExtensionFilterLb2=\u30ad\u30fc\u30ef\u30fc\u30c9\u30ea\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u30a8\u30f3\u30b1\u30fc\u30b9\u3059\u308b(txt)
|
||||||
@ -272,7 +270,7 @@ SolrConnectionCheck.HostnameOrPort=hostname\u3084\u30dd\u30fc\u30c8\u756a\u53f7\
|
|||||||
SolrConnectionCheck.Hostname=hostname\u304c\u7121\u52b9\u3067\u3059\u3002
|
SolrConnectionCheck.Hostname=hostname\u304c\u7121\u52b9\u3067\u3059\u3002
|
||||||
SolrConnectionCheck.Port=\u30dd\u30fc\u30c8\u756a\u53f7\u304c\u7121\u52b9\u3067\u3059\u3002
|
SolrConnectionCheck.Port=\u30dd\u30fc\u30c8\u756a\u53f7\u304c\u7121\u52b9\u3067\u3059\u3002
|
||||||
SolrConnectionCheck.MissingHostname=hostname\u304c\u6b20\u3051\u3066\u307e\u3059\u3002
|
SolrConnectionCheck.MissingHostname=hostname\u304c\u6b20\u3051\u3066\u307e\u3059\u3002
|
||||||
RawText.getText.error.msg=\u30c6\u30ad\u30b9\u30c8\u3092\u53d6\u5f97\u4e2d\u306b\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f
|
ExtractedContentViewer.getText.error.msg=\u30c6\u30ad\u30b9\u30c8\u3092\u53d6\u5f97\u4e2d\u306b\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f
|
||||||
GlobalListsManagementPanel.exportButton.text=\u30ea\u30b9\u30c8\u3092\u30a8\u30af\u30b9\u30dd\u30fc\u30c8
|
GlobalListsManagementPanel.exportButton.text=\u30ea\u30b9\u30c8\u3092\u30a8\u30af\u30b9\u30dd\u30fc\u30c8
|
||||||
GlobalListsManagementPanel.deleteListButton.text=\u30ea\u30b9\u30c8\u3092\u524a\u9664
|
GlobalListsManagementPanel.deleteListButton.text=\u30ea\u30b9\u30c8\u3092\u524a\u9664
|
||||||
GlobalListsManagementPanel.copyListButton.text=\u30ea\u30b9\u30c8\u3092\u30b3\u30d4\u30fc
|
GlobalListsManagementPanel.copyListButton.text=\u30ea\u30b9\u30c8\u3092\u30b3\u30d4\u30fc
|
||||||
|
@ -648,7 +648,7 @@ class ExtractedContentPanel extends javax.swing.JPanel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@NbBundle.Messages({
|
@NbBundle.Messages({
|
||||||
"ExtractedContentPanel.SetMarkup.error=There was an error getting the text for the selected source."})
|
"ExtractedContentPanel.SetMarkup.error.msg=Error getting text."})
|
||||||
@Override
|
@Override
|
||||||
protected void done() {
|
protected void done() {
|
||||||
super.done();
|
super.done();
|
||||||
@ -665,7 +665,7 @@ class ExtractedContentPanel extends javax.swing.JPanel {
|
|||||||
|
|
||||||
} catch (InterruptedException | ExecutionException ex) {
|
} catch (InterruptedException | ExecutionException ex) {
|
||||||
logger.log(Level.SEVERE, "Error getting marked up text", ex); //NON-NLS
|
logger.log(Level.SEVERE, "Error getting marked up text", ex); //NON-NLS
|
||||||
setPanelText(Bundle.ExtractedContentPanel_SetMarkup_error(), true);
|
setPanelText(NbBundle.getMessage(ExtractedContentViewer.class, "ExtractedContentPanel.getText.error.msg"), true);
|
||||||
} // catch and ignore if we were cancelled
|
} // catch and ignore if we were cancelled
|
||||||
catch (java.util.concurrent.CancellationException ex) {
|
catch (java.util.concurrent.CancellationException ex) {
|
||||||
}
|
}
|
||||||
|
@ -29,6 +29,7 @@ import java.util.logging.Level;
|
|||||||
import org.openide.nodes.Node;
|
import org.openide.nodes.Node;
|
||||||
import org.openide.util.Lookup;
|
import org.openide.util.Lookup;
|
||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
|
import org.openide.util.NbBundle.Messages;
|
||||||
import org.openide.util.lookup.ServiceProvider;
|
import org.openide.util.lookup.ServiceProvider;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
import org.sleuthkit.autopsy.corecomponentinterfaces.DataContentViewer;
|
import org.sleuthkit.autopsy.corecomponentinterfaces.DataContentViewer;
|
||||||
@ -47,6 +48,11 @@ import org.sleuthkit.datamodel.TskCoreException;
|
|||||||
* A content viewer that displays the indexed text associated with a file or an
|
* A content viewer that displays the indexed text associated with a file or an
|
||||||
* artifact, possibly marked up with HTML to highlight keyword hits.
|
* artifact, possibly marked up with HTML to highlight keyword hits.
|
||||||
*/
|
*/
|
||||||
|
@Messages({
|
||||||
|
"ExtractedContentViewer.getText.error.msg=Error getting text.",
|
||||||
|
"ExtractedContentViewer.getSolrContent.noTxtYetMsg=<p style\\=''font-style\\:italic''>There is currently no text in the index for this {0}. It may have no text, it may not have been analyzed yet, there may have been an error extracting text, or keyword search was not enabled during ingest.</p>",
|
||||||
|
"ExtractedContentViewer.getSolrContent.txtBodyItal=<span style\\=''font-style\\:italic''>{0}</span>"
|
||||||
|
})
|
||||||
@ServiceProvider(service = DataContentViewer.class, position = 4)
|
@ServiceProvider(service = DataContentViewer.class, position = 4)
|
||||||
public class ExtractedContentViewer implements DataContentViewer {
|
public class ExtractedContentViewer implements DataContentViewer {
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2011-2017 Basis Technology Corp.
|
* Copyright 2011-2018 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -20,7 +20,6 @@ package org.sleuthkit.autopsy.keywordsearch;
|
|||||||
|
|
||||||
import com.google.common.collect.Iterators;
|
import com.google.common.collect.Iterators;
|
||||||
import com.google.common.collect.Range;
|
import com.google.common.collect.Range;
|
||||||
import com.google.common.collect.RangeSet;
|
|
||||||
import com.google.common.collect.TreeRangeSet;
|
import com.google.common.collect.TreeRangeSet;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
@ -55,7 +54,7 @@ import org.sleuthkit.datamodel.TskCoreException;
|
|||||||
*/
|
*/
|
||||||
class HighlightedText implements IndexedText {
|
class HighlightedText implements IndexedText {
|
||||||
|
|
||||||
private static final Logger logger = Logger.getLogger(HighlightedText.class.getName());
|
private static final Logger LOGGER = Logger.getLogger(HighlightedText.class.getName());
|
||||||
|
|
||||||
private static final boolean DEBUG = (Version.getBuildType() == Version.Type.DEVELOPMENT);
|
private static final boolean DEBUG = (Version.getBuildType() == Version.Type.DEVELOPMENT);
|
||||||
|
|
||||||
@ -140,7 +139,6 @@ class HighlightedText implements IndexedText {
|
|||||||
* This method figures out which pages / chunks have hits. Invoking it a
|
* This method figures out which pages / chunks have hits. Invoking it a
|
||||||
* second time has no effect.
|
* second time has no effect.
|
||||||
*/
|
*/
|
||||||
@Messages({"HighlightedText.query.exception.msg=Could not perform the query to get chunk info and get highlights:"})
|
|
||||||
synchronized private void loadPageInfo() throws TskCoreException, KeywordSearchModuleException, NoOpenCoreException {
|
synchronized private void loadPageInfo() throws TskCoreException, KeywordSearchModuleException, NoOpenCoreException {
|
||||||
if (isPageInfoLoaded) {
|
if (isPageInfoLoaded) {
|
||||||
return;
|
return;
|
||||||
@ -158,7 +156,6 @@ class HighlightedText implements IndexedText {
|
|||||||
this.numberPages = 1;
|
this.numberPages = 1;
|
||||||
this.currentPage = 1;
|
this.currentPage = 1;
|
||||||
numberOfHitsPerPage.put(1, 0);
|
numberOfHitsPerPage.put(1, 0);
|
||||||
pages.add(1);
|
|
||||||
currentHitPerPage.put(1, 0);
|
currentHitPerPage.put(1, 0);
|
||||||
isPageInfoLoaded = true;
|
isPageInfoLoaded = true;
|
||||||
}
|
}
|
||||||
@ -401,7 +398,7 @@ class HighlightedText implements IndexedText {
|
|||||||
// either be a single chunk containing hits or we narrow our
|
// either be a single chunk containing hits or we narrow our
|
||||||
// query down to the current page/chunk.
|
// query down to the current page/chunk.
|
||||||
if (response.getResults().size() > 1) {
|
if (response.getResults().size() > 1) {
|
||||||
logger.log(Level.WARNING, "Unexpected number of results for Solr highlighting query: {0}", q); //NON-NLS
|
LOGGER.log(Level.WARNING, "Unexpected number of results for Solr highlighting query: {0}", q); //NON-NLS
|
||||||
}
|
}
|
||||||
String highlightedContent;
|
String highlightedContent;
|
||||||
Map<String, Map<String, List<String>>> responseHighlight = response.getHighlighting();
|
Map<String, Map<String, List<String>>> responseHighlight = response.getHighlighting();
|
||||||
@ -427,8 +424,8 @@ class HighlightedText implements IndexedText {
|
|||||||
|
|
||||||
return "<html><pre>" + highlightedContent + "</pre></html>"; //NON-NLS
|
return "<html><pre>" + highlightedContent + "</pre></html>"; //NON-NLS
|
||||||
} catch (TskCoreException | KeywordSearchModuleException | NoOpenCoreException ex) {
|
} catch (TskCoreException | KeywordSearchModuleException | NoOpenCoreException ex) {
|
||||||
logger.log(Level.SEVERE, "Error getting highlighted text for Solr doc id " + objectId + ", chunkID " + chunkID + ", highlight query: " + highlightField, ex); //NON-NLS
|
LOGGER.log(Level.SEVERE, "Error getting highlighted text for Solr doc id " + objectId + ", chunkID " + chunkID + ", highlight query: " + highlightField, ex); //NON-NLS
|
||||||
return NbBundle.getMessage(this.getClass(), "HighlightedMatchesSource.getMarkup.queryFailedMsg");
|
return NbBundle.getMessage(ExtractedContentViewer.class, "ExtractedContentViewer.getText.error.msg");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -471,7 +468,7 @@ class HighlightedText implements IndexedText {
|
|||||||
*/
|
*/
|
||||||
static String attemptManualHighlighting(SolrDocumentList solrDocumentList, String highlightField, Collection<String> keywords) {
|
static String attemptManualHighlighting(SolrDocumentList solrDocumentList, String highlightField, Collection<String> keywords) {
|
||||||
if (solrDocumentList.isEmpty()) {
|
if (solrDocumentList.isEmpty()) {
|
||||||
return NbBundle.getMessage(HighlightedText.class, "HighlightedMatchesSource.getMarkup.noMatchMsg");
|
return NbBundle.getMessage(ExtractedContentViewer.class, "ExtractedContentViewer.getSolrContent.noTxtYetMsg", "document"); // DLG:
|
||||||
}
|
}
|
||||||
|
|
||||||
// It doesn't make sense for there to be more than a single document in
|
// It doesn't make sense for there to be more than a single document in
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2011-2017 Basis Technology Corp.
|
* Copyright 2011-2018 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -18,16 +18,14 @@
|
|||||||
*/
|
*/
|
||||||
package org.sleuthkit.autopsy.keywordsearch;
|
package org.sleuthkit.autopsy.keywordsearch;
|
||||||
|
|
||||||
import java.util.LinkedHashMap;
|
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import org.apache.solr.client.solrj.SolrServerException;
|
import org.apache.solr.client.solrj.SolrServerException;
|
||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
|
import org.openide.util.NbBundle.Messages;
|
||||||
import org.sleuthkit.autopsy.coreutils.EscapeUtil;
|
import org.sleuthkit.autopsy.coreutils.EscapeUtil;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.datamodel.AbstractFile;
|
|
||||||
import org.sleuthkit.datamodel.BlackboardArtifact;
|
import org.sleuthkit.datamodel.BlackboardArtifact;
|
||||||
import org.sleuthkit.datamodel.Content;
|
import org.sleuthkit.datamodel.Content;
|
||||||
import org.sleuthkit.datamodel.TskData;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A "source" for the extracted content viewer that displays "raw" (not
|
* A "source" for the extracted content viewer that displays "raw" (not
|
||||||
@ -44,7 +42,7 @@ class RawText implements IndexedText {
|
|||||||
//keep last content cached
|
//keep last content cached
|
||||||
private String cachedString;
|
private String cachedString;
|
||||||
private int cachedChunk;
|
private int cachedChunk;
|
||||||
private static final Logger logger = Logger.getLogger(RawText.class.getName());
|
private static final Logger LOGGER = Logger.getLogger(RawText.class.getName());
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Construct a new RawText object for the given content and object id. This
|
* Construct a new RawText object for the given content and object id. This
|
||||||
@ -153,10 +151,10 @@ class RawText implements IndexedText {
|
|||||||
} else if (this.blackboardArtifact != null) {
|
} else if (this.blackboardArtifact != null) {
|
||||||
return getArtifactText();
|
return getArtifactText();
|
||||||
}
|
}
|
||||||
} catch (SolrServerException ex) {
|
} catch (SolrServerException | NoOpenCoreException ex) {
|
||||||
logger.log(Level.SEVERE, "Couldn't get extracted content", ex); //NON-NLS
|
LOGGER.log(Level.SEVERE, "Couldn't get extracted text", ex); //NON-NLS
|
||||||
}
|
}
|
||||||
return NbBundle.getMessage(this.getClass(), "RawText.getText.error.msg");
|
return NbBundle.getMessage(ExtractedContentViewer.class, "ExtractedContentViewerRawText.getText.error.msg");
|
||||||
}
|
}
|
||||||
|
|
||||||
@NbBundle.Messages({
|
@NbBundle.Messages({
|
||||||
@ -208,10 +206,10 @@ class RawText implements IndexedText {
|
|||||||
hasChunks = true;
|
hasChunks = true;
|
||||||
}
|
}
|
||||||
} catch (KeywordSearchModuleException ex) {
|
} catch (KeywordSearchModuleException ex) {
|
||||||
logger.log(Level.WARNING, "Could not get number of chunks: ", ex); //NON-NLS
|
LOGGER.log(Level.WARNING, "Could not get number of chunks: ", ex); //NON-NLS
|
||||||
|
|
||||||
} catch (NoOpenCoreException ex) {
|
} catch (NoOpenCoreException ex) {
|
||||||
logger.log(Level.WARNING, "Could not get number of chunks: ", ex); //NON-NLS
|
LOGGER.log(Level.WARNING, "Could not get number of chunks: ", ex); //NON-NLS
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -225,30 +223,20 @@ class RawText implements IndexedText {
|
|||||||
* chunks. This means we need to address the content
|
* chunks. This means we need to address the content
|
||||||
* pages specially.
|
* pages specially.
|
||||||
*
|
*
|
||||||
* @return the extracted content
|
* @return the extracted text
|
||||||
*
|
*
|
||||||
* @throws SolrServerException if something goes wrong
|
* @throws NoOpenCoreException If no Solr core is available.
|
||||||
|
* @throws SolrServerException If there's a Solr communication or parsing issue.
|
||||||
*/
|
*/
|
||||||
private String getContentText(int currentPage, boolean hasChunks) throws SolrServerException {
|
private String getContentText(int currentPage, boolean hasChunks) throws NoOpenCoreException, SolrServerException {
|
||||||
final Server solrServer = KeywordSearch.getServer();
|
final Server solrServer = KeywordSearch.getServer();
|
||||||
|
|
||||||
if (hasChunks == false) {
|
if (hasChunks == false) {
|
||||||
//if no chunks, it is safe to assume there is no text content
|
//if no chunks, it is safe to assume there is no text content
|
||||||
//because we are storing extracted text in chunks only
|
//because we are storing extracted text in chunks only
|
||||||
//and the non-chunk stores meta-data only
|
//and the non-chunk stores meta-data only
|
||||||
String name = content.getName();
|
String msg = NbBundle.getMessage(ExtractedContentViewer.class, "ExtractedContentViewer.getSolrContent.noTxtYetMsg", "file");
|
||||||
String msg = null;
|
String htmlMsg = NbBundle.getMessage(ExtractedContentViewer.class, "ExtractedContentViewer.getSolrContent.txtBodyItal", msg);
|
||||||
if (content instanceof AbstractFile) {
|
|
||||||
//we know it's AbstractFile, but do quick check to make sure if we index other objects in future
|
|
||||||
boolean isKnown = TskData.FileKnown.KNOWN.equals(((AbstractFile) content).getKnown());
|
|
||||||
if (isKnown && KeywordSearchSettings.getSkipKnown()) {
|
|
||||||
msg = NbBundle.getMessage(this.getClass(), "ExtractedContentViewer.getSolrContent.knownFileMsg", name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (msg == null) {
|
|
||||||
msg = NbBundle.getMessage(this.getClass(), "ExtractedContentViewer.getSolrContent.noTxtYetMsg", name);
|
|
||||||
}
|
|
||||||
String htmlMsg = NbBundle.getMessage(this.getClass(), "ExtractedContentViewer.getSolrContent.txtBodyItal", msg);
|
|
||||||
return htmlMsg;
|
return htmlMsg;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -262,33 +250,33 @@ class RawText implements IndexedText {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//not cached
|
//not cached
|
||||||
try {
|
String indexedText = solrServer.getSolrContent(this.objectId, chunkId);
|
||||||
String indexedText = solrServer.getSolrContent(this.objectId, chunkId);
|
if (indexedText == null) indexedText = "";
|
||||||
if (indexedText == null) indexedText = "";
|
cachedString = EscapeUtil.escapeHtml(indexedText).trim();
|
||||||
cachedString = EscapeUtil.escapeHtml(indexedText).trim();
|
StringBuilder sb = new StringBuilder(cachedString.length() + 20);
|
||||||
StringBuilder sb = new StringBuilder(cachedString.length() + 20);
|
sb.append("<pre>").append(cachedString).append("</pre>"); //NON-NLS
|
||||||
sb.append("<pre>").append(cachedString).append("</pre>"); //NON-NLS
|
cachedString = sb.toString();
|
||||||
cachedString = sb.toString();
|
cachedChunk = chunkId;
|
||||||
cachedChunk = chunkId;
|
|
||||||
} catch (NoOpenCoreException ex) {
|
|
||||||
logger.log(Level.SEVERE, "No open core", ex); //NON-NLS
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
return cachedString;
|
return cachedString;
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getArtifactText() throws SolrServerException{
|
/**
|
||||||
try {
|
* Get extracted artifact for a node from Solr
|
||||||
String indexedText = KeywordSearch.getServer().getSolrContent(this.objectId, 1);
|
*
|
||||||
if (indexedText == null) indexedText = "";
|
* @return the extracted text
|
||||||
indexedText = EscapeUtil.escapeHtml(indexedText).trim();
|
*
|
||||||
StringBuilder sb = new StringBuilder(indexedText.length() + 20);
|
* @throws NoOpenCoreException If no Solr core is available.
|
||||||
sb.append("<pre>").append(indexedText).append("</pre>"); //NON-NLS
|
* @throws SolrServerException If there's a Solr communication or parsing issue.
|
||||||
return sb.toString();
|
*/
|
||||||
} catch (NoOpenCoreException ex) {
|
private String getArtifactText() throws NoOpenCoreException, SolrServerException{
|
||||||
logger.log(Level.SEVERE, "No open core", ex); //NON-NLS
|
String indexedText = KeywordSearch.getServer().getSolrContent(this.objectId, 1);
|
||||||
return "";
|
if (indexedText == null) indexedText = "";
|
||||||
}
|
indexedText = EscapeUtil.escapeHtml(indexedText).trim();
|
||||||
|
StringBuilder sb = new StringBuilder(indexedText.length() + 20);
|
||||||
|
sb.append("<pre>").append(indexedText).append("</pre>"); //NON-NLS
|
||||||
|
|
||||||
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user