You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by do...@apache.org on 2005/08/12 00:35:13 UTC

svn commit: r231530 - in /beehive/trunk/docs/forrest/release/src/documentation: content/xdocs/pageflow/treeTags.xml content/xdocs/site.xml resources/images/SimpleTreePage.png resources/images/simpleTreeFlow.png resources/images/simpleTreeFlow.vsd

Author: dolander
Date: Thu Aug 11 15:35:07 2005
New Revision: 231530

URL: http://svn.apache.org/viewcvs?rev=231530&view=rev
Log:
Add start of documentation for the Tree tag.


Added:
    beehive/trunk/docs/forrest/release/src/documentation/content/xdocs/pageflow/treeTags.xml   (with props)
    beehive/trunk/docs/forrest/release/src/documentation/resources/images/SimpleTreePage.png   (with props)
    beehive/trunk/docs/forrest/release/src/documentation/resources/images/simpleTreeFlow.png   (with props)
    beehive/trunk/docs/forrest/release/src/documentation/resources/images/simpleTreeFlow.vsd   (with props)
Modified:
    beehive/trunk/docs/forrest/release/src/documentation/content/xdocs/site.xml

Added: beehive/trunk/docs/forrest/release/src/documentation/content/xdocs/pageflow/treeTags.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/docs/forrest/release/src/documentation/content/xdocs/pageflow/treeTags.xml?rev=231530&view=auto
==============================================================================
--- beehive/trunk/docs/forrest/release/src/documentation/content/xdocs/pageflow/treeTags.xml (added)
+++ beehive/trunk/docs/forrest/release/src/documentation/content/xdocs/pageflow/treeTags.xml Thu Aug 11 15:35:07 2005
@@ -0,0 +1,189 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" 
+	"http://forrest.apache.org/dtd/document-v20.dtd">
+<document>
+    <header>
+        <title>Tree Tags</title>
+    </header>
+    <body>
+        <section id="intro">
+            <title>Introduction</title>
+            <p>The following topic explains the tree tags and classes and how they are used to create
+                and render trees.  A tree is rendered in an HTML page based upon an
+                object based representation of the tree.  NetUI defines a set of classes which
+                create a tree structure which is rendered.  The object representation may be created
+                either through NetUI JSP tags found in a JSP page or may be created programatically
+                in a Page Flow.
+            </p>
+
+        </section>
+        <section id="simple_example">
+            <title>Simple Example</title>
+            <p>This section presents a sample of the most basic tree.  The tree is created in a JSP page and
+                displays a simple tree on the page.  The tree itself has a root node with three children.  The
+                root may be expanded and collapsed.  Any of the tree nodes may be selected.
+            </p>
+            <section id="simple_example_code">
+                <title>Simple Example Code</title>
+                <p>
+                    <strong>simpleTree.jsp</strong>
+                </p>
+                <source><![CDATA[
+<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
+<netui:html>
+    <head>
+        <title>SimpleTree</title>
+        <netui:base/>
+    </head>
+    <netui:body>
+        <netui:tree dataSource="pageFlow.simpleTree" selectionAction="postback" tagId="tree">
+            <netui:treeItem expanded="true">
+                <netui:treeLabel>0</netui:treeLabel>
+                <netui:treeItem>
+                    <netui:treeLabel>0.0</netui:treeLabel>
+                </netui:treeItem>
+                <netui:treeItem>0.1</netui:treeItem>
+                <netui:treeItem>0.2</netui:treeItem>
+            </netui:treeItem>
+        </netui:tree>
+    </netui:body>
+</netui:html>
+       ]]></source>
+                <p>The &lt;netui:tree> tag is JSP tag that includes a tree into the page.  It is responsible
+                    for rendering the tree in the generated HTML page.  In this example, the contents of the tree
+                    itself is also
+                    defined in the &lt;netui:tree> tag by using the &lt;netui:treeItem> tags and nesting them
+                    in a tree structure.  In this simple case, the tree has a root (0) with three children (0.0,
+                    0.1, and 0.2).
+                </p>
+                <p> There are two required attributes on the &lt;netui:tree> tag, <strong>dataSource</strong>
+                    and <strong>selectionAction</strong>.  The dataSource is used to bind to a
+                    <strong>TreeElement</strong> based data structure representing the tree to be displayed.
+                    The selectionAction is the action that will be called when a node is selected
+                    in the tree.  It will also be called in some cases when a node in the tree is expanded or
+                    collapsed.
+                </p>
+                <p><strong>Note:</strong>  In the example above, the leaf nodes are defined in two manners.  The
+                    first child (0.0) uses the &lt;netui:treeLabel> to set the nodes label.  The next two
+                    children (0.1 and 0.2) are defined with the label as the body of the &lt;netui:treeItem>. The
+                    treeItem supports setting the label value from the treeItem body only if that treeItem is
+                    a leaf.  You are required to use the &lt;netui:treeLabel> for all interior nodes.  In other
+                    words, &lt;netui:treeItem> does not support mixed content; meaning that interior nodes must use
+                    &lt;netuiLabel> to set the label value and all text inside the body is ignored.
+                </p>
+                <p>
+                    <strong>Controller.jpf</strong>
+                </p>
+                <source><![CDATA[
+package simpleTree;
+
+import org.apache.beehive.netui.pageflow.PageFlowController;
+import org.apache.beehive.netui.pageflow.annotations.Jpf;
+import org.apache.beehive.netui.tags.tree.TreeElement;
+
+@Jpf.Controller(
+    simpleActions={
+        @Jpf.SimpleAction(name="begin", path="simpleTree.jsp"),
+        @Jpf.SimpleAction(name="postback", path="simpleTree.jsp")
+    }
+)
+public class Controller
+    extends PageFlowController
+{
+    private TreeElement _simpleTree;
+
+    public TreeElement getSimpleTree() {
+        return _simpleTree;
+    }
+
+    public void setSimpleTree(TreeElement _simpleTree) {
+        this._simpleTree = _simpleTree;
+    }
+}
+       ]]></source>
+                <p>This very simple Page Flow Controller supports displaying a tree.  There is a single property
+                "simpleTree" which holds a reference to a TreeElement.  This TreeElement represents the root
+                of the underlying tree object structure which is rendered by the &lt;netui:tree> tag.  There are
+                two actions defined, the standard
+                    <strong>begin</strong> action and the
+                    <strong>postback</strong>
+                action.  The
+                    <strong>postback</strong> action is called when a selection or expand link is selected
+                in the rendered tree.
+                </p>
+            </section>
+            <section>
+                <title>Simple Sample Lifecycle</title>
+                <p> This section describes the basic tree lifecycle using the SimpleTree example above.  The
+                    following figure represents the basic lifecycle of a tree being rendered by a &lt;netui:tree>
+                    tag.
+                </p>
+                <p>
+                    <img src="images/simpleTreeFlow.png" alt="Tree Tag Lifecycle"/>
+                </p>
+                <p> The
+                    <strong>dataSource</strong> attribute is a required attribute on all trees.  It binds
+                    to an instance of a
+                    <strong>TreeElement</strong> [defined in
+                    <strong>org.apache.beehive.netui.tags.tree</strong>].  All trees are represented as tree data
+                        structure with a single root.  The dataSource attribute binds to this root.
+                </p>
+                <p>When the &lt;netui:tree> tag begins processing it checks to see if the variable
+                    bound to by the
+                    <strong>dataSource</strong> is equal to null.  If it is, then the tree will
+                    process it's body content to create the tree data structure.  If the
+                    <strong>dataSource</strong>
+                    is not null, then that tree data structure is used to render content.
+                </p>
+                <p>In the simpleTree sample, the first time the page is displayed the body of the tree tag is
+                    processed because the Page Flow property
+                    <strong>simpleTree</strong> is null.  This creates the initial
+                    tree data structure which is then rendered.  When the page is requested
+                    again, for example when a tree element is selected, the tree data structure created on the first
+                    request continues to be used and the body of the &lt;netui:tree> tag is ignored.
+                </p>
+                <p>
+                    <strong>Note:</strong> A very common development task is to iteratively develop the
+                    &lt;netui:tree>'s body content.  In order for any changes to be reflected when the tree is
+                    rendered, the variable bound to by
+                    <strong>dataSource</strong> must be null.  It is
+                    common to add an action to the page flow that will reset the value to null and call
+                    that from a link on a page.  If variable is not null, changes to the JSP page will not be
+                    reflected in the rendered tree.
+                </p>
+            </section>
+        </section>
+        <section>
+            <title>Tree Features</title>
+            <p>This section describes the basic features of the NetUI Tree.  The SimpleTree example introduces the
+                basic mechanics for creating a tree in a Page Flow.  A tree is output into the HTML page as
+                a hiearchy of TreeElements.  The SimpleTree example output the following:
+            </p>
+            <p><img src="images/simpleTreePage.png" alt="Tree Tag Display" /></p>
+            <p>The root of the tree supports expanding and collapsing.  The children of a node appear
+                at the same level.  Trees appear commonly in applications such as file system explorers, and
+                are good at representing limitted hiearchical data sets.
+            </p>
+            <section>
+                <title>TreeElement Rendered Contents</title>
+                <p>This section describes what markup is output to represent the tree.</p>
+            </section>
+            <section>
+                <title>Feature Overview</title>
+                <p>This section describes the overall features of the tree.</p>
+            </section>
+            <section>
+                <title>NetUI Tree Tags</title>
+                <p>This section describes each of the NetUI tags that can be used with the tree.  All of
+                    the tree features are available both in the tree tags as well as the underlying tree
+                    classes (described below).
+                </p>
+            </section>
+            <section>
+                <title>Netui Tree Classes</title>
+                <p>This section describes the underlying classes which represent a tree</p>
+            </section>
+        </section>
+    </body>
+</document>

Propchange: beehive/trunk/docs/forrest/release/src/documentation/content/xdocs/pageflow/treeTags.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: beehive/trunk/docs/forrest/release/src/documentation/content/xdocs/site.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/docs/forrest/release/src/documentation/content/xdocs/site.xml?rev=231530&r1=231529&r2=231530&view=diff
==============================================================================
--- beehive/trunk/docs/forrest/release/src/documentation/content/xdocs/site.xml (original)
+++ beehive/trunk/docs/forrest/release/src/documentation/content/xdocs/site.xml Thu Aug 11 15:35:07 2005
@@ -25,6 +25,7 @@
             <pageflow_datagrid label="Data Grids" href="pageflow/pageflow_datagrid.html"/>
             <pageflow_sharedFlow label="Shared Flow" href="pageflow/sharedFlow.html"/>
             <pageflow_popups label="Popup Windows" href="pageflow/popupWindows.html"/>
+	    <pageflow_tree label="Tree Tags" href="pageflow/treeTags.html" />
             <pageflow_valid label="Validation" href="pageflow/validation.html"/>
             <pageflow_jsf label="Java Server Faces" href="pageflow/jsf.html"/>
             <pageflow_servlet_adapter label="Servlet Container Adapters" href="pageflow/servlet_container_adapters.html"/>

Added: beehive/trunk/docs/forrest/release/src/documentation/resources/images/SimpleTreePage.png
URL: http://svn.apache.org/viewcvs/beehive/trunk/docs/forrest/release/src/documentation/resources/images/SimpleTreePage.png?rev=231530&view=auto
==============================================================================
Binary file - no diff available.

Propchange: beehive/trunk/docs/forrest/release/src/documentation/resources/images/SimpleTreePage.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: beehive/trunk/docs/forrest/release/src/documentation/resources/images/simpleTreeFlow.png
URL: http://svn.apache.org/viewcvs/beehive/trunk/docs/forrest/release/src/documentation/resources/images/simpleTreeFlow.png?rev=231530&view=auto
==============================================================================
Binary file - no diff available.

Propchange: beehive/trunk/docs/forrest/release/src/documentation/resources/images/simpleTreeFlow.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: beehive/trunk/docs/forrest/release/src/documentation/resources/images/simpleTreeFlow.vsd
URL: http://svn.apache.org/viewcvs/beehive/trunk/docs/forrest/release/src/documentation/resources/images/simpleTreeFlow.vsd?rev=231530&view=auto
==============================================================================
Binary file - no diff available.

Propchange: beehive/trunk/docs/forrest/release/src/documentation/resources/images/simpleTreeFlow.vsd
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream