|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.raritantechnologies.utils.tree.CachedTreeBuilder
TreeBuilder that maintains a cached copy of the initial tree build. For a dynamic cache, uses a set of request parameters to monitor - rebuilds the tree if one of these parameter values changes.
XML Configuration Template:
<TreeBuilder class="com.raritantechnologies.utils.tree.CachedTreeBuilder"
cacheTreeName="[ name of cached tree ]"
useStaticCache="[ true|false(default) ]" >
<!-- Optional: use CacheObject to detect changes in request params -->
<CacheParams cacheOnNull="[ true|false( default ) ]" >
<Param ID="[ name of request param ]" />
<!-- etc. . . -->
</CacheParams>
<!-- Delegate tree builder to create the cached tree -->
<TreeBuilder class="[ class of com.raritantechnologies.utils.tree.ITreeBuilder ]" >
</TreeBuilder>
</TreeBuilder>
| Field Summary |
| Fields inherited from interface com.raritantechnologies.utils.tree.ITreeBuilder |
TEMPLATE |
| Constructor Summary | |
CachedTreeBuilder()
|
|
| Method Summary | |
TreeRoot |
buildTree(RaritanPageContext pContext)
if cachedTree is present, return it, else call proxyTreeBuilder.buildTree( ) cache it and return it. |
static void |
cacheTree(TreeRoot cachedTree,
java.lang.String cacheTreeName,
RaritanPageContext pContext)
|
static void |
cacheTree(TreeRoot cachedTree,
java.lang.String cacheTreeName,
RaritanPageContext pContext,
boolean useStaticMap)
|
java.lang.String |
getConfigurationXML()
|
java.lang.String |
getConfigurationXML(java.lang.String configurationTemplate)
|
void |
getConfigurationXML(java.io.Writer writer)
|
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. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public CachedTreeBuilder()
| Method Detail |
public TreeRoot buildTree(RaritanPageContext pContext)
buildTree in interface ITreeBuilder
public static void cacheTree(TreeRoot cachedTree,
java.lang.String cacheTreeName,
RaritanPageContext pContext)
public static void cacheTree(TreeRoot cachedTree,
java.lang.String cacheTreeName,
RaritanPageContext pContext,
boolean useStaticMap)
public TreeRoot refreshTree(TreeRoot tree,
RaritanPageContext pContext)
ITreeBuilderMethod 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.
refreshTree in interface ITreeBuilderpublic void initialize(org.w3c.dom.Element elem)
IConfigurable
initialize in interface IConfigurable
public void getConfigurationXML(java.io.Writer writer)
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String getConfigurationXML()
public java.lang.String getConfigurationXML(java.lang.String configurationTemplate)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||