com.raritantechnologies.utils.tree.topic
Class TreeTopicSetBuilder
java.lang.Object
com.raritantechnologies.utils.tree.topic.TreeTopicSetBuilder
- All Implemented Interfaces:
- IConfigurable, ITopicSetBuilder
- public class TreeTopicSetBuilder
- extends java.lang.Object
- implements ITopicSetBuilder
Builds a TopicSet from an RTI
TreeRoot object. Configuration describes how the TreeNode attributes are to be
used as Topic parts.
Tree Nodes can include a query rule that is parsable using an ITopicParser. If
the query rule is not present, other fields can be used to create a simple rule based on a set of terms that are either
ANDed or ORed together. Topic generation can also be selectively suppressed for some nodes.
XML Configuration Template:
<TopicSetBuilder class="com.raritantechnologies.utils.tree.topic.TreeTopicSetBuilder"
topicDepth="[ depth of Topic node: 0 = node only, 1 = children only, 2 = grandchildren etc. ]"
leafNodesOnly="[ true|false(default) if true: only make Topics on leaf nodes ]"
topicNameField="[NODE|PATH|Attribute:<attribute name>|ResultField:<field name>]"
topicOperator="[AND|OR|(default)|COUNT/threshold - operator for set of topics ]"
termOperator="[ANY(default)|ALL|PHRASE - operator for words within a term ]"
debug="true|false(default)"
debugTiming="[ true|false(default) ]"
debugMemory="[ true|false(default) ]"
noTopicAttribute="[Attribute Name=Attribute value: use to supress topic generation for some nodes]"
definitionAttribute="[ tree node attribute that is used to set Topic definition ]"
combineTopics="[ true|false( default) - if false: TopicParser rule overrides Term Rule - if true they are combined using the topic operator (default=OR) ]" >
<!-- TreeBuilder -->
<TreeBuilder class="[ class of com.raritantechnologies.utils.tree.ITreeBuilder ]" >
</TreeBuilder>
<!-- An (optional) ITopicParser tag that convert a query string attribute value into -->
<!-- a query Topic. -->
<TopicParser class="[ class of com.raritantechnologies.rql.topic.ITopicParser ]"
attribute="[ name of TreeNode Attribute that contains the query rule ]" >
<!-- Set of attributes or nested result fields that will be added to topics "As Is" -->
<!-- The Terms will be used IF the TopicParser is not present OR the node does not contain -->
<!-- a parsable query (i.e. the TopicParser attribute is not set in the node). -->
<Terms>
<Term attribute="[Attribute:<attribute name>|ResultField:<field name>]" >
</Terms>
<!-- Set of tagging attributes that will be added as Topic attributes (used for tagging, not matching) -->
<TopicAttributes>
<Attribute nodeAttribute="[ name of TreeNode attribute ]" topicAttribute="[ name of Topic attribute ]" />
</TopicAttributes>
<!-- Optional filtering operations on node path name -->
<NodePathFilter class="[ class of com.raritantechnologies.utils.filter.IStringFilter ]" >
</NodePathFilter>
<!-- Optional Topic Parser -->
<TopicParser class="[ class of com.raritantechnologies.rql.topic.ITopicParser ]"
attribute="[ attribute associated with this Topic ]" >
</TopicParser>
</TopicSetBuilder>
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TreeTopicSetBuilder
public TreeTopicSetBuilder()
buildTopicSet
public TopicSet buildTopicSet(RaritanPageContext pageContext)
- Specified by:
buildTopicSet in interface ITopicSetBuilder
buildTopicSet
public TopicSet buildTopicSet(TreeRoot theTree)
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