Author: amarkhel
Date: 2009-03-24 14:50:37 -0400 (Tue, 24 Mar 2009)
New Revision: 13161
Added:
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/Help.java
trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/tags/templates/help.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/img/icons/
trunk/test-applications/realworld2/web/src/main/webapp/img/icons/help.gif
trunk/test-applications/realworld2/web/src/main/webapp/includes/help/
trunk/test-applications/realworld2/web/src/main/webapp/includes/help/tree_build_descr.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/help/tree_click_descr.xhtml
Modified:
trunk/test-applications/realworld2/doc/tree_build_descr.xhtml
trunk/test-applications/realworld2/doc/tree_click_descr.xhtml
Log:
Modified: trunk/test-applications/realworld2/doc/tree_build_descr.xhtml
===================================================================
--- trunk/test-applications/realworld2/doc/tree_build_descr.xhtml 2009-03-24 18:47:27 UTC
(rev 13160)
+++ trunk/test-applications/realworld2/doc/tree_build_descr.xhtml 2009-03-24 18:50:37 UTC
(rev 13161)
@@ -8,78 +8,50 @@
<h1> The <rich:tree> component</h1>
<p>The component is designed for hierarchical data presentation and is applied for
building a tree structure. The component also uses built-in drag and drop.</p>
-<p>The <rich:tree> component in the PhotoAlbum application helps to represent
and realize inherently the �Shelves�Albums�Photos� paradigm. Shelf is the highest
possible level in the tree hierarchy. Shelfs are used to group thematic albums and may
contain as many albums as needed. Photos are not represented in the tree because of their
possible big quantities, which can make tree clumsy. Photos by themselves are rendered in
the center of the screen (hereinafter referred to as watching area).</p>
+<p>The <rich:tree> component in the PhotoAlbum application helps to
represent and realize inherently the "Shelves-Albums-Photos" paradigm. Shelf is
the highest possible level in the tree hierarchy. Shelfs are used to group thematic albums
and may contain as many albums as needed. Photos are not represented in the tree because
of their possible big quantities, which can make tree clumsy. Photos by themselves are
rendered in the center of the screen (hereinafter referred to as watching
area).</p>
-<p>Implicitly, the <rich:tree> components takes one of the main position in
the PhotoAlbum and bounded with many application logic. There are several ways to realize
the <rich:tree>. In the current application the <rich:tree> is realized
using model tag <rich:treeNodesAdaptor>.</p>
+<p>Implicitly, the <rich:tree> components takes one of the main
position in the PhotoAlbum and bounded with many application logic. There are several ways
to realize the <rich:tree>. In the current application the
<rich:tree> is realized using model tag
<rich:treeNodesAdaptor>.</p>
-<p>Using the <rich:treeNodesAdaptor> means that the typical hierarchical tree
structure is built on page straight in the component tree. The code snippet below shows
the idea of how the tree can be built on the page with the help of adaptors:</p>
+<p>Using the <rich:treeNodesAdaptor> means that the typical
hierarchical tree structure is built on page straight in the component tree. The code
snippet below shows the idea of how the tree can be built on the page with the help of
adaptors:</p>
-<BLOCKQUOTE>
-<rich:tree>
- <rich:treeNodesAdaptor>
- <rich:treeNode />
+<pre>
+<rich:tree>
+ <rich:treeNodesAdaptor>
+ </rich:treeNode />
- <rich:treeNodesAdaptor>
- <rich:treeNode />
+ <rich:treeNodesAdaptor>
+ </rich:treeNode />
- <rich:treeNodesAdaptor>
- <rich:treeNode />
+ <rich:treeNodesAdaptor>
+ </rich:treeNode />
- <rich:treeNodesAdaptor>
- <rich:treeNode />
- </rich:treeNodesAdaptor>
+ <rich:treeNodesAdaptor>
+ </rich:treeNode />
+ </rich:treeNodesAdaptor>
- </rich:treeNodesAdaptor>
- </rich:treeNodesAdaptor>
- </rich:treeNodesAdaptor>
-</rich:tree>
-</BLOCKQUOTE>
+ </rich:treeNodesAdaptor>
+ </rich:treeNodesAdaptor>
+ </rich:treeNodesAdaptor>
+</rich:tree>
+</pre>
<p>The NodesAdaptors completely repeat the tree hierarchy that takes place in an
application. Adaptors may be nested one into another as deeply as needed. </p>
-<p>When using <rich:treeNodesAdaptor> component there is no need to specify
the "value" and "var" attributes for the <rich:tree>. The values
for nodes to be rendered are passed directly into the corresponding adaptor and the
component do all the necessary iterative job. </p>
+<p>When using <rich:treeNodesAdaptor> component there is no need to
specify the "value" and "var" attributes for the
<rich:tree>. The values for nodes to be rendered are passed directly into
the corresponding adaptor and the component do all the necessary iterative job.
</p>
-<p>The realization of the <rich:tree> in the application is very close to the
model shown above. The <rich:treeNodesAdaptor> component has �nodes� attribute. This
attribute accepts collections that may include lists, arrays, maps, XML NodeList and
NamedNodeMap either as single objects. The top <rich:treeNodesAdaptor> in the
application responses for shelfs rendering. It �nodes� attribute refers to getShelfs()
method of ShelfManager class and gets the collection of shelfs associated with the current
user and all the shared shelfs in the system. Take a look at this method:</p>
+<p>The realization of the <rich:tree> in the application is very
close to the model shown above. The <rich:treeNodesAdaptor>component has
"nodes" attribute. This attribute accepts collections that may include lists,
arrays, maps, XML NodeList and NamedNodeMap either as single objects. The top
<rich:treeNodesAdaptor> in the application responses for shelfs rendering.
It "nodes" attribute refers to getShelfs() method of ShelfManager class and gets
the collection of shelfs associated with the current user and all the shared shelfs in the
system. Take a look at this method:</p>
-<BLOCKQUOTE>
- public List<Shelf> getShelfs(){
+<pre>
+ public List<Shelf> getShelfs(){
if(shelfs == null){
shelfs = shelfAction.getShelfs(user);
}
return shelfs;
}
-</BLOCKQUOTE>
+</pre>
-<p>After the �nodes� attribute of �shelf� <rich:treeNodesAdaptor> receives
the collection of shelfs, it switches to the nested �album� <rich:treeNodesAdaptor>,
which �nodes� attribute refers in it turn to albums field of the Shelf class and takes the
collection of all albums associated with the current shelf. The
<rich:treeNodesAdaptor> renders all the albums that belongs to current iterating
shelf and switches back to the �shelf� adaptor to render and iterate the next shelf in the
received earlier collection. Here is how it looks in the webapp/includes/index/tree.xhtml
file:</p>
-<BLOCKQUOTE>
-<rich:tree id="tree" ...>
- <rich:treeNodesAdaptor nodes="#{shelfManager.getShelfs()}" ...>
- <rich:treeNode reRender="mainArea" ...>
- <rich:dropSupport id="shelfDND" .../>
- <ui:include src="/includes/contextMenu/CMForShelf.xhtml"
>
- <ui:param name="shelf" ... />
- </ui:include>
- <h:outputText value="#{shelf.name}" />
- <h:outputText value=" :: " />
<strong>#{shelfManager.getCountUnvisitedImages(shelf)}
- </strong> new
- <a4j:support reRender="tree, mainArea" .../>
- <a4j:support reRender="tree, mainArea" .../>
- </rich:treeNode>
- <rich:treeNodesAdaptor var="album" ...>
- <rich:treeNode reRender="mainArea" ...>
- <ui:include src="/includes/contextMenu/CMForAlbum.xhtml" >
- <ui:param name="album" ... />
- </ui:include>
- <rich:dndParam name="label" ... />
- <h:outputText value="#{album.name}" />
- <h:outputText value=" :: " />
- <strong>#{albumManager.getCountUnvisitedImages(album)}</strong> new
- <rich:dropSupport id="php" .../>
- <a4j:support reRender="tree, mainArea"
.../>
- <a4j:support reRender="tree, mainArea" .../>
- </rich:treeNode>
- </rich:treeNodesAdaptor>
- </rich:treeNodesAdaptor>
-</rich:tree>
-<BLOCKQUOTE>
+<p>After the "nodes" attribute of "shelf"
<rich:treeNodesAdaptor> receives the collection of shelfs, it switches to
the nested "album" <rich:treeNodesAdaptor>, which
"nodes" attribute refers in it turn to albums field of the Shelf class and takes
the collection of all albums associated with the current shelf. The
<rich:treeNodesAdaptor> renders all the albums that belongs to current
iterating shelf and switches back to the "shelf" adaptor to render and iterate
the next shelf in the received earlier collection. Here is how it looks in the
webapp/includes/index/tree.xhtml file:</p>
+<pre>
+<rich:insert src="/includes/index/tree.xhtml"></rich:insert>
+</pre>
</ui:composition>
\ No newline at end of file
Modified: trunk/test-applications/realworld2/doc/tree_click_descr.xhtml
===================================================================
--- trunk/test-applications/realworld2/doc/tree_click_descr.xhtml 2009-03-24 18:47:27 UTC
(rev 13160)
+++ trunk/test-applications/realworld2/doc/tree_click_descr.xhtml 2009-03-24 18:50:37 UTC
(rev 13161)
@@ -4,8 +4,7 @@
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">
-
-<h1> How the tree built</h1>
-<h1> What happens when click on tree node</h1>
-<BLOCKQUOTE>
+<h1> List of use-cases on rich:tree component:</h1>
+<a4j:commandLink
actionListener="#{help.navigateTo('/includes/help/tree_build_descr.xhtml')}"
reRender="helpForm"> How the tree built</a4j:commandLink><br/>
+<a4j:commandLink
actionListener="#{help.navigateTo('/includes/help/tree_build_descr.xhtml')}"
reRender="helpForm"> What happens when click on tree
node</a4j:commandLink>
</ui:composition>
\ No newline at end of file
Added:
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/Help.java
===================================================================
---
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/Help.java
(rev 0)
+++
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/Help.java 2009-03-24
18:50:37 UTC (rev 13161)
@@ -0,0 +1,26 @@
+package org.richfaces.realworld.util;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.AutoCreate;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+
+@Name("help")
+(a)Scope(ScopeType.CONVERSATION)
+@AutoCreate
+public class Help {
+
+ private String page;
+
+ public String getPage() {
+ return page;
+ }
+
+ public void setPage(String page) {
+ this.page = page;
+ }
+
+ public void navigateTo(String src){
+ this.setPage(src);
+ }
+}
Property changes on:
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/Help.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added:
trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/tags/templates/help.xhtml
===================================================================
(Binary files differ)
Property changes on:
trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/tags/templates/help.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Added: trunk/test-applications/realworld2/web/src/main/webapp/img/icons/help.gif
===================================================================
(Binary files differ)
Property changes on:
trunk/test-applications/realworld2/web/src/main/webapp/img/icons/help.gif
___________________________________________________________________
Name: svn:mime-type
+ image/gif
Added:
trunk/test-applications/realworld2/web/src/main/webapp/includes/help/tree_build_descr.xhtml
===================================================================
(Binary files differ)
Property changes on:
trunk/test-applications/realworld2/web/src/main/webapp/includes/help/tree_build_descr.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Added:
trunk/test-applications/realworld2/web/src/main/webapp/includes/help/tree_click_descr.xhtml
===================================================================
(Binary files differ)
Property changes on:
trunk/test-applications/realworld2/web/src/main/webapp/includes/help/tree_click_descr.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml