|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.ontopia.topicmaps.nav2.utils.DynamicTreeWidget
public class DynamicTreeWidget
EXPERIMENTAL: This class can output a nice collapsing/expanding tree view of a topic map implemented with DHTML, which uses tolog queries to produce the tree. The class is configurable in various ways, and can also be subclassed to further fine-tune the rendering.
Field Summary | |
---|---|
protected static int |
CLOSE
|
protected static int |
CLOSE_ALL
|
protected NavigatorPageIF |
context
|
protected static int |
EXPAND_ALL
|
protected java.lang.String |
imageurl
|
protected java.lang.String |
nodepage
|
protected static int |
OPEN
|
protected java.lang.String |
ownpage
|
protected QueryProcessorIF |
processor
|
protected java.lang.String |
staticurl
|
protected static int |
WINDOW_SIZE
|
protected int |
windowSize
|
Constructor Summary | |
---|---|
DynamicTreeWidget()
PUBLIC: Sets up the widget ready for use. |
|
DynamicTreeWidget(TopicMapIF topicmap,
java.lang.String tablequery,
java.lang.String ownpage,
java.lang.String nodepage)
PUBLIC: Sets up the widget ready for use. |
Method Summary | |
---|---|
protected void |
endRender(java.io.Writer out)
PUBLIC: Called after the tree has been rendered. |
protected java.lang.String |
escapeName(java.lang.String name)
|
protected java.lang.String |
getId(TopicIF topic)
|
protected java.lang.String |
getQualifiedId(java.lang.String id)
|
protected TopicIF |
getTopic(java.lang.String id)
|
protected void |
initializeContext(javax.servlet.http.HttpServletRequest request)
|
protected java.lang.String |
list(java.util.Set nodes)
|
protected java.lang.String |
makeNodeUrl(TopicTreeNode node)
PUBLIC: Produces the URL to the given node. |
protected void |
renderBackButton(java.io.Writer out,
int topline)
PUBLIC: Renders the back button at the top/bottom of the form. |
protected void |
renderCloseAllButton(java.io.Writer out,
int topline)
PUBLIC: Renders the close all button at the top/bottom of the form. |
protected void |
renderExpandAllButton(java.io.Writer out,
int topline)
PUBLIC: Renders the expand all button at the top/bottom of the form. |
protected void |
renderForwardButton(java.io.Writer out,
int topline)
PUBLIC: Renders the close all button at the top/bottom of the form. |
protected void |
renderNode(TopicTreeNode node,
java.io.Writer out)
PUBLIC: This method renders the tree node, including its link, but not the button in front of the node. |
protected void |
renderNodeButton(int topline,
int level,
int action,
java.lang.String id,
java.io.Writer out)
PUBLIC: Renders the +/- button in front of the node. |
void |
run(javax.servlet.http.HttpServletRequest request,
java.io.Writer writer)
PUBLIC: Runs the widget, producing the output. |
void |
run(javax.servlet.jsp.PageContext ctxt,
java.io.Writer writer)
PUBLIC: Runs the widget, producing the output. |
void |
setAddAnchor(boolean addAnchor)
PUBLIC: If set to true the widget will add anchors on all links that open/close nodes in the tree. |
void |
setChildrenComparator(java.util.Comparator childrenComparator)
|
void |
setDataQuery(java.lang.String dataquery)
|
void |
setDebug(boolean debug)
INTERNAL: Debug flag. |
void |
setDependentWidgets(java.lang.String[] widget_names)
PUBLIC: The name of the session key in which the set of open nodes is stored. |
void |
setImageUrl(java.lang.String imageurl)
PUBLIC: The URL at which the graphics used by the widget are found. |
void |
setNodeFrame(java.lang.String nodeFrame)
PUBLIC: The name of the HTML frame in which to open links to nodes. |
void |
setNodePageUrl(java.lang.String nodePageUrl)
PUBLIC: The URL of of the page that shows the nodes. |
void |
setOwnPageUrl(java.lang.String ownPageUrl)
PUBLIC: The URL of the page the widget is on. |
void |
setTableQuery(java.lang.String tablequery)
EXPERIMENTAL: The name of the HTML frame in which to open links to nodes. |
void |
setTableQueryString(java.lang.String tablequery)
PUBLIC: Sets the tolog query that generates the entire tree. |
void |
setTopicMap(TopicMapIF topicmap)
PUBLIC: Sets the topic map used by the widget. |
void |
setTopQuery(java.lang.String topquery)
|
void |
setWidgetName(java.lang.String name)
PUBLIC: The name of the session key in which the set of open nodes is stored. |
void |
setWindowSize(int windowSize)
PUBLIC: Sets the maximum number of nodes displayed by the widget at once. |
protected void |
startRender(java.io.Writer out)
PUBLIC: Called before rendering of the tree begins. |
java.lang.String |
toString(TopicIF topic)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final int OPEN
protected static final int CLOSE
protected static final int EXPAND_ALL
protected static final int CLOSE_ALL
protected static final int WINDOW_SIZE
protected QueryProcessorIF processor
protected java.lang.String nodepage
protected java.lang.String staticurl
protected java.lang.String imageurl
protected int windowSize
protected NavigatorPageIF context
protected java.lang.String ownpage
Constructor Detail |
---|
public DynamicTreeWidget(TopicMapIF topicmap, java.lang.String tablequery, java.lang.String ownpage, java.lang.String nodepage) throws InvalidQueryException
topicmap
- The topic map being displayed.tablequery
- A tolog query that generates the entire tree. The
query must have at least two columns, where the first column
contains all the parent nodes and the second column contains the
children of those parents. Any further columns will be used to
populate the data attribute of the tree nodes.ownpage
- The URL of the page the widget is on. The widget
will append request parameters in the form "a=b&c=d&e=f..."nodepage
- The URL of of the page that shows the nodes.
InvalidQueryException
public DynamicTreeWidget()
Method Detail |
---|
public void setTopicMap(TopicMapIF topicmap)
public void setTableQueryString(java.lang.String tablequery)
public void setOwnPageUrl(java.lang.String ownPageUrl)
public void setNodePageUrl(java.lang.String nodePageUrl)
public void setDebug(boolean debug)
public void setWidgetName(java.lang.String name)
public void setDependentWidgets(java.lang.String[] widget_names)
protected java.lang.String escapeName(java.lang.String name)
public void setImageUrl(java.lang.String imageurl)
public void setAddAnchor(boolean addAnchor)
public void setWindowSize(int windowSize)
public void setNodeFrame(java.lang.String nodeFrame)
public void run(javax.servlet.jsp.PageContext ctxt, java.io.Writer writer) throws java.io.IOException, InvalidQueryException, NavigatorRuntimeException
java.io.IOException
InvalidQueryException
NavigatorRuntimeException
public void setTableQuery(java.lang.String tablequery)
public void setChildrenComparator(java.util.Comparator childrenComparator)
public void setTopQuery(java.lang.String topquery)
public void setDataQuery(java.lang.String dataquery)
public void run(javax.servlet.http.HttpServletRequest request, java.io.Writer writer) throws java.io.IOException, InvalidQueryException, NavigatorRuntimeException
java.io.IOException
InvalidQueryException
NavigatorRuntimeException
protected void initializeContext(javax.servlet.http.HttpServletRequest request)
protected TopicIF getTopic(java.lang.String id)
protected java.lang.String getId(TopicIF topic)
protected java.lang.String getQualifiedId(java.lang.String id)
protected java.lang.String list(java.util.Set nodes)
public java.lang.String toString(TopicIF topic)
protected void renderNode(TopicTreeNode node, java.io.Writer out) throws java.io.IOException
java.io.IOException
protected void renderNodeButton(int topline, int level, int action, java.lang.String id, java.io.Writer out) throws java.io.IOException
java.io.IOException
protected void renderBackButton(java.io.Writer out, int topline) throws java.io.IOException
java.io.IOException
protected void renderExpandAllButton(java.io.Writer out, int topline) throws java.io.IOException
java.io.IOException
protected void renderCloseAllButton(java.io.Writer out, int topline) throws java.io.IOException
java.io.IOException
protected void renderForwardButton(java.io.Writer out, int topline) throws java.io.IOException
java.io.IOException
protected void startRender(java.io.Writer out) throws java.io.IOException
java.io.IOException
protected void endRender(java.io.Writer out) throws java.io.IOException
java.io.IOException
protected java.lang.String makeNodeUrl(TopicTreeNode node)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |