Improve comments on TextMarkupLookup

This commit is contained in:
Richard Cordovano 2015-11-18 22:38:08 -05:00
parent fd11227d62
commit 17d9c77f45

View File

@ -19,32 +19,34 @@
package org.sleuthkit.autopsy.datamodel; package org.sleuthkit.autopsy.datamodel;
/** /**
* This interface acts as a sort of circular-dependency-defeating bridge at run * This interface acts as a sort of bridge between the Autopsy Core NetBeans
* time between the Autopsy Core NetBeans Module (NBM) and the Autopsy * Module (NBM) and the Autopsy KeywordSearch NBM. It is used to get indexed
* KeywordSearch NBM. Here is how it works. Code in the Core NBM asks the * text marked up with HTML to highlight search hits for a particular keyword.
*
* Here is an example of how it works. It is used to put highlighted markup into
* the Lookups of the BlackboardArtifactNodes for keyword search hit artifacts.
* The BlackboardArtifactNode code that populates the node's Lookup asks the
* default global Lookup for an instance of TextMarkupLookup. The * default global Lookup for an instance of TextMarkupLookup. The
* org.sleuthkit.autopsy.keywordsearch.HighlightedTextMarkup class is the sole * org.sleuthkit.autopsy.keywordsearch.HighlightedTextMarkup class is the sole
* implementation, so the Core code gets a default constructed instance of * implementation of the interface, so the BlackboardArtifactNode gets a default
* HighlightedTextMarkup. This otherwise useless instance is then used to call * constructed instance of HighlightedTextMarkup. This otherwise useless
* createInstance with parameters that will be used to employ the Solr * instance is then used to call createInstance with parameters that are used to
* highlighting capability on text indexed through the KeywordSearch NBM * employ the Solr highlighting capability to create the markup. The
* implementation of the KeywordSearchService interface. The Core code then puts * TextMarkupLookup object goes in the BlackboardArtifactNode Lookup for later
* that TextMarkupLookup in its Lookup for later use by the * use by the ExtractedContentViewer, a DataContentViewer in the KeywordSearch
* ExtractedContentViewer, a DataContentViewer in the KeywordSearch NBM. * NBM.
*/ */
public interface TextMarkupLookup { public interface TextMarkupLookup {
/** /**
* Creates an instance of a TextMarkupLookup object without knowing its * Factory method for getting an object that encapsulates indexed text
* actual type. * marked up (HTML) to highlight search hits for a particular keyword.
* *
* @param objectId ID of the object (file or artifact) for which to get * @param objectId ID of the object (file or artifact) that is the
* keyword search indexed text marked up (HTML) to * source of the indexed text.
* highlight a particular keword search hit. * @param keyword The keyword to be highlighted in the text.
* @param keyword The keyword hit to be highlighted.
* @param isRegex Whether or not the query that follows is a regex. * @param isRegex Whether or not the query that follows is a regex.
* @param originalQuery The query that produces the indexed text containing * @param originalQuery The query that produces the keyword hit.
* the keyword to be highlighted.
* *
* @return An object that encapsulates indexed text marked up (HTML) to * @return An object that encapsulates indexed text marked up (HTML) to
* highlight search hits for a particular keyword. * highlight search hits for a particular keyword.