com.raritantechnologies.concept.clustering
Class ClusterTreeBuilder

java.lang.Object
  extended bycom.raritantechnologies.concept.clustering.ClusterTreeBuilder
All Implemented Interfaces:
IConfigurable, IResultSetTreeBuilder, ITreeBuilder

public class ClusterTreeBuilder
extends java.lang.Object
implements ITreeBuilder, IResultSetTreeBuilder

Uses recursive clustering to build a "Cluster Hierarchy" tree object. A Raritan SearchSource is first used to generate a set of results from which keywords are extracted using an IDocumentKeywordProcessor. In the first pass, the most popular keywords are used as tree nodes. For each keyword, the set of documents that contain the keyword is processed (the document cluster), is re-clustered excluding the parent keywords.

XML Configuration Template:
   <TreeBuilder class="com.raritantechnologies.concept.clustering.ClusterTreeBuilder"
                   searchSource="[ name of SearchSource to get results to cluster ]"
                   nClustersPerLevel="[ number of clusters to be added per level ]"
                   maxDepth="[ maximum depth to persue ]"
                   minimumDocCount="[ minimum number of documents for node to be included ]"
                   sortNodesBy="[ NAME | COUNT | DOCCOUNT ]" >

      <!-- Optional Request - query map: defines which request fields are used to generate a query for the result clustering -->
      <QueryMap>
         <Field ID="[ name of query field ]" requestParam="[ name of parameter in http request ]" />
      </QueryMap>

      <!-- Optional query parser / translator -->
      <QueryParser>

      </QueryParser>

      <!-- Instance of IDocumentKeywordProcessor that will be used to construct the hierarchical cluster map -->
      <DocumentKeywordProcessor class="[ class of com.raritantechnologies.concept.IDocumentKeywordProcessor ]" >

      </DocumentKeywordProcessor>

   </TreeBuilder>
 

Developed by Raritan Technologies .

Author:
Ted Sullivan

Field Summary
 
Fields inherited from interface com.raritantechnologies.utils.tree.ITreeBuilder
TEMPLATE
 
Constructor Summary
ClusterTreeBuilder()
           
 
Method Summary
 TreeRoot buildTree(RaritanPageContext pContext)
           
 TreeRoot buildTree(java.lang.String sessionID, IDocumentKeywordProcessor processor, IResultSet results)
           
 TreeRoot buildTree(java.lang.String treeName, java.lang.String pathField, IResultSet results)
           
protected  OrderedMap getQuery(RaritanPageContext pContext)
           
protected  IResultSet getResults(RaritanPageContext pContext)
           
 void initialize(org.w3c.dom.Element elem)
          Initializes the object from an XML tag or element.
 TreeRoot refreshTree(TreeRoot tree, RaritanPageContext pContext)
          Method to enable dynamic or refreshable trees.
 void setAddNodeCounts(boolean addNodeCounts)
           
 void setAddResultsToNode(boolean addResultsToNode)
           
 void setPathValueDelimiter(java.lang.String delimiter)
           
 void setResultAttributeMap(java.util.Map resultAttributeMap)
           
 void setUseRootPath(boolean useRootPath)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClusterTreeBuilder

public ClusterTreeBuilder()
Method Detail

buildTree

public TreeRoot buildTree(RaritanPageContext pContext)
Specified by:
buildTree in interface ITreeBuilder

buildTree

public TreeRoot buildTree(java.lang.String treeName,
                          java.lang.String pathField,
                          IResultSet results)
Specified by:
buildTree in interface IResultSetTreeBuilder

getResults

protected IResultSet getResults(RaritanPageContext pContext)

getQuery

protected OrderedMap getQuery(RaritanPageContext pContext)

buildTree

public TreeRoot buildTree(java.lang.String sessionID,
                          IDocumentKeywordProcessor processor,
                          IResultSet results)

refreshTree

public TreeRoot refreshTree(TreeRoot tree,
                            RaritanPageContext pContext)
Description copied from interface: ITreeBuilder

Method to enable dynamic or refreshable trees. Static tree builders should implement this by returning the passed in tree object. Dynamic tree builders should implement this by returning the output of their buildTree( ) method or by pruning/growing the given tree as appropriate.

ITreeBuilders that support "lazy tree node evaluation" should use this method to determine which nodes in the tree need to be updated (TreeNode.needsUpdate( ) method returns true.

Specified by:
refreshTree in interface ITreeBuilder

initialize

public void initialize(org.w3c.dom.Element elem)
Description copied from interface: IConfigurable
Initializes the object from an XML tag or element. This method is called by the Framework as part of the application initializtion. see ConfigurationManager, XMLConfigurationManager, XMLSearchFieldMapFactory, XMLSearchSourceFactory. Configurable objects that are owned or contained by other configurable objects will be initialized in by the parent object.

Specified by:
initialize in interface IConfigurable

setAddResultsToNode

public void setAddResultsToNode(boolean addResultsToNode)
Specified by:
setAddResultsToNode in interface IResultSetTreeBuilder

setAddNodeCounts

public void setAddNodeCounts(boolean addNodeCounts)
Specified by:
setAddNodeCounts in interface IResultSetTreeBuilder

setResultAttributeMap

public void setResultAttributeMap(java.util.Map resultAttributeMap)
Specified by:
setResultAttributeMap in interface IResultSetTreeBuilder

setUseRootPath

public void setUseRootPath(boolean useRootPath)
Specified by:
setUseRootPath in interface IResultSetTreeBuilder

setPathValueDelimiter

public void setPathValueDelimiter(java.lang.String delimiter)
Specified by:
setPathValueDelimiter in interface IResultSetTreeBuilder