/*
 * Autopsy Forensic Browser
 * 
 * Copyright 2011-2015 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.datamodel;

/**
 * This interface acts as a sort of circular-dependency-defeating bridge at run
 * time between the Autopsy Core NetBeans Module (NBM) and the Autopsy
 * KeywordSearch NBM. Here is how it works. Code in the Core NBM asks the
 * default global Lookup for an instance of TextMarkupLookup. The
 * org.sleuthkit.autopsy.keywordsearch.HighlightedTextMarkup class is the sole
 * implementation, so the Core code gets a default constructed instance of
 * HighlightedTextMarkup. This otherwise useless instance is then used to call
 * createInstance with parameters that will be used to employ the Solr
 * highlighting capability on text indexed through the KeywordSearch NBM
 * implementation of the KeywordSearchService interface. The Core code then puts
 * that TextMarkupLookup in its Lookup for later use by the
 * ExtractedContentViewer, a DataContentViewer in the KeywordSearch NBM.
 */
public interface TextMarkupLookup {

    /**
     * Creates an instance of a TextMarkupLookup object without knowing its
     * actual type.
     *
     * @param objectId      ID of the object (file or artifact) for which to get
     *                      keyword search indexed text marked up (HTML) to
     *                      highlight a particular keword search hit.
     * @param keyword       The keyword hit to be highlighted.
     * @param isRegex       Whether or not the query that follows is a regex.
     * @param originalQuery The query that produces the indexed text containing
     *                      the keyword to be highlighted.
     *
     * @return An object that encapsulates indexed text marked up (HTML) to
     *         highlight search hits for a particular keyword.
     */
    public TextMarkupLookup createInstance(long objectId, String keyword, boolean isRegex, String originalQuery);
}

@@ -770,58 +770,13 @@
  of 
-circular-dependency-defeating bridge at run%0A * tim
+bridg
 e be
@@ -806,16 +806,19 @@
 NetBeans
+%0A *
  Module 
@@ -838,19 +838,16 @@
  Autopsy
-%0A *
  Keyword
@@ -862,50 +862,344 @@
 BM. 
-Here is how it works. Code in the Core NBM
+It is used to get indexed%0A * text marked up with HTML to highlight search hits for a particular keyword.%0A *%0A * Here is an example of how it works. It is used to put highlighted markup into%0A * the Lookups of the BlackboardArtifactNodes for keyword search hit artifacts.%0A * The BlackboardArtifactNode code that populates the node's Lookup
  ask
@@ -1370,23 +1370,53 @@
 tion
-, so the Core c
+ of the interface, so the BlackboardArtifactN
 ode 
@@ -1429,16 +1429,19 @@
  default
+%0A *
  constru
@@ -1456,19 +1456,16 @@
 tance of
-%0A *
  Highlig
@@ -1502,16 +1502,19 @@
  useless
+%0A *
  instanc
@@ -1535,19 +1535,16 @@
  to call
-%0A *
  createI
@@ -1576,14 +1576,10 @@
 hat 
-will b
+ar
 e us
@@ -1583,16 +1583,19 @@
  used to
+%0A *
  employ 
@@ -1602,19 +1602,16 @@
 the Solr
-%0A *
  highlig
@@ -1631,166 +1631,95 @@
 ity 
-on text indexed through the KeywordSearch NBM%0A * implementation of the KeywordSearchService interface. The Core code then puts%0A * that TextMarkupLookup in its
+to create the markup. The%0A * TextMarkupLookup object goes in the BlackboardArtifactNode
  Loo
@@ -1731,16 +1731,19 @@
 or later
+%0A *
  use by 
@@ -1745,19 +1745,16 @@
 e by the
-%0A *
  Extract
@@ -1806,24 +1806,27 @@
 eywordSearch
+%0A *
  NBM.%0A */%0Apu
@@ -1879,95 +1879,149 @@
   * 
-Creates an instance of a TextMarkupLookup object without knowing its%0A     * actual type
+Factory method for getting an object that encapsulates indexed text%0A     * marked up (HTML) to highlight search hits for a particular keyword
 .%0A  
@@ -2093,24 +2093,19 @@
 ct) 
-for which to get
+that is the
 %0A   
@@ -2133,123 +2133,33 @@
     
-keyword search indexed text marked up (HTML) to%0A     *                      highlight a particular keword search hi
+source of the indexed tex
 t.%0A 
@@ -2197,20 +2197,16 @@
 keyword 
-hit 
 to be hi
@@ -2206,32 +2206,44 @@
 o be highlighted
+ in the text
 .%0A     * @param 
@@ -2366,89 +2366,19 @@
 the 
-indexed text containing%0A     *                      the keyword to be highlighted
+keyword hit
 .%0A  

Improve comments on TextMarkupLookup